vue3-network-graph 0.1.9 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +1 -2
- package/README.md +1 -2
- package/dist/index.d.ts +50 -3
- package/dist/index.mjs +809 -734
- package/dist/index.umd.cjs +5 -5
- package/package.json +1 -1
package/README.en.md
CHANGED
|
@@ -370,7 +370,6 @@ const handleMethods = () => {
|
|
|
370
370
|
| `imageNodeBySource` | `Boolean` | `false` | **Global image-node rule**: when `true`, any node carrying a picture source is rendered as an image node (its `nodeType` is ignored); text and border-only nodes are unaffected |
|
|
371
371
|
| `edgeLayer` | `"split" \| "below"` | `"split"` | Paint order of nodes vs edges: `split` paints each node in two passes — plate + border below, icon / image / label above, with edges in between (a line crossing a node stays visible); `below` is the classic "all edges under all nodes" |
|
|
372
372
|
| `highlightEdgeOnTop` | `Boolean` | `true` | Selected edges are re-painted above the node layer so the highlighted path is never hidden by a node plate or icon (decoration only — it never captures clicks) |
|
|
373
|
-
| `edgeCasingColor` | `String` | `#0a0e1a` | Casing color drawn under a promoted (selected) edge so the line stays readable on any node artwork |
|
|
374
373
|
|
|
375
374
|
### radialGradient Configuration
|
|
376
375
|
|
|
@@ -700,7 +699,7 @@ group boxes → node plate (background + border) → edges (base / glow / partic
|
|
|
700
699
|
|
|
701
700
|
An edge crossing a node — or a node overlapping another node — therefore keeps running **across the node plate**, and is only partly covered by the icon itself instead of disappearing. Set `edgeLayer: "below"` for the classic "all edges under all nodes" order.
|
|
702
701
|
|
|
703
|
-
With `config.highlightEdgeOnTop` (default `true`) selected edges are additionally painted above the node content,
|
|
702
|
+
With `config.highlightEdgeOnTop` (default `true`) selected edges are additionally painted above the node content, so the path under inspection is never hidden.
|
|
704
703
|
|
|
705
704
|
### TypeScript Support
|
|
706
705
|
|
package/README.md
CHANGED
|
@@ -370,7 +370,6 @@ const handleMethods = () => {
|
|
|
370
370
|
| `imageNodeBySource` | `Boolean` | `false` | **图片节点全局判定**:`true` 时节点只要带图片地址就按图片节点渲染(忽略 `nodeType`);文本节点、纯边框节点不受影响 |
|
|
371
371
|
| `edgeLayer` | `"split" \| "below"` | `"split"` | 节点与连线的绘制顺序:`split` 把节点拆两层——底板+边框在下、图标/图片/标签在上,连线夹在中间(线穿过节点不再被整块盖住);`below` 为传统的「所有连线在所有节点之下」 |
|
|
372
372
|
| `highlightEdgeOnTop` | `Boolean` | `true` | 选中的连线额外绘制在节点层之上,避免高亮链路被节点底板或图标遮挡(纯装饰层,不参与点击命中) |
|
|
373
|
-
| `edgeCasingColor` | `String` | `#0a0e1a` | 提升到节点之上的连线外描边(casing)颜色,保证线压在任何节点图形上都清晰可读 |
|
|
374
373
|
|
|
375
374
|
### radialGradient 配置
|
|
376
375
|
|
|
@@ -700,7 +699,7 @@ const methods = () => {
|
|
|
700
699
|
|
|
701
700
|
这样连线穿过节点——或节点互相重叠时——会**压在节点底板上继续可见**,只被图标本体局部遮挡,不会整段消失。若需要传统的「所有连线都在所有节点之下」,设 `edgeLayer: "below"`。
|
|
702
701
|
|
|
703
|
-
配合 `config.highlightEdgeOnTop`(默认 `true
|
|
702
|
+
配合 `config.highlightEdgeOnTop`(默认 `true`),被选中的连线还会在节点内容之上再画一遍,保证正在查看的链路永远不会被节点挡住。
|
|
704
703
|
|
|
705
704
|
### TypeScript 支持
|
|
706
705
|
|
package/dist/index.d.ts
CHANGED
|
@@ -44,16 +44,41 @@ export interface TopologyNode {
|
|
|
44
44
|
|
|
45
45
|
export type TopologyEdgeLabel =
|
|
46
46
|
| string
|
|
47
|
-
| {
|
|
47
|
+
| {
|
|
48
|
+
text?: string;
|
|
49
|
+
rotation?: number;
|
|
50
|
+
fontSize?: number;
|
|
51
|
+
color?: string;
|
|
52
|
+
/** Show the background plate for this label (overrides config.showEdgeTextBg) */
|
|
53
|
+
showBg?: boolean;
|
|
54
|
+
/** Background plate color (overrides config.edgeTextBgColor) */
|
|
55
|
+
bgColor?: string;
|
|
56
|
+
/** Background plate opacity 0-1 (overrides config.edgeTextBgOpacity) */
|
|
57
|
+
bgOpacity?: number;
|
|
58
|
+
/** Border style of the plate: solid (default) / dashed / none */
|
|
59
|
+
borderStyle?: "solid" | "dashed" | "none";
|
|
60
|
+
/** Border color (default: the text color at 35% opacity); an explicit color draws at full opacity */
|
|
61
|
+
borderColor?: string;
|
|
62
|
+
};
|
|
48
63
|
|
|
49
64
|
export interface TopologyEdge {
|
|
50
65
|
id: string;
|
|
51
66
|
from: string;
|
|
52
67
|
to: string;
|
|
68
|
+
/** Line color of this edge (animation layers). Takes priority over config.edgeColor and the legacy edge.centerText.color fallback. */
|
|
69
|
+
color?: string;
|
|
70
|
+
/** Static line color of this edge (the solid line visible when animations are off). Priority over config.edgeBaseColor; falls back to edge.color / config.edgeColor when explicitly configured, else legacy "#1a2744". */
|
|
71
|
+
baseColor?: string;
|
|
72
|
+
/** Opacity of this edge's solid base line while the edge animation mode is active (overrides config.edgeBaseDimOpacity — an explicitly set value always applies, even on edges with animation switched off). */
|
|
73
|
+
baseDimOpacity?: number;
|
|
53
74
|
/** flow speed multiplier */
|
|
54
75
|
speed?: number;
|
|
55
76
|
/** Per-edge animation switch: `false` stops this edge's flow + particle layers (works even when the global fx config is on); `true` / unset follow the global config */
|
|
56
77
|
animated?: boolean;
|
|
78
|
+
/** Ants-marching dashed flow for this edge (overrides config.edgeDashFlow when set) */
|
|
79
|
+
dashFlow?: boolean;
|
|
80
|
+
/** Stroke width of this edge's dashed flow line (default 2) */
|
|
81
|
+
dashFlowWidth?: number;
|
|
57
82
|
fromAnchor?: "center" | "edge";
|
|
58
83
|
toAnchor?: "center" | "edge";
|
|
59
84
|
fromText?: TopologyEdgeLabel;
|
|
@@ -125,6 +150,30 @@ export interface TopologyConfig {
|
|
|
125
150
|
showCenterPoint?: boolean;
|
|
126
151
|
showEdgeTextBg?: boolean;
|
|
127
152
|
edgeTextBgColor?: string;
|
|
153
|
+
/** Edge label plate opacity 0-1 (default 0.92) */
|
|
154
|
+
edgeTextBgOpacity?: number;
|
|
155
|
+
/** Global default line color for edges (animation layers AND, when set, the static line). Per-edge `edge.color` wins. Legacy fallback edge.centerText.color still applies to animation layers when unset. */
|
|
156
|
+
edgeColor?: string;
|
|
157
|
+
/** Alias for `edgeColor` */
|
|
158
|
+
defaultEdgeColor?: string;
|
|
159
|
+
/** Global static line color (the solid line visible when animations are off) — default legacy "#1a2744". Per-edge `edge.baseColor` wins. */
|
|
160
|
+
edgeBaseColor?: string;
|
|
161
|
+
/**
|
|
162
|
+
* Opacity (0-1) of the solid base line of edges while the edge animation
|
|
163
|
+
* mode is NOT "none" (flow / particle / all), so the moving layer stands
|
|
164
|
+
* out. Default 0.45; 1 disables dimming; mode "none" restores full
|
|
165
|
+
* opacity. Per-edge `edge.baseDimOpacity` overrides (explicit values
|
|
166
|
+
* always apply, even on edges with animation switched off).
|
|
167
|
+
*/
|
|
168
|
+
edgeBaseDimOpacity?: number;
|
|
169
|
+
/** Global default color for edge CENTER text (per-edge centerText.color / edge.fontColor win); from/to texts fall back to "#000000" */
|
|
170
|
+
edgeCenterTextColor?: string;
|
|
171
|
+
/** Ants-marching dashed flow on edges (per-edge `edge.dashFlow` overrides). Independent of motionFx flow/particle layers. */
|
|
172
|
+
edgeDashFlow?: boolean;
|
|
173
|
+
/** Dash pattern of the dashed flow line — e.g. "10 8" or [10, 8] (default "10 8") */
|
|
174
|
+
edgeDashPattern?: string | number[];
|
|
175
|
+
/** Stroke width of the dashed flow line (default 2, per-edge edge.dashFlowWidth overrides) */
|
|
176
|
+
edgeDashFlowWidth?: number;
|
|
128
177
|
showNodeHandles?: boolean;
|
|
129
178
|
/** Status dot at each node's top-right corner (shown by default) */
|
|
130
179
|
showStatusDot?: boolean;
|
|
@@ -161,8 +210,6 @@ export interface TopologyConfig {
|
|
|
161
210
|
* never hidden by a node plate or icon. Default true.
|
|
162
211
|
*/
|
|
163
212
|
highlightEdgeOnTop?: boolean;
|
|
164
|
-
/** Casing color drawn under a promoted (selected) edge — default "#0a0e1a". */
|
|
165
|
-
edgeCasingColor?: string;
|
|
166
213
|
/**
|
|
167
214
|
* Delete the current selection when Delete / Backspace is pressed
|
|
168
215
|
* (only while editable and something is selected; form fields are never
|