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

Class BarView

src/chart/bar/BarView.ts:98–676  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96
97
98class BarView extends ChartView {
99 static readonly type = SERIES_TYPE_BAR;
100 readonly type = SERIES_TYPE_BAR;
101
102 private _data: SeriesData;
103
104 private _isLargeDraw: boolean;
105
106 private _isFirstFrame: boolean; // First frame after series added
107 private _onRendered: EventCallback;
108
109 private _backgroundGroup: Group;
110
111 private _backgroundEls: (Rect | Sector)[];
112
113 private _model: BarSeriesModel;
114
115 private _progressiveEls: Element[];
116
117 constructor() {
118 super();
119 this._isFirstFrame = true;
120 }
121
122 render(seriesModel: BarSeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload) {
123 this._model = seriesModel;
124
125 this._removeOnRenderedListener(api);
126
127 this._updateDrawMode(seriesModel);
128
129 const coordinateSystemType = seriesModel.get('coordinateSystem');
130
131 if (coordinateSystemType === 'cartesian2d'
132 || coordinateSystemType === 'polar'
133 ) {
134 // Clear previously rendered progressive elements.
135 this._progressiveEls = null;
136
137 this._isLargeDraw
138 ? this._renderLarge(seriesModel, ecModel, api)
139 : this._renderNormal(seriesModel, ecModel, api, payload);
140 }
141 else if (__DEV__) {
142 warn('Only cartesian2d and polar supported for bar.');
143 }
144 }
145
146 incrementalPrepareRender(seriesModel: BarSeriesModel): void {
147 this._clear();
148 this._updateDrawMode(seriesModel);
149 // incremental also need to clip, otherwise might be overlow.
150 // But must not set clip in each frame, otherwise all of the children will be marked redraw.
151 this._updateLargeClip(seriesModel);
152 }
153
154 incrementalRender(params: StageHandlerProgressParams, seriesModel: BarSeriesModel): void {
155 // Reset for eachRendered

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…