* This is the input for label layout and overlap resolving.
| 33 | * This is the input for label layout and overlap resolving. |
| 34 | */ |
| 35 | interface LabelLayoutBase { |
| 36 | label: ZRText |
| 37 | labelLine?: Polyline | NullUndefined |
| 38 | layoutOption?: LabelLayoutOption | NullUndefined |
| 39 | priority: number |
| 40 | // @see `SavedLabelAttr` in `LabelManager.ts` |
| 41 | defaultAttr: { |
| 42 | ignore?: boolean |
| 43 | labelGuideIgnore?: boolean |
| 44 | } |
| 45 | // To replace user specified `textMargin` or `minMargin`. |
| 46 | // Format: `[top, right, bottom, left]` |
| 47 | // e.g., `[0, null, 0, null]` means that the top and bottom margin is replaced as `0`, |
| 48 | // and use the original settings of left and right margin. |
| 49 | marginForce?: (number | NullUndefined)[] | NullUndefined; |
| 50 | // For backward compatibility for `minMargin`. `minMargin` can only be a number rather than number[], |
| 51 | // some series only apply `minMargin` on top/bottom but disregard left/right. |
| 52 | minMarginForce?: (number | NullUndefined)[] | NullUndefined; |
| 53 | // If no `textMargin` and `minMargin` is specified, use this as default. |
| 54 | // Format: `[top, right, bottom, left]` |
| 55 | marginDefault?: number[] | NullUndefined; |
| 56 | |
| 57 | // In grid (Cartesian) estimation process (for `grid.containLabel` and related overflow resolving handlings), |
| 58 | // the `gridRect` is shrunk gradually according to the last union boundingRect of the axis labels and names. |
| 59 | // But the `ignore` strategy (such as in `hideOverlap` and `fixMinMaxLabelShow`) affects this process |
| 60 | // significantly - the outermost labels might be determined `ignore:true` in a big `gridRect`, but be determined |
| 61 | // `ignore:false` in a shrunk `gridRect`. (e.g., if the third label touches the outermost label in a shrunk |
| 62 | // `gridRect`.) That probably causes the result overflowing unexpectedly. |
| 63 | // Therefore, `suggestIgnore` is introduced to ensure the `ignore` consistent during that estimation process. |
| 64 | // It suggests that this label has the lowest priority in ignore-if-overlap strategy. |
| 65 | suggestIgnore?: boolean; |
| 66 | } |
| 67 | const LABEL_LAYOUT_BASE_PROPS = [ |
| 68 | 'label', 'labelLine', 'layoutOption', 'priority', 'defaultAttr', |
| 69 | 'marginForce', 'minMarginForce', 'marginDefault', 'suggestIgnore' |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…