9615315a8494ac21f788da298f55a188a43305619a3665b186e9c99b4c0d069461aa8123b12f7b3a8020fc8cc4f2e81c4cd14f5e1c4012c3cd037cd57d8896 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import ZRText from 'zrender/lib/graphic/Text.js';
  2. import { LabelLayoutOption } from '../util/types.js';
  3. import { BoundingRect, OrientedBoundingRect, Polyline } from '../util/graphic.js';
  4. interface LabelLayoutListPrepareInput {
  5. label: ZRText;
  6. labelLine?: Polyline;
  7. computedLayoutOption?: LabelLayoutOption;
  8. priority: number;
  9. defaultAttr: {
  10. ignore: boolean;
  11. labelGuideIgnore?: boolean;
  12. };
  13. }
  14. export interface LabelLayoutInfo {
  15. label: ZRText;
  16. labelLine: Polyline;
  17. priority: number;
  18. rect: BoundingRect;
  19. localRect: BoundingRect;
  20. obb?: OrientedBoundingRect;
  21. axisAligned: boolean;
  22. layoutOption: LabelLayoutOption;
  23. defaultAttr: {
  24. ignore: boolean;
  25. labelGuideIgnore?: boolean;
  26. };
  27. transform: number[];
  28. }
  29. export declare function prepareLayoutList(input: LabelLayoutListPrepareInput[]): LabelLayoutInfo[];
  30. /**
  31. * Adjust labels on x direction to avoid overlap.
  32. */
  33. export declare function shiftLayoutOnX(list: Pick<LabelLayoutInfo, 'rect' | 'label'>[], leftBound: number, rightBound: number, balanceShift?: boolean): boolean;
  34. /**
  35. * Adjust labels on y direction to avoid overlap.
  36. */
  37. export declare function shiftLayoutOnY(list: Pick<LabelLayoutInfo, 'rect' | 'label'>[], topBound: number, bottomBound: number, balanceShift?: boolean): boolean;
  38. export declare function hideOverlap(labelList: LabelLayoutInfo[]): void;
  39. export {};