From 284a95759c06c9b478242666f71bc19ea791cb08 Mon Sep 17 00:00:00 2001 From: Krist Wongsuphasawat Date: Tue, 16 Apr 2019 12:19:59 -0700 Subject: [PATCH 1/7] feat: bubble in progress --- .../preset-chart-xy/Bubble/constants.ts | 2 + .../preset-chart-xy/Bubble/data/data.js | 226 +++++ .../preset-chart-xy/Bubble/data/data2.js | 94 ++ .../preset-chart-xy/Bubble/data/legacyData.js | 908 ++++++++++++++++++ .../stories/preset-chart-xy/Bubble/index.js | 14 + .../preset-chart-xy/Bubble/stories/basic.jsx | 59 ++ .../preset-chart-xy/Bubble/stories/legacy.tsx | 78 ++ .../Bubble/stories/missing.tsx | 67 ++ .../Bubble/stories/timeShift.tsx | 78 ++ .../src/Bubble/Bubble.tsx | 237 +++++ .../src/Bubble/Encoder.ts | 58 ++ .../src/Bubble/createTooltip.tsx | 63 ++ .../src/Bubble/images/thumbnail.png | Bin 0 -> 31155 bytes .../src/Bubble/images/thumbnailLarge.png | Bin 0 -> 31155 bytes .../src/Bubble/index.ts | 13 + .../src/Bubble/legacy/index.ts | 13 + .../src/Bubble/legacy/metadata.ts | 6 + .../src/Bubble/legacy/transformProps.ts | 67 ++ .../src/Bubble/metadata.ts | 11 + .../src/Bubble/transformProps.ts | 16 + .../superset-ui-preset-chart-xy/src/index.ts | 1 + .../superset-ui-preset-chart-xy/src/legacy.ts | 1 + 22 files changed, 2012 insertions(+) create mode 100644 packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/constants.ts create mode 100644 packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/data/data.js create mode 100644 packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/data/data2.js create mode 100644 packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/data/legacyData.js create mode 100644 packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/index.js create mode 100644 packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/stories/basic.jsx create mode 100644 packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/stories/legacy.tsx create mode 100644 packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/stories/missing.tsx create mode 100644 packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/stories/timeShift.tsx create mode 100644 packages/superset-ui-preset-chart-xy/src/Bubble/Bubble.tsx create mode 100644 packages/superset-ui-preset-chart-xy/src/Bubble/Encoder.ts create mode 100644 packages/superset-ui-preset-chart-xy/src/Bubble/createTooltip.tsx create mode 100644 packages/superset-ui-preset-chart-xy/src/Bubble/images/thumbnail.png create mode 100644 packages/superset-ui-preset-chart-xy/src/Bubble/images/thumbnailLarge.png create mode 100644 packages/superset-ui-preset-chart-xy/src/Bubble/index.ts create mode 100644 packages/superset-ui-preset-chart-xy/src/Bubble/legacy/index.ts create mode 100644 packages/superset-ui-preset-chart-xy/src/Bubble/legacy/metadata.ts create mode 100644 packages/superset-ui-preset-chart-xy/src/Bubble/legacy/transformProps.ts create mode 100644 packages/superset-ui-preset-chart-xy/src/Bubble/metadata.ts create mode 100644 packages/superset-ui-preset-chart-xy/src/Bubble/transformProps.ts diff --git a/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/constants.ts b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/constants.ts new file mode 100644 index 000000000..3bc83f336 --- /dev/null +++ b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/constants.ts @@ -0,0 +1,2 @@ +export const BUBBLE_PLUGIN_TYPE = 'v2-line'; +export const BUBBLE_PLUGIN_LEGACY_TYPE = 'v2-line/legacy'; diff --git a/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/data/data.js b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/data/data.js new file mode 100644 index 000000000..f14581b7f --- /dev/null +++ b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/data/data.js @@ -0,0 +1,226 @@ +/* eslint-disable sort-keys, no-magic-numbers */ +export default { + keys: ['name', 'x', 'y'], + values: [ + { x: -157766400000, y: 24703, name: 'Christopher' }, + { x: -126230400000, y: 27861, name: 'Christopher' }, + { x: -94694400000, y: 29436, name: 'Christopher' }, + { x: -63158400000, y: 31463, name: 'Christopher' }, + { x: -31536000000, y: 35718, name: 'Christopher' }, + { x: 0, y: 41758, name: 'Christopher' }, + { x: 31536000000, y: 48172, name: 'Christopher' }, + { x: 63072000000, y: 52092, name: 'Christopher' }, + { x: 94694400000, y: 48217, name: 'Christopher' }, + { x: 126230400000, y: 48476, name: 'Christopher' }, + { x: 157766400000, y: 46438, name: 'Christopher' }, + { x: 189302400000, y: 45086, name: 'Christopher' }, + { x: 220924800000, y: 46610, name: 'Christopher' }, + { x: 252460800000, y: 47107, name: 'Christopher' }, + { x: 283996800000, y: 50514, name: 'Christopher' }, + { x: 315532800000, y: 48969, name: 'Christopher' }, + { x: 347155200000, y: 50108, name: 'Christopher' }, + { x: 378691200000, y: 59055, name: 'Christopher' }, + { x: 410227200000, y: 59188, name: 'Christopher' }, + { x: 441763200000, y: 59859, name: 'Christopher' }, + { x: 473385600000, y: 59516, name: 'Christopher' }, + { x: 504921600000, y: 56633, name: 'Christopher' }, + { x: 536457600000, y: 54466, name: 'Christopher' }, + { x: 567993600000, y: 52996, name: 'Christopher' }, + { x: 599616000000, y: 53205, name: 'Christopher' }, + { x: 631152000000, y: 52322, name: 'Christopher' }, + { x: 662688000000, y: 47109, name: 'Christopher' }, + { x: 694224000000, y: 42470, name: 'Christopher' }, + { x: 725846400000, y: 38257, name: 'Christopher' }, + { x: 757382400000, y: 34823, name: 'Christopher' }, + { x: 788918400000, y: 32728, name: 'Christopher' }, + { x: 820454400000, y: 30988, name: 'Christopher' }, + { x: 852076800000, y: 29179, name: 'Christopher' }, + { x: 883612800000, y: 27083, name: 'Christopher' }, + { x: 915148800000, y: 25700, name: 'Christopher' }, + { x: 946684800000, y: 24959, name: 'Christopher' }, + { x: 978307200000, y: 23180, name: 'Christopher' }, + { x: 1009843200000, y: 21731, name: 'Christopher' }, + { x: 1041379200000, y: 20793, name: 'Christopher' }, + { x: 1072915200000, y: 19739, name: 'Christopher' }, + { x: 1104537600000, y: 19190, name: 'Christopher' }, + { x: 1136073600000, y: 19674, name: 'Christopher' }, + { x: 1167609600000, y: 19986, name: 'Christopher' }, + { x: 1199145600000, y: 17771, name: 'Christopher' }, + { x: -157766400000, y: 67646, name: 'David' }, + { x: -126230400000, y: 66207, name: 'David' }, + { x: -94694400000, y: 66581, name: 'David' }, + { x: -63158400000, y: 63531, name: 'David' }, + { x: -31536000000, y: 63502, name: 'David' }, + { x: 0, y: 61570, name: 'David' }, + { x: 31536000000, y: 52948, name: 'David' }, + { x: 63072000000, y: 46218, name: 'David' }, + { x: 94694400000, y: 40968, name: 'David' }, + { x: 126230400000, y: 41654, name: 'David' }, + { x: 157766400000, y: 39019, name: 'David' }, + { x: 189302400000, y: 39165, name: 'David' }, + { x: 220924800000, y: 40407, name: 'David' }, + { x: 252460800000, y: 40533, name: 'David' }, + { x: 283996800000, y: 41898, name: 'David' }, + { x: 315532800000, y: 41743, name: 'David' }, + { x: 347155200000, y: 40486, name: 'David' }, + { x: 378691200000, y: 40283, name: 'David' }, + { x: 410227200000, y: 39048, name: 'David' }, + { x: 441763200000, y: 38346, name: 'David' }, + { x: 473385600000, y: 38395, name: 'David' }, + { x: 504921600000, y: 37021, name: 'David' }, + { x: 536457600000, y: 36672, name: 'David' }, + { x: 567993600000, y: 35214, name: 'David' }, + { x: 599616000000, y: 35139, name: 'David' }, + { x: 631152000000, y: 33661, name: 'David' }, + { x: 662688000000, y: 30347, name: 'David' }, + { x: 694224000000, y: 28344, name: 'David' }, + { x: 725846400000, y: 26947, name: 'David' }, + { x: 757382400000, y: 24784, name: 'David' }, + { x: 788918400000, y: 22967, name: 'David' }, + { x: 820454400000, y: 22941, name: 'David' }, + { x: 852076800000, y: 21824, name: 'David' }, + { x: 883612800000, y: 20816, name: 'David' }, + { x: 915148800000, y: 20267, name: 'David' }, + { x: 946684800000, y: 19695, name: 'David' }, + { x: 978307200000, y: 19281, name: 'David' }, + { x: 1009843200000, y: 18600, name: 'David' }, + { x: 1041379200000, y: 18557, name: 'David' }, + { x: 1072915200000, y: 18315, name: 'David' }, + { x: 1104537600000, y: 18017, name: 'David' }, + { x: 1136073600000, y: 17510, name: 'David' }, + { x: 1167609600000, y: 17400, name: 'David' }, + { x: 1199145600000, y: 16049, name: 'David' }, + { x: -157766400000, y: 67506, name: 'James' }, + { x: -126230400000, y: 65036, name: 'James' }, + { x: -94694400000, y: 61554, name: 'James' }, + { x: -63158400000, y: 60584, name: 'James' }, + { x: -31536000000, y: 59824, name: 'James' }, + { x: 0, y: 61597, name: 'James' }, + { x: 31536000000, y: 54463, name: 'James' }, + { x: 63072000000, y: 46960, name: 'James' }, + { x: 94694400000, y: 42782, name: 'James' }, + { x: 126230400000, y: 41258, name: 'James' }, + { x: 157766400000, y: 39471, name: 'James' }, + { x: 189302400000, y: 38203, name: 'James' }, + { x: 220924800000, y: 39916, name: 'James' }, + { x: 252460800000, y: 39783, name: 'James' }, + { x: 283996800000, y: 39237, name: 'James' }, + { x: 315532800000, y: 39185, name: 'James' }, + { x: 347155200000, y: 38176, name: 'James' }, + { x: 378691200000, y: 38750, name: 'James' }, + { x: 410227200000, y: 36228, name: 'James' }, + { x: 441763200000, y: 35728, name: 'James' }, + { x: 473385600000, y: 35750, name: 'James' }, + { x: 504921600000, y: 33955, name: 'James' }, + { x: 536457600000, y: 32552, name: 'James' }, + { x: 567993600000, y: 32418, name: 'James' }, + { x: 599616000000, y: 32658, name: 'James' }, + { x: 631152000000, y: 32288, name: 'James' }, + { x: 662688000000, y: 30460, name: 'James' }, + { x: 694224000000, y: 28450, name: 'James' }, + { x: 725846400000, y: 26193, name: 'James' }, + { x: 757382400000, y: 24706, name: 'James' }, + { x: 788918400000, y: 22691, name: 'James' }, + { x: 820454400000, y: 21122, name: 'James' }, + { x: 852076800000, y: 20368, name: 'James' }, + { x: 883612800000, y: 19651, name: 'James' }, + { x: 915148800000, y: 18508, name: 'James' }, + { x: 946684800000, y: 17939, name: 'James' }, + { x: 978307200000, y: 17023, name: 'James' }, + { x: 1009843200000, y: 16905, name: 'James' }, + { x: 1041379200000, y: 16832, name: 'James' }, + { x: 1072915200000, y: 16459, name: 'James' }, + { x: 1104537600000, y: 16046, name: 'James' }, + { x: 1136073600000, y: 16139, name: 'James' }, + { x: 1167609600000, y: 15821, name: 'James' }, + { x: 1199145600000, y: 14920, name: 'James' }, + { x: -157766400000, y: 71390, name: 'John' }, + { x: -126230400000, y: 64858, name: 'John' }, + { x: -94694400000, y: 61480, name: 'John' }, + { x: -63158400000, y: 60754, name: 'John' }, + { x: -31536000000, y: 58644, name: 'John' }, + { x: 0, y: 58348, name: 'John' }, + { x: 31536000000, y: 51382, name: 'John' }, + { x: 63072000000, y: 43028, name: 'John' }, + { x: 94694400000, y: 39061, name: 'John' }, + { x: 126230400000, y: 37553, name: 'John' }, + { x: 157766400000, y: 34970, name: 'John' }, + { x: 189302400000, y: 33876, name: 'John' }, + { x: 220924800000, y: 34103, name: 'John' }, + { x: 252460800000, y: 33895, name: 'John' }, + { x: 283996800000, y: 35305, name: 'John' }, + { x: 315532800000, y: 35131, name: 'John' }, + { x: 347155200000, y: 34761, name: 'John' }, + { x: 378691200000, y: 34560, name: 'John' }, + { x: 410227200000, y: 33047, name: 'John' }, + { x: 441763200000, y: 32484, name: 'John' }, + { x: 473385600000, y: 31397, name: 'John' }, + { x: 504921600000, y: 30103, name: 'John' }, + { x: 536457600000, y: 29462, name: 'John' }, + { x: 567993600000, y: 29301, name: 'John' }, + { x: 599616000000, y: 29751, name: 'John' }, + { x: 631152000000, y: 29011, name: 'John' }, + { x: 662688000000, y: 27727, name: 'John' }, + { x: 694224000000, y: 26156, name: 'John' }, + { x: 725846400000, y: 24918, name: 'John' }, + { x: 757382400000, y: 24119, name: 'John' }, + { x: 788918400000, y: 23174, name: 'John' }, + { x: 820454400000, y: 22104, name: 'John' }, + { x: 852076800000, y: 21330, name: 'John' }, + { x: 883612800000, y: 20556, name: 'John' }, + { x: 915148800000, y: 20280, name: 'John' }, + { x: 946684800000, y: 20032, name: 'John' }, + { x: 978307200000, y: 18839, name: 'John' }, + { x: 1009843200000, y: 17400, name: 'John' }, + { x: 1041379200000, y: 17170, name: 'John' }, + { x: 1072915200000, y: 16381, name: 'John' }, + { x: 1104537600000, y: 15692, name: 'John' }, + { x: 1136073600000, y: 15083, name: 'John' }, + { x: 1167609600000, y: 14348, name: 'John' }, + { x: 1199145600000, y: 13110, name: 'John' }, + { x: -157766400000, y: 80812, name: 'Michael' }, + { x: -126230400000, y: 79709, name: 'Michael' }, + { x: -94694400000, y: 82204, name: 'Michael' }, + { x: -63158400000, y: 81785, name: 'Michael' }, + { x: -31536000000, y: 84893, name: 'Michael' }, + { x: 0, y: 85015, name: 'Michael' }, + { x: 31536000000, y: 77321, name: 'Michael' }, + { x: 63072000000, y: 71197, name: 'Michael' }, + { x: 94694400000, y: 67598, name: 'Michael' }, + { x: 126230400000, y: 67304, name: 'Michael' }, + { x: 157766400000, y: 68149, name: 'Michael' }, + { x: 189302400000, y: 66686, name: 'Michael' }, + { x: 220924800000, y: 67344, name: 'Michael' }, + { x: 252460800000, y: 66875, name: 'Michael' }, + { x: 283996800000, y: 67473, name: 'Michael' }, + { x: 315532800000, y: 68375, name: 'Michael' }, + { x: 347155200000, y: 68467, name: 'Michael' }, + { x: 378691200000, y: 67904, name: 'Michael' }, + { x: 410227200000, y: 67708, name: 'Michael' }, + { x: 441763200000, y: 67457, name: 'Michael' }, + { x: 473385600000, y: 64667, name: 'Michael' }, + { x: 504921600000, y: 63959, name: 'Michael' }, + { x: 536457600000, y: 63442, name: 'Michael' }, + { x: 567993600000, y: 63924, name: 'Michael' }, + { x: 599616000000, y: 65233, name: 'Michael' }, + { x: 631152000000, y: 65138, name: 'Michael' }, + { x: 662688000000, y: 60646, name: 'Michael' }, + { x: 694224000000, y: 54216, name: 'Michael' }, + { x: 725846400000, y: 49443, name: 'Michael' }, + { x: 757382400000, y: 44361, name: 'Michael' }, + { x: 788918400000, y: 41311, name: 'Michael' }, + { x: 820454400000, y: 38284, name: 'Michael' }, + { x: 852076800000, y: 37459, name: 'Michael' }, + { x: 883612800000, y: 36525, name: 'Michael' }, + { x: 915148800000, y: 33820, name: 'Michael' }, + { x: 946684800000, y: 31956, name: 'Michael' }, + { x: 978307200000, y: 29612, name: 'Michael' }, + { x: 1009843200000, y: 28156, name: 'Michael' }, + { x: 1041379200000, y: 27031, name: 'Michael' }, + { x: 1072915200000, y: 25418, name: 'Michael' }, + { x: 1104537600000, y: 23678, name: 'Michael' }, + { x: 1136073600000, y: 22498, name: 'Michael' }, + { x: 1167609600000, y: 21805, name: 'Michael' }, + { x: 1199145600000, y: 20271, name: 'Michael' }, + ], +}; diff --git a/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/data/data2.js b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/data/data2.js new file mode 100644 index 000000000..fda02b8af --- /dev/null +++ b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/data/data2.js @@ -0,0 +1,94 @@ +/* eslint-disable sort-keys, no-magic-numbers */ +export default { + keys: ['snapshot', 'x', 'y'], + values: [ + { x: -157766400000, y: 24703, snapshot: 'Last year' }, + { x: -126230400000, y: 27861, snapshot: 'Last year' }, + { x: -94694400000, y: 29436, snapshot: 'Last year' }, + { x: -63158400000, y: 31463, snapshot: 'Last year' }, + { x: -31536000000, y: 35718, snapshot: 'Last year' }, + { x: 0, y: 41758, snapshot: 'Last year' }, + { x: 31536000000, y: 48172, snapshot: 'Last year' }, + { x: 63072000000, y: 52092, snapshot: 'Last year' }, + { x: 94694400000, y: 48217, snapshot: 'Last year' }, + { x: 126230400000, y: 48476, snapshot: 'Last year' }, + { x: 157766400000, y: 46438, snapshot: 'Last year' }, + { x: 189302400000, y: 45086, snapshot: 'Last year' }, + { x: 220924800000, y: 46610, snapshot: 'Last year' }, + { x: 252460800000, y: 47107, snapshot: 'Last year' }, + { x: 283996800000, y: 50514, snapshot: 'Last year' }, + { x: 315532800000, y: 48969, snapshot: 'Last year' }, + { x: 347155200000, y: 50108, snapshot: 'Last year' }, + { x: 378691200000, y: 59055, snapshot: 'Last year' }, + { x: 410227200000, y: 59188, snapshot: 'Last year' }, + { x: 441763200000, y: 59859, snapshot: 'Last year' }, + { x: 473385600000, y: 59516, snapshot: 'Last year' }, + { x: 504921600000, y: 56633, snapshot: 'Last year' }, + { x: 536457600000, y: 54466, snapshot: 'Last year' }, + { x: 567993600000, y: 52996, snapshot: 'Last year' }, + { x: 599616000000, y: 53205, snapshot: 'Last year' }, + { x: 631152000000, y: 52322, snapshot: 'Last year' }, + { x: 662688000000, y: 47109, snapshot: 'Last year' }, + { x: 694224000000, y: 42470, snapshot: 'Last year' }, + { x: 725846400000, y: 38257, snapshot: 'Last year' }, + { x: 757382400000, y: 34823, snapshot: 'Last year' }, + { x: 788918400000, y: 32728, snapshot: 'Last year' }, + { x: 820454400000, y: 30988, snapshot: 'Last year' }, + { x: 852076800000, y: 29179, snapshot: 'Last year' }, + { x: 883612800000, y: 27083, snapshot: 'Last year' }, + { x: 915148800000, y: 25700, snapshot: 'Last year' }, + { x: 946684800000, y: 24959, snapshot: 'Last year' }, + { x: 978307200000, y: 23180, snapshot: 'Last year' }, + { x: 1009843200000, y: 21731, snapshot: 'Last year' }, + { x: 1041379200000, y: 20793, snapshot: 'Last year' }, + { x: 1072915200000, y: 19739, snapshot: 'Last year' }, + { x: 1104537600000, y: 19190, snapshot: 'Last year' }, + { x: 1136073600000, y: 19674, snapshot: 'Last year' }, + { x: 1167609600000, y: 19986, snapshot: 'Last year' }, + { x: 1199145600000, y: 17771, snapshot: 'Last year' }, + { x: -157766400000, y: 80812, snapshot: 'Current' }, + { x: -126230400000, y: 79709, snapshot: 'Current' }, + { x: -94694400000, y: 82204, snapshot: 'Current' }, + { x: -63158400000, y: 81785, snapshot: 'Current' }, + { x: -31536000000, y: 84893, snapshot: 'Current' }, + { x: 0, y: 85015, snapshot: 'Current' }, + { x: 31536000000, y: 77321, snapshot: 'Current' }, + { x: 63072000000, y: 71197, snapshot: 'Current' }, + { x: 94694400000, y: 67598, snapshot: 'Current' }, + { x: 126230400000, y: 67304, snapshot: 'Current' }, + { x: 157766400000, y: 68149, snapshot: 'Current' }, + { x: 189302400000, y: 66686, snapshot: 'Current' }, + { x: 220924800000, y: 67344, snapshot: 'Current' }, + { x: 252460800000, y: 66875, snapshot: 'Current' }, + { x: 283996800000, y: 67473, snapshot: 'Current' }, + { x: 315532800000, y: 68375, snapshot: 'Current' }, + { x: 347155200000, y: 68467, snapshot: 'Current' }, + { x: 378691200000, y: 67904, snapshot: 'Current' }, + { x: 410227200000, y: 67708, snapshot: 'Current' }, + { x: 441763200000, y: 67457, snapshot: 'Current' }, + { x: 473385600000, y: 64667, snapshot: 'Current' }, + { x: 504921600000, y: 63959, snapshot: 'Current' }, + { x: 536457600000, y: 63442, snapshot: 'Current' }, + { x: 567993600000, y: 63924, snapshot: 'Current' }, + { x: 599616000000, y: 65233, snapshot: 'Current' }, + { x: 631152000000, y: 65138, snapshot: 'Current' }, + { x: 662688000000, y: 60646, snapshot: 'Current' }, + { x: 694224000000, y: 54216, snapshot: 'Current' }, + { x: 725846400000, y: 49443, snapshot: 'Current' }, + { x: 757382400000, y: 44361, snapshot: 'Current' }, + { x: 788918400000, y: 41311, snapshot: 'Current' }, + { x: 820454400000, y: 38284, snapshot: 'Current' }, + { x: 852076800000, y: 37459, snapshot: 'Current' }, + { x: 883612800000, y: 36525, snapshot: 'Current' }, + { x: 915148800000, y: 33820, snapshot: 'Current' }, + { x: 946684800000, y: 31956, snapshot: 'Current' }, + { x: 978307200000, y: 29612, snapshot: 'Current' }, + { x: 1009843200000, y: 28156, snapshot: 'Current' }, + { x: 1041379200000, y: 27031, snapshot: 'Current' }, + { x: 1072915200000, y: 25418, snapshot: 'Current' }, + { x: 1104537600000, y: 23678, snapshot: 'Current' }, + { x: 1136073600000, y: 22498, snapshot: 'Current' }, + { x: 1167609600000, y: 21805, snapshot: 'Current' }, + { x: 1199145600000, y: 20271, snapshot: 'Current' }, + ], +}; diff --git a/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/data/legacyData.js b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/data/legacyData.js new file mode 100644 index 000000000..17c103293 --- /dev/null +++ b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/data/legacyData.js @@ -0,0 +1,908 @@ +/* eslint-disable sort-keys, no-magic-numbers */ +export default [ + { + key: ['Christopher'], + values: [ + { + x: -157766400000.0, + y: 24703, + }, + { + x: -126230400000.0, + y: 27861, + }, + { + x: -94694400000.0, + y: 29436, + }, + { + x: -63158400000.0, + y: 31463, + }, + { + x: -31536000000.0, + y: 35718, + }, + { + x: 0.0, + y: 41758, + }, + { + x: 31536000000.0, + y: 48172, + }, + { + x: 63072000000.0, + y: 52092, + }, + { + x: 94694400000.0, + y: 48217, + }, + { + x: 126230400000.0, + y: 48476, + }, + { + x: 157766400000.0, + y: 46438, + }, + { + x: 189302400000.0, + y: 45086, + }, + { + x: 220924800000.0, + y: 46610, + }, + { + x: 252460800000.0, + y: 47107, + }, + { + x: 283996800000.0, + y: 50514, + }, + { + x: 315532800000.0, + y: 48969, + }, + { + x: 347155200000.0, + y: 50108, + }, + { + x: 378691200000.0, + y: 59055, + }, + { + x: 410227200000.0, + y: 59188, + }, + { + x: 441763200000.0, + y: 59859, + }, + { + x: 473385600000.0, + y: 59516, + }, + { + x: 504921600000.0, + y: 56633, + }, + { + x: 536457600000.0, + y: 54466, + }, + { + x: 567993600000.0, + y: 52996, + }, + { + x: 599616000000.0, + y: 53205, + }, + { + x: 631152000000.0, + y: 52322, + }, + { + x: 662688000000.0, + y: 47109, + }, + { + x: 694224000000.0, + y: 42470, + }, + { + x: 725846400000.0, + y: 38257, + }, + { + x: 757382400000.0, + y: 34823, + }, + { + x: 788918400000.0, + y: 32728, + }, + { + x: 820454400000.0, + y: 30988, + }, + { + x: 852076800000.0, + y: 29179, + }, + { + x: 883612800000.0, + y: 27083, + }, + { + x: 915148800000.0, + y: 25700, + }, + { + x: 946684800000.0, + y: 24959, + }, + { + x: 978307200000.0, + y: 23180, + }, + { + x: 1009843200000.0, + y: 21731, + }, + { + x: 1041379200000.0, + y: 20793, + }, + { + x: 1072915200000.0, + y: 19739, + }, + { + x: 1104537600000.0, + y: 19190, + }, + { + x: 1136073600000.0, + y: 19674, + }, + { + x: 1167609600000.0, + y: 19986, + }, + { + x: 1199145600000.0, + y: 17771, + }, + ], + }, + { + key: ['David'], + values: [ + { + x: -157766400000.0, + y: 67646, + }, + { + x: -126230400000.0, + y: 66207, + }, + { + x: -94694400000.0, + y: 66581, + }, + { + x: -63158400000.0, + y: 63531, + }, + { + x: -31536000000.0, + y: 63502, + }, + { + x: 0.0, + y: 61570, + }, + { + x: 31536000000.0, + y: 52948, + }, + { + x: 63072000000.0, + y: 46218, + }, + { + x: 94694400000.0, + y: 40968, + }, + { + x: 126230400000.0, + y: 41654, + }, + { + x: 157766400000.0, + y: 39019, + }, + { + x: 189302400000.0, + y: 39165, + }, + { + x: 220924800000.0, + y: 40407, + }, + { + x: 252460800000.0, + y: 40533, + }, + { + x: 283996800000.0, + y: 41898, + }, + { + x: 315532800000.0, + y: 41743, + }, + { + x: 347155200000.0, + y: 40486, + }, + { + x: 378691200000.0, + y: 40283, + }, + { + x: 410227200000.0, + y: 39048, + }, + { + x: 441763200000.0, + y: 38346, + }, + { + x: 473385600000.0, + y: 38395, + }, + { + x: 504921600000.0, + y: 37021, + }, + { + x: 536457600000.0, + y: 36672, + }, + { + x: 567993600000.0, + y: 35214, + }, + { + x: 599616000000.0, + y: 35139, + }, + { + x: 631152000000.0, + y: 33661, + }, + { + x: 662688000000.0, + y: 30347, + }, + { + x: 694224000000.0, + y: 28344, + }, + { + x: 725846400000.0, + y: 26947, + }, + { + x: 757382400000.0, + y: 24784, + }, + { + x: 788918400000.0, + y: 22967, + }, + { + x: 820454400000.0, + y: 22941, + }, + { + x: 852076800000.0, + y: 21824, + }, + { + x: 883612800000.0, + y: 20816, + }, + { + x: 915148800000.0, + y: 20267, + }, + { + x: 946684800000.0, + y: 19695, + }, + { + x: 978307200000.0, + y: 19281, + }, + { + x: 1009843200000.0, + y: 18600, + }, + { + x: 1041379200000.0, + y: 18557, + }, + { + x: 1072915200000.0, + y: 18315, + }, + { + x: 1104537600000.0, + y: 18017, + }, + { + x: 1136073600000.0, + y: 17510, + }, + { + x: 1167609600000.0, + y: 17400, + }, + { + x: 1199145600000.0, + y: 16049, + }, + ], + }, + { + key: ['James'], + values: [ + { + x: -157766400000.0, + y: 67506, + }, + { + x: -126230400000.0, + y: 65036, + }, + { + x: -94694400000.0, + y: 61554, + }, + { + x: -63158400000.0, + y: 60584, + }, + { + x: -31536000000.0, + y: 59824, + }, + { + x: 0.0, + y: 61597, + }, + { + x: 31536000000.0, + y: 54463, + }, + { + x: 63072000000.0, + y: 46960, + }, + { + x: 94694400000.0, + y: 42782, + }, + { + x: 126230400000.0, + y: 41258, + }, + { + x: 157766400000.0, + y: 39471, + }, + { + x: 189302400000.0, + y: 38203, + }, + { + x: 220924800000.0, + y: 39916, + }, + { + x: 252460800000.0, + y: 39783, + }, + { + x: 283996800000.0, + y: 39237, + }, + { + x: 315532800000.0, + y: 39185, + }, + { + x: 347155200000.0, + y: 38176, + }, + { + x: 378691200000.0, + y: 38750, + }, + { + x: 410227200000.0, + y: 36228, + }, + { + x: 441763200000.0, + y: 35728, + }, + { + x: 473385600000.0, + y: 35750, + }, + { + x: 504921600000.0, + y: 33955, + }, + { + x: 536457600000.0, + y: 32552, + }, + { + x: 567993600000.0, + y: 32418, + }, + { + x: 599616000000.0, + y: 32658, + }, + { + x: 631152000000.0, + y: 32288, + }, + { + x: 662688000000.0, + y: 30460, + }, + { + x: 694224000000.0, + y: 28450, + }, + { + x: 725846400000.0, + y: 26193, + }, + { + x: 757382400000.0, + y: 24706, + }, + { + x: 788918400000.0, + y: 22691, + }, + { + x: 820454400000.0, + y: 21122, + }, + { + x: 852076800000.0, + y: 20368, + }, + { + x: 883612800000.0, + y: 19651, + }, + { + x: 915148800000.0, + y: 18508, + }, + { + x: 946684800000.0, + y: 17939, + }, + { + x: 978307200000.0, + y: 17023, + }, + { + x: 1009843200000.0, + y: 16905, + }, + { + x: 1041379200000.0, + y: 16832, + }, + { + x: 1072915200000.0, + y: 16459, + }, + { + x: 1104537600000.0, + y: 16046, + }, + { + x: 1136073600000.0, + y: 16139, + }, + { + x: 1167609600000.0, + y: 15821, + }, + { + x: 1199145600000.0, + y: 14920, + }, + ], + }, + { + key: ['John'], + values: [ + { + x: -157766400000.0, + y: 71390, + }, + { + x: -126230400000.0, + y: 64858, + }, + { + x: -94694400000.0, + y: 61480, + }, + { + x: -63158400000.0, + y: 60754, + }, + { + x: -31536000000.0, + y: 58644, + }, + { + x: 0.0, + y: 58348, + }, + { + x: 31536000000.0, + y: 51382, + }, + { + x: 63072000000.0, + y: 43028, + }, + { + x: 94694400000.0, + y: 39061, + }, + { + x: 126230400000.0, + y: 37553, + }, + { + x: 157766400000.0, + y: 34970, + }, + { + x: 189302400000.0, + y: 33876, + }, + { + x: 220924800000.0, + y: 34103, + }, + { + x: 252460800000.0, + y: 33895, + }, + { + x: 283996800000.0, + y: 35305, + }, + { + x: 315532800000.0, + y: 35131, + }, + { + x: 347155200000.0, + y: 34761, + }, + { + x: 378691200000.0, + y: 34560, + }, + { + x: 410227200000.0, + y: 33047, + }, + { + x: 441763200000.0, + y: 32484, + }, + { + x: 473385600000.0, + y: 31397, + }, + { + x: 504921600000.0, + y: 30103, + }, + { + x: 536457600000.0, + y: 29462, + }, + { + x: 567993600000.0, + y: 29301, + }, + { + x: 599616000000.0, + y: 29751, + }, + { + x: 631152000000.0, + y: 29011, + }, + { + x: 662688000000.0, + y: 27727, + }, + { + x: 694224000000.0, + y: 26156, + }, + { + x: 725846400000.0, + y: 24918, + }, + { + x: 757382400000.0, + y: 24119, + }, + { + x: 788918400000.0, + y: 23174, + }, + { + x: 820454400000.0, + y: 22104, + }, + { + x: 852076800000.0, + y: 21330, + }, + { + x: 883612800000.0, + y: 20556, + }, + { + x: 915148800000.0, + y: 20280, + }, + { + x: 946684800000.0, + y: 20032, + }, + { + x: 978307200000.0, + y: 18839, + }, + { + x: 1009843200000.0, + y: 17400, + }, + { + x: 1041379200000.0, + y: 17170, + }, + { + x: 1072915200000.0, + y: 16381, + }, + { + x: 1104537600000.0, + y: 15692, + }, + { + x: 1136073600000.0, + y: 15083, + }, + { + x: 1167609600000.0, + y: 14348, + }, + { + x: 1199145600000.0, + y: 13110, + }, + ], + }, + { + key: ['Michael'], + values: [ + { + x: -157766400000.0, + y: 80812, + }, + { + x: -126230400000.0, + y: 79709, + }, + { + x: -94694400000.0, + y: 82204, + }, + { + x: -63158400000.0, + y: 81785, + }, + { + x: -31536000000.0, + y: 84893, + }, + { + x: 0.0, + y: 85015, + }, + { + x: 31536000000.0, + y: 77321, + }, + { + x: 63072000000.0, + y: 71197, + }, + { + x: 94694400000.0, + y: 67598, + }, + { + x: 126230400000.0, + y: 67304, + }, + { + x: 157766400000.0, + y: 68149, + }, + { + x: 189302400000.0, + y: 66686, + }, + { + x: 220924800000.0, + y: 67344, + }, + { + x: 252460800000.0, + y: 66875, + }, + { + x: 283996800000.0, + y: 67473, + }, + { + x: 315532800000.0, + y: 68375, + }, + { + x: 347155200000.0, + y: 68467, + }, + { + x: 378691200000.0, + y: 67904, + }, + { + x: 410227200000.0, + y: 67708, + }, + { + x: 441763200000.0, + y: 67457, + }, + { + x: 473385600000.0, + y: 64667, + }, + { + x: 504921600000.0, + y: 63959, + }, + { + x: 536457600000.0, + y: 63442, + }, + { + x: 567993600000.0, + y: 63924, + }, + { + x: 599616000000.0, + y: 65233, + }, + { + x: 631152000000.0, + y: 65138, + }, + { + x: 662688000000.0, + y: 60646, + }, + { + x: 694224000000.0, + y: 54216, + }, + { + x: 725846400000.0, + y: 49443, + }, + { + x: 757382400000.0, + y: 44361, + }, + { + x: 788918400000.0, + y: 41311, + }, + { + x: 820454400000.0, + y: 38284, + }, + { + x: 852076800000.0, + y: 37459, + }, + { + x: 883612800000.0, + y: 36525, + }, + { + x: 915148800000.0, + y: 33820, + }, + { + x: 946684800000.0, + y: 31956, + }, + { + x: 978307200000.0, + y: 29612, + }, + { + x: 1009843200000.0, + y: 28156, + }, + { + x: 1041379200000.0, + y: 27031, + }, + { + x: 1072915200000.0, + y: 25418, + }, + { + x: 1104537600000.0, + y: 23678, + }, + { + x: 1136073600000.0, + y: 22498, + }, + { + x: 1167609600000.0, + y: 21805, + }, + { + x: 1199145600000.0, + y: 20271, + }, + ], + }, +]; diff --git a/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/index.js b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/index.js new file mode 100644 index 000000000..b7b5ff187 --- /dev/null +++ b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/index.js @@ -0,0 +1,14 @@ +import { LineChartPlugin as LegacyLineChartPlugin } from '../../../../../superset-ui-preset-chart-xy/src/legacy'; +import { LineChartPlugin } from '../../../../../superset-ui-preset-chart-xy/src'; +import BasicStories from './stories/basic'; +import LegacyStories from './stories/legacy'; +import MissingStories from './stories/missing'; +import TimeShiftStories from './stories/timeShift'; +import { LINE_PLUGIN_TYPE, LINE_PLUGIN_LEGACY_TYPE } from './constants'; + +new LegacyLineChartPlugin().configure({ key: LINE_PLUGIN_LEGACY_TYPE }).register(); +new LineChartPlugin().configure({ key: LINE_PLUGIN_TYPE }).register(); + +export default { + examples: [...BasicStories, ...MissingStories, ...TimeShiftStories, ...LegacyStories], +}; diff --git a/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/stories/basic.jsx b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/stories/basic.jsx new file mode 100644 index 000000000..1a0d04d70 --- /dev/null +++ b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/stories/basic.jsx @@ -0,0 +1,59 @@ +/* eslint-disable no-magic-numbers, sort-keys */ +import * as React from 'react'; +import { SuperChart, ChartProps } from '@superset-ui/chart'; +import { radios } from '@storybook/addon-knobs'; +import data from '../data/data'; +import { BUBBLE_PLUGIN_TYPE } from '../constants'; + +export default [ + { + renderStory: () => [ + , + ], + storyName: 'Basic', + storyPath: 'preset-chart-xy|LineChartPlugin', + }, +]; diff --git a/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/stories/legacy.tsx b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/stories/legacy.tsx new file mode 100644 index 000000000..b981d9d02 --- /dev/null +++ b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/stories/legacy.tsx @@ -0,0 +1,78 @@ +/* eslint-disable no-magic-numbers */ +import * as React from 'react'; +import { SuperChart, ChartProps } from '@superset-ui/chart'; +import data from '../data/legacyData'; +import { BUBBLE_PLUGIN_LEGACY_TYPE } from '../constants'; + +export default [ + { + renderStory: () => [ + , + , + ], + storyName: 'Use Legacy API shim', + storyPath: 'preset-chart-xy|LineChartPlugin', + }, +]; diff --git a/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/stories/missing.tsx b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/stories/missing.tsx new file mode 100644 index 000000000..1da18ec62 --- /dev/null +++ b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/stories/missing.tsx @@ -0,0 +1,67 @@ +/* eslint-disable no-magic-numbers, sort-keys */ +import * as React from 'react'; +import { SuperChart, ChartProps } from '@superset-ui/chart'; +import data from '../data/data'; +import { LINE_PLUGIN_TYPE } from '../constants'; + +const missingData = { + keys: data.keys, + values: data.values.map(({ y, ...rest }) => ({ + ...rest, + y: Math.random() < 0.25 ? null : y, + })), +}; + +export default [ + { + renderStory: () => [ + , + ], + storyName: 'with missing data', + storyPath: 'preset-chart-xy|LineChartPlugin', + }, +]; diff --git a/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/stories/timeShift.tsx b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/stories/timeShift.tsx new file mode 100644 index 000000000..842c8cd35 --- /dev/null +++ b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/stories/timeShift.tsx @@ -0,0 +1,78 @@ +/* eslint-disable no-magic-numbers, sort-keys */ +import * as React from 'react'; +import { SuperChart, ChartProps } from '@superset-ui/chart'; +import data from '../data/data2'; +import { BUBBLE_PLUGIN_TYPE } from '../constants'; + +export default [ + { + renderStory: () => [ + , + ], + storyName: 'with time shift', + storyPath: 'preset-chart-xy|LineChartPlugin', + }, +]; diff --git a/packages/superset-ui-preset-chart-xy/src/Bubble/Bubble.tsx b/packages/superset-ui-preset-chart-xy/src/Bubble/Bubble.tsx new file mode 100644 index 000000000..481d94a10 --- /dev/null +++ b/packages/superset-ui-preset-chart-xy/src/Bubble/Bubble.tsx @@ -0,0 +1,237 @@ +/* eslint-disable sort-keys, no-magic-numbers, complexity */ + +import React, { PureComponent } from 'react'; +import { + AreaSeries, + LinearGradient, + LineSeries, + XYChart, + CrossHair, + WithTooltip, +} from '@data-ui/xy-chart'; +import { chartTheme, ChartTheme } from '@data-ui/theme'; +import { Margin, Dimension } from '@superset-ui/dimension'; +import { groupBy, flatMap, uniqueId, values } from 'lodash'; +import { createSelector } from 'reselect'; +import createTooltip from './createTooltip'; +import XYChartLayout from '../utils/XYChartLayout'; +import WithLegend from '../components/WithLegend'; +import Encoder, { ChannelTypes, Encoding, Outputs } from './Encoder'; +import { Dataset, PlainObject } from '../encodeable/types/Data'; +import ChartLegend from '../components/ChartLegend'; + +chartTheme.gridStyles.stroke = '#f1f3f5'; + +const defaultProps = { + className: '', + margin: { top: 20, right: 20, left: 20, bottom: 20 }, + theme: chartTheme, +}; + +type Props = { + className?: string; + width: string | number; + height: string | number; + margin?: Margin; + encoding: Encoding; + data: Dataset; + theme?: ChartTheme; +} & Readonly; + +export interface Series { + key: string; + color: Outputs['color']; + fill: Outputs['fill']; + strokeDasharray: Outputs['strokeDasharray']; + values: SeriesValue[]; +} + +export interface SeriesValue { + x: Outputs['x']; + y: Outputs['y']; + data: PlainObject; + parent: Series; +} + +const CIRCLE_STYLE = { strokeWidth: 1.5 }; + +class LineChart extends PureComponent { + static defaultProps = defaultProps; + + constructor(props: Props) { + super(props); + + const createEncoder = createSelector( + (enc: Encoding) => enc, + (enc: Encoding) => new Encoder({ encoding: enc }), + ); + + this.createEncoder = () => { + this.encoder = createEncoder(this.props.encoding); + }; + + this.encoder = createEncoder(this.props.encoding); + this.renderChart = this.renderChart.bind(this); + } + + encoder: Encoder; + private createEncoder: () => void; + + renderChart(dim: Dimension) { + const { width, height } = dim; + const { data, encoding, margin, theme } = this.props; + + const fieldNames = data.keys + .filter(k => k !== encoding.x.field && k !== encoding.y.field) + .sort((a, b) => a.localeCompare(b)); + + const groups = groupBy(data.values, row => fieldNames.map(f => `${f}=${row[f]}`).join(',')); + + const allSeries = values(groups).map(seriesData => { + const firstDatum = seriesData[0]; + + const series: Series = { + key: fieldNames.map(f => firstDatum[f]).join(','), + color: this.encoder.channels.color.encode(firstDatum), + fill: this.encoder.channels.fill.encode(firstDatum, false), + strokeDasharray: this.encoder.channels.strokeDasharray.encode(firstDatum), + values: [], + }; + + series.values = seriesData.map(v => ({ + x: this.encoder.channels.x.encode(v), + y: this.encoder.channels.y.encode(v), + data: v, + parent: series, + })); + + return series; + }); + + const filledSeries = flatMap( + allSeries + .filter(({ fill }) => fill) + .map(series => { + const gradientId = uniqueId(`gradient-${series.key}`); + + return [ + , + , + ]; + }), + ); + + const unfilledSeries = allSeries + .filter(({ fill }) => !fill) + .map(series => ( + + )); + + const children = filledSeries.concat(unfilledSeries); + + const layout = new XYChartLayout({ + width, + height, + margin, + theme, + xEncoder: this.encoder.channels.x, + yEncoder: this.encoder.channels.y, + children, + }); + + return layout.renderChartWithFrame((chartDim: Dimension) => ( + + {({ + onMouseLeave, + onMouseMove, + tooltipData, + }: { + onMouseLeave: (...args: any[]) => void; + onMouseMove: (...args: any[]) => void; + tooltipData: any; + }) => ( + + {children} + {layout.renderXAxis()} + {layout.renderYAxis()} + + d.y === tooltipData.datum.y ? d.parent.color : '#fff' + } + circleSize={(d: SeriesValue) => (d.y === tooltipData.datum.y ? 6 : 4)} + circleStroke={(d: SeriesValue) => + d.y === tooltipData.datum.y ? '#fff' : d.parent.color + } + circleStyles={CIRCLE_STYLE} + stroke="#ccc" + showCircle + showMultipleCircles + /> + + )} + + )); + } + + render() { + const { className, data, width, height } = this.props; + + this.createEncoder(); + const renderLegend = this.encoder.hasLegend() + ? // eslint-disable-next-line react/jsx-props-no-multi-spaces + () => data={data} encoder={this.encoder} /> + : undefined; + + return ( + + ); + } +} + +export default LineChart; diff --git a/packages/superset-ui-preset-chart-xy/src/Bubble/Encoder.ts b/packages/superset-ui-preset-chart-xy/src/Bubble/Encoder.ts new file mode 100644 index 000000000..0b13b0900 --- /dev/null +++ b/packages/superset-ui-preset-chart-xy/src/Bubble/Encoder.ts @@ -0,0 +1,58 @@ +import AbstractEncoder from '../encodeable/AbstractEncoder'; +import { PartialSpec } from '../encodeable/types/Specification'; +import { EncodingFromChannelsAndOutputs } from '../encodeable/types/Channel'; + +/** + * Define channel types + */ +// This is a workaround until TypeScript 3.4 which has const context +// which will allow use to derive type from object literal +// without type widening (e.g. 'X' instead of string). +// Now we have to define class with readonly fields +// to be able to use "typeof" to infer strict types +// See more details from +// https://github.com/Microsoft/TypeScript/issues/20195 +// https://github.com/Microsoft/TypeScript/pull/29510 +const channelTypes = new (class Channels { + readonly x = 'X'; + readonly y = 'Y'; + readonly color = 'Color'; + readonly fill = 'Category'; + readonly strokeDasharray = 'Category'; +})(); + +export type ChannelTypes = typeof channelTypes; + +/** + * Define output type for each channel + */ +export interface Outputs { + x: number | null; + y: number | null; + color: string; + fill: boolean; + strokeDasharray: string; +} + +/** + * Derive encoding config + */ +export type Encoding = EncodingFromChannelsAndOutputs; + +export default class Encoder extends AbstractEncoder { + static readonly DEFAULT_ENCODINGS: Encoding = { + color: { value: '#222' }, + fill: { value: false }, + strokeDasharray: { value: '' }, + x: { field: 'x', type: 'quantitative' }, + y: { field: 'y', type: 'quantitative' }, + }; + + static readonly CHANNEL_OPTIONS = { + fill: { legend: false }, + }; + + constructor(spec: PartialSpec) { + super(channelTypes, spec, Encoder.DEFAULT_ENCODINGS, Encoder.CHANNEL_OPTIONS); + } +} diff --git a/packages/superset-ui-preset-chart-xy/src/Bubble/createTooltip.tsx b/packages/superset-ui-preset-chart-xy/src/Bubble/createTooltip.tsx new file mode 100644 index 000000000..bda7d09d4 --- /dev/null +++ b/packages/superset-ui-preset-chart-xy/src/Bubble/createTooltip.tsx @@ -0,0 +1,63 @@ +/* eslint-disable no-magic-numbers */ + +import React from 'react'; +import TooltipFrame from '../components/tooltip/TooltipFrame'; +import TooltipTable from '../components/tooltip/TooltipTable'; +import { Series, SeriesValue } from './Bubble'; +import Encoder from './Encoder'; + +const MARK_STYLE = { marginRight: 4 }; + +export default function createTooltip(encoder: Encoder, allSeries: Series[]) { + function LineTooltip({ + datum, + series = {}, + }: { + datum: SeriesValue; + series: { + [key: string]: { + y: number; + }; + }; + }) { + return ( + + <> +
+ {encoder.channels.x.formatValue(datum.x)} +
+
+ {series && ( + series[key]) + .concat() + .sort((a, b) => series[b.key].y - series[a.key].y) + .map(({ key, color, strokeDasharray }) => ({ + key, + keyColumn: ( + <> + + + + {series[key] === datum ? {key} : key} + + ), + valueColumn: encoder.channels.y.formatValue(series[key].y), + }))} + /> + )} + +
+ ); + } + + return LineTooltip; +} diff --git a/packages/superset-ui-preset-chart-xy/src/Bubble/images/thumbnail.png b/packages/superset-ui-preset-chart-xy/src/Bubble/images/thumbnail.png new file mode 100644 index 0000000000000000000000000000000000000000..ecb8dd566e97e8490a4cc41f59a7a53588818be4 GIT binary patch literal 31155 zcmeFYM4FLm;>ZcL@%?JkR&nc6GH~ z{R8^qyqU9Q_Ut($pP3V-q9l!iNPq|d0f8bbBcTQX0htJX65wIM6lam}U!@P>|*%ECB0bF1fhmO0=-yf$v7bbANlGE_6Asa&IU=&e6sG#QKx1e;NGT8~5Fr!}@Sk_Ffx7T)K@~8BJ-@&sKPEu;n+5*QIA-Wf z(C^?lBh!yrU?O0f{bN1ws6rfo0-1H+5G(utY!Y;d_n)-`fhtIlH0aI7yBYtT175-t z`F~ic2!p_k)UCgg{~yL^l*y*^g$7=q@2_4ST~Zk|5V>p?B^pcz%_(;eXG`iE8^ubb z;!;VNudc3^nr(2O{+;F2u#_>*)En#S68JwI(N1KtLw)`Fm0(fxvMvQRU)Ybqro!`T z$I;0tsI08aJdRYvpGe(dz1{7mI)#l;*q8V8?2Ot*OI4DcogF+5W-Oh#s-j}{?QN?M zYH4MqSRx7o@wsB!EN93`Obo!FS)FMiA|@ubb$*U2EiJv)<^tDZzb=-+Vu1B8XUwqO zRW|c8;*Kh=Rtilb_!MS?(b$%2t?WcZM2pq~z#@j^cT3gyxm zJa6_{fqH{-~W6en#$jxsIt%oLO`^oFNYl z4>!F%oL#Y2yI9E*3Fro$GVA?Rr^^veup<~g`BOLi({44CkMiK=a$DT@Zb2)P*NGyV z%O?EhV0yPd3<;0RI5sLdHB;Qh6QjR*Tz2}`Y%IGIO2%}&Oy39mP;RPX(6^wh(* zG9HF@oN4R}@S0{*xqO)d9<{cEmrr*#GZH^ME(~o~nq=z*f0LtYU@0(~Q2@WdCN>Zf1?ZAo=MPZ$^=5G7w(maxis~rqkuk z<$kfjOo?6wI}#9<2~ro8A8eE$$qNvQ_^nmi_nkSkSh|FYN+O7%Mz2MxMz=Zi=Ll69w#(PAG)j5=VK~gXg;w+5`uBLe zuFZ>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}l@&(}atRRT zAr|%mzXODwLD6eZ@5N@g5{-(mr5PIX_f%L}$b{zm-I&ZV)FYZ(1Nu)?hEq3lKy;i> zG7T4@C>fBp^7!nE)C5sSM-CIyZNPcCQ=QLBp2qUfh p5TIA??4RiW_Qn4b9sPy7v`4ySRrxgmJjVR)qokrlg_u#m{{S?1!lM8H literal 0 HcmV?d00001 diff --git a/packages/superset-ui-preset-chart-xy/src/Bubble/images/thumbnailLarge.png b/packages/superset-ui-preset-chart-xy/src/Bubble/images/thumbnailLarge.png new file mode 100644 index 0000000000000000000000000000000000000000..ecb8dd566e97e8490a4cc41f59a7a53588818be4 GIT binary patch literal 31155 zcmeFYM4FLm;>ZcL@%?JkR&nc6GH~ z{R8^qyqU9Q_Ut($pP3V-q9l!iNPq|d0f8bbBcTQX0htJX65wIM6lam}U!@P>|*%ECB0bF1fhmO0=-yf$v7bbANlGE_6Asa&IU=&e6sG#QKx1e;NGT8~5Fr!}@Sk_Ffx7T)K@~8BJ-@&sKPEu;n+5*QIA-Wf z(C^?lBh!yrU?O0f{bN1ws6rfo0-1H+5G(utY!Y;d_n)-`fhtIlH0aI7yBYtT175-t z`F~ic2!p_k)UCgg{~yL^l*y*^g$7=q@2_4ST~Zk|5V>p?B^pcz%_(;eXG`iE8^ubb z;!;VNudc3^nr(2O{+;F2u#_>*)En#S68JwI(N1KtLw)`Fm0(fxvMvQRU)Ybqro!`T z$I;0tsI08aJdRYvpGe(dz1{7mI)#l;*q8V8?2Ot*OI4DcogF+5W-Oh#s-j}{?QN?M zYH4MqSRx7o@wsB!EN93`Obo!FS)FMiA|@ubb$*U2EiJv)<^tDZzb=-+Vu1B8XUwqO zRW|c8;*Kh=Rtilb_!MS?(b$%2t?WcZM2pq~z#@j^cT3gyxm zJa6_{fqH{-~W6en#$jxsIt%oLO`^oFNYl z4>!F%oL#Y2yI9E*3Fro$GVA?Rr^^veup<~g`BOLi({44CkMiK=a$DT@Zb2)P*NGyV z%O?EhV0yPd3<;0RI5sLdH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(3V7PUp;`2ZK z5!#+UNCS&*eDpYnFME3=0zaRUqQ&;P;JNMdI+$)(71P!>ziMv}>YVN*rkXO;X#82S ziO3ln<**|J{NmL!J*`@>?zf@IWOzlKlWV%6F$@C~IFts?D5NG=rWoibT2UzWOl-9T zf2wmqD2%K~_PDVl4T95rY{6uGnN)J@$`|$%gV;qt{!-G6$ zpahEsk}IwoOJP1=6ez?44uiOEHuPa0kp5lgiPn1imr0k(aO{D|Ad>_}l@&(}atRRT zAr|%mzXODwLD6eZ@5N@g5{-(mr5PIX_f%L}$b{zm-I&ZV)FYZ(1Nu)?hEq3lKy;i> zG7T4@C>fBp^7!nE)C5sSM-CIyZNPcCQ=QLBp2qUfh p5TIA??4RiW_Qn4b9sPy7v`4ySRrxgmJjVR)qokrlg_u#m{{S?1!lM8H literal 0 HcmV?d00001 diff --git a/packages/superset-ui-preset-chart-xy/src/Bubble/index.ts b/packages/superset-ui-preset-chart-xy/src/Bubble/index.ts new file mode 100644 index 000000000..c0111f4a9 --- /dev/null +++ b/packages/superset-ui-preset-chart-xy/src/Bubble/index.ts @@ -0,0 +1,13 @@ +import { ChartPlugin } from '@superset-ui/chart'; +import metadata from './metadata'; +import transformProps from './transformProps'; + +export default class LineChartPlugin extends ChartPlugin { + constructor() { + super({ + loadChart: () => import('./Bubble'), + metadata, + transformProps, + }); + } +} diff --git a/packages/superset-ui-preset-chart-xy/src/Bubble/legacy/index.ts b/packages/superset-ui-preset-chart-xy/src/Bubble/legacy/index.ts new file mode 100644 index 000000000..48e4a02d2 --- /dev/null +++ b/packages/superset-ui-preset-chart-xy/src/Bubble/legacy/index.ts @@ -0,0 +1,13 @@ +import { ChartPlugin } from '@superset-ui/chart'; +import metadata from './metadata'; +import transformProps from './transformProps'; + +export default class LineChartPlugin extends ChartPlugin { + constructor() { + super({ + loadChart: () => import('../Bubble'), + metadata, + transformProps, + }); + } +} diff --git a/packages/superset-ui-preset-chart-xy/src/Bubble/legacy/metadata.ts b/packages/superset-ui-preset-chart-xy/src/Bubble/legacy/metadata.ts new file mode 100644 index 000000000..2f532e6a2 --- /dev/null +++ b/packages/superset-ui-preset-chart-xy/src/Bubble/legacy/metadata.ts @@ -0,0 +1,6 @@ +import metadata from '../metadata'; + +const legacyMetadata = metadata.clone(); +legacyMetadata.useLegacyApi = true; + +export default legacyMetadata; diff --git a/packages/superset-ui-preset-chart-xy/src/Bubble/legacy/transformProps.ts b/packages/superset-ui-preset-chart-xy/src/Bubble/legacy/transformProps.ts new file mode 100644 index 000000000..a9e07df78 --- /dev/null +++ b/packages/superset-ui-preset-chart-xy/src/Bubble/legacy/transformProps.ts @@ -0,0 +1,67 @@ +/* eslint-disable sort-keys */ +import { ChartProps } from '@superset-ui/chart'; +import { flatMap } from 'lodash'; + +interface DataRow { + key: string[]; + values: { + x: number; + y: number; + }[]; +} + +export default function transformProps(chartProps: ChartProps) { + const { width, height, formData, payload } = chartProps; + const { colorScheme, xAxisLabel, xAxisFormat, yAxisLabel, yAxisFormat } = formData; + const data = payload.data as DataRow[]; + + return { + data: { + keys: ['name', 'x', 'y'], + values: flatMap( + data.map((row: DataRow) => + row.values.map(v => ({ + ...v, + name: row.key[0], + })), + ), + ), + }, + width, + height, + encoding: { + x: { + field: 'x', + type: 'temporal', + format: xAxisFormat, + scale: { + type: 'time', + }, + axis: { + orient: 'bottom', + title: xAxisLabel, + }, + }, + y: { + field: 'y', + type: 'quantitative', + format: yAxisFormat, + scale: { + type: 'linear', + }, + axis: { + orient: 'left', + title: yAxisLabel, + }, + }, + color: { + field: 'name', + type: 'nominal', + scale: { + scheme: colorScheme, + }, + legend: true, + }, + }, + }; +} diff --git a/packages/superset-ui-preset-chart-xy/src/Bubble/metadata.ts b/packages/superset-ui-preset-chart-xy/src/Bubble/metadata.ts new file mode 100644 index 000000000..5e5f46099 --- /dev/null +++ b/packages/superset-ui-preset-chart-xy/src/Bubble/metadata.ts @@ -0,0 +1,11 @@ +import { t } from '@superset-ui/translation'; +import { ChartMetadata } from '@superset-ui/chart'; +import thumbnail from './images/thumbnail.png'; + +const metadata = new ChartMetadata({ + description: '', + name: t('Bubble Chart'), + thumbnail, +}); + +export default metadata; diff --git a/packages/superset-ui-preset-chart-xy/src/Bubble/transformProps.ts b/packages/superset-ui-preset-chart-xy/src/Bubble/transformProps.ts new file mode 100644 index 000000000..d75251efa --- /dev/null +++ b/packages/superset-ui-preset-chart-xy/src/Bubble/transformProps.ts @@ -0,0 +1,16 @@ +import { ChartProps } from '@superset-ui/chart'; + +/* eslint-disable sort-keys */ + +export default function transformProps(chartProps: ChartProps) { + const { width, height, formData, payload } = chartProps; + const { encoding } = formData; + const { data } = payload; + + return { + data, + width, + height, + encoding, + }; +} diff --git a/packages/superset-ui-preset-chart-xy/src/index.ts b/packages/superset-ui-preset-chart-xy/src/index.ts index 498637196..3982f08f4 100644 --- a/packages/superset-ui-preset-chart-xy/src/index.ts +++ b/packages/superset-ui-preset-chart-xy/src/index.ts @@ -1,2 +1,3 @@ export { default as BoxPlotChartPlugin } from './BoxPlot'; +export { default as BubbleChartPlugin } from './Bubble'; export { default as LineChartPlugin } from './Line'; diff --git a/packages/superset-ui-preset-chart-xy/src/legacy.ts b/packages/superset-ui-preset-chart-xy/src/legacy.ts index c0403f479..f497170bc 100644 --- a/packages/superset-ui-preset-chart-xy/src/legacy.ts +++ b/packages/superset-ui-preset-chart-xy/src/legacy.ts @@ -1,2 +1,3 @@ export { default as BoxPlotChartPlugin } from './BoxPlot/legacy'; +export { default as BubbleChartPlugin } from './Bubble/legacy'; export { default as LineChartPlugin } from './Line/legacy'; From c600dd25b06343dcfe1f58ff7225c4c58e1ff353 Mon Sep 17 00:00:00 2001 From: Krist Wongsuphasawat Date: Wed, 8 May 2019 13:14:26 -0700 Subject: [PATCH 2/7] feat: working scatter plot with basic and bubble demo --- .../preset-chart-xy/Bubble/constants.ts | 2 - .../preset-chart-xy/Bubble/data/data.js | 226 ----- .../preset-chart-xy/Bubble/data/data2.js | 94 -- .../preset-chart-xy/Bubble/data/legacyData.js | 908 ------------------ .../stories/preset-chart-xy/Bubble/index.js | 14 - .../Bubble/stories/timeShift.tsx | 78 -- .../preset-chart-xy/ScatterPlot/constants.ts | 2 + .../preset-chart-xy/ScatterPlot/data/data.js | 178 ++++ .../ScatterPlot/data/legacyData.js | 338 +++++++ .../preset-chart-xy/ScatterPlot/index.js | 13 + .../{Bubble => ScatterPlot}/stories/basic.jsx | 23 +- .../stories/bubble.jsx} | 49 +- .../stories/legacy.tsx | 12 +- .../src/BoxPlot/BoxPlot.tsx | 18 - .../src/Bubble/Bubble.tsx | 237 ----- .../src/Bubble/createTooltip.tsx | 63 -- .../src/Bubble/legacy/metadata.ts | 6 - .../src/Bubble/metadata.ts | 11 - .../src/{Bubble => ScatterPlot}/Encoder.ts | 38 +- .../src/ScatterPlot/ScatterPlot.tsx | 163 ++++ .../src/ScatterPlot/createMetadata.ts | 12 + .../src/ScatterPlot/createTooltip.tsx | 50 + .../images/thumbnail.png | Bin .../images/thumbnailLarge.png | Bin .../src/{Bubble => ScatterPlot}/index.ts | 6 +- .../{Bubble => ScatterPlot}/legacy/index.ts | 6 +- .../legacy/transformProps.ts | 0 .../{Bubble => ScatterPlot}/transformProps.ts | 3 +- .../src/encodeable/AxisAgent.ts | 2 +- .../superset-ui-preset-chart-xy/src/index.ts | 2 +- .../superset-ui-preset-chart-xy/src/legacy.ts | 2 +- .../types/@data-ui/xy-chart/index.d.ts | 1 + 32 files changed, 821 insertions(+), 1736 deletions(-) delete mode 100644 packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/constants.ts delete mode 100644 packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/data/data.js delete mode 100644 packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/data/data2.js delete mode 100644 packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/data/legacyData.js delete mode 100644 packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/index.js delete mode 100644 packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/stories/timeShift.tsx create mode 100644 packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/ScatterPlot/constants.ts create mode 100644 packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/ScatterPlot/data/data.js create mode 100644 packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/ScatterPlot/data/legacyData.js create mode 100644 packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/ScatterPlot/index.js rename packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/{Bubble => ScatterPlot}/stories/basic.jsx (72%) rename packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/{Bubble/stories/missing.tsx => ScatterPlot/stories/bubble.jsx} (50%) rename packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/{Bubble => ScatterPlot}/stories/legacy.tsx (88%) delete mode 100644 packages/superset-ui-preset-chart-xy/src/Bubble/Bubble.tsx delete mode 100644 packages/superset-ui-preset-chart-xy/src/Bubble/createTooltip.tsx delete mode 100644 packages/superset-ui-preset-chart-xy/src/Bubble/legacy/metadata.ts delete mode 100644 packages/superset-ui-preset-chart-xy/src/Bubble/metadata.ts rename packages/superset-ui-preset-chart-xy/src/{Bubble => ScatterPlot}/Encoder.ts (51%) create mode 100644 packages/superset-ui-preset-chart-xy/src/ScatterPlot/ScatterPlot.tsx create mode 100644 packages/superset-ui-preset-chart-xy/src/ScatterPlot/createMetadata.ts create mode 100644 packages/superset-ui-preset-chart-xy/src/ScatterPlot/createTooltip.tsx rename packages/superset-ui-preset-chart-xy/src/{Bubble => ScatterPlot}/images/thumbnail.png (100%) rename packages/superset-ui-preset-chart-xy/src/{Bubble => ScatterPlot}/images/thumbnailLarge.png (100%) rename packages/superset-ui-preset-chart-xy/src/{Bubble => ScatterPlot}/index.ts (63%) rename packages/superset-ui-preset-chart-xy/src/{Bubble => ScatterPlot}/legacy/index.ts (62%) rename packages/superset-ui-preset-chart-xy/src/{Bubble => ScatterPlot}/legacy/transformProps.ts (100%) rename packages/superset-ui-preset-chart-xy/src/{Bubble => ScatterPlot}/transformProps.ts (84%) diff --git a/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/constants.ts b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/constants.ts deleted file mode 100644 index 3bc83f336..000000000 --- a/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/constants.ts +++ /dev/null @@ -1,2 +0,0 @@ -export const BUBBLE_PLUGIN_TYPE = 'v2-line'; -export const BUBBLE_PLUGIN_LEGACY_TYPE = 'v2-line/legacy'; diff --git a/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/data/data.js b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/data/data.js deleted file mode 100644 index f14581b7f..000000000 --- a/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/data/data.js +++ /dev/null @@ -1,226 +0,0 @@ -/* eslint-disable sort-keys, no-magic-numbers */ -export default { - keys: ['name', 'x', 'y'], - values: [ - { x: -157766400000, y: 24703, name: 'Christopher' }, - { x: -126230400000, y: 27861, name: 'Christopher' }, - { x: -94694400000, y: 29436, name: 'Christopher' }, - { x: -63158400000, y: 31463, name: 'Christopher' }, - { x: -31536000000, y: 35718, name: 'Christopher' }, - { x: 0, y: 41758, name: 'Christopher' }, - { x: 31536000000, y: 48172, name: 'Christopher' }, - { x: 63072000000, y: 52092, name: 'Christopher' }, - { x: 94694400000, y: 48217, name: 'Christopher' }, - { x: 126230400000, y: 48476, name: 'Christopher' }, - { x: 157766400000, y: 46438, name: 'Christopher' }, - { x: 189302400000, y: 45086, name: 'Christopher' }, - { x: 220924800000, y: 46610, name: 'Christopher' }, - { x: 252460800000, y: 47107, name: 'Christopher' }, - { x: 283996800000, y: 50514, name: 'Christopher' }, - { x: 315532800000, y: 48969, name: 'Christopher' }, - { x: 347155200000, y: 50108, name: 'Christopher' }, - { x: 378691200000, y: 59055, name: 'Christopher' }, - { x: 410227200000, y: 59188, name: 'Christopher' }, - { x: 441763200000, y: 59859, name: 'Christopher' }, - { x: 473385600000, y: 59516, name: 'Christopher' }, - { x: 504921600000, y: 56633, name: 'Christopher' }, - { x: 536457600000, y: 54466, name: 'Christopher' }, - { x: 567993600000, y: 52996, name: 'Christopher' }, - { x: 599616000000, y: 53205, name: 'Christopher' }, - { x: 631152000000, y: 52322, name: 'Christopher' }, - { x: 662688000000, y: 47109, name: 'Christopher' }, - { x: 694224000000, y: 42470, name: 'Christopher' }, - { x: 725846400000, y: 38257, name: 'Christopher' }, - { x: 757382400000, y: 34823, name: 'Christopher' }, - { x: 788918400000, y: 32728, name: 'Christopher' }, - { x: 820454400000, y: 30988, name: 'Christopher' }, - { x: 852076800000, y: 29179, name: 'Christopher' }, - { x: 883612800000, y: 27083, name: 'Christopher' }, - { x: 915148800000, y: 25700, name: 'Christopher' }, - { x: 946684800000, y: 24959, name: 'Christopher' }, - { x: 978307200000, y: 23180, name: 'Christopher' }, - { x: 1009843200000, y: 21731, name: 'Christopher' }, - { x: 1041379200000, y: 20793, name: 'Christopher' }, - { x: 1072915200000, y: 19739, name: 'Christopher' }, - { x: 1104537600000, y: 19190, name: 'Christopher' }, - { x: 1136073600000, y: 19674, name: 'Christopher' }, - { x: 1167609600000, y: 19986, name: 'Christopher' }, - { x: 1199145600000, y: 17771, name: 'Christopher' }, - { x: -157766400000, y: 67646, name: 'David' }, - { x: -126230400000, y: 66207, name: 'David' }, - { x: -94694400000, y: 66581, name: 'David' }, - { x: -63158400000, y: 63531, name: 'David' }, - { x: -31536000000, y: 63502, name: 'David' }, - { x: 0, y: 61570, name: 'David' }, - { x: 31536000000, y: 52948, name: 'David' }, - { x: 63072000000, y: 46218, name: 'David' }, - { x: 94694400000, y: 40968, name: 'David' }, - { x: 126230400000, y: 41654, name: 'David' }, - { x: 157766400000, y: 39019, name: 'David' }, - { x: 189302400000, y: 39165, name: 'David' }, - { x: 220924800000, y: 40407, name: 'David' }, - { x: 252460800000, y: 40533, name: 'David' }, - { x: 283996800000, y: 41898, name: 'David' }, - { x: 315532800000, y: 41743, name: 'David' }, - { x: 347155200000, y: 40486, name: 'David' }, - { x: 378691200000, y: 40283, name: 'David' }, - { x: 410227200000, y: 39048, name: 'David' }, - { x: 441763200000, y: 38346, name: 'David' }, - { x: 473385600000, y: 38395, name: 'David' }, - { x: 504921600000, y: 37021, name: 'David' }, - { x: 536457600000, y: 36672, name: 'David' }, - { x: 567993600000, y: 35214, name: 'David' }, - { x: 599616000000, y: 35139, name: 'David' }, - { x: 631152000000, y: 33661, name: 'David' }, - { x: 662688000000, y: 30347, name: 'David' }, - { x: 694224000000, y: 28344, name: 'David' }, - { x: 725846400000, y: 26947, name: 'David' }, - { x: 757382400000, y: 24784, name: 'David' }, - { x: 788918400000, y: 22967, name: 'David' }, - { x: 820454400000, y: 22941, name: 'David' }, - { x: 852076800000, y: 21824, name: 'David' }, - { x: 883612800000, y: 20816, name: 'David' }, - { x: 915148800000, y: 20267, name: 'David' }, - { x: 946684800000, y: 19695, name: 'David' }, - { x: 978307200000, y: 19281, name: 'David' }, - { x: 1009843200000, y: 18600, name: 'David' }, - { x: 1041379200000, y: 18557, name: 'David' }, - { x: 1072915200000, y: 18315, name: 'David' }, - { x: 1104537600000, y: 18017, name: 'David' }, - { x: 1136073600000, y: 17510, name: 'David' }, - { x: 1167609600000, y: 17400, name: 'David' }, - { x: 1199145600000, y: 16049, name: 'David' }, - { x: -157766400000, y: 67506, name: 'James' }, - { x: -126230400000, y: 65036, name: 'James' }, - { x: -94694400000, y: 61554, name: 'James' }, - { x: -63158400000, y: 60584, name: 'James' }, - { x: -31536000000, y: 59824, name: 'James' }, - { x: 0, y: 61597, name: 'James' }, - { x: 31536000000, y: 54463, name: 'James' }, - { x: 63072000000, y: 46960, name: 'James' }, - { x: 94694400000, y: 42782, name: 'James' }, - { x: 126230400000, y: 41258, name: 'James' }, - { x: 157766400000, y: 39471, name: 'James' }, - { x: 189302400000, y: 38203, name: 'James' }, - { x: 220924800000, y: 39916, name: 'James' }, - { x: 252460800000, y: 39783, name: 'James' }, - { x: 283996800000, y: 39237, name: 'James' }, - { x: 315532800000, y: 39185, name: 'James' }, - { x: 347155200000, y: 38176, name: 'James' }, - { x: 378691200000, y: 38750, name: 'James' }, - { x: 410227200000, y: 36228, name: 'James' }, - { x: 441763200000, y: 35728, name: 'James' }, - { x: 473385600000, y: 35750, name: 'James' }, - { x: 504921600000, y: 33955, name: 'James' }, - { x: 536457600000, y: 32552, name: 'James' }, - { x: 567993600000, y: 32418, name: 'James' }, - { x: 599616000000, y: 32658, name: 'James' }, - { x: 631152000000, y: 32288, name: 'James' }, - { x: 662688000000, y: 30460, name: 'James' }, - { x: 694224000000, y: 28450, name: 'James' }, - { x: 725846400000, y: 26193, name: 'James' }, - { x: 757382400000, y: 24706, name: 'James' }, - { x: 788918400000, y: 22691, name: 'James' }, - { x: 820454400000, y: 21122, name: 'James' }, - { x: 852076800000, y: 20368, name: 'James' }, - { x: 883612800000, y: 19651, name: 'James' }, - { x: 915148800000, y: 18508, name: 'James' }, - { x: 946684800000, y: 17939, name: 'James' }, - { x: 978307200000, y: 17023, name: 'James' }, - { x: 1009843200000, y: 16905, name: 'James' }, - { x: 1041379200000, y: 16832, name: 'James' }, - { x: 1072915200000, y: 16459, name: 'James' }, - { x: 1104537600000, y: 16046, name: 'James' }, - { x: 1136073600000, y: 16139, name: 'James' }, - { x: 1167609600000, y: 15821, name: 'James' }, - { x: 1199145600000, y: 14920, name: 'James' }, - { x: -157766400000, y: 71390, name: 'John' }, - { x: -126230400000, y: 64858, name: 'John' }, - { x: -94694400000, y: 61480, name: 'John' }, - { x: -63158400000, y: 60754, name: 'John' }, - { x: -31536000000, y: 58644, name: 'John' }, - { x: 0, y: 58348, name: 'John' }, - { x: 31536000000, y: 51382, name: 'John' }, - { x: 63072000000, y: 43028, name: 'John' }, - { x: 94694400000, y: 39061, name: 'John' }, - { x: 126230400000, y: 37553, name: 'John' }, - { x: 157766400000, y: 34970, name: 'John' }, - { x: 189302400000, y: 33876, name: 'John' }, - { x: 220924800000, y: 34103, name: 'John' }, - { x: 252460800000, y: 33895, name: 'John' }, - { x: 283996800000, y: 35305, name: 'John' }, - { x: 315532800000, y: 35131, name: 'John' }, - { x: 347155200000, y: 34761, name: 'John' }, - { x: 378691200000, y: 34560, name: 'John' }, - { x: 410227200000, y: 33047, name: 'John' }, - { x: 441763200000, y: 32484, name: 'John' }, - { x: 473385600000, y: 31397, name: 'John' }, - { x: 504921600000, y: 30103, name: 'John' }, - { x: 536457600000, y: 29462, name: 'John' }, - { x: 567993600000, y: 29301, name: 'John' }, - { x: 599616000000, y: 29751, name: 'John' }, - { x: 631152000000, y: 29011, name: 'John' }, - { x: 662688000000, y: 27727, name: 'John' }, - { x: 694224000000, y: 26156, name: 'John' }, - { x: 725846400000, y: 24918, name: 'John' }, - { x: 757382400000, y: 24119, name: 'John' }, - { x: 788918400000, y: 23174, name: 'John' }, - { x: 820454400000, y: 22104, name: 'John' }, - { x: 852076800000, y: 21330, name: 'John' }, - { x: 883612800000, y: 20556, name: 'John' }, - { x: 915148800000, y: 20280, name: 'John' }, - { x: 946684800000, y: 20032, name: 'John' }, - { x: 978307200000, y: 18839, name: 'John' }, - { x: 1009843200000, y: 17400, name: 'John' }, - { x: 1041379200000, y: 17170, name: 'John' }, - { x: 1072915200000, y: 16381, name: 'John' }, - { x: 1104537600000, y: 15692, name: 'John' }, - { x: 1136073600000, y: 15083, name: 'John' }, - { x: 1167609600000, y: 14348, name: 'John' }, - { x: 1199145600000, y: 13110, name: 'John' }, - { x: -157766400000, y: 80812, name: 'Michael' }, - { x: -126230400000, y: 79709, name: 'Michael' }, - { x: -94694400000, y: 82204, name: 'Michael' }, - { x: -63158400000, y: 81785, name: 'Michael' }, - { x: -31536000000, y: 84893, name: 'Michael' }, - { x: 0, y: 85015, name: 'Michael' }, - { x: 31536000000, y: 77321, name: 'Michael' }, - { x: 63072000000, y: 71197, name: 'Michael' }, - { x: 94694400000, y: 67598, name: 'Michael' }, - { x: 126230400000, y: 67304, name: 'Michael' }, - { x: 157766400000, y: 68149, name: 'Michael' }, - { x: 189302400000, y: 66686, name: 'Michael' }, - { x: 220924800000, y: 67344, name: 'Michael' }, - { x: 252460800000, y: 66875, name: 'Michael' }, - { x: 283996800000, y: 67473, name: 'Michael' }, - { x: 315532800000, y: 68375, name: 'Michael' }, - { x: 347155200000, y: 68467, name: 'Michael' }, - { x: 378691200000, y: 67904, name: 'Michael' }, - { x: 410227200000, y: 67708, name: 'Michael' }, - { x: 441763200000, y: 67457, name: 'Michael' }, - { x: 473385600000, y: 64667, name: 'Michael' }, - { x: 504921600000, y: 63959, name: 'Michael' }, - { x: 536457600000, y: 63442, name: 'Michael' }, - { x: 567993600000, y: 63924, name: 'Michael' }, - { x: 599616000000, y: 65233, name: 'Michael' }, - { x: 631152000000, y: 65138, name: 'Michael' }, - { x: 662688000000, y: 60646, name: 'Michael' }, - { x: 694224000000, y: 54216, name: 'Michael' }, - { x: 725846400000, y: 49443, name: 'Michael' }, - { x: 757382400000, y: 44361, name: 'Michael' }, - { x: 788918400000, y: 41311, name: 'Michael' }, - { x: 820454400000, y: 38284, name: 'Michael' }, - { x: 852076800000, y: 37459, name: 'Michael' }, - { x: 883612800000, y: 36525, name: 'Michael' }, - { x: 915148800000, y: 33820, name: 'Michael' }, - { x: 946684800000, y: 31956, name: 'Michael' }, - { x: 978307200000, y: 29612, name: 'Michael' }, - { x: 1009843200000, y: 28156, name: 'Michael' }, - { x: 1041379200000, y: 27031, name: 'Michael' }, - { x: 1072915200000, y: 25418, name: 'Michael' }, - { x: 1104537600000, y: 23678, name: 'Michael' }, - { x: 1136073600000, y: 22498, name: 'Michael' }, - { x: 1167609600000, y: 21805, name: 'Michael' }, - { x: 1199145600000, y: 20271, name: 'Michael' }, - ], -}; diff --git a/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/data/data2.js b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/data/data2.js deleted file mode 100644 index fda02b8af..000000000 --- a/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/data/data2.js +++ /dev/null @@ -1,94 +0,0 @@ -/* eslint-disable sort-keys, no-magic-numbers */ -export default { - keys: ['snapshot', 'x', 'y'], - values: [ - { x: -157766400000, y: 24703, snapshot: 'Last year' }, - { x: -126230400000, y: 27861, snapshot: 'Last year' }, - { x: -94694400000, y: 29436, snapshot: 'Last year' }, - { x: -63158400000, y: 31463, snapshot: 'Last year' }, - { x: -31536000000, y: 35718, snapshot: 'Last year' }, - { x: 0, y: 41758, snapshot: 'Last year' }, - { x: 31536000000, y: 48172, snapshot: 'Last year' }, - { x: 63072000000, y: 52092, snapshot: 'Last year' }, - { x: 94694400000, y: 48217, snapshot: 'Last year' }, - { x: 126230400000, y: 48476, snapshot: 'Last year' }, - { x: 157766400000, y: 46438, snapshot: 'Last year' }, - { x: 189302400000, y: 45086, snapshot: 'Last year' }, - { x: 220924800000, y: 46610, snapshot: 'Last year' }, - { x: 252460800000, y: 47107, snapshot: 'Last year' }, - { x: 283996800000, y: 50514, snapshot: 'Last year' }, - { x: 315532800000, y: 48969, snapshot: 'Last year' }, - { x: 347155200000, y: 50108, snapshot: 'Last year' }, - { x: 378691200000, y: 59055, snapshot: 'Last year' }, - { x: 410227200000, y: 59188, snapshot: 'Last year' }, - { x: 441763200000, y: 59859, snapshot: 'Last year' }, - { x: 473385600000, y: 59516, snapshot: 'Last year' }, - { x: 504921600000, y: 56633, snapshot: 'Last year' }, - { x: 536457600000, y: 54466, snapshot: 'Last year' }, - { x: 567993600000, y: 52996, snapshot: 'Last year' }, - { x: 599616000000, y: 53205, snapshot: 'Last year' }, - { x: 631152000000, y: 52322, snapshot: 'Last year' }, - { x: 662688000000, y: 47109, snapshot: 'Last year' }, - { x: 694224000000, y: 42470, snapshot: 'Last year' }, - { x: 725846400000, y: 38257, snapshot: 'Last year' }, - { x: 757382400000, y: 34823, snapshot: 'Last year' }, - { x: 788918400000, y: 32728, snapshot: 'Last year' }, - { x: 820454400000, y: 30988, snapshot: 'Last year' }, - { x: 852076800000, y: 29179, snapshot: 'Last year' }, - { x: 883612800000, y: 27083, snapshot: 'Last year' }, - { x: 915148800000, y: 25700, snapshot: 'Last year' }, - { x: 946684800000, y: 24959, snapshot: 'Last year' }, - { x: 978307200000, y: 23180, snapshot: 'Last year' }, - { x: 1009843200000, y: 21731, snapshot: 'Last year' }, - { x: 1041379200000, y: 20793, snapshot: 'Last year' }, - { x: 1072915200000, y: 19739, snapshot: 'Last year' }, - { x: 1104537600000, y: 19190, snapshot: 'Last year' }, - { x: 1136073600000, y: 19674, snapshot: 'Last year' }, - { x: 1167609600000, y: 19986, snapshot: 'Last year' }, - { x: 1199145600000, y: 17771, snapshot: 'Last year' }, - { x: -157766400000, y: 80812, snapshot: 'Current' }, - { x: -126230400000, y: 79709, snapshot: 'Current' }, - { x: -94694400000, y: 82204, snapshot: 'Current' }, - { x: -63158400000, y: 81785, snapshot: 'Current' }, - { x: -31536000000, y: 84893, snapshot: 'Current' }, - { x: 0, y: 85015, snapshot: 'Current' }, - { x: 31536000000, y: 77321, snapshot: 'Current' }, - { x: 63072000000, y: 71197, snapshot: 'Current' }, - { x: 94694400000, y: 67598, snapshot: 'Current' }, - { x: 126230400000, y: 67304, snapshot: 'Current' }, - { x: 157766400000, y: 68149, snapshot: 'Current' }, - { x: 189302400000, y: 66686, snapshot: 'Current' }, - { x: 220924800000, y: 67344, snapshot: 'Current' }, - { x: 252460800000, y: 66875, snapshot: 'Current' }, - { x: 283996800000, y: 67473, snapshot: 'Current' }, - { x: 315532800000, y: 68375, snapshot: 'Current' }, - { x: 347155200000, y: 68467, snapshot: 'Current' }, - { x: 378691200000, y: 67904, snapshot: 'Current' }, - { x: 410227200000, y: 67708, snapshot: 'Current' }, - { x: 441763200000, y: 67457, snapshot: 'Current' }, - { x: 473385600000, y: 64667, snapshot: 'Current' }, - { x: 504921600000, y: 63959, snapshot: 'Current' }, - { x: 536457600000, y: 63442, snapshot: 'Current' }, - { x: 567993600000, y: 63924, snapshot: 'Current' }, - { x: 599616000000, y: 65233, snapshot: 'Current' }, - { x: 631152000000, y: 65138, snapshot: 'Current' }, - { x: 662688000000, y: 60646, snapshot: 'Current' }, - { x: 694224000000, y: 54216, snapshot: 'Current' }, - { x: 725846400000, y: 49443, snapshot: 'Current' }, - { x: 757382400000, y: 44361, snapshot: 'Current' }, - { x: 788918400000, y: 41311, snapshot: 'Current' }, - { x: 820454400000, y: 38284, snapshot: 'Current' }, - { x: 852076800000, y: 37459, snapshot: 'Current' }, - { x: 883612800000, y: 36525, snapshot: 'Current' }, - { x: 915148800000, y: 33820, snapshot: 'Current' }, - { x: 946684800000, y: 31956, snapshot: 'Current' }, - { x: 978307200000, y: 29612, snapshot: 'Current' }, - { x: 1009843200000, y: 28156, snapshot: 'Current' }, - { x: 1041379200000, y: 27031, snapshot: 'Current' }, - { x: 1072915200000, y: 25418, snapshot: 'Current' }, - { x: 1104537600000, y: 23678, snapshot: 'Current' }, - { x: 1136073600000, y: 22498, snapshot: 'Current' }, - { x: 1167609600000, y: 21805, snapshot: 'Current' }, - { x: 1199145600000, y: 20271, snapshot: 'Current' }, - ], -}; diff --git a/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/data/legacyData.js b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/data/legacyData.js deleted file mode 100644 index 17c103293..000000000 --- a/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/data/legacyData.js +++ /dev/null @@ -1,908 +0,0 @@ -/* eslint-disable sort-keys, no-magic-numbers */ -export default [ - { - key: ['Christopher'], - values: [ - { - x: -157766400000.0, - y: 24703, - }, - { - x: -126230400000.0, - y: 27861, - }, - { - x: -94694400000.0, - y: 29436, - }, - { - x: -63158400000.0, - y: 31463, - }, - { - x: -31536000000.0, - y: 35718, - }, - { - x: 0.0, - y: 41758, - }, - { - x: 31536000000.0, - y: 48172, - }, - { - x: 63072000000.0, - y: 52092, - }, - { - x: 94694400000.0, - y: 48217, - }, - { - x: 126230400000.0, - y: 48476, - }, - { - x: 157766400000.0, - y: 46438, - }, - { - x: 189302400000.0, - y: 45086, - }, - { - x: 220924800000.0, - y: 46610, - }, - { - x: 252460800000.0, - y: 47107, - }, - { - x: 283996800000.0, - y: 50514, - }, - { - x: 315532800000.0, - y: 48969, - }, - { - x: 347155200000.0, - y: 50108, - }, - { - x: 378691200000.0, - y: 59055, - }, - { - x: 410227200000.0, - y: 59188, - }, - { - x: 441763200000.0, - y: 59859, - }, - { - x: 473385600000.0, - y: 59516, - }, - { - x: 504921600000.0, - y: 56633, - }, - { - x: 536457600000.0, - y: 54466, - }, - { - x: 567993600000.0, - y: 52996, - }, - { - x: 599616000000.0, - y: 53205, - }, - { - x: 631152000000.0, - y: 52322, - }, - { - x: 662688000000.0, - y: 47109, - }, - { - x: 694224000000.0, - y: 42470, - }, - { - x: 725846400000.0, - y: 38257, - }, - { - x: 757382400000.0, - y: 34823, - }, - { - x: 788918400000.0, - y: 32728, - }, - { - x: 820454400000.0, - y: 30988, - }, - { - x: 852076800000.0, - y: 29179, - }, - { - x: 883612800000.0, - y: 27083, - }, - { - x: 915148800000.0, - y: 25700, - }, - { - x: 946684800000.0, - y: 24959, - }, - { - x: 978307200000.0, - y: 23180, - }, - { - x: 1009843200000.0, - y: 21731, - }, - { - x: 1041379200000.0, - y: 20793, - }, - { - x: 1072915200000.0, - y: 19739, - }, - { - x: 1104537600000.0, - y: 19190, - }, - { - x: 1136073600000.0, - y: 19674, - }, - { - x: 1167609600000.0, - y: 19986, - }, - { - x: 1199145600000.0, - y: 17771, - }, - ], - }, - { - key: ['David'], - values: [ - { - x: -157766400000.0, - y: 67646, - }, - { - x: -126230400000.0, - y: 66207, - }, - { - x: -94694400000.0, - y: 66581, - }, - { - x: -63158400000.0, - y: 63531, - }, - { - x: -31536000000.0, - y: 63502, - }, - { - x: 0.0, - y: 61570, - }, - { - x: 31536000000.0, - y: 52948, - }, - { - x: 63072000000.0, - y: 46218, - }, - { - x: 94694400000.0, - y: 40968, - }, - { - x: 126230400000.0, - y: 41654, - }, - { - x: 157766400000.0, - y: 39019, - }, - { - x: 189302400000.0, - y: 39165, - }, - { - x: 220924800000.0, - y: 40407, - }, - { - x: 252460800000.0, - y: 40533, - }, - { - x: 283996800000.0, - y: 41898, - }, - { - x: 315532800000.0, - y: 41743, - }, - { - x: 347155200000.0, - y: 40486, - }, - { - x: 378691200000.0, - y: 40283, - }, - { - x: 410227200000.0, - y: 39048, - }, - { - x: 441763200000.0, - y: 38346, - }, - { - x: 473385600000.0, - y: 38395, - }, - { - x: 504921600000.0, - y: 37021, - }, - { - x: 536457600000.0, - y: 36672, - }, - { - x: 567993600000.0, - y: 35214, - }, - { - x: 599616000000.0, - y: 35139, - }, - { - x: 631152000000.0, - y: 33661, - }, - { - x: 662688000000.0, - y: 30347, - }, - { - x: 694224000000.0, - y: 28344, - }, - { - x: 725846400000.0, - y: 26947, - }, - { - x: 757382400000.0, - y: 24784, - }, - { - x: 788918400000.0, - y: 22967, - }, - { - x: 820454400000.0, - y: 22941, - }, - { - x: 852076800000.0, - y: 21824, - }, - { - x: 883612800000.0, - y: 20816, - }, - { - x: 915148800000.0, - y: 20267, - }, - { - x: 946684800000.0, - y: 19695, - }, - { - x: 978307200000.0, - y: 19281, - }, - { - x: 1009843200000.0, - y: 18600, - }, - { - x: 1041379200000.0, - y: 18557, - }, - { - x: 1072915200000.0, - y: 18315, - }, - { - x: 1104537600000.0, - y: 18017, - }, - { - x: 1136073600000.0, - y: 17510, - }, - { - x: 1167609600000.0, - y: 17400, - }, - { - x: 1199145600000.0, - y: 16049, - }, - ], - }, - { - key: ['James'], - values: [ - { - x: -157766400000.0, - y: 67506, - }, - { - x: -126230400000.0, - y: 65036, - }, - { - x: -94694400000.0, - y: 61554, - }, - { - x: -63158400000.0, - y: 60584, - }, - { - x: -31536000000.0, - y: 59824, - }, - { - x: 0.0, - y: 61597, - }, - { - x: 31536000000.0, - y: 54463, - }, - { - x: 63072000000.0, - y: 46960, - }, - { - x: 94694400000.0, - y: 42782, - }, - { - x: 126230400000.0, - y: 41258, - }, - { - x: 157766400000.0, - y: 39471, - }, - { - x: 189302400000.0, - y: 38203, - }, - { - x: 220924800000.0, - y: 39916, - }, - { - x: 252460800000.0, - y: 39783, - }, - { - x: 283996800000.0, - y: 39237, - }, - { - x: 315532800000.0, - y: 39185, - }, - { - x: 347155200000.0, - y: 38176, - }, - { - x: 378691200000.0, - y: 38750, - }, - { - x: 410227200000.0, - y: 36228, - }, - { - x: 441763200000.0, - y: 35728, - }, - { - x: 473385600000.0, - y: 35750, - }, - { - x: 504921600000.0, - y: 33955, - }, - { - x: 536457600000.0, - y: 32552, - }, - { - x: 567993600000.0, - y: 32418, - }, - { - x: 599616000000.0, - y: 32658, - }, - { - x: 631152000000.0, - y: 32288, - }, - { - x: 662688000000.0, - y: 30460, - }, - { - x: 694224000000.0, - y: 28450, - }, - { - x: 725846400000.0, - y: 26193, - }, - { - x: 757382400000.0, - y: 24706, - }, - { - x: 788918400000.0, - y: 22691, - }, - { - x: 820454400000.0, - y: 21122, - }, - { - x: 852076800000.0, - y: 20368, - }, - { - x: 883612800000.0, - y: 19651, - }, - { - x: 915148800000.0, - y: 18508, - }, - { - x: 946684800000.0, - y: 17939, - }, - { - x: 978307200000.0, - y: 17023, - }, - { - x: 1009843200000.0, - y: 16905, - }, - { - x: 1041379200000.0, - y: 16832, - }, - { - x: 1072915200000.0, - y: 16459, - }, - { - x: 1104537600000.0, - y: 16046, - }, - { - x: 1136073600000.0, - y: 16139, - }, - { - x: 1167609600000.0, - y: 15821, - }, - { - x: 1199145600000.0, - y: 14920, - }, - ], - }, - { - key: ['John'], - values: [ - { - x: -157766400000.0, - y: 71390, - }, - { - x: -126230400000.0, - y: 64858, - }, - { - x: -94694400000.0, - y: 61480, - }, - { - x: -63158400000.0, - y: 60754, - }, - { - x: -31536000000.0, - y: 58644, - }, - { - x: 0.0, - y: 58348, - }, - { - x: 31536000000.0, - y: 51382, - }, - { - x: 63072000000.0, - y: 43028, - }, - { - x: 94694400000.0, - y: 39061, - }, - { - x: 126230400000.0, - y: 37553, - }, - { - x: 157766400000.0, - y: 34970, - }, - { - x: 189302400000.0, - y: 33876, - }, - { - x: 220924800000.0, - y: 34103, - }, - { - x: 252460800000.0, - y: 33895, - }, - { - x: 283996800000.0, - y: 35305, - }, - { - x: 315532800000.0, - y: 35131, - }, - { - x: 347155200000.0, - y: 34761, - }, - { - x: 378691200000.0, - y: 34560, - }, - { - x: 410227200000.0, - y: 33047, - }, - { - x: 441763200000.0, - y: 32484, - }, - { - x: 473385600000.0, - y: 31397, - }, - { - x: 504921600000.0, - y: 30103, - }, - { - x: 536457600000.0, - y: 29462, - }, - { - x: 567993600000.0, - y: 29301, - }, - { - x: 599616000000.0, - y: 29751, - }, - { - x: 631152000000.0, - y: 29011, - }, - { - x: 662688000000.0, - y: 27727, - }, - { - x: 694224000000.0, - y: 26156, - }, - { - x: 725846400000.0, - y: 24918, - }, - { - x: 757382400000.0, - y: 24119, - }, - { - x: 788918400000.0, - y: 23174, - }, - { - x: 820454400000.0, - y: 22104, - }, - { - x: 852076800000.0, - y: 21330, - }, - { - x: 883612800000.0, - y: 20556, - }, - { - x: 915148800000.0, - y: 20280, - }, - { - x: 946684800000.0, - y: 20032, - }, - { - x: 978307200000.0, - y: 18839, - }, - { - x: 1009843200000.0, - y: 17400, - }, - { - x: 1041379200000.0, - y: 17170, - }, - { - x: 1072915200000.0, - y: 16381, - }, - { - x: 1104537600000.0, - y: 15692, - }, - { - x: 1136073600000.0, - y: 15083, - }, - { - x: 1167609600000.0, - y: 14348, - }, - { - x: 1199145600000.0, - y: 13110, - }, - ], - }, - { - key: ['Michael'], - values: [ - { - x: -157766400000.0, - y: 80812, - }, - { - x: -126230400000.0, - y: 79709, - }, - { - x: -94694400000.0, - y: 82204, - }, - { - x: -63158400000.0, - y: 81785, - }, - { - x: -31536000000.0, - y: 84893, - }, - { - x: 0.0, - y: 85015, - }, - { - x: 31536000000.0, - y: 77321, - }, - { - x: 63072000000.0, - y: 71197, - }, - { - x: 94694400000.0, - y: 67598, - }, - { - x: 126230400000.0, - y: 67304, - }, - { - x: 157766400000.0, - y: 68149, - }, - { - x: 189302400000.0, - y: 66686, - }, - { - x: 220924800000.0, - y: 67344, - }, - { - x: 252460800000.0, - y: 66875, - }, - { - x: 283996800000.0, - y: 67473, - }, - { - x: 315532800000.0, - y: 68375, - }, - { - x: 347155200000.0, - y: 68467, - }, - { - x: 378691200000.0, - y: 67904, - }, - { - x: 410227200000.0, - y: 67708, - }, - { - x: 441763200000.0, - y: 67457, - }, - { - x: 473385600000.0, - y: 64667, - }, - { - x: 504921600000.0, - y: 63959, - }, - { - x: 536457600000.0, - y: 63442, - }, - { - x: 567993600000.0, - y: 63924, - }, - { - x: 599616000000.0, - y: 65233, - }, - { - x: 631152000000.0, - y: 65138, - }, - { - x: 662688000000.0, - y: 60646, - }, - { - x: 694224000000.0, - y: 54216, - }, - { - x: 725846400000.0, - y: 49443, - }, - { - x: 757382400000.0, - y: 44361, - }, - { - x: 788918400000.0, - y: 41311, - }, - { - x: 820454400000.0, - y: 38284, - }, - { - x: 852076800000.0, - y: 37459, - }, - { - x: 883612800000.0, - y: 36525, - }, - { - x: 915148800000.0, - y: 33820, - }, - { - x: 946684800000.0, - y: 31956, - }, - { - x: 978307200000.0, - y: 29612, - }, - { - x: 1009843200000.0, - y: 28156, - }, - { - x: 1041379200000.0, - y: 27031, - }, - { - x: 1072915200000.0, - y: 25418, - }, - { - x: 1104537600000.0, - y: 23678, - }, - { - x: 1136073600000.0, - y: 22498, - }, - { - x: 1167609600000.0, - y: 21805, - }, - { - x: 1199145600000.0, - y: 20271, - }, - ], - }, -]; diff --git a/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/index.js b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/index.js deleted file mode 100644 index b7b5ff187..000000000 --- a/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/index.js +++ /dev/null @@ -1,14 +0,0 @@ -import { LineChartPlugin as LegacyLineChartPlugin } from '../../../../../superset-ui-preset-chart-xy/src/legacy'; -import { LineChartPlugin } from '../../../../../superset-ui-preset-chart-xy/src'; -import BasicStories from './stories/basic'; -import LegacyStories from './stories/legacy'; -import MissingStories from './stories/missing'; -import TimeShiftStories from './stories/timeShift'; -import { LINE_PLUGIN_TYPE, LINE_PLUGIN_LEGACY_TYPE } from './constants'; - -new LegacyLineChartPlugin().configure({ key: LINE_PLUGIN_LEGACY_TYPE }).register(); -new LineChartPlugin().configure({ key: LINE_PLUGIN_TYPE }).register(); - -export default { - examples: [...BasicStories, ...MissingStories, ...TimeShiftStories, ...LegacyStories], -}; diff --git a/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/stories/timeShift.tsx b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/stories/timeShift.tsx deleted file mode 100644 index 842c8cd35..000000000 --- a/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/stories/timeShift.tsx +++ /dev/null @@ -1,78 +0,0 @@ -/* eslint-disable no-magic-numbers, sort-keys */ -import * as React from 'react'; -import { SuperChart, ChartProps } from '@superset-ui/chart'; -import data from '../data/data2'; -import { BUBBLE_PLUGIN_TYPE } from '../constants'; - -export default [ - { - renderStory: () => [ - , - ], - storyName: 'with time shift', - storyPath: 'preset-chart-xy|LineChartPlugin', - }, -]; diff --git a/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/ScatterPlot/constants.ts b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/ScatterPlot/constants.ts new file mode 100644 index 000000000..70083c631 --- /dev/null +++ b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/ScatterPlot/constants.ts @@ -0,0 +1,2 @@ +export const SCATTER_PLOT_PLUGIN_TYPE = 'v2-scatter-plot'; +export const SCATTER_PLOT_PLUGIN_LEGACY_TYPE = 'v2-scatter-plot/legacy'; diff --git a/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/ScatterPlot/data/data.js b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/ScatterPlot/data/data.js new file mode 100644 index 000000000..e9aff588c --- /dev/null +++ b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/ScatterPlot/data/data.js @@ -0,0 +1,178 @@ +/* eslint-disable sort-keys, no-magic-numbers */ +export default [ + { + country_name: 'China', + region: 'East Asia & Pacific', + sum__SP_POP_TOTL: 1344130000, + sum__SP_RUR_TOTL_ZS: 49.427, + sum__SP_DYN_LE00_IN: 75.042, + }, + { + country_name: 'Indonesia', + region: 'East Asia & Pacific', + sum__SP_POP_TOTL: 244808254, + sum__SP_RUR_TOTL_ZS: 49.288, + sum__SP_DYN_LE00_IN: 70.3915609756, + }, + { + country_name: 'Japan', + region: 'East Asia & Pacific', + sum__SP_POP_TOTL: 127817277, + sum__SP_RUR_TOTL_ZS: 8.752, + sum__SP_DYN_LE00_IN: 82.5912195122, + }, + { + country_name: 'Philippines', + region: 'East Asia & Pacific', + sum__SP_POP_TOTL: 94501233, + sum__SP_RUR_TOTL_ZS: 54.983, + sum__SP_DYN_LE00_IN: 68.3914878049, + }, + { + country_name: 'Vietnam', + region: 'East Asia & Pacific', + sum__SP_POP_TOTL: 87840000, + sum__SP_RUR_TOTL_ZS: 68.971, + sum__SP_DYN_LE00_IN: 75.457902439, + }, + { + country_name: 'Thailand', + region: 'East Asia & Pacific', + sum__SP_POP_TOTL: 66902958, + sum__SP_RUR_TOTL_ZS: 54.606, + sum__SP_DYN_LE00_IN: 74.008902439, + }, + { + country_name: 'Myanmar', + region: 'East Asia & Pacific', + sum__SP_POP_TOTL: 52125411, + sum__SP_RUR_TOTL_ZS: 68.065, + sum__SP_DYN_LE00_IN: 64.7612439024, + }, + { + country_name: 'India', + region: 'South Asia', + sum__SP_POP_TOTL: 1247446011, + sum__SP_RUR_TOTL_ZS: 68.724, + sum__SP_DYN_LE00_IN: 65.9584878049, + }, + { + country_name: 'Pakistan', + region: 'South Asia', + sum__SP_POP_TOTL: 173669648, + sum__SP_RUR_TOTL_ZS: 62.993, + sum__SP_DYN_LE00_IN: 66.2838780488, + }, + { + country_name: 'Bangladesh', + region: 'South Asia', + sum__SP_POP_TOTL: 153405612, + sum__SP_RUR_TOTL_ZS: 68.775, + sum__SP_DYN_LE00_IN: 69.891804878, + }, + { + country_name: 'United States', + region: 'North America', + sum__SP_POP_TOTL: 311721632, + sum__SP_RUR_TOTL_ZS: 19.06, + sum__SP_DYN_LE00_IN: 78.6414634146, + }, + { + country_name: 'Brazil', + region: 'Latin America & Caribbean', + sum__SP_POP_TOTL: 200517584, + sum__SP_RUR_TOTL_ZS: 15.377, + sum__SP_DYN_LE00_IN: 73.3473658537, + }, + { + country_name: 'Mexico', + region: 'Latin America & Caribbean', + sum__SP_POP_TOTL: 120365271, + sum__SP_RUR_TOTL_ZS: 21.882, + sum__SP_DYN_LE00_IN: 76.9141707317, + }, + { + country_name: 'Nigeria', + region: 'Sub-Saharan Africa', + sum__SP_POP_TOTL: 163770669, + sum__SP_RUR_TOTL_ZS: 55.638, + sum__SP_DYN_LE00_IN: 51.7102439024, + }, + { + country_name: 'Ethiopia', + region: 'Sub-Saharan Africa', + sum__SP_POP_TOTL: 89858696, + sum__SP_RUR_TOTL_ZS: 82.265, + sum__SP_DYN_LE00_IN: 62.2528536585, + }, + { + country_name: 'Congo, Dem. Rep.', + region: 'Sub-Saharan Africa', + sum__SP_POP_TOTL: 68087376, + sum__SP_RUR_TOTL_ZS: 59.558, + sum__SP_DYN_LE00_IN: 49.3007073171, + }, + { + country_name: 'South Africa', + region: 'Sub-Saharan Africa', + sum__SP_POP_TOTL: 51553479, + sum__SP_RUR_TOTL_ZS: 37.254, + sum__SP_DYN_LE00_IN: 55.2956585366, + }, + { + country_name: 'Russian Federation', + region: 'Europe & Central Asia', + sum__SP_POP_TOTL: 142960868, + sum__SP_RUR_TOTL_ZS: 26.268, + sum__SP_DYN_LE00_IN: 69.6585365854, + }, + { + country_name: 'Germany', + region: 'Europe & Central Asia', + sum__SP_POP_TOTL: 81797673, + sum__SP_RUR_TOTL_ZS: 25.512, + sum__SP_DYN_LE00_IN: 80.7414634146, + }, + { + country_name: 'Turkey', + region: 'Europe & Central Asia', + sum__SP_POP_TOTL: 73199372, + sum__SP_RUR_TOTL_ZS: 28.718, + sum__SP_DYN_LE00_IN: 74.5404878049, + }, + { + country_name: 'France', + region: 'Europe & Central Asia', + sum__SP_POP_TOTL: 65342776, + sum__SP_RUR_TOTL_ZS: 21.416, + sum__SP_DYN_LE00_IN: 82.1146341463, + }, + { + country_name: 'United Kingdom', + region: 'Europe & Central Asia', + sum__SP_POP_TOTL: 63258918, + sum__SP_RUR_TOTL_ZS: 18.43, + sum__SP_DYN_LE00_IN: 80.9512195122, + }, + { + country_name: 'Italy', + region: 'Europe & Central Asia', + sum__SP_POP_TOTL: 59379449, + sum__SP_RUR_TOTL_ZS: 31.556, + sum__SP_DYN_LE00_IN: 82.187804878, + }, + { + country_name: 'Egypt, Arab Rep.', + region: 'Middle East & North Africa', + sum__SP_POP_TOTL: 83787634, + sum__SP_RUR_TOTL_ZS: 57, + sum__SP_DYN_LE00_IN: 70.6785609756, + }, + { + country_name: 'Iran, Islamic Rep.', + region: 'Middle East & North Africa', + sum__SP_POP_TOTL: 75184322, + sum__SP_RUR_TOTL_ZS: 28.8, + sum__SP_DYN_LE00_IN: 73.4493170732, + }, +]; diff --git a/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/ScatterPlot/data/legacyData.js b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/ScatterPlot/data/legacyData.js new file mode 100644 index 000000000..37a26d3ec --- /dev/null +++ b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/ScatterPlot/data/legacyData.js @@ -0,0 +1,338 @@ +/* eslint-disable sort-keys, no-magic-numbers */ +export default [ + { + key: 'East Asia & Pacific', + values: [ + { + country_name: 'China', + region: 'East Asia & Pacific', + sum__SP_POP_TOTL: 1344130000.0, + sum__SP_RUR_TOTL_ZS: 49.427, + sum__SP_DYN_LE00_IN: 75.042, + x: 49.427, + y: 75.042, + size: 1344130000.0, + shape: 'circle', + group: 'East Asia & Pacific', + }, + { + country_name: 'Indonesia', + region: 'East Asia & Pacific', + sum__SP_POP_TOTL: 244808254.0, + sum__SP_RUR_TOTL_ZS: 49.288, + sum__SP_DYN_LE00_IN: 70.3915609756, + x: 49.288, + y: 70.3915609756, + size: 244808254.0, + shape: 'circle', + group: 'East Asia & Pacific', + }, + { + country_name: 'Japan', + region: 'East Asia & Pacific', + sum__SP_POP_TOTL: 127817277.0, + sum__SP_RUR_TOTL_ZS: 8.752, + sum__SP_DYN_LE00_IN: 82.5912195122, + x: 8.752, + y: 82.5912195122, + size: 127817277.0, + shape: 'circle', + group: 'East Asia & Pacific', + }, + { + country_name: 'Philippines', + region: 'East Asia & Pacific', + sum__SP_POP_TOTL: 94501233.0, + sum__SP_RUR_TOTL_ZS: 54.983, + sum__SP_DYN_LE00_IN: 68.3914878049, + x: 54.983, + y: 68.3914878049, + size: 94501233.0, + shape: 'circle', + group: 'East Asia & Pacific', + }, + { + country_name: 'Vietnam', + region: 'East Asia & Pacific', + sum__SP_POP_TOTL: 87840000.0, + sum__SP_RUR_TOTL_ZS: 68.971, + sum__SP_DYN_LE00_IN: 75.457902439, + x: 68.971, + y: 75.457902439, + size: 87840000.0, + shape: 'circle', + group: 'East Asia & Pacific', + }, + { + country_name: 'Thailand', + region: 'East Asia & Pacific', + sum__SP_POP_TOTL: 66902958.0, + sum__SP_RUR_TOTL_ZS: 54.606, + sum__SP_DYN_LE00_IN: 74.008902439, + x: 54.606, + y: 74.008902439, + size: 66902958.0, + shape: 'circle', + group: 'East Asia & Pacific', + }, + { + country_name: 'Myanmar', + region: 'East Asia & Pacific', + sum__SP_POP_TOTL: 52125411.0, + sum__SP_RUR_TOTL_ZS: 68.065, + sum__SP_DYN_LE00_IN: 64.7612439024, + x: 68.065, + y: 64.7612439024, + size: 52125411.0, + shape: 'circle', + group: 'East Asia & Pacific', + }, + ], + }, + { + key: 'South Asia', + values: [ + { + country_name: 'India', + region: 'South Asia', + sum__SP_POP_TOTL: 1247446011.0, + sum__SP_RUR_TOTL_ZS: 68.724, + sum__SP_DYN_LE00_IN: 65.9584878049, + x: 68.724, + y: 65.9584878049, + size: 1247446011.0, + shape: 'circle', + group: 'South Asia', + }, + { + country_name: 'Pakistan', + region: 'South Asia', + sum__SP_POP_TOTL: 173669648.0, + sum__SP_RUR_TOTL_ZS: 62.993, + sum__SP_DYN_LE00_IN: 66.2838780488, + x: 62.993, + y: 66.2838780488, + size: 173669648.0, + shape: 'circle', + group: 'South Asia', + }, + { + country_name: 'Bangladesh', + region: 'South Asia', + sum__SP_POP_TOTL: 153405612.0, + sum__SP_RUR_TOTL_ZS: 68.775, + sum__SP_DYN_LE00_IN: 69.891804878, + x: 68.775, + y: 69.891804878, + size: 153405612.0, + shape: 'circle', + group: 'South Asia', + }, + ], + }, + { + key: 'North America', + values: [ + { + country_name: 'United States', + region: 'North America', + sum__SP_POP_TOTL: 311721632.0, + sum__SP_RUR_TOTL_ZS: 19.06, + sum__SP_DYN_LE00_IN: 78.6414634146, + x: 19.06, + y: 78.6414634146, + size: 311721632.0, + shape: 'circle', + group: 'North America', + }, + ], + }, + { + key: 'Latin America & Caribbean', + values: [ + { + country_name: 'Brazil', + region: 'Latin America & Caribbean', + sum__SP_POP_TOTL: 200517584.0, + sum__SP_RUR_TOTL_ZS: 15.377, + sum__SP_DYN_LE00_IN: 73.3473658537, + x: 15.377, + y: 73.3473658537, + size: 200517584.0, + shape: 'circle', + group: 'Latin America & Caribbean', + }, + { + country_name: 'Mexico', + region: 'Latin America & Caribbean', + sum__SP_POP_TOTL: 120365271.0, + sum__SP_RUR_TOTL_ZS: 21.882, + sum__SP_DYN_LE00_IN: 76.9141707317, + x: 21.882, + y: 76.9141707317, + size: 120365271.0, + shape: 'circle', + group: 'Latin America & Caribbean', + }, + ], + }, + { + key: 'Sub-Saharan Africa', + values: [ + { + country_name: 'Nigeria', + region: 'Sub-Saharan Africa', + sum__SP_POP_TOTL: 163770669.0, + sum__SP_RUR_TOTL_ZS: 55.638, + sum__SP_DYN_LE00_IN: 51.7102439024, + x: 55.638, + y: 51.7102439024, + size: 163770669.0, + shape: 'circle', + group: 'Sub-Saharan Africa', + }, + { + country_name: 'Ethiopia', + region: 'Sub-Saharan Africa', + sum__SP_POP_TOTL: 89858696.0, + sum__SP_RUR_TOTL_ZS: 82.265, + sum__SP_DYN_LE00_IN: 62.2528536585, + x: 82.265, + y: 62.2528536585, + size: 89858696.0, + shape: 'circle', + group: 'Sub-Saharan Africa', + }, + { + country_name: 'Congo, Dem. Rep.', + region: 'Sub-Saharan Africa', + sum__SP_POP_TOTL: 68087376.0, + sum__SP_RUR_TOTL_ZS: 59.558, + sum__SP_DYN_LE00_IN: 49.3007073171, + x: 59.558, + y: 49.3007073171, + size: 68087376.0, + shape: 'circle', + group: 'Sub-Saharan Africa', + }, + { + country_name: 'South Africa', + region: 'Sub-Saharan Africa', + sum__SP_POP_TOTL: 51553479.0, + sum__SP_RUR_TOTL_ZS: 37.254, + sum__SP_DYN_LE00_IN: 55.2956585366, + x: 37.254, + y: 55.2956585366, + size: 51553479.0, + shape: 'circle', + group: 'Sub-Saharan Africa', + }, + ], + }, + { + key: 'Europe & Central Asia', + values: [ + { + country_name: 'Russian Federation', + region: 'Europe & Central Asia', + sum__SP_POP_TOTL: 142960868.0, + sum__SP_RUR_TOTL_ZS: 26.268, + sum__SP_DYN_LE00_IN: 69.6585365854, + x: 26.268, + y: 69.6585365854, + size: 142960868.0, + shape: 'circle', + group: 'Europe & Central Asia', + }, + { + country_name: 'Germany', + region: 'Europe & Central Asia', + sum__SP_POP_TOTL: 81797673.0, + sum__SP_RUR_TOTL_ZS: 25.512, + sum__SP_DYN_LE00_IN: 80.7414634146, + x: 25.512, + y: 80.7414634146, + size: 81797673.0, + shape: 'circle', + group: 'Europe & Central Asia', + }, + { + country_name: 'Turkey', + region: 'Europe & Central Asia', + sum__SP_POP_TOTL: 73199372.0, + sum__SP_RUR_TOTL_ZS: 28.718, + sum__SP_DYN_LE00_IN: 74.5404878049, + x: 28.718, + y: 74.5404878049, + size: 73199372.0, + shape: 'circle', + group: 'Europe & Central Asia', + }, + { + country_name: 'France', + region: 'Europe & Central Asia', + sum__SP_POP_TOTL: 65342776.0, + sum__SP_RUR_TOTL_ZS: 21.416, + sum__SP_DYN_LE00_IN: 82.1146341463, + x: 21.416, + y: 82.1146341463, + size: 65342776.0, + shape: 'circle', + group: 'Europe & Central Asia', + }, + { + country_name: 'United Kingdom', + region: 'Europe & Central Asia', + sum__SP_POP_TOTL: 63258918.0, + sum__SP_RUR_TOTL_ZS: 18.43, + sum__SP_DYN_LE00_IN: 80.9512195122, + x: 18.43, + y: 80.9512195122, + size: 63258918.0, + shape: 'circle', + group: 'Europe & Central Asia', + }, + { + country_name: 'Italy', + region: 'Europe & Central Asia', + sum__SP_POP_TOTL: 59379449.0, + sum__SP_RUR_TOTL_ZS: 31.556, + sum__SP_DYN_LE00_IN: 82.187804878, + x: 31.556, + y: 82.187804878, + size: 59379449.0, + shape: 'circle', + group: 'Europe & Central Asia', + }, + ], + }, + { + key: 'Middle East & North Africa', + values: [ + { + country_name: 'Egypt, Arab Rep.', + region: 'Middle East & North Africa', + sum__SP_POP_TOTL: 83787634.0, + sum__SP_RUR_TOTL_ZS: 57.0, + sum__SP_DYN_LE00_IN: 70.6785609756, + x: 57.0, + y: 70.6785609756, + size: 83787634.0, + shape: 'circle', + group: 'Middle East & North Africa', + }, + { + country_name: 'Iran, Islamic Rep.', + region: 'Middle East & North Africa', + sum__SP_POP_TOTL: 75184322.0, + sum__SP_RUR_TOTL_ZS: 28.8, + sum__SP_DYN_LE00_IN: 73.4493170732, + x: 28.8, + y: 73.4493170732, + size: 75184322.0, + shape: 'circle', + group: 'Middle East & North Africa', + }, + ], + }, +]; diff --git a/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/ScatterPlot/index.js b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/ScatterPlot/index.js new file mode 100644 index 000000000..614efc99e --- /dev/null +++ b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/ScatterPlot/index.js @@ -0,0 +1,13 @@ +import { ScatterPlotPlugin as LegacyScatterPlotPlugin } from '../../../../../superset-ui-preset-chart-xy/src/legacy'; +import { ScatterPlotPlugin } from '../../../../../superset-ui-preset-chart-xy/src'; +import BasicStories from './stories/basic'; +import BubbleStories from './stories/bubble'; +import LegacyStories from './stories/legacy'; +import { SCATTER_PLOT_PLUGIN_TYPE, SCATTER_PLOT_PLUGIN_LEGACY_TYPE } from './constants'; + +new LegacyScatterPlotPlugin().configure({ key: SCATTER_PLOT_PLUGIN_LEGACY_TYPE }).register(); +new ScatterPlotPlugin().configure({ key: SCATTER_PLOT_PLUGIN_TYPE }).register(); + +export default { + examples: [...BasicStories, ...BubbleStories], +}; diff --git a/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/stories/basic.jsx b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/ScatterPlot/stories/basic.jsx similarity index 72% rename from packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/stories/basic.jsx rename to packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/ScatterPlot/stories/basic.jsx index 1a0d04d70..b18824789 100644 --- a/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/stories/basic.jsx +++ b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/ScatterPlot/stories/basic.jsx @@ -3,44 +3,41 @@ import * as React from 'react'; import { SuperChart, ChartProps } from '@superset-ui/chart'; import { radios } from '@storybook/addon-knobs'; import data from '../data/data'; -import { BUBBLE_PLUGIN_TYPE } from '../constants'; +import { SCATTER_PLOT_PLUGIN_TYPE } from '../constants'; export default [ { renderStory: () => [ , ], storyName: 'Basic', - storyPath: 'preset-chart-xy|LineChartPlugin', + storyPath: 'preset-chart-xy|ScatterPlotPlugin', }, ]; diff --git a/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/stories/missing.tsx b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/ScatterPlot/stories/bubble.jsx similarity index 50% rename from packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/stories/missing.tsx rename to packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/ScatterPlot/stories/bubble.jsx index 1da18ec62..56d9fb4f0 100644 --- a/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/stories/missing.tsx +++ b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/ScatterPlot/stories/bubble.jsx @@ -1,67 +1,64 @@ /* eslint-disable no-magic-numbers, sort-keys */ import * as React from 'react'; import { SuperChart, ChartProps } from '@superset-ui/chart'; +import { radios } from '@storybook/addon-knobs'; import data from '../data/data'; -import { LINE_PLUGIN_TYPE } from '../constants'; - -const missingData = { - keys: data.keys, - values: data.values.map(({ y, ...rest }) => ({ - ...rest, - y: Math.random() < 0.25 ? null : y, - })), -}; +import { SCATTER_PLOT_PLUGIN_TYPE } from '../constants'; export default [ { renderStory: () => [ , ], - storyName: 'with missing data', - storyPath: 'preset-chart-xy|LineChartPlugin', + storyName: 'Bubble', + storyPath: 'preset-chart-xy|ScatterPlotPlugin', }, ]; diff --git a/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/stories/legacy.tsx b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/ScatterPlot/stories/legacy.tsx similarity index 88% rename from packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/stories/legacy.tsx rename to packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/ScatterPlot/stories/legacy.tsx index b981d9d02..553b84a82 100644 --- a/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/Bubble/stories/legacy.tsx +++ b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/ScatterPlot/stories/legacy.tsx @@ -2,14 +2,14 @@ import * as React from 'react'; import { SuperChart, ChartProps } from '@superset-ui/chart'; import data from '../data/legacyData'; -import { BUBBLE_PLUGIN_LEGACY_TYPE } from '../constants'; +import { SCATTER_PLOT_PLUGIN_LEGACY_TYPE } from '../constants'; export default [ { renderStory: () => [ , , ], storyName: 'Use Legacy API shim', - storyPath: 'preset-chart-xy|LineChartPlugin', + storyPath: 'preset-chart-xy|ScatterPlotPlugin', }, ]; diff --git a/packages/superset-ui-preset-chart-xy/src/BoxPlot/BoxPlot.tsx b/packages/superset-ui-preset-chart-xy/src/BoxPlot/BoxPlot.tsx index 58676abfb..47add4725 100644 --- a/packages/superset-ui-preset-chart-xy/src/BoxPlot/BoxPlot.tsx +++ b/packages/superset-ui-preset-chart-xy/src/BoxPlot/BoxPlot.tsx @@ -1,21 +1,3 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ /* eslint-disable sort-keys, no-magic-numbers, complexity */ import React from 'react'; import { BoxPlotSeries, XYChart } from '@data-ui/xy-chart'; diff --git a/packages/superset-ui-preset-chart-xy/src/Bubble/Bubble.tsx b/packages/superset-ui-preset-chart-xy/src/Bubble/Bubble.tsx deleted file mode 100644 index 481d94a10..000000000 --- a/packages/superset-ui-preset-chart-xy/src/Bubble/Bubble.tsx +++ /dev/null @@ -1,237 +0,0 @@ -/* eslint-disable sort-keys, no-magic-numbers, complexity */ - -import React, { PureComponent } from 'react'; -import { - AreaSeries, - LinearGradient, - LineSeries, - XYChart, - CrossHair, - WithTooltip, -} from '@data-ui/xy-chart'; -import { chartTheme, ChartTheme } from '@data-ui/theme'; -import { Margin, Dimension } from '@superset-ui/dimension'; -import { groupBy, flatMap, uniqueId, values } from 'lodash'; -import { createSelector } from 'reselect'; -import createTooltip from './createTooltip'; -import XYChartLayout from '../utils/XYChartLayout'; -import WithLegend from '../components/WithLegend'; -import Encoder, { ChannelTypes, Encoding, Outputs } from './Encoder'; -import { Dataset, PlainObject } from '../encodeable/types/Data'; -import ChartLegend from '../components/ChartLegend'; - -chartTheme.gridStyles.stroke = '#f1f3f5'; - -const defaultProps = { - className: '', - margin: { top: 20, right: 20, left: 20, bottom: 20 }, - theme: chartTheme, -}; - -type Props = { - className?: string; - width: string | number; - height: string | number; - margin?: Margin; - encoding: Encoding; - data: Dataset; - theme?: ChartTheme; -} & Readonly; - -export interface Series { - key: string; - color: Outputs['color']; - fill: Outputs['fill']; - strokeDasharray: Outputs['strokeDasharray']; - values: SeriesValue[]; -} - -export interface SeriesValue { - x: Outputs['x']; - y: Outputs['y']; - data: PlainObject; - parent: Series; -} - -const CIRCLE_STYLE = { strokeWidth: 1.5 }; - -class LineChart extends PureComponent { - static defaultProps = defaultProps; - - constructor(props: Props) { - super(props); - - const createEncoder = createSelector( - (enc: Encoding) => enc, - (enc: Encoding) => new Encoder({ encoding: enc }), - ); - - this.createEncoder = () => { - this.encoder = createEncoder(this.props.encoding); - }; - - this.encoder = createEncoder(this.props.encoding); - this.renderChart = this.renderChart.bind(this); - } - - encoder: Encoder; - private createEncoder: () => void; - - renderChart(dim: Dimension) { - const { width, height } = dim; - const { data, encoding, margin, theme } = this.props; - - const fieldNames = data.keys - .filter(k => k !== encoding.x.field && k !== encoding.y.field) - .sort((a, b) => a.localeCompare(b)); - - const groups = groupBy(data.values, row => fieldNames.map(f => `${f}=${row[f]}`).join(',')); - - const allSeries = values(groups).map(seriesData => { - const firstDatum = seriesData[0]; - - const series: Series = { - key: fieldNames.map(f => firstDatum[f]).join(','), - color: this.encoder.channels.color.encode(firstDatum), - fill: this.encoder.channels.fill.encode(firstDatum, false), - strokeDasharray: this.encoder.channels.strokeDasharray.encode(firstDatum), - values: [], - }; - - series.values = seriesData.map(v => ({ - x: this.encoder.channels.x.encode(v), - y: this.encoder.channels.y.encode(v), - data: v, - parent: series, - })); - - return series; - }); - - const filledSeries = flatMap( - allSeries - .filter(({ fill }) => fill) - .map(series => { - const gradientId = uniqueId(`gradient-${series.key}`); - - return [ - , - , - ]; - }), - ); - - const unfilledSeries = allSeries - .filter(({ fill }) => !fill) - .map(series => ( - - )); - - const children = filledSeries.concat(unfilledSeries); - - const layout = new XYChartLayout({ - width, - height, - margin, - theme, - xEncoder: this.encoder.channels.x, - yEncoder: this.encoder.channels.y, - children, - }); - - return layout.renderChartWithFrame((chartDim: Dimension) => ( - - {({ - onMouseLeave, - onMouseMove, - tooltipData, - }: { - onMouseLeave: (...args: any[]) => void; - onMouseMove: (...args: any[]) => void; - tooltipData: any; - }) => ( - - {children} - {layout.renderXAxis()} - {layout.renderYAxis()} - - d.y === tooltipData.datum.y ? d.parent.color : '#fff' - } - circleSize={(d: SeriesValue) => (d.y === tooltipData.datum.y ? 6 : 4)} - circleStroke={(d: SeriesValue) => - d.y === tooltipData.datum.y ? '#fff' : d.parent.color - } - circleStyles={CIRCLE_STYLE} - stroke="#ccc" - showCircle - showMultipleCircles - /> - - )} - - )); - } - - render() { - const { className, data, width, height } = this.props; - - this.createEncoder(); - const renderLegend = this.encoder.hasLegend() - ? // eslint-disable-next-line react/jsx-props-no-multi-spaces - () => data={data} encoder={this.encoder} /> - : undefined; - - return ( - - ); - } -} - -export default LineChart; diff --git a/packages/superset-ui-preset-chart-xy/src/Bubble/createTooltip.tsx b/packages/superset-ui-preset-chart-xy/src/Bubble/createTooltip.tsx deleted file mode 100644 index bda7d09d4..000000000 --- a/packages/superset-ui-preset-chart-xy/src/Bubble/createTooltip.tsx +++ /dev/null @@ -1,63 +0,0 @@ -/* eslint-disable no-magic-numbers */ - -import React from 'react'; -import TooltipFrame from '../components/tooltip/TooltipFrame'; -import TooltipTable from '../components/tooltip/TooltipTable'; -import { Series, SeriesValue } from './Bubble'; -import Encoder from './Encoder'; - -const MARK_STYLE = { marginRight: 4 }; - -export default function createTooltip(encoder: Encoder, allSeries: Series[]) { - function LineTooltip({ - datum, - series = {}, - }: { - datum: SeriesValue; - series: { - [key: string]: { - y: number; - }; - }; - }) { - return ( - - <> -
- {encoder.channels.x.formatValue(datum.x)} -
-
- {series && ( - series[key]) - .concat() - .sort((a, b) => series[b.key].y - series[a.key].y) - .map(({ key, color, strokeDasharray }) => ({ - key, - keyColumn: ( - <> - - - - {series[key] === datum ? {key} : key} - - ), - valueColumn: encoder.channels.y.formatValue(series[key].y), - }))} - /> - )} - -
- ); - } - - return LineTooltip; -} diff --git a/packages/superset-ui-preset-chart-xy/src/Bubble/legacy/metadata.ts b/packages/superset-ui-preset-chart-xy/src/Bubble/legacy/metadata.ts deleted file mode 100644 index 2f532e6a2..000000000 --- a/packages/superset-ui-preset-chart-xy/src/Bubble/legacy/metadata.ts +++ /dev/null @@ -1,6 +0,0 @@ -import metadata from '../metadata'; - -const legacyMetadata = metadata.clone(); -legacyMetadata.useLegacyApi = true; - -export default legacyMetadata; diff --git a/packages/superset-ui-preset-chart-xy/src/Bubble/metadata.ts b/packages/superset-ui-preset-chart-xy/src/Bubble/metadata.ts deleted file mode 100644 index 5e5f46099..000000000 --- a/packages/superset-ui-preset-chart-xy/src/Bubble/metadata.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { t } from '@superset-ui/translation'; -import { ChartMetadata } from '@superset-ui/chart'; -import thumbnail from './images/thumbnail.png'; - -const metadata = new ChartMetadata({ - description: '', - name: t('Bubble Chart'), - thumbnail, -}); - -export default metadata; diff --git a/packages/superset-ui-preset-chart-xy/src/Bubble/Encoder.ts b/packages/superset-ui-preset-chart-xy/src/ScatterPlot/Encoder.ts similarity index 51% rename from packages/superset-ui-preset-chart-xy/src/Bubble/Encoder.ts rename to packages/superset-ui-preset-chart-xy/src/ScatterPlot/Encoder.ts index 0b13b0900..bbda94638 100644 --- a/packages/superset-ui-preset-chart-xy/src/Bubble/Encoder.ts +++ b/packages/superset-ui-preset-chart-xy/src/ScatterPlot/Encoder.ts @@ -5,21 +5,13 @@ import { EncodingFromChannelsAndOutputs } from '../encodeable/types/Channel'; /** * Define channel types */ -// This is a workaround until TypeScript 3.4 which has const context -// which will allow use to derive type from object literal -// without type widening (e.g. 'X' instead of string). -// Now we have to define class with readonly fields -// to be able to use "typeof" to infer strict types -// See more details from -// https://github.com/Microsoft/TypeScript/issues/20195 -// https://github.com/Microsoft/TypeScript/pull/29510 -const channelTypes = new (class Channels { - readonly x = 'X'; - readonly y = 'Y'; - readonly color = 'Color'; - readonly fill = 'Category'; - readonly strokeDasharray = 'Category'; -})(); +const channelTypes = { + fill: 'Color', + size: 'Numeric', + stroke: 'Color', + x: 'X', + y: 'Y', +} as const; export type ChannelTypes = typeof channelTypes; @@ -27,11 +19,11 @@ export type ChannelTypes = typeof channelTypes; * Define output type for each channel */ export interface Outputs { + fill: string; + size: number; + stroke: string; x: number | null; y: number | null; - color: string; - fill: boolean; - strokeDasharray: string; } /** @@ -41,16 +33,14 @@ export type Encoding = EncodingFromChannelsAndOutputs; export default class Encoder extends AbstractEncoder { static readonly DEFAULT_ENCODINGS: Encoding = { - color: { value: '#222' }, - fill: { value: false }, - strokeDasharray: { value: '' }, + fill: { value: '#222' }, + size: { value: 5 }, + stroke: { value: 'none' }, x: { field: 'x', type: 'quantitative' }, y: { field: 'y', type: 'quantitative' }, }; - static readonly CHANNEL_OPTIONS = { - fill: { legend: false }, - }; + static readonly CHANNEL_OPTIONS = {}; constructor(spec: PartialSpec) { super(channelTypes, spec, Encoder.DEFAULT_ENCODINGS, Encoder.CHANNEL_OPTIONS); diff --git a/packages/superset-ui-preset-chart-xy/src/ScatterPlot/ScatterPlot.tsx b/packages/superset-ui-preset-chart-xy/src/ScatterPlot/ScatterPlot.tsx new file mode 100644 index 000000000..8c882fab3 --- /dev/null +++ b/packages/superset-ui-preset-chart-xy/src/ScatterPlot/ScatterPlot.tsx @@ -0,0 +1,163 @@ +/* eslint-disable sort-keys, no-magic-numbers, complexity */ +import React, { PureComponent } from 'react'; +import { XYChart, CrossHair, PointSeries } from '@data-ui/xy-chart'; +import { chartTheme, ChartTheme } from '@data-ui/theme'; +import { Margin, Dimension } from '@superset-ui/dimension'; +import { extent as d3Extent } from 'd3-array'; +import { createSelector } from 'reselect'; +import createTooltip from './createTooltip'; +import XYChartLayout from '../utils/XYChartLayout'; +import WithLegend from '../components/WithLegend'; +import Encoder, { ChannelTypes, Encoding, Outputs } from './Encoder'; +import { Dataset, PlainObject } from '../encodeable/types/Data'; +import ChartLegend from '../components/legend/ChartLegend'; + +chartTheme.gridStyles.stroke = '#f1f3f5'; + +const DEFAULT_MARGIN = { top: 20, right: 20, left: 20, bottom: 20 }; + +const defaultProps = { + className: '', + margin: DEFAULT_MARGIN, + theme: chartTheme, +} as const; + +type Props = { + className?: string; + width: string | number; + height: string | number; + margin?: Margin; + encoding: Encoding; + data: Dataset; + theme?: ChartTheme; +} & Readonly; + +export interface EncodedPoint { + x: Outputs['x']; + y: Outputs['y']; + size: Outputs['size']; + fill: Outputs['fill']; + stroke: Outputs['stroke']; + data: PlainObject; +} + +export default class ScatterPlot extends PureComponent { + static defaultProps = defaultProps; + + encoder: Encoder; + private createEncoder: () => void; + + constructor(props: Props) { + super(props); + + const createEncoder = createSelector( + (enc: Encoding) => enc, + (enc: Encoding) => new Encoder({ encoding: enc }), + ); + + this.createEncoder = () => { + this.encoder = createEncoder(this.props.encoding); + }; + + this.encoder = createEncoder(this.props.encoding); + this.renderChart = this.renderChart.bind(this); + } + + renderChart(dim: Dimension) { + const { width, height } = dim; + const { data, margin, theme } = this.props; + const { channels } = this.encoder; + + if (typeof channels.size.scale !== 'undefined') { + const domain = d3Extent(data, d => channels.size.get(d)); + const [min, max] = domain; + const adjustedDomain = [Math.min(min || 0, 0), Math.max(max || 1, 1)]; + channels.size.scale.setDomain(adjustedDomain); + // channels.x.definition.scale.domain = adjustedDomain; + } + + const encodedData = data.map(d => ({ + x: channels.x.get(d), + y: channels.y.get(d), + size: channels.size.encode(d), + fill: channels.fill.encode(d), + stroke: channels.stroke.encode(d), + data: d, + })); + + // if (typeof channels.x.scale !== 'undefined') { + // const xDomain = d3Extent(encodedData, d => d.x); + // const [min, max] = xDomain; + // const adjustedDomain = [Math.min(min || 0, 0), Math.max(max || 1, 1)]; + // // channels.x.scale.setDomain(adjustedDomain); + // // channels.x.definition.scale.domain = adjustedDomain; + // } + // if (typeof channels.y.scale !== 'undefined') { + // const yDomain = d3Extent(encodedData, d => d.y); + // const [min, max] = yDomain; + // const adjustedDomain = [Math.min(min || 0, 0), Math.max(max || 1, 1)]; + // // channels.y.scale.setDomain(adjustedDomain); + // // channels.y.definition.scale.domain = adjustedDomain; + // } + + const children = [ + d.fill} + fillOpacity={0.5} + stroke={(d: EncodedPoint) => d.stroke} + size={(d: EncodedPoint) => d.size} + />, + ]; + + const layout = new XYChartLayout({ + width, + height, + margin: { ...DEFAULT_MARGIN, ...margin }, + theme, + xEncoder: channels.x, + yEncoder: channels.y, + children, + }); + + return layout.renderChartWithFrame((chartDim: Dimension) => ( + + {children} + {layout.renderXAxis()} + {layout.renderYAxis()} + + )); + } + + render() { + const { className, data, width, height } = this.props; + + this.createEncoder(); + const renderLegend = this.encoder.hasLegend() + ? // eslint-disable-next-line react/jsx-props-no-multi-spaces + () => data={data} encoder={this.encoder} /> + : undefined; + + return ( + + ); + } +} diff --git a/packages/superset-ui-preset-chart-xy/src/ScatterPlot/createMetadata.ts b/packages/superset-ui-preset-chart-xy/src/ScatterPlot/createMetadata.ts new file mode 100644 index 000000000..29a790802 --- /dev/null +++ b/packages/superset-ui-preset-chart-xy/src/ScatterPlot/createMetadata.ts @@ -0,0 +1,12 @@ +import { t } from '@superset-ui/translation'; +import { ChartMetadata } from '@superset-ui/chart'; +import thumbnail from './images/thumbnail.png'; + +export default function createMetadata(useLegacyApi = false) { + return new ChartMetadata({ + description: '', + name: t('Scatter Plot'), + thumbnail, + useLegacyApi, + }); +} diff --git a/packages/superset-ui-preset-chart-xy/src/ScatterPlot/createTooltip.tsx b/packages/superset-ui-preset-chart-xy/src/ScatterPlot/createTooltip.tsx new file mode 100644 index 000000000..669173c16 --- /dev/null +++ b/packages/superset-ui-preset-chart-xy/src/ScatterPlot/createTooltip.tsx @@ -0,0 +1,50 @@ +/* eslint-disable no-magic-numbers */ + +import React from 'react'; +import TooltipFrame from '../components/tooltip/TooltipFrame'; +import TooltipTable from '../components/tooltip/TooltipTable'; +import Encoder from './Encoder'; +import { isFieldDef } from '../encodeable/types/ChannelDef'; +import { EncodedPoint } from './ScatterPlot'; + +export default function createTooltip(encoder: Encoder) { + function Tooltip({ datum }: { datum: EncodedPoint }) { + const { channels } = encoder; + const { x, y, size, fill, stroke } = channels; + + const tooltipRows = [ + { key: 'x', keyColumn: x.getTitle(), valueColumn: x.format(datum.data) }, + { key: 'y', keyColumn: y.getTitle(), valueColumn: y.format(datum.data) }, + ]; + + if (isFieldDef(fill.definition)) { + tooltipRows.push({ + key: 'fill', + keyColumn: fill.getTitle(), + valueColumn: fill.format(datum.data), + }); + } + if (isFieldDef(stroke.definition)) { + tooltipRows.push({ + key: 'stroke', + keyColumn: stroke.getTitle(), + valueColumn: stroke.format(datum.data), + }); + } + if (isFieldDef(size.definition)) { + tooltipRows.push({ + key: 'size', + keyColumn: size.getTitle(), + valueColumn: size.format(datum.data), + }); + } + + return ( + + + + ); + } + + return Tooltip; +} diff --git a/packages/superset-ui-preset-chart-xy/src/Bubble/images/thumbnail.png b/packages/superset-ui-preset-chart-xy/src/ScatterPlot/images/thumbnail.png similarity index 100% rename from packages/superset-ui-preset-chart-xy/src/Bubble/images/thumbnail.png rename to packages/superset-ui-preset-chart-xy/src/ScatterPlot/images/thumbnail.png diff --git a/packages/superset-ui-preset-chart-xy/src/Bubble/images/thumbnailLarge.png b/packages/superset-ui-preset-chart-xy/src/ScatterPlot/images/thumbnailLarge.png similarity index 100% rename from packages/superset-ui-preset-chart-xy/src/Bubble/images/thumbnailLarge.png rename to packages/superset-ui-preset-chart-xy/src/ScatterPlot/images/thumbnailLarge.png diff --git a/packages/superset-ui-preset-chart-xy/src/Bubble/index.ts b/packages/superset-ui-preset-chart-xy/src/ScatterPlot/index.ts similarity index 63% rename from packages/superset-ui-preset-chart-xy/src/Bubble/index.ts rename to packages/superset-ui-preset-chart-xy/src/ScatterPlot/index.ts index c0111f4a9..08a9615de 100644 --- a/packages/superset-ui-preset-chart-xy/src/Bubble/index.ts +++ b/packages/superset-ui-preset-chart-xy/src/ScatterPlot/index.ts @@ -1,12 +1,12 @@ import { ChartPlugin } from '@superset-ui/chart'; -import metadata from './metadata'; +import createMetadata from './createMetadata'; import transformProps from './transformProps'; export default class LineChartPlugin extends ChartPlugin { constructor() { super({ - loadChart: () => import('./Bubble'), - metadata, + loadChart: () => import('./ScatterPlot'), + metadata: createMetadata(), transformProps, }); } diff --git a/packages/superset-ui-preset-chart-xy/src/Bubble/legacy/index.ts b/packages/superset-ui-preset-chart-xy/src/ScatterPlot/legacy/index.ts similarity index 62% rename from packages/superset-ui-preset-chart-xy/src/Bubble/legacy/index.ts rename to packages/superset-ui-preset-chart-xy/src/ScatterPlot/legacy/index.ts index 48e4a02d2..571dbef72 100644 --- a/packages/superset-ui-preset-chart-xy/src/Bubble/legacy/index.ts +++ b/packages/superset-ui-preset-chart-xy/src/ScatterPlot/legacy/index.ts @@ -1,12 +1,12 @@ import { ChartPlugin } from '@superset-ui/chart'; -import metadata from './metadata'; +import createMetadata from '../createMetadata'; import transformProps from './transformProps'; export default class LineChartPlugin extends ChartPlugin { constructor() { super({ - loadChart: () => import('../Bubble'), - metadata, + loadChart: () => import('../ScatterPlot'), + metadata: createMetadata(true), transformProps, }); } diff --git a/packages/superset-ui-preset-chart-xy/src/Bubble/legacy/transformProps.ts b/packages/superset-ui-preset-chart-xy/src/ScatterPlot/legacy/transformProps.ts similarity index 100% rename from packages/superset-ui-preset-chart-xy/src/Bubble/legacy/transformProps.ts rename to packages/superset-ui-preset-chart-xy/src/ScatterPlot/legacy/transformProps.ts diff --git a/packages/superset-ui-preset-chart-xy/src/Bubble/transformProps.ts b/packages/superset-ui-preset-chart-xy/src/ScatterPlot/transformProps.ts similarity index 84% rename from packages/superset-ui-preset-chart-xy/src/Bubble/transformProps.ts rename to packages/superset-ui-preset-chart-xy/src/ScatterPlot/transformProps.ts index d75251efa..d9c6e4e38 100644 --- a/packages/superset-ui-preset-chart-xy/src/Bubble/transformProps.ts +++ b/packages/superset-ui-preset-chart-xy/src/ScatterPlot/transformProps.ts @@ -4,7 +4,7 @@ import { ChartProps } from '@superset-ui/chart'; export default function transformProps(chartProps: ChartProps) { const { width, height, formData, payload } = chartProps; - const { encoding } = formData; + const { encoding, margin } = formData; const { data } = payload; return { @@ -12,5 +12,6 @@ export default function transformProps(chartProps: ChartProps) { width, height, encoding, + margin, }; } diff --git a/packages/superset-ui-preset-chart-xy/src/encodeable/AxisAgent.ts b/packages/superset-ui-preset-chart-xy/src/encodeable/AxisAgent.ts index 94c1737c3..ffc15404f 100644 --- a/packages/superset-ui-preset-chart-xy/src/encodeable/AxisAgent.ts +++ b/packages/superset-ui-preset-chart-xy/src/encodeable/AxisAgent.ts @@ -142,7 +142,7 @@ export default class AxisAgent, Output extends Va if (this.channelEncoder.isX()) { if (strategyForLabelOverlap === 'flat') { - const labelHeight = labelDimensions[0].height; + const labelHeight = labelDimensions.length > 0 ? labelDimensions[0].height : 0; labelOffset = labelHeight + labelPadding; requiredMargin += labelHeight; } else if (strategyForLabelOverlap === 'rotate') { diff --git a/packages/superset-ui-preset-chart-xy/src/index.ts b/packages/superset-ui-preset-chart-xy/src/index.ts index 3982f08f4..3932d61ae 100644 --- a/packages/superset-ui-preset-chart-xy/src/index.ts +++ b/packages/superset-ui-preset-chart-xy/src/index.ts @@ -1,3 +1,3 @@ export { default as BoxPlotChartPlugin } from './BoxPlot'; -export { default as BubbleChartPlugin } from './Bubble'; +export { default as ScatterPlotPlugin } from './ScatterPlot'; export { default as LineChartPlugin } from './Line'; diff --git a/packages/superset-ui-preset-chart-xy/src/legacy.ts b/packages/superset-ui-preset-chart-xy/src/legacy.ts index f497170bc..24c83c6d3 100644 --- a/packages/superset-ui-preset-chart-xy/src/legacy.ts +++ b/packages/superset-ui-preset-chart-xy/src/legacy.ts @@ -1,3 +1,3 @@ export { default as BoxPlotChartPlugin } from './BoxPlot/legacy'; -export { default as BubbleChartPlugin } from './Bubble/legacy'; +export { default as ScatterPlotPlugin } from './ScatterPlot/legacy'; export { default as LineChartPlugin } from './Line/legacy'; diff --git a/packages/superset-ui-preset-chart-xy/types/@data-ui/xy-chart/index.d.ts b/packages/superset-ui-preset-chart-xy/types/@data-ui/xy-chart/index.d.ts index 504be9e51..308a07385 100644 --- a/packages/superset-ui-preset-chart-xy/types/@data-ui/xy-chart/index.d.ts +++ b/packages/superset-ui-preset-chart-xy/types/@data-ui/xy-chart/index.d.ts @@ -33,6 +33,7 @@ declare module '@data-ui/xy-chart' { export class CrossHair extends React.PureComponent {} export class LinearGradient extends React.PureComponent {} export class LineSeries extends React.PureComponent {} + export class PointSeries extends React.PureComponent {} export class WithTooltip extends React.PureComponent {} export class XYChart extends React.PureComponent {} export class XAxis extends React.PureComponent {} From 49e0851c4692726cedcb294bb977ad8716c10f27 Mon Sep 17 00:00:00 2001 From: Krist Wongsuphasawat Date: Wed, 8 May 2019 13:29:40 -0700 Subject: [PATCH 3/7] feat: add legacy shim --- .../preset-chart-xy/ScatterPlot/index.js | 2 +- .../ScatterPlot/stories/legacy.tsx | 53 ++++------------ .../src/ScatterPlot/legacy/transformProps.ts | 63 +++++++++++++------ 3 files changed, 56 insertions(+), 62 deletions(-) diff --git a/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/ScatterPlot/index.js b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/ScatterPlot/index.js index 614efc99e..ce1aec40b 100644 --- a/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/ScatterPlot/index.js +++ b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/ScatterPlot/index.js @@ -9,5 +9,5 @@ new LegacyScatterPlotPlugin().configure({ key: SCATTER_PLOT_PLUGIN_LEGACY_TYPE } new ScatterPlotPlugin().configure({ key: SCATTER_PLOT_PLUGIN_TYPE }).register(); export default { - examples: [...BasicStories, ...BubbleStories], + examples: [...BasicStories, ...BubbleStories, ...LegacyStories], }; diff --git a/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/ScatterPlot/stories/legacy.tsx b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/ScatterPlot/stories/legacy.tsx index 553b84a82..6e6d51a0f 100644 --- a/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/ScatterPlot/stories/legacy.tsx +++ b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/ScatterPlot/stories/legacy.tsx @@ -14,21 +14,24 @@ export default [ new ChartProps({ datasource: { verboseMap: {} }, formData: { + annotationData: {}, bottomMargin: 'auto', colorScheme: 'd3Category10', + entity: 'country_name', leftMargin: 'auto', - lineInterpolation: 'linear', - richTooltip: true, - showBrush: 'auto', + maxBubbleSize: '50', + series: 'region', showLegend: true, - showMarkers: false, - vizType: 'line', - xAxisFormat: '%Y', - xAxisLabel: '', + size: 'sum__SP_POP_TOTL', + vizType: 'bubble', + x: 'sum__SP_RUR_TOTL_ZS', + xAxisFormat: '.3s', + xAxisLabel: 'x-axis label', xAxisShowminmax: false, + xLogScale: false, xTicksLayout: 'auto', - yAxisBounds: [null, null], - yAxisFormat: '', + y: 'sum__SP_DYN_LE00_IN', + yAxisFormat: '.3s', yAxisLabel: '', yAxisShowminmax: false, yLogScale: false, @@ -39,38 +42,6 @@ export default [ }) } />, - , ], storyName: 'Use Legacy API shim', storyPath: 'preset-chart-xy|ScatterPlotPlugin', diff --git a/packages/superset-ui-preset-chart-xy/src/ScatterPlot/legacy/transformProps.ts b/packages/superset-ui-preset-chart-xy/src/ScatterPlot/legacy/transformProps.ts index a9e07df78..0d3c90554 100644 --- a/packages/superset-ui-preset-chart-xy/src/ScatterPlot/legacy/transformProps.ts +++ b/packages/superset-ui-preset-chart-xy/src/ScatterPlot/legacy/transformProps.ts @@ -5,37 +5,52 @@ import { flatMap } from 'lodash'; interface DataRow { key: string[]; values: { - x: number; - y: number; + [key: string]: any; }[]; } export default function transformProps(chartProps: ChartProps) { const { width, height, formData, payload } = chartProps; - const { colorScheme, xAxisLabel, xAxisFormat, yAxisLabel, yAxisFormat } = formData; + const { + colorScheme, + entity, + maxBubbleSize, + series, + showLegend, + size, + x, + xAxisFormat, + xAxisLabel, + // xAxisShowminmax, + // xLogScale, + y, + yAxisLabel, + yAxisFormat, + // yAxisShowminmax, + // yLogScale, + } = formData; const data = payload.data as DataRow[]; return { - data: { - keys: ['name', 'x', 'y'], - values: flatMap( - data.map((row: DataRow) => - row.values.map(v => ({ - ...v, - name: row.key[0], - })), - ), + data: flatMap( + data.map((row: DataRow) => + row.values.map(v => ({ + [x]: v[x], + [y]: v[y], + [series]: v[series], + [size]: v[size], + })), ), - }, + ), width, height, encoding: { x: { - field: 'x', - type: 'temporal', + field: x, + type: 'quantitive', format: xAxisFormat, scale: { - type: 'time', + type: 'linear', }, axis: { orient: 'bottom', @@ -43,7 +58,7 @@ export default function transformProps(chartProps: ChartProps) { }, }, y: { - field: 'y', + field: y, type: 'quantitative', format: yAxisFormat, scale: { @@ -54,13 +69,21 @@ export default function transformProps(chartProps: ChartProps) { title: yAxisLabel, }, }, - color: { - field: 'name', + size: { + field: size, + type: 'quantitative', + scale: { + type: 'linear', + range: [0, maxBubbleSize], + }, + }, + fill: { + field: series, type: 'nominal', scale: { scheme: colorScheme, }, - legend: true, + legend: showLegend, }, }, }; From cafe142b07c2dfd623f614b166500649a8411ba7 Mon Sep 17 00:00:00 2001 From: Krist Wongsuphasawat Date: Wed, 8 May 2019 18:11:31 -0700 Subject: [PATCH 4/7] feat: support group as separate channel --- .../ScatterPlot/stories/basic.jsx | 3 ++ .../ScatterPlot/stories/bubble.jsx | 3 ++ .../src/BoxPlot/BoxPlot.tsx | 19 ++++++----- .../src/Line/Line.tsx | 15 +++++---- .../src/ScatterPlot/ScatterPlot.tsx | 18 +++++----- .../src/ScatterPlot/createTooltip.tsx | 9 ++++- .../src/ScatterPlot/legacy/transformProps.ts | 4 +++ .../src/ScatterPlot/transformProps.ts | 3 +- .../src/encodeable/AbstractEncoder.ts | 33 +++++++++++++++++-- .../src/encodeable/types/Specification.ts | 10 ++++++ 10 files changed, 91 insertions(+), 26 deletions(-) diff --git a/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/ScatterPlot/stories/basic.jsx b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/ScatterPlot/stories/basic.jsx index b18824789..ff9c12ec3 100644 --- a/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/ScatterPlot/stories/basic.jsx +++ b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/ScatterPlot/stories/basic.jsx @@ -42,6 +42,9 @@ export default [ legend: true, }, }, + commonEncoding: { + group: [{ field: 'country_name', title: 'Country' }], + }, }, height: 400, payload: { data }, diff --git a/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/ScatterPlot/stories/bubble.jsx b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/ScatterPlot/stories/bubble.jsx index 56d9fb4f0..d4c98b0ff 100644 --- a/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/ScatterPlot/stories/bubble.jsx +++ b/packages/superset-ui-plugins-demo/storybook/stories/preset-chart-xy/ScatterPlot/stories/bubble.jsx @@ -50,6 +50,9 @@ export default [ legend: true, }, }, + commonEncoding: { + group: [{ field: 'country_name', title: 'Country' }], + }, }, height: 400, payload: { data }, diff --git a/packages/superset-ui-preset-chart-xy/src/BoxPlot/BoxPlot.tsx b/packages/superset-ui-preset-chart-xy/src/BoxPlot/BoxPlot.tsx index 47add4725..1d9c26f1d 100644 --- a/packages/superset-ui-preset-chart-xy/src/BoxPlot/BoxPlot.tsx +++ b/packages/superset-ui-preset-chart-xy/src/BoxPlot/BoxPlot.tsx @@ -10,6 +10,7 @@ import WithLegend from '../components/WithLegend'; import ChartLegend from '../components/legend/ChartLegend'; import Encoder, { ChannelTypes, Encoding, Outputs } from './Encoder'; import { Dataset, PlainObject } from '../encodeable/types/Data'; +import { PartialSpec } from '../encodeable/types/Specification'; chartTheme.gridStyles.stroke = '#f1f3f5'; @@ -26,10 +27,10 @@ type Props = { width: string | number; height: string | number; margin?: Margin; - encoding: Encoding; data: Dataset; theme?: ChartTheme; -} & Readonly; +} & PartialSpec & + Readonly; export default class BoxPlot extends React.PureComponent { static defaultProps = defaultProps; @@ -41,15 +42,17 @@ export default class BoxPlot extends React.PureComponent { super(props); const createEncoder = createSelector( - (enc: Encoding) => enc, - (enc: Encoding) => new Encoder({ encoding: enc }), + (p: PartialSpec) => p.encoding, + p => p.commonEncoding, + p => p.options, + (encoding, commonEncoding, options) => new Encoder({ encoding, commonEncoding, options }), ); this.createEncoder = () => { - this.encoder = createEncoder(this.props.encoding); + this.encoder = createEncoder(this.props); }; - this.encoder = createEncoder(this.props.encoding); + this.encoder = createEncoder(this.props); this.renderChart = this.renderChart.bind(this); } @@ -58,7 +61,7 @@ export default class BoxPlot extends React.PureComponent { const { data, encoding, margin, theme } = this.props; const { channels } = this.encoder; - const isHorizontal = encoding.y.type === 'nominal'; + const isHorizontal = channels.y.definition.type === 'nominal'; const children = [ { stroke={(datum: PlainObject) => channels.color.encode(datum)} strokeWidth={1} widthRatio={0.6} - horizontal={encoding.y.type === 'nominal'} + horizontal={channels.y.definition.type === 'nominal'} />, ]; diff --git a/packages/superset-ui-preset-chart-xy/src/Line/Line.tsx b/packages/superset-ui-preset-chart-xy/src/Line/Line.tsx index 69accd8dc..8bcd81b81 100644 --- a/packages/superset-ui-preset-chart-xy/src/Line/Line.tsx +++ b/packages/superset-ui-preset-chart-xy/src/Line/Line.tsx @@ -19,6 +19,7 @@ import WithLegend from '../components/WithLegend'; import Encoder, { ChannelTypes, Encoding, Outputs } from './Encoder'; import { Dataset, PlainObject } from '../encodeable/types/Data'; import ChartLegend from '../components/legend/ChartLegend'; +import { PartialSpec } from '../encodeable/types/Specification'; chartTheme.gridStyles.stroke = '#f1f3f5'; @@ -35,10 +36,10 @@ type Props = { width: string | number; height: string | number; margin?: Margin; - encoding: Encoding; data: Dataset; theme?: ChartTheme; -} & Readonly; +} & PartialSpec & + Readonly; export interface Series { key: string; @@ -67,15 +68,17 @@ class LineChart extends PureComponent { super(props); const createEncoder = createSelector( - (enc: Encoding) => enc, - (enc: Encoding) => new Encoder({ encoding: enc }), + (p: PartialSpec) => p.encoding, + p => p.commonEncoding, + p => p.options, + (encoding, commonEncoding, options) => new Encoder({ encoding, commonEncoding, options }), ); this.createEncoder = () => { - this.encoder = createEncoder(this.props.encoding); + this.encoder = createEncoder(this.props); }; - this.encoder = createEncoder(this.props.encoding); + this.encoder = createEncoder(this.props); this.renderChart = this.renderChart.bind(this); } diff --git a/packages/superset-ui-preset-chart-xy/src/ScatterPlot/ScatterPlot.tsx b/packages/superset-ui-preset-chart-xy/src/ScatterPlot/ScatterPlot.tsx index 8c882fab3..1f196c56a 100644 --- a/packages/superset-ui-preset-chart-xy/src/ScatterPlot/ScatterPlot.tsx +++ b/packages/superset-ui-preset-chart-xy/src/ScatterPlot/ScatterPlot.tsx @@ -1,6 +1,6 @@ /* eslint-disable sort-keys, no-magic-numbers, complexity */ import React, { PureComponent } from 'react'; -import { XYChart, CrossHair, PointSeries } from '@data-ui/xy-chart'; +import { XYChart, PointSeries } from '@data-ui/xy-chart'; import { chartTheme, ChartTheme } from '@data-ui/theme'; import { Margin, Dimension } from '@superset-ui/dimension'; import { extent as d3Extent } from 'd3-array'; @@ -11,6 +11,7 @@ import WithLegend from '../components/WithLegend'; import Encoder, { ChannelTypes, Encoding, Outputs } from './Encoder'; import { Dataset, PlainObject } from '../encodeable/types/Data'; import ChartLegend from '../components/legend/ChartLegend'; +import { PartialSpec } from '../encodeable/types/Specification'; chartTheme.gridStyles.stroke = '#f1f3f5'; @@ -27,10 +28,10 @@ type Props = { width: string | number; height: string | number; margin?: Margin; - encoding: Encoding; data: Dataset; theme?: ChartTheme; -} & Readonly; +} & PartialSpec & + Readonly; export interface EncodedPoint { x: Outputs['x']; @@ -51,15 +52,17 @@ export default class ScatterPlot extends PureComponent { super(props); const createEncoder = createSelector( - (enc: Encoding) => enc, - (enc: Encoding) => new Encoder({ encoding: enc }), + (p: PartialSpec) => p.encoding, + p => p.commonEncoding, + p => p.options, + (encoding, commonEncoding, options) => new Encoder({ encoding, commonEncoding, options }), ); this.createEncoder = () => { - this.encoder = createEncoder(this.props.encoding); + this.encoder = createEncoder(this.props); }; - this.encoder = createEncoder(this.props.encoding); + this.encoder = createEncoder(this.props); this.renderChart = this.renderChart.bind(this); } @@ -73,7 +76,6 @@ export default class ScatterPlot extends PureComponent { const [min, max] = domain; const adjustedDomain = [Math.min(min || 0, 0), Math.max(max || 1, 1)]; channels.size.scale.setDomain(adjustedDomain); - // channels.x.definition.scale.domain = adjustedDomain; } const encodedData = data.map(d => ({ diff --git a/packages/superset-ui-preset-chart-xy/src/ScatterPlot/createTooltip.tsx b/packages/superset-ui-preset-chart-xy/src/ScatterPlot/createTooltip.tsx index 669173c16..aabb41f00 100644 --- a/packages/superset-ui-preset-chart-xy/src/ScatterPlot/createTooltip.tsx +++ b/packages/superset-ui-preset-chart-xy/src/ScatterPlot/createTooltip.tsx @@ -9,7 +9,7 @@ import { EncodedPoint } from './ScatterPlot'; export default function createTooltip(encoder: Encoder) { function Tooltip({ datum }: { datum: EncodedPoint }) { - const { channels } = encoder; + const { channels, commonChannels } = encoder; const { x, y, size, fill, stroke } = channels; const tooltipRows = [ @@ -38,6 +38,13 @@ export default function createTooltip(encoder: Encoder) { valueColumn: size.format(datum.data), }); } + commonChannels.group.forEach(g => { + tooltipRows.push({ + key: `${g.name}`, + keyColumn: g.getTitle(), + valueColumn: g.format(datum.data), + }); + }); return ( diff --git a/packages/superset-ui-preset-chart-xy/src/ScatterPlot/legacy/transformProps.ts b/packages/superset-ui-preset-chart-xy/src/ScatterPlot/legacy/transformProps.ts index 0d3c90554..88775918d 100644 --- a/packages/superset-ui-preset-chart-xy/src/ScatterPlot/legacy/transformProps.ts +++ b/packages/superset-ui-preset-chart-xy/src/ScatterPlot/legacy/transformProps.ts @@ -39,6 +39,7 @@ export default function transformProps(chartProps: ChartProps) { [y]: v[y], [series]: v[series], [size]: v[size], + [entity]: v[entity], })), ), ), @@ -86,5 +87,8 @@ export default function transformProps(chartProps: ChartProps) { legend: showLegend, }, }, + commonEncoding: { + group: [{ field: entity }], + }, }; } diff --git a/packages/superset-ui-preset-chart-xy/src/ScatterPlot/transformProps.ts b/packages/superset-ui-preset-chart-xy/src/ScatterPlot/transformProps.ts index d9c6e4e38..94f2c864e 100644 --- a/packages/superset-ui-preset-chart-xy/src/ScatterPlot/transformProps.ts +++ b/packages/superset-ui-preset-chart-xy/src/ScatterPlot/transformProps.ts @@ -4,7 +4,7 @@ import { ChartProps } from '@superset-ui/chart'; export default function transformProps(chartProps: ChartProps) { const { width, height, formData, payload } = chartProps; - const { encoding, margin } = formData; + const { encoding, commonEncoding, margin } = formData; const { data } = payload; return { @@ -12,6 +12,7 @@ export default function transformProps(chartProps: ChartProps) { width, height, encoding, + commonEncoding, margin, }; } diff --git a/packages/superset-ui-preset-chart-xy/src/encodeable/AbstractEncoder.ts b/packages/superset-ui-preset-chart-xy/src/encodeable/AbstractEncoder.ts index cd9f95394..4a290a362 100644 --- a/packages/superset-ui-preset-chart-xy/src/encodeable/AbstractEncoder.ts +++ b/packages/superset-ui-preset-chart-xy/src/encodeable/AbstractEncoder.ts @@ -7,7 +7,7 @@ import { ChannelInput, } from './types/Channel'; import { FullSpec, BaseOptions, PartialSpec } from './types/Specification'; -import { isFieldDef, isTypedFieldDef } from './types/ChannelDef'; +import { isFieldDef, isTypedFieldDef, FieldDef } from './types/ChannelDef'; import ChannelEncoder from './ChannelEncoder'; import { Dataset } from './types/Data'; @@ -28,6 +28,11 @@ export default abstract class AbstractEncoder< readonly [k in keyof ChannelTypes]: ChannelEncoder }; + readonly commonChannels: { + group: ChannelEncoder[]; + tooltip: ChannelEncoder[]; + }; + readonly legends: { [key: string]: (keyof ChannelTypes)[]; }; @@ -67,6 +72,25 @@ export default abstract class AbstractEncoder< return all; }, {}) as Channels; + this.commonChannels = { + group: this.spec.commonEncoding.group.map( + (def, i) => + new ChannelEncoder({ + definition: def, + name: `group${i}`, + type: 'Text', + }), + ), + tooltip: this.spec.commonEncoding.tooltip.map( + (def, i) => + new ChannelEncoder({ + definition: def, + name: `tooltip${i}`, + type: 'Text', + }), + ), + }; + // Group the channels that use the same field together // so they can share the same legend. this.legends = {}; @@ -94,9 +118,14 @@ export default abstract class AbstractEncoder< return spec as FullSpec; } - const { encoding, ...rest } = spec; + const { encoding, commonEncoding = {}, ...rest } = spec; + const { group = [], tooltip = [] } = commonEncoding; return { + commonEncoding: { + group, + tooltip, + }, ...rest, encoding: { ...defaultEncoding, diff --git a/packages/superset-ui-preset-chart-xy/src/encodeable/types/Specification.ts b/packages/superset-ui-preset-chart-xy/src/encodeable/types/Specification.ts index 7631de62e..f8d7427d0 100644 --- a/packages/superset-ui-preset-chart-xy/src/encodeable/types/Specification.ts +++ b/packages/superset-ui-preset-chart-xy/src/encodeable/types/Specification.ts @@ -1,13 +1,23 @@ +import { FieldDef } from './ChannelDef'; + export interface BaseOptions { namespace?: string; } export interface PartialSpec { encoding: Partial; + commonEncoding?: Partial<{ + group: FieldDef[]; + tooltip: FieldDef[]; + }>; options?: Options; } export interface FullSpec { encoding: Encoding; + commonEncoding: { + group: FieldDef[]; + tooltip: FieldDef[]; + }; options?: Options; } From 9acf6c1d867d54511fb2c875d5d0c896624cbc3c Mon Sep 17 00:00:00 2001 From: Krist Wongsuphasawat Date: Wed, 8 May 2019 18:14:58 -0700 Subject: [PATCH 5/7] fix: box plot formatting --- .../src/BoxPlot/createTooltip.tsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/superset-ui-preset-chart-xy/src/BoxPlot/createTooltip.tsx b/packages/superset-ui-preset-chart-xy/src/BoxPlot/createTooltip.tsx index b3efd5070..23c0633cd 100644 --- a/packages/superset-ui-preset-chart-xy/src/BoxPlot/createTooltip.tsx +++ b/packages/superset-ui-preset-chart-xy/src/BoxPlot/createTooltip.tsx @@ -11,21 +11,24 @@ export default function createBoxPlotTooltip(encoder: Encoder) { return function BoxPlotTooltip({ datum, color }: { datum: BoxPlotDataRow; color: string }) { const { label, min, max, median, firstQuartile, thirdQuartile, outliers } = datum; + const formatValue = + channels.y.definition.type === 'nominal' ? channels.x.formatValue : channels.y.formatValue; + const data = []; if (isDefined(min)) { - data.push({ key: 'Min', valueColumn: channels.y.formatValue(min) }); + data.push({ key: 'Min', valueColumn: formatValue(min) }); } if (isDefined(max)) { - data.push({ key: 'Max', valueColumn: channels.y.formatValue(max) }); + data.push({ key: 'Max', valueColumn: formatValue(max) }); } if (isDefined(median)) { - data.push({ key: 'Median', valueColumn: channels.y.formatValue(median) }); + data.push({ key: 'Median', valueColumn: formatValue(median) }); } if (isDefined(firstQuartile)) { - data.push({ key: '1st Quartile', valueColumn: channels.y.formatValue(firstQuartile) }); + data.push({ key: '1st Quartile', valueColumn: formatValue(firstQuartile) }); } if (isDefined(thirdQuartile)) { - data.push({ key: '3rd Quartile', valueColumn: channels.y.formatValue(thirdQuartile) }); + data.push({ key: '3rd Quartile', valueColumn: formatValue(thirdQuartile) }); } if (isDefined(outliers) && outliers.length > 0) { data.push({ key: '# Outliers', valueColumn: outliers.length }); From 211c4c6e3c12b01c7980c91a59f543ec7a5dd069 Mon Sep 17 00:00:00 2001 From: Krist Wongsuphasawat Date: Wed, 8 May 2019 18:22:30 -0700 Subject: [PATCH 6/7] fix: lint --- packages/superset-ui-preset-chart-xy/src/BoxPlot/BoxPlot.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/superset-ui-preset-chart-xy/src/BoxPlot/BoxPlot.tsx b/packages/superset-ui-preset-chart-xy/src/BoxPlot/BoxPlot.tsx index 1d9c26f1d..089f40d2e 100644 --- a/packages/superset-ui-preset-chart-xy/src/BoxPlot/BoxPlot.tsx +++ b/packages/superset-ui-preset-chart-xy/src/BoxPlot/BoxPlot.tsx @@ -58,7 +58,7 @@ export default class BoxPlot extends React.PureComponent { renderChart(dim: Dimension) { const { width, height } = dim; - const { data, encoding, margin, theme } = this.props; + const { data, margin, theme } = this.props; const { channels } = this.encoder; const isHorizontal = channels.y.definition.type === 'nominal'; From 676ba71b23b80408caf47489b3f902e3089731b2 Mon Sep 17 00:00:00 2001 From: Krist Wongsuphasawat Date: Thu, 9 May 2019 10:36:44 -0700 Subject: [PATCH 7/7] fix: remove/clarify comments --- .../src/ScatterPlot/ScatterPlot.tsx | 15 --------------- .../src/ScatterPlot/legacy/transformProps.ts | 2 ++ 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/packages/superset-ui-preset-chart-xy/src/ScatterPlot/ScatterPlot.tsx b/packages/superset-ui-preset-chart-xy/src/ScatterPlot/ScatterPlot.tsx index 1f196c56a..1ba6316f4 100644 --- a/packages/superset-ui-preset-chart-xy/src/ScatterPlot/ScatterPlot.tsx +++ b/packages/superset-ui-preset-chart-xy/src/ScatterPlot/ScatterPlot.tsx @@ -87,21 +87,6 @@ export default class ScatterPlot extends PureComponent { data: d, })); - // if (typeof channels.x.scale !== 'undefined') { - // const xDomain = d3Extent(encodedData, d => d.x); - // const [min, max] = xDomain; - // const adjustedDomain = [Math.min(min || 0, 0), Math.max(max || 1, 1)]; - // // channels.x.scale.setDomain(adjustedDomain); - // // channels.x.definition.scale.domain = adjustedDomain; - // } - // if (typeof channels.y.scale !== 'undefined') { - // const yDomain = d3Extent(encodedData, d => d.y); - // const [min, max] = yDomain; - // const adjustedDomain = [Math.min(min || 0, 0), Math.max(max || 1, 1)]; - // // channels.y.scale.setDomain(adjustedDomain); - // // channels.y.definition.scale.domain = adjustedDomain; - // } - const children = [