MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / setElementHoverStyle

Function setElementHoverStyle

libs/echarts/echarts.simple.js:17277–17303  ·  view source on GitHub ↗

* Set hover style (namely "emphasis style") of element, based on the current * style of the given `el`. * This method should be called after all of the normal styles have been adopted * to the `el`. See the reason on `setHoverStyle`. * * @param {module:zrender/Element} el Should not be `zrender

(el, hoverStl)

Source from the content-addressed store, hash-verified

17275 * Otherwise, use the default hover style if not provided.
17276 */
17277function setElementHoverStyle(el, hoverStl) {
17278 // For performance consideration, it might be better to make the "hover style" only the
17279 // difference properties from the "normal style", but not a entire copy of all styles.
17280 hoverStl = el.__hoverStl = hoverStl !== false && (el.hoverStyle || hoverStl || {});
17281 el.__hoverStlDirty = true;
17282
17283 // FIXME
17284 // It is not completely right to save "normal"/"emphasis" flag on elements.
17285 // It probably should be saved on `data` of series. Consider the cases:
17286 // (1) A highlighted elements are moved out of the view port and re-enter
17287 // again by dataZoom.
17288 // (2) call `setOption` and replace elements totally when they are highlighted.
17289 if (el.__highlighted) {
17290 // Consider the case:
17291 // The styles of a highlighted `el` is being updated. The new "emphasis style"
17292 // should be adapted to the `el`. Notice here new "normal styles" should have
17293 // been set outside and the cached "normal style" is out of date.
17294 el.__cachedNormalStl = null;
17295 // Do not clear `__cachedNormalZ2` here, because setting `z2` is not a constraint
17296 // of this method. In most cases, `z2` is not set and hover style should be able
17297 // to rollback. Of course, that would bring bug, but only in a rare case, see
17298 // `doSingleLeaveHover` for details.
17299 singleEnterNormal(el);
17300
17301 singleEnterEmphasis(el);
17302 }
17303}
17304
17305function onElementMouseOver(e) {
17306 !shouldSilent(this, e)

Callers

nothing calls this directly

Calls 2

singleEnterNormalFunction · 0.70
singleEnterEmphasisFunction · 0.70

Tested by

no test coverage detected