Skip to content

Commit 62cbb9f

Browse files
committed
violins initial
1 parent 215e856 commit 62cbb9f

File tree

4 files changed

+65
-5
lines changed

4 files changed

+65
-5
lines changed

src/default_panels/StyleTracesPanel.js

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,27 @@ const StyleTracesPanel = (props, {localize: _}) => (
395395
]}
396396
/>
397397
</PlotlySection>
398+
<PlotlySection name={_('Scaling')}>
399+
<Numeric label={_('Bandwidth')} attr="bandwidth" />
400+
<Radio
401+
label="Scale Mode"
402+
attr="scalemode"
403+
options={[
404+
{label: _('Width'), value: 'width'},
405+
{label: _('Count'), value: 'count'},
406+
]}
407+
/>
408+
<Radio
409+
label="Span Mode"
410+
attr="spanmode"
411+
options={[
412+
{label: _('Soft'), value: 'soft'},
413+
{label: _('Hard'), value: 'hard'},
414+
{label: _('Manual'), value: 'manual'},
415+
]}
416+
/>
417+
<Numeric label={_('Span')} attr="span" />
418+
</PlotlySection>
398419
<PlotlySection name={_('Highlight')}>
399420
<Radio
400421
attr="boxmean"
@@ -412,6 +433,37 @@ const StyleTracesPanel = (props, {localize: _}) => (
412433
{label: _('Hide'), value: false},
413434
]}
414435
/>
436+
<Radio
437+
attr="box.visible"
438+
label={_('Box Visible')}
439+
options={[
440+
{label: _('Show'), value: true},
441+
{label: _('Hide'), value: false},
442+
]}
443+
/>
444+
<NumericFraction label={_('Box Width')} attr="box.width" />
445+
<ColorPicker label={_('Box Fill Color')} attr="box.color" />
446+
<NumericFraction label={_('Box Line Width')} attr="box.line.width" />
447+
<ColorPicker label={_('Box Line Color')} attr="box.line.color" />
448+
<Radio
449+
attr="meanline.visible"
450+
label={_('Meanline Visible')}
451+
options={[
452+
{label: _('Show'), value: true},
453+
{label: _('Hide'), value: false},
454+
]}
455+
/>
456+
<NumericFraction label={_('Meanline Width')} attr="meanline.width" />
457+
<ColorPicker label={_('Meanline Color')} attr="meanline.color" />
458+
<Radio
459+
attr="side"
460+
label={_('Density Function Side')}
461+
options={[
462+
{label: _('Both'), value: 'both'},
463+
{label: _('Positive'), value: 'positive'},
464+
{label: _('Negative'), value: 'negative'},
465+
]}
466+
/>
415467
</PlotlySection>
416468
<PlotlySection name={_('On Hover')}>
417469
<HoverInfo attr="hoverinfo" label={_('Values Shown On Hover')} />

src/lib/constants.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export const TRACE_TO_AXIS = {
5858
'scatter',
5959
'scattergl',
6060
'box',
61+
'violin',
6162
'bar',
6263
'heatmap',
6364
'heatmapgl',

src/lib/customTraceType.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ export function traceTypeToPlotlyInitFigure(traceType) {
4949
type: 'box',
5050
boxpoints: false,
5151
};
52+
case 'violin':
53+
return {
54+
type: 'violin',
55+
box: {visible: false},
56+
meanline: {visible: false},
57+
bandwidth: 0,
58+
};
5259
case 'line3d':
5360
return {
5461
type: 'scatter3d',

src/lib/traceTypes.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,11 @@ export const traceTypes = _ => [
126126
label: _('2D Contour Histogram'),
127127
category: chartCategory(_).DISTRIBUTIONS,
128128
},
129-
// {
130-
// value: 'violin',
131-
// label: _('Violin'),
132-
// category: chartCategory(_).DISTRIBUTIONS,
133-
// },
129+
{
130+
value: 'violin',
131+
label: _('Violin'),
132+
category: chartCategory(_).DISTRIBUTIONS,
133+
},
134134
{
135135
value: 'choropleth',
136136
label: _('Choropleth'),

0 commit comments

Comments
 (0)