Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1b8cc36

Browse files
author
minjk-bl
committed
Add orient option to barplot on Seaborn
1 parent20ba6f3 commit1b8cc36

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

‎visualpython/data/m_visualize/seabornLibrary.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,14 @@ define([
148148
},
149149
'barplot':{
150150
name:'Bar Plot',
151-
code:'${allocateTo} = sns.barplot(${data}${x}${y}${hue}${etc})',
151+
code:'${allocateTo} = sns.barplot(${data}${x}${y}${hue}${orient}${etc})',
152152
description:'Show point estimates and confidence intervals as rectangular bars.',
153153
options:[
154154
{name:'data',component:['var_select'],var_type:['DataFrame','Series','list'],usePair:true},
155155
{name:'x',component:['col_select'],usePair:true},
156156
{name:'y',component:['col_select'],usePair:true},
157157
{name:'hue',component:['col_select'],usePair:true},
158+
{name:'orient',component:['option_select'],usePair:true},
158159
{name:'allocateTo',label:'Allocate To',component:['input'],usePair:true}
159160
]
160161
},

‎visualpython/html/m_visualize/seaborn.html‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,14 @@
100100
<labelfor="bins"class="vp-bold">Bins</label>
101101
<inputtype="number"class="vp-input vp-state"id="bins"placeholder="Type bins"step="5"min="0"/>
102102
</div>
103+
<divclass="vp-grid-box sb-option">
104+
<labelfor="orient"class="vp-bold">Orient</label>
105+
<selectid="orient"class="vp-select vp-state">
106+
<optionvalue="">Select option...</option>
107+
<optionvalue="'v'">Vertical</option>
108+
<optionvalue="'h'">Horizontal</option>
109+
</select>
110+
</div>
103111
<divclass="vp-grid-box sb-option">
104112
<labelfor="kde"class="vp-bold">Kde</label>
105113
<selectid="kde"class="vp-select vp-state">

‎visualpython/js/m_visualize/Seaborn.js‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ define([
3232

3333
this.config.dataview=false;
3434
this.config.size={width:1064,height:550};
35+
this.config.autoScroll=false;
3536
this.config.checkModules=['plt','sns'];
3637
this.config.docs='https://seaborn.pydata.org/index.html';
3738

@@ -201,6 +202,7 @@ define([
201202
$(that.wrapSelector('#kde')).closest('.sb-option').show();
202203
$(that.wrapSelector('#stat')).closest('.sb-option').show();
203204
}elseif(chartType=='barplot'){
205+
$(that.wrapSelector('#orient')).closest('.sb-option').show();
204206
$(that.wrapSelector('#showValues')).closest('.sb-option').show();
205207
$(that.wrapSelector('#errorbar')).closest('.sb-option').show();
206208
if(that.state.setXY===false){
@@ -547,6 +549,7 @@ define([
547549
$(page).find('#kde').closest('.sb-option').show();
548550
$(page).find('#stat').closest('.sb-option').show();
549551
}elseif(this.state.chartType=='barplot'){
552+
$(page).find('#orient').closest('.sb-option').show();
550553
$(page).find('#showValues').closest('.sb-option').show();
551554
$(page).find('#errorbar').closest('.sb-option').show();
552555
if(this.state.setXY===false){
@@ -890,7 +893,7 @@ define([
890893

891894
generateCode(preview=false){
892895
let{
893-
chartType, data, x, y, setXY, hue, kde, stat,
896+
chartType, data, x, y, setXY, hue,orient,kde, stat,
894897
showValues, showValuesPrecision, errorbar,
895898
sortType, sortBy, sortHue, sortHueText,
896899
userOption='',

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp