(
tooltipModel: TooltipModel,
ecModel: GlobalModel,
api: ExtensionAPI
)
| 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; |
nothing calls this directly
no test coverage detected