MCPcopy Index your code
hub / github.com/apache/echarts / update

Method update

src/component/tooltip/TooltipHTMLContent.ts:374–402  ·  view source on GitHub ↗

* Update when tooltip is rendered

(tooltipModel: Model<TooltipOption>)

Source from the content-addressed store, hash-verified

372 * Update when tooltip is rendered
373 */
374 update(tooltipModel: Model<TooltipOption>) {
375 // FIXME
376 // Move this logic to ec main?
377 if (!this._container) {
378 const container = this._api.getDom();
379 const position = getComputedStyle(container, 'position');
380 const domStyle = container.style;
381 if (domStyle.position !== 'absolute' && position !== 'absolute') {
382 domStyle.position = 'relative';
383 }
384 }
385
386 // move tooltip if chart resized
387 const alwaysShowContent = tooltipModel.get('alwaysShowContent');
388 alwaysShowContent && this._moveIfResized();
389
390 // update alwaysShowContent
391 this._alwaysShowContent = alwaysShowContent;
392
393 this._enableDisplayTransition = tooltipModel.get('displayTransition')
394 && tooltipModel.get('transitionDuration') > 0;
395
396 // update className
397 this.el.className = tooltipModel.get('className') || '';
398
399 // Hide the tooltip
400 // PENDING
401 // this.hide();
402 }
403
404 show(tooltipModel: Model<TooltipOption>, nearPointColor: ZRColor) {
405 clearTimeout(this._hideTimeout);

Callers

nothing calls this directly

Calls 4

_moveIfResizedMethod · 0.95
getComputedStyleFunction · 0.90
getDomMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected