From f22ee7ef8d2ab774f1024dc9899adfc919c3f258 Mon Sep 17 00:00:00 2001 From: "linghao.su" Date: Sat, 1 Jul 2023 17:59:33 +0800 Subject: [PATCH] fix(sankey): rm comment code & import type explicity --- src/chart/sankey/SankeyView.ts | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/src/chart/sankey/SankeyView.ts b/src/chart/sankey/SankeyView.ts index 368704403a..70b264d53e 100644 --- a/src/chart/sankey/SankeyView.ts +++ b/src/chart/sankey/SankeyView.ts @@ -20,7 +20,7 @@ import * as graphic from '../../util/graphic'; import { enterEmphasis, leaveEmphasis, toggleHoverEmphasis, setStatesStylesFromModel } from '../../util/states'; import { LayoutOrient, ECElement } from '../../util/types'; -import { PathProps, PathStyleProps } from 'zrender/src/graphic/Path'; +import type { PathProps, PathStyleProps } from 'zrender/src/graphic/Path'; import SankeySeriesModel, { SankeyEdgeItemOption, SankeyNodeItemOption } from './SankeySeries'; import ChartView from '../../view/Chart'; import GlobalModel from '../../model/Global'; @@ -30,7 +30,7 @@ import { RectLike } from 'zrender/src/core/BoundingRect'; import { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle'; import { getECData } from '../../util/innerStore'; import { isString, retrieve3 } from 'zrender/src/core/util'; -import { GraphEdge } from '../../data/Graph'; +import type { GraphEdge } from '../../data/Graph'; class SankeyPathShape { x1 = 0; @@ -197,30 +197,6 @@ class SankeyView extends ChartView { curve.useStyle(lineStyleModel.getItemStyle()); // Special color, use source node color or target node color applyCurveStyle(curve.style, orient, edge); - // switch (curve.style.fill) { - // case 'source': - // curve.style.fill = edge.node1.getVisual('color'); - // curve.style.decal = edge.node1.getVisual('style').decal; - // break; - // case 'target': - // curve.style.fill = edge.node2.getVisual('color'); - // curve.style.decal = edge.node2.getVisual('style').decal; - // break; - // case 'gradient': - // const sourceColor = edge.node1.getVisual('color'); - // const targetColor = edge.node2.getVisual('color'); - // if (isString(sourceColor) && isString(targetColor)) { - // curve.style.fill = new graphic.LinearGradient( - // 0, 0, +(orient === 'horizontal'), +(orient === 'vertical'), [{ - // color: sourceColor, - // offset: 0 - // }, { - // color: targetColor, - // offset: 1 - // }] - // ); - // } - // } const defaultEdgeLabelText = `${edgeModel.get('value')}`;