(el, visualRectGroupParent)
| 1735 | return; |
| 1736 | |
| 1737 | function travelGroupAndBuildRects(el, visualRectGroupParent) { |
| 1738 | if (el.childrenRef) { // group or text |
| 1739 | var visualRectGroup = createVisualRectGroup(el, visualRectGroupParent) |
| 1740 | var children = el.childrenRef(); |
| 1741 | for (var idx = 0; idx < children.length; idx++) { |
| 1742 | var child = children[idx]; |
| 1743 | travelGroupAndBuildRects(child, visualRectGroup); |
| 1744 | } |
| 1745 | } |
| 1746 | // Both display ZRText and TSpan bounding rect for debuging. |
| 1747 | if (!el.isGroup) { |
| 1748 | createVisualRectForEl(el, visualRectGroupParent); |
| 1749 | } |
| 1750 | |
| 1751 | function createVisualRectForEl(el, visualRectGroup) { |
| 1752 | createRectForDisplayable(el, visualRectGroup); |
| 1753 | var textContent = el.getTextContent(); |
| 1754 | var textGuildLine = el.getTextGuideLine(); |
| 1755 | var textConfig = el.textConfig; |
| 1756 | if (textContent || textGuildLine) { |
| 1757 | var isLocal = textConfig && textConfig.local; |
| 1758 | var targetVisualGroup = isLocal ? visualRectGroup : _bRectGroup; |
| 1759 | textContent && createRectForDisplayable(textContent, targetVisualGroup, true); |
| 1760 | textGuildLine && createRectForDisplayable(textGuildLine, targetVisualGroup, true); |
| 1761 | } |
| 1762 | } |
| 1763 | |
| 1764 | function createVisualRectGroup(fromEl, visualRectGroupParent) { |
| 1765 | var visualRectGroup = new echarts.graphic.Group(); |
| 1766 | copyTransformAttrs(visualRectGroup, fromEl); |
| 1767 | visualRectGroupParent.add(visualRectGroup); |
| 1768 | return visualRectGroup; |
| 1769 | } |
| 1770 | |
| 1771 | function createRectForDisplayable(el, visualRectGroup, useInnerTransformable) { |
| 1772 | var elRawRect = el.getBoundingRect(); |
| 1773 | var visualRect = new echarts.graphic.Rect({ |
| 1774 | shape: {x: elRawRect.x, y: elRawRect.y, width: elRawRect.width, height: elRawRect.height}, |
| 1775 | style: {fill: null, stroke: strokeColor, lineWidth: 1, strokeNoScale: true}, |
| 1776 | silent: silent, |
| 1777 | z: Number.MAX_SAFE_INTEGER |
| 1778 | }); |
| 1779 | visualRect.__testHelperBoundingRectTarget = el; |
| 1780 | var transAttrSource = el; |
| 1781 | if (useInnerTransformable && el.innerTransformable) { |
| 1782 | transAttrSource = el.innerTransformable; |
| 1783 | } |
| 1784 | copyTransformAttrs(visualRect, transAttrSource); |
| 1785 | visualRectGroup.add(visualRect); |
| 1786 | } |
| 1787 | } |
| 1788 | |
| 1789 | function copyTransformAttrs(target, source) { |
| 1790 | target.x = source.x; |
no test coverage detected
searching dependent graphs…