diff --git a/dev/mocks.json b/dev/mocks.json index 505f8da91..7b47dd749 100644 --- a/dev/mocks.json +++ b/dev/mocks.json @@ -10,6 +10,7 @@ "/percy/waterfall.json", "/percy/sunburst.json", "/percy/sankey.json", + "/percy/choropleth.json", "0.json", "1.json", "10.json", diff --git a/dev/percy/choropleth.json b/dev/percy/choropleth.json new file mode 100644 index 000000000..f6cff42e3 --- /dev/null +++ b/dev/percy/choropleth.json @@ -0,0 +1,42 @@ +{ + "data": [ + { + "zmax": 1000, + "colorscale": "RdBu", + "zmin": -1000, + "locations": [ + "AGO", + "ALB", + "ARE" + ], + "locationssrc": "x1", + "z": [ + -639.491311425916, + 21.2123434330386, + -179.388449582104 + ], + "zsrc": "x1", + "text": [ + "AGO", + "ALB", + "ARE" + ], + "textsrc": "x1", + "type": "choropleth", + "zauto": false, + "hoverinfo": "text" + } + ], + "layout": { + "autosize": true, + "showlegend": false, + "geo": { + "showcountries": true, + "showocean": true, + "showland": true, + "showlakes": true, + "showrivers": true + } + }, + "frames": [] +} diff --git a/dev/percy/index.js b/dev/percy/index.js index 8984d6a7a..246082d0f 100644 --- a/dev/percy/index.js +++ b/dev/percy/index.js @@ -8,3 +8,4 @@ export {default as box} from './box.json'; export {default as waterfall} from './waterfall.json'; export {default as sunburst} from './sunburst.json'; export {default as sankey} from './sankey.json'; +export {default as choropleth} from './choropleth.json'; diff --git a/src/__stories__/index.js b/src/__stories__/index.js index 5934c2221..782ab2bbb 100644 --- a/src/__stories__/index.js +++ b/src/__stories__/index.js @@ -27,6 +27,7 @@ const panelsToTest = { waterfall: ['GraphCreatePanel', 'StyleTracesPanel'], sunburst: ['GraphCreatePanel', 'StyleTracesPanel'], sankey: ['GraphCreatePanel', 'StyleTracesPanel'], + choropleth: ['GraphCreatePanel', 'GraphSubplotsPanel', 'StyleTracesPanel'], }; window.URL.createObjectURL = function() { diff --git a/src/default_panels/StyleLayoutPanel.js b/src/default_panels/StyleLayoutPanel.js index 288c936fc..b47634874 100644 --- a/src/default_panels/StyleLayoutPanel.js +++ b/src/default_panels/StyleLayoutPanel.js @@ -144,6 +144,16 @@ const StyleLayoutPanel = (props, {localize: _}) => ( + value); const StyleTracesPanel = (props, {localize: _}) => ( @@ -435,12 +439,19 @@ const StyleTracesPanel = (props, {localize: _}) => ( 'scatterternary', 'scatterpolar', 'scatterpolargl', + 'box', + 'violin', 'scatter3d', 'scattergl', 'scattergeo', + 'parcoords', + 'parcats', 'scattermapbox', - 'box', - 'violin', + 'scattercarpet', + 'contourcarpet', + 'ohlc', + 'candlestick', + 'histogram2dcontour', ]} mode="trace" > @@ -477,21 +488,19 @@ const StyleTracesPanel = (props, {localize: _}) => ( + ![ + 'histogram2d', + 'histogram2dcontour', + 'parcoords', + 'parcats', + 'sankey', + 'table', + 'scattercarpet', + 'carpet', + ].includes(t) + )} mode="trace" > @@ -738,6 +747,16 @@ const StyleTracesPanel = (props, {localize: _}) => ( + diff --git a/src/lib/constants.js b/src/lib/constants.js index 8d31eb5ff..98d0e2805 100644 --- a/src/lib/constants.js +++ b/src/lib/constants.js @@ -142,17 +142,4 @@ export const COLORS = { black: '#000000', }; -export const DEFAULT_COLORS = [ - COLORS.charcoal, - COLORS.white, - COLORS.mutedBlue, - COLORS.safetyOrange, - COLORS.cookedAsparagusGreen, - COLORS.brickRed, - COLORS.mutedPurple, - COLORS.chestnutBrown, - COLORS.raspberryYogurtPink, - COLORS.middleGray, - COLORS.curryYellowGreen, - COLORS.blueTeal, -]; +export const DEFAULT_COLORS = Object.values(COLORS);