Skip to content

Commit b9f6ef9

Browse files
Merge pull request #734 from plotly/conetube
patches for creating cones and tubes from scratch
2 parents 48baa8a + d779826 commit b9f6ef9

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

src/default_panels/GraphCreatePanel.js

+3
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ const GraphCreatePanel = (props, {localize: _, setPanel}) => {
102102
<DataSelector label={_('U')} attr="u" />
103103
<DataSelector label={_('V')} attr="v" />
104104
<DataSelector label={_('W')} attr="w" />
105+
<DataSelector label={_('X start')} attr="starts.x" />
106+
<DataSelector label={_('Y start')} attr="starts.y" />
107+
<DataSelector label={_('Z start')} attr="starts.z" />
105108
<DataSelector label={_('Headers')} attr="header.values" />
106109
<DataSelector label={_('Columns')} attr="cells.values" />
107110

src/default_panels/StyleTracesPanel.js

+20
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,25 @@ const StyleTracesPanel = (props, {localize: _}) => (
4949
options={[{label: _('Show'), value: true}, {label: _('Hide'), value: false}]}
5050
/>
5151
<NumericFraction label={_('Trace Opacity')} attr="opacity" />
52+
<PlotlySection name={_('Cones & Streamtubes')}>
53+
<Numeric label={_('Size')} attr="sizeref" />
54+
<Dropdown
55+
label={_('Size Mode')}
56+
options={[{label: _('scaled'), value: 'scaled'}, {label: _('absolute'), value: 'absolute'}]}
57+
attr="sizemode"
58+
/>
59+
<Dropdown
60+
label={_('Cone Anchor')}
61+
options={[
62+
{label: _('Tip'), value: 'tip'},
63+
{label: _('Tail'), value: 'tail'},
64+
{label: _('Center'), value: 'center'},
65+
{label: _('Center of Mass'), value: 'cm'},
66+
]}
67+
attr="anchor"
68+
/>
69+
<Numeric label={_('Max Tube segments')} attr="maxdisplayed" />
70+
</PlotlySection>
5271
<MultiColorPicker label={_('Color')} attr="color" />
5372
<TraceTypeSection name={_('Pie Colors')} traceTypes={['pie']} mode="trace">
5473
<LayoutSection attr="name">
@@ -222,6 +241,7 @@ const StyleTracesPanel = (props, {localize: _}) => (
222241
<SymbolSelector label={_('Symbol')} attr="marker.symbol" />
223242
<Numeric label={_('Border Width')} attr="marker.line.width" />
224243
<MultiColorPicker label={_('Border Color')} attr="marker.line.color" />
244+
<Numeric label={_('Max Number of Points')} attr="marker.maxdisplayed" />
225245
</TraceMarkerSection>
226246

227247
<TraceTypeSection

src/lib/customTraceType.js

+5
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ export function traceTypeToPlotlyInitFigure(traceType, gl = '') {
9292
orientation: 'v',
9393
type: 'bar',
9494
};
95+
case 'cone':
96+
return {
97+
sizeref: 1,
98+
type: 'cone',
99+
};
95100
default:
96101
return {type: traceType};
97102
}

0 commit comments

Comments
 (0)