@@ -117,9 +117,11 @@ define([
117
117
if ( type == 'concat' ) {
118
118
$ ( that . wrapSelector ( '.vp-bd-type-box.concat' ) ) . show ( ) ;
119
119
$ ( that . wrapSelector ( '.vp-bd-type-box.merge' ) ) . hide ( ) ;
120
+ $ ( that . wrapSelector ( '#vp_bdWithoutColumn' ) ) . hide ( ) ;
120
121
} else {
121
122
$ ( that . wrapSelector ( '.vp-bd-type-box.merge' ) ) . show ( ) ;
122
123
$ ( that . wrapSelector ( '.vp-bd-type-box.concat' ) ) . hide ( ) ;
124
+ $ ( that . wrapSelector ( '#vp_bdWithoutColumn' ) ) . show ( ) ;
123
125
}
124
126
// clear user option
125
127
$ ( that . wrapSelector ( '#vp_bdUserOption' ) ) . val ( '' ) ;
@@ -380,6 +382,13 @@ define([
380
382
render ( ) {
381
383
super . render ( ) ;
382
384
385
+ // check its type
386
+ if ( this . state . type === 'concat' ) {
387
+ $ ( this . wrapSelector ( '#vp_bdWithoutColumn' ) ) . hide ( ) ;
388
+ } else {
389
+ $ ( this . wrapSelector ( '#vp_bdWithoutColumn' ) ) . hide ( ) ;
390
+ }
391
+
383
392
this . loadVariableList ( ) ;
384
393
}
385
394
@@ -389,20 +398,6 @@ define([
389
398
* @param {string } defaultValue previous value
390
399
*/
391
400
renderVariableList ( id , varList , defaultValue = '' ) {
392
- // var tag = new com_String();
393
- // tag.appendFormatLine('<select id="{0}">', id);
394
- // varList.forEach(vObj => {
395
- // // varName, varType
396
- // var label = vObj.varName;
397
- // tag.appendFormatLine('<option value="{0}" data-type="{1}" {2}>{3}</option>'
398
- // , vObj.varName, vObj.varType
399
- // , defaultValue == vObj.varName?'selected':''
400
- // , label);
401
- // });
402
- // tag.appendLine('</select>'); // VP_VS_VARIABLES
403
- // $(this.wrapSelector('#' + id)).replaceWith(function() {
404
- // return tag.toString();
405
- // });
406
401
let mappedList = varList . map ( obj => { return { label : obj . varName , value : obj . varName , dtype : obj . varType } } ) ;
407
402
408
403
var variableInput = new SuggestInput ( ) ;
@@ -420,7 +415,7 @@ define([
420
415
/**
421
416
* Load variable list (dataframe)
422
417
*/
423
- loadVariableList ( ) {
418
+ loadVariableList ( ) {
424
419
var that = this ;
425
420
// load using kernel
426
421
var dataTypes = [ 'DataFrame' ] ;
@@ -476,6 +471,13 @@ define([
476
471
code . append ( ', sort=True' ) ;
477
472
}
478
473
474
+ //====================================================================
475
+ // Reset index
476
+ //====================================================================
477
+ if ( resetIndex ) {
478
+ code . append ( ', ignore_index=True' ) ;
479
+ }
480
+
479
481
//====================================================================
480
482
// User option
481
483
//====================================================================
@@ -538,16 +540,16 @@ define([
538
540
}
539
541
540
542
code . append ( ')' ) ;
541
- }
542
543
543
- //====================================================================
544
- // Reset index
545
- //====================================================================
546
- if ( resetIndex ) {
547
- if ( withoutColumn === 'True' ) {
548
- code . append ( '.reset_index(drop=True)' ) ;
549
- } else {
550
- code . append ( '.reset_index()' ) ;
544
+ //====================================================================
545
+ // Reset index
546
+ //====================================================================
547
+ if ( resetIndex ) {
548
+ if ( withoutColumn === 'True' ) {
549
+ code . append ( '.reset_index(drop=True)' ) ;
550
+ } else {
551
+ code . append ( '.reset_index()' ) ;
552
+ }
551
553
}
552
554
}
553
555
0 commit comments