MCPcopy
hub / github.com/apache/echarts / TreeView

Class TreeView

src/chart/tree/TreeView.ts:133–317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131}
132
133class TreeView extends ChartView {
134
135 static readonly type = SERIES_TYPE_TREE;
136 readonly type = SERIES_TYPE_TREE;
137
138 private _mainGroup = new graphic.Group();
139
140 private _controller: RoamController;
141
142 private _data: SeriesData<TreeSeriesModel>;
143
144 private _min: number[];
145 private _max: number[];
146 private _firstRender: boolean;
147
148 init(ecModel: GlobalModel, api: ExtensionAPI) {
149 this._controller = new RoamController(api.getZr());
150 this.group.add(this._mainGroup);
151 this._firstRender = true;
152 }
153
154 render(
155 seriesModel: TreeSeriesModel,
156 ecModel: GlobalModel,
157 api: ExtensionAPI
158 ) {
159 const data = seriesModel.getData();
160
161 const layoutInfo = seriesModel.layoutInfo;
162
163 const group = this._mainGroup;
164
165 const layout = seriesModel.get('layout');
166
167 if (layout === 'radial') {
168 group.x = layoutInfo.x + layoutInfo.width / 2;
169 group.y = layoutInfo.y + layoutInfo.height / 2;
170 }
171 else {
172 group.x = layoutInfo.x;
173 group.y = layoutInfo.y;
174 }
175
176 this._updateViewCoordSys(seriesModel, api);
177
178 updateRoamControllerSimply(
179 seriesModel,
180 api,
181 this._controller,
182 createIsInSelfByPointerCheckerEl(this.group),
183 null,
184 );
185
186 const oldData = this._data;
187
188 data.diff(oldData)
189 .add(function (newIdx) {
190 if (symbolNeedsDraw(data, newIdx)) {

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…