Skip to content

Commit fc0b985

Browse files
authored
Merge pull request #679 from plotly/cones-and-tubes
cone and streamtube initial
2 parents f811976 + 278f919 commit fc0b985

File tree

7 files changed

+51
-2
lines changed

7 files changed

+51
-2
lines changed

dev/mocks.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,14 @@
271271
"gl3d_bunny-hull.json",
272272
"gl3d_bunny.json",
273273
"gl3d_chrisp-nan-1.json",
274+
"gl3d_cone-absolute.json",
275+
"gl3d_cone-autorange.json",
276+
"gl3d_cone-lighting.json",
277+
"gl3d_cone-rossler.json",
278+
"gl3d_cone-simple.json",
279+
"gl3d_cone-single.json",
280+
"gl3d_cone-wind.json",
281+
"gl3d_cone-with-streamtube.json",
274282
"gl3d_contour-lines.json",
275283
"gl3d_convex-hull.json",
276284
"gl3d_cube.json",
@@ -301,6 +309,9 @@
301309
"gl3d_set-ranges.json",
302310
"gl3d_snowden.json",
303311
"gl3d_snowden_altered.json",
312+
"gl3d_streamtube-simple.json",
313+
"gl3d_streamtube-thin.json",
314+
"gl3d_streamtube-wind.json",
304315
"gl3d_surface-circular-colorscale.json",
305316
"gl3d_surface-lighting.json",
306317
"gl3d_surface_intensity.json",

src/components/fields/derived.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,17 @@ export const HoverInfo = connectToContainer(UnconnectedFlaglist, {
597597
];
598598
} else if (container.type === 'table') {
599599
plotProps.isVisible = false;
600+
} else if (['cone', 'streamtube'].includes(container.type)) {
601+
options = [
602+
{label: _('X'), value: 'x'},
603+
{label: _('Y'), value: 'y'},
604+
{label: _('Z'), value: 'z'},
605+
{label: _('U'), value: 'u'},
606+
{label: _('V'), value: 'v'},
607+
{label: _('W'), value: 'w'},
608+
{label: _('Norm'), value: 'norm'},
609+
{label: _('Divergence'), value: 'divergence'},
610+
];
600611
}
601612

602613
if (container.text) {

src/components/widgets/TraceTypeSelector.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,10 @@ class TraceTypeSelector extends Component {
117117

118118
let columnClasses = 'trace-grid__column';
119119

120-
if (items.length > MAX_ITEMS) {
120+
if (
121+
(items.length > MAX_ITEMS && !category.maxColumns) ||
122+
(category.maxColumns && category.maxColumns > 1)
123+
) {
121124
columnClasses += ' trace-grid__column--double';
122125
}
123126

src/default_panels/GraphCreatePanel.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ const GraphCreatePanel = (props, {localize: _}) => {
7979
<DataSelector label={_('A')} attr="a" />
8080
<DataSelector label={_('B')} attr="b" />
8181
<DataSelector label={_('C')} attr="c" />
82+
<DataSelector label={_('U')} attr="u" />
83+
<DataSelector label={_('V')} attr="v" />
84+
<DataSelector label={_('W')} attr="w" />
8285
<DataSelector label={_('Headers')} attr="header.values" />
8386
<DataSelector label={_('Columns')} attr="cells.values" />
8487

src/lib/computeTraceOptionsFromSchema.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ function computeTraceOptionsFromSchema(schema, _, context) {
6262
value: 'mesh3d',
6363
label: _('3D Mesh'),
6464
},
65+
{
66+
value: 'cone',
67+
label: _('Cone'),
68+
},
69+
{
70+
value: 'streamtube',
71+
label: _('Streamtube'),
72+
},
6573
{
6674
value: 'scattergeo',
6775
label: _('Atlas Map'),

src/lib/constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export const TRACE_TO_AXIS = {
7070
'histogram2dcontour',
7171
],
7272
ternary: ['scatterternary'],
73-
gl3d: ['scatter3d', 'surface', 'mesh3d'],
73+
gl3d: ['scatter3d', 'surface', 'mesh3d', 'cone', 'streamtube'],
7474
geo: ['scattergeo', 'choropleth'],
7575
mapbox: ['scattermapbox'],
7676
polar: ['scatterpolar', 'scatterpolargl'],

src/lib/traceTypes.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export const chartCategory = _ => {
3131
THREE_D: {
3232
value: '3D',
3333
label: _('3D'),
34+
maxColumns: 1,
3435
},
3536
};
3637
};
@@ -106,6 +107,18 @@ export const traceTypes = _ => [
106107
label: _('3D Mesh'),
107108
category: chartCategory(_).THREE_D,
108109
},
110+
{
111+
value: 'cone',
112+
label: _('Cone'),
113+
icon: 'scatter3d',
114+
category: chartCategory(_).THREE_D,
115+
},
116+
{
117+
value: 'streamtube',
118+
label: _('Streamtube'),
119+
icon: 'line3d',
120+
category: chartCategory(_).THREE_D,
121+
},
109122
{
110123
value: 'box',
111124
label: _('Box'),

0 commit comments

Comments
 (0)