Skip to content

Commit b3f0d5d

Browse files
Merge pull request #812 from plotly/alltracetypes
include all trace types in constants
2 parents 74e6d4a + 95ea13b commit b3f0d5d

File tree

3 files changed

+54
-35
lines changed

3 files changed

+54
-35
lines changed

src/lib/constants.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ export const TRACE_TO_AXIS = {
6868
'histogram',
6969
'histogram2d',
7070
'histogram2dcontour',
71+
'carpet',
72+
'scattercarpet',
73+
'contourcarpet',
7174
],
7275
ternary: ['scatterternary'],
7376
gl3d: ['scatter3d', 'surface', 'mesh3d', 'cone', 'streamtube'],

src/lib/getAllAxes.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,7 @@ export function traceTypeToAxisType(traceType, subplot = false) {
6767
return category;
6868
}
6969

70-
if (traceType === 'pie' || traceType === 'table') {
71-
return null;
72-
}
73-
74-
throw new Error(`Sorry, could not find ${traceType} in any category.`);
70+
return null;
7571
}
7672

7773
export function axisIdToAxisName(id) {

src/lib/traceTypes.js

Lines changed: 50 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ export const chartCategory = _ => {
88
value: 'SIMPLE',
99
label: _('Simple'),
1010
},
11-
CHARTS_3D: {
12-
value: 'CHARTS_3D',
13-
label: _('3D charts'),
14-
},
1511
FINANCIAL: {
1612
value: 'FINANCIAL',
1713
label: _('Finance'),
@@ -33,6 +29,10 @@ export const chartCategory = _ => {
3329
label: _('3D'),
3430
maxColumns: 1,
3531
},
32+
HIDDEN: {
33+
value: 'HIDDEN',
34+
label: '',
35+
},
3636
};
3737
};
3838

@@ -157,21 +157,6 @@ export const traceTypes = _ => [
157157
label: _('Atlas Map'),
158158
category: chartCategory(_).MAPS,
159159
},
160-
// {
161-
// value: 'parcoords',
162-
// label: _('Parallel Coordinates'),
163-
// category: chartCategory(_).SPECIALIZED,
164-
// },
165-
// {
166-
// value: 'sankey',
167-
// label: _('Sankey'),
168-
// category: chartCategory(_).SPECIALIZED,
169-
// },
170-
// {
171-
// value: 'carpet',
172-
// label: _('Carpet'),
173-
// category: chartCategory(_).SPECIALIZED,
174-
// },
175160
{
176161
value: 'scatterpolar',
177162
label: _('Polar Scatter'),
@@ -197,11 +182,6 @@ export const traceTypes = _ => [
197182
label: _('OHLC'),
198183
category: chartCategory(_).FINANCIAL,
199184
},
200-
// {
201-
// value: 'pointcloud',
202-
// label: _('Point Cloud'),
203-
// category: chartCategory(_).THREE_D,
204-
// },
205185
{
206186
value: 'scattergl',
207187
icon: 'scatter',
@@ -214,10 +194,50 @@ export const traceTypes = _ => [
214194
label: _('Polar Scatter'),
215195
category: chartCategory(_).THREE_D,
216196
},
217-
// {
218-
// value: 'heatmapgl',
219-
// icon: 'heatmap',
220-
// label: _('Heatmap GL'),
221-
// category: chartCategory(_).THREE_D,
222-
// },
197+
{
198+
value: 'heatmapgl',
199+
icon: 'heatmap',
200+
label: _('Heatmap GL'),
201+
category: chartCategory(_).HIDDEN,
202+
},
203+
{
204+
value: 'pointcloud',
205+
label: _('Point Cloud'),
206+
category: chartCategory(_).HIDDEN,
207+
},
208+
{
209+
value: 'parcoords',
210+
label: _('Parallel Coordinates'),
211+
category: chartCategory(_).HIDDEN,
212+
},
213+
{
214+
value: 'parcats',
215+
label: _('Parallel Categories'),
216+
category: chartCategory(_).HIDDEN,
217+
},
218+
{
219+
value: 'splom',
220+
label: _('Scatterplot Matrix'),
221+
category: chartCategory(_).HIDDEN,
222+
},
223+
{
224+
value: 'sankey',
225+
label: _('Sankey'),
226+
category: chartCategory(_).HIDDEN,
227+
},
228+
{
229+
value: 'scattercarpet',
230+
label: _('Scatter Carpet'),
231+
category: chartCategory(_).HIDDEN,
232+
},
233+
{
234+
value: 'contourcarpet',
235+
label: _('Contour Carpet'),
236+
category: chartCategory(_).HIDDEN,
237+
},
238+
{
239+
value: 'carpet',
240+
label: _('Carpet'),
241+
category: chartCategory(_).HIDDEN,
242+
},
223243
];

0 commit comments

Comments
 (0)