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

Class View

src/coord/View.ts:228–330  ·  view source on GitHub ↗

* [VIEW_COORD_SYS] * * @final [NOTICE] Inheritance of this class is not recommended. Use composition instead.

Source from the content-addressed store, hash-verified

226 * @final [NOTICE] Inheritance of this class is not recommended. Use composition instead.
227 */
228class View extends Transformable implements CoordinateSystemMaster, CoordinateSystem {
229
230 readonly type: string = VIEW_COORD_SYS_TYPE;
231
232 static dimensions = ['x', 'y'];
233 readonly dimensions = ['x', 'y'];
234
235 constructor(
236 invertY?: boolean,
237 legacyCenterBase?: ViewInner['lgCt'],
238 legacyGeo?: Transformable
239 ) {
240 super();
241 const viewInner = inner(this);
242
243 viewInner.invertY = invertY;
244
245 viewInner.lgCt = legacyCenterBase;
246 viewInner.lgGeo = legacyGeo;
247
248 const trans: ViewInner['trans'] = viewInner.trans = [];
249 trans[VIEW_COORD_SYS_TRANS_RAW] = transformableCreate();
250 trans[VIEW_COORD_SYS_TRANS_ROAM] = transformableCreate();
251 trans[VIEW_COORD_SYS_TRANS_OVERALL] = transformableCreate();
252
253 viewInner.mtRaw = matrixCreate();
254 viewInner.mtRawInv = matrixCreate();
255 viewInner.mtOverall = matrixCreate();
256 viewInner.mtOverallInv = matrixCreate();
257
258 viewInner.zoom = 1;
259 }
260
261 /**
262 * @implements CoordinateSystem['getBoundingRect']
263 * @see VIEW_COORD_SYS_TRANS_RAW
264 *
265 * This is a rect in data space.
266 * For historicall reason, the name is `getBoundingRect` - preserve it for backward compatibility.
267 */
268 getBoundingRect(): BoundingRect {
269 return viewCoordSysCopyBoundingRect(null, this);
270 }
271
272 /**
273 * @implements CoordinateSystem['getViewRect']
274 * @see VIEW_COORD_SYS_TRANS_RAW
275 */
276 getViewRect(): BoundingRect {
277 return viewCoordSysCopyViewRect(null, this);
278 }
279
280 /**
281 * @implements CoordinateSystem['getRoamTransform']
282 */
283 getRoamTransform(): MatrixArray {
284 return transformableGetLocalTransform(inner(this).trans[VIEW_COORD_SYS_TRANS_ROAM]);
285 }

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…