vue3-network-graph 0.1.2 → 0.1.3

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 CHANGED
@@ -140,7 +140,7 @@ Wherever an edge and a node overlap, clicks/drags act on the **node**; edges sta
140
140
 
141
141
  | Prop | Type | Default | Description |
142
142
  | ------------------ | --------- | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
143
- | `nodes` | `Array` | `[]` | `id` `label` `type` `state` `x` `y` `width` `height` `fontColor` `fontSize` `fontWeight` `borderColor` `borderWidth` `borderStyle` `background` `labelPosition`(`top`/`center`/`bottom`) `rotation`; `type: "text"` for text-only nodes |
143
+ | `nodes` | `Array` | `[]` | `id` `label` `type` `state` `x` `y` `width` `height` `fontColor` `fontSize` `fontWeight` `borderColor` `borderWidth` `borderStyle` `borderRadius` `background` `labelPosition`(`top`/`center`/`bottom`) `rotation`; `type: "text"` for text-only nodes |
144
144
  | `edges` | `Array` | `[]` | `id` `from` `to` `speed` `animated` (per-edge animation switch; `false` stops this edge's flow + particles) `fromAnchor` `toAnchor` (`center`/`edge` boundary intersection) `fromText` `centerText` `toText` `endMarker` (`none`/`arrow`/`dot`) `fontSize` `fontColor` |
145
145
  | `groups` | `Array` | `[]` | Dashed group frames: `id` `label` `color` `nodeIds` `padding` `rotation` |
146
146
  | `lineMode` | `String` | `"curve"` | `straight` / `polyline` / `curve` (`v-model:line-mode` supported) |
@@ -174,6 +174,7 @@ Wherever an edge and a node overlap, clicks/drags act on the **node**; edges sta
174
174
  | `edgeTextBgColor` | `String` | `#0a0e1a` | Plate color |
175
175
  | `showNodeHandles` | `Boolean` | `false` | Node handles (four small circles for drag-to-connect) |
176
176
  | `showStatusDot` | `Boolean` | `true` | Status dot at each node's top-right corner (**shown by default**; set `false` to hide all) |
177
+ | `labelGap` | `Number` | `18` | Fixed gap (px at 1x zoom) between the node box edge and its label, independent of node size; applies to `top` / default (bottom) labels |
177
178
  | `watchDataChanges` | `Boolean` | `false` | In-component data change tracking (debounced 300ms → `data-change`) |
178
179
  | `fx` | `Boolean` | auto | Master switch for decorative effects: `false` = all off (cheapest) / `true` = all on / unset = automatic (see "Performance with large graphs") |
179
180
  | `motionFx` / `glowFx` / `breatheFx` | `Boolean` | auto | Per-feature overrides: **connection-line animation (flow + particles)** / edge glow / breathing rings; a single edge can opt out via the data field `edge.animated: false` |
package/README.md CHANGED
@@ -135,7 +135,7 @@ const topoRef = ref(null);
135
135
 
136
136
  | Prop | 类型 | 默认值 | 说明 |
137
137
  | ------------------ | --------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
138
- | `nodes` | `Array` | `[]` | 节点数组:`id` `label` `type` `state` `x` `y` `width` `height` `fontColor` `fontSize` `fontWeight` `borderColor` `borderWidth` `borderStyle` `background` `labelPosition`(`top`/`center`/`bottom`) `rotation`;`type: "text"` 为纯文本节点 |
138
+ | `nodes` | `Array` | `[]` | 节点数组:`id` `label` `type` `state` `x` `y` `width` `height` `fontColor` `fontSize` `fontWeight` `borderColor` `borderWidth` `borderStyle` `borderRadius` `background` `labelPosition`(`top`/`center`/`bottom`) `rotation`;`type: "text"` 为纯文本节点 |
139
139
  | `edges` | `Array` | `[]` | 连线数组:`id` `from` `to` `speed`(流速倍率) `animated`(单条线动画开关,`false` 关闭该线流光/粒子) `fromAnchor` `toAnchor`(`center`/`edge` 边界交点) `fromText` `centerText` `toText` `endMarker`(`none`/`arrow`/`dot`) `fontSize` `fontColor` |
140
140
  | `groups` | `Array` | `[]` | 分组虚线框:`id` `label` `color` `nodeIds` `padding` `rotation` |
141
141
  | `lineMode` | `String` | `"curve"` | 连线模式:`straight` / `polyline` / `curve`(支持 `v-model:line-mode`) |
@@ -169,6 +169,7 @@ const topoRef = ref(null);
169
169
  | `edgeTextBgColor` | `String` | `#0a0e1a` | 连线文字底牌颜色 |
170
170
  | `showNodeHandles` | `Boolean` | `false` | 节点手柄(开启后节点上下左右出现四个小圆圈,拖到另一节点松开自动连线) |
171
171
  | `showStatusDot` | `Boolean` | `true` | 节点右上角状态圆点开关(**默认展示**,设 `false` 隐藏全部) |
172
+ | `labelGap` | `Number` | `18` | 节点标签与节点盒边缘的**固定间距**(1x 缩放下 px),不随节点尺寸变化;`top` / 默认(下方)标签均适用 |
172
173
  | `watchDataChanges` | `Boolean` | `false` | 组件内数据变动检测(拖拽、尺寸调整、手柄连线、删除等,防抖 300ms 后触发 `data-change`) |
173
174
  | `fx` | `Boolean` | 自动 | 装饰动效总开关:`false` 全关(最省性能)/ `true` 全开 / 不设按规模自动(见「性能与大数据量」) |
174
175
  | `motionFx` / `glowFx` / `breatheFx` | `Boolean` | 自动 | 单项覆盖:**连接线动画(流光+粒子)** / 连线发光 / 呼吸灯;单条线可用数据字段 `edge.animated: false` 单独关闭动画 |
package/dist/index.d.ts CHANGED
@@ -28,6 +28,8 @@ export interface TopologyNode {
28
28
  borderWidth?: number;
29
29
  borderStyle?: "dashed" | string;
30
30
  background?: string;
31
+ /** Node box corner radius in px (default 6); applies to the node background, border and selection box. */
32
+ borderRadius?: number;
31
33
  labelPosition?: "top" | "center" | "bottom";
32
34
  [key: string]: unknown;
33
35
  }
@@ -118,6 +120,8 @@ export interface TopologyConfig {
118
120
  showNodeHandles?: boolean;
119
121
  /** Status dot at each node's top-right corner (shown by default) */
120
122
  showStatusDot?: boolean;
123
+ /** Fixed gap (px at 1x zoom) between the node box edge and its label, regardless of node size (default 18). */
124
+ labelGap?: number;
121
125
  watchDataChanges?: boolean;
122
126
  /** Effects master switch: false = all off / true = all on / unset = auto by scale */
123
127
  fx?: boolean;