From dbe0a8b51990f6645d29b2fb54e2686d95a7a5c3 Mon Sep 17 00:00:00 2001 From: Ville Brofeldt <33317356+villebro@users.noreply.github.com> Date: Thu, 27 Jan 2022 11:26:00 +0200 Subject: [PATCH] chore: bump echarts to 5.3.0 (#18162) * chore: bump echarts to 5.3.0 * change to official 5.3.0 and reintroduce bold effect --- superset-frontend/package-lock.json | 32 +++++++++---------- .../plugins/plugin-chart-echarts/package.json | 2 +- .../src/MixedTimeseries/controlPanel.tsx | 1 + .../src/MixedTimeseries/transformProps.ts | 3 ++ .../src/Timeseries/transformers.ts | 10 +++++- 5 files changed, 30 insertions(+), 18 deletions(-) diff --git a/superset-frontend/package-lock.json b/superset-frontend/package-lock.json index b5be70458bdac..45492060603b1 100644 --- a/superset-frontend/package-lock.json +++ b/superset-frontend/package-lock.json @@ -31658,12 +31658,12 @@ } }, "node_modules/echarts": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/echarts/-/echarts-5.2.2.tgz", - "integrity": "sha512-yxuBfeIH5c+0FsoRP60w4De6omXhA06c7eUYBsC1ykB6Ys2yK5fSteIYWvkJ4xJVLQgCvAdO8C4mN6MLeJpBaw==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/echarts/-/echarts-5.3.0.tgz", + "integrity": "sha512-zENufmwFE6WjM+24tW3xQq4ICqQtI0CGj4bDVDNd3BK3LtaA/5wBp+64ykIyKy3QElz0cieKqSYP4FX9Lv9MwQ==", "dependencies": { "tslib": "2.3.0", - "zrender": "5.2.1" + "zrender": "5.3.0" } }, "node_modules/echarts/node_modules/tslib": { @@ -58561,9 +58561,9 @@ } }, "node_modules/zrender": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/zrender/-/zrender-5.2.1.tgz", - "integrity": "sha512-M3bPGZuyLTNBC6LiNKXJwSCtglMp8XUEqEBG+2MdICDI3d1s500Y4P0CzldQGsqpRVB7fkvf3BKQQRxsEaTlsw==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/zrender/-/zrender-5.3.0.tgz", + "integrity": "sha512-Ln2QB5uqI1ftNYMtCRxd+XDq6MOttLgam2tmhKAVA+j0ko47UT+VNlDvKTkqe4K2sJhBvB0EhYNLebqlCTjatQ==", "dependencies": { "tslib": "2.3.0" } @@ -59699,7 +59699,7 @@ "license": "Apache-2.0", "dependencies": { "d3-array": "^1.2.0", - "echarts": "^5.2.2", + "echarts": "^5.3.0", "lodash": "^4.17.15", "moment": "^2.26.0" }, @@ -76498,7 +76498,7 @@ "version": "file:plugins/plugin-chart-echarts", "requires": { "d3-array": "^1.2.0", - "echarts": "^5.2.2", + "echarts": "^5.3.0", "lodash": "^4.17.15", "moment": "^2.26.0" } @@ -84839,12 +84839,12 @@ } }, "echarts": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/echarts/-/echarts-5.2.2.tgz", - "integrity": "sha512-yxuBfeIH5c+0FsoRP60w4De6omXhA06c7eUYBsC1ykB6Ys2yK5fSteIYWvkJ4xJVLQgCvAdO8C4mN6MLeJpBaw==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/echarts/-/echarts-5.3.0.tgz", + "integrity": "sha512-zENufmwFE6WjM+24tW3xQq4ICqQtI0CGj4bDVDNd3BK3LtaA/5wBp+64ykIyKy3QElz0cieKqSYP4FX9Lv9MwQ==", "requires": { "tslib": "2.3.0", - "zrender": "5.2.1" + "zrender": "5.3.0" }, "dependencies": { "tslib": { @@ -105702,9 +105702,9 @@ } }, "zrender": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/zrender/-/zrender-5.2.1.tgz", - "integrity": "sha512-M3bPGZuyLTNBC6LiNKXJwSCtglMp8XUEqEBG+2MdICDI3d1s500Y4P0CzldQGsqpRVB7fkvf3BKQQRxsEaTlsw==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/zrender/-/zrender-5.3.0.tgz", + "integrity": "sha512-Ln2QB5uqI1ftNYMtCRxd+XDq6MOttLgam2tmhKAVA+j0ko47UT+VNlDvKTkqe4K2sJhBvB0EhYNLebqlCTjatQ==", "requires": { "tslib": "2.3.0" }, diff --git a/superset-frontend/plugins/plugin-chart-echarts/package.json b/superset-frontend/plugins/plugin-chart-echarts/package.json index baa4b19d75446..a37e90e173671 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/package.json +++ b/superset-frontend/plugins/plugin-chart-echarts/package.json @@ -27,7 +27,7 @@ }, "dependencies": { "d3-array": "^1.2.0", - "echarts": "^5.2.2", + "echarts": "^5.3.0", "lodash": "^4.17.15", "moment": "^2.26.0" }, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/controlPanel.tsx index 67a7a21f96851..8cd681c5e33e1 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/controlPanel.tsx @@ -244,6 +244,7 @@ function createCustomizeSection( [1, t('Secondary')], ], default: yAxisIndex, + clearable: false, renderTrigger: true, description: t('Primary or secondary y-axis'), }, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts b/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts index 886f69314e379..ccaf366840821 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts @@ -266,6 +266,7 @@ export default function transformProps( }, {}) as Record; const { setDataMask = () => {} } = hooks; + const alignTicks = yAxisIndex !== yAxisIndexB; const echartOptions: EChartsCoreOption = { useUTC: true, @@ -296,6 +297,7 @@ export default function transformProps( name: yAxisTitle, nameGap: yAxisTitleMargin, nameLocation: yAxisTitlePosition === 'Left' ? 'middle' : 'end', + alignTicks, }, { ...defaultYAxis, @@ -308,6 +310,7 @@ export default function transformProps( axisLabel: { formatter: formatterSecondary }, scale: truncateYAxis, name: yAxisTitleSecondary, + alignTicks, }, ], tooltip: { diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformers.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformers.ts index d6cbcdc77d274..fc9a3068f70e7 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformers.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformers.ts @@ -198,7 +198,15 @@ export function transformSeries( opacity: opacity * areaOpacity, } : undefined, - emphasis, + emphasis: { + // bold on hover as required since 5.3.0 to retain backwards feature parity: + // https://apache.github.io/echarts-handbook/en/basics/release-note/5-3-0/#removing-the-default-bolding-emphasis-effect-in-the-line-chart + // TODO: should consider only adding emphasis to currently hovered series + lineStyle: { + width: 'bolder', + }, + ...emphasis, + }, showSymbol, symbolSize: markerSize, label: {