* For backward compat, normalize the return from `formatTooltip`.
(result // markersExisting: Dictionary<ColorString>
)
| 20534 | */ |
| 20535 | |
| 20536 | function normalizeTooltipFormatResult(result // markersExisting: Dictionary<ColorString> |
| 20537 | ) { |
| 20538 | var markupText; // let markers: Dictionary<ColorString>; |
| 20539 | |
| 20540 | var markupFragment; |
| 20541 | |
| 20542 | if (isObject(result)) { |
| 20543 | if (result.type) { |
| 20544 | markupFragment = result; |
| 20545 | } else { |
| 20546 | if ("development" !== 'production') { |
| 20547 | console.warn('The return type of `formatTooltip` is not supported: ' + makePrintable(result)); |
| 20548 | } |
| 20549 | } // else { |
| 20550 | // markupText = (result as TooltipFormatResultLegacyObject).html; |
| 20551 | // markers = (result as TooltipFormatResultLegacyObject).markers; |
| 20552 | // if (markersExisting) { |
| 20553 | // markers = zrUtil.merge(markersExisting, markers); |
| 20554 | // } |
| 20555 | // } |
| 20556 | |
| 20557 | } else { |
| 20558 | markupText = result; |
| 20559 | } |
| 20560 | |
| 20561 | return { |
| 20562 | markupText: markupText, |
| 20563 | // markers: markers || markersExisting, |
| 20564 | markupFragment: markupFragment |
| 20565 | }; |
| 20566 | } |
| 20567 | |
| 20568 | /** |
| 20569 | * @param {Object} define |
no test coverage detected
searching dependent graphs…