@@ -49,6 +49,12 @@ define([
4949 // specify pandas object types
5050 this . pdObjTypes = [ 'DataFrame' , 'Series' ] ;
5151 this . allowSubsetTypes = [ 'subset' , 'iloc' , 'loc' , 'query' ] ;
52+ this . subsetLabels = {
53+ 'subset' : 'subset' ,
54+ 'iloc' : 'iloc (integer location)' ,
55+ 'loc' : 'loc (location)' ,
56+ 'query' : 'query'
57+ } ;
5258 if ( this . prop . allowSubsetTypes ) {
5359 this . allowSubsetTypes = this . prop . allowSubsetTypes ;
5460 }
@@ -160,12 +166,14 @@ define([
160166 }
161167 renderSubsetType ( dataType ) {
162168 var subsetType = this . state . subsetType ;
169+ let that = this ;
163170
164171 var tag = new com_String ( ) ;
165172 tag . appendFormatLine ( '<select class="{0} {1}">' , VP_DS_SUBSET_TYPE , 'vp-select' ) ;
166173 this . allowSubsetTypes . forEach ( thisType => {
167174 if ( thisType != 'query' || dataType == 'DataFrame' ) {
168- tag . appendFormatLine ( '<option value="{0}" {1}>{2}</option>' , thisType , subsetType == thisType ?'selected' :'' , thisType ) ;
175+ let label = that . subsetLabels [ thisType ] ;
176+ tag . appendFormatLine ( '<option value="{0}" {1}>{2}</option>' , thisType , subsetType == thisType ?'selected' :'' , label ) ;
169177 }
170178 } ) ;
171179 // tag.appendFormatLine('<option value="{0}" {1}>{2}</option>', 'subset', subsetType == 'subset'?'selected':'', 'subset');
@@ -619,7 +627,7 @@ define([
619627 * - render on VP_DS_PANDAS_OBJECT
620628 */
621629 loadVariables ( ) {
622- var that = this ;
630+ let that = this ;
623631 var types = that . pdObjTypes ;
624632 var prevValue = this . state . pandasObject ;
625633
@@ -688,7 +696,7 @@ define([
688696 }
689697 }
690698 loadSubsetType ( dataType ) {
691- var that = this ;
699+ let that = this ;
692700 $ ( this . wrapSelector ( '.' + VP_DS_SUBSET_TYPE ) ) . replaceWith ( function ( ) {
693701 return that . renderSubsetType ( dataType ) ;
694702 } ) ;
0 commit comments