From 62cbb9fd064fa4648296053ed299ec44858f4ae2 Mon Sep 17 00:00:00 2001 From: dmt0 Date: Tue, 3 Jul 2018 16:24:52 -0400 Subject: [PATCH 01/12] violins initial --- src/default_panels/StyleTracesPanel.js | 52 ++++++++++++++++++++++++++ src/lib/constants.js | 1 + src/lib/customTraceType.js | 7 ++++ src/lib/traceTypes.js | 10 ++--- 4 files changed, 65 insertions(+), 5 deletions(-) diff --git a/src/default_panels/StyleTracesPanel.js b/src/default_panels/StyleTracesPanel.js index a306eb9a7..748a00ec9 100644 --- a/src/default_panels/StyleTracesPanel.js +++ b/src/default_panels/StyleTracesPanel.js @@ -395,6 +395,27 @@ const StyleTracesPanel = (props, {localize: _}) => ( ]} /> + + + + + + ( {label: _('Hide'), value: false}, ]} /> + + + + + + + + + diff --git a/src/lib/constants.js b/src/lib/constants.js index 008e49e03..58e64145f 100644 --- a/src/lib/constants.js +++ b/src/lib/constants.js @@ -58,6 +58,7 @@ export const TRACE_TO_AXIS = { 'scatter', 'scattergl', 'box', + 'violin', 'bar', 'heatmap', 'heatmapgl', diff --git a/src/lib/customTraceType.js b/src/lib/customTraceType.js index 38b1be67c..d78efe9dc 100644 --- a/src/lib/customTraceType.js +++ b/src/lib/customTraceType.js @@ -49,6 +49,13 @@ export function traceTypeToPlotlyInitFigure(traceType) { type: 'box', boxpoints: false, }; + case 'violin': + return { + type: 'violin', + box: {visible: false}, + meanline: {visible: false}, + bandwidth: 0, + }; case 'line3d': return { type: 'scatter3d', diff --git a/src/lib/traceTypes.js b/src/lib/traceTypes.js index 95d748990..daf16da1d 100644 --- a/src/lib/traceTypes.js +++ b/src/lib/traceTypes.js @@ -126,11 +126,11 @@ export const traceTypes = _ => [ label: _('2D Contour Histogram'), category: chartCategory(_).DISTRIBUTIONS, }, - // { - // value: 'violin', - // label: _('Violin'), - // category: chartCategory(_).DISTRIBUTIONS, - // }, + { + value: 'violin', + label: _('Violin'), + category: chartCategory(_).DISTRIBUTIONS, + }, { value: 'choropleth', label: _('Choropleth'), From f6768f6c024b6efd1211f62db8084d1286bed18f Mon Sep 17 00:00:00 2001 From: dmt0 Date: Thu, 5 Jul 2018 12:30:26 -0400 Subject: [PATCH 02/12] Violin Percy test --- dev/mocks.json | 1 + dev/percy/index.js | 3 ++- dev/percy/violin.json | 28 ++++++++++++++++++++++++++++ src/__percy__/panels.percy.js | 1 + 4 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 dev/percy/violin.json diff --git a/dev/mocks.json b/dev/mocks.json index 372cbc945..9e1cebf8c 100644 --- a/dev/mocks.json +++ b/dev/mocks.json @@ -3,6 +3,7 @@ "/percy/panelTest.json", "/percy/histogram.json", "/percy/histogram2d.json", + "/percy/violin.json", "0.json", "1.json", "10.json", diff --git a/dev/percy/index.js b/dev/percy/index.js index 32a680630..f35bb460f 100644 --- a/dev/percy/index.js +++ b/dev/percy/index.js @@ -1,5 +1,6 @@ import panelTest from './panelTest.json'; import histogram from './histogram.json'; import histogram2d from './histogram2d.json'; +import violin from './violin.json'; -export {panelTest, histogram, histogram2d}; +export {panelTest, histogram, histogram2d, violin}; diff --git a/dev/percy/violin.json b/dev/percy/violin.json new file mode 100644 index 000000000..a33e89108 --- /dev/null +++ b/dev/percy/violin.json @@ -0,0 +1,28 @@ +{ + "data": [ + { + "type": "violin", + "mode": "markers", + "uid": "91db56", + "box": { + "visible": true + }, + "meanline": { + "visible": true + }, + "bandwidth": 0, + "x": [ + 1, + 2, + 3 + ], + "xsrc": "x1" + } + ], + "layout": { + "xaxis": {}, + "yaxis": {}, + "autosize": true + }, + "frames": [] +} diff --git a/src/__percy__/panels.percy.js b/src/__percy__/panels.percy.js index 9bd071ff6..cec8fc4d0 100644 --- a/src/__percy__/panels.percy.js +++ b/src/__percy__/panels.percy.js @@ -16,6 +16,7 @@ import './percy.css'; const panelsToTest = { histogram: ['GraphCreatePanel'], histogram2d: ['GraphCreatePanel', 'StyleTracesPanel'], + violin: ['GraphCreatePanel', 'StyleTracesPanel'], }; window.URL.createObjectURL = function() { From 8af688ba5f53c800da908a33b264d4aa7f74fcb2 Mon Sep 17 00:00:00 2001 From: dmt0 Date: Thu, 5 Jul 2018 14:30:22 -0400 Subject: [PATCH 03/12] Add violin points, make box points a dropdown --- src/default_panels/StyleTracesPanel.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/default_panels/StyleTracesPanel.js b/src/default_panels/StyleTracesPanel.js index 748a00ec9..6b89d04a7 100644 --- a/src/default_panels/StyleTracesPanel.js +++ b/src/default_panels/StyleTracesPanel.js @@ -189,12 +189,25 @@ const StyleTracesPanel = (props, {localize: _}) => ( {label: _('Unsorted'), value: false}, ]} /> - + From 37391d9ea29d5867dc0845ce58fceee2630f56b9 Mon Sep 17 00:00:00 2001 From: dmt0 Date: Thu, 5 Jul 2018 13:57:49 -0400 Subject: [PATCH 04/12] boxmod, barmode, violinmode, etc --- src/default_panels/StyleLayoutPanel.js | 59 ++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/src/default_panels/StyleLayoutPanel.js b/src/default_panels/StyleLayoutPanel.js index 39d258339..a62194a36 100644 --- a/src/default_panels/StyleLayoutPanel.js +++ b/src/default_panels/StyleLayoutPanel.js @@ -10,6 +10,7 @@ import { TextEditor, PlotlySection, TraceRequiredPanel, + NumericFraction, } from '../components'; const StyleLayoutPanel = (props, {localize: _}) => ( @@ -36,6 +37,64 @@ const StyleLayoutPanel = (props, {localize: _}) => ( {label: _('Disable'), value: false}, ]} /> + + + + + + + + + + + + + + + + + + From f5bdc3f5bf77cf67d2f3ac333d4dcac5fdeec14a Mon Sep 17 00:00:00 2001 From: dmt0 Date: Thu, 5 Jul 2018 14:10:59 -0400 Subject: [PATCH 05/12] move fields to trace style panel --- src/default_panels/StyleLayoutPanel.js | 59 -------------------------- src/default_panels/StyleTracesPanel.js | 41 +++++++++++++++++- 2 files changed, 39 insertions(+), 61 deletions(-) diff --git a/src/default_panels/StyleLayoutPanel.js b/src/default_panels/StyleLayoutPanel.js index a62194a36..39d258339 100644 --- a/src/default_panels/StyleLayoutPanel.js +++ b/src/default_panels/StyleLayoutPanel.js @@ -10,7 +10,6 @@ import { TextEditor, PlotlySection, TraceRequiredPanel, - NumericFraction, } from '../components'; const StyleLayoutPanel = (props, {localize: _}) => ( @@ -37,64 +36,6 @@ const StyleLayoutPanel = (props, {localize: _}) => ( {label: _('Disable'), value: false}, ]} /> - - - - - - - - - - - - - - - - - - diff --git a/src/default_panels/StyleTracesPanel.js b/src/default_panels/StyleTracesPanel.js index 6b89d04a7..9385416a0 100644 --- a/src/default_panels/StyleTracesPanel.js +++ b/src/default_panels/StyleTracesPanel.js @@ -220,10 +220,47 @@ const StyleTracesPanel = (props, {localize: _}) => ( - + - + + + + + + + From 8f6207429b0a43618b9de667e4e86edc97ba6023 Mon Sep 17 00:00:00 2001 From: dmt0 Date: Thu, 5 Jul 2018 14:33:05 -0400 Subject: [PATCH 06/12] Move whisker width to Size and Spacing --- src/default_panels/StyleTracesPanel.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/default_panels/StyleTracesPanel.js b/src/default_panels/StyleTracesPanel.js index 9385416a0..a98c2cfc0 100644 --- a/src/default_panels/StyleTracesPanel.js +++ b/src/default_panels/StyleTracesPanel.js @@ -261,13 +261,11 @@ const StyleTracesPanel = (props, {localize: _}) => ( /> + - - - Date: Thu, 5 Jul 2018 14:43:50 -0400 Subject: [PATCH 07/12] Combine box mean and SD into same field as is in plotly.js --- src/default_panels/StyleTracesPanel.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/default_panels/StyleTracesPanel.js b/src/default_panels/StyleTracesPanel.js index a98c2cfc0..356b2e8a5 100644 --- a/src/default_panels/StyleTracesPanel.js +++ b/src/default_panels/StyleTracesPanel.js @@ -467,18 +467,10 @@ const StyleTracesPanel = (props, {localize: _}) => ( - Date: Thu, 5 Jul 2018 14:57:11 -0400 Subject: [PATCH 08/12] Bar and Box Percy mocks --- dev/mocks.json | 2 ++ dev/percy/bar.json | 45 +++++++++++++++++++++++++++++++++++ dev/percy/box.json | 38 +++++++++++++++++++++++++++++ dev/percy/index.js | 4 +++- src/__percy__/panels.percy.js | 2 ++ 5 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 dev/percy/bar.json create mode 100644 dev/percy/box.json diff --git a/dev/mocks.json b/dev/mocks.json index 9e1cebf8c..9fb9cf892 100644 --- a/dev/mocks.json +++ b/dev/mocks.json @@ -1,6 +1,8 @@ [ "/mocks/aggregate.json", "/percy/panelTest.json", + "/percy/bar.json", + "/percy/box.json", "/percy/histogram.json", "/percy/histogram2d.json", "/percy/violin.json", diff --git a/dev/percy/bar.json b/dev/percy/bar.json new file mode 100644 index 000000000..e0fc4d8f0 --- /dev/null +++ b/dev/percy/bar.json @@ -0,0 +1,45 @@ +{ + "data": [ + { + "type": "bar", + "mode": "markers", + "uid": "040729", + "x": [ + 1, + 2, + 3 + ], + "xsrc": "x1", + "error_x": { + "visible": true, + "symmetric": true + }, + "error_y": { + "visible": true, + "symmetric": false + } + } + ], + "layout": { + "xaxis": { + "type": "linear", + "range": [ + 0, + 115.78947368421052 + ], + "autorange": true + }, + "yaxis": { + "range": [ + -0.5, + 5.815789473684211 + ], + "autorange": true + }, + "autosize": true, + "barmode": "group", + "barnorm": "percent", + "bargroupgap": 0.28 + }, + "frames": [] +} diff --git a/dev/percy/box.json b/dev/percy/box.json new file mode 100644 index 000000000..4f1e8cdb6 --- /dev/null +++ b/dev/percy/box.json @@ -0,0 +1,38 @@ +{ + "data": [ + { + "type": "box", + "mode": "markers", + "uid": "43d2ef", + "boxpoints": "all", + "x": [ + 1, + 2, + 3 + ], + "xsrc": "x1", + "boxmean": true + } + ], + "layout": { + "xaxis": { + "type": "linear", + "range": [ + 0.7222222222222222, + 6.277777777777778 + ], + "autorange": true + }, + "yaxis": { + "type": "category", + "range": [ + -0.696, + 0.5 + ], + "autorange": true + }, + "autosize": true, + "boxmode": "overlay" + }, + "frames": [] +} diff --git a/dev/percy/index.js b/dev/percy/index.js index f35bb460f..19f80bbfc 100644 --- a/dev/percy/index.js +++ b/dev/percy/index.js @@ -2,5 +2,7 @@ import panelTest from './panelTest.json'; import histogram from './histogram.json'; import histogram2d from './histogram2d.json'; import violin from './violin.json'; +import bar from './bar.json'; +import box from './box.json'; -export {panelTest, histogram, histogram2d, violin}; +export {panelTest, histogram, histogram2d, violin, bar, box}; diff --git a/src/__percy__/panels.percy.js b/src/__percy__/panels.percy.js index cec8fc4d0..191c6dc52 100644 --- a/src/__percy__/panels.percy.js +++ b/src/__percy__/panels.percy.js @@ -14,6 +14,8 @@ import './percy.css'; * To specify which panels to test with the mock, add entry to panelsToTest, else all panels will be tested */ const panelsToTest = { + bar: ['GraphCreatePanel', 'StyleTracesPanel'], + box: ['GraphCreatePanel', 'StyleTracesPanel'], histogram: ['GraphCreatePanel'], histogram2d: ['GraphCreatePanel', 'StyleTracesPanel'], violin: ['GraphCreatePanel', 'StyleTracesPanel'], From c4bce3dc0b830eefed1e78507262009c6196213f Mon Sep 17 00:00:00 2001 From: dmt0 Date: Thu, 5 Jul 2018 15:08:40 -0400 Subject: [PATCH 09/12] Filter operation - change label from Target to Reference --- src/components/fields/FilterOperation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/fields/FilterOperation.js b/src/components/fields/FilterOperation.js index c6a304230..3f6843329 100644 --- a/src/components/fields/FilterOperation.js +++ b/src/components/fields/FilterOperation.js @@ -168,7 +168,7 @@ class UnconnectedFilterValue extends Component { const {fullValue, attr, defaultValue} = this.props; const op = findOperation(operation); - let label1 = _('Target'); + let label1 = _('Reference'); if (op === 'inrange' || op === 'exrange') { label1 = _('Lower Bound'); } else if (op === 'inset' || op === 'exset') { From 801c339e312919cc2ee33b75cc755a558b820537 Mon Sep 17 00:00:00 2001 From: dmt0 Date: Thu, 5 Jul 2018 15:12:45 -0400 Subject: [PATCH 10/12] Move Financial into Specialized, remove Financial section --- src/lib/traceTypes.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/lib/traceTypes.js b/src/lib/traceTypes.js index daf16da1d..4fb542e5c 100644 --- a/src/lib/traceTypes.js +++ b/src/lib/traceTypes.js @@ -12,10 +12,10 @@ export const chartCategory = _ => { value: 'CHARTS_3D', label: _('3D charts'), }, - FINANCIAL: { - value: 'FINANCIAL', - label: _('Finance'), - }, + // FINANCIAL: { + // value: 'FINANCIAL', + // label: _('Finance'), + // }, DISTRIBUTIONS: { value: 'DISTRIBUTIONS', label: _('Distributions'), @@ -42,7 +42,7 @@ export const categoryLayout = _ => [ chartCategory(_).DISTRIBUTIONS, chartCategory(_).SPECIALIZED, chartCategory(_).MAPS, - chartCategory(_).FINANCIAL, + // chartCategory(_).FINANCIAL, ]; export const traceTypes = _ => [ @@ -146,16 +146,6 @@ export const traceTypes = _ => [ label: _('Atlas Map'), category: chartCategory(_).MAPS, }, - { - value: 'candlestick', - label: _('Candlestick'), - category: chartCategory(_).FINANCIAL, - }, - { - value: 'ohlc', - label: _('OHLC'), - category: chartCategory(_).FINANCIAL, - }, // { // value: 'parcoords', // label: _('Parallel Coordinates'), @@ -181,6 +171,16 @@ export const traceTypes = _ => [ label: _('Ternary Scatter'), category: chartCategory(_).SPECIALIZED, }, + { + value: 'candlestick', + label: _('Candlestick'), + category: chartCategory(_).SPECIALIZED, + }, + { + value: 'ohlc', + label: _('OHLC'), + category: chartCategory(_).SPECIALIZED, + }, // { // value: 'pointcloud', // label: _('Point Cloud'), From 09d3bdc6b73aad34f64fe36f1fab60f31080b23c Mon Sep 17 00:00:00 2001 From: dmt0 Date: Thu, 5 Jul 2018 16:59:48 -0400 Subject: [PATCH 11/12] Visual improvements --- src/__percy__/panels.percy.js | 2 +- src/default_panels/StyleTracesPanel.js | 34 ++++++++++++++------------ 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/__percy__/panels.percy.js b/src/__percy__/panels.percy.js index 191c6dc52..3c8c5bf36 100644 --- a/src/__percy__/panels.percy.js +++ b/src/__percy__/panels.percy.js @@ -16,7 +16,7 @@ import './percy.css'; const panelsToTest = { bar: ['GraphCreatePanel', 'StyleTracesPanel'], box: ['GraphCreatePanel', 'StyleTracesPanel'], - histogram: ['GraphCreatePanel'], + histogram: ['GraphCreatePanel', 'StyleTracesPanel'], histogram2d: ['GraphCreatePanel', 'StyleTracesPanel'], violin: ['GraphCreatePanel', 'StyleTracesPanel'], }; diff --git a/src/default_panels/StyleTracesPanel.js b/src/default_panels/StyleTracesPanel.js index 356b2e8a5..e38d03191 100644 --- a/src/default_panels/StyleTracesPanel.js +++ b/src/default_panels/StyleTracesPanel.js @@ -230,7 +230,7 @@ const StyleTracesPanel = (props, {localize: _}) => ( /> - ( {label: _('Stack'), value: 'stack'}, {label: _('Relative'), value: 'relative'}, ]} + clearable={false} /> - @@ -463,8 +465,17 @@ const StyleTracesPanel = (props, {localize: _}) => ( ]} /> + - + ( {label: _('None'), value: false}, ]} /> + + ( + + ( /> - From 25a9bc75e795cdf9d33cf803cf3338a8f9f8f767 Mon Sep 17 00:00:00 2001 From: dmt0 Date: Fri, 6 Jul 2018 11:11:48 -0400 Subject: [PATCH 12/12] moved whiskerwidth out of a section --- src/default_panels/StyleTracesPanel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/default_panels/StyleTracesPanel.js b/src/default_panels/StyleTracesPanel.js index e38d03191..131fa4e94 100644 --- a/src/default_panels/StyleTracesPanel.js +++ b/src/default_panels/StyleTracesPanel.js @@ -263,8 +263,8 @@ const StyleTracesPanel = (props, {localize: _}) => ( /> - +