09a69a53d76ee68ac1a7bc959967de8db70af93b162e0c6acd0a70e559bdf19812156b953288032773ffca62580861732ca61b5bfccc666a649c388cb5b29f 1.6 KB

12345678910111213141516171819202122232425262728293031
  1. import { Point, Polyline } from '../util/graphic.js';
  2. import Element from 'zrender/lib/Element.js';
  3. import { LabelLineOption, DisplayState, StatesOptionMixin } from '../util/types.js';
  4. import Model from '../model/Model.js';
  5. import * as vector from 'zrender/lib/core/vector.js';
  6. /**
  7. * Calculate a proper guide line based on the label position and graphic element definition
  8. * @param label
  9. * @param labelRect
  10. * @param target
  11. * @param targetRect
  12. */
  13. export declare function updateLabelLinePoints(target: Element, labelLineModel: Model<LabelLineOption>): void;
  14. /**
  15. * Reduce the line segment attached to the label to limit the turn angle between two segments.
  16. * @param linePoints
  17. * @param minTurnAngle Radian of minimum turn angle. 0 - 180
  18. */
  19. export declare function limitTurnAngle(linePoints: number[][], minTurnAngle: number): void;
  20. /**
  21. * Limit the angle of line and the surface
  22. * @param maxSurfaceAngle Radian of minimum turn angle. 0 - 180. 0 is same direction to normal. 180 is opposite
  23. */
  24. export declare function limitSurfaceAngle(linePoints: vector.VectorArray[], surfaceNormal: Point, maxSurfaceAngle: number): void;
  25. declare type LabelLineModel = Model<LabelLineOption>;
  26. /**
  27. * Create a label line if necessary and set it's style.
  28. */
  29. export declare function setLabelLineStyle(targetEl: Element, statesModels: Record<DisplayState, LabelLineModel>, defaultStyle?: Polyline['style']): void;
  30. export declare function getLabelLineStatesModels<LabelName extends string = 'labelLine'>(itemModel: Model<StatesOptionMixin<any, any> & Partial<Record<LabelName, any>>>, labelLineName?: LabelName): Record<DisplayState, LabelLineModel>;
  31. export {};