@@ -49,6 +49,12 @@ define([
49
49
// specify pandas object types
50
50
this . pdObjTypes = [ 'DataFrame' , 'Series' ] ;
51
51
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
+ } ;
52
58
if ( this . prop . allowSubsetTypes ) {
53
59
this . allowSubsetTypes = this . prop . allowSubsetTypes ;
54
60
}
@@ -160,12 +166,14 @@ define([
160
166
}
161
167
renderSubsetType ( dataType ) {
162
168
var subsetType = this . state . subsetType ;
169
+ let that = this ;
163
170
164
171
var tag = new com_String ( ) ;
165
172
tag . appendFormatLine ( '<select class="{0} {1}">' , VP_DS_SUBSET_TYPE , 'vp-select' ) ;
166
173
this . allowSubsetTypes . forEach ( thisType => {
167
174
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 ) ;
169
177
}
170
178
} ) ;
171
179
// tag.appendFormatLine('<option value="{0}" {1}>{2}</option>', 'subset', subsetType == 'subset'?'selected':'', 'subset');
@@ -619,7 +627,7 @@ define([
619
627
* - render on VP_DS_PANDAS_OBJECT
620
628
*/
621
629
loadVariables ( ) {
622
- var that = this ;
630
+ let that = this ;
623
631
var types = that . pdObjTypes ;
624
632
var prevValue = this . state . pandasObject ;
625
633
@@ -688,7 +696,7 @@ define([
688
696
}
689
697
}
690
698
loadSubsetType ( dataType ) {
691
- var that = this ;
699
+ let that = this ;
692
700
$ ( this . wrapSelector ( '.' + VP_DS_SUBSET_TYPE ) ) . replaceWith ( function ( ) {
693
701
return that . renderSubsetType ( dataType ) ;
694
702
} ) ;
0 commit comments