From 25416c96b3e1d265ac2c82a61d4820987c8c4a70 Mon Sep 17 00:00:00 2001 From: Nicolas Kruchten Date: Mon, 13 Jan 2020 15:12:26 -0500 Subject: [PATCH 1/9] bump plotly.js --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 148a5a175..487f0a3e2 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "fast-isnumeric": "^1.1.2", "immutability-helper": "^3.0.0", "plotly-icons": "1.3.13", - "plotly.js": "1.51.3", + "plotly.js": "1.52.0", "prop-types": "^15.7.2", "raf": "^3.4.1", "react-color": "^2.17.0", From e8a75b92d02ca2f66f7943b11a1c698a01613d60 Mon Sep 17 00:00:00 2001 From: Nicolas Kruchten Date: Mon, 13 Jan 2020 15:12:34 -0500 Subject: [PATCH 2/9] texttemplate controls --- src/default_panels/StyleTracesPanel.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/default_panels/StyleTracesPanel.js b/src/default_panels/StyleTracesPanel.js index ab8d153d9..054cc0fa8 100644 --- a/src/default_panels/StyleTracesPanel.js +++ b/src/default_panels/StyleTracesPanel.js @@ -633,9 +633,6 @@ const StyleTracesPanel = (props, {localize: _}) => ( /> - - - ( )} mode="trace" > - + + + + From b94846deabe932cffd12868db4896c06847432fc Mon Sep 17 00:00:00 2001 From: Nicolas Kruchten Date: Mon, 13 Jan 2020 15:42:23 -0500 Subject: [PATCH 3/9] legend title --- src/default_panels/StyleLegendPanel.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/default_panels/StyleLegendPanel.js b/src/default_panels/StyleLegendPanel.js index 71e6a1a5a..fd2b6e745 100644 --- a/src/default_panels/StyleLegendPanel.js +++ b/src/default_panels/StyleLegendPanel.js @@ -9,6 +9,7 @@ import { PlotlySection, Dropdown, TraceRequiredPanel, + TextEditor, } from '../components'; const StyleLegendPanel = (props, {localize: _}) => ( @@ -21,6 +22,13 @@ const StyleLegendPanel = (props, {localize: _}) => ( {label: _('Hide'), value: false}, ]} /> + + + + + + + From b230db5aba6b9c9410767f54f0f6d484a812fd30 Mon Sep 17 00:00:00 2001 From: Nicolas Kruchten Date: Mon, 13 Jan 2020 15:42:36 -0500 Subject: [PATCH 4/9] uniformtext --- src/default_panels/StyleLayoutPanel.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/default_panels/StyleLayoutPanel.js b/src/default_panels/StyleLayoutPanel.js index f116c8471..9fbaeadfc 100644 --- a/src/default_panels/StyleLayoutPanel.js +++ b/src/default_panels/StyleLayoutPanel.js @@ -54,7 +54,7 @@ const StyleLayoutPanel = (props, {localize: _}) => ( - + ( ]} clearable={false} /> + + From 0193fa466c64828f96326b0bd717214ca4fdbb20 Mon Sep 17 00:00:00 2001 From: Nicolas Kruchten Date: Mon, 13 Jan 2020 15:42:48 -0500 Subject: [PATCH 5/9] text orientation --- src/default_panels/StyleTracesPanel.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/default_panels/StyleTracesPanel.js b/src/default_panels/StyleTracesPanel.js index 054cc0fa8..e01b209c0 100644 --- a/src/default_panels/StyleTracesPanel.js +++ b/src/default_panels/StyleTracesPanel.js @@ -658,6 +658,30 @@ const StyleTracesPanel = (props, {localize: _}) => ( + + Date: Mon, 13 Jan 2020 16:18:05 -0500 Subject: [PATCH 6/9] choropleth geojson improvements --- src/components/fields/Dropzone.js | 2 +- src/components/fields/LocationSelector.js | 1 + src/default_panels/GraphCreatePanel.js | 12 ++++++ src/default_panels/StyleMapsPanel.js | 47 +++++++++++++++-------- 4 files changed, 46 insertions(+), 16 deletions(-) diff --git a/src/components/fields/Dropzone.js b/src/components/fields/Dropzone.js index 9d5932707..39427de11 100644 --- a/src/components/fields/Dropzone.js +++ b/src/components/fields/Dropzone.js @@ -27,7 +27,7 @@ UnconnectedDropzone.propTypes = { UnconnectedDropzone.displayName = 'UnconnectedDropzone'; function modifyPlotProps(props, context, plotProps) { - if (context.container.type === 'choroplethmapbox') { + if (context.container.type === 'choroplethmapbox' || context.container.type === 'choropleth') { plotProps.isVisible = true; } } diff --git a/src/components/fields/LocationSelector.js b/src/components/fields/LocationSelector.js index 78fe831d8..0a5dd2dd3 100644 --- a/src/components/fields/LocationSelector.js +++ b/src/components/fields/LocationSelector.js @@ -28,6 +28,7 @@ class UnconnectedLocation extends Component { attr="locationmode" clearable={false} options={[ + {label: _('GeoJSON feature'), value: 'geojson-id'}, {label: _('Country Names'), value: 'country names'}, {label: _('Country Abbreviations (ISO-3)'), value: 'ISO-3'}, { diff --git a/src/default_panels/GraphCreatePanel.js b/src/default_panels/GraphCreatePanel.js index 6c06dbba7..e243d93a2 100644 --- a/src/default_panels/GraphCreatePanel.js +++ b/src/default_panels/GraphCreatePanel.js @@ -3,6 +3,7 @@ import PropTypes from 'prop-types'; import { DataSelector, Dropdown, + DropdownCustom, Radio, PlotlySection, AxesCreator, @@ -74,6 +75,17 @@ const GraphCreatePanel = (props, {localize: _, setPanel}) => { }} attr="z" /> + diff --git a/src/default_panels/StyleMapsPanel.js b/src/default_panels/StyleMapsPanel.js index cddab354d..047670d9e 100644 --- a/src/default_panels/StyleMapsPanel.js +++ b/src/default_panels/StyleMapsPanel.js @@ -35,6 +35,16 @@ const StyleMapsPanel = (props, {localize: _}) => ( + @@ -84,6 +94,28 @@ const StyleMapsPanel = (props, {localize: _}) => ( {label: _('Sinusoidal'), value: 'sinusoidal'}, ]} /> + + + + + + + + + @@ -172,21 +204,6 @@ const StyleMapsPanel = (props, {localize: _}) => ( - - - - - - - - ); From cb1b934a9f35f4b13c8502fbf94ae7caa0da7dfb Mon Sep 17 00:00:00 2001 From: Nicolas Kruchten Date: Tue, 14 Jan 2020 14:00:04 -0500 Subject: [PATCH 7/9] treemap support --- src/components/containers/SubplotAccordion.js | 14 +++++++-- .../containers/TraceMarkerSection.js | 2 +- src/components/fields/derived.js | 12 +++++--- src/default_panels/GraphCreatePanel.js | 2 +- src/default_panels/StyleTracesPanel.js | 30 +++++++++++++++++-- src/lib/traceTypes.js | 5 ++++ 6 files changed, 54 insertions(+), 11 deletions(-) diff --git a/src/components/containers/SubplotAccordion.js b/src/components/containers/SubplotAccordion.js index d62772168..8d746eaef 100644 --- a/src/components/containers/SubplotAccordion.js +++ b/src/components/containers/SubplotAccordion.js @@ -118,6 +118,7 @@ class SubplotAccordion extends Component { pie: 0, table: 0, sunburst: 0, + treemap: 0, sankey: 0, parcoords: 0, parcats: 0, @@ -126,9 +127,16 @@ class SubplotAccordion extends Component { data.forEach((d, i) => { if ( (d.type === 'pie' && d.values) || - ['pie', 'table', 'sunburst', 'sankey', 'parcoords', 'parcats', 'funnelarea'].includes( - d.type - ) + [ + 'pie', + 'table', + 'sunburst', + 'treemap', + 'sankey', + 'parcoords', + 'parcats', + 'funnelarea', + ].includes(d.type) ) { counter[d.type]++; const currentCount = counter[d.type]; diff --git a/src/components/containers/TraceMarkerSection.js b/src/components/containers/TraceMarkerSection.js index a798255b0..5ee921d68 100644 --- a/src/components/containers/TraceMarkerSection.js +++ b/src/components/containers/TraceMarkerSection.js @@ -17,7 +17,7 @@ class TraceMarkerSection extends Component { const traceType = context.fullContainer.type; if (['bar', 'histogram', 'funnel', 'waterfall'].includes(traceType)) { this.name = _('Bars'); - } else if (['funnelarea', 'pie', 'sunburst'].includes(traceType)) { + } else if (['funnelarea', 'pie', 'sunburst', 'treemap'].includes(traceType)) { this.name = _('Segments'); } else { this.name = _('Points'); diff --git a/src/components/fields/derived.js b/src/components/fields/derived.js index d82dc82d3..188b0536f 100644 --- a/src/components/fields/derived.js +++ b/src/components/fields/derived.js @@ -169,7 +169,11 @@ export const TickFormat = connectToContainer(UnconnectedDropdownCustom, { export const ShowInLegend = connectToContainer(UnconnectedVisibilitySelect, { modifyPlotProps: (props, context, plotProps) => { - if (context.container.type && context.container.type !== 'sunburst') { + if ( + context.container.type && + context.container.type !== 'sunburst' && + context.container.type !== 'treemap' + ) { plotProps.isVisible = context.fullLayout.showlegend; } @@ -628,15 +632,15 @@ export const HoverInfo = connectToContainer(UnconnectedFlaglist, { {label: _('Norm'), value: 'norm'}, {label: _('Divergence'), value: 'divergence'}, ]; - } else if (container.type === 'sunburst') { + } else if (container.type === 'sunburst' || container.type === 'treemap') { options = []; } - if (container.labels && ['pie', 'sunburst', 'funnelarea'].includes(container.type)) { + if (container.labels && ['pie', 'sunburst', 'treemap', 'funnelarea'].includes(container.type)) { options.push({label: _('Label'), value: 'label'}); } - if (container.values && ['pie', 'sunburst', 'funnelarea'].includes(container.type)) { + if (container.values && ['pie', 'sunburst', 'treemap', 'funnelarea'].includes(container.type)) { options.push({label: _('Value'), value: 'value'}); } diff --git a/src/default_panels/GraphCreatePanel.js b/src/default_panels/GraphCreatePanel.js index e243d93a2..96791976e 100644 --- a/src/default_panels/GraphCreatePanel.js +++ b/src/default_panels/GraphCreatePanel.js @@ -38,7 +38,7 @@ const GraphCreatePanel = (props, {localize: _, setPanel}) => { - + ( - + @@ -99,7 +99,7 @@ const StyleTracesPanel = (props, {localize: _}) => ( @@ -113,6 +113,7 @@ const StyleTracesPanel = (props, {localize: _}) => ( ]} /> + ( {label: _('Off'), value: false}, ]} /> + ( + + + + [ label: _('Sunburst'), category: chartCategory(_).SPECIALIZED, }, + { + value: 'treemap', + label: _('Treemap'), + category: chartCategory(_).SPECIALIZED, + }, { value: 'sankey', label: _('Sankey'), From 6ef0c2a9b19645f6ad8ffc3daa404e7700bde355 Mon Sep 17 00:00:00 2001 From: Nicolas Kruchten Date: Tue, 14 Jan 2020 15:56:27 -0500 Subject: [PATCH 8/9] missing commit --- package.json | 4 ++-- src/default_panels/StyleLegendPanel.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 487f0a3e2..ebee462cc 100644 --- a/package.json +++ b/package.json @@ -34,8 +34,8 @@ "draft-js-utils": "^1.3.3", "fast-isnumeric": "^1.1.2", "immutability-helper": "^3.0.0", - "plotly-icons": "1.3.13", - "plotly.js": "1.52.0", + "plotly-icons": "1.3.14", + "plotly.js": "1.52.1", "prop-types": "^15.7.2", "raf": "^3.4.1", "react-color": "^2.17.0", diff --git a/src/default_panels/StyleLegendPanel.js b/src/default_panels/StyleLegendPanel.js index fd2b6e745..cc474a261 100644 --- a/src/default_panels/StyleLegendPanel.js +++ b/src/default_panels/StyleLegendPanel.js @@ -24,7 +24,7 @@ const StyleLegendPanel = (props, {localize: _}) => ( /> - + From a16ccca68efc9372681cff23f32991d07b5668ce Mon Sep 17 00:00:00 2001 From: Nicolas Kruchten Date: Tue, 14 Jan 2020 15:57:21 -0500 Subject: [PATCH 9/9] version bump --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ebee462cc..1ca9b6a37 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "react-chart-editor", "description": "plotly.js chart editor react component UI", - "version": "0.40.3", + "version": "0.41.0", "author": "Plotly, Inc.", "bugs": { "url": "https://github.com/plotly/react-chart-editor/issues"