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


##########
src/chart/graph/GraphView.ts:
##########
@@ -312,6 +335,13 @@ class GraphView extends ChartView {
         this._symbolDraw && this._symbolDraw.remove();
         this._lineDraw && this._lineDraw.remove();
     }
+
+    private _renderThumbnail(seriesModel: GraphSeriesModel, api: ExtensionAPI) 
{
+        if (this._thumbanil) {

Review Comment:
   Use `this.group.remove(this._thumbnail.group)` to remove the whole group



##########
src/chart/graph/Thumbnail.ts:
##########
@@ -0,0 +1,242 @@
+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 * as zrUtil from 'zrender/src/core/util';
+
+interface LayoutParams {
+    pos: BoxLayoutOptionMixin
+    box: {
+        width: number,
+        height: number
+    }
+}
+
+class Thumbnail {
+
+    group = new graphic.Group();
+    _parent: graphic.Group;
+
+    _selectedRect: graphic.Rect;
+
+    _layoutParams: LayoutParams;
+
+    _graphModel: GraphSeriesModel;
+
+    _thumbnailSystem: graphic.Rect;
+
+    _wrapper: graphic.Rect;
+
+    _height: number;
+    _width: number;
+
+    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._graphModel = 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 lineGroup = new graphic.Group();
+        const symbolGroup = new graphic.Group();
+
+        const itemStyle = model.getModel('itemStyle');
+        this._height = model.getModel('height').option;

Review Comment:
   use `model.get('height')`



-- 
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