From e2ecd3286a0a472b6b737bcc9f6e733275d96f7f Mon Sep 17 00:00:00 2001 From: dmt0 Date: Wed, 10 Apr 2019 14:55:53 -0400 Subject: [PATCH 1/7] Enable text for choropleth --- src/default_panels/StyleTracesPanel.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/default_panels/StyleTracesPanel.js b/src/default_panels/StyleTracesPanel.js index 0ad4f7efe..f7d89c75a 100644 --- a/src/default_panels/StyleTracesPanel.js +++ b/src/default_panels/StyleTracesPanel.js @@ -487,6 +487,7 @@ const StyleTracesPanel = (props, {localize: _}) => ( 'scatter3d', 'scatterternary', 'bar', + 'choropleth', 'scattergeo', 'scattermapbox', 'sunburst', From 197378273870d1f60db539c860a1ca4355a6b227 Mon Sep 17 00:00:00 2001 From: dmt0 Date: Wed, 10 Apr 2019 14:56:00 -0400 Subject: [PATCH 2/7] Add choropleth mock --- dev/mocks.json | 1 + dev/percy/choropleth.json | 42 +++++++++++++++++++++++++++++++++++++++ dev/percy/index.js | 1 + src/__stories__/index.js | 1 + 4 files changed, 45 insertions(+) create mode 100644 dev/percy/choropleth.json 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() { From 8b12d1664dab5700cf5b7328bbc0789e358e6308 Mon Sep 17 00:00:00 2001 From: dmt0 Date: Wed, 10 Apr 2019 15:23:45 -0400 Subject: [PATCH 3/7] Enable text attr for all traces that implement it --- src/default_panels/StyleTracesPanel.js | 33 +++++++++++++------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/src/default_panels/StyleTracesPanel.js b/src/default_panels/StyleTracesPanel.js index f7d89c75a..60e7279aa 100644 --- a/src/default_panels/StyleTracesPanel.js +++ b/src/default_panels/StyleTracesPanel.js @@ -46,6 +46,10 @@ import { HoveronDropdown, LevelRendered, } from '../components/fields/derived'; +import {traceTypes} from 'lib/traceTypes'; +import localize from 'lib/localize'; + +const allTraceTypes = traceTypes(localize).map(({value}) => value); const StyleTracesPanel = (props, {localize: _}) => ( @@ -477,22 +481,19 @@ const StyleTracesPanel = (props, {localize: _}) => ( + ![ + 'histogram2d', + 'histogram2dcontour', + 'parcoords', + 'parcats', + 'sankey', + 'table', + 'scattercarpet', + 'carpet', + ].includes(t) + )} mode="trace" > From 7ba258a98be7200b33dbed30b867de5e278202ac Mon Sep 17 00:00:00 2001 From: dmt0 Date: Wed, 10 Apr 2019 15:23:49 -0400 Subject: [PATCH 4/7] Small refactor --- src/lib/constants.js | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) 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); From 61338c3cf0436ffd10c416cf05f21f3e2df62b5b Mon Sep 17 00:00:00 2001 From: dmt0 Date: Wed, 10 Apr 2019 15:34:20 -0400 Subject: [PATCH 5/7] Enable line attr for more trace types --- src/default_panels/StyleTracesPanel.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/default_panels/StyleTracesPanel.js b/src/default_panels/StyleTracesPanel.js index 60e7279aa..e74b0703f 100644 --- a/src/default_panels/StyleTracesPanel.js +++ b/src/default_panels/StyleTracesPanel.js @@ -439,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" > From e0fcef0023b60f26951bebbc8da2b0ff17f31bed Mon Sep 17 00:00:00 2001 From: dmt0 Date: Wed, 10 Apr 2019 16:27:17 -0400 Subject: [PATCH 6/7] Add hoverlabel.align --- src/default_panels/StyleLayoutPanel.js | 10 ++++++++++ 1 file changed, 10 insertions(+) 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: _}) => ( + Date: Wed, 10 Apr 2019 21:31:36 -0400 Subject: [PATCH 7/7] Add hoverlabel.align to trace panel --- src/default_panels/StyleTracesPanel.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/default_panels/StyleTracesPanel.js b/src/default_panels/StyleTracesPanel.js index e74b0703f..32951e6e1 100644 --- a/src/default_panels/StyleTracesPanel.js +++ b/src/default_panels/StyleTracesPanel.js @@ -747,6 +747,16 @@ const StyleTracesPanel = (props, {localize: _}) => ( +