This is an automated email from the ASF dual-hosted git repository. shenyi pushed a commit to branch enhance-morph in repository https://gitbox.apache.org/repos/asf/echarts.git
commit 9d6f2ff179eebf00d43647f22b6e92fe4f06af50 Author: pissang <[email protected]> AuthorDate: Mon Jun 7 11:21:04 2021 +0800 fix(merge): fix some issues in merging --- src/chart/custom/CustomSeries.ts | 2 +- src/chart/custom/CustomView.ts | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/chart/custom/CustomSeries.ts b/src/chart/custom/CustomSeries.ts index c3b94f2..125c173 100644 --- a/src/chart/custom/CustomSeries.ts +++ b/src/chart/custom/CustomSeries.ts @@ -83,7 +83,7 @@ export const NON_STYLE_VISUAL_PROPS = { symbol: 1, symbolSize: 1, symbolKeepAspect: 1, - legendSymbol: 1, + legendIcon: 1, visualMeta: 1, liftZ: 1, decal: 1 diff --git a/src/chart/custom/CustomView.ts b/src/chart/custom/CustomView.ts index 249d20e..9bf6e4c 100644 --- a/src/chart/custom/CustomView.ts +++ b/src/chart/custom/CustomView.ts @@ -31,7 +31,7 @@ import Model from '../../model/Model'; import ChartView from '../../view/Chart'; import {createClipPath} from '../helper/createClipPathFromCoordSys'; import { - EventQueryItem, ECEvent, + EventQueryItem, ECActionEvent, DimensionLoose, ParsedValue, Dictionary, @@ -101,8 +101,6 @@ import { prepareTransformAllPropsFinal, prepareTransformTransitionFrom } from './prepare'; -import { SeriesModel } from '../../export/api'; -import { seriesStyleTask } from '../../visual/style'; const transformPropNamesStr = keys(TRANSFORM_PROPS).join(', '); @@ -192,6 +190,12 @@ export default class CustomChartView extends ChartView { const group = this.group; const renderItem = makeRenderItem(customSeries, data, ecModel, api); + if (!oldData) { + // Previous render is incremental render or first render. + // Needs remove the incremental rendered elements. + group.removeAll(); + } + // By default, merge mode is applied. In most cases, custom series is // used in the scenario that data amount is not large but graphic elements // is complicated, where merge mode is probably necessary for optimization. @@ -360,12 +364,12 @@ export default class CustomChartView extends ChartView { const el = createOrUpdateItem( null, null, false, idx, renderItem(idx, payload), customSeries, this.group, data ); - el.traverse(setIncrementalAndHoverLayer); + el && el.traverse(setIncrementalAndHoverLayer); } } filterForExposedEvent( - eventType: string, query: EventQueryItem, targetEl: Element, packedEvent: ECEvent + eventType: string, query: EventQueryItem, targetEl: Element, packedEvent: ECActionEvent ): boolean { const elementName = query.element; if (elementName == null || targetEl.name === elementName) { @@ -1294,7 +1298,7 @@ function createOrUpdateItem( const el = doCreateOrUpdateEl(api, existsEl, hasMorphFrom, dataIndex, elOption, seriesModel, group, true); el && data.setItemGraphicEl(dataIndex, el); - enableHoverEmphasis(el, elOption.focus, elOption.blurScope); + el && enableHoverEmphasis(el, elOption.focus, elOption.blurScope); return el; } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
