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

Class DataZoomFeature

src/component/toolbox/feature/DataZoom.ts:78–235  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76type ToolboxDataZoomFeatureModel = ToolboxFeatureModel<ToolboxDataZoomFeatureOption>;
77
78class DataZoomFeature extends ToolboxFeature<ToolboxDataZoomFeatureOption> {
79
80 _brushController: BrushController;
81
82 _isZoomActive: boolean;
83
84 render(
85 featureModel: ToolboxDataZoomFeatureModel,
86 ecModel: GlobalModel,
87 api: ExtensionAPI,
88 payload: Payload
89 ) {
90 if (!this._brushController) {
91 this._brushController = new BrushController(api.getZr());
92 this._brushController.on('brush', zrUtil.bind(this._onBrush, this))
93 .mount();
94 }
95 updateZoomBtnStatus(featureModel, ecModel, this, payload, api);
96 updateBackBtnStatus(featureModel, ecModel);
97 }
98
99 onclick(
100 ecModel: GlobalModel,
101 api: ExtensionAPI,
102 type: IconType
103 ) {
104 handlers[type].call(this);
105 }
106
107 dispose(
108 ecModel: GlobalModel,
109 api: ExtensionAPI
110 ) {
111 this._brushController && this._brushController.dispose();
112 }
113
114 private _onBrush(eventParam: BrushControllerEvents['brush']): void {
115 const areas = eventParam.areas;
116 if (!eventParam.isEnd || !areas.length) {
117 return;
118 }
119 const snapshot: history.DataZoomStoreSnapshot = {};
120 const ecModel = this.ecModel;
121
122 this._brushController.updateCovers([]); // remove cover
123
124 const brushTargetManager = new BrushTargetManager(
125 makeAxisFinder(this.model),
126 ecModel,
127 {include: ['grid']}
128 );
129 brushTargetManager.matchOutputRanges(areas, ecModel, function (area, coordRange, coordSys: Cartesian2D) {
130 if (coordSys.type !== 'cartesian2d') {
131 return;
132 }
133
134 const coordSysRect = coordSys.master.getRect().clone();
135

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…