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

Function labelIntersect

src/label/labelLayoutHelper.ts:586–608  ·  view source on GitHub ↗
(
    baseLayoutInfo: LabelGeometry | NullUndefined,
    targetLayoutInfo: LabelGeometry | NullUndefined,
    mtv?: PointLike,
    intersectOpt?: BoundingRectIntersectOpt
)

Source from the content-addressed store, hash-verified

584 * Typically this method (and the entire layout process) is performed in normal state.
585 */
586export function labelIntersect(
587 baseLayoutInfo: LabelGeometry | NullUndefined,
588 targetLayoutInfo: LabelGeometry | NullUndefined,
589 mtv?: PointLike,
590 intersectOpt?: BoundingRectIntersectOpt
591): boolean {
592 if (!baseLayoutInfo || !targetLayoutInfo) {
593 return false;
594 }
595 if ((baseLayoutInfo.label && baseLayoutInfo.label.ignore)
596 || (targetLayoutInfo.label && targetLayoutInfo.label.ignore)
597 ) {
598 return false;
599 }
600 // Fast rejection.
601 if (!baseLayoutInfo.rect.intersect(targetLayoutInfo.rect, mtv, intersectOpt)) {
602 return false;
603 }
604 if (baseLayoutInfo.axisAligned && targetLayoutInfo.axisAligned) {
605 return true; // obb is the same as the normal bounding rect.
606 }
607 return ensureOBB(baseLayoutInfo).intersect(ensureOBB(targetLayoutInfo), mtv, intersectOpt);
608}

Callers 4

adjustBreakLabelPairFunction · 0.90
moveIfOverlapFunction · 0.90
dealFunction · 0.90
hideOverlapFunction · 0.85

Calls 2

ensureOBBFunction · 0.85
intersectMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…