本文へ移動

@eightkk/vue-weave / core / GraphEdgeLabelPlacementOptions

Interface: GraphEdgeLabelPlacementOptions<E> ​

Defined in: src/core/graphLabelPlacement.ts:22

Options of placeGraphEdgeLabels and the NetworkGraph edgeLabelPlacement prop. The font size and glyph width must be finite numbers > 0, gap and margin finite numbers ≥ 0 and samples an integer from 1 to 32; otherwise a RangeError names the option, as for the layouts (for example gap must be a finite number ≥ 0 (got -1) or samples must be an integer from 1 to 32 (got 40)).

Type Parameters ​

E ​

E extends GraphEdge = GraphEdge

Properties ​

edgeIds? ​

optional edgeIds?: Iterable<string, any, any>

Defined in: src/core/graphLabelPlacement.ts:51

Only these edges' labels are placed; the labels of the other edges keep their anchors and are avoided like nodes. Every ID must be an edge in edges. Default: all edges.


edgeWidth? ​

optional edgeWidth?: (edge) => number | null | undefined

Defined in: src/core/graphLabelPlacement.ts:42

The drawn width of an edge in chart units, for edges drawn wider than a thin line, such as the bands of a flow diagram. A label beside such an edge keeps gap from its outer side (gap + width / 2 from its centre line), and other labels avoid its full width. Return nothing (undefined or null) or 0 for a thin line; any other value must be a finite number ≥ 0, else a RangeError names the edge. Default: every edge is a thin line.

Parameters ​

edge ​

E

Returns ​

number | null | undefined


fontSize? ​

optional fontSize?: number

Defined in: src/core/graphLabelPlacement.ts:24

Font size of the labels in chart units, used to estimate their size and baseline. Default 11, the stylesheet's .vw-edge-label size.


gap? ​

optional gap?: number

Defined in: src/core/graphLabelPlacement.ts:35

Distance between a route and a label placed beside it. Default 3.


glyphWidth? ​

optional glyphWidth?: number

Defined in: src/core/graphLabelPlacement.ts:26

Average glyph width as a fraction of the font size, used to estimate the label width from its text. Default 0.6.


labelSize? ​

optional labelSize?: (edge, text) => GraphEdgeLabelSize | null | undefined

Defined in: src/core/graphLabelPlacement.ts:31

The exact size of an edge's label, for callers that measure their text. Return nothing (undefined or null) to use the estimate. The box is centred horizontally on the anchor and vertically on anchor.y - 0.35 × fontSize.

Parameters ​

edge ​

E

text ​

string

Returns ​

GraphEdgeLabelSize | null | undefined


labelText? ​

optional labelText?: (edge) => string | undefined

Defined in: src/core/graphLabelPlacement.ts:33

The text of an edge's label. Default: edge.label. Edges without text keep their anchor and are not avoided.

Parameters ​

edge ​

E

Returns ​

string | undefined


margin? ​

optional margin?: number

Defined in: src/core/graphLabelPlacement.ts:44

Free space kept around each label when checking overlaps. Default 2.


obstacles? ​

optional obstacles?: readonly GraphRect[]

Defined in: src/core/graphLabelPlacement.ts:53

More areas to keep labels out of, such as group headers or a legend.


samples? ​

optional samples?: number

Defined in: src/core/graphLabelPlacement.ts:46

Number of positions tried along each route, besides the middles of its longest segments. An integer from 1 to 32. Default 9.

MIT ライセンスで公開しています。