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

Method render

src/component/tooltip/TooltipView.ts:179–217  ·  view source on GitHub ↗
(
        tooltipModel: TooltipModel,
        ecModel: GlobalModel,
        api: ExtensionAPI
    )

Source from the content-addressed store, hash-verified

177 }
178
179 render(
180 tooltipModel: TooltipModel,
181 ecModel: GlobalModel,
182 api: ExtensionAPI
183 ) {
184 if (env.node || !api.getDom()) {
185 return;
186 }
187
188 // Reset
189 this.group.removeAll();
190
191 this._tooltipModel = tooltipModel;
192
193 this._ecModel = ecModel;
194
195 this._api = api;
196
197 const tooltipContent = this._tooltipContent;
198 tooltipContent.update(tooltipModel);
199 tooltipContent.setEnterable(tooltipModel.get('enterable'));
200
201 this._initGlobalListener();
202
203 this._keepShow();
204
205 // PENDING
206 // `mousemove` event will be triggered very frequently when the mouse moves fast,
207 // which causes that the `updatePosition` function was also called frequently.
208 // In Chrome with devtools open and Firefox, tooltip looks laggy and shakes. See #14695 #16101
209 // To avoid frequent triggering,
210 // consider throttling it in 50ms when transition is enabled
211 if (this._renderMode !== 'richText' && tooltipModel.get('transitionDuration')) {
212 createOrUpdate(this, '_updatePosition', 50, 'fixRate');
213 }
214 else {
215 clear(this, '_updatePosition');
216 }
217 }
218
219 private _initGlobalListener() {
220 const tooltipModel = this._tooltipModel;

Callers

nothing calls this directly

Calls 8

_initGlobalListenerMethod · 0.95
_keepShowMethod · 0.95
createOrUpdateFunction · 0.90
clearFunction · 0.90
getDomMethod · 0.80
updateMethod · 0.65
setEnterableMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected