Ovilia commented on code in PR #17698:
URL: https://github.com/apache/echarts/pull/17698#discussion_r2159802105
##########
test/ut/core/editorInfoUtHelper.ts:
##########
@@ -0,0 +1,75 @@
+import { createChart } from './utHelper';
+import type { EChartsType } from '../../../src/echarts';
+import type { ECBasicOption, EditorInfo } from '../../../src/util/types';
+import Displayable from 'zrender/src/graphic/Displayable';
+import Group from 'zrender/src/graphic/Group';
+export const isHaveEditorInfo =
+ function (
+ graphic: Displayable | Group, findParent = false, editorInfo:
EditorInfo
+ ): boolean {
+ const { component, element, componentIndex, subType, dataIndex } =
editorInfo;
+ if (graphic?.__editorInfo?.component === component &&
graphic?.__editorInfo?.element === element) {
+ if (componentIndex !== undefined && componentIndex !==
graphic?.__editorInfo?.componentIndex) {
Review Comment:
Avoid using optional chaining operator `?.`
##########
src/chart/helper/Line.ts:
##########
@@ -167,6 +176,12 @@ class Line extends graphic.Group {
const linePoints = lineData.getItemLayout(idx);
const z2 = lineData.getItemVisual(idx, 'z2');
const line = createLine(linePoints);
+ if (__EDITOR__) {
+ addEditorInfo(line, {
+ ...this._editorInfo,
Review Comment:
Use `zrUtil.extend` instead.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]