@@ -59,28 +59,18 @@ define([
5959 finish : function ( filesPath , status , error ) {
6060 let { file, path} = filesPath [ 0 ] ;
6161 that . state . data = path ;
62+
6263 that . state . useFile = true ;
64+ $ ( that . wrapSelector ( '.vp-wc-file-option' ) ) . show ( ) ;
6365
6466 // set text
6567 $ ( that . wrapSelector ( '#data' ) ) . val ( path ) ;
66- $ ( that . wrapSelector ( '#useFile' ) ) . prop ( 'checked' , true ) ;
6768 $ ( that . wrapSelector ( '#data' ) ) . trigger ( 'change' ) ;
68- $ ( that . wrapSelector ( '#useFile' ) ) . trigger ( 'change' ) ;
6969 }
7070 } ) ;
7171 fileNavi . open ( ) ;
7272 } ) ;
7373
74- // use file
75- $ ( this . wrapSelector ( '#useFile' ) ) . on ( 'change' , function ( ) {
76- let checked = $ ( this ) . prop ( 'checked' ) ;
77- if ( checked ) {
78- $ ( that . wrapSelector ( '.vp-wc-file-option' ) ) . show ( ) ;
79- } else {
80- $ ( that . wrapSelector ( '.vp-wc-file-option' ) ) . hide ( ) ;
81- }
82- } )
83-
8474 // change tab
8575 $ ( this . wrapSelector ( '.vp-tab-item' ) ) . on ( 'click' , function ( ) {
8676 let type = $ ( this ) . data ( 'type' ) ; // data / wordcloud / plot
@@ -136,7 +126,14 @@ define([
136126 pageThis : this ,
137127 id : 'data' ,
138128 classes : 'vp-state' ,
129+ select : function ( ) {
130+ that . state . useFile = false ;
131+ $ ( that . wrapSelector ( '.vp-wc-file-option' ) ) . hide ( ) ;
132+ } ,
139133 finish : function ( ) {
134+ that . state . useFile = false ;
135+ $ ( that . wrapSelector ( '.vp-wc-file-option' ) ) . hide ( ) ;
136+
140137 $ ( that . wrapSelector ( '#data' ) ) . change ( ) ;
141138 }
142139 } ) ;
@@ -271,9 +268,6 @@ define([
271268 if ( dataType == 'DataFrame' || dataType == 'Series' ) {
272269 dataVariable = data + '.to_string()' ;
273270 }
274- if ( dataType == 'ndarray' ) {
275- dataVariable = data + '.tobytes()' ; // FIXME: use tobytes instead?
276- }
277271 code . appendFormatLine ( "counts = Counter({0}.split())" , dataVariable ) ;
278272 code . appendFormatLine ( "tags = counts.most_common({0})" , wordCount ) ;
279273 code . appendLine ( ) ;
0 commit comments