Interface: GraphTraceHighlight
Highlighting: the neighbourhood of the node or link under the pointer (or of highlight.nodes), and a shortest path between two selected nodes or the two of highlight.path. What is highlighted keeps its look, its label shows even where there was no room for it, and everything else is dimmed; nothing is laid out or built again. A hover comes first, then highlight.nodes, then a path.
Properties
| Property | Type | Default value | Description |
|---|---|---|---|
color? | string | undefined | Color of the highlighted links. Default: each link's own color, made opaque. |
dim? | number | 0.15 | Opacity factor of the nodes, links and labels that are not highlighted while something is. Range: 0 – 1 |
direction? | "both" | "out" | "in" | "both" | With 'neighbors': which links are followed from the hovered node, and from each node reached. 'both': all of them. 'out': only from a link's source to its target, which gives what the node leads to (its descendants). 'in': only from target to source: what leads to it (its ancestors). |
hops? | number | 1 | With 'neighbors': how many links away from the hovered node the highlight reaches. 1: its neighbours; 2: their neighbours too; 0: the node alone. The links between two nodes that are both at the last hop are not part of it. Minimum: 0 |
mode? | "none" | "neighbors" | "path" | "neighbors+path" | "path+neighbors" | "neighbors+path" | What is emphasized, the rest of the graph being dimmed (highlight.dim). 'neighbors': while the pointer is over a node, the node, the links that lead from it and the nodes they lead to (highlight.hops, highlight.direction); over a link, the link and its two ends. 'path': while exactly two nodes are selected, a shortest path between them. 'none': neither. Hover highlighting is skipped for a graph of more than 50,000 nodes and links together. |
nodes? | DataColumn | undefined | Node indices whose neighbourhood is highlighted as a hover on each of them would (highlight.hops, highlight.direction), whatever highlight.mode says, until this is unset: for a highlight that the app drives (a search box, a linked view, a story). The pointer over a node or link takes its place while it is there. |
path? | readonly number[] | undefined | Two node indices: a shortest path from the first to the second is highlighted, whatever is selected, until this is unset. Nothing is highlighted when there is no such path. graphPath(trace) returns the path that is highlighted. |
pathdirected? | boolean | undefined | Whether a path follows every link from its source to its target only. Default: true when the links have arrowheads at their targets (link.arrow.end), else false: a path may run along a link either way. |
pathweight? | "value" | "hops" | "hops" | What makes a path short. 'hops': the number of its links. 'value': the sum of its links' link.value, each taken as a cost or a distance (a link without a positive value costs 1). |