MCPcopy Index your code
hub / github.com/apache/echarts / ThumbnailView

Class ThumbnailView

src/component/thumbnail/ThumbnailView.ts:43–315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41
42
43export class ThumbnailView extends ComponentView {
44
45 static type = 'thumbnail' as const;
46 type = ThumbnailView.type;
47
48 private _api: ExtensionAPI;
49 private _model: ThumbnailModel;
50 private _bgRect: Rect;
51 private _windowRect: Rect;
52 private _contentRect: BoundingRect;
53 private _targetGroup: Group;
54 private _transThisToTarget: matrix.MatrixArray;
55 private _roamController: RoamController;
56 private _coordSys: View;
57 private _bridgeRendered: ThumbnailBridgeRendered | NullUndefined;
58
59 // The version of rendering result.
60 // `render`/`updateContent`/`updateWindow` can be called separatedly and the order
61 // is not guaranteed. Use version to ensure the consistency.
62 private _renderVersion: number;
63
64 render(thumbnailModel: ThumbnailModel, ecModel: GlobalModel, api: ExtensionAPI): void {
65 this._api = api;
66 this._model = thumbnailModel;
67 if (!this._coordSys) {
68 this._coordSys = new View();
69 }
70
71 if (!this._isEnabled()) {
72 this._clear();
73 return;
74 }
75
76 this._renderVersion = api.getECUpdateCycleVersion();
77 const group = this.group;
78
79 group.removeAll();
80
81 const itemStyleModel = thumbnailModel.getModel('itemStyle');
82 const itemStyle = itemStyleModel.getItemStyle();
83 if (itemStyle.fill == null) {
84 itemStyle.fill = ecModel.get('backgroundColor') || tokens.color.neutral00;
85 }
86
87 const refContainer = createBoxLayoutReference(thumbnailModel, api).refContainer;
88 const boxRect = getLayoutRect(
89 getBoxLayoutParams(thumbnailModel, true),
90 refContainer
91 );
92 const boxBorderWidth = itemStyle.lineWidth || 0;
93 const contentRect = this._contentRect = expandOrShrinkRect(
94 boxRect.clone(), boxBorderWidth / 2, true, true
95 );
96
97 const contentGroup = new Group();
98 group.add(contentGroup);
99 contentGroup.setClipPath(new Rect({shape: contentRect.plain()}));
100

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…