vue3-network-graph 0.1.9 → 0.2.2
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 +2 -2
- package/README.md +2 -2
- package/dist/index.d.ts +59 -3
- package/dist/index.mjs +787 -706
- package/dist/index.umd.cjs +5 -5
- package/package.json +1 -1
package/README.en.md
CHANGED
|
@@ -353,6 +353,7 @@ const handleMethods = () => {
|
|
|
353
353
|
| `showCenterPoint` | `Boolean` | `false` | Canvas center cross marker |
|
|
354
354
|
| `showEdgeTextBg` | `Boolean` | `false` | Connection text background |
|
|
355
355
|
| `edgeTextBgColor` | `String` | `#0a0e1a` | Connection text background color |
|
|
356
|
+
| `edgeCenterTextFollowLine` | `Boolean` | `true` | Whether the center label rotates along the line: `true` follows the line tangent (current), `false` always stays horizontal |
|
|
356
357
|
| `showNodeHandles` | `Boolean` | `false` | Node handles (four small circles appear at top/bottom/left/right of nodes, auto-connect when dragged to another node) |
|
|
357
358
|
| `showStatusDot` | `Boolean` | `true` | Status dot at top-right corner of each node |
|
|
358
359
|
| `labelGap` | `Number` | `18` | Fixed gap between node box edge and its label (px at 1x zoom) |
|
|
@@ -370,7 +371,6 @@ const handleMethods = () => {
|
|
|
370
371
|
| `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
372
|
| `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
373
|
| `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
374
|
|
|
375
375
|
### radialGradient Configuration
|
|
376
376
|
|
|
@@ -700,7 +700,7 @@ group boxes → node plate (background + border) → edges (base / glow / partic
|
|
|
700
700
|
|
|
701
701
|
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
702
|
|
|
703
|
-
With `config.highlightEdgeOnTop` (default `true`) selected edges are additionally painted above the node content,
|
|
703
|
+
With `config.highlightEdgeOnTop` (default `true`) selected edges are additionally painted above the node content, so the path under inspection is never hidden.
|
|
704
704
|
|
|
705
705
|
### TypeScript Support
|
|
706
706
|
|
package/README.md
CHANGED
|
@@ -353,6 +353,7 @@ const handleMethods = () => {
|
|
|
353
353
|
| `showCenterPoint` | `Boolean` | `false` | 画布中心十字标记 |
|
|
354
354
|
| `showEdgeTextBg` | `Boolean` | `false` | 连线文字底牌 |
|
|
355
355
|
| `edgeTextBgColor` | `String` | `#0a0e1a` | 连线文字底牌颜色 |
|
|
356
|
+
| `edgeCenterTextFollowLine` | `Boolean` | `true` | 中心文字是否跟随线方向旋转:`true` 随线倾斜(现状),`false` 始终保持水平 |
|
|
356
357
|
| `showNodeHandles` | `Boolean` | `false` | 节点手柄(开启后节点上下左右出现四个小圆圈,拖到另一节点松开自动连线) |
|
|
357
358
|
| `showStatusDot` | `Boolean` | `true` | 节点右上角状态圆点开关 |
|
|
358
359
|
| `labelGap` | `Number` | `18` | 节点标签与节点盒边缘的固定间距(1x 缩放下 px) |
|
|
@@ -370,7 +371,6 @@ const handleMethods = () => {
|
|
|
370
371
|
| `imageNodeBySource` | `Boolean` | `false` | **图片节点全局判定**:`true` 时节点只要带图片地址就按图片节点渲染(忽略 `nodeType`);文本节点、纯边框节点不受影响 |
|
|
371
372
|
| `edgeLayer` | `"split" \| "below"` | `"split"` | 节点与连线的绘制顺序:`split` 把节点拆两层——底板+边框在下、图标/图片/标签在上,连线夹在中间(线穿过节点不再被整块盖住);`below` 为传统的「所有连线在所有节点之下」 |
|
|
372
373
|
| `highlightEdgeOnTop` | `Boolean` | `true` | 选中的连线额外绘制在节点层之上,避免高亮链路被节点底板或图标遮挡(纯装饰层,不参与点击命中) |
|
|
373
|
-
| `edgeCasingColor` | `String` | `#0a0e1a` | 提升到节点之上的连线外描边(casing)颜色,保证线压在任何节点图形上都清晰可读 |
|
|
374
374
|
|
|
375
375
|
### radialGradient 配置
|
|
376
376
|
|
|
@@ -700,7 +700,7 @@ const methods = () => {
|
|
|
700
700
|
|
|
701
701
|
这样连线穿过节点——或节点互相重叠时——会**压在节点底板上继续可见**,只被图标本体局部遮挡,不会整段消失。若需要传统的「所有连线都在所有节点之下」,设 `edgeLayer: "below"`。
|
|
702
702
|
|
|
703
|
-
配合 `config.highlightEdgeOnTop`(默认 `true
|
|
703
|
+
配合 `config.highlightEdgeOnTop`(默认 `true`),被选中的连线还会在节点内容之上再画一遍,保证正在查看的链路永远不会被节点挡住。
|
|
704
704
|
|
|
705
705
|
### TypeScript 支持
|
|
706
706
|
|
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,39 @@ 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
|
+
/**
|
|
156
|
+
* Whether the edge `centerText` label rotates along the line direction.
|
|
157
|
+
* - `true` (default): label follows the line tangent, like today.
|
|
158
|
+
* - `false`: label always stays horizontal on screen; only its anchor
|
|
159
|
+
* point still tracks the path midpoint. Affects `centerText` only —
|
|
160
|
+
* `fromText` / `toText` and the merged-bundle count badge still follow
|
|
161
|
+
* the line.
|
|
162
|
+
*/
|
|
163
|
+
edgeCenterTextFollowLine?: boolean;
|
|
164
|
+
/** 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. */
|
|
165
|
+
edgeColor?: string;
|
|
166
|
+
/** Alias for `edgeColor` */
|
|
167
|
+
defaultEdgeColor?: string;
|
|
168
|
+
/** Global static line color (the solid line visible when animations are off) — default legacy "#1a2744". Per-edge `edge.baseColor` wins. */
|
|
169
|
+
edgeBaseColor?: string;
|
|
170
|
+
/**
|
|
171
|
+
* Opacity (0-1) of the solid base line of edges while the edge animation
|
|
172
|
+
* mode is NOT "none" (flow / particle / all), so the moving layer stands
|
|
173
|
+
* out. Default 0.45; 1 disables dimming; mode "none" restores full
|
|
174
|
+
* opacity. Per-edge `edge.baseDimOpacity` overrides (explicit values
|
|
175
|
+
* always apply, even on edges with animation switched off).
|
|
176
|
+
*/
|
|
177
|
+
edgeBaseDimOpacity?: number;
|
|
178
|
+
/** Global default color for edge CENTER text (per-edge centerText.color / edge.fontColor win); from/to texts fall back to "#000000" */
|
|
179
|
+
edgeCenterTextColor?: string;
|
|
180
|
+
/** Ants-marching dashed flow on edges (per-edge `edge.dashFlow` overrides). Independent of motionFx flow/particle layers. */
|
|
181
|
+
edgeDashFlow?: boolean;
|
|
182
|
+
/** Dash pattern of the dashed flow line — e.g. "10 8" or [10, 8] (default "10 8") */
|
|
183
|
+
edgeDashPattern?: string | number[];
|
|
184
|
+
/** Stroke width of the dashed flow line (default 2, per-edge edge.dashFlowWidth overrides) */
|
|
185
|
+
edgeDashFlowWidth?: number;
|
|
128
186
|
showNodeHandles?: boolean;
|
|
129
187
|
/** Status dot at each node's top-right corner (shown by default) */
|
|
130
188
|
showStatusDot?: boolean;
|
|
@@ -161,8 +219,6 @@ export interface TopologyConfig {
|
|
|
161
219
|
* never hidden by a node plate or icon. Default true.
|
|
162
220
|
*/
|
|
163
221
|
highlightEdgeOnTop?: boolean;
|
|
164
|
-
/** Casing color drawn under a promoted (selected) edge — default "#0a0e1a". */
|
|
165
|
-
edgeCasingColor?: string;
|
|
166
222
|
/**
|
|
167
223
|
* Delete the current selection when Delete / Backspace is pressed
|
|
168
224
|
* (only while editable and something is selected; form fields are never
|