Skip to content

Commit dd1c065

Browse files
author
minjk-bl
committed
Add DataSelector to PandasPlot app
1 parent c1147ae commit dd1c065

File tree

2 files changed

+43
-2
lines changed

2 files changed

+43
-2
lines changed

data/libraries.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2154,8 +2154,7 @@
21542154
"tag" : "PANDAS PLOT,PANDAS",
21552155
"path" : "visualpython - library - pandas - plot",
21562156
"desc" : "Pandas Plot",
2157-
"file" : "m_library/m_pandas/plot",
2158-
"useAuto" : true
2157+
"file" : "m_library/m_pandas/PandasPlot"
21592158
},
21602159
{
21612160
"id" : "pdPkg_inputOutput",

js/m_library/m_pandas/PandasPlot.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Project Name : Visual Python
3+
* Description : GUI-based Python code generator
4+
* File Name : PandasPlot.js
5+
* Author : Black Logic
6+
* Note : Library Component
7+
* License : GNU GPLv3 with Visual Python special exception
8+
* Date : 2022. 06. 22
9+
* Change Date :
10+
*/
11+
12+
//============================================================================
13+
// [CLASS] PandasPlot
14+
//============================================================================
15+
define([
16+
'vp_base/js/com/component/LibraryComponent',
17+
'vp_base/js/com/component/DataSelector'
18+
], function(LibraryComponent, DataSelector) {
19+
/**
20+
* PandasPlot
21+
*/
22+
class PandasPlot extends LibraryComponent {
23+
_init() {
24+
super._init();
25+
26+
this.state = {
27+
i0: '',
28+
o0: '',
29+
...this.state
30+
}
31+
}
32+
render() {
33+
super.render();
34+
35+
// add data selector
36+
let dataSelector = new DataSelector({ pageThis: this, id: 'i0', value: this.state.i0, required: true });
37+
$(this.wrapSelector('#i0')).replaceWith(dataSelector.toTagString());
38+
}
39+
}
40+
41+
return PandasPlot;
42+
});

0 commit comments

Comments
 (0)