From 23ae97b9fce109d71ec5c8d16912ba81ea6e9ffb Mon Sep 17 00:00:00 2001 From: kongmoumou Date: Thu, 29 Jul 2021 14:41:38 +0800 Subject: [PATCH 01/86] feat(graph): simple layout graph support dragging --- src/chart/graph/GraphView.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/chart/graph/GraphView.ts b/src/chart/graph/GraphView.ts index 1c8d10f921..fd5640b731 100644 --- a/src/chart/graph/GraphView.ts +++ b/src/chart/graph/GraphView.ts @@ -37,6 +37,8 @@ import List from '../../data/List'; import Line from '../helper/Line'; import { getECData } from '../../util/innerStore'; +import { simpleLayoutEdge } from './simpleLayoutHelper'; + function isViewCoordSys(coordSys: CoordinateSystem): coordSys is View { return coordSys.type === 'view'; } @@ -139,13 +141,20 @@ class GraphView extends ChartView { // Write position back to layout data.setItemLayout(idx, [el.x, el.y]); } + // handle simple layout dragging + if (!seriesModel.get('layout') || seriesModel.get('layout') === 'none') { + data.setItemLayout(idx, [el.x, el.y]); + // update edge + simpleLayoutEdge(seriesModel.getGraph(), seriesModel); + this.updateLayout(seriesModel); + } }).on('dragend', () => { if (forceLayout) { forceLayout.setUnfixed(idx); } }); } - el.setDraggable(draggable && !!forceLayout); + el.setDraggable(draggable); const focus = itemModel.get(['emphasis', 'focus']); From 78b247521da4db3bfa4d42da0d7812e8a1d8fad1 Mon Sep 17 00:00:00 2001 From: kongmoumou Date: Thu, 29 Jul 2021 14:46:41 +0800 Subject: [PATCH 02/86] test(graph): add simple graph draggable test case --- test/graph-simple.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/graph-simple.html b/test/graph-simple.html index 25899700ea..5e08e1a0c1 100644 --- a/test/graph-simple.html +++ b/test/graph-simple.html @@ -75,7 +75,8 @@ name: '节点1', x: 300, y: 300, - value: 'set_style_on_item' + value: 'set_style_on_item', + draggable: true, }, { name: '节点2', x: 800, @@ -162,7 +163,7 @@ title: [ '[focusNodeAdjacency: **true**]', 'hover node3, edge label should be displayed.', - '节点1 should display value in tooltip.', + '节点1 should display value in tooltip, and should be draggable', 'series.lineStyle: 5', 'hover set_style_on_item, lineStyle: {opacity 0.1, color: "blue", width: 20}, label: {color: "red", fontSize: 40}.', 'focusNodeAdjacency triggered and returned, opacity change MUST NOT be kept' @@ -175,7 +176,7 @@ title: [ '[focusNodeAdjacency: **false**]', 'hover node3, edge label should be displayed.', - '节点1 should display value in tooltip.', + '节点1 should display value in tooltip, and should be draggable', 'hover set_style_on_item, lineStyle: {opacity 0.1, color: "blue", width: 20}, label: {color: "red", fontSize: 40}.', 'focusNodeAdjacency triggered and returned, opacity change MUST NOT be kept' ], From 1d962f663505cde896f1ec44eb591b87b13fef93 Mon Sep 17 00:00:00 2001 From: kongmoumou Date: Sun, 1 Aug 2021 00:25:19 +0800 Subject: [PATCH 03/86] feat(graph): update circular layout helper function --- src/chart/graph/circularLayoutHelper.ts | 69 +++++++++++++++++++++++-- 1 file changed, 65 insertions(+), 4 deletions(-) diff --git a/src/chart/graph/circularLayoutHelper.ts b/src/chart/graph/circularLayoutHelper.ts index a81538c377..318e08a1e5 100644 --- a/src/chart/graph/circularLayoutHelper.ts +++ b/src/chart/graph/circularLayoutHelper.ts @@ -20,8 +20,9 @@ import * as vec2 from 'zrender/src/core/vector'; import {getSymbolSize, getNodeGlobalScale} from './graphHelper'; -import GraphSeriesModel, { GraphEdgeItemOption } from './GraphSeries'; -import Graph from '../../data/Graph'; +import GraphSeriesModel, { GraphEdgeItemOption, GraphNodeItemOption } from './GraphSeries'; +import Graph, { GraphNode } from '../../data/Graph'; +import Symbol from '../helper/Symbol'; import List from '../../data/List'; import * as zrUtil from 'zrender/src/core/util'; import {getCurvenessForEdge} from '../helper/multipleGraphEdgeHelper'; @@ -51,7 +52,8 @@ const _symbolRadiansHalf: number[] = []; */ export function circularLayout( seriesModel: GraphSeriesModel, - basedOn: 'value' | 'symbolSize' + basedOn: 'value' | 'symbolSize', + draggingNode?: GraphNode ) { const coordSys = seriesModel.coordinateSystem; if (coordSys && coordSys.type !== 'view') { @@ -77,6 +79,25 @@ export function circularLayout( return; } + if (draggingNode) { + const [tempX, tempY] = draggingNode.getLayout(); + const tan = (tempY - cy) / (tempX - cx); + const radian = -Math.atan(tan); + + tempX > cx + ? draggingNode.setLayout([ + r * Math.cos(radian) + cx, + r * -Math.sin(radian) + cy + ]) : draggingNode.setLayout([ + r * -Math.cos(radian) + cx, + r * Math.sin(radian) + cy + ]); + + const circularRotateLabel = seriesModel.get('layout') === 'circular' + && seriesModel.get(['circular', 'rotateLabel']); + rotateNodeLabel(draggingNode, circularRotateLabel, cx, cy); + } + _layoutNodesBasedOn[basedOn](seriesModel, graph, nodeData, r, cx, cy, count); graph.eachEdge(function (edge, index) { @@ -163,7 +184,8 @@ const _layoutNodesBasedOn: Record<'value' | 'symbolSize', LayoutNode> = { const radianHalf = halfRemainRadian + _symbolRadiansHalf[node.dataIndex]; angle += radianHalf; - node.setLayout([ + // auto circular layout for not dragged node + !node.getFixed() && node.setLayout([ r * Math.cos(angle) + cx, r * Math.sin(angle) + cy ]); @@ -171,3 +193,42 @@ const _layoutNodesBasedOn: Record<'value' | 'symbolSize', LayoutNode> = { }); } }; + +export function rotateNodeLabel( + node: GraphNode, + circularRotateLabel: boolean, + cx: number, + cy: number +) { + const nodeModel = node.getModel(); + const el = node.getGraphicEl() as Symbol; + let labelRotate = nodeModel.get(['label', 'rotate']) || 0; + const symbolPath = el.getSymbolPath(); + if (circularRotateLabel) { + const pos = node.getLayout(); + let rad = Math.atan2(pos[1] - cy, pos[0] - cx); + if (rad < 0) { + rad = Math.PI * 2 + rad; + } + const isLeft = pos[0] < cx; + if (isLeft) { + rad = rad - Math.PI; + } + const textPosition = isLeft ? 'left' as const : 'right' as const; + + symbolPath.setTextConfig({ + rotation: -rad, + position: textPosition, + origin: 'center' + }); + const emphasisState = symbolPath.ensureState('emphasis'); + zrUtil.extend(emphasisState.textConfig || (emphasisState.textConfig = {}), { + position: textPosition + }); + } + else { + symbolPath.setTextConfig({ + rotation: labelRotate *= Math.PI / 180 + }); + } +} From ae38c73f1bab18bd72c259756fff3e3644ffe731 Mon Sep 17 00:00:00 2001 From: kongmoumou Date: Sun, 1 Aug 2021 00:26:59 +0800 Subject: [PATCH 04/86] feat(graph): support draggable for all graph layout ('none' | 'circular' | 'force') --- src/chart/graph/GraphView.ts | 74 ++++++++++++++---------------------- src/data/Graph.ts | 11 ++++++ 2 files changed, 40 insertions(+), 45 deletions(-) diff --git a/src/chart/graph/GraphView.ts b/src/chart/graph/GraphView.ts index fd5640b731..ec3af054a2 100644 --- a/src/chart/graph/GraphView.ts +++ b/src/chart/graph/GraphView.ts @@ -38,6 +38,7 @@ import Line from '../helper/Line'; import { getECData } from '../../util/innerStore'; import { simpleLayoutEdge } from './simpleLayoutHelper'; +import { circularLayout, rotateNodeLabel } from './circularLayoutHelper'; function isViewCoordSys(coordSys: CoordinateSystem): coordSys is View { return coordSys.type === 'view'; @@ -124,6 +125,8 @@ class GraphView extends ChartView { this._startForceLayoutIteration(forceLayout, layoutAnimation); } + const layout = seriesModel.get('layout'); + data.graph.eachNode((node) => { const idx = node.dataIndex; const el = node.getGraphicEl() as Symbol; @@ -133,20 +136,30 @@ class GraphView extends ChartView { const draggable = itemModel.get('draggable'); if (draggable) { el.on('drag', () => { - if (forceLayout) { - forceLayout.warmUp(); - !this._layouting - && this._startForceLayoutIteration(forceLayout, layoutAnimation); - forceLayout.setFixed(idx); - // Write position back to layout - data.setItemLayout(idx, [el.x, el.y]); - } - // handle simple layout dragging - if (!seriesModel.get('layout') || seriesModel.get('layout') === 'none') { - data.setItemLayout(idx, [el.x, el.y]); - // update edge - simpleLayoutEdge(seriesModel.getGraph(), seriesModel); - this.updateLayout(seriesModel); + switch (layout) { + case 'force': + forceLayout.warmUp(); + !this._layouting + && this._startForceLayoutIteration(forceLayout, layoutAnimation); + forceLayout.setFixed(idx); + // Write position back to layout + data.setItemLayout(idx, [el.x, el.y]); + break; + case 'circular': + // mark node fixed + node.setFixed(true); + data.setItemLayout(idx, [el.x, el.y]); + // recalculate circular layout + circularLayout(seriesModel, 'symbolSize', node); + this.updateLayout(seriesModel); + break; + case 'none': + default: + data.setItemLayout(idx, [el.x, el.y]); + // update edge + simpleLayoutEdge(seriesModel.getGraph(), seriesModel); + this.updateLayout(seriesModel); + break; } }).on('dragend', () => { if (forceLayout) { @@ -179,37 +192,8 @@ class GraphView extends ChartView { && seriesModel.get(['circular', 'rotateLabel']); const cx = data.getLayout('cx'); const cy = data.getLayout('cy'); - data.eachItemGraphicEl(function (el: Symbol, idx) { - const itemModel = data.getItemModel(idx); - let labelRotate = itemModel.get(['label', 'rotate']) || 0; - const symbolPath = el.getSymbolPath(); - if (circularRotateLabel) { - const pos = data.getItemLayout(idx); - let rad = Math.atan2(pos[1] - cy, pos[0] - cx); - if (rad < 0) { - rad = Math.PI * 2 + rad; - } - const isLeft = pos[0] < cx; - if (isLeft) { - rad = rad - Math.PI; - } - const textPosition = isLeft ? 'left' as const : 'right' as const; - - symbolPath.setTextConfig({ - rotation: -rad, - position: textPosition, - origin: 'center' - }); - const emphasisState = symbolPath.ensureState('emphasis'); - zrUtil.extend(emphasisState.textConfig || (emphasisState.textConfig = {}), { - position: textPosition - }); - } - else { - symbolPath.setTextConfig({ - rotation: labelRotate *= Math.PI / 180 - }); - } + data.graph.eachNode((node) => { + rotateNodeLabel(node, circularRotateLabel, cx, cy); }); this._firstRender = false; diff --git a/src/data/Graph.ts b/src/data/Graph.ts index 75ec38f654..ee76a77e57 100644 --- a/src/data/Graph.ts +++ b/src/data/Graph.ts @@ -333,6 +333,9 @@ class GraphNode { // Used in traverse of Graph __visited: boolean; + // NOTE: only use in circular layout + private _fixed: boolean = false; + constructor(id?: string, dataIndex?: number) { this.id = id == null ? '' : id; this.dataIndex = dataIndex == null ? -1 : dataIndex; @@ -387,6 +390,14 @@ class GraphNode { } return dataIndices; } + + setFixed(fixed: boolean) { + this._fixed = fixed; + } + + getFixed() { + return this._fixed; + } } From ebae2649401ad7ef5dc5fcea398a929f725d3d28 Mon Sep 17 00:00:00 2001 From: kongmoumou Date: Sun, 1 Aug 2021 00:28:40 +0800 Subject: [PATCH 05/86] test(graph): add graph draggable test case --- test/graph-draggable.html | 441 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 441 insertions(+) create mode 100644 test/graph-draggable.html diff --git a/test/graph-draggable.html b/test/graph-draggable.html new file mode 100644 index 0000000000..d681e98e19 --- /dev/null +++ b/test/graph-draggable.html @@ -0,0 +1,441 @@ + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + From 8144dcc0b2ba3dd5467a13ea28d6d25fe40cbaa2 Mon Sep 17 00:00:00 2001 From: kongmoumou Date: Sun, 1 Aug 2021 00:29:36 +0800 Subject: [PATCH 06/86] Revert "test(graph): add simple graph draggable test case" This reverts commit 78b247521da4db3bfa4d42da0d7812e8a1d8fad1. --- test/graph-simple.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/graph-simple.html b/test/graph-simple.html index 5e08e1a0c1..25899700ea 100644 --- a/test/graph-simple.html +++ b/test/graph-simple.html @@ -75,8 +75,7 @@ name: '节点1', x: 300, y: 300, - value: 'set_style_on_item', - draggable: true, + value: 'set_style_on_item' }, { name: '节点2', x: 800, @@ -163,7 +162,7 @@ title: [ '[focusNodeAdjacency: **true**]', 'hover node3, edge label should be displayed.', - '节点1 should display value in tooltip, and should be draggable', + '节点1 should display value in tooltip.', 'series.lineStyle: 5', 'hover set_style_on_item, lineStyle: {opacity 0.1, color: "blue", width: 20}, label: {color: "red", fontSize: 40}.', 'focusNodeAdjacency triggered and returned, opacity change MUST NOT be kept' @@ -176,7 +175,7 @@ title: [ '[focusNodeAdjacency: **false**]', 'hover node3, edge label should be displayed.', - '节点1 should display value in tooltip, and should be draggable', + '节点1 should display value in tooltip.', 'hover set_style_on_item, lineStyle: {opacity 0.1, color: "blue", width: 20}, label: {color: "red", fontSize: 40}.', 'focusNodeAdjacency triggered and returned, opacity change MUST NOT be kept' ], From 5f8f0c6d4d450b2b3578e7e18c6207fad818c467 Mon Sep 17 00:00:00 2001 From: kongmoumou Date: Fri, 6 Aug 2021 01:15:30 +0800 Subject: [PATCH 07/86] fix(graph): node el check for circular layout --- src/chart/graph/circularLayoutHelper.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/chart/graph/circularLayoutHelper.ts b/src/chart/graph/circularLayoutHelper.ts index 318e08a1e5..acc0697753 100644 --- a/src/chart/graph/circularLayoutHelper.ts +++ b/src/chart/graph/circularLayoutHelper.ts @@ -200,8 +200,12 @@ export function rotateNodeLabel( cx: number, cy: number ) { - const nodeModel = node.getModel(); const el = node.getGraphicEl() as Symbol; + // need to check if el exists. '-' value may not create node element. + if (!el) { + return; + } + const nodeModel = node.getModel(); let labelRotate = nodeModel.get(['label', 'rotate']) || 0; const symbolPath = el.getSymbolPath(); if (circularRotateLabel) { From db01e51282bf0402f33c25a924b0db3d33abe0b0 Mon Sep 17 00:00:00 2001 From: kongmoumou Date: Fri, 6 Aug 2021 15:38:18 +0800 Subject: [PATCH 08/86] fix(graph): remove GraphNode `_fixed` field --- src/data/Graph.ts | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/data/Graph.ts b/src/data/Graph.ts index ee76a77e57..75ec38f654 100644 --- a/src/data/Graph.ts +++ b/src/data/Graph.ts @@ -333,9 +333,6 @@ class GraphNode { // Used in traverse of Graph __visited: boolean; - // NOTE: only use in circular layout - private _fixed: boolean = false; - constructor(id?: string, dataIndex?: number) { this.id = id == null ? '' : id; this.dataIndex = dataIndex == null ? -1 : dataIndex; @@ -390,14 +387,6 @@ class GraphNode { } return dataIndices; } - - setFixed(fixed: boolean) { - this._fixed = fixed; - } - - getFixed() { - return this._fixed; - } } From 2b1595dba31c7da7c5346418356e6fed1d7d9422 Mon Sep 17 00:00:00 2001 From: kongmoumou Date: Fri, 6 Aug 2021 15:42:33 +0800 Subject: [PATCH 09/86] fix(graph): use zrender/vector calculate node layout --- src/chart/graph/GraphView.ts | 2 +- src/chart/graph/circularLayoutHelper.ts | 22 +++++++++------------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/chart/graph/GraphView.ts b/src/chart/graph/GraphView.ts index ec3af054a2..cf8ff11312 100644 --- a/src/chart/graph/GraphView.ts +++ b/src/chart/graph/GraphView.ts @@ -147,7 +147,7 @@ class GraphView extends ChartView { break; case 'circular': // mark node fixed - node.setFixed(true); + node.getModel().mergeOption({fixed: true}); data.setItemLayout(idx, [el.x, el.y]); // recalculate circular layout circularLayout(seriesModel, 'symbolSize', node); diff --git a/src/chart/graph/circularLayoutHelper.ts b/src/chart/graph/circularLayoutHelper.ts index acc0697753..5648630876 100644 --- a/src/chart/graph/circularLayoutHelper.ts +++ b/src/chart/graph/circularLayoutHelper.ts @@ -81,17 +81,10 @@ export function circularLayout( if (draggingNode) { const [tempX, tempY] = draggingNode.getLayout(); - const tan = (tempY - cy) / (tempX - cx); - const radian = -Math.atan(tan); - - tempX > cx - ? draggingNode.setLayout([ - r * Math.cos(radian) + cx, - r * -Math.sin(radian) + cy - ]) : draggingNode.setLayout([ - r * -Math.cos(radian) + cx, - r * Math.sin(radian) + cy - ]); + const v = [tempX - cx, tempY - cy]; + vec2.normalize(v, v); + vec2.scale(v, v, r); + draggingNode.setLayout([cx + v[0], cy + v[1]]); const circularRotateLabel = seriesModel.get('layout') === 'circular' && seriesModel.get(['circular', 'rotateLabel']); @@ -184,8 +177,11 @@ const _layoutNodesBasedOn: Record<'value' | 'symbolSize', LayoutNode> = { const radianHalf = halfRemainRadian + _symbolRadiansHalf[node.dataIndex]; angle += radianHalf; - // auto circular layout for not dragged node - !node.getFixed() && node.setLayout([ + // init circular layout for + // 1. layout undefined node + // 2. not fixed node + (!node.getLayout() || !node.getModel().get('fixed')) + && node.setLayout([ r * Math.cos(angle) + cx, r * Math.sin(angle) + cy ]); From 472e72b6fde58a2ff9f14f698e3c197cb03ec917 Mon Sep 17 00:00:00 2001 From: kongmoumou Date: Tue, 28 Sep 2021 23:13:53 +0800 Subject: [PATCH 10/86] fix: not trigger roam on el's child --- src/component/helper/RoamController.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/component/helper/RoamController.ts b/src/component/helper/RoamController.ts index edff61052d..cda4d1e9b4 100644 --- a/src/component/helper/RoamController.ts +++ b/src/component/helper/RoamController.ts @@ -179,6 +179,14 @@ class RoamController extends Eventful<{ return; } + let el = e.target; + while (el) { + if (el.draggable) { + return; + } + el = el.__hostTarget ? el.__hostTarget : el.parent; + } + const x = e.offsetX; const y = e.offsetY; From 657f379177b9348fa5a74f92f2f54bc8186500da Mon Sep 17 00:00:00 2001 From: kongmoumou Date: Wed, 29 Sep 2021 13:20:31 +0800 Subject: [PATCH 11/86] fix: fix code --- src/chart/graph/circularLayoutHelper.ts | 3 +-- src/component/helper/RoamController.ts | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/chart/graph/circularLayoutHelper.ts b/src/chart/graph/circularLayoutHelper.ts index 86228467e1..171805cec3 100644 --- a/src/chart/graph/circularLayoutHelper.ts +++ b/src/chart/graph/circularLayoutHelper.ts @@ -86,8 +86,7 @@ export function circularLayout( vec2.scale(v, v, r); draggingNode.setLayout([cx + v[0], cy + v[1]]); - const circularRotateLabel = seriesModel.get('layout') === 'circular' - && seriesModel.get(['circular', 'rotateLabel']); + const circularRotateLabel = seriesModel.get(['circular', 'rotateLabel']); rotateNodeLabel(draggingNode, circularRotateLabel, cx, cy); } diff --git a/src/component/helper/RoamController.ts b/src/component/helper/RoamController.ts index cda4d1e9b4..247ac1b693 100644 --- a/src/component/helper/RoamController.ts +++ b/src/component/helper/RoamController.ts @@ -184,7 +184,8 @@ class RoamController extends Eventful<{ if (el.draggable) { return; } - el = el.__hostTarget ? el.__hostTarget : el.parent; + // check if host is draggable + el = el.__hostTarget || el.parent; } const x = e.offsetX; From aeb66aa7c35fcdc9c6650f6c75c42fe62e806880 Mon Sep 17 00:00:00 2001 From: kongmoumou Date: Wed, 29 Sep 2021 13:26:37 +0800 Subject: [PATCH 12/86] fix: remove useless code --- src/component/helper/RoamController.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/component/helper/RoamController.ts b/src/component/helper/RoamController.ts index 247ac1b693..874865ebee 100644 --- a/src/component/helper/RoamController.ts +++ b/src/component/helper/RoamController.ts @@ -173,9 +173,7 @@ class RoamController extends Eventful<{ } private _mousedownHandler(e: ZRElementEvent) { - if (eventTool.isMiddleOrRightButtonOnMouseUpDown(e) - || (e.target && e.target.draggable) - ) { + if (eventTool.isMiddleOrRightButtonOnMouseUpDown(e)) { return; } From 45a1ebd5c007a586bacd8d79b46928aff3aec934 Mon Sep 17 00:00:00 2001 From: kongmoumou Date: Wed, 29 Sep 2021 14:24:15 +0800 Subject: [PATCH 13/86] fix: store fixed state in layout object --- src/chart/graph/GraphView.ts | 4 ++-- src/chart/graph/circularLayoutHelper.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/chart/graph/GraphView.ts b/src/chart/graph/GraphView.ts index ff463f6efa..2e3da638a5 100644 --- a/src/chart/graph/GraphView.ts +++ b/src/chart/graph/GraphView.ts @@ -146,9 +146,9 @@ class GraphView extends ChartView { data.setItemLayout(idx, [el.x, el.y]); break; case 'circular': - // mark node fixed - node.getModel().mergeOption({fixed: true}); data.setItemLayout(idx, [el.x, el.y]); + // mark node fixed + node.setLayout({ fixed: true }, true); // recalculate circular layout circularLayout(seriesModel, 'symbolSize', node); this.updateLayout(seriesModel); diff --git a/src/chart/graph/circularLayoutHelper.ts b/src/chart/graph/circularLayoutHelper.ts index 171805cec3..453414fdd7 100644 --- a/src/chart/graph/circularLayoutHelper.ts +++ b/src/chart/graph/circularLayoutHelper.ts @@ -84,7 +84,7 @@ export function circularLayout( const v = [tempX - cx, tempY - cy]; vec2.normalize(v, v); vec2.scale(v, v, r); - draggingNode.setLayout([cx + v[0], cy + v[1]]); + draggingNode.setLayout([cx + v[0], cy + v[1]], true); const circularRotateLabel = seriesModel.get(['circular', 'rotateLabel']); rotateNodeLabel(draggingNode, circularRotateLabel, cx, cy); @@ -179,7 +179,7 @@ const _layoutNodesBasedOn: Record<'value' | 'symbolSize', LayoutNode> = { // init circular layout for // 1. layout undefined node // 2. not fixed node - (!node.getLayout() || !node.getModel().get('fixed')) + (!node.getLayout() || !node.getLayout().fixed) && node.setLayout([ r * Math.cos(angle) + cx, r * Math.sin(angle) + cy From 155364a6b5084e0f64e3d6fc05ab6ef02b48a58c Mon Sep 17 00:00:00 2001 From: kongmoumou Date: Wed, 29 Sep 2021 14:30:43 +0800 Subject: [PATCH 14/86] fix: use mouse position calculate circular layout --- src/chart/graph/GraphView.ts | 4 ++-- src/chart/graph/circularLayoutHelper.ts | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/chart/graph/GraphView.ts b/src/chart/graph/GraphView.ts index 2e3da638a5..20f4448eb3 100644 --- a/src/chart/graph/GraphView.ts +++ b/src/chart/graph/GraphView.ts @@ -135,7 +135,7 @@ class GraphView extends ChartView { el.off('drag').off('dragend'); const draggable = itemModel.get('draggable'); if (draggable) { - el.on('drag', () => { + el.on('drag', (e) => { switch (layout) { case 'force': forceLayout.warmUp(); @@ -150,7 +150,7 @@ class GraphView extends ChartView { // mark node fixed node.setLayout({ fixed: true }, true); // recalculate circular layout - circularLayout(seriesModel, 'symbolSize', node); + circularLayout(seriesModel, 'symbolSize', node, [e.offsetX, e.offsetY]); this.updateLayout(seriesModel); break; case 'none': diff --git a/src/chart/graph/circularLayoutHelper.ts b/src/chart/graph/circularLayoutHelper.ts index 453414fdd7..af01fb0f8c 100644 --- a/src/chart/graph/circularLayoutHelper.ts +++ b/src/chart/graph/circularLayoutHelper.ts @@ -53,7 +53,8 @@ const _symbolRadiansHalf: number[] = []; export function circularLayout( seriesModel: GraphSeriesModel, basedOn: 'value' | 'symbolSize', - draggingNode?: GraphNode + draggingNode?: GraphNode, + pointer?: [number, number] ) { const coordSys = seriesModel.coordinateSystem; if (coordSys && coordSys.type !== 'view') { @@ -80,7 +81,7 @@ export function circularLayout( } if (draggingNode) { - const [tempX, tempY] = draggingNode.getLayout(); + const [tempX, tempY] = coordSys.pointToData(pointer) as [number, number]; const v = [tempX - cx, tempY - cy]; vec2.normalize(v, v); vec2.scale(v, v, r); From dd950c78ae65c95b9eebc82027cdadbccf779c82 Mon Sep 17 00:00:00 2001 From: "wangguisong@sinotrans.com" Date: Tue, 26 Apr 2022 14:01:20 +0800 Subject: [PATCH 15/86] feat(LineDraw):series-lines support the effect animation go back --- src/chart/helper/EffectLine.ts | 26 +++++++++++++++++--------- src/chart/helper/EffectPolyline.ts | 8 ++++---- src/chart/helper/LineDraw.ts | 1 + 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/src/chart/helper/EffectLine.ts b/src/chart/helper/EffectLine.ts index 412b27297c..66aa96a4b2 100644 --- a/src/chart/helper/EffectLine.ts +++ b/src/chart/helper/EffectLine.ts @@ -47,6 +47,8 @@ class EffectLine extends graphic.Group { private _loop: boolean; + private _goback: boolean; + private _symbolScale: number[]; constructor(lineData: SeriesData, idx: number, seriesScope: LineDrawSeriesScope) { @@ -121,6 +123,7 @@ class EffectLine extends graphic.Group { let period = effectModel.get('period') * 1000; const loop = effectModel.get('loop'); + const goback = effectModel.get('goback'); const constantSpeed = effectModel.get('constantSpeed'); const delayExpr = zrUtil.retrieve(effectModel.get('delay'), function (idx) { return idx / lineData.count() * period / 3; @@ -135,7 +138,7 @@ class EffectLine extends graphic.Group { period = this._getLineLength(symbol) / constantSpeed * 1000; } - if (period !== this._period || loop !== this._loop) { + if (period !== this._period || loop !== this._loop || goback !== this._goback) { symbol.stopAnimation(); let delayNum: number; if (zrUtil.isFunction(delayExpr)) { @@ -149,21 +152,23 @@ class EffectLine extends graphic.Group { } this._animateSymbol( - symbol, period, delayNum, loop + symbol, period, delayNum, loop, goback ); } this._period = period; this._loop = loop; + this._goback = goback; } - private _animateSymbol(symbol: ECSymbolOnEffectLine, period: number, delayNum: number, loop: boolean) { + private _animateSymbol( + symbol: ECSymbolOnEffectLine, period: number, delayNum: number, loop: boolean, goback: boolean) { if (period > 0) { symbol.__t = 0; const self = this; const animator = symbol.animate('', loop) - .when(period, { - __t: 1 + .when(goback ? period * 2 : period, { + __t: goback ? 2 : 1 }) .delay(delayNum) .during(function () { @@ -202,7 +207,7 @@ class EffectLine extends graphic.Group { const p1 = symbol.__p1; const p2 = symbol.__p2; const cp1 = symbol.__cp1; - const t = symbol.__t; + const t = symbol.__t < 1 ? symbol.__t : 2 - symbol.__t; const pos = [symbol.x, symbol.y]; const lastPos = pos.slice(); const quadraticAt = curveUtil.quadraticAt; @@ -211,8 +216,11 @@ class EffectLine extends graphic.Group { pos[1] = quadraticAt(p1[1], cp1[1], p2[1], t); // Tangent - const tx = quadraticDerivativeAt(p1[0], cp1[0], p2[0], t); - const ty = quadraticDerivativeAt(p1[1], cp1[1], p2[1], t); + const tx = symbol.__t < 1 ? quadraticDerivativeAt(p1[0], cp1[0], p2[0], t) + : quadraticDerivativeAt(p2[0], cp1[0], p1[0], 1 - t); + const ty = symbol.__t < 1 ? quadraticDerivativeAt(p1[1], cp1[1], p2[1], t) + : quadraticDerivativeAt(p2[1], cp1[1], p1[1], 1 - t); + symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2; // enable continuity trail for 'line', 'rect', 'roundRect' symbolType @@ -247,4 +255,4 @@ class EffectLine extends graphic.Group { this._updateEffectAnimation(lineData, effectModel, idx); } } -export default EffectLine; \ No newline at end of file +export default EffectLine; diff --git a/src/chart/helper/EffectPolyline.ts b/src/chart/helper/EffectPolyline.ts index a250cb590a..389dbe4d83 100644 --- a/src/chart/helper/EffectPolyline.ts +++ b/src/chart/helper/EffectPolyline.ts @@ -67,7 +67,7 @@ class EffectPolyline extends EffectLine { // Override protected _updateSymbolPosition(symbol: ECSymbolOnEffectLine) { - const t = symbol.__t; + const t = symbol.__t < 1 ? symbol.__t : 2 - symbol.__t; const points = this._points; const offsets = this._offsets; const len = points.length; @@ -107,8 +107,8 @@ class EffectPolyline extends EffectLine { symbol.x = p0[0] * (1 - p) + p * p1[0]; symbol.y = p0[1] * (1 - p) + p * p1[1]; - const tx = p1[0] - p0[0]; - const ty = p1[1] - p0[1]; + const tx = symbol.__t < 1 ? p1[0] - p0[0] : p0[0] - p1[0]; + const ty = symbol.__t < 1 ? p1[1] - p0[1] : p0[1] - p1[1]; symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2; this._lastFrame = frame; @@ -119,4 +119,4 @@ class EffectPolyline extends EffectLine { } -export default EffectPolyline; \ No newline at end of file +export default EffectPolyline; diff --git a/src/chart/helper/LineDraw.ts b/src/chart/helper/LineDraw.ts index d96595395b..d05231c93d 100644 --- a/src/chart/helper/LineDraw.ts +++ b/src/chart/helper/LineDraw.ts @@ -73,6 +73,7 @@ export interface LineDrawModelOption extends LineDrawStateOption, symbol?: string symbolSize?: number | number[] loop?: boolean + goback?: boolean /** * Length of trail, 0 - 1 */ From 0478f51cdd2186291b4e98fb6bc73fa0fb950730 Mon Sep 17 00:00:00 2001 From: "wangguisong@sinotrans.com" Date: Tue, 26 Apr 2022 15:41:21 +0800 Subject: [PATCH 16/86] rename the option from goback to roundTrip --- src/chart/helper/EffectLine.ts | 16 ++++++++-------- src/chart/helper/LineDraw.ts | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/chart/helper/EffectLine.ts b/src/chart/helper/EffectLine.ts index 66aa96a4b2..f368d83ac0 100644 --- a/src/chart/helper/EffectLine.ts +++ b/src/chart/helper/EffectLine.ts @@ -47,7 +47,7 @@ class EffectLine extends graphic.Group { private _loop: boolean; - private _goback: boolean; + private _roundTrip: boolean; private _symbolScale: number[]; @@ -123,7 +123,7 @@ class EffectLine extends graphic.Group { let period = effectModel.get('period') * 1000; const loop = effectModel.get('loop'); - const goback = effectModel.get('goback'); + const roundTrip = effectModel.get('roundTrip'); const constantSpeed = effectModel.get('constantSpeed'); const delayExpr = zrUtil.retrieve(effectModel.get('delay'), function (idx) { return idx / lineData.count() * period / 3; @@ -138,7 +138,7 @@ class EffectLine extends graphic.Group { period = this._getLineLength(symbol) / constantSpeed * 1000; } - if (period !== this._period || loop !== this._loop || goback !== this._goback) { + if (period !== this._period || loop !== this._loop || roundTrip !== this._roundTrip) { symbol.stopAnimation(); let delayNum: number; if (zrUtil.isFunction(delayExpr)) { @@ -152,23 +152,23 @@ class EffectLine extends graphic.Group { } this._animateSymbol( - symbol, period, delayNum, loop, goback + symbol, period, delayNum, loop, roundTrip ); } this._period = period; this._loop = loop; - this._goback = goback; + this._roundTrip = roundTrip; } private _animateSymbol( - symbol: ECSymbolOnEffectLine, period: number, delayNum: number, loop: boolean, goback: boolean) { + symbol: ECSymbolOnEffectLine, period: number, delayNum: number, loop: boolean, roundTrip: boolean) { if (period > 0) { symbol.__t = 0; const self = this; const animator = symbol.animate('', loop) - .when(goback ? period * 2 : period, { - __t: goback ? 2 : 1 + .when(roundTrip ? period * 2 : period, { + __t: roundTrip ? 2 : 1 }) .delay(delayNum) .during(function () { diff --git a/src/chart/helper/LineDraw.ts b/src/chart/helper/LineDraw.ts index d05231c93d..94c417f4f7 100644 --- a/src/chart/helper/LineDraw.ts +++ b/src/chart/helper/LineDraw.ts @@ -73,7 +73,7 @@ export interface LineDrawModelOption extends LineDrawStateOption, symbol?: string symbolSize?: number | number[] loop?: boolean - goback?: boolean + roundTrip?: boolean /** * Length of trail, 0 - 1 */ From 6de533a261d115342d49f333b12d5afabbae5c57 Mon Sep 17 00:00:00 2001 From: Ovilia Date: Tue, 24 May 2022 14:33:51 +0800 Subject: [PATCH 17/86] feat: ignore target size for large charts --- src/chart/bar/BarView.ts | 1 + src/chart/candlestick/CandlestickView.ts | 7 ++++--- src/chart/helper/LargeLineDraw.ts | 3 ++- src/chart/helper/LargeSymbolDraw.ts | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/chart/bar/BarView.ts b/src/chart/bar/BarView.ts index 70e6c34678..9ca497b40f 100644 --- a/src/chart/bar/BarView.ts +++ b/src/chart/bar/BarView.ts @@ -1146,6 +1146,7 @@ function createLarge( const el = new LargePath({ shape: {points: data.getLayout('largePoints')}, incremental: !!incremental, + ignoreTargetSize: true, z2: 1 }); el.baseDimIdx = baseDimIdx; diff --git a/src/chart/candlestick/CandlestickView.ts b/src/chart/candlestick/CandlestickView.ts index 9b2436db92..0990120de8 100644 --- a/src/chart/candlestick/CandlestickView.ts +++ b/src/chart/candlestick/CandlestickView.ts @@ -358,12 +358,14 @@ function createLarge( const elP = new LargeBoxPath({ shape: {points: largePoints}, - __sign: 1 + __sign: 1, + ignoreTargetSize: true }); group.add(elP); const elN = new LargeBoxPath({ shape: {points: largePoints}, - __sign: -1 + __sign: -1, + ignoreTargetSize: true }); group.add(elN); @@ -397,4 +399,3 @@ function setLargeStyle(sign: number, el: LargeBoxPath, seriesModel: CandlestickS export default CandlestickView; - diff --git a/src/chart/helper/LargeLineDraw.ts b/src/chart/helper/LargeLineDraw.ts index 62f5b6d14b..82eb4c1526 100644 --- a/src/chart/helper/LargeLineDraw.ts +++ b/src/chart/helper/LargeLineDraw.ts @@ -293,7 +293,8 @@ class LargeLineDraw { private _create() { const lineEl = new LargeLinesPath({ - cursor: 'default' + cursor: 'default', + ignoreTargetSize: true }); this._newAdded.push(lineEl); this.group.add(lineEl); diff --git a/src/chart/helper/LargeSymbolDraw.ts b/src/chart/helper/LargeSymbolDraw.ts index 22614b29f5..a103ff0bdf 100644 --- a/src/chart/helper/LargeSymbolDraw.ts +++ b/src/chart/helper/LargeSymbolDraw.ts @@ -315,6 +315,7 @@ class LargeSymbolDraw { const symbolEl = new LargeSymbolPath({ cursor: 'default' }); + symbolEl.ignoreTargetSize = true; this.group.add(symbolEl); this._newAdded.push(symbolEl); return symbolEl; From 02beb9a9ba2874ad2d07d8aff8b62790a399aa73 Mon Sep 17 00:00:00 2001 From: Ovilia Date: Tue, 24 May 2022 15:25:34 +0800 Subject: [PATCH 18/86] feat: make target size an option --- src/core/echarts.ts | 6 +- test/aria-target-size.html | 140 +++++++++++++++++++++++++++++++++++++ test/lib/testHelper.js | 7 +- 3 files changed, 151 insertions(+), 2 deletions(-) create mode 100644 test/aria-target-size.html diff --git a/src/core/echarts.ts b/src/core/echarts.ts index 78ea7687b5..f70bbc7b50 100644 --- a/src/core/echarts.ts +++ b/src/core/echarts.ts @@ -324,6 +324,8 @@ type EChartsInitOpts = { renderer?: RendererType, devicePixelRatio?: number, useDirtyRect?: boolean, + useTargetSize?: boolean, + targetSize?: number, ssr?: boolean, width?: number, height?: number @@ -430,7 +432,9 @@ class ECharts extends Eventful { width: opts.width, height: opts.height, ssr: opts.ssr, - useDirtyRect: opts.useDirtyRect == null ? defaultUseDirtyRect : opts.useDirtyRect + useDirtyRect: opts.useDirtyRect == null ? defaultUseDirtyRect : opts.useDirtyRect, + useTargetSize: opts.useTargetSize, + targetSize: opts.targetSize }); this._ssr = opts.ssr; diff --git a/test/aria-target-size.html b/test/aria-target-size.html new file mode 100644 index 0000000000..2f536e7030 --- /dev/null +++ b/test/aria-target-size.html @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + diff --git a/test/lib/testHelper.js b/test/lib/testHelper.js index 93fb9bbb60..3efc2e8836 100644 --- a/test/lib/testHelper.js +++ b/test/lib/testHelper.js @@ -262,6 +262,8 @@ * @param {boolean|number} opt If number, means height * @param {boolean} opt.lazyUpdate * @param {boolean} opt.notMerge + * @param {boolean} opt.useTargetSize + * @param {boolean} opt.targetSize * @param {number} opt.width * @param {number} opt.height * @param {boolean} opt.draggable @@ -284,7 +286,10 @@ dom.style.height = opt.height + 'px'; } - var chart = echarts.init(dom); + var chart = echarts.init(dom, null, { + useTargetSize: opt.useTargetSize, + targetSize: opt.targetSize + }); if (opt.draggable) { if (!window.draggable) { From 4b2bd9c16312b4ec6b2b5d3b1505288ccb228f4f Mon Sep 17 00:00:00 2001 From: Ovilia Date: Tue, 24 May 2022 15:40:24 +0800 Subject: [PATCH 19/86] feat: rename test file --- test/{aria-target-size.html => target-size.html} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename test/{aria-target-size.html => target-size.html} (100%) diff --git a/test/aria-target-size.html b/test/target-size.html similarity index 100% rename from test/aria-target-size.html rename to test/target-size.html From c11463a85e165dd25cf64e6f0c7fcf1de0d1c277 Mon Sep 17 00:00:00 2001 From: Ovilia Date: Thu, 26 May 2022 16:25:14 +0800 Subject: [PATCH 20/86] feat: rename variables --- src/chart/bar/BarView.ts | 2 +- src/chart/candlestick/CandlestickView.ts | 4 ++-- src/chart/helper/LargeLineDraw.ts | 2 +- src/chart/helper/LargeSymbolDraw.ts | 2 +- src/core/echarts.ts | 8 +++---- test/lib/testHelper.js | 8 +++---- test/{target-size.html => pointer-size.html} | 24 ++++++++++++-------- 7 files changed, 28 insertions(+), 22 deletions(-) rename test/{target-size.html => pointer-size.html} (82%) diff --git a/src/chart/bar/BarView.ts b/src/chart/bar/BarView.ts index 9ca497b40f..70f053d8f7 100644 --- a/src/chart/bar/BarView.ts +++ b/src/chart/bar/BarView.ts @@ -1146,7 +1146,7 @@ function createLarge( const el = new LargePath({ shape: {points: data.getLayout('largePoints')}, incremental: !!incremental, - ignoreTargetSize: true, + ignoreCoarsePointer: true, z2: 1 }); el.baseDimIdx = baseDimIdx; diff --git a/src/chart/candlestick/CandlestickView.ts b/src/chart/candlestick/CandlestickView.ts index 0990120de8..2b96f2cadc 100644 --- a/src/chart/candlestick/CandlestickView.ts +++ b/src/chart/candlestick/CandlestickView.ts @@ -359,13 +359,13 @@ function createLarge( const elP = new LargeBoxPath({ shape: {points: largePoints}, __sign: 1, - ignoreTargetSize: true + ignoreCoarsePointer: true }); group.add(elP); const elN = new LargeBoxPath({ shape: {points: largePoints}, __sign: -1, - ignoreTargetSize: true + ignoreCoarsePointer: true }); group.add(elN); diff --git a/src/chart/helper/LargeLineDraw.ts b/src/chart/helper/LargeLineDraw.ts index 82eb4c1526..88afd6b4c0 100644 --- a/src/chart/helper/LargeLineDraw.ts +++ b/src/chart/helper/LargeLineDraw.ts @@ -294,7 +294,7 @@ class LargeLineDraw { private _create() { const lineEl = new LargeLinesPath({ cursor: 'default', - ignoreTargetSize: true + ignoreCoarsePointer: true }); this._newAdded.push(lineEl); this.group.add(lineEl); diff --git a/src/chart/helper/LargeSymbolDraw.ts b/src/chart/helper/LargeSymbolDraw.ts index a103ff0bdf..2aafb9d13c 100644 --- a/src/chart/helper/LargeSymbolDraw.ts +++ b/src/chart/helper/LargeSymbolDraw.ts @@ -315,7 +315,7 @@ class LargeSymbolDraw { const symbolEl = new LargeSymbolPath({ cursor: 'default' }); - symbolEl.ignoreTargetSize = true; + symbolEl.ignoreCoarsePointer = true; this.group.add(symbolEl); this._newAdded.push(symbolEl); return symbolEl; diff --git a/src/core/echarts.ts b/src/core/echarts.ts index f70bbc7b50..4f64bf1fcf 100644 --- a/src/core/echarts.ts +++ b/src/core/echarts.ts @@ -324,8 +324,8 @@ type EChartsInitOpts = { renderer?: RendererType, devicePixelRatio?: number, useDirtyRect?: boolean, - useTargetSize?: boolean, - targetSize?: number, + useCoarsePointer?: boolean, + pointerSize?: number, ssr?: boolean, width?: number, height?: number @@ -433,8 +433,8 @@ class ECharts extends Eventful { height: opts.height, ssr: opts.ssr, useDirtyRect: opts.useDirtyRect == null ? defaultUseDirtyRect : opts.useDirtyRect, - useTargetSize: opts.useTargetSize, - targetSize: opts.targetSize + useCoarsePointer: opts.useCoarsePointer, + pointerSize: opts.pointerSize }); this._ssr = opts.ssr; diff --git a/test/lib/testHelper.js b/test/lib/testHelper.js index 3efc2e8836..6df2c44a6e 100644 --- a/test/lib/testHelper.js +++ b/test/lib/testHelper.js @@ -262,8 +262,8 @@ * @param {boolean|number} opt If number, means height * @param {boolean} opt.lazyUpdate * @param {boolean} opt.notMerge - * @param {boolean} opt.useTargetSize - * @param {boolean} opt.targetSize + * @param {boolean} opt.useCoarsePointer + * @param {boolean} opt.pointerSize * @param {number} opt.width * @param {number} opt.height * @param {boolean} opt.draggable @@ -287,8 +287,8 @@ } var chart = echarts.init(dom, null, { - useTargetSize: opt.useTargetSize, - targetSize: opt.targetSize + useCoarsePointer: opt.useCoarsePointer, + pointerSize: opt.pointerSize }); if (opt.draggable) { diff --git a/test/target-size.html b/test/pointer-size.html similarity index 82% rename from test/target-size.html rename to test/pointer-size.html index 2f536e7030..8e740dbcd1 100644 --- a/test/target-size.html +++ b/test/pointer-size.html @@ -56,7 +56,9 @@ yAxis: {}, series: { type: 'scatter', - data: [[11, 22], [33, 44]] + data: [[11, 22], [33, 44]], + symbol: 'pin', + symbolSize: 100 }, tooltip: { show: true @@ -65,7 +67,7 @@ var chart = testHelper.create(echarts, 'main0', { title: [ - 'By default, targe size feature is turned **off** for non-mobile devices.', + 'By default, pointer size feature is turned **off** for non-mobile devices.', 'So in this tese case, tooltip should **not show** if mouse position is near by but not on the data point.' ], option: option @@ -86,7 +88,9 @@ yAxis: {}, series: { type: 'scatter', - data: [[11, 22], [33, 44]] + data: [[11, 22], [33, 44]], + symbol: 'pin', + symbolSize: 100 }, tooltip: { show: true @@ -95,11 +99,11 @@ var chart = testHelper.create(echarts, 'main1', { title: [ - 'If targe size feature is turned **on** for non-mobile devices,', + 'If pointer size feature is turned **on** for non-mobile devices,', 'like in this tese case, tooltip should **show** if mouse position is near by but not on the data point.' ], option: option, - useTargetSize: true + useCoarsePointer: true }); }); @@ -117,7 +121,9 @@ yAxis: {}, series: { type: 'scatter', - data: [[11, 22], [33, 44]] + data: [[11, 22], [33, 44]], + symbol: 'pin', + symbolSize: 100 }, tooltip: { show: true @@ -126,11 +132,11 @@ var chart = testHelper.create(echarts, 'main2', { title: [ - 'In this case, the target size is set to be 200 so it should have a larger responsive area.' + 'In this case, the pointer size is set to be 200 so it should have a larger responsive area.' ], option: option, - useTargetSize: true, - targetSize: 200 + useCoarsePointer: true, + pointerSize: 200 }); }); From c1b67759765e420e09412dc0193ce06d471d626a Mon Sep 17 00:00:00 2001 From: plainheart Date: Sat, 28 May 2022 15:17:06 +0800 Subject: [PATCH 21/86] feat(pie): support specifying coordinate system for pie series. --- src/chart/pie/pieLayout.ts | 17 +- test/pie-coordinate-system.html | 376 ++++++++++++++++++++++++++++++++ 2 files changed, 391 insertions(+), 2 deletions(-) create mode 100644 test/pie-coordinate-system.html diff --git a/src/chart/pie/pieLayout.ts b/src/chart/pie/pieLayout.ts index 0598a779aa..0a6998c70c 100644 --- a/src/chart/pie/pieLayout.ts +++ b/src/chart/pie/pieLayout.ts @@ -53,10 +53,23 @@ export function getBasicPieLayout(seriesModel: PieSeriesModel, api: ExtensionAPI const width = parsePercent(viewRect.width, api.getWidth()); const height = parsePercent(viewRect.height, api.getHeight()); const size = Math.min(width, height); - const cx = parsePercent(center[0], width) + viewRect.x; - const cy = parsePercent(center[1], height) + viewRect.y; const r0 = parsePercent(radius[0], size / 2); const r = parsePercent(radius[1], size / 2); + + let cx: number; + let cy: number; + const coordSys = seriesModel.coordinateSystem; + if (coordSys) { + // percentage is not allowed when coordinate system is specified + const point = coordSys.dataToPoint(center); + cx = point[0] || 0; + cy = point[1] || 0; + } + else { + cx = parsePercent(center[0], width) + viewRect.x; + cy = parsePercent(center[1], height) + viewRect.y; + } + return { cx, cy, diff --git a/test/pie-coordinate-system.html b/test/pie-coordinate-system.html new file mode 100644 index 0000000000..95221bc4d1 --- /dev/null +++ b/test/pie-coordinate-system.html @@ -0,0 +1,376 @@ + + + + + + + + + + + + + + + +
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + From a6307826cfc17862c9ef533283c80dc06de0969f Mon Sep 17 00:00:00 2001 From: plainheart Date: Sat, 28 May 2022 16:16:15 +0800 Subject: [PATCH 22/86] feat(bmap): support `convertToPixel` & `convertFromPixel` API. --- extension-src/bmap/BMapCoordSys.ts | 14 ++++++++++++++ test/pie-coordinate-system.html | 13 +++++++++---- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/extension-src/bmap/BMapCoordSys.ts b/extension-src/bmap/BMapCoordSys.ts index 79ec79f0f2..96f24de386 100644 --- a/extension-src/bmap/BMapCoordSys.ts +++ b/extension-src/bmap/BMapCoordSys.ts @@ -36,6 +36,8 @@ function BMapCoordSys(bmap, api) { this._projection = new BMap.MercatorProjection(); } +BMapCoordSys.prototype.type = 'bmap'; + BMapCoordSys.prototype.dimensions = ['lng', 'lat']; BMapCoordSys.prototype.setZoom = function (zoom) { @@ -107,6 +109,15 @@ BMapCoordSys.prototype.prepareCustoms = function () { }; }; +BMapCoordSys.prototype.convertToPixel = function (ecModel, finder, value) { + // here we ignore finder as only one bmap component is allowed + return this.dataToPoint(value); +}; + +BMapCoordSys.prototype.convertFromPixel = function (ecModel, finder, value) { + return this.pointToData(value); +}; + function dataToCoordSize(dataSize, dataItem) { dataItem = dataItem || [0, 0]; return zrUtil.map([0, 1], function (dimIdx) { @@ -229,6 +240,9 @@ BMapCoordSys.create = function (ecModel, api) { seriesModel.coordinateSystem = bmapCoordSys; } }); + + // return created coordinate systems + return bmapCoordSys && [bmapCoordSys]; }; export default BMapCoordSys; diff --git a/test/pie-coordinate-system.html b/test/pie-coordinate-system.html index 95221bc4d1..ad0703eddf 100644 --- a/test/pie-coordinate-system.html +++ b/test/pie-coordinate-system.html @@ -85,11 +85,16 @@ ] }; - testHelper.create(echarts, 'main0', { + var chart = testHelper.create(echarts, 'main0', { title: ['Pie series on BMap'], - option: option - }) - + option: option, + buttons: [{ + text: 'Convert point [120, 30] to pixel', + onclick: function () { + alert(chart.convertToPixel('bmap', [120, 30])); + } + }] + }); }); From 032e73835f178e783285c122b5e052e82c86b787 Mon Sep 17 00:00:00 2001 From: Kane Blueriver Date: Thu, 9 Jun 2022 23:44:11 +0800 Subject: [PATCH 23/86] fix(typo): Trasition -> Transition --- src/animation/{basicTrasition.ts => basicTransition.ts} | 0 src/animation/customGraphicKeyframeAnimation.ts | 2 +- src/animation/customGraphicTransition.ts | 2 +- src/animation/morphTransitionHelper.ts | 2 +- src/animation/universalTransition.ts | 2 +- src/chart/bar/BarView.ts | 2 +- src/chart/boxplot/BoxplotView.ts | 2 +- src/chart/candlestick/CandlestickView.ts | 2 +- src/chart/funnel/FunnelView.ts | 2 +- src/chart/helper/Symbol.ts | 2 +- src/chart/parallel/ParallelView.ts | 2 +- src/chart/pie/PieView.ts | 2 +- src/chart/radar/RadarView.ts | 2 +- src/chart/sunburst/SunburstPiece.ts | 2 +- src/chart/themeRiver/ThemeRiverView.ts | 2 +- src/component/graphic/GraphicView.ts | 2 +- src/util/graphic.ts | 2 +- 17 files changed, 16 insertions(+), 16 deletions(-) rename src/animation/{basicTrasition.ts => basicTransition.ts} (100%) diff --git a/src/animation/basicTrasition.ts b/src/animation/basicTransition.ts similarity index 100% rename from src/animation/basicTrasition.ts rename to src/animation/basicTransition.ts diff --git a/src/animation/customGraphicKeyframeAnimation.ts b/src/animation/customGraphicKeyframeAnimation.ts index 53f9fbbddc..196c5fcb37 100644 --- a/src/animation/customGraphicKeyframeAnimation.ts +++ b/src/animation/customGraphicKeyframeAnimation.ts @@ -23,7 +23,7 @@ import { keys, filter, each, isArray, indexOf } from 'zrender/src/core/util'; import { ELEMENT_ANIMATABLE_PROPS } from './customGraphicTransition'; import { AnimationOption, AnimationOptionMixin, Dictionary } from '../util/types'; import { Model } from '../echarts.all'; -import { getAnimationConfig } from './basicTrasition'; +import { getAnimationConfig } from './basicTransition'; import { warn } from '../util/log'; import { makeInner } from '../util/model'; diff --git a/src/animation/customGraphicTransition.ts b/src/animation/customGraphicTransition.ts index e1cdb68dac..73c12401aa 100644 --- a/src/animation/customGraphicTransition.ts +++ b/src/animation/customGraphicTransition.ts @@ -25,7 +25,7 @@ import { assert, bind, each, eqNaN, extend, hasOwn, indexOf, isArrayLike, keys, import { cloneValue } from 'zrender/src/animation/Animator'; import Displayable, { DisplayableProps } from 'zrender/src/graphic/Displayable'; import Model from '../model/Model'; -import { getAnimationConfig } from './basicTrasition'; +import { getAnimationConfig } from './basicTransition'; import { Path } from '../util/graphic'; import { warn } from '../util/log'; import { AnimationOption, AnimationOptionMixin, ZRStyleProps } from '../util/types'; diff --git a/src/animation/morphTransitionHelper.ts b/src/animation/morphTransitionHelper.ts index 6caafe39f4..f9672073ca 100644 --- a/src/animation/morphTransitionHelper.ts +++ b/src/animation/morphTransitionHelper.ts @@ -29,7 +29,7 @@ import { Path } from '../util/graphic'; import SeriesModel from '../model/Series'; import Element, { ElementAnimateConfig } from 'zrender/src/Element'; import { defaults, isArray} from 'zrender/src/core/util'; -import { getAnimationConfig } from './basicTrasition'; +import { getAnimationConfig } from './basicTransition'; import { ECElement, UniversalTransitionOption } from '../util/types'; import { clonePath } from 'zrender/src/tool/path'; import Model from '../model/Model'; diff --git a/src/animation/universalTransition.ts b/src/animation/universalTransition.ts index 0ccae06363..dabd7ee3ec 100644 --- a/src/animation/universalTransition.ts +++ b/src/animation/universalTransition.ts @@ -37,7 +37,7 @@ import { import { makeInner, normalizeToArray } from '../util/model'; import { warn } from '../util/log'; import ExtensionAPI from '../core/ExtensionAPI'; -import { getAnimationConfig, getOldStyle } from './basicTrasition'; +import { getAnimationConfig, getOldStyle } from './basicTransition'; import Model from '../model/Model'; import Displayable from 'zrender/src/graphic/Displayable'; diff --git a/src/chart/bar/BarView.ts b/src/chart/bar/BarView.ts index 70e6c34678..a5c99d0bd3 100644 --- a/src/chart/bar/BarView.ts +++ b/src/chart/bar/BarView.ts @@ -64,7 +64,7 @@ import {LayoutRect} from '../../util/layout'; import {EventCallback} from 'zrender/src/core/Eventful'; import { warn } from '../../util/log'; import {createSectorCalculateTextPosition, SectorTextPosition, setSectorTextRotation} from '../../label/sectorLabel'; -import { saveOldStyle } from '../../animation/basicTrasition'; +import { saveOldStyle } from '../../animation/basicTransition'; import Element from 'zrender/src/Element'; const mathMax = Math.max; diff --git a/src/chart/boxplot/BoxplotView.ts b/src/chart/boxplot/BoxplotView.ts index f217e8af7f..f48cdf67b0 100644 --- a/src/chart/boxplot/BoxplotView.ts +++ b/src/chart/boxplot/BoxplotView.ts @@ -27,7 +27,7 @@ import GlobalModel from '../../model/Global'; import ExtensionAPI from '../../core/ExtensionAPI'; import SeriesData from '../../data/SeriesData'; import { BoxplotItemLayout } from './boxplotLayout'; -import { saveOldStyle } from '../../animation/basicTrasition'; +import { saveOldStyle } from '../../animation/basicTransition'; class BoxplotView extends ChartView { static type = 'boxplot'; diff --git a/src/chart/candlestick/CandlestickView.ts b/src/chart/candlestick/CandlestickView.ts index 9b2436db92..3fa95f39d8 100644 --- a/src/chart/candlestick/CandlestickView.ts +++ b/src/chart/candlestick/CandlestickView.ts @@ -31,7 +31,7 @@ import SeriesData from '../../data/SeriesData'; import {CandlestickItemLayout} from './candlestickLayout'; import { CoordinateSystemClipArea } from '../../coord/CoordinateSystem'; import Model from '../../model/Model'; -import { saveOldStyle } from '../../animation/basicTrasition'; +import { saveOldStyle } from '../../animation/basicTransition'; import Element from 'zrender/src/Element'; const SKIP_PROPS = ['color', 'borderColor'] as const; diff --git a/src/chart/funnel/FunnelView.ts b/src/chart/funnel/FunnelView.ts index 673c53ceb2..e4a922afca 100644 --- a/src/chart/funnel/FunnelView.ts +++ b/src/chart/funnel/FunnelView.ts @@ -27,7 +27,7 @@ import SeriesData from '../../data/SeriesData'; import { ColorString } from '../../util/types'; import { setLabelLineStyle, getLabelLineStatesModels } from '../../label/labelGuideHelper'; import { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle'; -import { saveOldStyle } from '../../animation/basicTrasition'; +import { saveOldStyle } from '../../animation/basicTransition'; const opacityAccessPath = ['itemStyle', 'opacity'] as const; diff --git a/src/chart/helper/Symbol.ts b/src/chart/helper/Symbol.ts index 9295f306d8..c31e9b11b3 100644 --- a/src/chart/helper/Symbol.ts +++ b/src/chart/helper/Symbol.ts @@ -30,7 +30,7 @@ import { SymbolDrawSeriesScope, SymbolDrawItemModelOption } from './SymbolDraw'; import { extend, isNumber } from 'zrender/src/core/util'; import { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle'; import ZRImage from 'zrender/src/graphic/Image'; -import { saveOldStyle } from '../../animation/basicTrasition'; +import { saveOldStyle } from '../../animation/basicTransition'; import Model from '../../model/Model'; type ECSymbol = ReturnType; diff --git a/src/chart/parallel/ParallelView.ts b/src/chart/parallel/ParallelView.ts index 4f00445c28..a56c5579b7 100644 --- a/src/chart/parallel/ParallelView.ts +++ b/src/chart/parallel/ParallelView.ts @@ -29,7 +29,7 @@ import Parallel from '../../coord/parallel/Parallel'; import { OptionAxisType } from '../../coord/axisCommonTypes'; import { numericToNumber } from '../../util/number'; import { eqNaN } from 'zrender/src/core/util'; -import { saveOldStyle } from '../../animation/basicTrasition'; +import { saveOldStyle } from '../../animation/basicTransition'; import Element from 'zrender/src/Element'; const DEFAULT_SMOOTH = 0.3; diff --git a/src/chart/pie/PieView.ts b/src/chart/pie/PieView.ts index 9118f9267b..77f5c445e3 100644 --- a/src/chart/pie/PieView.ts +++ b/src/chart/pie/PieView.ts @@ -32,7 +32,7 @@ import labelLayout from './labelLayout'; import { setLabelLineStyle, getLabelLineStatesModels } from '../../label/labelGuideHelper'; import { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle'; import { getSectorCornerRadius } from '../helper/pieHelper'; -import { saveOldStyle } from '../../animation/basicTrasition'; +import { saveOldStyle } from '../../animation/basicTransition'; import { getBasicPieLayout } from './pieLayout'; /** diff --git a/src/chart/radar/RadarView.ts b/src/chart/radar/RadarView.ts index 429b5a50e4..e51130d4bb 100644 --- a/src/chart/radar/RadarView.ts +++ b/src/chart/radar/RadarView.ts @@ -30,7 +30,7 @@ import GlobalModel from '../../model/Global'; import { VectorArray } from 'zrender/src/core/vector'; import { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle'; import ZRImage from 'zrender/src/graphic/Image'; -import { saveOldStyle } from '../../animation/basicTrasition'; +import { saveOldStyle } from '../../animation/basicTransition'; type RadarSymbol = ReturnType & { __dimIdx: number diff --git a/src/chart/sunburst/SunburstPiece.ts b/src/chart/sunburst/SunburstPiece.ts index a44b7b2921..873a686f17 100644 --- a/src/chart/sunburst/SunburstPiece.ts +++ b/src/chart/sunburst/SunburstPiece.ts @@ -31,7 +31,7 @@ import { getECData } from '../../util/innerStore'; import { getSectorCornerRadius } from '../helper/pieHelper'; import {createOrUpdatePatternFromDecal} from '../../util/decal'; import ExtensionAPI from '../../core/ExtensionAPI'; -import { saveOldStyle } from '../../animation/basicTrasition'; +import { saveOldStyle } from '../../animation/basicTransition'; const DEFAULT_SECTOR_Z = 2; const DEFAULT_TEXT_Z = 4; diff --git a/src/chart/themeRiver/ThemeRiverView.ts b/src/chart/themeRiver/ThemeRiverView.ts index 754eb2bf7f..283d43a5c3 100644 --- a/src/chart/themeRiver/ThemeRiverView.ts +++ b/src/chart/themeRiver/ThemeRiverView.ts @@ -29,7 +29,7 @@ import GlobalModel from '../../model/Global'; import ExtensionAPI from '../../core/ExtensionAPI'; import { RectLike } from 'zrender/src/core/BoundingRect'; import { ColorString } from '../../util/types'; -import { saveOldStyle } from '../../animation/basicTrasition'; +import { saveOldStyle } from '../../animation/basicTransition'; type LayerSeries = ReturnType; diff --git a/src/component/graphic/GraphicView.ts b/src/component/graphic/GraphicView.ts index 8a573e77d3..e29d238050 100644 --- a/src/component/graphic/GraphicView.ts +++ b/src/component/graphic/GraphicView.ts @@ -44,7 +44,7 @@ import { isTransitionAll, updateLeaveTo } from '../../animation/customGraphicTransition'; -import { updateProps } from '../../animation/basicTrasition'; +import { updateProps } from '../../animation/basicTransition'; import { applyKeyframeAnimation, stopPreviousKeyframeAnimationAndRestore diff --git a/src/util/graphic.ts b/src/util/graphic.ts index 2f66a79c7e..a2e2d7c176 100644 --- a/src/util/graphic.ts +++ b/src/util/graphic.ts @@ -75,7 +75,7 @@ import { removeElement, removeElementWithFadeOut, isElementRemoved -} from '../animation/basicTrasition'; +} from '../animation/basicTransition'; /** * @deprecated export for compatitable reason From 905b32405f10c7e2b5fb522759120b4bcaba5ab8 Mon Sep 17 00:00:00 2001 From: Ovilia Date: Mon, 13 Jun 2022 12:28:30 +0800 Subject: [PATCH 24/86] chore: update pr template to improve doc control --- .github/pull_request_template.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 4b6b673ce4..1f02a0e753 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -33,7 +33,7 @@ This pull request is in the type of: -### After: How is it fixed in this PR? +### After: How does it behave after the fixing? @@ -41,11 +41,20 @@ This pull request is in the type of: +## Document Info + +One of the following should be checked. + +- [ ] This PR doesn't relate to document changes +- [ ] The document should be updated later +- [ ] The document changes have been made in apache/echarts-doc#xxx + + + ## Misc - +### ZRender Changes -- [ ] The API has been changed (apache/echarts-doc#xxx). - [ ] This PR depends on ZRender changes (ecomfe/zrender#xxx). ### Related test cases or examples to use the new APIs From 821b24ad6b37deefda9fed0645aa6e42474cf6a6 Mon Sep 17 00:00:00 2001 From: zhangchuangm Date: Wed, 15 Jun 2022 10:38:01 +0800 Subject: [PATCH 25/86] fix:improve interface SunburstSeriesOption and TreemapSeriesOption --- src/chart/sunburst/SunburstSeries.ts | 4 ++-- src/chart/treemap/TreemapSeries.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/chart/sunburst/SunburstSeries.ts b/src/chart/sunburst/SunburstSeries.ts index 9ef36b54d5..0887e2fd7f 100644 --- a/src/chart/sunburst/SunburstSeries.ts +++ b/src/chart/sunburst/SunburstSeries.ts @@ -81,7 +81,7 @@ export interface SunburstSeriesNodeItemOption extends StatesOptionMixin, SunburstStatesMixin>, OptionDataItemObject { - nodeClick?: 'rootToNode' | 'link' + nodeClick?: 'rootToNode' | 'link' | false // Available when nodeClick is link link?: string target?: string @@ -138,7 +138,7 @@ export interface SunburstSeriesOption extends */ // highlightPolicy?: 'descendant' | 'ancestor' | 'self' - nodeClick?: 'rootToNode' | 'link' + nodeClick?: 'rootToNode' | 'link' | false renderLabelForZeroData?: boolean diff --git a/src/chart/treemap/TreemapSeries.ts b/src/chart/treemap/TreemapSeries.ts index 241837c9fc..78fb9cc3d8 100644 --- a/src/chart/treemap/TreemapSeries.ts +++ b/src/chart/treemap/TreemapSeries.ts @@ -192,7 +192,7 @@ export interface TreemapSeriesOption * be on left depth, the behaviour would be changing root. Otherwise * use behavious defined above. */ - nodeClick?: 'zoomToNode' | 'link' + nodeClick?: 'zoomToNode' | 'link' | false breadcrumb?: BoxLayoutOptionMixin & { show?: boolean From f21ec1d297711b90f2be843c4f053c9c5c252af0 Mon Sep 17 00:00:00 2001 From: jiawulin001 Date: Fri, 17 Jun 2022 14:05:42 +0800 Subject: [PATCH 26/86] fix: sliderZoom in candlestick dataset error --- src/component/dataZoom/SliderZoomView.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/component/dataZoom/SliderZoomView.ts b/src/component/dataZoom/SliderZoomView.ts index 6669929fb7..1f98f15923 100644 --- a/src/component/dataZoom/SliderZoomView.ts +++ b/src/component/dataZoom/SliderZoomView.ts @@ -359,7 +359,8 @@ class SliderZoomView extends DataZoomView { const oldSize = this._shadowSize || []; const seriesModel = info.series; const data = seriesModel.getRawData(); - const otherDim: string = seriesModel.getShadowDim + const candlestickDim = seriesModel.getShadowDim && seriesModel.getShadowDim(); + const otherDim: string = candlestickDim && data.getDimensionInfo(candlestickDim) ? seriesModel.getShadowDim() // @see candlestick : info.otherDim; From ae66fe6de1ed1be1ba50890baf0033b24c64632d Mon Sep 17 00:00:00 2001 From: Amice13 Date: Sat, 18 Jun 2022 13:27:43 +0300 Subject: [PATCH 27/86] feat(i18n): add Ukrainian translation. close #17243 --- src/i18n/langUA.ts | 143 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 src/i18n/langUA.ts diff --git a/src/i18n/langUA.ts b/src/i18n/langUA.ts new file mode 100644 index 0000000000..38b2e10498 --- /dev/null +++ b/src/i18n/langUA.ts @@ -0,0 +1,143 @@ +/* + * 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. + */ + +/** + * Language: Ukrainian. + */ + +export default { + time: { + month: [ + 'Січень', 'Лютий', 'Березень', 'Квітень', 'Травень', 'Червень', + 'Липень', 'Серпень', 'Вересень', 'Жовтень', 'Листопад', 'Грудень' + ], + monthAbbr: [ + 'Січ', 'Лют', 'Бер', 'Кві', 'Тра', 'Чер', + 'Лип', 'Сер', 'Вер', 'Жов', 'Лис', 'Гру' + ], + dayOfWeek: [ + 'Неділя', 'Понеділок', 'Вівторок', 'Середа', 'Четвер', 'П\'ятниця', 'Субота' + ], + dayOfWeekAbbr: [ + 'нд', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб' + ] + }, + legend: { + selector: { + all: 'Все', + inverse: 'Обернути' + } + }, + toolbox: { + brush: { + title: { + rect: 'Выділити область', + polygon: 'Інструмент «Ласо»', + lineX: 'Горизонтальне виділення', + lineY: 'Вертикальне виділення', + keep: 'Залишити обране', + clear: 'Очистити обране' + } + }, + dataView: { + title: 'Дані', + lang: ['Дані', 'Закрити', 'Оновити'] + }, + dataZoom: { + title: { + zoom: 'Збільшити', + back: 'Скасувати збільшення' + } + }, + magicType: { + title: { + line: 'Переключитися на лінійний графік', + bar: 'Переключитися на стовпчикову діаграму', + stack: 'Стопка', + tiled: 'Плитка' + } + }, + restore: { + title: 'Відновити' + }, + saveAsImage: { + title: 'Зберегти зображення', + lang: ['Правий клік, щоб зберегти зображення'] + } + }, + series: { + typeNames: { + pie: 'Кругова діаграма', + bar: 'Стовпчикова діаграма', + line: 'Лінійний графік', + scatter: 'Точкова діаграма', + effectScatter: 'Точкова діаграма з хвилями', + radar: 'Пелюсткова діаграма', + tree: 'Дерево', + treemap: 'Пласке дерево', + boxplot: 'Ящик з вусами', + candlestick: 'Свічний графік', + k: 'Графік К-ліній', + heatmap: 'Теплова мапа', + map: 'Мапа', + parallel: 'Діаграма паралельних координат', + lines: 'Лінійний граф', + graph: 'Граф отношений', + sankey: 'Діаграма Санкей', + funnel: 'Воронкообразна діаграма', + gauge: 'Шкала', + pictorialBar: 'Стовпчик-картинка', + themeRiver: 'Тематична ріка', + sunburst: 'Сонячне проміння' + } + }, + aria: { + general: { + withTitle: 'Це графік, що відрображує "{title}"', + withoutTitle: 'Це графік' + }, + series: { + single: { + prefix: '', + withName: ' з типом {seriesType} та іменем {seriesName}.', + withoutName: ' з типом {seriesType}.' + }, + multiple: { + prefix: '. Він складається з {seriesCount} серій.', + withName: + ' Серія {seriesId} має тип {seriesType} та відображає {seriesName}.', + withoutName: ' Серія {seriesId} має тип {seriesType}.', + separator: { + middle: '', + end: '' + } + } + }, + data: { + allData: 'Дані такі: ', + partialData: 'Перші {displayCnt} елементів: ', + withName: 'значення для {name} — {value}', + withoutName: '{value}', + separator: { + middle: ', ', + end: '. ' + } + } + } +}; From aeca584e79e44fa2a23dbfa2f4b081d403b6e7c3 Mon Sep 17 00:00:00 2001 From: pissang Date: Sun, 19 Jun 2022 22:57:26 +0800 Subject: [PATCH 28/86] chore: fix publish ci on fork --- .github/workflows/nightly-next.yml | 1 + .github/workflows/nightly.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/nightly-next.yml b/.github/workflows/nightly-next.yml index a8f1f2a9cf..b8c7978846 100644 --- a/.github/workflows/nightly-next.yml +++ b/.github/workflows/nightly-next.yml @@ -11,6 +11,7 @@ on: jobs: build: runs-on: ubuntu-latest + if: ${{ github.repository_owner == 'apache' }} strategy: matrix: diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 030044bbb4..5f4a302383 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -11,6 +11,7 @@ on: jobs: build: runs-on: ubuntu-latest + if: ${{ github.repository_owner == 'apache' }} strategy: matrix: From f950face586b575e47e97134d126c7f9d3f53f2d Mon Sep 17 00:00:00 2001 From: pissang Date: Mon, 20 Jun 2022 00:55:21 +0800 Subject: [PATCH 29/86] chore: check owner on specific workflows --- .github/workflows/source-release.yml | 1 + .github/workflows/stale.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/source-release.yml b/.github/workflows/source-release.yml index db4c7e2f77..c98ba72345 100644 --- a/.github/workflows/source-release.yml +++ b/.github/workflows/source-release.yml @@ -7,6 +7,7 @@ on: jobs: materials: runs-on: ubuntu-latest + if: ${{ github.repository_owner == 'apache' }} strategy: matrix: diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 7f1420b4c5..50295e8a68 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -11,6 +11,7 @@ on: jobs: stale: runs-on: ubuntu-latest + if: ${{ github.repository_owner == 'apache' }} steps: - name: Close Stale Issues uses: actions/stale@v4 From 6212121e9723cea6f82af68c030ea9a12b3a3c26 Mon Sep 17 00:00:00 2001 From: plainheart Date: Mon, 20 Jun 2022 11:42:23 +0800 Subject: [PATCH 30/86] fix(line): set default z/zlevel for temporary symbol to avoid warnings. --- src/chart/line/LineView.ts | 4 ++-- test/line-case.html | 34 +++++++++++++++++++++++++++++ test/runTest/actions/__meta__.json | 4 ++-- test/runTest/actions/line-case.json | 2 +- 4 files changed, 39 insertions(+), 5 deletions(-) diff --git a/src/chart/line/LineView.ts b/src/chart/line/LineView.ts index 493c17d186..45414fb386 100644 --- a/src/chart/line/LineView.ts +++ b/src/chart/line/LineView.ts @@ -947,8 +947,8 @@ class LineView extends ChartView { if (this._clipShapeForSymbol && !this._clipShapeForSymbol.contain(x, y)) { return; } - const zlevel = seriesModel.get('zlevel'); - const z = seriesModel.get('z'); + const zlevel = seriesModel.get('zlevel') || 0; + const z = seriesModel.get('z') || 0; symbol = new SymbolClz(data, dataIndex); symbol.x = x; symbol.y = y; diff --git a/test/line-case.html b/test/line-case.html index aa54d7c77c..8d76e8e412 100644 --- a/test/line-case.html +++ b/test/line-case.html @@ -41,6 +41,7 @@
+
@@ -610,6 +611,39 @@ }); + + diff --git a/test/runTest/actions/__meta__.json b/test/runTest/actions/__meta__.json index 473fa64b8f..388c569e03 100644 --- a/test/runTest/actions/__meta__.json +++ b/test/runTest/actions/__meta__.json @@ -121,7 +121,7 @@ "line-animation": 1, "line-animation-update": 3, "line-boldWhenHover": 1, - "line-case": 1, + "line-case": 2, "line-crash": 1, "line-endLabel": 1, "line-sampling": 2, @@ -189,8 +189,8 @@ "tooltip-valueFormatter": 3, "tree-image": 1, "tree-legend": 1, - "tree-radial": 2, "tree-polyline": 1, + "tree-radial": 2, "treemap-action": 3, "treemap-disk": 3, "treemap-disk2": 3, diff --git a/test/runTest/actions/line-case.json b/test/runTest/actions/line-case.json index 318b5d1ac1..3de8815477 100644 --- a/test/runTest/actions/line-case.json +++ b/test/runTest/actions/line-case.json @@ -1 +1 @@ -[{"name":"Action 1","ops":[{"type":"mousedown","time":264,"x":423,"y":226},{"type":"mouseup","time":353,"x":423,"y":226},{"time":354,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":426,"x":425,"y":227},{"type":"mousemove","time":626,"x":456,"y":261},{"type":"mousemove","time":826,"x":499,"y":322},{"type":"mousedown","time":936,"x":499,"y":322},{"type":"mousemove","time":1027,"x":495,"y":317},{"type":"mousemove","time":1231,"x":443,"y":252},{"type":"mouseup","time":1403,"x":443,"y":251},{"time":1404,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":1493,"x":443,"y":251},{"type":"mousemove","time":1976,"x":443,"y":251},{"type":"mousemove","time":2180,"x":455,"y":233},{"type":"mousemove","time":2393,"x":455,"y":231},{"type":"mousedown","time":2469,"x":455,"y":231},{"type":"mouseup","time":2532,"x":454,"y":231},{"time":2533,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":2593,"x":454,"y":231}],"scrollY":1268,"scrollX":0,"timestamp":1641536392159}] \ No newline at end of file +[{"name":"Action 1","ops":[{"type":"mousedown","time":264,"x":423,"y":226},{"type":"mouseup","time":353,"x":423,"y":226},{"time":354,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":426,"x":425,"y":227},{"type":"mousemove","time":626,"x":456,"y":261},{"type":"mousemove","time":826,"x":499,"y":322},{"type":"mousedown","time":936,"x":499,"y":322},{"type":"mousemove","time":1027,"x":495,"y":317},{"type":"mousemove","time":1231,"x":443,"y":252},{"type":"mouseup","time":1403,"x":443,"y":251},{"time":1404,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":1493,"x":443,"y":251},{"type":"mousemove","time":1976,"x":443,"y":251},{"type":"mousemove","time":2180,"x":455,"y":233},{"type":"mousemove","time":2393,"x":455,"y":231},{"type":"mousedown","time":2469,"x":455,"y":231},{"type":"mouseup","time":2532,"x":454,"y":231},{"time":2533,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":2593,"x":454,"y":231}],"scrollY":1268,"scrollX":0,"timestamp":1641536392159},{"name":"Action 2","ops":[{"type":"mousemove","time":556,"x":40,"y":566},{"type":"mousemove","time":757,"x":172,"y":441},{"type":"mousemove","time":963,"x":180,"y":424},{"type":"mousemove","time":1290,"x":180,"y":425}],"scrollY":1726,"scrollX":0,"timestamp":1655695727357}] \ No newline at end of file From bafb0f9a8a0ef5d4b7916c1cf62fbd4080a5da52 Mon Sep 17 00:00:00 2001 From: susiwen8 Date: Tue, 21 Jun 2022 15:14:29 +0800 Subject: [PATCH 31/86] feat(treemap.breadcrumb): add `emphasis` state (#17242) * feat(treemap.breadcrumb): add `emphasis` state * feat(treemap.breadcrumb): enbale `emphasis` by default * feat(treemap.breadcrumb): more text style * chore: remove unnecessary code * chore: simplify code * chore: cache emphasis item style --- src/chart/treemap/Breadcrumb.ts | 27 ++++++++++++++++++--------- src/chart/treemap/TreemapSeries.ts | 11 ++++++++++- src/data/DataStore.ts | 2 +- src/data/Graph.ts | 8 ++++---- src/data/Tree.ts | 18 +++++++++--------- src/model/Global.ts | 6 +++--- src/visual/VisualMapping.ts | 6 +++--- test/treemap-simple.html | 9 +++++++++ 8 files changed, 57 insertions(+), 30 deletions(-) diff --git a/src/chart/treemap/Breadcrumb.ts b/src/chart/treemap/Breadcrumb.ts index 6dd35c5df2..0875c4a2b3 100644 --- a/src/chart/treemap/Breadcrumb.ts +++ b/src/chart/treemap/Breadcrumb.ts @@ -29,7 +29,8 @@ import { ZRElementEvent, BoxLayoutOptionMixin, ECElement } from '../../util/type import Element from 'zrender/src/Element'; import Model from '../../model/Model'; import { convertOptionIdName } from '../../util/model'; -import { Z2_EMPHASIS_LIFT } from '../../util/states'; +import { toggleHoverEmphasis, Z2_EMPHASIS_LIFT } from '../../util/states'; +import { createTextStyle } from '../../label/labelStyle'; const TEXT_PADDING = 8; const ITEM_GAP = 8; @@ -55,6 +56,7 @@ interface LayoutParam { } type BreadcrumbItemStyleModel = Model; +type BreadcrumbEmphasisItemStyleModel = Model; type BreadcrumbTextStyleModel = Model; class Breadcrumb { @@ -81,8 +83,9 @@ class Breadcrumb { } const normalStyleModel = model.getModel('itemStyle'); - // let emphasisStyleModel = model.getModel('emphasis.itemStyle'); + const emphasisModel = model.getModel('emphasis'); const textStyleModel = normalStyleModel.getModel('textStyle'); + const emphasisTextStyleModel = emphasisModel.getModel(['itemStyle', 'textStyle']); const layoutParam: LayoutParam = { pos: { @@ -101,7 +104,10 @@ class Breadcrumb { }; this._prepare(targetNode, layoutParam, textStyleModel); - this._renderContent(seriesModel, layoutParam, normalStyleModel, textStyleModel, onSelect); + this._renderContent( + seriesModel, layoutParam, normalStyleModel, + emphasisModel, textStyleModel, emphasisTextStyleModel, onSelect + ); layout.positionElement(thisGroup, layoutParam.pos, layoutParam.box); } @@ -134,7 +140,9 @@ class Breadcrumb { seriesModel: TreemapSeriesModel, layoutParam: LayoutParam, normalStyleModel: BreadcrumbItemStyleModel, + emphasisModel: BreadcrumbEmphasisItemStyleModel, textStyleModel: BreadcrumbTextStyleModel, + emphasisTextStyleModel: BreadcrumbTextStyleModel, onSelect: OnSelectCallback ) { // Start rendering. @@ -144,6 +152,7 @@ class Breadcrumb { const availableSize = layout.getAvailableSize(layoutParam.pos, layoutParam.box); let totalWidth = layoutParam.totalWidth; const renderList = layoutParam.renderList; + const emphasisItemStyle = emphasisModel.getModel('itemStyle').getItemStyle(); for (let i = renderList.length - 1; i >= 0; i--) { const item = renderList[i]; @@ -172,11 +181,7 @@ class Breadcrumb { } ), textContent: new graphic.Text({ - style: { - text, - fill: textStyleModel.getTextColor(), - font: textStyleModel.getFont() - } + style: createTextStyle(textStyleModel, { text }) }), textConfig: { position: 'inside' @@ -185,7 +190,11 @@ class Breadcrumb { onclick: curry(onSelect, itemNode) }); (el as ECElement).disableLabelAnimation = true; - + el.getTextContent().ensureState('emphasis').style = createTextStyle(emphasisTextStyleModel, { text }); + el.ensureState('emphasis').style = emphasisItemStyle; + toggleHoverEmphasis( + el, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled') + ); this.group.add(el); packEventData(el, seriesModel, itemNode); diff --git a/src/chart/treemap/TreemapSeries.ts b/src/chart/treemap/TreemapSeries.ts index 15c0a5e9a2..2e5f22835f 100644 --- a/src/chart/treemap/TreemapSeries.ts +++ b/src/chart/treemap/TreemapSeries.ts @@ -36,7 +36,8 @@ import { DecalObject, SeriesLabelOption, DefaultEmphasisFocus, - AriaOptionMixin + AriaOptionMixin, + BlurScope } from '../../util/types'; import GlobalModel from '../../model/Global'; import { LayoutRect } from '../../util/layout'; @@ -202,6 +203,9 @@ export interface TreemapSeriesOption itemStyle?: BreadcrumbItemStyleOption emphasis?: { + disabled?: boolean + focus?: DefaultEmphasisFocus + blurScope?: BlurScope itemStyle?: BreadcrumbItemStyleOption } } @@ -265,6 +269,11 @@ class TreemapSeriesModel extends SeriesModel { textStyle: { color: '#fff' } + }, + emphasis: { + itemStyle: { + color: 'rgba(0,0,0,0.9)' //'#5793f3', + } } }, label: { diff --git a/src/data/DataStore.ts b/src/data/DataStore.ts index b839d8b0f3..bb9dcf179c 100644 --- a/src/data/DataStore.ts +++ b/src/data/DataStore.ts @@ -448,7 +448,7 @@ class DataStore { } getValues(idx: number): ParsedValue[]; - getValues(dimensions: readonly DimensionIndex[], idx?: number): ParsedValue[] + getValues(dimensions: readonly DimensionIndex[], idx?: number): ParsedValue[]; getValues(dimensions: readonly DimensionIndex[] | number, idx?: number): ParsedValue[] { const values = []; let dimArr: DimensionIndex[] = []; diff --git a/src/data/Graph.ts b/src/data/Graph.ts index a250ad9632..f7939a5304 100644 --- a/src/data/Graph.ts +++ b/src/data/Graph.ts @@ -360,8 +360,8 @@ class GraphNode { } // TODO: TYPE Same type with Model#getModel - getModel(): Model - getModel(path: S): Model + getModel(): Model; + getModel(path: S): Model; getModel(path?: string): Model { if (this.dataIndex < 0) { return; @@ -410,8 +410,8 @@ class GraphEdge { this.dataIndex = dataIndex == null ? -1 : dataIndex; } - getModel(): Model - getModel(path: S): Model + getModel(): Model; + getModel(path: S): Model; // eslint-disable-next-line @typescript-eslint/no-unused-vars getModel(path?: string): Model { if (this.dataIndex < 0) { diff --git a/src/data/Tree.ts b/src/data/Tree.ts index ad7ae4241c..8467084945 100644 --- a/src/data/Tree.ts +++ b/src/data/Tree.ts @@ -98,9 +98,9 @@ export class TreeNode { * @param cb If in preorder and return false, * its subtree will not be visited. */ - eachNode(options: TreeTraverseOrder, cb: TreeTraverseCallback, context?: Ctx): void - eachNode(options: TreeTraverseOption, cb: TreeTraverseCallback, context?: Ctx): void - eachNode(cb: TreeTraverseCallback, context?: Ctx): void + eachNode(options: TreeTraverseOrder, cb: TreeTraverseCallback, context?: Ctx): void; + eachNode(options: TreeTraverseOption, cb: TreeTraverseCallback, context?: Ctx): void; + eachNode(cb: TreeTraverseCallback, context?: Ctx): void; eachNode( options: TreeTraverseOrder | TreeTraverseOption | TreeTraverseCallback, cb?: TreeTraverseCallback | Ctx, @@ -225,7 +225,7 @@ export class TreeNode { return this.hostTree.data.getItemLayout(this.dataIndex); } - getModel(): Model + getModel(): Model; // @depcrecated // getModel(path: S): Model // eslint-disable-next-line @typescript-eslint/no-unused-vars @@ -251,8 +251,8 @@ export class TreeNode { * }); */ // TODO: TYPE - setVisual(key: string, value: any): void - setVisual(obj: Dictionary): void + setVisual(key: string, value: any): void; + setVisual(obj: Dictionary): void; setVisual(key: string | Dictionary, value?: any) { this.dataIndex >= 0 && this.hostTree.data.setItemVisual(this.dataIndex, key as any, value); @@ -353,9 +353,9 @@ class Tree { * @param cb * @param context */ - eachNode(options: TreeTraverseOrder, cb: TreeTraverseCallback, context?: Ctx): void - eachNode(options: TreeTraverseOption, cb: TreeTraverseCallback, context?: Ctx): void - eachNode(cb: TreeTraverseCallback, context?: Ctx): void + eachNode(options: TreeTraverseOrder, cb: TreeTraverseCallback, context?: Ctx): void; + eachNode(options: TreeTraverseOption, cb: TreeTraverseCallback, context?: Ctx): void; + eachNode(cb: TreeTraverseCallback, context?: Ctx): void; eachNode( options: TreeTraverseOrder | TreeTraverseOption | TreeTraverseCallback, cb?: TreeTraverseCallback | Ctx, diff --git a/src/model/Global.ts b/src/model/Global.ts index d4777a4ee9..cadc98b20d 100644 --- a/src/model/Global.ts +++ b/src/model/Global.ts @@ -696,17 +696,17 @@ echarts.use([${seriesImportName}]);`); eachComponent( cb: EachComponentAllCallback, context?: T - ): void + ): void; eachComponent( mainType: string, cb: EachComponentInMainTypeCallback, context?: T - ): void + ): void; eachComponent( mainType: QueryConditionKindA, cb: EachComponentInMainTypeCallback, context?: T - ): void + ): void; eachComponent( mainType: string | QueryConditionKindA | EachComponentAllCallback, cb?: EachComponentInMainTypeCallback | T, diff --git a/src/visual/VisualMapping.ts b/src/visual/VisualMapping.ts index 8898bc7b06..f964e3fb0a 100644 --- a/src/visual/VisualMapping.ts +++ b/src/visual/VisualMapping.ts @@ -377,13 +377,13 @@ class VisualMapping { } } - static mapVisual(visual: T, callback: (visual: T, key?: string | number) => T, context?: Ctx): T - static mapVisual(visual: T[], callback: (visual: T, key?: string | number) => T[], context?: Ctx): T[] + static mapVisual(visual: T, callback: (visual: T, key?: string | number) => T, context?: Ctx): T; + static mapVisual(visual: T[], callback: (visual: T, key?: string | number) => T[], context?: Ctx): T[]; static mapVisual( visual: Dictionary, callback: (visual: T, key?: string | number) => Dictionary, context?: Ctx - ): Dictionary + ): Dictionary; static mapVisual( visual: T | T[] | Dictionary, callback: (visual: T, key?: string | number) => T | T[] | Dictionary, diff --git a/test/treemap-simple.html b/test/treemap-simple.html index c71b8122ca..37c7aa2ffc 100644 --- a/test/treemap-simple.html +++ b/test/treemap-simple.html @@ -66,6 +66,15 @@ } }, breadcrumb: { + emphasis: { + itemStyle: { + color: 'blue', + opacity: 0.6, + textStyle: { + color: 'green' + } + }, + } }, levels: [ { From 731362be0a1d7e0d0f996a40fe829cd90926fdae Mon Sep 17 00:00:00 2001 From: plainheart Date: Mon, 4 Jul 2022 10:10:51 +0800 Subject: [PATCH 32/86] chore(workflow): close stale issues as not planned rather than completed. [ci skip] --- .github/workflows/stale.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 50295e8a68..d0fc4545b9 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -22,6 +22,7 @@ jobs: stale-pr-label: stale stale-issue-message: 'This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.' close-issue-message: 'This issue has been automatically closed because it did not have recent activity. If this remains to be a problem with the latest version of Apache ECharts, please open a new issue and link this to it. Thanks!' + close-issue-reason: 'not_planned' stale-pr-message: 'This PR has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this PR. We are sorry for this but 2 years is a long time and the code base has been changed a lot. Thanks for your contribution anyway.' close-pr-message: 'This PR has been automatically closed because it has not had recent activity. Sorry for that and we are looking forward to your next contribution.' exempt-issue-labels: 'FAQ,priority: high' From 70b10e198704167ac10bf24a2be1bfa51c5c7f16 Mon Sep 17 00:00:00 2001 From: plainheart Date: Mon, 4 Jul 2022 15:49:42 +0800 Subject: [PATCH 33/86] fix(custom): fix potential NPE when applying leave transition. --- src/chart/custom/CustomView.ts | 10 ++-- test/custom.html | 73 ++++++++++++++++++++---------- test/runTest/actions/__meta__.json | 2 +- test/runTest/actions/custom.json | 2 +- 4 files changed, 57 insertions(+), 30 deletions(-) diff --git a/src/chart/custom/CustomView.ts b/src/chart/custom/CustomView.ts index 49fad96860..1568078267 100644 --- a/src/chart/custom/CustomView.ts +++ b/src/chart/custom/CustomView.ts @@ -228,7 +228,7 @@ export default class CustomChartView extends ChartView { }) .remove(function (oldIdx) { const el = oldData.getItemGraphicEl(oldIdx); - applyLeaveTransition(el, customInnerStore(el).option, customSeries); + el && applyLeaveTransition(el, customInnerStore(el).option, customSeries); }) .update(function (newIdx, oldIdx) { const oldEl = oldData.getItemGraphicEl(oldIdx); @@ -1326,11 +1326,11 @@ function mergeChildren( ); } for (let i = el.childCount() - 1; i >= index; i--) { - // Do not supprot leave elements that are not mentioned in the latest + // Do not support leave elements that are not mentioned in the latest // `renderItem` return. Otherwise users may not have a clear and simple - // concept that how to contorl all of the elements. + // concept that how to control all of the elements. const child = el.childAt(i); - applyLeaveTransition(child, customInnerStore(el).option, seriesModel); + child && applyLeaveTransition(child, customInnerStore(el).option, seriesModel); } } @@ -1383,7 +1383,7 @@ function processAddUpdate( function processRemove(this: DataDiffer, oldIndex: number): void { const context = this.context; const child = context.oldChildren[oldIndex]; - applyLeaveTransition(child, customInnerStore(child).option, context.seriesModel); + child && applyLeaveTransition(child, customInnerStore(child).option, context.seriesModel); } /** diff --git a/test/custom.html b/test/custom.html index 1485c8a155..a8b727ea82 100644 --- a/test/custom.html +++ b/test/custom.html @@ -90,29 +90,37 @@

Custom Single Axis

{name: 'GPU', color: '#72b362'} ]; + var renderCount = 0; // Generate mock data - echarts.util.each(categories, function (category, index) { - var baseTime = startTime; - for (var i = 0; i < dataCount; i++) { - var typeItem = types[Math.round(Math.random() * (types.length - 1))]; - var duration = Math.round(Math.random() * 10000); - data.push({ - name: typeItem.name, - value: [ - index, - baseTime, - baseTime += duration, - duration - ], - itemStyle: { - normal: { - color: typeItem.color + function updateData() { + data = []; + echarts.util.each(categories, function (category, index) { + var baseTime = startTime; + for (var i = 0; i < dataCount; i++) { + var typeItem = types[Math.round(Math.random() * (types.length - 1))]; + var duration = Math.round(Math.random() * 10000); + var isEven = renderCount % 2 === 0; + data.push({ + name: typeItem.name, + value: [ + index, + baseTime, + isEven ? (baseTime += duration) : NaN, + duration + ], + itemStyle: { + normal: { + color: typeItem.color + } } - } - }); - baseTime += Math.round(Math.random() * 2000); - } - }); + }); + isEven && (baseTime += Math.round(Math.random() * 2000)); + } + }); + renderCount++; + } + + updateData(); console.log(JSON.stringify({ startTime: startTime, @@ -211,7 +219,26 @@

Custom Single Axis

}] }; - testHelper.createChart(echarts, 'profile', option); + var chart = testHelper.create(echarts, 'profile', { + option: option, + title: [ + 'The data should be cleared when clicking the **updateData** button firstly', + 'Should have no errors when clicking the **updateData** button once again' + ], + buttons: [ + { + text: 'updateData', + onclick: function () { + updateData(); + chart.setOption({ + series: [{ + data: data + }] + }); + } + } + ] + }); }); @@ -1398,4 +1425,4 @@

Custom Single Axis

- \ No newline at end of file + diff --git a/test/runTest/actions/__meta__.json b/test/runTest/actions/__meta__.json index 388c569e03..baadde9800 100644 --- a/test/runTest/actions/__meta__.json +++ b/test/runTest/actions/__meta__.json @@ -56,7 +56,7 @@ "connect-manually": 1, "connect2": 1, "css-transform": 4, - "custom": 5, + "custom": 6, "custom-bmap-grid": 1, "custom-children-remove": 1, "custom-hexbin": 2, diff --git a/test/runTest/actions/custom.json b/test/runTest/actions/custom.json index 7e80989310..9d0864af42 100644 --- a/test/runTest/actions/custom.json +++ b/test/runTest/actions/custom.json @@ -1 +1 @@ -[{"name":"Action 1","ops":[{"type":"mousedown","time":408,"x":81,"y":475},{"type":"mousemove","time":570,"x":85,"y":475},{"type":"mousemove","time":770,"x":209,"y":479},{"type":"mouseup","time":1011,"x":209,"y":479},{"time":1012,"delay":400,"type":"screenshot-auto"},{"type":"mousedown","time":1403,"x":209,"y":479},{"type":"mousemove","time":1537,"x":210,"y":478},{"type":"mousemove","time":1738,"x":322,"y":473},{"type":"mousemove","time":1945,"x":325,"y":473},{"type":"mousemove","time":2155,"x":326,"y":474},{"type":"mouseup","time":2168,"x":326,"y":474},{"time":2169,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":2271,"x":326,"y":474},{"type":"mousedown","time":2520,"x":326,"y":474},{"type":"mousemove","time":2605,"x":327,"y":474},{"type":"mousemove","time":2806,"x":621,"y":480},{"type":"mousemove","time":3012,"x":631,"y":480},{"type":"mouseup","time":3269,"x":631,"y":480},{"time":3270,"delay":400,"type":"screenshot-auto"}],"scrollY":0,"scrollX":0,"timestamp":1568035195567},{"name":"Action 2","ops":[{"type":"mousedown","time":344,"x":458,"y":537},{"type":"mousemove","time":423,"x":457,"y":537},{"type":"mousemove","time":624,"x":310,"y":538},{"type":"mousemove","time":833,"x":300,"y":540},{"type":"mouseup","time":939,"x":300,"y":540},{"time":940,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":1625,"x":305,"y":540},{"type":"mousemove","time":1830,"x":384,"y":535},{"type":"mousemove","time":2043,"x":368,"y":534},{"type":"mousemove","time":2308,"x":368,"y":534},{"type":"mousedown","time":2321,"x":368,"y":534},{"type":"mousemove","time":2508,"x":430,"y":524},{"type":"mousemove","time":2709,"x":613,"y":516},{"type":"mousemove","time":2909,"x":659,"y":519},{"type":"mousemove","time":3118,"x":682,"y":517},{"type":"mousemove","time":3368,"x":686,"y":517},{"type":"mouseup","time":3436,"x":686,"y":517},{"time":3437,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":3676,"x":685,"y":512},{"type":"mousemove","time":3877,"x":498,"y":192},{"type":"mousemove","time":4077,"x":437,"y":106},{"type":"mousemove","time":4280,"x":387,"y":72},{"type":"mousemove","time":4501,"x":384,"y":71},{"type":"mousedown","time":4618,"x":384,"y":71},{"type":"mouseup","time":4719,"x":384,"y":71},{"time":4720,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":5562,"x":386,"y":71},{"type":"mousemove","time":5768,"x":431,"y":68},{"type":"mousedown","time":5985,"x":431,"y":68},{"type":"mouseup","time":6086,"x":431,"y":68},{"time":6087,"delay":400,"type":"screenshot-auto"}],"scrollY":1749,"scrollX":0,"timestamp":1568035212695},{"name":"Action 3","ops":[{"type":"screenshot","time":1787},{"type":"mousedown","time":2426,"x":408,"y":89},{"type":"mouseup","time":2504,"x":408,"y":89},{"time":2505,"delay":400,"type":"screenshot-auto"},{"type":"mousedown","time":3672,"x":408,"y":89},{"type":"mouseup","time":3754,"x":408,"y":89},{"time":3755,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":4015,"x":416,"y":99},{"type":"mousemove","time":4216,"x":677,"y":586},{"type":"mousemove","time":4417,"x":696,"y":564},{"type":"mousemove","time":4624,"x":711,"y":556},{"type":"mousemove","time":4840,"x":719,"y":554},{"type":"mousedown","time":5007,"x":719,"y":553},{"type":"mousemove","time":5105,"x":719,"y":553},{"type":"mousemove","time":5117,"x":717,"y":554},{"type":"mousemove","time":5317,"x":613,"y":548},{"type":"mousemove","time":5517,"x":511,"y":548},{"type":"mousemove","time":5724,"x":406,"y":555},{"type":"mousemove","time":5935,"x":312,"y":549},{"type":"mouseup","time":6333,"x":312,"y":549},{"time":6334,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":6543,"x":309,"y":550},{"type":"mousemove","time":6750,"x":304,"y":551},{"type":"mousemove","time":6984,"x":323,"y":549},{"type":"mousemove","time":7194,"x":322,"y":549},{"type":"mousemove","time":7394,"x":318,"y":549},{"type":"mousemove","time":7594,"x":264,"y":556},{"type":"mousemove","time":7800,"x":255,"y":557},{"type":"mousedown","time":7855,"x":255,"y":557},{"type":"mousemove","time":8010,"x":308,"y":555},{"type":"mousemove","time":8211,"x":522,"y":557},{"type":"mousemove","time":8421,"x":577,"y":556},{"type":"mouseup","time":8854,"x":577,"y":556},{"time":8855,"delay":400,"type":"screenshot-auto"}],"scrollY":2309,"scrollX":0,"timestamp":1568035234459},{"name":"Action 4","ops":[{"type":"mousedown","time":392,"x":485,"y":521},{"type":"mousemove","time":487,"x":477,"y":520},{"type":"mousemove","time":690,"x":396,"y":521},{"type":"mousemove","time":895,"x":315,"y":522},{"type":"mouseup","time":1150,"x":315,"y":522},{"time":1151,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":1403,"x":315,"y":521},{"type":"mousemove","time":1604,"x":221,"y":201},{"type":"mousemove","time":1812,"x":176,"y":58},{"type":"mousemove","time":2004,"x":170,"y":48},{"type":"mousemove","time":2212,"x":174,"y":52},{"type":"mousedown","time":2335,"x":174,"y":52},{"type":"mouseup","time":2469,"x":174,"y":52},{"time":2470,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":2499,"x":175,"y":52},{"type":"mousemove","time":2699,"x":247,"y":52},{"type":"mousemove","time":2997,"x":247,"y":52},{"type":"mousedown","time":3049,"x":247,"y":52},{"type":"mouseup","time":3138,"x":247,"y":52},{"time":3139,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":3212,"x":251,"y":52},{"type":"mousemove","time":3413,"x":304,"y":58},{"type":"mousemove","time":3620,"x":320,"y":58},{"type":"mousedown","time":3669,"x":320,"y":58},{"type":"mouseup","time":3775,"x":320,"y":58},{"time":3776,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":3980,"x":323,"y":58},{"type":"mousemove","time":4180,"x":376,"y":64},{"type":"mousedown","time":4360,"x":376,"y":64},{"type":"mousemove","time":4387,"x":376,"y":64},{"type":"mouseup","time":4470,"x":376,"y":64},{"time":4471,"delay":400,"type":"screenshot-auto"}],"scrollY":2916,"scrollX":0,"timestamp":1568035317710},{"name":"Action 5","ops":[{"type":"mousedown","time":448,"x":717,"y":482},{"type":"mousemove","time":556,"x":712,"y":482},{"type":"mousemove","time":756,"x":493,"y":483},{"type":"mousemove","time":957,"x":407,"y":481},{"type":"mousemove","time":1158,"x":355,"y":479},{"type":"mouseup","time":1415,"x":355,"y":479},{"time":1416,"delay":400,"type":"screenshot-auto"},{"type":"mousedown","time":2050,"x":355,"y":479},{"type":"mousemove","time":2176,"x":345,"y":480},{"type":"mousemove","time":2382,"x":175,"y":486},{"type":"mousemove","time":2599,"x":161,"y":486},{"type":"mousemove","time":2725,"x":161,"y":486},{"type":"mousemove","time":2933,"x":153,"y":487},{"type":"mouseup","time":3205,"x":153,"y":487},{"time":3206,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":3542,"x":152,"y":487},{"type":"mousemove","time":3744,"x":132,"y":485},{"type":"mousedown","time":3901,"x":130,"y":485},{"type":"mousemove","time":3944,"x":131,"y":485},{"type":"mousemove","time":4144,"x":267,"y":485},{"type":"mousemove","time":4344,"x":278,"y":484},{"type":"mousemove","time":4552,"x":303,"y":482},{"type":"mouseup","time":4705,"x":303,"y":482},{"time":4706,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":5380,"x":305,"y":482},{"type":"mousemove","time":5587,"x":340,"y":475},{"type":"mousemove","time":5780,"x":337,"y":475},{"type":"mousemove","time":5986,"x":333,"y":476},{"type":"mousemove","time":6236,"x":333,"y":477},{"type":"mousemove","time":6437,"x":333,"y":477},{"type":"mousedown","time":6544,"x":333,"y":477},{"type":"mousemove","time":6653,"x":339,"y":477},{"type":"mousemove","time":6862,"x":668,"y":473},{"type":"mousemove","time":7080,"x":684,"y":473},{"type":"mousemove","time":7354,"x":684,"y":473},{"type":"mouseup","time":7730,"x":684,"y":473},{"time":7731,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":7888,"x":678,"y":473},{"type":"mousemove","time":8088,"x":639,"y":472},{"type":"mousedown","time":8265,"x":620,"y":474},{"type":"mousemove","time":8296,"x":620,"y":474},{"type":"mousemove","time":8548,"x":732,"y":473},{"type":"mouseup","time":8782,"x":732,"y":473},{"time":8783,"delay":400,"type":"screenshot-auto"}],"scrollY":3541,"scrollX":0,"timestamp":1568035375040}] \ No newline at end of file +[{"name":"Action 1","ops":[{"type":"mousedown","time":408,"x":81,"y":475},{"type":"mousemove","time":570,"x":85,"y":475},{"type":"mousemove","time":770,"x":209,"y":479},{"type":"mouseup","time":1011,"x":209,"y":479},{"time":1012,"delay":400,"type":"screenshot-auto"},{"type":"mousedown","time":1403,"x":209,"y":479},{"type":"mousemove","time":1537,"x":210,"y":478},{"type":"mousemove","time":1738,"x":322,"y":473},{"type":"mousemove","time":1945,"x":325,"y":473},{"type":"mousemove","time":2155,"x":326,"y":474},{"type":"mouseup","time":2168,"x":326,"y":474},{"time":2169,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":2271,"x":326,"y":474},{"type":"mousedown","time":2520,"x":326,"y":474},{"type":"mousemove","time":2605,"x":327,"y":474},{"type":"mousemove","time":2806,"x":621,"y":480},{"type":"mousemove","time":3012,"x":631,"y":480},{"type":"mouseup","time":3269,"x":631,"y":480},{"time":3270,"delay":400,"type":"screenshot-auto"}],"scrollY":0,"scrollX":0,"timestamp":1568035195567},{"name":"Action 2","ops":[{"type":"mousedown","time":344,"x":458,"y":537},{"type":"mousemove","time":423,"x":457,"y":537},{"type":"mousemove","time":624,"x":310,"y":538},{"type":"mousemove","time":833,"x":300,"y":540},{"type":"mouseup","time":939,"x":300,"y":540},{"time":940,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":1625,"x":305,"y":540},{"type":"mousemove","time":1830,"x":384,"y":535},{"type":"mousemove","time":2043,"x":368,"y":534},{"type":"mousemove","time":2308,"x":368,"y":534},{"type":"mousedown","time":2321,"x":368,"y":534},{"type":"mousemove","time":2508,"x":430,"y":524},{"type":"mousemove","time":2709,"x":613,"y":516},{"type":"mousemove","time":2909,"x":659,"y":519},{"type":"mousemove","time":3118,"x":682,"y":517},{"type":"mousemove","time":3368,"x":686,"y":517},{"type":"mouseup","time":3436,"x":686,"y":517},{"time":3437,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":3676,"x":685,"y":512},{"type":"mousemove","time":3877,"x":498,"y":192},{"type":"mousemove","time":4077,"x":437,"y":106},{"type":"mousemove","time":4280,"x":387,"y":72},{"type":"mousemove","time":4501,"x":384,"y":71},{"type":"mousedown","time":4618,"x":384,"y":71},{"type":"mouseup","time":4719,"x":384,"y":71},{"time":4720,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":5562,"x":386,"y":71},{"type":"mousemove","time":5768,"x":431,"y":68},{"type":"mousedown","time":5985,"x":431,"y":68},{"type":"mouseup","time":6086,"x":431,"y":68},{"time":6087,"delay":400,"type":"screenshot-auto"}],"scrollY":1749,"scrollX":0,"timestamp":1568035212695},{"name":"Action 3","ops":[{"type":"screenshot","time":1787},{"type":"mousedown","time":2426,"x":408,"y":89},{"type":"mouseup","time":2504,"x":408,"y":89},{"time":2505,"delay":400,"type":"screenshot-auto"},{"type":"mousedown","time":3672,"x":408,"y":89},{"type":"mouseup","time":3754,"x":408,"y":89},{"time":3755,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":4015,"x":416,"y":99},{"type":"mousemove","time":4216,"x":677,"y":586},{"type":"mousemove","time":4417,"x":696,"y":564},{"type":"mousemove","time":4624,"x":711,"y":556},{"type":"mousemove","time":4840,"x":719,"y":554},{"type":"mousedown","time":5007,"x":719,"y":553},{"type":"mousemove","time":5105,"x":719,"y":553},{"type":"mousemove","time":5117,"x":717,"y":554},{"type":"mousemove","time":5317,"x":613,"y":548},{"type":"mousemove","time":5517,"x":511,"y":548},{"type":"mousemove","time":5724,"x":406,"y":555},{"type":"mousemove","time":5935,"x":312,"y":549},{"type":"mouseup","time":6333,"x":312,"y":549},{"time":6334,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":6543,"x":309,"y":550},{"type":"mousemove","time":6750,"x":304,"y":551},{"type":"mousemove","time":6984,"x":323,"y":549},{"type":"mousemove","time":7194,"x":322,"y":549},{"type":"mousemove","time":7394,"x":318,"y":549},{"type":"mousemove","time":7594,"x":264,"y":556},{"type":"mousemove","time":7800,"x":255,"y":557},{"type":"mousedown","time":7855,"x":255,"y":557},{"type":"mousemove","time":8010,"x":308,"y":555},{"type":"mousemove","time":8211,"x":522,"y":557},{"type":"mousemove","time":8421,"x":577,"y":556},{"type":"mouseup","time":8854,"x":577,"y":556},{"time":8855,"delay":400,"type":"screenshot-auto"}],"scrollY":2309,"scrollX":0,"timestamp":1568035234459},{"name":"Action 4","ops":[{"type":"mousedown","time":392,"x":485,"y":521},{"type":"mousemove","time":487,"x":477,"y":520},{"type":"mousemove","time":690,"x":396,"y":521},{"type":"mousemove","time":895,"x":315,"y":522},{"type":"mouseup","time":1150,"x":315,"y":522},{"time":1151,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":1403,"x":315,"y":521},{"type":"mousemove","time":1604,"x":221,"y":201},{"type":"mousemove","time":1812,"x":176,"y":58},{"type":"mousemove","time":2004,"x":170,"y":48},{"type":"mousemove","time":2212,"x":174,"y":52},{"type":"mousedown","time":2335,"x":174,"y":52},{"type":"mouseup","time":2469,"x":174,"y":52},{"time":2470,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":2499,"x":175,"y":52},{"type":"mousemove","time":2699,"x":247,"y":52},{"type":"mousemove","time":2997,"x":247,"y":52},{"type":"mousedown","time":3049,"x":247,"y":52},{"type":"mouseup","time":3138,"x":247,"y":52},{"time":3139,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":3212,"x":251,"y":52},{"type":"mousemove","time":3413,"x":304,"y":58},{"type":"mousemove","time":3620,"x":320,"y":58},{"type":"mousedown","time":3669,"x":320,"y":58},{"type":"mouseup","time":3775,"x":320,"y":58},{"time":3776,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":3980,"x":323,"y":58},{"type":"mousemove","time":4180,"x":376,"y":64},{"type":"mousedown","time":4360,"x":376,"y":64},{"type":"mousemove","time":4387,"x":376,"y":64},{"type":"mouseup","time":4470,"x":376,"y":64},{"time":4471,"delay":400,"type":"screenshot-auto"}],"scrollY":2916,"scrollX":0,"timestamp":1568035317710},{"name":"Action 5","ops":[{"type":"mousedown","time":448,"x":717,"y":482},{"type":"mousemove","time":556,"x":712,"y":482},{"type":"mousemove","time":756,"x":493,"y":483},{"type":"mousemove","time":957,"x":407,"y":481},{"type":"mousemove","time":1158,"x":355,"y":479},{"type":"mouseup","time":1415,"x":355,"y":479},{"time":1416,"delay":400,"type":"screenshot-auto"},{"type":"mousedown","time":2050,"x":355,"y":479},{"type":"mousemove","time":2176,"x":345,"y":480},{"type":"mousemove","time":2382,"x":175,"y":486},{"type":"mousemove","time":2599,"x":161,"y":486},{"type":"mousemove","time":2725,"x":161,"y":486},{"type":"mousemove","time":2933,"x":153,"y":487},{"type":"mouseup","time":3205,"x":153,"y":487},{"time":3206,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":3542,"x":152,"y":487},{"type":"mousemove","time":3744,"x":132,"y":485},{"type":"mousedown","time":3901,"x":130,"y":485},{"type":"mousemove","time":3944,"x":131,"y":485},{"type":"mousemove","time":4144,"x":267,"y":485},{"type":"mousemove","time":4344,"x":278,"y":484},{"type":"mousemove","time":4552,"x":303,"y":482},{"type":"mouseup","time":4705,"x":303,"y":482},{"time":4706,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":5380,"x":305,"y":482},{"type":"mousemove","time":5587,"x":340,"y":475},{"type":"mousemove","time":5780,"x":337,"y":475},{"type":"mousemove","time":5986,"x":333,"y":476},{"type":"mousemove","time":6236,"x":333,"y":477},{"type":"mousemove","time":6437,"x":333,"y":477},{"type":"mousedown","time":6544,"x":333,"y":477},{"type":"mousemove","time":6653,"x":339,"y":477},{"type":"mousemove","time":6862,"x":668,"y":473},{"type":"mousemove","time":7080,"x":684,"y":473},{"type":"mousemove","time":7354,"x":684,"y":473},{"type":"mouseup","time":7730,"x":684,"y":473},{"time":7731,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":7888,"x":678,"y":473},{"type":"mousemove","time":8088,"x":639,"y":472},{"type":"mousedown","time":8265,"x":620,"y":474},{"type":"mousemove","time":8296,"x":620,"y":474},{"type":"mousemove","time":8548,"x":732,"y":473},{"type":"mouseup","time":8782,"x":732,"y":473},{"time":8783,"delay":400,"type":"screenshot-auto"}],"scrollY":3541,"scrollX":0,"timestamp":1568035375040},{"name":"Action 6","ops":[{"type":"mousedown","time":512,"x":40,"y":163},{"type":"mouseup","time":662,"x":40,"y":163},{"type":"mousedown","time":1019,"x":40,"y":163},{"type":"mouseup","time":1164,"x":40,"y":163},{"time":1165,"delay":400,"type":"screenshot-auto"}],"scrollY":0,"scrollX":0,"timestamp":1656920000014}] \ No newline at end of file From 8951f4199994d47d3b77faf6345ea159f2c0814f Mon Sep 17 00:00:00 2001 From: Zhongxiang Wang Date: Tue, 5 Jul 2022 11:21:30 +0800 Subject: [PATCH 34/86] chore: upgrade stale action to v5 fix `close-issue-reason` option is not being recognized --- .github/workflows/stale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index d0fc4545b9..2c293e76c8 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -14,7 +14,7 @@ jobs: if: ${{ github.repository_owner == 'apache' }} steps: - name: Close Stale Issues - uses: actions/stale@v4 + uses: actions/stale@v5 with: days-before-stale: 730 days-before-close: 7 From c885e65033b45ced14536b61be8265d1a842f8a2 Mon Sep 17 00:00:00 2001 From: Ovilia Date: Tue, 5 Jul 2022 16:46:52 +0800 Subject: [PATCH 35/86] fix(log): fix log axis breaks a single data whose log value is negative #13154 --- src/scale/Interval.ts | 3 ++- src/scale/Log.ts | 5 +++-- test/logScale.html | 33 ++++++++++++++++++++++++++++++++- 3 files changed, 37 insertions(+), 4 deletions(-) diff --git a/src/scale/Interval.ts b/src/scale/Interval.ts index 1f4a7f98e8..866051dcf2 100644 --- a/src/scale/Interval.ts +++ b/src/scale/Interval.ts @@ -250,7 +250,8 @@ class IntervalScale = Dictionary> e if (extent[0] === extent[1]) { if (extent[0] !== 0) { // Expand extent - const expandSize = extent[0]; + // Note that extents can be both negative. See #13154 + const expandSize = Math.abs(extent[0]); // In the fowllowing case // Axis has been fixed max 100 // Plus data are all 100 and axis extent are [100, 100]. diff --git a/src/scale/Log.ts b/src/scale/Log.ts index 41586e8775..6354e9eed0 100644 --- a/src/scale/Log.ts +++ b/src/scale/Log.ts @@ -86,8 +86,9 @@ class LogScale extends Scale { setExtent(start: number, end: number): void { const base = this.base; - start = mathLog(start) / mathLog(base); - end = mathLog(end) / mathLog(base); + // log(-Infinity) is NaN, so safe guard here + start = mathLog(Math.max(0, start)) / mathLog(base); + end = mathLog(Math.max(0, end)) / mathLog(base); intervalScaleProto.setExtent.call(this, start, end); } diff --git a/test/logScale.html b/test/logScale.html index e91507ac10..def5bfdfdc 100644 --- a/test/logScale.html +++ b/test/logScale.html @@ -26,12 +26,13 @@
+
+ \ No newline at end of file From 4bf7f4d564410496406881610b34eab303020fbc Mon Sep 17 00:00:00 2001 From: Ovilia Date: Wed, 6 Jul 2022 15:07:12 +0800 Subject: [PATCH 36/86] fix(log): cache base variable --- src/scale/Log.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/scale/Log.ts b/src/scale/Log.ts index 6354e9eed0..b1f4d08b16 100644 --- a/src/scale/Log.ts +++ b/src/scale/Log.ts @@ -85,10 +85,10 @@ class LogScale extends Scale { } setExtent(start: number, end: number): void { - const base = this.base; + const base = mathLog(this.base); // log(-Infinity) is NaN, so safe guard here - start = mathLog(Math.max(0, start)) / mathLog(base); - end = mathLog(Math.max(0, end)) / mathLog(base); + start = mathLog(Math.max(0, start)) / base; + end = mathLog(Math.max(0, end)) / base; intervalScaleProto.setExtent.call(this, start, end); } From 11f488c074a08e8b2a631252d5106776e79d8727 Mon Sep 17 00:00:00 2001 From: plainheart Date: Thu, 7 Jul 2022 11:24:43 +0800 Subject: [PATCH 37/86] fix(axis): fix axis symbol is not reverted when axis is reverse. --- src/component/axis/AxisBuilder.ts | 6 ++- test/axis-arrow.html | 70 ++++++++++++++++++++++++------- 2 files changed, 60 insertions(+), 16 deletions(-) diff --git a/src/component/axis/AxisBuilder.ts b/src/component/axis/AxisBuilder.ts index 5ed1ed3f6b..b0e31e08f8 100644 --- a/src/component/axis/AxisBuilder.ts +++ b/src/component/axis/AxisBuilder.ts @@ -255,6 +255,7 @@ const builders: Record<'axisLine' | 'axisTickLabel' | 'axisName', AxisElementsBu const matrix = transformGroup.transform; const pt1 = [extent[0], 0]; const pt2 = [extent[1], 0]; + const inverse = pt1[0] > pt2[0]; if (matrix) { v2ApplyTransform(pt1, pt1, matrix); v2ApplyTransform(pt2, pt2, matrix); @@ -327,10 +328,11 @@ const builders: Record<'axisLine' | 'axisTickLabel' | 'axisName', AxisElementsBu // Calculate arrow position with offset const r = point.r + point.offset; + const pt = inverse ? pt2 : pt1; symbol.attr({ rotation: point.rotate, - x: pt1[0] + r * Math.cos(opt.rotation), - y: pt1[1] - r * Math.sin(opt.rotation), + x: pt[0] + r * Math.cos(opt.rotation), + y: pt[1] - r * Math.sin(opt.rotation), silent: true, z2: 11 }); diff --git a/test/axis-arrow.html b/test/axis-arrow.html index 4194631f7b..d6a4a5defc 100644 --- a/test/axis-arrow.html +++ b/test/axis-arrow.html @@ -23,19 +23,18 @@ + + -
+
+
+ + From ef3e28feda8dea7b9901afbef10e61c1736f71b0 Mon Sep 17 00:00:00 2001 From: MeetzhDing <3303652975@qq.com> Date: Thu, 5 May 2022 19:51:52 +0800 Subject: [PATCH 38/86] feat(gauge): axisLabel support rotate like sunburst. close 15944 --- src/chart/gauge/GaugeSeries.ts | 8 +++-- src/chart/gauge/GaugeView.ts | 62 +++++++++++++++++++++++++++------- test/gauge-case.html | 8 +++++ test/gauge-simple.html | 3 +- 4 files changed, 64 insertions(+), 17 deletions(-) diff --git a/src/chart/gauge/GaugeSeries.ts b/src/chart/gauge/GaugeSeries.ts index 07bfcc470e..7ffb508376 100644 --- a/src/chart/gauge/GaugeSeries.ts +++ b/src/chart/gauge/GaugeSeries.ts @@ -170,8 +170,9 @@ export interface GaugeSeriesOption extends SeriesOption & { formatter?: LabelFormatter | string + rotate?: 'tangential' | 'radial' | number } pointer?: PointerOption @@ -265,7 +266,8 @@ class GaugeSeriesModel extends SeriesModel { distance: 15, // formatter: null, color: '#464646', - fontSize: 12 + fontSize: 12, + rotate: 0 }, pointer: { icon: null, @@ -321,4 +323,4 @@ class GaugeSeriesModel extends SeriesModel { } -export default GaugeSeriesModel; \ No newline at end of file +export default GaugeSeriesModel; diff --git a/src/chart/gauge/GaugeView.ts b/src/chart/gauge/GaugeView.ts index b646607d75..a03243e1aa 100644 --- a/src/chart/gauge/GaugeView.ts +++ b/src/chart/gauge/GaugeView.ts @@ -31,7 +31,7 @@ import SeriesData from '../../data/SeriesData'; import Sausage from '../../util/shape/sausage'; import {createSymbol} from '../../util/symbol'; import ZRImage from 'zrender/src/graphic/Image'; -import {extend, isFunction, isString} from 'zrender/src/core/util'; +import {extend, isFunction, isString, isNumber} from 'zrender/src/core/util'; import {setCommonECData} from '../../util/innerStore'; import { normalizeArcAngles } from 'zrender/src/core/PathProxy'; @@ -272,19 +272,55 @@ class GaugeView extends ChartView { labelModel.get('formatter') ); const autoColor = getColor(i / splitNumber); + const textStyleX = unitX * (r - splitLineLen - distance) + cx; + const textStyleY = unitY * (r - splitLineLen - distance) + cy; + + const rotateType = labelModel.get('rotate'); + let rotate = 0; + if (rotateType === 'radial') { + rotate = -angle + 2 * Math.PI; + if (rotate > Math.PI / 2) { + rotate += Math.PI; + } + } + else if (rotateType === 'tangential') { + rotate = -angle - Math.PI / 2; + } + else if (isNumber(rotateType)) { + rotate = rotateType * Math.PI / 180; + } - group.add(new graphic.Text({ - style: createTextStyle(labelModel, { - text: label, - x: unitX * (r - splitLineLen - distance) + cx, - y: unitY * (r - splitLineLen - distance) + cy, - verticalAlign: unitY < -0.8 ? 'top' : (unitY > 0.8 ? 'bottom' : 'middle'), - align: unitX < -0.4 ? 'left' : (unitX > 0.4 ? 'right' : 'center') - }, { - inheritColor: autoColor - }), - silent: true - })); + if (rotate === 0) { + group.add(new graphic.Text({ + style: createTextStyle(labelModel, { + text: label, + x: textStyleX, + y: textStyleY, + verticalAlign: unitY < -0.8 ? 'top' : (unitY > 0.8 ? 'bottom' : 'middle'), + align: unitX < -0.4 ? 'left' : (unitX > 0.4 ? 'right' : 'center') + }, { + inheritColor: autoColor + }), + silent: true + })); + } + else { + group.add(new graphic.Text({ + style: createTextStyle(labelModel, { + text: label, + x: textStyleX, + y: textStyleY, + verticalAlign: 'middle', + align: 'center' + }, { + inheritColor: autoColor + }), + silent: true, + originX: textStyleX, + originY: textStyleY, + rotation: rotate + })); + } } // Axis tick diff --git a/test/gauge-case.html b/test/gauge-case.html index 94f8bd5626..cdbf852b32 100644 --- a/test/gauge-case.html +++ b/test/gauge-case.html @@ -65,6 +65,10 @@ show: true, width: 18 }, + axisLabel: { + distance: 30, + rotate: 50 + }, data: [ { value: 0 @@ -101,6 +105,10 @@ name: 'SCORE' } ], + axisLabel: { + distance: 30, + rotate: 'radial' + }, progress: { show: true, roundCap: true diff --git a/test/gauge-simple.html b/test/gauge-simple.html index d92a979c5c..076e0af123 100644 --- a/test/gauge-simple.html +++ b/test/gauge-simple.html @@ -210,6 +210,7 @@ color: '#464646', fontSize: 20, distance: -60, + rotate: 'tangential', formatter: function(value) { if (value === 0.875) { return '优' @@ -252,4 +253,4 @@ - \ No newline at end of file + From 13177430235f99ca566741b35f06614f4332eec2 Mon Sep 17 00:00:00 2001 From: plainheart Date: Mon, 11 Jul 2022 16:32:44 +0800 Subject: [PATCH 39/86] fix(visualMap): fix the indicator doesn't show when hovering on map label. --- src/component/visualMap/ContinuousView.ts | 20 ++++++++++++++------ test/runTest/actions/__meta__.json | 2 +- test/runTest/actions/geo-map.json | 2 +- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/component/visualMap/ContinuousView.ts b/src/component/visualMap/ContinuousView.ts index ac31cd0943..68ad343171 100644 --- a/src/component/visualMap/ContinuousView.ts +++ b/src/component/visualMap/ContinuousView.ts @@ -32,13 +32,14 @@ import GlobalModel from '../../model/Global'; import ExtensionAPI from '../../core/ExtensionAPI'; import Element, { ElementEvent } from 'zrender/src/Element'; import { TextVerticalAlign, TextAlign } from 'zrender/src/core/types'; -import { ColorString, Payload } from '../../util/types'; +import { ColorString, ECEventData, Payload } from '../../util/types'; import { parsePercent } from 'zrender/src/contain/text'; import { setAsHighDownDispatcher } from '../../util/states'; import { createSymbol } from '../../util/symbol'; import ZRImage from 'zrender/src/graphic/Image'; import { getECData } from '../../util/innerStore'; import { createTextStyle } from '../../label/labelStyle'; +import { findEventDispatcher } from '../../util/event'; const linearMap = numberUtil.linearMap; const each = zrUtil.each; @@ -816,16 +817,23 @@ class ContinuousView extends VisualMapView { } private _hoverLinkFromSeriesMouseOver(e: ElementEvent) { - const el = e.target; - const visualMapModel = this.visualMapModel; + let ecData: ECEventData; + + findEventDispatcher(e.target, target => { + const currECData = getECData(target); + if (currECData.dataIndex != null) { + ecData = currECData; + return true; + } + }, true); - if (!el || getECData(el).dataIndex == null) { + if (!ecData) { return; } - const ecData = getECData(el); const dataModel = this.ecModel.getSeriesByIndex(ecData.seriesIndex); + const visualMapModel = this.visualMapModel; if (!visualMapModel.isTargetSeries(dataModel)) { return; } @@ -947,4 +955,4 @@ function getCursor(orient: Orient) { return orient === 'vertical' ? 'ns-resize' : 'ew-resize'; } -export default ContinuousView; \ No newline at end of file +export default ContinuousView; diff --git a/test/runTest/actions/__meta__.json b/test/runTest/actions/__meta__.json index baadde9800..ae9e2a6992 100644 --- a/test/runTest/actions/__meta__.json +++ b/test/runTest/actions/__meta__.json @@ -88,7 +88,7 @@ "emphasis-inherit": 1, "funnel": 2, "gauge-simple": 2, - "geo-map": 3, + "geo-map": 4, "geo-map-features": 3, "geo-svg": 8, "geo-svg-demo": 6, diff --git a/test/runTest/actions/geo-map.json b/test/runTest/actions/geo-map.json index ffbe5bcc13..b9f1566534 100644 --- a/test/runTest/actions/geo-map.json +++ b/test/runTest/actions/geo-map.json @@ -1 +1 @@ -[{"name":"Action 1","ops":[{"type":"mousedown","time":750,"x":67,"y":8},{"type":"mouseup","time":835,"x":67,"y":8},{"time":836,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":1086,"x":67,"y":8},{"type":"mousemove","time":1291,"x":65,"y":29},{"type":"mousemove","time":1491,"x":65,"y":30},{"type":"mousedown","time":1667,"x":65,"y":30},{"type":"mouseup","time":1785,"x":65,"y":30},{"time":1786,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":2142,"x":65,"y":31},{"type":"mousemove","time":2342,"x":61,"y":61},{"type":"mousemove","time":2568,"x":61,"y":61},{"type":"mousedown","time":2652,"x":61,"y":61},{"type":"mouseup","time":2725,"x":61,"y":61},{"time":2726,"delay":400,"type":"screenshot-auto"},{"type":"mousedown","time":3702,"x":61,"y":61},{"type":"mouseup","time":3775,"x":61,"y":61},{"time":3776,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":3955,"x":61,"y":61},{"type":"mousemove","time":4155,"x":68,"y":46},{"type":"mousemove","time":4362,"x":71,"y":37},{"type":"mousedown","time":4510,"x":71,"y":37},{"type":"mouseup","time":4605,"x":71,"y":37},{"time":4606,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":5004,"x":71,"y":36},{"type":"mousemove","time":5226,"x":72,"y":16},{"type":"mousedown","time":5406,"x":72,"y":15},{"type":"mousemove","time":5426,"x":72,"y":15},{"type":"mouseup","time":5493,"x":72,"y":15},{"time":5494,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":6071,"x":72,"y":16},{"type":"mousemove","time":6272,"x":69,"y":35},{"type":"mousemove","time":6486,"x":69,"y":35},{"type":"mousedown","time":6614,"x":69,"y":35},{"type":"mouseup","time":6697,"x":69,"y":35},{"time":6698,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":7099,"x":69,"y":36},{"type":"mousemove","time":7299,"x":66,"y":56},{"type":"mousemove","time":7499,"x":62,"y":65},{"type":"mousedown","time":7766,"x":62,"y":65},{"type":"mouseup","time":7841,"x":62,"y":65},{"time":7842,"delay":400,"type":"screenshot-auto"}],"scrollY":0,"scrollX":0,"timestamp":1568040771612},{"name":"Action 2","ops":[{"type":"mousedown","time":465,"x":18,"y":430},{"type":"mousemove","time":578,"x":18,"y":432},{"type":"mousemove","time":914,"x":24,"y":475},{"type":"mouseup","time":1111,"x":23,"y":477},{"time":1112,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":1140,"x":23,"y":477},{"type":"mousemove","time":1357,"x":19,"y":571},{"type":"mousemove","time":1603,"x":21,"y":579},{"type":"mousemove","time":1807,"x":21,"y":576},{"type":"mousemove","time":2020,"x":21,"y":574},{"type":"mousedown","time":2170,"x":21,"y":573},{"type":"mousemove","time":2228,"x":21,"y":573},{"type":"mousemove","time":2277,"x":21,"y":573},{"type":"mousemove","time":2493,"x":23,"y":549},{"type":"mousemove","time":2715,"x":23,"y":543},{"type":"mousemove","time":2929,"x":23,"y":543},{"type":"mouseup","time":3233,"x":23,"y":543},{"time":3234,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":3327,"x":23,"y":542},{"type":"mousemove","time":3549,"x":18,"y":516},{"type":"mousemove","time":3768,"x":14,"y":510},{"type":"mousedown","time":4021,"x":14,"y":510},{"type":"mouseup","time":4111,"x":14,"y":510},{"time":4112,"delay":400,"type":"screenshot-auto"}],"scrollY":0,"scrollX":0,"timestamp":1603890244262},{"name":"Action 3","ops":[{"type":"mousemove","time":550,"x":429,"y":336},{"type":"mousedown","time":674,"x":431,"y":335},{"type":"mousemove","time":793,"x":431,"y":336},{"type":"mousemove","time":1006,"x":346,"y":462},{"type":"mousemove","time":1207,"x":350,"y":458},{"type":"mouseup","time":1343,"x":350,"y":458},{"time":1344,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":1410,"x":350,"y":458},{"type":"mousemove","time":1603,"x":350,"y":457},{"type":"mousewheel","time":1686,"x":350,"y":457,"deltaY":4.000244140625},{"type":"mousewheel","time":1719,"x":350,"y":457,"deltaY":40.41015625},{"type":"mousewheel","time":1748,"x":350,"y":457,"deltaY":377.4566650390625},{"type":"mousewheel","time":1775,"x":350,"y":457,"deltaY":252.0208740234375},{"type":"mousewheel","time":1801,"x":350,"y":457,"deltaY":274.16015625},{"type":"mousewheel","time":1901,"x":350,"y":457,"deltaY":263.7664794921875},{"type":"mousemove","time":2236,"x":347,"y":454},{"type":"mousemove","time":2441,"x":308,"y":411},{"type":"mousedown","time":2514,"x":308,"y":411},{"type":"mousemove","time":2644,"x":443,"y":385},{"type":"mousemove","time":2855,"x":648,"y":301},{"type":"mousemove","time":3059,"x":670,"y":288},{"type":"mouseup","time":3161,"x":670,"y":288},{"time":3162,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":3270,"x":662,"y":291},{"type":"mousemove","time":3476,"x":581,"y":308},{"type":"mousewheel","time":3521,"x":581,"y":308,"deltaY":-4.000244140625},{"type":"mousewheel","time":3545,"x":581,"y":308,"deltaY":-37.410888671875},{"type":"mousewheel","time":3570,"x":581,"y":308,"deltaY":-385.2349853515625},{"type":"mousewheel","time":3602,"x":581,"y":308,"deltaY":-252.042236328125},{"type":"mousewheel","time":3627,"x":581,"y":308,"deltaY":-271.1181640625}],"scrollY":0,"scrollX":0,"timestamp":1568969626016}] \ No newline at end of file +[{"name":"Action 1","ops":[{"type":"mousemove","time":461,"x":229,"y":419},{"type":"mousemove","time":735,"x":246,"y":350},{"type":"mousemove","time":1019,"x":249,"y":366},{"type":"screenshot","time":2182}],"scrollY":0,"scrollX":0,"timestamp":1657527803250},{"name":"Action 2","ops":[{"type":"mousedown","time":750,"x":67,"y":8},{"type":"mouseup","time":835,"x":67,"y":8},{"time":836,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":1086,"x":67,"y":8},{"type":"mousemove","time":1291,"x":65,"y":29},{"type":"mousemove","time":1491,"x":65,"y":30},{"type":"mousedown","time":1667,"x":65,"y":30},{"type":"mouseup","time":1785,"x":65,"y":30},{"time":1786,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":2142,"x":65,"y":31},{"type":"mousemove","time":2342,"x":61,"y":61},{"type":"mousemove","time":2568,"x":61,"y":61},{"type":"mousedown","time":2652,"x":61,"y":61},{"type":"mouseup","time":2725,"x":61,"y":61},{"time":2726,"delay":400,"type":"screenshot-auto"},{"type":"mousedown","time":3702,"x":61,"y":61},{"type":"mouseup","time":3775,"x":61,"y":61},{"time":3776,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":3955,"x":61,"y":61},{"type":"mousemove","time":4155,"x":68,"y":46},{"type":"mousemove","time":4362,"x":71,"y":37},{"type":"mousedown","time":4510,"x":71,"y":37},{"type":"mouseup","time":4605,"x":71,"y":37},{"time":4606,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":5004,"x":71,"y":36},{"type":"mousemove","time":5226,"x":72,"y":16},{"type":"mousedown","time":5406,"x":72,"y":15},{"type":"mousemove","time":5426,"x":72,"y":15},{"type":"mouseup","time":5493,"x":72,"y":15},{"time":5494,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":6071,"x":72,"y":16},{"type":"mousemove","time":6272,"x":69,"y":35},{"type":"mousemove","time":6486,"x":69,"y":35},{"type":"mousedown","time":6614,"x":69,"y":35},{"type":"mouseup","time":6697,"x":69,"y":35},{"time":6698,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":7099,"x":69,"y":36},{"type":"mousemove","time":7299,"x":66,"y":56},{"type":"mousemove","time":7499,"x":62,"y":65},{"type":"mousedown","time":7766,"x":62,"y":65},{"type":"mouseup","time":7841,"x":62,"y":65},{"time":7842,"delay":400,"type":"screenshot-auto"}],"scrollY":0,"scrollX":0,"timestamp":1568040771612},{"name":"Action 3","ops":[{"type":"mousedown","time":465,"x":18,"y":430},{"type":"mousemove","time":578,"x":18,"y":432},{"type":"mousemove","time":914,"x":24,"y":475},{"type":"mouseup","time":1111,"x":23,"y":477},{"time":1112,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":1140,"x":23,"y":477},{"type":"mousemove","time":1357,"x":19,"y":571},{"type":"mousemove","time":1603,"x":21,"y":579},{"type":"mousemove","time":1807,"x":21,"y":576},{"type":"mousemove","time":2020,"x":21,"y":574},{"type":"mousedown","time":2170,"x":21,"y":573},{"type":"mousemove","time":2228,"x":21,"y":573},{"type":"mousemove","time":2277,"x":21,"y":573},{"type":"mousemove","time":2493,"x":23,"y":549},{"type":"mousemove","time":2715,"x":23,"y":543},{"type":"mousemove","time":2929,"x":23,"y":543},{"type":"mouseup","time":3233,"x":23,"y":543},{"time":3234,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":3327,"x":23,"y":542},{"type":"mousemove","time":3549,"x":18,"y":516},{"type":"mousemove","time":3768,"x":14,"y":510},{"type":"mousedown","time":4021,"x":14,"y":510},{"type":"mouseup","time":4111,"x":14,"y":510},{"time":4112,"delay":400,"type":"screenshot-auto"}],"scrollY":0,"scrollX":0,"timestamp":1603890244262},{"name":"Action 4","ops":[{"type":"mousemove","time":550,"x":429,"y":336},{"type":"mousedown","time":674,"x":431,"y":335},{"type":"mousemove","time":793,"x":431,"y":336},{"type":"mousemove","time":1006,"x":346,"y":462},{"type":"mousemove","time":1207,"x":350,"y":458},{"type":"mouseup","time":1343,"x":350,"y":458},{"time":1344,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":1410,"x":350,"y":458},{"type":"mousemove","time":1603,"x":350,"y":457},{"type":"mousewheel","time":1686,"x":350,"y":457,"deltaY":4.000244140625},{"type":"mousewheel","time":1719,"x":350,"y":457,"deltaY":40.41015625},{"type":"mousewheel","time":1748,"x":350,"y":457,"deltaY":377.4566650390625},{"type":"mousewheel","time":1775,"x":350,"y":457,"deltaY":252.0208740234375},{"type":"mousewheel","time":1801,"x":350,"y":457,"deltaY":274.16015625},{"type":"mousewheel","time":1901,"x":350,"y":457,"deltaY":263.7664794921875},{"type":"mousemove","time":2236,"x":347,"y":454},{"type":"mousemove","time":2441,"x":308,"y":411},{"type":"mousedown","time":2514,"x":308,"y":411},{"type":"mousemove","time":2644,"x":443,"y":385},{"type":"mousemove","time":2855,"x":648,"y":301},{"type":"mousemove","time":3059,"x":670,"y":288},{"type":"mouseup","time":3161,"x":670,"y":288},{"time":3162,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":3270,"x":662,"y":291},{"type":"mousemove","time":3476,"x":581,"y":308},{"type":"mousewheel","time":3521,"x":581,"y":308,"deltaY":-4.000244140625},{"type":"mousewheel","time":3545,"x":581,"y":308,"deltaY":-37.410888671875},{"type":"mousewheel","time":3570,"x":581,"y":308,"deltaY":-385.2349853515625},{"type":"mousewheel","time":3602,"x":581,"y":308,"deltaY":-252.042236328125},{"type":"mousewheel","time":3627,"x":581,"y":308,"deltaY":-271.1181640625}],"scrollY":0,"scrollX":0,"timestamp":1568969626016}] \ No newline at end of file From 71bdec63c10f8a6fa2253505b3957a24b39447aa Mon Sep 17 00:00:00 2001 From: plainheart Date: Mon, 11 Jul 2022 16:35:11 +0800 Subject: [PATCH 40/86] chore: fix some typos --- src/component/helper/MapDraw.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/component/helper/MapDraw.ts b/src/component/helper/MapDraw.ts index 5915619411..5296014546 100644 --- a/src/component/helper/MapDraw.ts +++ b/src/component/helper/MapDraw.ts @@ -820,7 +820,7 @@ function resetEventTriggerForRegion( dataIdx: number ): void { // setItemGraphicEl, setHoverStyle after all polygons and labels - // are added to the rigionGroup + // are added to the regionGroup if (viewBuildCtx.data) { // FIXME: when series-map use a SVG map, and there are duplicated name specified // on different SVG elements, after `data.setItemGraphicEl(...)`: @@ -832,7 +832,7 @@ function resetEventTriggerForRegion( viewBuildCtx.data.setItemGraphicEl(dataIdx, eventTrigger); } // series-map will not trigger "geoselectchange" no matter it is - // based on a declared geo component. Becuause series-map will + // based on a declared geo component. Because series-map will // trigger "selectchange". If it trigger both the two events, // If users call `chart.dispatchAction({type: 'toggleSelect'})`, // it not easy to also fire event "geoselectchanged". From 2f29323e10311aebf646eb5458271bd5cfbe088b Mon Sep 17 00:00:00 2001 From: plainheart Date: Mon, 11 Jul 2022 16:38:02 +0800 Subject: [PATCH 41/86] fix(visualMap): fix wrong type of ecData. --- src/component/visualMap/ContinuousView.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/component/visualMap/ContinuousView.ts b/src/component/visualMap/ContinuousView.ts index 68ad343171..9886945161 100644 --- a/src/component/visualMap/ContinuousView.ts +++ b/src/component/visualMap/ContinuousView.ts @@ -32,12 +32,12 @@ import GlobalModel from '../../model/Global'; import ExtensionAPI from '../../core/ExtensionAPI'; import Element, { ElementEvent } from 'zrender/src/Element'; import { TextVerticalAlign, TextAlign } from 'zrender/src/core/types'; -import { ColorString, ECEventData, Payload } from '../../util/types'; +import { ColorString, Payload } from '../../util/types'; import { parsePercent } from 'zrender/src/contain/text'; import { setAsHighDownDispatcher } from '../../util/states'; import { createSymbol } from '../../util/symbol'; import ZRImage from 'zrender/src/graphic/Image'; -import { getECData } from '../../util/innerStore'; +import { ECData, getECData } from '../../util/innerStore'; import { createTextStyle } from '../../label/labelStyle'; import { findEventDispatcher } from '../../util/event'; @@ -817,7 +817,7 @@ class ContinuousView extends VisualMapView { } private _hoverLinkFromSeriesMouseOver(e: ElementEvent) { - let ecData: ECEventData; + let ecData: ECData; findEventDispatcher(e.target, target => { const currECData = getECData(target); From bc4ee6c952ca25ab48a6b72545300d368535ed33 Mon Sep 17 00:00:00 2001 From: Ovilia Date: Mon, 11 Jul 2022 17:29:40 +0800 Subject: [PATCH 42/86] fix(custom): fix elements may not be removed after updates #17333 --- src/chart/custom/CustomView.ts | 23 +-- test/custom-update.html | 181 ++++++++++++++++++++++++ test/runTest/actions/__meta__.json | 1 + test/runTest/actions/custom-update.json | 1 + 4 files changed, 198 insertions(+), 8 deletions(-) create mode 100644 test/custom-update.html create mode 100644 test/runTest/actions/custom-update.json diff --git a/src/chart/custom/CustomView.ts b/src/chart/custom/CustomView.ts index 1568078267..b415e391ad 100644 --- a/src/chart/custom/CustomView.ts +++ b/src/chart/custom/CustomView.ts @@ -1316,14 +1316,21 @@ function mergeChildren( // might be better performance. let index = 0; for (; index < newLen; index++) { - newChildren[index] && doCreateOrUpdateEl( - api, - el.childAt(index), - dataIndex, - newChildren[index] as CustomElementOption, - seriesModel, - el - ); + const newChild = newChildren[index]; + if (newChild) { + doCreateOrUpdateEl( + api, + el.childAt(index), + dataIndex, + newChild as CustomElementOption, + seriesModel, + el + ); + } + else { + // The element is being null after updating, remove the old element + el.remove(el.childAt(index)); + } } for (let i = el.childCount() - 1; i >= index; i--) { // Do not support leave elements that are not mentioned in the latest diff --git a/test/custom-update.html b/test/custom-update.html new file mode 100644 index 0000000000..ca91a3cc9c --- /dev/null +++ b/test/custom-update.html @@ -0,0 +1,181 @@ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + diff --git a/test/runTest/actions/__meta__.json b/test/runTest/actions/__meta__.json index baadde9800..69339014dc 100644 --- a/test/runTest/actions/__meta__.json +++ b/test/runTest/actions/__meta__.json @@ -63,6 +63,7 @@ "custom-large": 1, "custom-shape-morphing": 1, "custom-text-content": 6, + "custom-update": 1, "dataSelect": 7, "dataset-case": 6, "dataZoom-action": 4, diff --git a/test/runTest/actions/custom-update.json b/test/runTest/actions/custom-update.json new file mode 100644 index 0000000000..bfc1d94cb4 --- /dev/null +++ b/test/runTest/actions/custom-update.json @@ -0,0 +1 @@ +[{"name":"Action 1","ops":[{"type":"mousemove","time":420,"x":14,"y":161},{"type":"mousemove","time":620,"x":27,"y":69},{"type":"mousemove","time":825,"x":28,"y":53},{"type":"mousemove","time":1036,"x":37,"y":74},{"type":"mousedown","time":1162,"x":37,"y":76},{"type":"mousemove","time":1237,"x":37,"y":76},{"type":"mouseup","time":1311,"x":37,"y":76},{"time":1312,"delay":400,"type":"screenshot-auto"}],"scrollY":0,"scrollX":0,"timestamp":1657531346385}] \ No newline at end of file From 22c82182347f3a450c50ed2b1e1c7679793cb299 Mon Sep 17 00:00:00 2001 From: Ovilia Date: Tue, 12 Jul 2022 16:44:27 +0800 Subject: [PATCH 43/86] fix(custom): apply leave transition and add more comments --- src/chart/custom/CustomView.ts | 40 ++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/src/chart/custom/CustomView.ts b/src/chart/custom/CustomView.ts index b415e391ad..96a54d4734 100644 --- a/src/chart/custom/CustomView.ts +++ b/src/chart/custom/CustomView.ts @@ -99,6 +99,7 @@ import { applyKeyframeAnimation, stopPreviousKeyframeAnimationAndRestore } from '../../animation/customGraphicKeyframeAnimation'; +import { SeriesModel } from '../../echarts.all'; const EMPHASIS = 'emphasis' as const; const NORMAL = 'normal' as const; @@ -1264,16 +1265,21 @@ function retrieveStyleOptionOnState( // Usage: -// (1) By default, `elOption.$mergeChildren` is `'byIndex'`, which indicates that -// the existing children will not be removed, and enables the feature that -// update some of the props of some of the children simply by construct +// (1) By default, `elOption.$mergeChildren` is `'byIndex'`, which indicates +// that the existing children will not be removed, and enables the feature +// that update some of the props of some of the children simply by construct // the returned children of `renderItem` like: // `var children = group.children = []; children[3] = {opacity: 0.5};` // (2) If `elOption.$mergeChildren` is `'byName'`, add/update/remove children // by child.name. But that might be lower performance. // (3) If `elOption.$mergeChildren` is `false`, the existing children will be // replaced totally. -// (4) If `!elOption.children`, following the "merge" principle, nothing will happen. +// (4) If `!elOption.children`, following the "merge" principle, nothing will +// happen. +// (5) If `elOption.$mergeChildren` is not `false` neither `'byName'` and the +// `el` is a group, and if any of the new child is null, it means to remove +// the element at the same index, if exists. On the other hand, if the new +// child is and empty object `{}`, it means to keep the element not changed. // // For implementation simpleness, do not provide a direct way to remove sinlge // child (otherwise the total indicies of the children array have to be modified). @@ -1317,10 +1323,11 @@ function mergeChildren( let index = 0; for (; index < newLen; index++) { const newChild = newChildren[index]; + const oldChild = el.childAt(index); if (newChild) { doCreateOrUpdateEl( api, - el.childAt(index), + oldChild, dataIndex, newChild as CustomElementOption, seriesModel, @@ -1328,19 +1335,30 @@ function mergeChildren( ); } else { - // The element is being null after updating, remove the old element - el.remove(el.childAt(index)); + removeChildFromGroup(el, oldChild, seriesModel); } } for (let i = el.childCount() - 1; i >= index; i--) { - // Do not support leave elements that are not mentioned in the latest - // `renderItem` return. Otherwise users may not have a clear and simple - // concept that how to control all of the elements. const child = el.childAt(i); - child && applyLeaveTransition(child, customInnerStore(el).option, seriesModel); + removeChildFromGroup(el, child, seriesModel); } } +function removeChildFromGroup( + group: graphicUtil.Group, + child: Element, + seriesModel: SeriesModel +) { + // Do not support leave elements that are not mentioned in the latest + // `renderItem` return. Otherwise users may not have a clear and simple + // concept that how to control all of the elements. + child && applyLeaveTransition( + child, + customInnerStore(group).option, + seriesModel + ); +} + type DiffGroupContext = { api: ExtensionAPI; oldChildren: Element[]; From ee3b8357c812cb48b201633448a098255cf5b670 Mon Sep 17 00:00:00 2001 From: Ovilia Date: Tue, 12 Jul 2022 16:45:15 +0800 Subject: [PATCH 44/86] test(custom): add a test case with {} that should preserve child --- test/runTest/actions/__meta__.json | 2 +- test/runTest/actions/custom-update.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/runTest/actions/__meta__.json b/test/runTest/actions/__meta__.json index 69339014dc..de4ac84d96 100644 --- a/test/runTest/actions/__meta__.json +++ b/test/runTest/actions/__meta__.json @@ -63,7 +63,7 @@ "custom-large": 1, "custom-shape-morphing": 1, "custom-text-content": 6, - "custom-update": 1, + "custom-update": 2, "dataSelect": 7, "dataset-case": 6, "dataZoom-action": 4, diff --git a/test/runTest/actions/custom-update.json b/test/runTest/actions/custom-update.json index bfc1d94cb4..bb04426472 100644 --- a/test/runTest/actions/custom-update.json +++ b/test/runTest/actions/custom-update.json @@ -1 +1 @@ -[{"name":"Action 1","ops":[{"type":"mousemove","time":420,"x":14,"y":161},{"type":"mousemove","time":620,"x":27,"y":69},{"type":"mousemove","time":825,"x":28,"y":53},{"type":"mousemove","time":1036,"x":37,"y":74},{"type":"mousedown","time":1162,"x":37,"y":76},{"type":"mousemove","time":1237,"x":37,"y":76},{"type":"mouseup","time":1311,"x":37,"y":76},{"time":1312,"delay":400,"type":"screenshot-auto"}],"scrollY":0,"scrollX":0,"timestamp":1657531346385}] \ No newline at end of file +[{"name":"Action 1","ops":[{"type":"mousemove","time":420,"x":14,"y":161},{"type":"mousemove","time":620,"x":27,"y":69},{"type":"mousemove","time":825,"x":28,"y":53},{"type":"mousemove","time":1036,"x":37,"y":74},{"type":"mousedown","time":1162,"x":37,"y":76},{"type":"mousemove","time":1237,"x":37,"y":76},{"type":"mouseup","time":1311,"x":37,"y":76},{"time":1312,"delay":400,"type":"screenshot-auto"}],"scrollY":0,"scrollX":0,"timestamp":1657531346385},{"name":"Action 2","ops":[{"type":"mousemove","time":743,"x":610,"y":251},{"type":"mousemove","time":943,"x":337,"y":165},{"type":"mousemove","time":1143,"x":109,"y":156},{"type":"mousemove","time":1343,"x":53,"y":176},{"type":"mousemove","time":1543,"x":47,"y":178},{"type":"mousedown","time":1548,"x":47,"y":178},{"type":"mouseup","time":1680,"x":47,"y":178},{"time":1681,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":2109,"x":48,"y":178},{"type":"mousemove","time":2309,"x":113,"y":178},{"type":"mousemove","time":2515,"x":114,"y":178}],"scrollY":434,"scrollX":0,"timestamp":1657615363601}] \ No newline at end of file From fc43e0ac14d7d4eddcc960826f5d463912ee801a Mon Sep 17 00:00:00 2001 From: Ovilia Date: Wed, 13 Jul 2022 17:06:47 +0800 Subject: [PATCH 45/86] test(custom): add a test case --- test/custom-update.html | 242 +++++++++++++++++++++------------------- 1 file changed, 125 insertions(+), 117 deletions(-) diff --git a/test/custom-update.html b/test/custom-update.html index ca91a3cc9c..65f8cbc5aa 100644 --- a/test/custom-update.html +++ b/test/custom-update.html @@ -38,6 +38,7 @@
+
@@ -50,129 +51,136 @@ // 'map/js/china', // './data/nutrients.json' ], function (echarts) { - var option; - var cellSize = [50, 51]; - var isFirst = true; - - option = { - calendar: [ - { - orient: 'vertical', - cellSize: cellSize, - yearLabel: { - show: false - }, - monthLabel: { - show: false - }, - range: ['2022-1'] - } - ], - series: [ - { - type: 'custom', - universalTransition: { - enabled: false - }, - name: 'a', - coordinateSystem: 'calendar', - animation: 0, - data: [ - ['2022-01-16', 'e', false] + function createCase(isTestingNull) { + var option; + var cellSize = [50, 51]; + var isFirst = true; + + option = { + calendar: [ + { + orient: 'vertical', + cellSize: cellSize, + yearLabel: { + show: false + }, + monthLabel: { + show: false + }, + range: ['2022-1'] + } ], - renderItem: (params, api) => { - const date = api.value(0); - const cellPoint = api.coord(date); - const xPos = cellPoint[0] - cellSize[0] / 2; - const yPos = cellPoint[1] - cellSize[1] / 2; - const name = api.value(1); - const cellWidth = params.coordSys.cellWidth; - const position = [xPos, yPos]; - const rect = { - type: 'rect', - shape: { - x: 0, - y: 0, - width: cellWidth, - height: 15 - }, - position, - style: { - fill: isFirst ? '#eee' : '#6ee' - }, - textContent: { - style: { - text: name, - fill: '#888', - overflow: 'truncate', - width: cellWidth, - height: 13, - y: 1 - } - }, - textConfig: { - position: 'insideLeft', - distance: 2 - } - }; - - const borderLeft = api.value(2) - ? null - : { - type: 'rect', - shape: { - x: -20, - y: 0, - width: 20, - height: 15 - }, - position, - style: { - fill: 'red' - } - }; - - const group = { - type: 'group', - children: [rect, borderLeft] - }; - return group; - }, - silent: true, - z: 2, - legendHoverLink: true, - clip: false, - label: {}, - emphasis: { label: {} } - } - ] - }; - - var chart = testHelper.create(echarts, 'main0', { - title: [ - 'The red bar should not be rendered after "Update"' - ], - option: option, - // height: 300, - buttons: [{text: 'Update', onclick: function () { - isFirst = false; - chart.setOption({ - calendar: { - range: ['2022-02'] - }, - series: [ + series: [ { type: 'custom', + universalTransition: { + enabled: false + }, name: 'a', + coordinateSystem: 'calendar', + animation: 0, data: [ - ['2022-02-13', 'e', true] - ] + ['2022-01-16', 'e', false] + ], + renderItem: (params, api) => { + const date = api.value(0); + const cellPoint = api.coord(date); + const xPos = cellPoint[0] - cellSize[0] / 2; + const yPos = cellPoint[1] - cellSize[1] / 2; + const name = api.value(1); + const cellWidth = params.coordSys.cellWidth; + const position = [xPos, yPos]; + const rect = { + type: 'rect', + shape: { + x: 0, + y: 0, + width: cellWidth, + height: 15 + }, + position, + style: { + fill: isFirst ? '#eee' : '#6ee' + }, + textContent: { + style: { + text: name, + fill: '#888', + overflow: 'truncate', + width: cellWidth, + height: 13, + y: 1 + } + }, + textConfig: { + position: 'insideLeft', + distance: 2 + }, + name: 'rect' + }; + + const borderLeft = api.value(2) + ? (isTestingNull ? null : {}) + : { + type: 'rect', + shape: { + x: -20, + y: 0, + width: 20, + height: 15 + }, + position, + style: { + fill: 'red' + }, + name: 'bar' + }; + + const group = { + type: 'group', + children: [rect, borderLeft] + }; + return group; + }, + silent: true, + z: 2, + legendHoverLink: true, + clip: false, + label: {}, + emphasis: { label: {} } } - ] - }); - }}], - // recordCanvas: true, - }); + ] + }; + + var rendered = isTestingNull ? ' NOT' : ''; + var chart = testHelper.create(echarts, 'main' + (isTestingNull ? '1' : '0'), { + title: [ + 'Update group with ' + (isTestingNull ? 'null' : '{}') + ' as new child', + 'The red bar should be' + rendered + ' rendered after "Update"' + ], + option: option, + // height: 300, + buttons: [{text: 'Update', onclick: function () { + isFirst = false; + chart.setOption({ + calendar: { + range: ['2022-02'] + }, + series: [ + { + type: 'custom', + data: [ + ['2022-02-13', 'e', true] + ] + } + ] + }); + }}] + }); + } + + createCase(false); + createCase(true); }); From 343b13a498196dfb6c40face68293879bb072919 Mon Sep 17 00:00:00 2001 From: Ovilia Date: Thu, 14 Jul 2022 11:47:32 +0800 Subject: [PATCH 46/86] test: add coarse-pointer in test env --- src/core/echarts.ts | 5 +- ...{pointer-size.html => coarse-pointer.html} | 26 ++- test/lib/caseFrame.js | 11 ++ test/lib/config.js | 3 + test/runTest/actions/__meta__.json | 1 + test/runTest/actions/coarse-pointer.json | 1 + test/runTest/cli.js | 7 +- test/runTest/client/client.css | 10 +- test/runTest/client/client.js | 6 + test/runTest/client/index.html | 153 ++++++++++-------- test/runTest/server.js | 4 + test/runTest/store.js | 6 +- 12 files changed, 147 insertions(+), 86 deletions(-) rename test/{pointer-size.html => coarse-pointer.html} (84%) create mode 100644 test/runTest/actions/coarse-pointer.json diff --git a/src/core/echarts.ts b/src/core/echarts.ts index 4f64bf1fcf..6d7c398579 100644 --- a/src/core/echarts.ts +++ b/src/core/echarts.ts @@ -411,6 +411,7 @@ class ECharts extends Eventful { this._dom = dom; let defaultRenderer = 'canvas'; + let defaultCoarsePointer: 'auto' | boolean = 'auto'; let defaultUseDirtyRect = false; if (__DEV__) { const root = ( @@ -420,6 +421,8 @@ class ECharts extends Eventful { defaultRenderer = root.__ECHARTS__DEFAULT__RENDERER__ || defaultRenderer; + defaultCoarsePointer = root.__ECHARTS__DEFAULT__COARSE_POINTER || defaultCoarsePointer; + const devUseDirtyRect = root.__ECHARTS__DEFAULT__USE_DIRTY_RECT__; defaultUseDirtyRect = devUseDirtyRect == null ? defaultUseDirtyRect @@ -433,7 +436,7 @@ class ECharts extends Eventful { height: opts.height, ssr: opts.ssr, useDirtyRect: opts.useDirtyRect == null ? defaultUseDirtyRect : opts.useDirtyRect, - useCoarsePointer: opts.useCoarsePointer, + useCoarsePointer: opts.useCoarsePointer == null ? defaultCoarsePointer : opts.useCoarsePointer, pointerSize: opts.pointerSize }); this._ssr = opts.ssr; diff --git a/test/pointer-size.html b/test/coarse-pointer.html similarity index 84% rename from test/pointer-size.html rename to test/coarse-pointer.html index 8e740dbcd1..959d8babfd 100644 --- a/test/pointer-size.html +++ b/test/coarse-pointer.html @@ -35,7 +35,7 @@ - +

__ECHARTS__DEFAULT__COARSE_POINTER:

@@ -49,6 +49,9 @@ // 'map/js/china', // './data/nutrients.json' ], function (echarts) { + var debug = document.getElementById('debug'); + debug.innerText = window.__ECHARTS__DEFAULT__COARSE_POINTER; + var option; option = { @@ -58,7 +61,12 @@ type: 'scatter', data: [[11, 22], [33, 44]], symbol: 'pin', - symbolSize: 100 + symbolSize: 100, + emphasis: { + itemStyle: { + color: 'red' + } + } }, tooltip: { show: true @@ -90,7 +98,12 @@ type: 'scatter', data: [[11, 22], [33, 44]], symbol: 'pin', - symbolSize: 100 + symbolSize: 100, + emphasis: { + itemStyle: { + color: 'red' + } + } }, tooltip: { show: true @@ -123,7 +136,12 @@ type: 'scatter', data: [[11, 22], [33, 44]], symbol: 'pin', - symbolSize: 100 + symbolSize: 100, + emphasis: { + itemStyle: { + color: 'red' + } + } }, tooltip: { show: true diff --git a/test/lib/caseFrame.js b/test/lib/caseFrame.js index fb2a1703da..bd3e193377 100644 --- a/test/lib/caseFrame.js +++ b/test/lib/caseFrame.js @@ -207,6 +207,17 @@ var matchResult = (pageURL || '').match(/[?&]__RENDERER__=(canvas|svg)(&|$)/); return matchResult && matchResult[1] || 'canvas'; }, + // true, false, 'auto' + useCoarsePointer: function (pageURL) { + var matchResult = (pageURL || '').match(/[?&]__USE_COARSE_POINTER__=(true|false|auto)(&|$)/); + return matchResult && matchResult[1] + ? matchResult[1] === 'true' + ? true + : matchResult[1] === 'false' + ? false + : 'auto' + : 'auto'; + }, // true, false useDirtyRect: function (pageURL) { var matchResult = (pageURL || '').match(/[?&]__USE_DIRTY_RECT__=(true|false)(&|$)/); diff --git a/test/lib/config.js b/test/lib/config.js index 1c99b359ac..63ffbd49c8 100644 --- a/test/lib/config.js +++ b/test/lib/config.js @@ -30,6 +30,9 @@ if (params.__RENDERER__) { window.__ECHARTS__DEFAULT__RENDERER__ = params.__RENDERER__; } + if (params.__COARSE__POINTER__) { + window.__ECHARTS__DEFAULT__COARSE_POINTER = params.__COARSE__POINTER__; + } if (params.__USE_DIRTY_RECT__) { window.__ECHARTS__DEFAULT__USE_DIRTY_RECT__ = params.__USE_DIRTY_RECT__ === 'true'; } diff --git a/test/runTest/actions/__meta__.json b/test/runTest/actions/__meta__.json index d8eec78bac..a70f48fc49 100644 --- a/test/runTest/actions/__meta__.json +++ b/test/runTest/actions/__meta__.json @@ -50,6 +50,7 @@ "candlestick-large2": 1, "candlestickConnect": 4, "clip": 12, + "coarse-pointer": 3, "color-mix-aqi": 2, "connect": 1, "connect-dynamic": 2, diff --git a/test/runTest/actions/coarse-pointer.json b/test/runTest/actions/coarse-pointer.json new file mode 100644 index 0000000000..4b7d7ed09b --- /dev/null +++ b/test/runTest/actions/coarse-pointer.json @@ -0,0 +1 @@ +[{"name":"Action 1","ops":[{"type":"mousemove","time":427,"x":507,"y":250},{"type":"mousemove","time":627,"x":469,"y":258},{"type":"mousemove","time":830,"x":403,"y":272},{"type":"mousemove","time":1042,"x":365,"y":279},{"type":"mousemove","time":1242,"x":345,"y":306},{"type":"mousemove","time":1446,"x":338,"y":330},{"type":"mousemove","time":1626,"x":337,"y":330},{"type":"mousemove","time":1827,"x":304,"y":339},{"type":"mousemove","time":2027,"x":303,"y":338},{"type":"mousemove","time":2231,"x":298,"y":331},{"type":"mousemove","time":2447,"x":298,"y":330},{"type":"mousedown","time":2686,"x":298,"y":330},{"type":"mouseup","time":2831,"x":298,"y":330},{"time":2832,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":4028,"x":298,"y":333},{"type":"mousemove","time":4230,"x":330,"y":386},{"type":"mousemove","time":4446,"x":339,"y":395},{"type":"mousemove","time":4692,"x":339,"y":395},{"type":"mousemove","time":4892,"x":344,"y":402}],"scrollY":0,"scrollX":0,"timestamp":1657770168133},{"name":"Action 2","ops":[{"type":"mousemove","time":777,"x":394,"y":369},{"type":"mousemove","time":977,"x":351,"y":337},{"type":"mousemove","time":1178,"x":322,"y":311},{"type":"mousemove","time":1378,"x":312,"y":297},{"type":"mousemove","time":1578,"x":305,"y":292},{"type":"mousemove","time":1779,"x":304,"y":291},{"type":"mousedown","time":2165,"x":304,"y":291},{"type":"mouseup","time":2308,"x":304,"y":291},{"time":2309,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":3131,"x":304,"y":292},{"type":"mousemove","time":3333,"x":335,"y":337},{"type":"mousemove","time":3545,"x":354,"y":365},{"type":"mousemove","time":3749,"x":357,"y":369}],"scrollY":512,"scrollX":0,"timestamp":1657770178748},{"name":"Action 3","ops":[{"type":"mousemove","time":351,"x":589,"y":312},{"type":"mousemove","time":551,"x":481,"y":373},{"type":"mousemove","time":755,"x":446,"y":397},{"type":"mousemove","time":967,"x":417,"y":416},{"type":"mousemove","time":1168,"x":410,"y":420},{"type":"mousemove","time":1401,"x":409,"y":420},{"type":"mousemove","time":1408,"x":408,"y":420},{"type":"mousemove","time":1608,"x":375,"y":433},{"type":"mousemove","time":1818,"x":353,"y":433},{"type":"mousemove","time":2018,"x":352,"y":433},{"type":"mousemove","time":2618,"x":352,"y":433},{"type":"mousemove","time":2823,"x":406,"y":439},{"type":"mousemove","time":3035,"x":467,"y":431},{"type":"mousemove","time":3237,"x":467,"y":431}],"scrollY":870.5,"scrollX":0,"timestamp":1657770187725}] \ No newline at end of file diff --git a/test/runTest/cli.js b/test/runTest/cli.js index 582fa9928f..7b7755fda0 100644 --- a/test/runTest/cli.js +++ b/test/runTest/cli.js @@ -41,6 +41,7 @@ program .option('--expected ', 'Expected version') .option('--actual ', 'Actual version') .option('--renderer ', 'svg/canvas renderer') + .option('--use-coarse-pointer ', '"auto" (by default) or "true" or "false"') .option('--threads ', 'How many threads to run concurrently') .option('--no-save', 'Don\'t save result') .option('--dir ', 'Out dir'); @@ -51,6 +52,7 @@ program.speed = +program.speed || 1; program.actual = program.actual || 'local'; program.threads = +program.threads || 1; program.renderer = (program.renderer || 'canvas').toLowerCase(); +program.useCoarsePointer = (program.useCoarsePointer || 'auto').toLowerCase(); program.dir = program.dir || (__dirname + '/tmp'); if (!program.tests) { @@ -265,7 +267,7 @@ async function runTestPage(browser, testOpt, version, runtimeCode, isExpected) { width: 800, height: 600 }); - await page.goto(`${origin}/test/${fileUrl}?__RENDERER__=${program.renderer}`, { + await page.goto(`${origin}/test/${fileUrl}?__RENDERER__=${program.renderer}&__COARSE__POINTER__=${program.useCoarsePointer}`, { waitUntil: 'networkidle2', timeout: 10000 }); @@ -384,6 +386,7 @@ async function runTest(browser, testOpt, runtimeCode, expectedVersion, actualVer testOpt.actualVersion = actualVersion; testOpt.expectedVersion = expectedVersion; testOpt.useSVG = program.renderer === 'svg'; + testOpt.useCoarsePointer = program.useCoarsePointer; testOpt.lastRun = Date.now(); } else { @@ -407,7 +410,7 @@ async function runTests(pendingTests) { }); async function eachTask(testOpt) { - console.log(`Running test: ${testOpt.name}, renderer: ${program.renderer}`); + console.log(`Running test: ${testOpt.name}, renderer: ${program.renderer}, useCoarsePointer: ${program.useCoarsePointer}`); try { await runTest(browser, testOpt, runtimeCode, program.expected, program.actual); } diff --git a/test/runTest/client/client.css b/test/runTest/client/client.css index dcb6956374..1cce88083b 100644 --- a/test/runTest/client/client.css +++ b/test/runTest/client/client.css @@ -71,7 +71,6 @@ } .nav-toolbar, .test-run-controls { - padding: 10px 10px; background: #fff; position: fixed; width: 330px; @@ -84,17 +83,14 @@ z-index: 1; position: sticky; width: 100%; - padding: 5px 40px; top: 0px; - background: #896bda; box-shadow: 0 0 20px rgb(0 0 0 / 20%); border-bottom: none; } -.test-run-controls>* { - display: inline-block; - vertical-align: middle; +.test-run-row { + padding: 5px 20px; } .nav-toolbar .el-button { @@ -106,6 +102,8 @@ margin: 0 5px; color: #fff; font-size: 12px; + display: inline-block; + vertical-align: middle; } .run-config-item>* { display: inline-block; diff --git a/test/runTest/client/client.js b/test/runTest/client/client.js index f110fbd3f1..0c34e0ff0e 100644 --- a/test/runTest/client/client.js +++ b/test/runTest/client/client.js @@ -137,6 +137,7 @@ const app = new Vue({ expectedVersion: null, renderer: 'canvas', + useCoarsePointer: 'auto', threads: 4 }, urlRunConfig) }, @@ -344,6 +345,9 @@ const app = new Vue({ if (test.useSVG) { searches.push('__RENDERER__=svg'); } + if (test.useCoarsePointer) { + searches.push('__COARSE__POINTER__=true'); + } let src = test.fileUrl; if (searches.length) { src = src + '?' + searches.join('&'); @@ -366,6 +370,7 @@ const app = new Vue({ this.runConfig.isExpectedNightly = runResult.expectedVersion.includes('-dev.'); this.runConfig.isActualNightly = runResult.actualVersion.includes('-dev.'); this.runConfig.renderer = runResult.renderer; + this.runConfig.useCoarsePointer = runResult.useCoarsePointer; this.showRunsDialog = false; }, @@ -418,6 +423,7 @@ function runTests(tests, noHeadless) { actualVersion: app.runConfig.actualVersion, threads: app.runConfig.threads, renderer: app.runConfig.renderer, + useCoarsePointer: app.runConfig.useCoarsePointer, noHeadless, replaySpeed: noHeadless ? 5 : 5 }); diff --git a/test/runTest/client/index.html b/test/runTest/client/index.html index 5e876c3f63..d2a190baa0 100644 --- a/test/runTest/client/index.html +++ b/test/runTest/client/index.html @@ -101,83 +101,94 @@

Visual Regression Testing Tool

-
- -
- - ALL RUNS -
-
-
- -
- - RUN ({{selectedTests.length}}) - - Run unfinished ({{unfinishedTests.length}}) - Run failed ({{failedTests.length}}) - Run all ({{fullTests.length}}) - - +
+
+ +
+ + LIST OF RUNNING RESULTS +
+
+
- - Stop - - +
+ + RUN ({{selectedTests.length}}) + + Run unfinished ({{unfinishedTests.length}}) + Run failed ({{failedTests.length}}) + Run all ({{fullTests.length}}) + + - - - -
+ + Stop + + -
- - Expected - - - - - - - - - - Actual - - + + - - - - -
-
- Renderer - - - - +
-
- Threads +
+
+ + Expected + + + + + + + + + + Actual + + + + + + + +
+
+ Renderer + + + + +
+
+ Coarse Pointer + + + + + +
+
+ Threads - - - - + + + + +
diff --git a/test/runTest/server.js b/test/runTest/server.js index f74b001956..7cf41945b1 100644 --- a/test/runTest/server.js +++ b/test/runTest/server.js @@ -131,6 +131,7 @@ function startTests(testsNameList, socket, { actualVersion, expectedVersion, renderer, + useCoarsePointer, noSave }) { console.log('Received: ', testsNameList.join(',')); @@ -190,6 +191,7 @@ function startTests(testsNameList, socket, { '--actual', actualVersion, '--expected', expectedVersion, '--renderer', renderer || '', + '--use-coarse-pointer', useCoarsePointer || 'auto', '--threads', Math.min(threadsCount, CLI_FIXED_THREADS_COUNT), '--dir', getResultBaseDir(), ...(noHeadless ? ['--no-headless'] : []), @@ -339,6 +341,7 @@ async function start() { actualVersion: data.actualVersion, expectedVersion: data.expectedVersion, renderer: data.renderer, + useCoarsePointer: data.useCoarsePointer, noSave: false } ); @@ -399,6 +402,7 @@ async function start() { actualVersion: data.actualVersion, expectedVersion: data.expectedVersion, renderer: data.renderer || '', + useCoarsePointer: data.useCoarsePointer || 'auto', noSave: true }); } diff --git a/test/runTest/store.js b/test/runTest/store.js index 5eb3e1dd10..31e0537c84 100644 --- a/test/runTest/store.js +++ b/test/runTest/store.js @@ -80,7 +80,8 @@ function getRunHash(params) { return [ params.expectedVersion, params.actualVersion, - params.renderer + params.renderer, + params.useCoarsePointer ].join(TEST_HASH_SPLITTER); } @@ -92,7 +93,8 @@ function parseRunHash(str) { return { expectedVersion: parts[0], actualVersion: parts[1], - renderer: parts[2] + renderer: parts[2], + useCoarsePointer: parts[3] }; } From 44e650e3b3647706d1749d84d24c21a96a410a49 Mon Sep 17 00:00:00 2001 From: Ovilia Date: Thu, 14 Jul 2022 15:17:13 +0800 Subject: [PATCH 47/86] fix(custom): fix the case for element after the null child --- src/chart/custom/CustomView.ts | 11 +++++++- test/custom-update.html | 47 +++++++++++++++++++++++++++++----- 2 files changed, 50 insertions(+), 8 deletions(-) diff --git a/src/chart/custom/CustomView.ts b/src/chart/custom/CustomView.ts index 96a54d4734..60de188fd1 100644 --- a/src/chart/custom/CustomView.ts +++ b/src/chart/custom/CustomView.ts @@ -1321,9 +1321,14 @@ function mergeChildren( // Mapping children of a group simply by index, which // might be better performance. let index = 0; + let oldRemovedCount = 0; for (; index < newLen; index++) { const newChild = newChildren[index]; - const oldChild = el.childAt(index); + // The index of oldChild may change if previous child not exists + // in newChildren and have no leave animation. By subtracting + // oldRemovedCount, we make sure to compare the children before + // removing from the parent. + const oldChild = el.childAt(index - oldRemovedCount); if (newChild) { doCreateOrUpdateEl( api, @@ -1335,7 +1340,11 @@ function mergeChildren( ); } else { + const childCount = el.childCount(); removeChildFromGroup(el, oldChild, seriesModel); + // If there is not leave animation, the child is removed from + // the parent directly, so we should update the index. + oldRemovedCount += childCount - el.childCount(); } } for (let i = el.childCount() - 1; i >= index; i--) { diff --git a/test/custom-update.html b/test/custom-update.html index 65f8cbc5aa..680020ee04 100644 --- a/test/custom-update.html +++ b/test/custom-update.html @@ -39,6 +39,8 @@
+
+
@@ -51,7 +53,7 @@ // 'map/js/china', // './data/nutrients.json' ], function (echarts) { - function createCase(isTestingNull) { + function createCase(isTestingNull, hasAnimation) { var option; var cellSize = [50, 51]; var isFirst = true; @@ -78,7 +80,7 @@ }, name: 'a', coordinateSystem: 'calendar', - animation: 0, + animation: hasAnimation ? 1000 : 0, data: [ ['2022-01-16', 'e', false] ], @@ -136,9 +138,36 @@ name: 'bar' }; + const right = api.value(2) + ? { + type: 'rect', + shape: { + x: cellWidth, + y: 0, + width: 20, + height: 15 + }, + position, + style: { + fill: 'blue' + } + } + : { + type: 'circle', + shape: { + cx: cellWidth + 20, + cy: 20, + r: 15 + }, + position, + style: { + fill: 'red' + } + }; + const group = { type: 'group', - children: [rect, borderLeft] + children: [rect, borderLeft, right] }; return group; }, @@ -153,10 +182,12 @@ }; var rendered = isTestingNull ? ' NOT' : ''; - var chart = testHelper.create(echarts, 'main' + (isTestingNull ? '1' : '0'), { + var chartId = (isTestingNull ? 2 : 0) + (hasAnimation ? 1 : 0); + var chart = testHelper.create(echarts, 'main' + chartId, { title: [ 'Update group with ' + (isTestingNull ? 'null' : '{}') + ' as new child', - 'The red bar should be' + rendered + ' rendered after "Update"' + 'Animation: ' + (hasAnimation ? 'true' : 'false'), + 'The red shapes should be' + rendered + ' rendered after "Update"' ], option: option, // height: 300, @@ -179,8 +210,10 @@ }); } - createCase(false); - createCase(true); + createCase(false, false); + createCase(true, false); + createCase(false, true); + createCase(true, true); }); From d08a58f357b4a0cd30ddf7661f4ae1f40cae99b7 Mon Sep 17 00:00:00 2001 From: ZT <2417407179@qq.com> Date: Fri, 15 Jul 2022 10:24:27 +0800 Subject: [PATCH 48/86] style: spelling mistakes --- src/component/marker/MarkAreaView.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/component/marker/MarkAreaView.ts b/src/component/marker/MarkAreaView.ts index dcaa4b1c78..5d8b2dce70 100644 --- a/src/component/marker/MarkAreaView.ts +++ b/src/component/marker/MarkAreaView.ts @@ -91,7 +91,7 @@ const markAreaTransform = function ( return result; }; -function isInifinity(val: ScaleDataValue) { +function isInfinity(val: ScaleDataValue) { return !isNaN(val as number) && !isFinite(val as number); } @@ -103,7 +103,7 @@ function ifMarkAreaHasOnlyDim( coordSys: CoordinateSystem ) { const otherDimIndex = 1 - dimIndex; - return isInifinity(fromCoord[otherDimIndex]) && isInifinity(toCoord[otherDimIndex]); + return isInfinity(fromCoord[otherDimIndex]) && isInfinity(toCoord[otherDimIndex]); } function markAreaFilter(coordSys: CoordinateSystem, item: MarkAreaMergedItemOption) { @@ -182,10 +182,10 @@ function getSingleMarkerEndPoint( const yAxis = coordSys.getAxis('y') as Axis2D; const x = data.get(dims[0], idx) as number; const y = data.get(dims[1], idx) as number; - if (isInifinity(x)) { + if (isInfinity(x)) { point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[dims[0] === 'x0' ? 0 : 1]); } - else if (isInifinity(y)) { + else if (isInfinity(y)) { point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[dims[1] === 'y0' ? 0 : 1]); } } From c7a8547bafaead6d81690a212434f7879abfc915 Mon Sep 17 00:00:00 2001 From: ZT <2417407179@qq.com> Date: Fri, 15 Jul 2022 10:41:39 +0800 Subject: [PATCH 49/86] style: spelling mistakes --- src/component/marker/MarkLineView.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/component/marker/MarkLineView.ts b/src/component/marker/MarkLineView.ts index d3d6a661d8..aa21d0bf25 100644 --- a/src/component/marker/MarkLineView.ts +++ b/src/component/marker/MarkLineView.ts @@ -154,7 +154,7 @@ const markLineTransform = function ( return normalizedItem; }; -function isInifinity(val: ScaleDataValue) { +function isInfinity(val: ScaleDataValue) { return !isNaN(val as number) && !isFinite(val as number); } @@ -167,7 +167,7 @@ function ifMarkLineHasOnlyDim( ) { const otherDimIndex = 1 - dimIndex; const dimName = coordSys.dimensions[dimIndex]; - return isInifinity(fromCoord[otherDimIndex]) && isInifinity(toCoord[otherDimIndex]) + return isInfinity(fromCoord[otherDimIndex]) && isInfinity(toCoord[otherDimIndex]) && fromCoord[dimIndex] === toCoord[dimIndex] && coordSys.getAxis(dimName).containData(fromCoord[dimIndex]); } @@ -240,10 +240,10 @@ function updateSingleMarkerEndLayout( const xAxis = coordSys.getAxis('x') as Axis2D; const yAxis = coordSys.getAxis('y') as Axis2D; const dims = coordSys.dimensions; - if (isInifinity(data.get(dims[0], idx))) { + if (isInfinity(data.get(dims[0], idx))) { point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[isFrom ? 0 : 1]); } - else if (isInifinity(data.get(dims[1], idx))) { + else if (isInfinity(data.get(dims[1], idx))) { point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[isFrom ? 0 : 1]); } } From 6a261fb79a648c3a3986488975fd2d4943332f97 Mon Sep 17 00:00:00 2001 From: ZT <2417407179@qq.com> Date: Fri, 15 Jul 2022 10:57:51 +0800 Subject: [PATCH 50/86] style: spelling mistakes --- src/component/marker/MarkAreaView.ts | 2 +- src/component/marker/MarkLineView.ts | 2 +- src/component/marker/MarkPointView.ts | 2 +- src/component/marker/markerHelper.ts | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/component/marker/MarkAreaView.ts b/src/component/marker/MarkAreaView.ts index 5d8b2dce70..785d107d87 100644 --- a/src/component/marker/MarkAreaView.ts +++ b/src/component/marker/MarkAreaView.ts @@ -164,7 +164,7 @@ function getSingleMarkerEndPoint( else { // Chart like bar may have there own marker positioning logic if (seriesModel.getMarkerPosition) { - // Use the getMarkerPoisition + // Use the getMarkerPosition point = seriesModel.getMarkerPosition( data.getValues(dims, idx) ); diff --git a/src/component/marker/MarkLineView.ts b/src/component/marker/MarkLineView.ts index aa21d0bf25..2c6d5e53e9 100644 --- a/src/component/marker/MarkLineView.ts +++ b/src/component/marker/MarkLineView.ts @@ -215,7 +215,7 @@ function updateSingleMarkerEndLayout( else { // Chart like bar may have there own marker positioning logic if (seriesModel.getMarkerPosition) { - // Use the getMarkerPoisition + // Use the getMarkerPosition point = seriesModel.getMarkerPosition( data.getValues(data.dimensions, idx) ); diff --git a/src/component/marker/MarkPointView.ts b/src/component/marker/MarkPointView.ts index d5e4fc1fa7..3e4499c0d4 100644 --- a/src/component/marker/MarkPointView.ts +++ b/src/component/marker/MarkPointView.ts @@ -51,7 +51,7 @@ function updateMarkerLayout( } // Chart like bar may have there own marker positioning logic else if (seriesModel.getMarkerPosition) { - // Use the getMarkerPoisition + // Use the getMarkerPosition point = seriesModel.getMarkerPosition( mpData.getValues(mpData.dimensions, idx) ); diff --git a/src/component/marker/markerHelper.ts b/src/component/marker/markerHelper.ts index 480a0345e5..1616df4226 100644 --- a/src/component/marker/markerHelper.ts +++ b/src/component/marker/markerHelper.ts @@ -191,7 +191,7 @@ export function dataFilter( }, item: MarkerPositionOption ) { - // Alwalys return true if there is no coordSys + // Always return true if there is no coordSys return (coordSys && coordSys.containData && item.coord && !hasXOrY(item)) ? coordSys.containData(item.coord) : true; } @@ -204,7 +204,7 @@ export function zoneFilter( item1: MarkerPositionOption, item2: MarkerPositionOption ) { - // Alwalys return true if there is no coordSys + // Always return true if there is no coordSys return (coordSys && coordSys.containZone && item1.coord && item2.coord && !hasXOrY(item1) && !hasXOrY(item2)) ? coordSys.containZone(item1.coord, item2.coord) : true; } From 1822053ea5bf2206023c7b17af42d6b1b5a4e6e8 Mon Sep 17 00:00:00 2001 From: plainheart Date: Mon, 18 Jul 2022 12:33:54 +0800 Subject: [PATCH 51/86] fix(type): add missing type `number` to `emphasis.scale` of scatter/line/graph series. --- src/chart/graph/GraphSeries.ts | 4 ++-- src/chart/line/LineSeries.ts | 2 +- src/chart/scatter/ScatterSeries.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/chart/graph/GraphSeries.ts b/src/chart/graph/GraphSeries.ts index 299b9a44d9..e1b85bead6 100644 --- a/src/chart/graph/GraphSeries.ts +++ b/src/chart/graph/GraphSeries.ts @@ -184,7 +184,7 @@ export interface GraphSeriesOption emphasis?: { focus?: Exclude['focus'] - scale?: boolean + scale?: boolean | number label?: SeriesLabelOption edgeLabel?: SeriesLabelOption itemStyle?: ItemStyleOption @@ -513,4 +513,4 @@ class GraphSeriesModel extends SeriesModel { }; } -export default GraphSeriesModel; \ No newline at end of file +export default GraphSeriesModel; diff --git a/src/chart/line/LineSeries.ts b/src/chart/line/LineSeries.ts index d46640bbc3..9faf5c5175 100644 --- a/src/chart/line/LineSeries.ts +++ b/src/chart/line/LineSeries.ts @@ -48,7 +48,7 @@ type LineDataValue = OptionDataValue | OptionDataValue[]; interface LineStateOptionMixin { emphasis?: { focus?: DefaultEmphasisFocus - scale?: boolean + scale?: boolean | number } } diff --git a/src/chart/scatter/ScatterSeries.ts b/src/chart/scatter/ScatterSeries.ts index 129b88cc63..5e2995ecad 100644 --- a/src/chart/scatter/ScatterSeries.ts +++ b/src/chart/scatter/ScatterSeries.ts @@ -50,7 +50,7 @@ interface ScatterStateOption { interface ScatterStatesOptionMixin { emphasis?: { focus?: DefaultEmphasisFocus - scale?: boolean + scale?: boolean | number } } @@ -163,4 +163,4 @@ class ScatterSeriesModel extends SeriesModel { } -export default ScatterSeriesModel; \ No newline at end of file +export default ScatterSeriesModel; From 6e3efd8fba0b0eeed878bca4954b470b5de31cab Mon Sep 17 00:00:00 2001 From: plainheart Date: Mon, 18 Jul 2022 12:37:32 +0800 Subject: [PATCH 52/86] style: fix typo of `RoamPayload`. --- src/action/roamHelper.ts | 4 ++-- src/chart/graph/install.ts | 4 ++-- src/chart/tree/treeAction.ts | 6 +++--- src/component/geo/install.ts | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/action/roamHelper.ts b/src/action/roamHelper.ts index d1721a93c3..f14c8ccfbe 100644 --- a/src/action/roamHelper.ts +++ b/src/action/roamHelper.ts @@ -22,7 +22,7 @@ import type View from '../coord/View'; import type ExtensionAPI from '../core/ExtensionAPI'; import type { Payload } from '../util/types'; -export interface RoamPaylod extends Payload { +export interface RoamPayload extends Payload { dx: number dy: number zoom: number @@ -39,7 +39,7 @@ function getCenterCoord(view: View, point: number[]) { export function updateCenterAndZoom( view: View, - payload: RoamPaylod, + payload: RoamPayload, zoomLimit?: { min?: number, max?: number diff --git a/src/chart/graph/install.ts b/src/chart/graph/install.ts index b917be00ef..2ffec7b035 100644 --- a/src/chart/graph/install.ts +++ b/src/chart/graph/install.ts @@ -29,7 +29,7 @@ import createView from './createView'; import View from '../../coord/View'; import GraphView from './GraphView'; import GraphSeriesModel from './GraphSeries'; -import { RoamPaylod, updateCenterAndZoom } from '../../action/roamHelper'; +import { RoamPayload, updateCenterAndZoom } from '../../action/roamHelper'; import GlobalModel from '../../model/Global'; import { noop } from 'zrender/src/core/util'; import type ExtensionAPI from '../../core/ExtensionAPI'; @@ -73,7 +73,7 @@ export function install(registers: EChartsExtensionInstallRegisters) { }, noop); // Register roam action. - registers.registerAction(actionInfo, function (payload: RoamPaylod, ecModel: GlobalModel, api: ExtensionAPI) { + registers.registerAction(actionInfo, function (payload: RoamPayload, ecModel: GlobalModel, api: ExtensionAPI) { ecModel.eachComponent({ mainType: 'series', query: payload }, function (seriesModel: GraphSeriesModel) { diff --git a/src/chart/tree/treeAction.ts b/src/chart/tree/treeAction.ts index 2589d3ef75..358779919c 100644 --- a/src/chart/tree/treeAction.ts +++ b/src/chart/tree/treeAction.ts @@ -17,7 +17,7 @@ * under the License. */ -import {updateCenterAndZoom, RoamPaylod} from '../../action/roamHelper'; +import {updateCenterAndZoom, RoamPayload} from '../../action/roamHelper'; import { Payload } from '../../util/types'; import TreeSeriesModel from './TreeSeries'; import GlobalModel from '../../model/Global'; @@ -52,7 +52,7 @@ export function installTreeAction(registers: EChartsExtensionInstallRegisters) { // the layout. So don't need to go through the whole update process, such // as 'dataPrcocess', 'coordSystemUpdate', 'layout' and so on. update: 'none' - }, function (payload: RoamPaylod, ecModel: GlobalModel, api: ExtensionAPI) { + }, function (payload: RoamPayload, ecModel: GlobalModel, api: ExtensionAPI) { ecModel.eachComponent({ mainType: 'series', subType: 'tree', query: payload }, function (seriesModel: TreeSeriesModel) { @@ -67,4 +67,4 @@ export function installTreeAction(registers: EChartsExtensionInstallRegisters) { }); }); -} \ No newline at end of file +} diff --git a/src/component/geo/install.ts b/src/component/geo/install.ts index d18aa18376..3bf9e3e2b9 100644 --- a/src/component/geo/install.ts +++ b/src/component/geo/install.ts @@ -23,7 +23,7 @@ import geoCreator from '../../coord/geo/geoCreator'; import { ActionInfo } from '../../util/types'; import { each } from 'zrender/src/core/util'; import GlobalModel from '../../model/Global'; -import { updateCenterAndZoom, RoamPaylod } from '../../action/roamHelper'; +import { updateCenterAndZoom, RoamPayload } from '../../action/roamHelper'; import MapSeries from '../../chart/map/MapSeries'; import GeoView from './GeoView'; import geoSourceManager from '../../coord/geo/geoSourceManager'; @@ -115,7 +115,7 @@ export function install(registers: EChartsExtensionInstallRegisters) { type: 'geoRoam', event: 'geoRoam', update: 'updateTransform' - }, function (payload: RoamPaylod, ecModel: GlobalModel, api: ExtensionAPI) { + }, function (payload: RoamPayload, ecModel: GlobalModel, api: ExtensionAPI) { const componentType = payload.componentType || 'series'; ecModel.eachComponent( @@ -147,4 +147,4 @@ export function install(registers: EChartsExtensionInstallRegisters) { } ); }); -} \ No newline at end of file +} From 690ad3df046d03e9c3e83fb4621d553bfc78bd7b Mon Sep 17 00:00:00 2001 From: plainheart Date: Tue, 19 Jul 2022 15:38:04 +0800 Subject: [PATCH 53/86] refactor(util): import `encodeHTML` function from `zrender`. --- src/util/format.ts | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/src/util/format.ts b/src/util/format.ts index ce85f6c83a..8aa00685ad 100644 --- a/src/util/format.ts +++ b/src/util/format.ts @@ -18,6 +18,7 @@ */ import * as zrUtil from 'zrender/src/core/util'; +import { encodeHTML } from 'zrender/src/core/dom'; import { parseDate, isNumeric, numericToNumber } from './number'; import { TooltipRenderMode, ColorString, ZRColor, DimensionType } from './types'; import { Dictionary } from 'zrender/src/core/types'; @@ -51,24 +52,7 @@ export function toCamelCase(str: string, upperCaseFirst?: boolean): string { export const normalizeCssArray = zrUtil.normalizeCssArray; - -const replaceReg = /([&<>"'])/g; -const replaceMap: Dictionary = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - '\'': ''' -}; - -export function encodeHTML(source: string): string { - return source == null - ? '' - : (source + '').replace(replaceReg, function (str, c) { - return replaceMap[c]; - }); -} - +export { encodeHTML }; /** * Make value user readable for tooltip and label. From 28baad87b02fb78eb50c270d49e569085571da00 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 20 Jul 2022 02:19:32 +0000 Subject: [PATCH 54/86] chore(deps-dev): bump terser from 5.3.8 to 5.14.2 Bumps [terser](https://github.com/terser/terser) from 5.3.8 to 5.14.2. - [Release notes](https://github.com/terser/terser/releases) - [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md) - [Commits](https://github.com/terser/terser/commits) --- updated-dependencies: - dependency-name: terser dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- package-lock.json | 174 +++++++++++++++++++++++++++++++++++++--------- 1 file changed, 143 insertions(+), 31 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4259502b29..004f09105c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1457,6 +1457,64 @@ "node": ">=8" } }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", + "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", + "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", + "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/source-map": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz", + "integrity": "sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==", + "dev": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.14", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", + "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.14", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.14.tgz", + "integrity": "sha512-bJWEfQ9lPTvm3SneWwRFVLzrh6nhjwqw7TUFFBEMzwvg7t7PCDenf2lDwqo4NQXzdpgBXyFgDWnQA+2vkruksQ==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, "node_modules/@lang/rollup-plugin-dts": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/@lang/rollup-plugin-dts/-/rollup-plugin-dts-2.0.2.tgz", @@ -11737,9 +11795,9 @@ } }, "node_modules/source-map-support": { - "version": "0.5.19", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", - "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", "dev": true, "dependencies": { "buffer-from": "^1.0.0", @@ -12281,14 +12339,15 @@ } }, "node_modules/terser": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.3.8.tgz", - "integrity": "sha512-zVotuHoIfnYjtlurOouTazciEfL7V38QMAOhGqpXDEg6yT13cF4+fEP9b0rrCEQTn+tT46uxgFsTZzhygk+CzQ==", + "version": "5.14.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.14.2.tgz", + "integrity": "sha512-oL0rGeM/WFQCUd0y2QrWxYnq7tfSuKBiqTjRPWrRgB46WD/kiwHwF8T23z78H6Q6kGCuuHcPB+KULHRdxvVGQA==", "dev": true, "dependencies": { + "@jridgewell/source-map": "^0.3.2", + "acorn": "^8.5.0", "commander": "^2.20.0", - "source-map": "~0.7.2", - "source-map-support": "~0.5.19" + "source-map-support": "~0.5.20" }, "bin": { "terser": "bin/terser" @@ -12297,21 +12356,24 @@ "node": ">=10" } }, + "node_modules/terser/node_modules/acorn": { + "version": "8.7.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.1.tgz", + "integrity": "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/terser/node_modules/commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, - "node_modules/terser/node_modules/source-map": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, "node_modules/test-exclude": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", @@ -14580,6 +14642,55 @@ } } }, + "@jridgewell/gen-mapping": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", + "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", + "dev": true, + "requires": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "@jridgewell/resolve-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", + "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", + "dev": true + }, + "@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "dev": true + }, + "@jridgewell/source-map": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz", + "integrity": "sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==", + "dev": true, + "requires": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "@jridgewell/sourcemap-codec": { + "version": "1.4.14", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", + "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", + "dev": true + }, + "@jridgewell/trace-mapping": { + "version": "0.3.14", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.14.tgz", + "integrity": "sha512-bJWEfQ9lPTvm3SneWwRFVLzrh6nhjwqw7TUFFBEMzwvg7t7PCDenf2lDwqo4NQXzdpgBXyFgDWnQA+2vkruksQ==", + "dev": true, + "requires": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, "@lang/rollup-plugin-dts": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/@lang/rollup-plugin-dts/-/rollup-plugin-dts-2.0.2.tgz", @@ -22933,9 +23044,9 @@ } }, "source-map-support": { - "version": "0.5.19", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", - "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", "dev": true, "requires": { "buffer-from": "^1.0.0", @@ -23379,27 +23490,28 @@ } }, "terser": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.3.8.tgz", - "integrity": "sha512-zVotuHoIfnYjtlurOouTazciEfL7V38QMAOhGqpXDEg6yT13cF4+fEP9b0rrCEQTn+tT46uxgFsTZzhygk+CzQ==", + "version": "5.14.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.14.2.tgz", + "integrity": "sha512-oL0rGeM/WFQCUd0y2QrWxYnq7tfSuKBiqTjRPWrRgB46WD/kiwHwF8T23z78H6Q6kGCuuHcPB+KULHRdxvVGQA==", "dev": true, "requires": { + "@jridgewell/source-map": "^0.3.2", + "acorn": "^8.5.0", "commander": "^2.20.0", - "source-map": "~0.7.2", - "source-map-support": "~0.5.19" + "source-map-support": "~0.5.20" }, "dependencies": { + "acorn": { + "version": "8.7.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.1.tgz", + "integrity": "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==", + "dev": true + }, "commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true - }, - "source-map": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", - "dev": true } } }, From 7d7150b28ecd5642be8ab96c41ea7494ce362d44 Mon Sep 17 00:00:00 2001 From: plainheart Date: Wed, 20 Jul 2022 16:38:34 +0800 Subject: [PATCH 55/86] chore: update zrender to the latest nightly version. --- package-lock.json | 15 ++++++++------- package.json | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4259502b29..b9f0bcea6a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "Apache-2.0", "dependencies": { "tslib": "2.3.0", - "zrender": "5.3.2" + "zrender": "npm:zrender-nightly@^5.3.3-dev.20220720" }, "devDependencies": { "@babel/code-frame": "7.10.4", @@ -13362,9 +13362,10 @@ } }, "node_modules/zrender": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/zrender/-/zrender-5.3.2.tgz", - "integrity": "sha512-8IiYdfwHj2rx0UeIGZGGU4WEVSDEdeVCaIg/fomejg1Xu6OifAL1GVzIPHg2D+MyUkbNgPWji90t0a8IDk+39w==", + "name": "zrender-nightly", + "version": "5.3.3-dev.20220720", + "resolved": "https://registry.npmjs.org/zrender-nightly/-/zrender-nightly-5.3.3-dev.20220720.tgz", + "integrity": "sha512-rh3tfK2ARgee39pYh1xEaT8ZyT+70kHQKFranukjmKOMQi8/5nM4sBuuYPCwFcoIpvSMM/iiYikZmM9VEMwMKQ==", "dependencies": { "tslib": "2.3.0" } @@ -24241,9 +24242,9 @@ } }, "zrender": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/zrender/-/zrender-5.3.2.tgz", - "integrity": "sha512-8IiYdfwHj2rx0UeIGZGGU4WEVSDEdeVCaIg/fomejg1Xu6OifAL1GVzIPHg2D+MyUkbNgPWji90t0a8IDk+39w==", + "version": "npm:zrender-nightly@5.3.3-dev.20220720", + "resolved": "https://registry.npmjs.org/zrender-nightly/-/zrender-nightly-5.3.3-dev.20220720.tgz", + "integrity": "sha512-rh3tfK2ARgee39pYh1xEaT8ZyT+70kHQKFranukjmKOMQi8/5nM4sBuuYPCwFcoIpvSMM/iiYikZmM9VEMwMKQ==", "requires": { "tslib": "2.3.0" } diff --git a/package.json b/package.json index 5acf86a154..1e1c3544eb 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ }, "dependencies": { "tslib": "2.3.0", - "zrender": "5.3.2" + "zrender": "npm:zrender-nightly@^5.3.3-dev.20220720" }, "devDependencies": { "@babel/code-frame": "7.10.4", From d5ee24d755d0fa1c7adf1cc4c484e862b2f4ffb2 Mon Sep 17 00:00:00 2001 From: plainheart Date: Thu, 21 Jul 2022 16:29:24 +0800 Subject: [PATCH 56/86] fix(pie): fix `labelLine` may not be hidden when `minShowLabelRadian` is specified, resolves #17013. --- src/chart/pie/labelLayout.ts | 3 +- test/pie-label.html | 120 +++++++++++++++++++++++++++- test/runTest/actions/__meta__.json | 1 + test/runTest/actions/pie-label.json | 1 + 4 files changed, 122 insertions(+), 3 deletions(-) create mode 100644 test/runTest/actions/pie-label.json diff --git a/src/chart/pie/labelLayout.ts b/src/chart/pie/labelLayout.ts index 9aaf1bf228..0c90908914 100644 --- a/src/chart/pie/labelLayout.ts +++ b/src/chart/pie/labelLayout.ts @@ -394,7 +394,8 @@ export default function pieLabelLayout( if (Math.abs(sectorShape.endAngle - sectorShape.startAngle) < minShowLabelRadian) { each(label.states, setNotShow); - label.ignore = true; + each(labelLine.states, setNotShow); + label.ignore = labelLine.ignore = true; return; } diff --git a/test/pie-label.html b/test/pie-label.html index 85541efd72..23cb8d39a7 100644 --- a/test/pie-label.html +++ b/test/pie-label.html @@ -51,7 +51,7 @@
- +
+ + diff --git a/test/runTest/actions/__meta__.json b/test/runTest/actions/__meta__.json index ae9e2a6992..5de0031e9b 100644 --- a/test/runTest/actions/__meta__.json +++ b/test/runTest/actions/__meta__.json @@ -149,6 +149,7 @@ "pie-animation": 2, "pie-calculable": 1, "pie-cornerRadius": 1, + "pie-label": 2, "pie-label-extreme": 2, "polar-rounded": 3, "polarLine": 1, diff --git a/test/runTest/actions/pie-label.json b/test/runTest/actions/pie-label.json new file mode 100644 index 0000000000..44ede7c777 --- /dev/null +++ b/test/runTest/actions/pie-label.json @@ -0,0 +1 @@ +[{"name":"Action 1","ops":[{"type":"mousemove","time":299,"x":274,"y":345},{"type":"mousemove","time":499,"x":336,"y":332},{"type":"screenshot","time":1769},{"type":"mousemove","time":2799,"x":337,"y":332},{"type":"mousemove","time":2999,"x":316,"y":331},{"type":"mousemove","time":3205,"x":188,"y":277},{"type":"mousemove","time":3419,"x":152,"y":223},{"type":"mousemove","time":3620,"x":134,"y":197},{"type":"mousedown","time":3688,"x":133,"y":189},{"type":"mousemove","time":3837,"x":133,"y":189},{"type":"mouseup","time":3858,"x":133,"y":189},{"time":3859,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":4250,"x":133,"y":191},{"type":"mousemove","time":4450,"x":315,"y":338},{"type":"mousemove","time":4656,"x":345,"y":345},{"type":"mousemove","time":5632,"x":346,"y":345},{"type":"screenshot","time":6169}],"scrollY":4134.8564453125,"scrollX":0,"timestamp":1658391799998},{"name":"Action 2","ops":[{"type":"mousemove","time":257,"x":145,"y":492},{"type":"mousemove","time":465,"x":146,"y":478},{"type":"mousedown","time":518,"x":146,"y":478},{"type":"mouseup","time":633,"x":146,"y":478},{"time":634,"delay":400,"type":"screenshot-auto"},{"type":"mousedown","time":1553,"x":146,"y":478},{"type":"mouseup","time":1719,"x":146,"y":478},{"time":1720,"delay":400,"type":"screenshot-auto"}],"scrollY":4431.60009765625,"scrollX":0,"timestamp":1658392063110}] \ No newline at end of file From a214eda00837c9823832cb7f29e6226d6562da28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E9=AA=A5?= Date: Thu, 21 Jul 2022 14:50:18 +0800 Subject: [PATCH 57/86] =?UTF-8?q?=E5=8D=95=E8=BD=B4=E5=8F=8D=E5=90=91?= =?UTF-8?q?=E5=A4=B1=E6=95=88=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/coord/single/Single.ts | 2 +- src/coord/single/SingleAxis.ts | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/coord/single/Single.ts b/src/coord/single/Single.ts index 4632190e41..c9226b5aae 100644 --- a/src/coord/single/Single.ts +++ b/src/coord/single/Single.ts @@ -140,7 +140,7 @@ class Single implements CoordinateSystem, CoordinateSystemMaster { const isHorizontal = axis.isHorizontal(); const extent = isHorizontal ? [0, rect.width] : [0, rect.height]; - const idx = axis.reverse ? 1 : 0; + const idx = axis.inverse ? 1 : 0; axis.setExtent(extent[idx], extent[1 - idx]); diff --git a/src/coord/single/SingleAxis.ts b/src/coord/single/SingleAxis.ts index 6009149be6..ff2db92516 100644 --- a/src/coord/single/SingleAxis.ts +++ b/src/coord/single/SingleAxis.ts @@ -43,8 +43,6 @@ class SingleAxis extends Axis { orient: LayoutOrient; - reverse: boolean; - coordinateSystem: Single; model: SingleAxisModel; From 8fc48c727663b0514352ac8b3b70e4f1eeed3988 Mon Sep 17 00:00:00 2001 From: Ovilia Date: Mon, 25 Jul 2022 15:58:52 +0800 Subject: [PATCH 58/86] fix(custom): ignore element when renderItem returns a group with null elements --- src/chart/custom/CustomView.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/chart/custom/CustomView.ts b/src/chart/custom/CustomView.ts index 60de188fd1..215087b72b 100644 --- a/src/chart/custom/CustomView.ts +++ b/src/chart/custom/CustomView.ts @@ -1321,15 +1321,15 @@ function mergeChildren( // Mapping children of a group simply by index, which // might be better performance. let index = 0; - let oldRemovedCount = 0; for (; index < newLen; index++) { const newChild = newChildren[index]; - // The index of oldChild may change if previous child not exists - // in newChildren and have no leave animation. By subtracting - // oldRemovedCount, we make sure to compare the children before - // removing from the parent. - const oldChild = el.childAt(index - oldRemovedCount); + const oldChild = el.childAt(index); if (newChild) { + if (newChild.ignore == null) { + // The old child is set to be ignored if null (see comments + // below). So we need to set ignore to be false back. + newChild.ignore = false; + } doCreateOrUpdateEl( api, oldChild, @@ -1340,11 +1340,11 @@ function mergeChildren( ); } else { - const childCount = el.childCount(); - removeChildFromGroup(el, oldChild, seriesModel); - // If there is not leave animation, the child is removed from - // the parent directly, so we should update the index. - oldRemovedCount += childCount - el.childCount(); + // If the new element option is null, it means to remove the old + // element. But we cannot really remove the element from the group + // directly, because the element order may not be stable when this + // element is added back. So we set the element to be ignored. + oldChild.ignore = true; } } for (let i = el.childCount() - 1; i >= index; i--) { From 09e0c801a5d2e01b6301cec3a636015eec8bd7d4 Mon Sep 17 00:00:00 2001 From: Ovilia Date: Mon, 25 Jul 2022 16:07:30 +0800 Subject: [PATCH 59/86] test(custom): update test case for custom update --- test/custom-update.html | 29 +++++++++++++++---------- test/runTest/actions/__meta__.json | 2 +- test/runTest/actions/custom-update.json | 2 +- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/test/custom-update.html b/test/custom-update.html index 680020ee04..2015c4bbb6 100644 --- a/test/custom-update.html +++ b/test/custom-update.html @@ -57,6 +57,7 @@ var option; var cellSize = [50, 51]; var isFirst = true; + var clickTimes = 0; option = { calendar: [ @@ -80,7 +81,7 @@ }, name: 'a', coordinateSystem: 'calendar', - animation: hasAnimation ? 1000 : 0, + animation: hasAnimation ? 3000 : 0, data: [ ['2022-01-16', 'e', false] ], @@ -102,7 +103,7 @@ }, position, style: { - fill: isFirst ? '#eee' : '#6ee' + fill: api.value(2) ? '#eee' : '#6ee' }, textContent: { style: { @@ -140,16 +141,16 @@ const right = api.value(2) ? { - type: 'rect', + type: 'circle', shape: { - x: cellWidth, - y: 0, - width: 20, - height: 15 + cx: cellWidth + 20, + cy: 20, + r: 30 }, position, style: { - fill: 'blue' + fill: 'transparent', + stroke: 'blue', } } : { @@ -193,19 +194,25 @@ // height: 300, buttons: [{text: 'Update', onclick: function () { isFirst = false; + var testId = clickTimes % 2; chart.setOption({ calendar: { - range: ['2022-02'] - }, + range: testId === 0 ? ['2022-02'] : ['2022-01'] + }, series: [ { type: 'custom', data: [ - ['2022-02-13', 'e', true] + [ + testId === 0 ? '2022-02-13' : '2022-01-16' , + 'e', + testId === 0 + ] ] } ] }); + ++clickTimes; }}] }); } diff --git a/test/runTest/actions/__meta__.json b/test/runTest/actions/__meta__.json index de4ac84d96..7e5334a6b6 100644 --- a/test/runTest/actions/__meta__.json +++ b/test/runTest/actions/__meta__.json @@ -63,7 +63,7 @@ "custom-large": 1, "custom-shape-morphing": 1, "custom-text-content": 6, - "custom-update": 2, + "custom-update": 4, "dataSelect": 7, "dataset-case": 6, "dataZoom-action": 4, diff --git a/test/runTest/actions/custom-update.json b/test/runTest/actions/custom-update.json index bb04426472..dbacd6ff19 100644 --- a/test/runTest/actions/custom-update.json +++ b/test/runTest/actions/custom-update.json @@ -1 +1 @@ -[{"name":"Action 1","ops":[{"type":"mousemove","time":420,"x":14,"y":161},{"type":"mousemove","time":620,"x":27,"y":69},{"type":"mousemove","time":825,"x":28,"y":53},{"type":"mousemove","time":1036,"x":37,"y":74},{"type":"mousedown","time":1162,"x":37,"y":76},{"type":"mousemove","time":1237,"x":37,"y":76},{"type":"mouseup","time":1311,"x":37,"y":76},{"time":1312,"delay":400,"type":"screenshot-auto"}],"scrollY":0,"scrollX":0,"timestamp":1657531346385},{"name":"Action 2","ops":[{"type":"mousemove","time":743,"x":610,"y":251},{"type":"mousemove","time":943,"x":337,"y":165},{"type":"mousemove","time":1143,"x":109,"y":156},{"type":"mousemove","time":1343,"x":53,"y":176},{"type":"mousemove","time":1543,"x":47,"y":178},{"type":"mousedown","time":1548,"x":47,"y":178},{"type":"mouseup","time":1680,"x":47,"y":178},{"time":1681,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":2109,"x":48,"y":178},{"type":"mousemove","time":2309,"x":113,"y":178},{"type":"mousemove","time":2515,"x":114,"y":178}],"scrollY":434,"scrollX":0,"timestamp":1657615363601}] \ No newline at end of file +[{"name":"Action 1","ops":[{"type":"mousemove","time":678,"x":793,"y":218},{"type":"mousemove","time":878,"x":436,"y":281},{"type":"mousemove","time":1079,"x":285,"y":329},{"type":"mousemove","time":1285,"x":283,"y":329},{"type":"mousemove","time":1362,"x":282,"y":329},{"type":"mousemove","time":1562,"x":239,"y":316},{"type":"mousemove","time":1765,"x":176,"y":325},{"type":"mousemove","time":1979,"x":158,"y":325},{"type":"mousemove","time":2180,"x":72,"y":178},{"type":"mousemove","time":2386,"x":43,"y":114},{"type":"mousemove","time":2580,"x":43,"y":114},{"type":"mousedown","time":2591,"x":43,"y":114},{"type":"mouseup","time":2723,"x":43,"y":114},{"time":2724,"delay":400,"type":"screenshot-auto"},{"type":"mousedown","time":4303,"x":43,"y":114},{"type":"mouseup","time":4435,"x":43,"y":114},{"time":4436,"delay":400,"type":"screenshot-auto"},{"type":"mousedown","time":6044,"x":43,"y":114},{"type":"mouseup","time":6177,"x":43,"y":114},{"time":6178,"delay":400,"type":"screenshot-auto"}],"scrollY":0,"scrollX":0,"timestamp":1658736074386},{"name":"Action 2","ops":[{"type":"mousemove","time":477,"x":484,"y":279},{"type":"mousemove","time":680,"x":226,"y":164},{"type":"mousemove","time":893,"x":119,"y":145},{"type":"mousemove","time":1094,"x":59,"y":132},{"type":"mousemove","time":1301,"x":51,"y":129},{"type":"mousedown","time":1423,"x":51,"y":129},{"type":"mouseup","time":1547,"x":51,"y":129},{"time":1548,"delay":400,"type":"screenshot-auto"},{"type":"mousedown","time":2550,"x":51,"y":129},{"type":"mouseup","time":2684,"x":51,"y":129},{"time":2685,"delay":400,"type":"screenshot-auto"},{"type":"mousedown","time":3923,"x":51,"y":129},{"type":"mouseup","time":4056,"x":51,"y":129},{"time":4057,"delay":400,"type":"screenshot-auto"}],"scrollY":530,"scrollX":0,"timestamp":1658736087421},{"name":"Action 3","ops":[{"type":"mousemove","time":399,"x":153,"y":147},{"type":"mousemove","time":600,"x":77,"y":88},{"type":"mousemove","time":805,"x":48,"y":69},{"type":"mousedown","time":931,"x":45,"y":66},{"type":"mousemove","time":1021,"x":45,"y":66},{"type":"mouseup","time":1062,"x":45,"y":66},{"time":1063,"delay":400,"type":"screenshot-auto"},{"type":"mousedown","time":2000,"x":45,"y":66},{"type":"mouseup","time":2122,"x":45,"y":66},{"time":2123,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":2934,"x":45,"y":66},{"type":"mousedown","time":2988,"x":45,"y":67},{"type":"mousemove","time":3136,"x":45,"y":67},{"type":"mouseup","time":3146,"x":45,"y":67},{"time":3147,"delay":400,"type":"screenshot-auto"}],"scrollY":1128,"scrollX":0,"timestamp":1658736095915},{"name":"Action 4","ops":[{"type":"mousemove","time":166,"x":266,"y":215},{"type":"mousemove","time":370,"x":79,"y":198},{"type":"mousemove","time":582,"x":55,"y":185},{"type":"mousedown","time":751,"x":52,"y":184},{"type":"mousemove","time":786,"x":52,"y":184},{"type":"mouseup","time":851,"x":52,"y":184},{"time":852,"delay":400,"type":"screenshot-auto"},{"type":"mousedown","time":1708,"x":52,"y":184},{"type":"mousemove","time":1715,"x":52,"y":184},{"type":"mouseup","time":1854,"x":52,"y":184},{"time":1855,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":2698,"x":52,"y":184},{"type":"mousedown","time":2732,"x":52,"y":185},{"type":"mouseup","time":2874,"x":52,"y":185},{"time":2875,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":2903,"x":52,"y":185}],"scrollY":1548,"scrollX":0,"timestamp":1658736103250}] \ No newline at end of file From 749b64e94d53ecc5e4ac4fc217762cae86c2fc5b Mon Sep 17 00:00:00 2001 From: Ovilia Date: Tue, 26 Jul 2022 14:46:14 +0800 Subject: [PATCH 60/86] fix(bar-race): provide subPixelOptimize option to solve #14679 --- src/component/axis/AxisBuilder.ts | 24 ++++++++++++++++-------- src/component/axis/CartesianAxisView.ts | 14 ++++++++++++-- src/component/axis/SingleAxisView.ts | 7 ++++++- src/coord/axisCommonTypes.ts | 1 + test/bar-race.html | 3 ++- 5 files changed, 37 insertions(+), 12 deletions(-) diff --git a/src/component/axis/AxisBuilder.ts b/src/component/axis/AxisBuilder.ts index b0e31e08f8..e338453ed9 100644 --- a/src/component/axis/AxisBuilder.ts +++ b/src/component/axis/AxisBuilder.ts @@ -343,13 +343,17 @@ const builders: Record<'axisLine' | 'axisTickLabel' | 'axisName', AxisElementsBu }, axisTickLabel(opt, axisModel, group, transformGroup) { + let subPixelOptimize = axisModel.get('subPixelOptimize'); + if (subPixelOptimize == null) { + subPixelOptimize = true; + } - const ticksEls = buildAxisMajorTicks(group, transformGroup, axisModel, opt); + const ticksEls = buildAxisMajorTicks(group, transformGroup, axisModel, opt, subPixelOptimize); const labelEls = buildAxisLabel(group, transformGroup, axisModel, opt); fixMinMaxLabelShow(axisModel, labelEls, ticksEls); - buildAxisMinorTicks(group, transformGroup, axisModel, opt.tickDirection); + buildAxisMinorTicks(group, transformGroup, axisModel, opt.tickDirection, subPixelOptimize); // This bit fixes the label overlap issue for the time chart. // See https://github.com/apache/echarts/issues/14266 for more. @@ -611,7 +615,8 @@ function createTicks( tickTransform: matrixUtil.MatrixArray, tickEndCoord: number, tickLineStyle: PathStyleProps, - anidPrefix: string + anidPrefix: string, + subPixelOptimize: boolean ) { const tickEls = []; const pt1: number[] = []; @@ -630,7 +635,7 @@ function createTicks( } // Tick line, Not use group transform to have better line draw const tickEl = new graphic.Line({ - subPixelOptimize: true, + subPixelOptimize, shape: { x1: pt1[0], y1: pt1[1], @@ -652,7 +657,8 @@ function buildAxisMajorTicks( group: graphic.Group, transformGroup: graphic.Group, axisModel: AxisBaseModel, - opt: AxisBuilderCfg + opt: AxisBuilderCfg, + subPixelOptimize: boolean ) { const axis = axisModel.axis; @@ -676,7 +682,7 @@ function buildAxisMajorTicks( { stroke: axisModel.get(['axisLine', 'lineStyle', 'color']) } - ), 'ticks'); + ), 'ticks', subPixelOptimize); for (let i = 0; i < ticksEls.length; i++) { group.add(ticksEls[i]); @@ -689,7 +695,8 @@ function buildAxisMinorTicks( group: graphic.Group, transformGroup: graphic.Group, axisModel: AxisBaseModel, - tickDirection: number + tickDirection: number, + subPixelOptimize: boolean ) { const axis = axisModel.axis; @@ -719,7 +726,8 @@ function buildAxisMinorTicks( for (let i = 0; i < minorTicksCoords.length; i++) { const minorTicksEls = createTicks( - minorTicksCoords[i], transformGroup.transform, tickEndCoord, minorTickLineStyle, 'minorticks_' + i + minorTicksCoords[i], transformGroup.transform, tickEndCoord, minorTickLineStyle, 'minorticks_' + i, + subPixelOptimize ); for (let k = 0; k < minorTicksEls.length; k++) { group.add(minorTicksEls[k]); diff --git a/src/component/axis/CartesianAxisView.ts b/src/component/axis/CartesianAxisView.ts index e040398902..e1a74b6dfe 100644 --- a/src/component/axis/CartesianAxisView.ts +++ b/src/component/axis/CartesianAxisView.ts @@ -139,6 +139,12 @@ const axisElementBuilders: Record { From 52d89e7c8bd7167485f4a23979ce9c9038b8cfdf Mon Sep 17 00:00:00 2001 From: Ovilia Date: Tue, 26 Jul 2022 14:58:40 +0800 Subject: [PATCH 61/86] test(bar-race): update test --- test/bar-race.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/bar-race.html b/test/bar-race.html index 9916d77385..7206a35240 100644 --- a/test/bar-race.html +++ b/test/bar-race.html @@ -76,6 +76,11 @@ return Math.round(n); } }, + splitLine: { + lineStyle: { + color: 'red' + } + }, subPixelOptimize: false }, dataset: { From c76c297e60829e9f46e8d72a07a778784a914bd7 Mon Sep 17 00:00:00 2001 From: plainheart Date: Thu, 28 Jul 2022 22:01:27 +0800 Subject: [PATCH 62/86] fix(symbol): fix `emphasis.scale` can't be reset and specified value may not be respect. - null / undefined / true means to use default strategy. - 0 / false / negative number / NaN / Infinity means no scale. --- src/chart/helper/Symbol.ts | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/chart/helper/Symbol.ts b/src/chart/helper/Symbol.ts index c31e9b11b3..e77a84dca3 100644 --- a/src/chart/helper/Symbol.ts +++ b/src/chart/helper/Symbol.ts @@ -336,11 +336,19 @@ class Symbol extends graphic.Group { symbolPath.ensureState('select').style = selectItemStyle; symbolPath.ensureState('blur').style = blurItemStyle; - if (hoverScale) { - const scaleRatio = Math.max(isNumber(hoverScale) ? hoverScale : 1.1, 3 / this._sizeY); - emphasisState.scaleX = this._sizeX * scaleRatio; - emphasisState.scaleY = this._sizeY * scaleRatio; - } + // null / undefined / true means to use default strategy. + // 0 / false / negative number / NaN / Infinity means no scale. + const scaleRatio = + hoverScale == null || hoverScale === true + ? Math.max(1.1, 3 / this._sizeY) + // PENDING: restrict hoverScale > 1? It seems unreasonable to scale down + : isFinite(hoverScale as number) && hoverScale > 0 + ? +hoverScale + : 1; + // always set scale to allow resetting + emphasisState.scaleX = this._sizeX * scaleRatio; + emphasisState.scaleY = this._sizeY * scaleRatio; + this.setSymbolScale(1); toggleHoverEmphasis(this, focus, blurScope, emphasisDisabled); From bffad00b26dacf53d4ab383a3d70aec14359eb11 Mon Sep 17 00:00:00 2001 From: plainheart Date: Thu, 28 Jul 2022 22:08:05 +0800 Subject: [PATCH 63/86] test(symbol): add test case for `emphasis.scale` --- test/runTest/actions/__meta__.json | 1 + test/runTest/actions/symbol.json | 1 + test/symbol.html | 72 +++++++++++++++++++++++++----- 3 files changed, 62 insertions(+), 12 deletions(-) create mode 100644 test/runTest/actions/symbol.json diff --git a/test/runTest/actions/__meta__.json b/test/runTest/actions/__meta__.json index 5de0031e9b..4267114bdc 100644 --- a/test/runTest/actions/__meta__.json +++ b/test/runTest/actions/__meta__.json @@ -170,6 +170,7 @@ "stackBar-dataZoom": 7, "sunburst-book": 1, "sunburst-canvas": 1, + "symbol": 1, "symbol2": 1, "themeRiver": 1, "timeScale": 1, diff --git a/test/runTest/actions/symbol.json b/test/runTest/actions/symbol.json new file mode 100644 index 0000000000..a3eaba4eea --- /dev/null +++ b/test/runTest/actions/symbol.json @@ -0,0 +1 @@ +[{"name":"Action 1","ops":[{"type":"mousemove","time":191,"x":749,"y":85},{"type":"mousemove","time":392,"x":733,"y":119},{"type":"mousemove","time":606,"x":704,"y":150},{"type":"screenshot","time":2032},{"type":"mousemove","time":2274,"x":705,"y":150},{"type":"mousemove","time":2479,"x":711,"y":74},{"type":"mousemove","time":2689,"x":706,"y":36},{"type":"mousemove","time":2897,"x":700,"y":20},{"type":"mousemove","time":3361,"x":697,"y":5},{"type":"mousemove","time":3407,"x":697,"y":7},{"type":"mousemove","time":3612,"x":696,"y":21},{"type":"valuechange","selector":"div.dg.ac>div.dg.main.a>ul>li.cr.string>div>div.c>select","value":"2","time":4315,"target":"select"},{"type":"mouseup","time":4316,"x":277,"y":-15},{"type":"mousemove","time":4330,"x":683,"y":59},{"type":"mousemove","time":4533,"x":714,"y":73},{"type":"mousedown","time":4750,"x":741,"y":109},{"type":"mousemove","time":4762,"x":741,"y":109},{"type":"mouseup","time":4863,"x":741,"y":109},{"type":"mousemove","time":5041,"x":741,"y":110},{"type":"mousemove","time":5245,"x":739,"y":117},{"type":"mousemove","time":5607,"x":737,"y":122},{"type":"mousemove","time":5821,"x":712,"y":154},{"type":"mousemove","time":7472,"x":711,"y":155},{"type":"mousemove","time":7673,"x":709,"y":137},{"type":"mousemove","time":7879,"x":703,"y":130},{"type":"mousemove","time":8090,"x":708,"y":152},{"type":"screenshot","time":8290},{"type":"mousemove","time":8495,"x":721,"y":153},{"type":"mousedown","time":15040,"x":721,"y":153},{"type":"mouseup","time":15178,"x":721,"y":153},{"type":"mousemove","time":17358,"x":721,"y":146},{"type":"mousemove","time":17576,"x":697,"y":70},{"type":"mousemove","time":17786,"x":689,"y":15},{"type":"mousemove","time":18161,"x":689,"y":21},{"type":"valuechange","selector":"div.dg.ac>div.dg.main.a>ul>li.cr.string>div>div.c>select","value":"undefined","time":19684,"target":"select"},{"type":"mouseup","time":19684,"x":277,"y":-15},{"type":"mousemove","time":19700,"x":699,"y":82},{"type":"mousemove","time":19909,"x":708,"y":105},{"type":"mousemove","time":20141,"x":711,"y":133},{"type":"mousedown","time":20325,"x":711,"y":133},{"type":"mouseup","time":20522,"x":711,"y":133},{"time":20523,"delay":400,"type":"screenshot-auto"}],"scrollY":0,"scrollX":0,"timestamp":1659016158148}] \ No newline at end of file diff --git a/test/symbol.html b/test/symbol.html index 808f9a7cfb..465cb38904 100644 --- a/test/symbol.html +++ b/test/symbol.html @@ -23,6 +23,8 @@ + + + +
+ + + \ No newline at end of file From 59e180ec0791cf946ecdef330ed9445a22f6c5b9 Mon Sep 17 00:00:00 2001 From: plainheart Date: Mon, 1 Aug 2022 16:22:06 +0800 Subject: [PATCH 68/86] chore: fix wrong imports from `echarts.all` --- src/chart/custom/CustomView.ts | 2 +- src/coord/geo/geoCreator.ts | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/chart/custom/CustomView.ts b/src/chart/custom/CustomView.ts index ad282ed9b0..e0ad444a36 100644 --- a/src/chart/custom/CustomView.ts +++ b/src/chart/custom/CustomView.ts @@ -99,7 +99,7 @@ import { applyKeyframeAnimation, stopPreviousKeyframeAnimationAndRestore } from '../../animation/customGraphicKeyframeAnimation'; -import { SeriesModel } from '../../echarts.all'; +import type SeriesModel from '../../model/Series'; const EMPHASIS = 'emphasis' as const; const NORMAL = 'normal' as const; diff --git a/src/coord/geo/geoCreator.ts b/src/coord/geo/geoCreator.ts index 1d4bd3730e..f51700ae0b 100644 --- a/src/coord/geo/geoCreator.ts +++ b/src/coord/geo/geoCreator.ts @@ -27,15 +27,14 @@ import MapSeries, { MapSeriesOption } from '../../chart/map/MapSeries'; import ExtensionAPI from '../../core/ExtensionAPI'; import { CoordinateSystemCreator } from '../CoordinateSystem'; import { NameMap } from './geoTypes'; -import SeriesModel from '../../model/Series'; import { SeriesOption, SeriesOnGeoOptionMixin } from '../../util/types'; import { Dictionary } from 'zrender/src/core/types'; -import GlobalModel from '../../model/Global'; -import ComponentModel from '../../model/Component'; -import { Model } from '../../echarts.all'; +import type Model from '../../model/Model'; +import type GlobalModel from '../../model/Global'; +import type SeriesModel from '../../model/Series'; +import type ComponentModel from '../../model/Component'; import * as vector from 'zrender/src/core/vector'; - export type resizeGeoType = typeof resizeGeo; /** From e3c8e3ceaf04b70e72a23281c23ed53356666205 Mon Sep 17 00:00:00 2001 From: plainheart Date: Mon, 1 Aug 2022 16:31:16 +0800 Subject: [PATCH 69/86] chore: fix wrong imports from `echarts.all` --- src/animation/customGraphicKeyframeAnimation.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/animation/customGraphicKeyframeAnimation.ts b/src/animation/customGraphicKeyframeAnimation.ts index 196c5fcb37..36dd9ecb1c 100644 --- a/src/animation/customGraphicKeyframeAnimation.ts +++ b/src/animation/customGraphicKeyframeAnimation.ts @@ -22,7 +22,7 @@ import Element from 'zrender/src/Element'; import { keys, filter, each, isArray, indexOf } from 'zrender/src/core/util'; import { ELEMENT_ANIMATABLE_PROPS } from './customGraphicTransition'; import { AnimationOption, AnimationOptionMixin, Dictionary } from '../util/types'; -import { Model } from '../echarts.all'; +import type Model from '../model/Model'; import { getAnimationConfig } from './basicTransition'; import { warn } from '../util/log'; import { makeInner } from '../util/model'; @@ -159,4 +159,4 @@ export function applyKeyframeAnimation>( .duration(duration) .start(animationOpts.easing); }); -} \ No newline at end of file +} From 979654c467bb96d50dc9566f09251aaac89a4448 Mon Sep 17 00:00:00 2001 From: Ovilia Date: Thu, 4 Aug 2022 14:43:28 +0800 Subject: [PATCH 70/86] fix(axis): remove unnecessary files --- src/component/axis/AxisView.ts | 2 - test/gesture.html | 175 --------------------------------- 2 files changed, 177 deletions(-) delete mode 100644 test/gesture.html diff --git a/src/component/axis/AxisView.ts b/src/component/axis/AxisView.ts index 8efa68d7d7..2b409bd949 100644 --- a/src/component/axis/AxisView.ts +++ b/src/component/axis/AxisView.ts @@ -24,8 +24,6 @@ import GlobalModel from '../../model/Global'; import ExtensionAPI from '../../core/ExtensionAPI'; import { Payload, Dictionary } from '../../util/types'; import type BaseAxisPointer from '../axisPointer/BaseAxisPointer'; -import Element from 'zrender/src/Element'; -import * as graphic from '../../util/graphic'; const axisPointerClazz: Dictionary = {}; diff --git a/test/gesture.html b/test/gesture.html deleted file mode 100644 index 0f42f27725..0000000000 --- a/test/gesture.html +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - - - - - -
- - - \ No newline at end of file From 3a6c0979b205334de85de07cd376f3ed4c896c50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E9=AA=A5?= Date: Thu, 23 Jun 2022 17:06:27 +0800 Subject: [PATCH 71/86] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=A5=BC=E5=9B=BE?= =?UTF-8?q?=E6=80=A7=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/chart/pie/PieSeries.ts | 28 ++++++------- src/util/number.ts | 23 +++++++++-- test/pie-percent.html | 83 ++++++++++++++++++++++++++++++++++++++ test/pie3.html | 2 +- 4 files changed, 116 insertions(+), 20 deletions(-) create mode 100644 test/pie-percent.html diff --git a/src/chart/pie/PieSeries.ts b/src/chart/pie/PieSeries.ts index f306fafb30..fc22425605 100644 --- a/src/chart/pie/PieSeries.ts +++ b/src/chart/pie/PieSeries.ts @@ -20,7 +20,7 @@ import createSeriesDataSimply from '../helper/createSeriesDataSimply'; import * as zrUtil from 'zrender/src/core/util'; import * as modelUtil from '../../util/model'; -import { getPercentWithPrecision } from '../../util/number'; +import { getPercentSeats } from '../../util/number'; import { makeSeriesEncodeForNameBased } from '../../data/helper/sourceHelper'; import LegendVisualProvider from '../../visual/LegendVisualProvider'; import SeriesModel from '../../model/Series'; @@ -133,6 +133,8 @@ class PieSeriesModel extends SeriesModel { static type = 'series.pie' as const; + seats: number[]; + /** * @overwrite */ @@ -159,31 +161,25 @@ class PieSeriesModel extends SeriesModel { * @overwrite */ getInitialData(this: PieSeriesModel): SeriesData { - return createSeriesDataSimply(this, { + const data = createSeriesDataSimply(this, { coordDimensions: ['value'], encodeDefaulter: zrUtil.curry(makeSeriesEncodeForNameBased, this) }); + const valueList:number[] = []; + data.each(data.mapDimension('value'), function (value: number) { + valueList.push(value); + }); + + this.seats = getPercentSeats(valueList, data.hostModel.get('percentPrecision')); + return data; } /** * @overwrite */ getDataParams(dataIndex: number): PieCallbackDataParams { - const data = this.getData(); const params = super.getDataParams(dataIndex) as PieCallbackDataParams; - // FIXME toFixed? - - const valueList: number[] = []; - data.each(data.mapDimension('value'), function (value: number) { - valueList.push(value); - }); - - params.percent = getPercentWithPrecision( - valueList, - dataIndex, - data.hostModel.get('percentPrecision') - ); - + params.percent = this.seats[dataIndex]; params.$vars.push('percent'); return params; } diff --git a/src/util/number.ts b/src/util/number.ts index aab32f1703..bf5b2562f0 100644 --- a/src/util/number.ts +++ b/src/util/number.ts @@ -233,11 +233,27 @@ export function getPercentWithPrecision(valueList: number[], idx: number, precis return 0; } + const seats = getPercentSeats(valueList, precision); + + return seats[idx] || 0; +} + +/** + * Get a data of given precision, assuring the sum of percentages + * in valueList is 1. + * The largest remainer method is used. + * https://en.wikipedia.org/wiki/Largest_remainder_method + * + * @param valueList a list of all data + * @param precision integer number showing digits of precision + * @return {Array} + */ +export function getPercentSeats(valueList: number[], precision: number): number[] { const sum = zrUtil.reduce(valueList, function (acc, val) { return acc + (isNaN(val) ? 0 : val); }, 0); if (sum === 0) { - return 0; + return []; } const digits = Math.pow(10, precision); @@ -275,8 +291,9 @@ export function getPercentWithPrecision(valueList: number[], idx: number, precis remainder[maxId] = 0; ++currentSum; } - - return seats[idx] / digits; + return zrUtil.map(seats, function (seat) { + return seat / digits; + }); } /** diff --git a/test/pie-percent.html b/test/pie-percent.html new file mode 100644 index 0000000000..9bbe0aa42f --- /dev/null +++ b/test/pie-percent.html @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + diff --git a/test/pie3.html b/test/pie3.html index e799aaae16..670e492a16 100644 --- a/test/pie3.html +++ b/test/pie3.html @@ -74,7 +74,7 @@ formatter: function (params) { return '
\

' + params.name + '

\ -
' + (params.percent * 100).toFixed(1) + '%
\ +
' + (params.percent).toFixed(1) + '%
\
From d2746afbaadb7130e7f8fb863b3871f254e5df57 Mon Sep 17 00:00:00 2001 From: Zhongxiang Wang Date: Thu, 4 Aug 2022 16:16:06 +0800 Subject: [PATCH 74/86] test(pie): fix test case pie3.html --- test/pie3.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/pie3.html b/test/pie3.html index 670e492a16..1f3b418b3a 100644 --- a/test/pie3.html +++ b/test/pie3.html @@ -74,7 +74,7 @@ formatter: function (params) { return '
\

' + params.name + '

\ -
' + (params.percent).toFixed(1) + '%
\ +
' + params.percent.toFixed(1) + '%
\
- \ No newline at end of file + From 08eb9a87edf8ab3b05965ae81536cbf01e28f303 Mon Sep 17 00:00:00 2001 From: liangism Date: Mon, 8 Aug 2022 10:56:40 +0800 Subject: [PATCH 75/86] fix(theme): fix the abandoned normal level in the theme file. close #17473 --- theme/infographic.js | 10 +- theme/macarons.js | 4 +- theme/macarons2.js | 105 ++++----- theme/shine.js | 4 +- theme/tech-blue.js | 8 +- theme/tool/option/area.js | 16 +- theme/tool/option/bar.js | 32 +-- theme/tool/option/graph.js | 472 ++++++++++++------------------------- theme/tool/option/map.js | 28 +-- theme/tool/option/pie.js | 20 +- 10 files changed, 261 insertions(+), 438 deletions(-) diff --git a/theme/infographic.js b/theme/infographic.js index 13a86c3dae..be5e2565a5 100644 --- a/theme/infographic.js +++ b/theme/infographic.js @@ -76,9 +76,7 @@ toolbox: { iconStyle: { - normal: { - borderColor: colorPalette[0] - } + borderColor: colorPalette[0] } }, @@ -152,8 +150,10 @@ borderColor: '#fff', lineStyle: { width: 3 - }, - emphasis: { + } + }, + emphasis: { + itemStyle: { borderWidth: 0 } }, diff --git a/theme/macarons.js b/theme/macarons.js index d78f7e99d4..c771d5e844 100644 --- a/theme/macarons.js +++ b/theme/macarons.js @@ -82,9 +82,7 @@ toolbox: { iconStyle: { - normal: { - borderColor: colorPalette[0] - } + borderColor: colorPalette[0] } }, diff --git a/theme/macarons2.js b/theme/macarons2.js index 3fdb4b9fbc..a5d18a75a7 100644 --- a/theme/macarons2.js +++ b/theme/macarons2.js @@ -89,69 +89,66 @@ barGap: '30%', // 柱间距离,默认为柱形宽度的30%,可设固定值 barCategoryGap: '20%', // 类目间柱形距离,默认为类目间距的20%,可设固定值 itemStyle: { - normal: { - // color: '各异', - barBorderColor: '#fff', // 柱条边线 - barBorderRadius: 0, // 柱条边线圆角,单位px,默认为0 - barBorderWidth: 1, // 柱条边线线宽,单位px,默认为1 - label: { - show: false - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - }, - emphasis: { + // color: '各异', + barBorderColor: '#fff', // 柱条边线 + barBorderRadius: 0, // 柱条边线圆角,单位px,默认为0 + barBorderWidth: 1, // 柱条边线线宽,单位px,默认为1 + label: { + show: false + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 + // 'inside'|'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + } + }, + emphasis: { + itemStyle: { // color: '各异', barBorderColor: 'rgba(0,0,0,0)', // 柱条边线 barBorderRadius: 0, // 柱条边线圆角,单位px,默认为0 barBorderWidth: 1, // 柱条边线线宽,单位px,默认为1 - label: { - show: false - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } + }, + label: { + show: false + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 + // 'inside'|'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE } } }, line: { + label: { + show: false + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 + // 'inside'|'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + }, itemStyle: { - normal: { - // color: 各异, - label: { - show: false - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - lineStyle: { - width: 2, - type: 'solid', - shadowColor: 'rgba(0,0,0,0)', //默认透明 - shadowBlur: 5, - shadowOffsetX: 3, - shadowOffsetY: 3 - } - }, - emphasis: { - // color: 各异, - label: { - show: false - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } + // color: 各异, + }, + emphasis: { + // color: 各异, + label: { + show: false + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 + // 'inside'|'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE } }, + lineStyle: { + width: 2, + type: 'solid', + shadowColor: 'rgba(0,0,0,0)', //默认透明 + shadowBlur: 5, + shadowOffsetX: 3, + shadowOffsetY: 3 + }, //smooth : false, //symbol: null, // 拐点图形类型 symbolSize: 2, // 拐点图形大小 //symbolRotate : null, // 拐点图形旋转控制 showAllSymbol: false // 标志图形默认只有主轴显示(随主轴标签间隔隐藏策略) }, - candlestick: { itemStyle: { color: '#fe9778', @@ -186,15 +183,15 @@ color: '#1b1b1b', lineStyle: { color: '#1b1b1b' } // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - labelLine: { - show: true, - length: 20, - lineStyle: { - // color: 各异, - width: 1, - type: 'solid' - } + } + }, + labelLine: { + show: true, + length: 20, + lineStyle: { + // color: 各异, + width: 1, + type: 'solid' } } }, diff --git a/theme/shine.js b/theme/shine.js index e554af7683..0114f7b90b 100644 --- a/theme/shine.js +++ b/theme/shine.js @@ -67,9 +67,7 @@ toolbox: { iconStyle: { - normal: { - borderColor: '#06467c' - } + borderColor: '#06467c' } }, diff --git a/theme/tech-blue.js b/theme/tech-blue.js index e5435f0e55..db05ba6355 100644 --- a/theme/tech-blue.js +++ b/theme/tech-blue.js @@ -105,8 +105,12 @@ color: '#00aecd' }, controlStyle: { - normal: { color: '#00aecd' }, - emphasis: { color: '#00aecd' } + color: '#00aecd', + }, + emphasis: { + controlStyle: { + color: '#00aecd' + } } }, diff --git a/theme/tool/option/area.js b/theme/tool/option/area.js index 49c290b470..037db12b75 100644 --- a/theme/tool/option/area.js +++ b/theme/tool/option/area.js @@ -49,28 +49,28 @@ export default { name:'Email', type:'line', stack: '总量', - areaStyle: {normal: {}}, + areaStyle: {}, data:[120, 132, 101, 134, 90, 230, 210] }, { name:'联盟广告', type:'line', stack: '总量', - areaStyle: {normal: {}}, + areaStyle: {}, data:[220, 182, 191, 234, 290, 330, 310] }, { name:'视频广告', type:'line', stack: '总量', - areaStyle: {normal: {}}, + areaStyle: {}, data:[150, 232, 201, 154, 190, 330, 410] }, { name:'直接访问', type:'line', stack: '总量', - areaStyle: {normal: {}}, + areaStyle: {}, data:[320, 332, 301, 334, 390, 330, 320] }, { @@ -78,12 +78,10 @@ export default { type:'line', stack: '总量', label: { - normal: { - show: true, - position: 'top' - } + show: true, + position: 'top' }, - areaStyle: {normal: {}}, + areaStyle: {}, data:[820, 932, 901, 934, 1290, 1330, 1320] } ] diff --git a/theme/tool/option/bar.js b/theme/tool/option/bar.js index 8cb7a7ac3f..a97ea75852 100644 --- a/theme/tool/option/bar.js +++ b/theme/tool/option/bar.js @@ -58,10 +58,8 @@ export default { type:'bar', stack: '总量', label: { - normal: { - show: true, - position: 'insideRight' - } + show: true, + position: 'insideRight' }, data:[320, 302, 301, 334, 390, 330, 320] }, @@ -70,10 +68,8 @@ export default { type:'bar', stack: '总量', label: { - normal: { - show: true, - position: 'insideRight' - } + show: true, + position: 'insideRight' }, data:[120, 132, 101, 134, 90, 230, 210] }, @@ -82,10 +78,8 @@ export default { type:'bar', stack: '总量', label: { - normal: { - show: true, - position: 'insideRight' - } + show: true, + position: 'insideRight' }, data:[220, 182, 191, 234, 290, 330, 310] }, @@ -94,10 +88,8 @@ export default { type:'bar', stack: '总量', label: { - normal: { - show: true, - position: 'insideRight' - } + show: true, + position: 'insideRight' }, data:[150, 212, 201, 154, 190, 330, 410] }, @@ -106,12 +98,10 @@ export default { type:'bar', stack: '总量', label: { - normal: { - show: true, - position: 'insideRight' - } + show: true, + position: 'insideRight' }, data:[820, 832, 901, 934, 1290, 1330, 1320] } ] -}; \ No newline at end of file +}; diff --git a/theme/tool/option/graph.js b/theme/tool/option/graph.js index c10878ca22..1b714c3da4 100644 --- a/theme/tool/option/graph.js +++ b/theme/tool/option/graph.js @@ -28,10 +28,8 @@ export default { "id":"0", "name":"Myriel", "label":{ - "normal":{ - "formatter":"Myriel", - "show":false - } + "formatter":"Myriel", + "show":false }, "symbolSize":28.685715, "x":-266.82776, @@ -46,10 +44,8 @@ export default { "id":"1", "name":"Napoleon", "label":{ - "normal":{ - "formatter":"Napoleon", - "show":false - } + "formatter":"Napoleon", + "show":false }, "symbolSize":4, "x":-418.08344, @@ -64,10 +60,8 @@ export default { "id":"2", "name":"MlleBaptistine", "label":{ - "normal":{ - "formatter":"MlleBaptistine", - "show":false - } + "formatter":"MlleBaptistine", + "show":false }, "symbolSize":9.485714, "x":-212.76357, @@ -82,10 +76,8 @@ export default { "id":"3", "name":"MmeMagloire", "label":{ - "normal":{ - "formatter":"MmeMagloire", - "show":false - } + "formatter":"MmeMagloire", + "show":false }, "symbolSize":9.485714, "x":-242.82404, @@ -100,10 +92,8 @@ export default { "id":"4", "name":"CountessDeLo", "label":{ - "normal":{ - "formatter":"CountessDeLo", - "show":false - } + "formatter":"CountessDeLo", + "show":false }, "symbolSize":4, "x":-379.30386, @@ -118,10 +108,8 @@ export default { "id":"5", "name":"Geborand", "label":{ - "normal":{ - "formatter":"Geborand", - "show":false - } + "formatter":"Geborand", + "show":false }, "symbolSize":4, "x":-417.26337, @@ -136,10 +124,8 @@ export default { "id":"6", "name":"Champtercier", "label":{ - "normal":{ - "formatter":"Champtercier", - "show":false - } + "formatter":"Champtercier", + "show":false }, "symbolSize":4, "x":-332.6012, @@ -154,10 +140,8 @@ export default { "id":"7", "name":"Cravatte", "label":{ - "normal":{ - "formatter":"Cravatte", - "show":false - } + "formatter":"Cravatte", + "show":false }, "symbolSize":4, "x":-382.69568, @@ -172,10 +156,8 @@ export default { "id":"8", "name":"Count", "label":{ - "normal":{ - "formatter":"Count", - "show":false - } + "formatter":"Count", + "show":false }, "symbolSize":4, "x":-320.384, @@ -190,10 +172,8 @@ export default { "id":"9", "name":"OldMan", "label":{ - "normal":{ - "formatter":"OldMan", - "show":false - } + "formatter":"OldMan", + "show":false }, "symbolSize":4, "x":-344.39832, @@ -208,10 +188,8 @@ export default { "id":"10", "name":"Labarre", "label":{ - "normal":{ - "formatter":"Labarre", - "show":false - } + "formatter":"Labarre", + "show":false }, "symbolSize":4, "x":-89.34107, @@ -226,10 +204,8 @@ export default { "id":"11", "name":"Valjean", "label":{ - "normal":{ - "formatter":"Valjean", - "show": false - } + "formatter":"Valjean", + "show": false }, "symbolSize":100, "x":-87.93029, @@ -244,10 +220,8 @@ export default { "id":"12", "name":"Marguerite", "label":{ - "normal":{ - "formatter":"Marguerite", - "show":false - } + "formatter":"Marguerite", + "show":false }, "symbolSize":6.742859, "x":-339.77908, @@ -262,10 +236,8 @@ export default { "id":"13", "name":"MmeDeR", "label":{ - "normal":{ - "formatter":"MmeDeR", - "show":false - } + "formatter":"MmeDeR", + "show":false }, "symbolSize":4, "x":-194.31313, @@ -280,10 +252,8 @@ export default { "id":"14", "name":"Isabeau", "label":{ - "normal":{ - "formatter":"Isabeau", - "show":false - } + "formatter":"Isabeau", + "show":false }, "symbolSize":4, "x":-158.05168, @@ -298,10 +268,8 @@ export default { "id":"15", "name":"Gervais", "label":{ - "normal":{ - "formatter":"Gervais", - "show":false - } + "formatter":"Gervais", + "show":false }, "symbolSize":4, "x":-127.701546, @@ -316,10 +284,8 @@ export default { "id":"16", "name":"Tholomyes", "label":{ - "normal":{ - "formatter":"Tholomyes", - "show":false - } + "formatter":"Tholomyes", + "show":false }, "symbolSize":25.942856, "x":-385.2226, @@ -334,10 +300,8 @@ export default { "id":"17", "name":"Listolier", "label":{ - "normal":{ - "formatter":"Listolier", - "show":false - } + "formatter":"Listolier", + "show":false }, "symbolSize":20.457146, "x":-516.55884, @@ -352,10 +316,8 @@ export default { "id":"18", "name":"Fameuil", "label":{ - "normal":{ - "formatter":"Fameuil", - "show":false - } + "formatter":"Fameuil", + "show":false }, "symbolSize":20.457146, "x":-464.79382, @@ -370,10 +332,8 @@ export default { "id":"19", "name":"Blacheville", "label":{ - "normal":{ - "formatter":"Blacheville", - "show":false - } + "formatter":"Blacheville", + "show":false }, "symbolSize":20.457146, "x":-515.1624, @@ -388,10 +348,8 @@ export default { "id":"20", "name":"Favourite", "label":{ - "normal":{ - "formatter":"Favourite", - "show":false - } + "formatter":"Favourite", + "show":false }, "symbolSize":20.457146, "x":-408.12122, @@ -406,10 +364,8 @@ export default { "id":"21", "name":"Dahlia", "label":{ - "normal":{ - "formatter":"Dahlia", - "show":false - } + "formatter":"Dahlia", + "show":false }, "symbolSize":20.457146, "x":-456.44113, @@ -424,10 +380,8 @@ export default { "id":"22", "name":"Zephine", "label":{ - "normal":{ - "formatter":"Zephine", - "show":false - } + "formatter":"Zephine", + "show":false }, "symbolSize":20.457146, "x":-459.1107, @@ -442,10 +396,8 @@ export default { "id":"23", "name":"Fantine", "label":{ - "normal":{ - "formatter":"Fantine", - "show": false - } + "formatter":"Fantine", + "show": false }, "symbolSize":42.4, "x":-313.42786, @@ -460,10 +412,8 @@ export default { "id":"24", "name":"MmeThenardier", "label":{ - "normal":{ - "formatter":"MmeThenardier", - "show": false - } + "formatter":"MmeThenardier", + "show": false }, "symbolSize":31.428574, "x":4.6313396, @@ -478,10 +428,8 @@ export default { "id":"25", "name":"Thenardier", "label":{ - "normal":{ - "formatter":"Thenardier", - "show": false - } + "formatter":"Thenardier", + "show": false }, "symbolSize":45.142853, "x":82.80825, @@ -496,10 +444,8 @@ export default { "id":"26", "name":"Cosette", "label":{ - "normal":{ - "formatter":"Cosette", - "show": false - } + "formatter":"Cosette", + "show": false }, "symbolSize":31.428574, "x":78.64646, @@ -514,10 +460,8 @@ export default { "id":"27", "name":"Javert", "label":{ - "normal":{ - "formatter":"Javert", - "show": false - } + "formatter":"Javert", + "show": false }, "symbolSize":47.88571, "x":-81.46074, @@ -532,10 +476,8 @@ export default { "id":"28", "name":"Fauchelevent", "label":{ - "normal":{ - "formatter":"Fauchelevent", - "show":false - } + "formatter":"Fauchelevent", + "show":false }, "symbolSize":12.228573, "x":-225.73984, @@ -550,10 +492,8 @@ export default { "id":"29", "name":"Bamatabois", "label":{ - "normal":{ - "formatter":"Bamatabois", - "show":false - } + "formatter":"Bamatabois", + "show":false }, "symbolSize":23.2, "x":-385.6842, @@ -568,10 +508,8 @@ export default { "id":"30", "name":"Perpetue", "label":{ - "normal":{ - "formatter":"Perpetue", - "show":false - } + "formatter":"Perpetue", + "show":false }, "symbolSize":6.742859, "x":-403.92447, @@ -586,10 +524,8 @@ export default { "id":"31", "name":"Simplice", "label":{ - "normal":{ - "formatter":"Simplice", - "show":false - } + "formatter":"Simplice", + "show":false }, "symbolSize":12.228573, "x":-281.4253, @@ -604,10 +540,8 @@ export default { "id":"32", "name":"Scaufflaire", "label":{ - "normal":{ - "formatter":"Scaufflaire", - "show":false - } + "formatter":"Scaufflaire", + "show":false }, "symbolSize":4, "x":-122.41348, @@ -622,10 +556,8 @@ export default { "id":"33", "name":"Woman1", "label":{ - "normal":{ - "formatter":"Woman1", - "show":false - } + "formatter":"Woman1", + "show":false }, "symbolSize":6.742859, "x":-234.6001, @@ -640,10 +572,8 @@ export default { "id":"34", "name":"Judge", "label":{ - "normal":{ - "formatter":"Judge", - "show":false - } + "formatter":"Judge", + "show":false }, "symbolSize":17.714287, "x":-387.84915, @@ -658,10 +588,8 @@ export default { "id":"35", "name":"Champmathieu", "label":{ - "normal":{ - "formatter":"Champmathieu", - "show":false - } + "formatter":"Champmathieu", + "show":false }, "symbolSize":17.714287, "x":-338.2307, @@ -676,10 +604,8 @@ export default { "id":"36", "name":"Brevet", "label":{ - "normal":{ - "formatter":"Brevet", - "show":false - } + "formatter":"Brevet", + "show":false }, "symbolSize":17.714287, "x":-453.26874, @@ -694,10 +620,8 @@ export default { "id":"37", "name":"Chenildieu", "label":{ - "normal":{ - "formatter":"Chenildieu", - "show":false - } + "formatter":"Chenildieu", + "show":false }, "symbolSize":17.714287, "x":-386.44904, @@ -712,10 +636,8 @@ export default { "id":"38", "name":"Cochepaille", "label":{ - "normal":{ - "formatter":"Cochepaille", - "show":false - } + "formatter":"Cochepaille", + "show":false }, "symbolSize":17.714287, "x":-446.7876, @@ -730,10 +652,8 @@ export default { "id":"39", "name":"Pontmercy", "label":{ - "normal":{ - "formatter":"Pontmercy", - "show":false - } + "formatter":"Pontmercy", + "show":false }, "symbolSize":9.485714, "x":336.49738, @@ -748,10 +668,8 @@ export default { "id":"40", "name":"Boulatruelle", "label":{ - "normal":{ - "formatter":"Boulatruelle", - "show":false - } + "formatter":"Boulatruelle", + "show":false }, "symbolSize":4, "x":29.187843, @@ -766,10 +684,8 @@ export default { "id":"41", "name":"Eponine", "label":{ - "normal":{ - "formatter":"Eponine", - "show": false - } + "formatter":"Eponine", + "show": false }, "symbolSize":31.428574, "x":238.36697, @@ -784,10 +700,8 @@ export default { "id":"42", "name":"Anzelma", "label":{ - "normal":{ - "formatter":"Anzelma", - "show":false - } + "formatter":"Anzelma", + "show":false }, "symbolSize":9.485714, "x":189.69513, @@ -802,10 +716,8 @@ export default { "id":"43", "name":"Woman2", "label":{ - "normal":{ - "formatter":"Woman2", - "show":false - } + "formatter":"Woman2", + "show":false }, "symbolSize":9.485714, "x":-187.00418, @@ -820,10 +732,8 @@ export default { "id":"44", "name":"MotherInnocent", "label":{ - "normal":{ - "formatter":"MotherInnocent", - "show":false - } + "formatter":"MotherInnocent", + "show":false }, "symbolSize":6.742859, "x":-252.99521, @@ -838,10 +748,8 @@ export default { "id":"45", "name":"Gribier", "label":{ - "normal":{ - "formatter":"Gribier", - "show":false - } + "formatter":"Gribier", + "show":false }, "symbolSize":4, "x":-296.07935, @@ -856,10 +764,8 @@ export default { "id":"46", "name":"Jondrette", "label":{ - "normal":{ - "formatter":"Jondrette", - "show":false - } + "formatter":"Jondrette", + "show":false }, "symbolSize":4, "x":550.3201, @@ -874,10 +780,8 @@ export default { "id":"47", "name":"MmeBurgon", "label":{ - "normal":{ - "formatter":"MmeBurgon", - "show":false - } + "formatter":"MmeBurgon", + "show":false }, "symbolSize":6.742859, "x":488.13535, @@ -892,10 +796,8 @@ export default { "id":"48", "name":"Gavroche", "label":{ - "normal":{ - "formatter":"Gavroche", - "show": false - } + "formatter":"Gavroche", + "show": false }, "symbolSize":61.600006, "x":387.89572, @@ -910,10 +812,8 @@ export default { "id":"49", "name":"Gillenormand", "label":{ - "normal":{ - "formatter":"Gillenormand", - "show":false - } + "formatter":"Gillenormand", + "show":false }, "symbolSize":20.457146, "x":126.4831, @@ -928,10 +828,8 @@ export default { "id":"50", "name":"Magnon", "label":{ - "normal":{ - "formatter":"Magnon", - "show":false - } + "formatter":"Magnon", + "show":false }, "symbolSize":6.742859, "x":127.07365, @@ -946,10 +844,8 @@ export default { "id":"51", "name":"MlleGillenormand", "label":{ - "normal":{ - "formatter":"MlleGillenormand", - "show":false - } + "formatter":"MlleGillenormand", + "show":false }, "symbolSize":20.457146, "x":162.63559, @@ -964,10 +860,8 @@ export default { "id":"52", "name":"MmePontmercy", "label":{ - "normal":{ - "formatter":"MmePontmercy", - "show":false - } + "formatter":"MmePontmercy", + "show":false }, "symbolSize":6.742859, "x":353.66415, @@ -982,10 +876,8 @@ export default { "id":"53", "name":"MlleVaubois", "label":{ - "normal":{ - "formatter":"MlleVaubois", - "show":false - } + "formatter":"MlleVaubois", + "show":false }, "symbolSize":4, "x":165.43939, @@ -1000,10 +892,8 @@ export default { "id":"54", "name":"LtGillenormand", "label":{ - "normal":{ - "formatter":"LtGillenormand", - "show":false - } + "formatter":"LtGillenormand", + "show":false }, "symbolSize":12.228573, "x":137.69348, @@ -1018,10 +908,8 @@ export default { "id":"55", "name":"Marius", "label":{ - "normal":{ - "formatter":"Marius", - "show": false - } + "formatter":"Marius", + "show": false }, "symbolSize":53.37143, "x":206.44687, @@ -1036,10 +924,8 @@ export default { "id":"56", "name":"BaronessT", "label":{ - "normal":{ - "formatter":"BaronessT", - "show":false - } + "formatter":"BaronessT", + "show":false }, "symbolSize":6.742859, "x":194.82993, @@ -1054,10 +940,8 @@ export default { "id":"57", "name":"Mabeuf", "label":{ - "normal":{ - "formatter":"Mabeuf", - "show": false - } + "formatter":"Mabeuf", + "show": false }, "symbolSize":31.428574, "x":597.6618, @@ -1072,10 +956,8 @@ export default { "id":"58", "name":"Enjolras", "label":{ - "normal":{ - "formatter":"Enjolras", - "show": false - } + "formatter":"Enjolras", + "show": false }, "symbolSize":42.4, "x":355.78366, @@ -1090,10 +972,8 @@ export default { "id":"59", "name":"Combeferre", "label":{ - "normal":{ - "formatter":"Combeferre", - "show": false - } + "formatter":"Combeferre", + "show": false }, "symbolSize":31.428574, "x":515.2961, @@ -1108,10 +988,8 @@ export default { "id":"60", "name":"Prouvaire", "label":{ - "normal":{ - "formatter":"Prouvaire", - "show":false - } + "formatter":"Prouvaire", + "show":false }, "symbolSize":25.942856, "x":614.29285, @@ -1126,10 +1004,8 @@ export default { "id":"61", "name":"Feuilly", "label":{ - "normal":{ - "formatter":"Feuilly", - "show": false - } + "formatter":"Feuilly", + "show": false }, "symbolSize":31.428574, "x":550.1917, @@ -1144,10 +1020,8 @@ export default { "id":"62", "name":"Courfeyrac", "label":{ - "normal":{ - "formatter":"Courfeyrac", - "show": false - } + "formatter":"Courfeyrac", + "show": false }, "symbolSize":36.91429, "x":436.17184, @@ -1162,10 +1036,8 @@ export default { "id":"63", "name":"Bahorel", "label":{ - "normal":{ - "formatter":"Bahorel", - "show": false - } + "formatter":"Bahorel", + "show": false }, "symbolSize":34.17143, "x":602.55225, @@ -1180,10 +1052,8 @@ export default { "id":"64", "name":"Bossuet", "label":{ - "normal":{ - "formatter":"Bossuet", - "show": false - } + "formatter":"Bossuet", + "show": false }, "symbolSize":36.91429, "x":455.81955, @@ -1198,10 +1068,8 @@ export default { "id":"65", "name":"Joly", "label":{ - "normal":{ - "formatter":"Joly", - "show": false - } + "formatter":"Joly", + "show": false }, "symbolSize":34.17143, "x":516.40784, @@ -1216,10 +1084,8 @@ export default { "id":"66", "name":"Grantaire", "label":{ - "normal":{ - "formatter":"Grantaire", - "show":false - } + "formatter":"Grantaire", + "show":false }, "symbolSize":28.685715, "x":646.4313, @@ -1234,10 +1100,8 @@ export default { "id":"67", "name":"MotherPlutarch", "label":{ - "normal":{ - "formatter":"MotherPlutarch", - "show":false - } + "formatter":"MotherPlutarch", + "show":false }, "symbolSize":4, "x":668.9568, @@ -1252,10 +1116,8 @@ export default { "id":"68", "name":"Gueulemer", "label":{ - "normal":{ - "formatter":"Gueulemer", - "show":false - } + "formatter":"Gueulemer", + "show":false }, "symbolSize":28.685715, "x":78.4799, @@ -1270,10 +1132,8 @@ export default { "id":"69", "name":"Babet", "label":{ - "normal":{ - "formatter":"Babet", - "show":false - } + "formatter":"Babet", + "show":false }, "symbolSize":28.685715, "x":150.35959, @@ -1288,10 +1148,8 @@ export default { "id":"70", "name":"Claquesous", "label":{ - "normal":{ - "formatter":"Claquesous", - "show":false - } + "formatter":"Claquesous", + "show":false }, "symbolSize":28.685715, "x":137.3717, @@ -1306,10 +1164,8 @@ export default { "id":"71", "name":"Montparnasse", "label":{ - "normal":{ - "formatter":"Montparnasse", - "show":false - } + "formatter":"Montparnasse", + "show":false }, "symbolSize":25.942856, "x":234.87747, @@ -1324,10 +1180,8 @@ export default { "id":"72", "name":"Toussaint", "label":{ - "normal":{ - "formatter":"Toussaint", - "show":false - } + "formatter":"Toussaint", + "show":false }, "symbolSize":9.485714, "x":40.942253, @@ -1342,10 +1196,8 @@ export default { "id":"73", "name":"Child1", "label":{ - "normal":{ - "formatter":"Child1", - "show":false - } + "formatter":"Child1", + "show":false }, "symbolSize":6.742859, "x":437.939, @@ -1360,10 +1212,8 @@ export default { "id":"74", "name":"Child2", "label":{ - "normal":{ - "formatter":"Child2", - "show":false - } + "formatter":"Child2", + "show":false }, "symbolSize":6.742859, "x":466.04922, @@ -1378,10 +1228,8 @@ export default { "id":"75", "name":"Brujon", "label":{ - "normal":{ - "formatter":"Brujon", - "show":false - } + "formatter":"Brujon", + "show":false }, "symbolSize":20.457146, "x":238.79364, @@ -1396,10 +1244,8 @@ export default { "id":"76", "name":"MmeHucheloup", "label":{ - "normal":{ - "formatter":"MmeHucheloup", - "show":false - } + "formatter":"MmeHucheloup", + "show":false }, "symbolSize":20.457146, "x":712.18353, @@ -2968,15 +2814,11 @@ export default { ], "roam":true, "label":{ - "normal":{ - "position":"right" - } + "position":"right" }, "lineStyle":{ - "normal":{ - "curveness":0.3 - } + "curveness":0.3 } } ] -}; \ No newline at end of file +}; diff --git a/theme/tool/option/map.js b/theme/tool/option/map.js index 1cd4f4d963..3b0ce19c81 100644 --- a/theme/tool/option/map.js +++ b/theme/tool/option/map.js @@ -35,11 +35,11 @@ export default { map: 'china', showLegendSymbol: true, label: { - normal: { - show: false - }, - emphasis: { - show: false + show: false, + }, + emphasis: { + label: { + show: false, } }, data:[ @@ -85,10 +85,10 @@ export default { mapType: 'china', showLegendSymbol: true, label: { - normal: { - show: false - }, - emphasis: { + show: false, + }, + emphasis: { + label: { show: false } }, @@ -120,10 +120,10 @@ export default { mapType: 'china', showLegendSymbol: true, label: { - normal: { - show: false - }, - emphasis: { + show: false, + }, + emphasis: { + label: { show: false } }, @@ -138,4 +138,4 @@ export default { ] } ] -}; \ No newline at end of file +}; diff --git a/theme/tool/option/pie.js b/theme/tool/option/pie.js index c88e11ee76..1170ab1097 100644 --- a/theme/tool/option/pie.js +++ b/theme/tool/option/pie.js @@ -29,18 +29,16 @@ export default { radius : [20, 80], center : ['25%', 110], label: { - normal: { - show: false - }, - emphasis: { - show: true - } + show: false, }, lableLine: { - normal: { - show: false + show: false, + }, + emphasis: { + label: { + show: true }, - emphasis: { + lableLine: { show: true } }, @@ -62,9 +60,7 @@ export default { center : ['75%', 110], roseType : 'area', labelLine: { - normal: { - length: 5 - } + length: 5 }, data:[ {value:10, name:'rose1'}, From c1c9faf2691ff94231e8019f375ac8c210b2b5e8 Mon Sep 17 00:00:00 2001 From: Ovilia Date: Mon, 8 Aug 2022 18:40:22 +0800 Subject: [PATCH 76/86] fix(coarse-pointer): use retrieve --- src/core/echarts.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/echarts.ts b/src/core/echarts.ts index 6d7c398579..054402bd83 100644 --- a/src/core/echarts.ts +++ b/src/core/echarts.ts @@ -34,7 +34,8 @@ import { isDom, isArray, noop, - isString + isString, + retrieve2 } from 'zrender/src/core/util'; import env from 'zrender/src/core/env'; import timsort from 'zrender/src/core/timsort'; @@ -435,8 +436,8 @@ class ECharts extends Eventful { width: opts.width, height: opts.height, ssr: opts.ssr, - useDirtyRect: opts.useDirtyRect == null ? defaultUseDirtyRect : opts.useDirtyRect, - useCoarsePointer: opts.useCoarsePointer == null ? defaultCoarsePointer : opts.useCoarsePointer, + useDirtyRect: retrieve2(opts.useDirtyRect, defaultUseDirtyRect), + useCoarsePointer: retrieve2(opts.useCoarsePointer, defaultCoarsePointer), pointerSize: opts.pointerSize }); this._ssr = opts.ssr; From 1e7f3b8750fcb977c1dd2d7dc8d198a70deaadd8 Mon Sep 17 00:00:00 2001 From: liangism Date: Tue, 9 Aug 2022 10:02:00 +0800 Subject: [PATCH 77/86] fix(theme): move the label block to the outside. --- theme/macarons2.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/theme/macarons2.js b/theme/macarons2.js index a5d18a75a7..59cdddb6cc 100644 --- a/theme/macarons2.js +++ b/theme/macarons2.js @@ -88,17 +88,17 @@ // barWidth: null, // 默认自适应 barGap: '30%', // 柱间距离,默认为柱形宽度的30%,可设固定值 barCategoryGap: '20%', // 类目间柱形距离,默认为类目间距的20%,可设固定值 + label: { + show: false + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 + // 'inside'|'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + }, itemStyle: { // color: '各异', barBorderColor: '#fff', // 柱条边线 barBorderRadius: 0, // 柱条边线圆角,单位px,默认为0 - barBorderWidth: 1, // 柱条边线线宽,单位px,默认为1 - label: { - show: false - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } + barBorderWidth: 1 // 柱条边线线宽,单位px,默认为1 }, emphasis: { itemStyle: { @@ -173,17 +173,17 @@ startAngle: 90, minAngle: 0, // 最小角度改为0 selectedOffset: 10, // 选中是扇区偏移量 + label: { + show: true, + position: 'outer', + color: '#1b1b1b', + lineStyle: { color: '#1b1b1b' } + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + }, itemStyle: { // color: 各异, borderColor: '#fff', - borderWidth: 1, - label: { - show: true, - position: 'outer', - color: '#1b1b1b', - lineStyle: { color: '#1b1b1b' } - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } + borderWidth: 1 }, labelLine: { show: true, From 1a1575494e7526142de5f56022175d86e264dc09 Mon Sep 17 00:00:00 2001 From: Ovilia Date: Mon, 15 Aug 2022 18:33:40 +0800 Subject: [PATCH 78/86] fix(subpixel): set animation with subpixel optimization --- src/component/axis/AxisBuilder.ts | 5 ++-- src/component/axis/CartesianAxisView.ts | 19 +++++++------- src/component/axis/ParallelAxisView.ts | 4 +-- src/component/axis/RadiusAxisView.ts | 4 +-- src/component/axis/SingleAxisView.ts | 18 +++++++------ src/util/graphic.ts | 34 +++++++++++++++---------- 6 files changed, 45 insertions(+), 39 deletions(-) diff --git a/src/component/axis/AxisBuilder.ts b/src/component/axis/AxisBuilder.ts index 5a8f22d4f2..2ce2b43230 100644 --- a/src/component/axis/AxisBuilder.ts +++ b/src/component/axis/AxisBuilder.ts @@ -269,8 +269,6 @@ const builders: Record<'axisLine' | 'axisTickLabel' | 'axisName', AxisElementsBu ); const line = new graphic.Line({ - // Id for animation - subPixelOptimize: false, shape: { x1: pt1[0], y1: pt1[1], @@ -282,6 +280,7 @@ const builders: Record<'axisLine' | 'axisTickLabel' | 'axisName', AxisElementsBu silent: true, z2: 1 }); + graphic.setSubPixelOptimizeLine(line); line.anid = 'line'; group.add(line); @@ -629,7 +628,6 @@ function createTicks( } // Tick line, Not use group transform to have better line draw const tickEl = new graphic.Line({ - subPixelOptimize: false, shape: { x1: pt1[0], y1: pt1[1], @@ -641,6 +639,7 @@ function createTicks( autoBatch: true, silent: true }); + graphic.setSubPixelOptimizeLine(tickEl); tickEl.anid = anidPrefix + '_' + ticksCoords[i].tickValue; tickEls.push(tickEl); } diff --git a/src/component/axis/CartesianAxisView.ts b/src/component/axis/CartesianAxisView.ts index a0f61d9357..57a6b0da49 100644 --- a/src/component/axis/CartesianAxisView.ts +++ b/src/component/axis/CartesianAxisView.ts @@ -66,6 +66,7 @@ class CartesianAxisView extends AxisView { const layout = cartesianAxisHelper.layout(gridModel, axisModel); + const axisBuilder = new AxisBuilder(axisModel, zrUtil.extend({ handleAutoShown(elementType) { const cartesians = gridModel.coordinateSystem.getCartesians(); @@ -96,9 +97,7 @@ class CartesianAxisView extends AxisView { const isInitialSortFromBarRacing = payload && payload.type === 'changeAxisOrder' && payload.isInitSort; if (!isInitialSortFromBarRacing) { - graphic.groupTransition(oldAxisGroup, this._axisGroup, axisModel, () => { - graphic.setGroupSubPixelOptimize(this._axisGroup, true); - }); + graphic.groupTransition(oldAxisGroup, this._axisGroup, axisModel); } super.render(axisModel, ecModel, api, payload); @@ -160,9 +159,8 @@ const axisElementBuilders: Record { - graphic.setGroupSubPixelOptimize(this._axisGroup, true); - }); + graphic.groupTransition(oldAxisGroup, this._axisGroup, axisModel); } // /** diff --git a/src/component/axis/RadiusAxisView.ts b/src/component/axis/RadiusAxisView.ts index 9be110100c..b09dd50603 100644 --- a/src/component/axis/RadiusAxisView.ts +++ b/src/component/axis/RadiusAxisView.ts @@ -67,9 +67,7 @@ class RadiusAxisView extends AxisView { zrUtil.each(axisBuilderAttrs, axisBuilder.add, axisBuilder); newAxisGroup.add(axisBuilder.getGroup()); - graphic.groupTransition(oldAxisGroup, newAxisGroup, radiusAxisModel, () => { - graphic.setGroupSubPixelOptimize(this._axisGroup, true); - }); + graphic.groupTransition(oldAxisGroup, newAxisGroup, radiusAxisModel); zrUtil.each(selfBuilderAttrs, function (name) { if (radiusAxisModel.get([name, 'show']) && !radiusAxis.scale.isBlank()) { diff --git a/src/component/axis/SingleAxisView.ts b/src/component/axis/SingleAxisView.ts index 3fa6b71f83..15b32b12fa 100644 --- a/src/component/axis/SingleAxisView.ts +++ b/src/component/axis/SingleAxisView.ts @@ -67,9 +67,7 @@ class SingleAxisView extends AxisView { } }, this); - graphic.groupTransition(oldAxisGroup, this._axisGroup, axisModel, () => { - graphic.setGroupSubPixelOptimize(this._axisGroup, true); - }); + graphic.groupTransition(oldAxisGroup, this._axisGroup, axisModel); super.render(axisModel, ecModel, api, payload); } @@ -95,8 +93,8 @@ const axisElementBuilders: Record { - if (el.type === 'line') { - (el as Line).attr('subPixelOptimize', useSubPixelOptimize); +/** + * Set the line with the optimized shape. + * + * @param line the line shape to set + * @param lineWidth the line width, if not given, line.style.lineWidth is used + */ + export function setSubPixelOptimizeLine(line: Line, lineWidth?: number) { + const lineSubpixelParams = subPixelOptimizeLine({ + shape: line.shape, + style: { + lineWidth: retrieve2(lineWidth, line.style.lineWidth) } }); + const lineShape = line.shape; + const subPixelShape = lineSubpixelParams.shape; + lineShape.x1 = subPixelShape.x1; + lineShape.y1 = subPixelShape.y1; + lineShape.x2 = subPixelShape.x2; + lineShape.y2 = subPixelShape.y2; } /** @@ -399,13 +413,9 @@ function isPath(el: Displayable): el is Path { export function groupTransition( g1: Group, g2: Group, - animatableModel: Model, - done?: () => void + animatableModel: Model ) { if (!g1 || !g2) { - if (typeof done === 'function') { - done(); - } return; } @@ -431,15 +441,13 @@ export function groupTransition( } const elMap1 = getElMap(g1); - let isFirstElement = true; g2.traverse(function (el) { if (isNotGroup(el) && el.anid) { const oldEl = elMap1[el.anid]; if (oldEl) { const newProp = getAnimatableProps(el); el.attr(getAnimatableProps(oldEl)); - updateProps(el, newProp, animatableModel, getECData(el).dataIndex, isFirstElement ? done : null); - isFirstElement = false; + updateProps(el, newProp, animatableModel, getECData(el).dataIndex); } } }); From 3c4179cd6a66684b36be0630f3258d3b527aa8ea Mon Sep 17 00:00:00 2001 From: Ovilia Date: Tue, 16 Aug 2022 09:59:00 +0800 Subject: [PATCH 79/86] fix(subpixel): remove function --- src/component/axis/AxisBuilder.ts | 36 +++++++++++++++---------- src/component/axis/CartesianAxisView.ts | 36 +++++++++++++++---------- src/component/axis/SingleAxisView.ts | 19 +++++++------ src/util/graphic.ts | 21 --------------- 4 files changed, 55 insertions(+), 57 deletions(-) diff --git a/src/component/axis/AxisBuilder.ts b/src/component/axis/AxisBuilder.ts index 2ce2b43230..14165fb483 100644 --- a/src/component/axis/AxisBuilder.ts +++ b/src/component/axis/AxisBuilder.ts @@ -269,18 +269,22 @@ const builders: Record<'axisLine' | 'axisTickLabel' | 'axisName', AxisElementsBu ); const line = new graphic.Line({ - shape: { - x1: pt1[0], - y1: pt1[1], - x2: pt2[0], - y2: pt2[1] - }, + shape: graphic.subPixelOptimizeLine({ + shape: { + x1: pt1[0], + y1: pt1[1], + x2: pt2[0], + y2: pt2[1] + }, + style: { + lineWidth: lineStyle.lineWidth + } + }).shape, style: lineStyle, strokeContainThreshold: opt.strokeContainThreshold || 5, silent: true, z2: 1 }); - graphic.setSubPixelOptimizeLine(line); line.anid = 'line'; group.add(line); @@ -628,18 +632,22 @@ function createTicks( } // Tick line, Not use group transform to have better line draw const tickEl = new graphic.Line({ - shape: { - x1: pt1[0], - y1: pt1[1], - x2: pt2[0], - y2: pt2[1] - }, + shape: graphic.subPixelOptimizeLine({ + shape: { + x1: pt1[0], + y1: pt1[1], + x2: pt2[0], + y2: pt2[1] + }, + style: { + lineWidth: tickLineStyle.lineWidth + } + }).shape, style: tickLineStyle, z2: 2, autoBatch: true, silent: true }); - graphic.setSubPixelOptimizeLine(tickEl); tickEl.anid = anidPrefix + '_' + ticksCoords[i].tickValue; tickEls.push(tickEl); } diff --git a/src/component/axis/CartesianAxisView.ts b/src/component/axis/CartesianAxisView.ts index 57a6b0da49..6f362c1dd5 100644 --- a/src/component/axis/CartesianAxisView.ts +++ b/src/component/axis/CartesianAxisView.ts @@ -162,18 +162,22 @@ const axisElementBuilders: Record Date: Tue, 16 Aug 2022 17:50:00 +0800 Subject: [PATCH 80/86] fix(subpixel): refactor --- src/component/axis/CartesianAxisView.ts | 12 ++++-------- src/util/graphic.ts | 3 +-- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/component/axis/CartesianAxisView.ts b/src/component/axis/CartesianAxisView.ts index 6f362c1dd5..69c8fcf2e4 100644 --- a/src/component/axis/CartesianAxisView.ts +++ b/src/component/axis/CartesianAxisView.ts @@ -66,7 +66,6 @@ class CartesianAxisView extends AxisView { const layout = cartesianAxisHelper.layout(gridModel, axisModel); - const axisBuilder = new AxisBuilder(axisModel, zrUtil.extend({ handleAutoShown(elementType) { const cartesians = gridModel.coordinateSystem.getCartesians(); @@ -140,7 +139,6 @@ const axisElementBuilders: Record Date: Tue, 16 Aug 2022 18:40:48 +0800 Subject: [PATCH 81/86] fix(subpixel): refactor subPixelOptimizeLine --- src/component/axis/AxisBuilder.ts | 21 +++++------ src/component/axis/CartesianAxisView.ts | 46 +++++++++++-------------- src/component/axis/SingleAxisView.ts | 18 ++++------ src/util/graphic.ts | 12 +++---- 4 files changed, 41 insertions(+), 56 deletions(-) diff --git a/src/component/axis/AxisBuilder.ts b/src/component/axis/AxisBuilder.ts index 14165fb483..d32fcb71f8 100644 --- a/src/component/axis/AxisBuilder.ts +++ b/src/component/axis/AxisBuilder.ts @@ -269,22 +269,18 @@ const builders: Record<'axisLine' | 'axisTickLabel' | 'axisName', AxisElementsBu ); const line = new graphic.Line({ - shape: graphic.subPixelOptimizeLine({ - shape: { - x1: pt1[0], - y1: pt1[1], - x2: pt2[0], - y2: pt2[1] - }, - style: { - lineWidth: lineStyle.lineWidth - } - }).shape, + shape: { + x1: pt1[0], + y1: pt1[1], + x2: pt2[0], + y2: pt2[1] + }, style: lineStyle, strokeContainThreshold: opt.strokeContainThreshold || 5, silent: true, z2: 1 }); + graphic.subPixelOptimizeLine(line.shape, line.style.lineWidth); line.anid = 'line'; group.add(line); @@ -632,7 +628,7 @@ function createTicks( } // Tick line, Not use group transform to have better line draw const tickEl = new graphic.Line({ - shape: graphic.subPixelOptimizeLine({ + shape: new graphic.Line({ shape: { x1: pt1[0], y1: pt1[1], @@ -648,6 +644,7 @@ function createTicks( autoBatch: true, silent: true }); + graphic.subPixelOptimizeLine(tickEl.shape, tickEl.style.lineWidth); tickEl.anid = anidPrefix + '_' + ticksCoords[i].tickValue; tickEls.push(tickEl); } diff --git a/src/component/axis/CartesianAxisView.ts b/src/component/axis/CartesianAxisView.ts index 69c8fcf2e4..3cc48e3041 100644 --- a/src/component/axis/CartesianAxisView.ts +++ b/src/component/axis/CartesianAxisView.ts @@ -157,25 +157,22 @@ const axisElementBuilders: Record Date: Wed, 17 Aug 2022 12:10:51 +0800 Subject: [PATCH 82/86] fix(subpixel): remove an unexpected change --- src/component/axis/AxisBuilder.ts | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/component/axis/AxisBuilder.ts b/src/component/axis/AxisBuilder.ts index d32fcb71f8..d01d20d660 100644 --- a/src/component/axis/AxisBuilder.ts +++ b/src/component/axis/AxisBuilder.ts @@ -628,17 +628,12 @@ function createTicks( } // Tick line, Not use group transform to have better line draw const tickEl = new graphic.Line({ - shape: new graphic.Line({ - shape: { - x1: pt1[0], - y1: pt1[1], - x2: pt2[0], - y2: pt2[1] - }, - style: { - lineWidth: tickLineStyle.lineWidth - } - }).shape, + shape: { + x1: pt1[0], + y1: pt1[1], + x2: pt2[0], + y2: pt2[1] + }, style: tickLineStyle, z2: 2, autoBatch: true, From acb54f829f10b3bc81de69c8bc17cef21080af86 Mon Sep 17 00:00:00 2001 From: Ovilia Date: Sun, 21 Aug 2022 16:16:32 +0800 Subject: [PATCH 83/86] feat(coarse-pointer): fix test --- package-lock.json | 15 ++--- package.json | 2 +- src/core/echarts.ts | 2 +- test/lib/config.js | 16 ++++- test/line-visual-polar.html | 122 ++++++++++++++++++++++++++++++++++++ test/runTest/server.js | 4 +- test/runTest/store.js | 3 +- 7 files changed, 151 insertions(+), 13 deletions(-) create mode 100644 test/line-visual-polar.html diff --git a/package-lock.json b/package-lock.json index f9606563db..114b6238f8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "Apache-2.0", "dependencies": { "tslib": "2.3.0", - "zrender": "5.3.1" + "zrender": "npm:zrender-nightly@^5.3.3-dev.20220820" }, "devDependencies": { "@babel/code-frame": "7.10.4", @@ -13362,9 +13362,10 @@ } }, "node_modules/zrender": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/zrender/-/zrender-5.3.1.tgz", - "integrity": "sha512-7olqIjy0gWfznKr6vgfnGBk7y4UtdMvdwFmK92vVQsQeDPyzkHW1OlrLEKg6GHz1W5ePf0FeN1q2vkl/HFqhXw==", + "name": "zrender-nightly", + "version": "5.3.3-dev.20220820", + "resolved": "https://registry.npmjs.org/zrender-nightly/-/zrender-nightly-5.3.3-dev.20220820.tgz", + "integrity": "sha512-/4hBgw+X1EAZ+wE/4VYfOJEkOD+FWJ+GUEMYVNUoo8FWpU97avPhcTVMupP2w6qjuDY8178ivDs8PMBL7igdxQ==", "dependencies": { "tslib": "2.3.0" } @@ -24241,9 +24242,9 @@ } }, "zrender": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/zrender/-/zrender-5.3.1.tgz", - "integrity": "sha512-7olqIjy0gWfznKr6vgfnGBk7y4UtdMvdwFmK92vVQsQeDPyzkHW1OlrLEKg6GHz1W5ePf0FeN1q2vkl/HFqhXw==", + "version": "npm:zrender-nightly@5.3.3-dev.20220820", + "resolved": "https://registry.npmjs.org/zrender-nightly/-/zrender-nightly-5.3.3-dev.20220820.tgz", + "integrity": "sha512-/4hBgw+X1EAZ+wE/4VYfOJEkOD+FWJ+GUEMYVNUoo8FWpU97avPhcTVMupP2w6qjuDY8178ivDs8PMBL7igdxQ==", "requires": { "tslib": "2.3.0" } diff --git a/package.json b/package.json index edd7c9b592..36189befa2 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ }, "dependencies": { "tslib": "2.3.0", - "zrender": "5.3.1" + "zrender": "npm:zrender-nightly@^5.3.3-dev.20220820" }, "devDependencies": { "@babel/code-frame": "7.10.4", diff --git a/src/core/echarts.ts b/src/core/echarts.ts index 054402bd83..28e789b100 100644 --- a/src/core/echarts.ts +++ b/src/core/echarts.ts @@ -422,7 +422,7 @@ class ECharts extends Eventful { defaultRenderer = root.__ECHARTS__DEFAULT__RENDERER__ || defaultRenderer; - defaultCoarsePointer = root.__ECHARTS__DEFAULT__COARSE_POINTER || defaultCoarsePointer; + defaultCoarsePointer = retrieve2(root.__ECHARTS__DEFAULT__COARSE_POINTER, defaultCoarsePointer); const devUseDirtyRect = root.__ECHARTS__DEFAULT__USE_DIRTY_RECT__; defaultUseDirtyRect = devUseDirtyRect == null diff --git a/test/lib/config.js b/test/lib/config.js index 63ffbd49c8..1096eec50c 100644 --- a/test/lib/config.js +++ b/test/lib/config.js @@ -31,7 +31,21 @@ window.__ECHARTS__DEFAULT__RENDERER__ = params.__RENDERER__; } if (params.__COARSE__POINTER__) { - window.__ECHARTS__DEFAULT__COARSE_POINTER = params.__COARSE__POINTER__; + switch (params.__COARSE__POINTER__) { + case true: + case 'true': + window.__ECHARTS__COARSE__POINTER__ = true; + break; + + case false: + case 'false': + window.__ECHARTS__COARSE__POINTER__ = false; + break; + + default: + window.__ECHARTS__COARSE__POINTER__ = 'auto'; + break; + } } if (params.__USE_DIRTY_RECT__) { window.__ECHARTS__DEFAULT__USE_DIRTY_RECT__ = params.__USE_DIRTY_RECT__ === 'true'; diff --git a/test/line-visual-polar.html b/test/line-visual-polar.html new file mode 100644 index 0000000000..736f669887 --- /dev/null +++ b/test/line-visual-polar.html @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + diff --git a/test/runTest/server.js b/test/runTest/server.js index 7cf41945b1..f7b598f6fc 100644 --- a/test/runTest/server.js +++ b/test/runTest/server.js @@ -191,7 +191,7 @@ function startTests(testsNameList, socket, { '--actual', actualVersion, '--expected', expectedVersion, '--renderer', renderer || '', - '--use-coarse-pointer', useCoarsePointer || 'auto', + '--use-coarse-pointer', useCoarsePointer, '--threads', Math.min(threadsCount, CLI_FIXED_THREADS_COUNT), '--dir', getResultBaseDir(), ...(noHeadless ? ['--no-headless'] : []), @@ -402,7 +402,7 @@ async function start() { actualVersion: data.actualVersion, expectedVersion: data.expectedVersion, renderer: data.renderer || '', - useCoarsePointer: data.useCoarsePointer || 'auto', + useCoarsePointer: data.useCoarsePointer, noSave: true }); } diff --git a/test/runTest/store.js b/test/runTest/store.js index 31e0537c84..3430bd47e8 100644 --- a/test/runTest/store.js +++ b/test/runTest/store.js @@ -113,7 +113,8 @@ module.exports.checkStoreVersion = function (runParams) { console.log('Store ', _runHash); return storeParams.expectedVersion === runParams.expectedVersion && storeParams.actualVersion === runParams.actualVersion - && storeParams.renderer === runParams.renderer; + && storeParams.renderer === runParams.renderer + && storeParams.useCoarsePointer === runParams.useCoarsePointer; } function getResultFilePath() { From 5c3025d4a36296424d81a875208521b2efa58c65 Mon Sep 17 00:00:00 2001 From: Ovilia Date: Mon, 22 Aug 2022 10:12:56 +0800 Subject: [PATCH 84/86] feat(coarse-pointer): fix test --- test/lib/config.js | 2 - test/line-visual-polar.html | 122 ------------------------------------ 2 files changed, 124 deletions(-) delete mode 100644 test/line-visual-polar.html diff --git a/test/lib/config.js b/test/lib/config.js index 1096eec50c..bc36037e79 100644 --- a/test/lib/config.js +++ b/test/lib/config.js @@ -32,12 +32,10 @@ } if (params.__COARSE__POINTER__) { switch (params.__COARSE__POINTER__) { - case true: case 'true': window.__ECHARTS__COARSE__POINTER__ = true; break; - case false: case 'false': window.__ECHARTS__COARSE__POINTER__ = false; break; diff --git a/test/line-visual-polar.html b/test/line-visual-polar.html deleted file mode 100644 index 736f669887..0000000000 --- a/test/line-visual-polar.html +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - From d0b204597000a4b6140cfca8632d46c75cc50f34 Mon Sep 17 00:00:00 2001 From: Ovilia Date: Mon, 22 Aug 2022 12:05:02 +0800 Subject: [PATCH 85/86] fix: merge conflict --- package-lock.json | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index de5f84f78b..84ba47d8ea 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13363,15 +13363,9 @@ }, "node_modules/zrender": { "name": "zrender-nightly", -<<<<<<< HEAD "version": "5.3.3-dev.20220820", "resolved": "https://registry.npmjs.org/zrender-nightly/-/zrender-nightly-5.3.3-dev.20220820.tgz", "integrity": "sha512-/4hBgw+X1EAZ+wE/4VYfOJEkOD+FWJ+GUEMYVNUoo8FWpU97avPhcTVMupP2w6qjuDY8178ivDs8PMBL7igdxQ==", -======= - "version": "5.3.3-dev.20220720", - "resolved": "https://registry.npmjs.org/zrender-nightly/-/zrender-nightly-5.3.3-dev.20220720.tgz", - "integrity": "sha512-rh3tfK2ARgee39pYh1xEaT8ZyT+70kHQKFranukjmKOMQi8/5nM4sBuuYPCwFcoIpvSMM/iiYikZmM9VEMwMKQ==", ->>>>>>> next "dependencies": { "tslib": "2.3.0" } @@ -24248,15 +24242,9 @@ } }, "zrender": { -<<<<<<< HEAD "version": "npm:zrender-nightly@5.3.3-dev.20220820", "resolved": "https://registry.npmjs.org/zrender-nightly/-/zrender-nightly-5.3.3-dev.20220820.tgz", "integrity": "sha512-/4hBgw+X1EAZ+wE/4VYfOJEkOD+FWJ+GUEMYVNUoo8FWpU97avPhcTVMupP2w6qjuDY8178ivDs8PMBL7igdxQ==", -======= - "version": "npm:zrender-nightly@5.3.3-dev.20220720", - "resolved": "https://registry.npmjs.org/zrender-nightly/-/zrender-nightly-5.3.3-dev.20220720.tgz", - "integrity": "sha512-rh3tfK2ARgee39pYh1xEaT8ZyT+70kHQKFranukjmKOMQi8/5nM4sBuuYPCwFcoIpvSMM/iiYikZmM9VEMwMKQ==", ->>>>>>> next "requires": { "tslib": "2.3.0" } From 41676b32b7a7106c22f9079dbf730dc82d94b588 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Aug 2022 06:24:40 +0000 Subject: [PATCH 86/86] chore(deps): bump engine.io and socket.io Bumps [engine.io](https://github.com/socketio/engine.io) and [socket.io](https://github.com/socketio/socket.io). These dependencies needed to be updated together. Updates `engine.io` from 3.3.2 to 3.6.0 - [Release notes](https://github.com/socketio/engine.io/releases) - [Changelog](https://github.com/socketio/engine.io/blob/main/CHANGELOG.md) - [Commits](https://github.com/socketio/engine.io/compare/3.3.2...3.6.0) Updates `socket.io` from 2.2.0 to 2.5.0 - [Release notes](https://github.com/socketio/socket.io/releases) - [Changelog](https://github.com/socketio/socket.io/blob/2.5.0/CHANGELOG.md) - [Commits](https://github.com/socketio/socket.io/compare/2.2.0...2.5.0) --- updated-dependencies: - dependency-name: engine.io dependency-type: indirect - dependency-name: socket.io dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- package-lock.json | 601 +++++++++++++++++++++------------------------- package.json | 2 +- 2 files changed, 274 insertions(+), 329 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7e1a599523..7db23f2bef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -49,7 +49,7 @@ "semver": "6.3.0", "serve-handler": "6.1.1", "slugify": "1.3.4", - "socket.io": "2.2.0", + "socket.io": "2.5.0", "terser": "^5.3.8", "ts-jest": "^26.4.3", "typescript": "4.4.3" @@ -2392,13 +2392,13 @@ "dev": true }, "node_modules/accepts": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", - "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", "dev": true, "dependencies": { - "mime-types": "~2.1.24", - "negotiator": "0.6.2" + "mime-types": "~2.1.34", + "negotiator": "0.6.3" }, "engines": { "node": ">= 0.6" @@ -2447,7 +2447,7 @@ "node_modules/after": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/after/-/after-0.8.2.tgz", - "integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=", + "integrity": "sha512-QbJ0NTQ/I9DI3uSJA4cbexiwQeRAfjPScqIbSjUDd9TOrcg6pTkdgziesOqxBMBzit8vFCTwrP27t13vFOORRA==", "dev": true }, "node_modules/ajv": { @@ -2646,12 +2646,6 @@ "node": ">=8" } }, - "node_modules/async-limiter": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", - "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==", - "dev": true - }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -2894,7 +2888,7 @@ "node_modules/backo2": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz", - "integrity": "sha1-MasayLEpNjRj41s+u2n038+6eUc=", + "integrity": "sha512-zj6Z6M7Eq+PBZ7PQxl5NT665MvJdAkzp0f60nAJ+sLaSCBPMwVak5ZegFbgVCzFcCJTKFoMizvM5Ld7+JrRJHA==", "dev": true }, "node_modules/balanced-match": { @@ -2972,9 +2966,9 @@ } }, "node_modules/base64-arraybuffer": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz", - "integrity": "sha1-c5JncZI7Whl0etZmqlzUv5xunOg=", + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.4.tgz", + "integrity": "sha512-a1eIFi4R9ySrbiMuyTGx5e92uRH5tQY6kArNcFaKBUleIoLjdjBg7Zxm3Mqm3Kmkf27HLR/1fnxX9q8GQ7Iavg==", "dev": true, "engines": { "node": ">= 0.6.0" @@ -2987,12 +2981,12 @@ "dev": true }, "node_modules/base64id": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/base64id/-/base64id-1.0.0.tgz", - "integrity": "sha1-R2iMuZu2gE8OBtPnY7HDLlfY5rY=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", + "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==", "dev": true, "engines": { - "node": ">= 0.4.0" + "node": "^4.5.0 || >= 5.9" } }, "node_modules/bcrypt-pbkdf": { @@ -3004,18 +2998,6 @@ "tweetnacl": "^0.14.3" } }, - "node_modules/better-assert": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/better-assert/-/better-assert-1.0.2.tgz", - "integrity": "sha1-QIZrnhueC1W0gYlDEeaPr/rrxSI=", - "dev": true, - "dependencies": { - "callsite": "1.0.0" - }, - "engines": { - "node": "*" - } - }, "node_modules/bin-build": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/bin-build/-/bin-build-3.0.0.tgz", @@ -3614,15 +3596,6 @@ "node": ">=0.10.0" } }, - "node_modules/callsite": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz", - "integrity": "sha1-KAOY5dZkvXQDi28JBRU+borxvCA=", - "dev": true, - "engines": { - "node": "*" - } - }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -4000,7 +3973,7 @@ "node_modules/component-bind": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz", - "integrity": "sha1-AMYIq33Nk4l8AAllGx06jh5zu9E=", + "integrity": "sha512-WZveuKPeKAG9qY+FkYDeADzdHyTYdIboXS59ixDeRJL5ZhxpqUnxSOwop4FQjMsiYm3/Or8cegVbpAHNA7pHxw==", "dev": true }, "node_modules/component-emitter": { @@ -4012,7 +3985,7 @@ "node_modules/component-inherit": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/component-inherit/-/component-inherit-0.0.3.tgz", - "integrity": "sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM=", + "integrity": "sha512-w+LhYREhatpVqTESyGFg3NlP6Iu0kEKUHETY9GoZP/pQyW4mHFZuFWRUCIqVPZ36ueVLtoOEZaAqbCF2RDndaA==", "dev": true }, "node_modules/concat-map": { @@ -4081,9 +4054,9 @@ } }, "node_modules/cookie": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", - "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=", + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", + "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", "dev": true, "engines": { "node": ">= 0.6" @@ -4880,44 +4853,41 @@ } }, "node_modules/engine.io": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-3.3.2.tgz", - "integrity": "sha512-AsaA9KG7cWPXWHp5FvHdDWY3AMWeZ8x+2pUVLcn71qE5AtAzgGbxuclOytygskw8XGmiQafTmnI9Bix3uihu2w==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-3.6.0.tgz", + "integrity": "sha512-Kc8fo5bbg8F4a2f3HPHTEpGyq/IRIQpyeHu3H1ThR14XDD7VrLcsGBo16HUpahgp8YkHJDaU5gNxJZbuGcuueg==", "dev": true, "dependencies": { "accepts": "~1.3.4", - "base64id": "1.0.0", - "cookie": "0.3.1", - "debug": "~3.1.0", - "engine.io-parser": "~2.1.0", - "ws": "~6.1.0" + "base64id": "2.0.0", + "cookie": "~0.4.1", + "debug": "~4.1.0", + "engine.io-parser": "~2.2.0", + "ws": "~7.4.2" + }, + "engines": { + "node": ">=8.0.0" } }, "node_modules/engine.io-client": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.3.3.tgz", - "integrity": "sha512-PXIgpzb1brtBzh8Q6vCjzCMeu4nfEPmaDm+L3Qb2sVHwLkxC1qRiBMSjOB0NJNjZ0hbPNUKQa+s8J2XxLOIEeQ==", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.5.2.tgz", + "integrity": "sha512-QEqIp+gJ/kMHeUun7f5Vv3bteRHppHH/FMBQX/esFj/fuYfjyUKWGMo3VCvIP/V8bE9KcjHmRZrhIz2Z9oNsDA==", "dev": true, "dependencies": { - "component-emitter": "1.2.1", + "component-emitter": "~1.3.0", "component-inherit": "0.0.3", "debug": "~3.1.0", - "engine.io-parser": "~2.1.1", + "engine.io-parser": "~2.2.0", "has-cors": "1.1.0", "indexof": "0.0.1", - "parseqs": "0.0.5", - "parseuri": "0.0.5", - "ws": "~6.1.0", - "xmlhttprequest-ssl": "~1.6.3", + "parseqs": "0.0.6", + "parseuri": "0.0.6", + "ws": "~7.4.2", + "xmlhttprequest-ssl": "~1.6.2", "yeast": "0.1.2" } }, - "node_modules/engine.io-client/node_modules/component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", - "dev": true - }, "node_modules/engine.io-client/node_modules/debug": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", @@ -4930,53 +4900,72 @@ "node_modules/engine.io-client/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "dev": true }, "node_modules/engine.io-client/node_modules/ws": { - "version": "6.1.4", - "resolved": "https://registry.npmjs.org/ws/-/ws-6.1.4.tgz", - "integrity": "sha512-eqZfL+NE/YQc1/ZynhojeV8q+H050oR8AZ2uIev7RU10svA9ZnJUddHcOUZTJLinZ9yEfdA2kSATS2qZK5fhJA==", + "version": "7.4.6", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", + "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==", "dev": true, - "dependencies": { - "async-limiter": "~1.0.0" + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } } }, "node_modules/engine.io-parser": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-2.1.3.tgz", - "integrity": "sha512-6HXPre2O4Houl7c4g7Ic/XzPnHBvaEmN90vtRO9uLmwtRqQmTOw0QMevL1TOfL2Cpu1VzsaTmMotQgMdkzGkVA==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-2.2.1.tgz", + "integrity": "sha512-x+dN/fBH8Ro8TFwJ+rkB2AmuVw9Yu2mockR/p3W8f8YtExwFgDvBDi0GWyb4ZLkpahtDGZgtr3zLovanJghPqg==", "dev": true, "dependencies": { "after": "0.8.2", "arraybuffer.slice": "~0.0.7", - "base64-arraybuffer": "0.1.5", + "base64-arraybuffer": "0.1.4", "blob": "0.0.5", "has-binary2": "~1.0.2" } }, "node_modules/engine.io/node_modules/debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "deprecated": "Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)", "dev": true, "dependencies": { - "ms": "2.0.0" + "ms": "^2.1.1" } }, - "node_modules/engine.io/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, "node_modules/engine.io/node_modules/ws": { - "version": "6.1.4", - "resolved": "https://registry.npmjs.org/ws/-/ws-6.1.4.tgz", - "integrity": "sha512-eqZfL+NE/YQc1/ZynhojeV8q+H050oR8AZ2uIev7RU10svA9ZnJUddHcOUZTJLinZ9yEfdA2kSATS2qZK5fhJA==", + "version": "7.4.6", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", + "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==", "dev": true, - "dependencies": { - "async-limiter": "~1.0.0" + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } } }, "node_modules/enquirer": { @@ -6404,13 +6393,13 @@ "node_modules/has-binary2/node_modules/isarray": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz", - "integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=", + "integrity": "sha512-c2cu3UxbI+b6kR3fy0nRnAhodsvR9dx7U5+znCOzdj6IfP3upFURTr0Xl5BlQZNKZjEtxrmVyfSdeE3O57smoQ==", "dev": true }, "node_modules/has-cors": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-cors/-/has-cors-1.1.0.tgz", - "integrity": "sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk=", + "integrity": "sha512-g5VNKdkFuUuVCP9gYfDJHjK2nqdQJ7aDLTnycnc2+RvsOQbuLdF5pm7vuE5J76SEBIQjs4kQY/BWq74JUmjbXA==", "dev": true }, "node_modules/has-flag": { @@ -6875,7 +6864,7 @@ "node_modules/indexof": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", - "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=", + "integrity": "sha512-i0G7hLJ1z0DE8dsqJa2rycj9dBmNKgXBvotXtZYXakU9oivfB9Uj2ZBC27qqef2U58/ZLwalxa1X/RDCdkHtVg==", "dev": true }, "node_modules/inflight": { @@ -9556,21 +9545,21 @@ } }, "node_modules/mime-db": { - "version": "1.44.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", - "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==", + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "dev": true, "engines": { "node": ">= 0.6" } }, "node_modules/mime-types": { - "version": "2.1.27", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", - "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "dev": true, "dependencies": { - "mime-db": "1.44.0" + "mime-db": "1.52.0" }, "engines": { "node": ">= 0.6" @@ -9681,9 +9670,9 @@ "dev": true }, "node_modules/negotiator": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", - "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==", + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", "dev": true, "engines": { "node": ">= 0.6" @@ -9965,12 +9954,6 @@ "node": ">=0.10.0" } }, - "node_modules/object-component": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/object-component/-/object-component-0.0.3.tgz", - "integrity": "sha1-8MaapQ78lbhmwYb0AKM3acsvEpE=", - "dev": true - }, "node_modules/object-copy": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", @@ -10268,22 +10251,16 @@ "dev": true }, "node_modules/parseqs": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.5.tgz", - "integrity": "sha1-1SCKNzjkZ2bikbouoXNoSSGouJ0=", - "dev": true, - "dependencies": { - "better-assert": "~1.0.0" - } + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.6.tgz", + "integrity": "sha512-jeAGzMDbfSHHA091hr0r31eYfTig+29g3GKKE/PPbEQ65X0lmMwlEoqmhzu0iztID5uJpZsFlUPDP8ThPL7M8w==", + "dev": true }, "node_modules/parseuri": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.5.tgz", - "integrity": "sha1-gCBKUNTbt3m/3G6+J3jZDkvOMgo=", - "dev": true, - "dependencies": { - "better-assert": "~1.0.0" - } + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.6.tgz", + "integrity": "sha512-AUjen8sAkGgao7UyCX6Ahv0gIK2fABKmYjvP4xmy5JaKvcbTRueIqIPHLAfq30xJddqSE033IOMUSOMCcK3Sow==", + "dev": true }, "node_modules/parsimmon": { "version": "1.16.0", @@ -11643,17 +11620,17 @@ "dev": true }, "node_modules/socket.io": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-2.2.0.tgz", - "integrity": "sha512-wxXrIuZ8AILcn+f1B4ez4hJTPG24iNgxBBDaJfT6MsyOhVYiTXWexGoPkd87ktJG8kQEcL/NBvRi64+9k4Kc0w==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-2.5.0.tgz", + "integrity": "sha512-gGunfS0od3VpwDBpGwVkzSZx6Aqo9uOcf1afJj2cKnKFAoyl16fvhpsUhmUFd4Ldbvl5JvRQed6eQw6oQp6n8w==", "dev": true, "dependencies": { "debug": "~4.1.0", - "engine.io": "~3.3.1", + "engine.io": "~3.6.0", "has-binary2": "~1.0.2", "socket.io-adapter": "~1.1.0", - "socket.io-client": "2.2.0", - "socket.io-parser": "~3.3.0" + "socket.io-client": "2.5.0", + "socket.io-parser": "~3.4.0" } }, "node_modules/socket.io-adapter": { @@ -11663,33 +11640,24 @@ "dev": true }, "node_modules/socket.io-client": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-2.2.0.tgz", - "integrity": "sha512-56ZrkTDbdTLmBIyfFYesgOxsjcLnwAKoN4CiPyTVkMQj3zTUh0QAx3GbvIvLpFEOvQWu92yyWICxB0u7wkVbYA==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-2.5.0.tgz", + "integrity": "sha512-lOO9clmdgssDykiOmVQQitwBAF3I6mYcQAo7hQ7AM6Ny5X7fp8hIJ3HcQs3Rjz4SoggoxA1OgrQyY8EgTbcPYw==", "dev": true, "dependencies": { "backo2": "1.0.2", - "base64-arraybuffer": "0.1.5", "component-bind": "1.0.0", - "component-emitter": "1.2.1", + "component-emitter": "~1.3.0", "debug": "~3.1.0", - "engine.io-client": "~3.3.1", + "engine.io-client": "~3.5.0", "has-binary2": "~1.0.2", - "has-cors": "1.1.0", "indexof": "0.0.1", - "object-component": "0.0.3", - "parseqs": "0.0.5", - "parseuri": "0.0.5", + "parseqs": "0.0.6", + "parseuri": "0.0.6", "socket.io-parser": "~3.3.0", "to-array": "0.1.4" } }, - "node_modules/socket.io-client/node_modules/component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", - "dev": true - }, "node_modules/socket.io-client/node_modules/debug": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", @@ -11699,13 +11667,19 @@ "ms": "2.0.0" } }, + "node_modules/socket.io-client/node_modules/isarray": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz", + "integrity": "sha512-c2cu3UxbI+b6kR3fy0nRnAhodsvR9dx7U5+znCOzdj6IfP3upFURTr0Xl5BlQZNKZjEtxrmVyfSdeE3O57smoQ==", + "dev": true + }, "node_modules/socket.io-client/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "dev": true }, - "node_modules/socket.io-parser": { + "node_modules/socket.io-client/node_modules/socket.io-parser": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.3.2.tgz", "integrity": "sha512-FJvDBuOALxdCI9qwRrO/Rfp9yfndRtc1jSgVgV8FDraihmSP/MLGD5PEuJrNfjALvcQ+vMDM/33AWOYP/JSjDg==", @@ -11716,25 +11690,37 @@ "isarray": "2.0.1" } }, + "node_modules/socket.io-parser": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.4.1.tgz", + "integrity": "sha512-11hMgzL+WCLWf1uFtHSNvliI++tcRUWdoeYuwIl+Axvwy9z2gQM+7nJyN3STj1tLj5JyIUH8/gpDGxzAlDdi0A==", + "dev": true, + "dependencies": { + "component-emitter": "1.2.1", + "debug": "~4.1.0", + "isarray": "2.0.1" + } + }, + "node_modules/socket.io-parser/node_modules/component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha512-jPatnhd33viNplKjqXKRkGU345p263OIWzDL2wH3LGIGp5Kojo+uXizHmOADRvhGFFTnJqX3jBAKP6vvmSDKcA==", + "dev": true + }, "node_modules/socket.io-parser/node_modules/debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "deprecated": "Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)", "dev": true, "dependencies": { - "ms": "2.0.0" + "ms": "^2.1.1" } }, "node_modules/socket.io-parser/node_modules/isarray": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz", - "integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=", - "dev": true - }, - "node_modules/socket.io-parser/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "integrity": "sha512-c2cu3UxbI+b6kR3fy0nRnAhodsvR9dx7U5+znCOzdj6IfP3upFURTr0Xl5BlQZNKZjEtxrmVyfSdeE3O57smoQ==", "dev": true }, "node_modules/socket.io/node_modules/debug": { @@ -12447,7 +12433,7 @@ "node_modules/to-array": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/to-array/-/to-array-0.1.4.tgz", - "integrity": "sha1-F+bBH3PdTz10zaek/zI46a2b+JA=", + "integrity": "sha512-LhVdShQD/4Mk4zXNroIQZJC+Ap3zgLcDuwEdcmLv9CCO73NWockQDwyUnW/m8VX/EElfL6FcYx7EeutN4HJA6A==", "dev": true }, "node_modules/to-buffer": { @@ -13391,7 +13377,7 @@ "node_modules/yeast": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz", - "integrity": "sha1-AI4G2AlDIMNy28L47XagymyKxBk=", + "integrity": "sha512-8HFIh676uyGYP6wP13R/j6OJ/1HwJ46snpvzE7aHAN3Ryqh2yX6Xox2B4CUmTwwOIzlG3Bs7ocsP5dZH/R1Qbg==", "dev": true }, "node_modules/yocto-queue": { @@ -15391,13 +15377,13 @@ "dev": true }, "accepts": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", - "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", "dev": true, "requires": { - "mime-types": "~2.1.24", - "negotiator": "0.6.2" + "mime-types": "~2.1.34", + "negotiator": "0.6.3" } }, "acorn": { @@ -15432,7 +15418,7 @@ "after": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/after/-/after-0.8.2.tgz", - "integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=", + "integrity": "sha512-QbJ0NTQ/I9DI3uSJA4cbexiwQeRAfjPScqIbSjUDd9TOrcg6pTkdgziesOqxBMBzit8vFCTwrP27t13vFOORRA==", "dev": true }, "ajv": { @@ -15591,12 +15577,6 @@ "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", "dev": true }, - "async-limiter": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", - "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==", - "dev": true - }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -15789,7 +15769,7 @@ "backo2": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz", - "integrity": "sha1-MasayLEpNjRj41s+u2n038+6eUc=", + "integrity": "sha512-zj6Z6M7Eq+PBZ7PQxl5NT665MvJdAkzp0f60nAJ+sLaSCBPMwVak5ZegFbgVCzFcCJTKFoMizvM5Ld7+JrRJHA==", "dev": true }, "balanced-match": { @@ -15854,9 +15834,9 @@ } }, "base64-arraybuffer": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz", - "integrity": "sha1-c5JncZI7Whl0etZmqlzUv5xunOg=", + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.4.tgz", + "integrity": "sha512-a1eIFi4R9ySrbiMuyTGx5e92uRH5tQY6kArNcFaKBUleIoLjdjBg7Zxm3Mqm3Kmkf27HLR/1fnxX9q8GQ7Iavg==", "dev": true }, "base64-js": { @@ -15866,9 +15846,9 @@ "dev": true }, "base64id": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/base64id/-/base64id-1.0.0.tgz", - "integrity": "sha1-R2iMuZu2gE8OBtPnY7HDLlfY5rY=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", + "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==", "dev": true }, "bcrypt-pbkdf": { @@ -15880,15 +15860,6 @@ "tweetnacl": "^0.14.3" } }, - "better-assert": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/better-assert/-/better-assert-1.0.2.tgz", - "integrity": "sha1-QIZrnhueC1W0gYlDEeaPr/rrxSI=", - "dev": true, - "requires": { - "callsite": "1.0.0" - } - }, "bin-build": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/bin-build/-/bin-build-3.0.0.tgz", @@ -16397,12 +16368,6 @@ } } }, - "callsite": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz", - "integrity": "sha1-KAOY5dZkvXQDi28JBRU+borxvCA=", - "dev": true - }, "callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -16717,7 +16682,7 @@ "component-bind": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz", - "integrity": "sha1-AMYIq33Nk4l8AAllGx06jh5zu9E=", + "integrity": "sha512-WZveuKPeKAG9qY+FkYDeADzdHyTYdIboXS59ixDeRJL5ZhxpqUnxSOwop4FQjMsiYm3/Or8cegVbpAHNA7pHxw==", "dev": true }, "component-emitter": { @@ -16729,7 +16694,7 @@ "component-inherit": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/component-inherit/-/component-inherit-0.0.3.tgz", - "integrity": "sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM=", + "integrity": "sha512-w+LhYREhatpVqTESyGFg3NlP6Iu0kEKUHETY9GoZP/pQyW4mHFZuFWRUCIqVPZ36ueVLtoOEZaAqbCF2RDndaA==", "dev": true }, "concat-map": { @@ -16792,9 +16757,9 @@ } }, "cookie": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", - "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=", + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", + "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", "dev": true }, "copy-descriptor": { @@ -17453,70 +17418,56 @@ } }, "engine.io": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-3.3.2.tgz", - "integrity": "sha512-AsaA9KG7cWPXWHp5FvHdDWY3AMWeZ8x+2pUVLcn71qE5AtAzgGbxuclOytygskw8XGmiQafTmnI9Bix3uihu2w==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-3.6.0.tgz", + "integrity": "sha512-Kc8fo5bbg8F4a2f3HPHTEpGyq/IRIQpyeHu3H1ThR14XDD7VrLcsGBo16HUpahgp8YkHJDaU5gNxJZbuGcuueg==", "dev": true, "requires": { "accepts": "~1.3.4", - "base64id": "1.0.0", - "cookie": "0.3.1", - "debug": "~3.1.0", - "engine.io-parser": "~2.1.0", - "ws": "~6.1.0" + "base64id": "2.0.0", + "cookie": "~0.4.1", + "debug": "~4.1.0", + "engine.io-parser": "~2.2.0", + "ws": "~7.4.2" }, "dependencies": { "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "dev": true, "requires": { - "ms": "2.0.0" + "ms": "^2.1.1" } }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, "ws": { - "version": "6.1.4", - "resolved": "https://registry.npmjs.org/ws/-/ws-6.1.4.tgz", - "integrity": "sha512-eqZfL+NE/YQc1/ZynhojeV8q+H050oR8AZ2uIev7RU10svA9ZnJUddHcOUZTJLinZ9yEfdA2kSATS2qZK5fhJA==", + "version": "7.4.6", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", + "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==", "dev": true, - "requires": { - "async-limiter": "~1.0.0" - } + "requires": {} } } }, "engine.io-client": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.3.3.tgz", - "integrity": "sha512-PXIgpzb1brtBzh8Q6vCjzCMeu4nfEPmaDm+L3Qb2sVHwLkxC1qRiBMSjOB0NJNjZ0hbPNUKQa+s8J2XxLOIEeQ==", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.5.2.tgz", + "integrity": "sha512-QEqIp+gJ/kMHeUun7f5Vv3bteRHppHH/FMBQX/esFj/fuYfjyUKWGMo3VCvIP/V8bE9KcjHmRZrhIz2Z9oNsDA==", "dev": true, "requires": { - "component-emitter": "1.2.1", + "component-emitter": "~1.3.0", "component-inherit": "0.0.3", "debug": "~3.1.0", - "engine.io-parser": "~2.1.1", + "engine.io-parser": "~2.2.0", "has-cors": "1.1.0", "indexof": "0.0.1", - "parseqs": "0.0.5", - "parseuri": "0.0.5", - "ws": "~6.1.0", - "xmlhttprequest-ssl": "~1.6.3", + "parseqs": "0.0.6", + "parseuri": "0.0.6", + "ws": "~7.4.2", + "xmlhttprequest-ssl": "~1.6.2", "yeast": "0.1.2" }, "dependencies": { - "component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", - "dev": true - }, "debug": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", @@ -17529,29 +17480,27 @@ "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "dev": true }, "ws": { - "version": "6.1.4", - "resolved": "https://registry.npmjs.org/ws/-/ws-6.1.4.tgz", - "integrity": "sha512-eqZfL+NE/YQc1/ZynhojeV8q+H050oR8AZ2uIev7RU10svA9ZnJUddHcOUZTJLinZ9yEfdA2kSATS2qZK5fhJA==", + "version": "7.4.6", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", + "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==", "dev": true, - "requires": { - "async-limiter": "~1.0.0" - } + "requires": {} } } }, "engine.io-parser": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-2.1.3.tgz", - "integrity": "sha512-6HXPre2O4Houl7c4g7Ic/XzPnHBvaEmN90vtRO9uLmwtRqQmTOw0QMevL1TOfL2Cpu1VzsaTmMotQgMdkzGkVA==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-2.2.1.tgz", + "integrity": "sha512-x+dN/fBH8Ro8TFwJ+rkB2AmuVw9Yu2mockR/p3W8f8YtExwFgDvBDi0GWyb4ZLkpahtDGZgtr3zLovanJghPqg==", "dev": true, "requires": { "after": "0.8.2", "arraybuffer.slice": "~0.0.7", - "base64-arraybuffer": "0.1.5", + "base64-arraybuffer": "0.1.4", "blob": "0.0.5", "has-binary2": "~1.0.2" } @@ -18693,7 +18642,7 @@ "isarray": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz", - "integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=", + "integrity": "sha512-c2cu3UxbI+b6kR3fy0nRnAhodsvR9dx7U5+znCOzdj6IfP3upFURTr0Xl5BlQZNKZjEtxrmVyfSdeE3O57smoQ==", "dev": true } } @@ -18701,7 +18650,7 @@ "has-cors": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-cors/-/has-cors-1.1.0.tgz", - "integrity": "sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk=", + "integrity": "sha512-g5VNKdkFuUuVCP9gYfDJHjK2nqdQJ7aDLTnycnc2+RvsOQbuLdF5pm7vuE5J76SEBIQjs4kQY/BWq74JUmjbXA==", "dev": true }, "has-flag": { @@ -19053,7 +19002,7 @@ "indexof": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", - "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=", + "integrity": "sha512-i0G7hLJ1z0DE8dsqJa2rycj9dBmNKgXBvotXtZYXakU9oivfB9Uj2ZBC27qqef2U58/ZLwalxa1X/RDCdkHtVg==", "dev": true }, "inflight": { @@ -21209,18 +21158,18 @@ } }, "mime-db": { - "version": "1.44.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", - "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==", + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "dev": true }, "mime-types": { - "version": "2.1.27", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", - "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "dev": true, "requires": { - "mime-db": "1.44.0" + "mime-db": "1.52.0" } }, "minimatch": { @@ -21317,9 +21266,9 @@ "dev": true }, "negotiator": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", - "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==", + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", "dev": true }, "nice-try": { @@ -21551,12 +21500,6 @@ "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true }, - "object-component": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/object-component/-/object-component-0.0.3.tgz", - "integrity": "sha1-8MaapQ78lbhmwYb0AKM3acsvEpE=", - "dev": true - }, "object-copy": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", @@ -21784,22 +21727,16 @@ "dev": true }, "parseqs": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.5.tgz", - "integrity": "sha1-1SCKNzjkZ2bikbouoXNoSSGouJ0=", - "dev": true, - "requires": { - "better-assert": "~1.0.0" - } + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.6.tgz", + "integrity": "sha512-jeAGzMDbfSHHA091hr0r31eYfTig+29g3GKKE/PPbEQ65X0lmMwlEoqmhzu0iztID5uJpZsFlUPDP8ThPL7M8w==", + "dev": true }, "parseuri": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.5.tgz", - "integrity": "sha1-gCBKUNTbt3m/3G6+J3jZDkvOMgo=", - "dev": true, - "requires": { - "better-assert": "~1.0.0" - } + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.6.tgz", + "integrity": "sha512-AUjen8sAkGgao7UyCX6Ahv0gIK2fABKmYjvP4xmy5JaKvcbTRueIqIPHLAfq30xJddqSE033IOMUSOMCcK3Sow==", + "dev": true }, "parsimmon": { "version": "1.16.0", @@ -22898,17 +22835,17 @@ } }, "socket.io": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-2.2.0.tgz", - "integrity": "sha512-wxXrIuZ8AILcn+f1B4ez4hJTPG24iNgxBBDaJfT6MsyOhVYiTXWexGoPkd87ktJG8kQEcL/NBvRi64+9k4Kc0w==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-2.5.0.tgz", + "integrity": "sha512-gGunfS0od3VpwDBpGwVkzSZx6Aqo9uOcf1afJj2cKnKFAoyl16fvhpsUhmUFd4Ldbvl5JvRQed6eQw6oQp6n8w==", "dev": true, "requires": { "debug": "~4.1.0", - "engine.io": "~3.3.1", + "engine.io": "~3.6.0", "has-binary2": "~1.0.2", "socket.io-adapter": "~1.1.0", - "socket.io-client": "2.2.0", - "socket.io-parser": "~3.3.0" + "socket.io-client": "2.5.0", + "socket.io-parser": "~3.4.0" }, "dependencies": { "debug": { @@ -22929,33 +22866,24 @@ "dev": true }, "socket.io-client": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-2.2.0.tgz", - "integrity": "sha512-56ZrkTDbdTLmBIyfFYesgOxsjcLnwAKoN4CiPyTVkMQj3zTUh0QAx3GbvIvLpFEOvQWu92yyWICxB0u7wkVbYA==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-2.5.0.tgz", + "integrity": "sha512-lOO9clmdgssDykiOmVQQitwBAF3I6mYcQAo7hQ7AM6Ny5X7fp8hIJ3HcQs3Rjz4SoggoxA1OgrQyY8EgTbcPYw==", "dev": true, "requires": { "backo2": "1.0.2", - "base64-arraybuffer": "0.1.5", "component-bind": "1.0.0", - "component-emitter": "1.2.1", + "component-emitter": "~1.3.0", "debug": "~3.1.0", - "engine.io-client": "~3.3.1", + "engine.io-client": "~3.5.0", "has-binary2": "~1.0.2", - "has-cors": "1.1.0", "indexof": "0.0.1", - "object-component": "0.0.3", - "parseqs": "0.0.5", - "parseuri": "0.0.5", + "parseqs": "0.0.6", + "parseuri": "0.0.6", "socket.io-parser": "~3.3.0", "to-array": "0.1.4" }, "dependencies": { - "component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", - "dev": true - }, "debug": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", @@ -22965,44 +22893,61 @@ "ms": "2.0.0" } }, + "isarray": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz", + "integrity": "sha512-c2cu3UxbI+b6kR3fy0nRnAhodsvR9dx7U5+znCOzdj6IfP3upFURTr0Xl5BlQZNKZjEtxrmVyfSdeE3O57smoQ==", + "dev": true + }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "dev": true + }, + "socket.io-parser": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.3.2.tgz", + "integrity": "sha512-FJvDBuOALxdCI9qwRrO/Rfp9yfndRtc1jSgVgV8FDraihmSP/MLGD5PEuJrNfjALvcQ+vMDM/33AWOYP/JSjDg==", + "dev": true, + "requires": { + "component-emitter": "~1.3.0", + "debug": "~3.1.0", + "isarray": "2.0.1" + } } } }, "socket.io-parser": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.3.2.tgz", - "integrity": "sha512-FJvDBuOALxdCI9qwRrO/Rfp9yfndRtc1jSgVgV8FDraihmSP/MLGD5PEuJrNfjALvcQ+vMDM/33AWOYP/JSjDg==", + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.4.1.tgz", + "integrity": "sha512-11hMgzL+WCLWf1uFtHSNvliI++tcRUWdoeYuwIl+Axvwy9z2gQM+7nJyN3STj1tLj5JyIUH8/gpDGxzAlDdi0A==", "dev": true, "requires": { - "component-emitter": "~1.3.0", - "debug": "~3.1.0", + "component-emitter": "1.2.1", + "debug": "~4.1.0", "isarray": "2.0.1" }, "dependencies": { + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha512-jPatnhd33viNplKjqXKRkGU345p263OIWzDL2wH3LGIGp5Kojo+uXizHmOADRvhGFFTnJqX3jBAKP6vvmSDKcA==", + "dev": true + }, "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "dev": true, "requires": { - "ms": "2.0.0" + "ms": "^2.1.1" } }, "isarray": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz", - "integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=", - "dev": true - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "integrity": "sha512-c2cu3UxbI+b6kR3fy0nRnAhodsvR9dx7U5+znCOzdj6IfP3upFURTr0Xl5BlQZNKZjEtxrmVyfSdeE3O57smoQ==", "dev": true } } @@ -23582,7 +23527,7 @@ "to-array": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/to-array/-/to-array-0.1.4.tgz", - "integrity": "sha1-F+bBH3PdTz10zaek/zI46a2b+JA=", + "integrity": "sha512-LhVdShQD/4Mk4zXNroIQZJC+Ap3zgLcDuwEdcmLv9CCO73NWockQDwyUnW/m8VX/EElfL6FcYx7EeutN4HJA6A==", "dev": true }, "to-buffer": { @@ -24332,7 +24277,7 @@ "yeast": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz", - "integrity": "sha1-AI4G2AlDIMNy28L47XagymyKxBk=", + "integrity": "sha512-8HFIh676uyGYP6wP13R/j6OJ/1HwJ46snpvzE7aHAN3Ryqh2yX6Xox2B4CUmTwwOIzlG3Bs7ocsP5dZH/R1Qbg==", "dev": true }, "yocto-queue": { diff --git a/package.json b/package.json index 320b0f6925..86bccc91d9 100644 --- a/package.json +++ b/package.json @@ -103,7 +103,7 @@ "semver": "6.3.0", "serve-handler": "6.1.1", "slugify": "1.3.4", - "socket.io": "2.2.0", + "socket.io": "2.5.0", "terser": "^5.3.8", "ts-jest": "^26.4.3", "typescript": "4.4.3"