Lruler commented on code in PR #17471:
URL: https://github.com/apache/echarts/pull/17471#discussion_r996430240


##########
src/chart/graph/Thumbnail.ts:
##########
@@ -0,0 +1,204 @@
+import * as graphic from '../../util/graphic';
+import ExtensionAPI from '../../core/ExtensionAPI';
+import * as layout from '../../util/layout';
+import { BoxLayoutOptionMixin } from '../../util/types';
+import SymbolClz from '../helper/Symbol';
+import ECLinePath from '../helper/LinePath';
+import GraphSeriesModel from './GraphSeries';
+import { RoamEventParams } from '../../component/helper/RoamController';
+import { clone } from 'zrender/src/core/util';
+
+interface LayoutParams {
+    pos: BoxLayoutOptionMixin
+    box: {
+        width: number,
+        height: number
+    }
+}
+
+class Thumbnail {
+
+    group = new graphic.Group();
+    _parent: graphic.Group;
+
+    _widthProportion: number;
+    _heightProportion: number;
+
+    _selectedRect: graphic.Rect;
+    _wrapper: graphic.Rect;
+    _layoutParams: LayoutParams;
+
+    _treeModel: GraphSeriesModel;
+
+    constructor(containerGroup: graphic.Group) {
+        containerGroup.add(this.group);
+        this._parent = containerGroup;
+    }
+
+    render(seriesModel: GraphSeriesModel, api: ExtensionAPI) {
+        const model = seriesModel.getModel('thumbnail');
+        const group = this.group;
+
+        group.removeAll();
+        if (!model.get('show')) {
+          return;
+        }
+
+        this._treeModel = seriesModel;
+
+        const childrenNodes = (this._parent.children()[0] as 
graphic.Group).children();
+        const symbolNodes = (childrenNodes[0] as graphic.Group).children();
+        const lineNodes = (childrenNodes[1] as graphic.Group).children();
+
+        const backgroundColor = model.getModel('backgroundColor');
+        const borderColor = model.getModel('borderColor');
+        const thumbnailWidth = model.get('width');
+        const thumbnailHeight = model.get('height');
+        const selectedDataBackground = 
model.getModel('selectedDataBackground');
+
+        this._layoutParams = {
+            pos: {
+                left: model.get('left'),
+                right: model.get('right'),
+                top: model.get('top'),
+                bottom: model.get('bottom')
+            },
+            box: {
+                width: api.getWidth(),
+                height: api.getHeight()
+            }
+        };
+
+          const layoutParams = this._layoutParams;
+
+          this._widthProportion = <number>thumbnailWidth / 
layoutParams.box.width;
+          this._heightProportion = <number>thumbnailHeight / 
layoutParams.box.height;
+
+          const thumbnailGroup = new graphic.Group();
+
+        for (const node of symbolNodes) {
+              const sub = (node as graphic.Group).children()[0];
+              const x = (node as SymbolClz).x;
+              const y = (node as SymbolClz).y;
+
+              const subThumbnail = new (sub as any).constructor({
+                  shape: {
+                        ...(sub as graphic.Path).shape,
+                        width: 5,
+                        height: 5,
+                        x: (x * 0.25 - 2.5),
+                        y: (y * 0.25 - 2.5)
+                      },
+                  style: (sub as graphic.Path).style,
+                  z: 3,
+                  z2: 151
+              });
+
+              thumbnailGroup.add(subThumbnail);
+        }
+
+      for (const node of lineNodes) {
+          const line = (node as graphic.Group).children()[0];
+          const lineThumbnail = new ECLinePath({
+              style: (line as ECLinePath).style,
+              shape: (line as ECLinePath).shape,
+              scaleX: 0.25,
+              scaleY: 0.25,
+              z: 3,

Review Comment:
   sorry, I don't understand how to use `z` in this link



-- 
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: commits-unsubscr...@echarts.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org
For additional commands, e-mail: commits-h...@echarts.apache.org

Reply via email to