@sentropic/design-system-vue 0.1.0 → 0.2.0
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/dist/ForceGraph.d.ts +142 -13
- package/dist/ForceGraph.d.ts.map +1 -1
- package/dist/ForceGraph.js +574 -36
- package/dist/ForceGraph.js.map +1 -1
- package/dist/GraphLegend.d.ts +42 -0
- package/dist/GraphLegend.d.ts.map +1 -0
- package/dist/GraphLegend.js +71 -0
- package/dist/GraphLegend.js.map +1 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/styles.css +179 -3
- package/package.json +1 -1
package/dist/ForceGraph.d.ts
CHANGED
|
@@ -1,86 +1,215 @@
|
|
|
1
|
-
|
|
1
|
+
import { type PropType, type VNode } from "vue";
|
|
2
|
+
export type ForceGraphTone = "category1" | "category2" | "category3" | "category4" | "category5" | "category6" | "category7" | "category8";
|
|
3
|
+
export type ForceGraphNodeShape = "dot" | "circle" | "diamond" | "star" | "hexagon" | "box" | "square" | "triangle";
|
|
2
4
|
export type ForceGraphNode = {
|
|
5
|
+
/** Stable identifier; referenced by edges. */
|
|
3
6
|
id: string;
|
|
7
|
+
/** Visible label (falls back to id). */
|
|
4
8
|
label?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Grouping key (e.g. node type or community). Nodes sharing a group get
|
|
11
|
+
* the same tone when `tone` is not set explicitly.
|
|
12
|
+
*/
|
|
5
13
|
group?: string | number;
|
|
14
|
+
/** Explicit data-vis tone; overrides the group-derived tone. */
|
|
6
15
|
tone?: ForceGraphTone;
|
|
16
|
+
/** Relative node radius weight (defaults to 1). */
|
|
7
17
|
weight?: number;
|
|
18
|
+
/** Pin the node to a fixed position (ignored by the simulation). */
|
|
8
19
|
fx?: number;
|
|
9
20
|
fy?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Visual shape for the node. Defaults to 'dot' (circle).
|
|
23
|
+
* Supported: 'dot'|'circle', 'diamond', 'star', 'hexagon', 'box'|'square', 'triangle'.
|
|
24
|
+
*/
|
|
25
|
+
shape?: ForceGraphNodeShape;
|
|
10
26
|
};
|
|
11
27
|
export type ForceGraphEdge = {
|
|
28
|
+
/** Source node id. */
|
|
12
29
|
source: string;
|
|
30
|
+
/** Target node id. */
|
|
13
31
|
target: string;
|
|
32
|
+
/** Optional relation label, surfaced in the tooltip on hover/focus. */
|
|
14
33
|
relation?: string;
|
|
34
|
+
/**
|
|
35
|
+
* When true the link renders as a dashed/faded "weak" link. Lets callers
|
|
36
|
+
* map a confidence dimension onto link strength without extra props.
|
|
37
|
+
*/
|
|
38
|
+
weak?: boolean;
|
|
39
|
+
};
|
|
40
|
+
export type ForceGraphLegendEntry = {
|
|
41
|
+
/** Label shown in the legend. */
|
|
42
|
+
label: string;
|
|
43
|
+
/** Shape for this entry (node legend). Absent = line-style legend entry. */
|
|
44
|
+
shape?: ForceGraphNodeShape;
|
|
45
|
+
/** Tone for this entry. Defaults to category1. */
|
|
46
|
+
tone?: ForceGraphTone;
|
|
47
|
+
/** When true, renders as a dashed line (edge legend). */
|
|
15
48
|
weak?: boolean;
|
|
16
49
|
};
|
|
17
50
|
export type ForceGraphProps = {
|
|
18
51
|
nodes: ForceGraphNode[];
|
|
19
52
|
edges: ForceGraphEdge[];
|
|
20
53
|
label?: string;
|
|
54
|
+
width?: number;
|
|
55
|
+
height?: number;
|
|
56
|
+
nodeRadius?: number;
|
|
57
|
+
showLabels?: boolean;
|
|
58
|
+
iterations?: number;
|
|
21
59
|
selectedIds?: string[];
|
|
22
60
|
focusId?: string | null;
|
|
61
|
+
legend?: ForceGraphLegendEntry[];
|
|
62
|
+
onSelect?: (id: string) => void;
|
|
63
|
+
onOpenEntity?: (id: string) => void;
|
|
64
|
+
onEdgeHover?: (edge: ForceGraphEdge) => void;
|
|
23
65
|
class?: string;
|
|
24
66
|
};
|
|
67
|
+
export declare function nodeShapePath(shape: ForceGraphNodeShape | undefined, r: number): string | null;
|
|
25
68
|
export declare const ForceGraph: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
26
69
|
nodes: {
|
|
27
|
-
type:
|
|
70
|
+
type: PropType<ForceGraphNode[]>;
|
|
28
71
|
required: true;
|
|
29
72
|
};
|
|
30
73
|
edges: {
|
|
31
|
-
type:
|
|
74
|
+
type: PropType<ForceGraphEdge[]>;
|
|
32
75
|
required: true;
|
|
33
76
|
};
|
|
34
77
|
label: {
|
|
35
78
|
type: StringConstructor;
|
|
36
79
|
default: string;
|
|
37
80
|
};
|
|
81
|
+
width: {
|
|
82
|
+
type: NumberConstructor;
|
|
83
|
+
default: number;
|
|
84
|
+
};
|
|
85
|
+
height: {
|
|
86
|
+
type: NumberConstructor;
|
|
87
|
+
default: number;
|
|
88
|
+
};
|
|
89
|
+
nodeRadius: {
|
|
90
|
+
type: NumberConstructor;
|
|
91
|
+
default: number;
|
|
92
|
+
};
|
|
93
|
+
showLabels: {
|
|
94
|
+
type: BooleanConstructor;
|
|
95
|
+
default: boolean;
|
|
96
|
+
};
|
|
97
|
+
iterations: {
|
|
98
|
+
type: NumberConstructor;
|
|
99
|
+
default: number;
|
|
100
|
+
};
|
|
38
101
|
selectedIds: {
|
|
39
|
-
type:
|
|
102
|
+
type: PropType<string[]>;
|
|
40
103
|
default: () => never[];
|
|
41
104
|
};
|
|
42
105
|
focusId: {
|
|
43
|
-
type:
|
|
106
|
+
type: PropType<string | null>;
|
|
44
107
|
default: null;
|
|
45
108
|
};
|
|
109
|
+
legend: {
|
|
110
|
+
type: PropType<ForceGraphLegendEntry[]>;
|
|
111
|
+
default: undefined;
|
|
112
|
+
};
|
|
113
|
+
onSelect: {
|
|
114
|
+
type: PropType<(id: string) => void>;
|
|
115
|
+
default: undefined;
|
|
116
|
+
};
|
|
117
|
+
onOpenEntity: {
|
|
118
|
+
type: PropType<(id: string) => void>;
|
|
119
|
+
default: undefined;
|
|
120
|
+
};
|
|
121
|
+
onEdgeHover: {
|
|
122
|
+
type: PropType<(edge: ForceGraphEdge) => void>;
|
|
123
|
+
default: undefined;
|
|
124
|
+
};
|
|
46
125
|
class: {
|
|
47
126
|
type: StringConstructor;
|
|
48
127
|
default: undefined;
|
|
49
128
|
};
|
|
50
|
-
}>, () =>
|
|
129
|
+
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
51
130
|
[key: string]: any;
|
|
52
|
-
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
131
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
132
|
+
select: (_id: string) => true;
|
|
133
|
+
openEntity: (_id: string) => true;
|
|
134
|
+
edgeHover: (_edge: ForceGraphEdge) => true;
|
|
135
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
53
136
|
nodes: {
|
|
54
|
-
type:
|
|
137
|
+
type: PropType<ForceGraphNode[]>;
|
|
55
138
|
required: true;
|
|
56
139
|
};
|
|
57
140
|
edges: {
|
|
58
|
-
type:
|
|
141
|
+
type: PropType<ForceGraphEdge[]>;
|
|
59
142
|
required: true;
|
|
60
143
|
};
|
|
61
144
|
label: {
|
|
62
145
|
type: StringConstructor;
|
|
63
146
|
default: string;
|
|
64
147
|
};
|
|
148
|
+
width: {
|
|
149
|
+
type: NumberConstructor;
|
|
150
|
+
default: number;
|
|
151
|
+
};
|
|
152
|
+
height: {
|
|
153
|
+
type: NumberConstructor;
|
|
154
|
+
default: number;
|
|
155
|
+
};
|
|
156
|
+
nodeRadius: {
|
|
157
|
+
type: NumberConstructor;
|
|
158
|
+
default: number;
|
|
159
|
+
};
|
|
160
|
+
showLabels: {
|
|
161
|
+
type: BooleanConstructor;
|
|
162
|
+
default: boolean;
|
|
163
|
+
};
|
|
164
|
+
iterations: {
|
|
165
|
+
type: NumberConstructor;
|
|
166
|
+
default: number;
|
|
167
|
+
};
|
|
65
168
|
selectedIds: {
|
|
66
|
-
type:
|
|
169
|
+
type: PropType<string[]>;
|
|
67
170
|
default: () => never[];
|
|
68
171
|
};
|
|
69
172
|
focusId: {
|
|
70
|
-
type:
|
|
173
|
+
type: PropType<string | null>;
|
|
71
174
|
default: null;
|
|
72
175
|
};
|
|
176
|
+
legend: {
|
|
177
|
+
type: PropType<ForceGraphLegendEntry[]>;
|
|
178
|
+
default: undefined;
|
|
179
|
+
};
|
|
180
|
+
onSelect: {
|
|
181
|
+
type: PropType<(id: string) => void>;
|
|
182
|
+
default: undefined;
|
|
183
|
+
};
|
|
184
|
+
onOpenEntity: {
|
|
185
|
+
type: PropType<(id: string) => void>;
|
|
186
|
+
default: undefined;
|
|
187
|
+
};
|
|
188
|
+
onEdgeHover: {
|
|
189
|
+
type: PropType<(edge: ForceGraphEdge) => void>;
|
|
190
|
+
default: undefined;
|
|
191
|
+
};
|
|
73
192
|
class: {
|
|
74
193
|
type: StringConstructor;
|
|
75
194
|
default: undefined;
|
|
76
195
|
};
|
|
77
196
|
}>> & Readonly<{
|
|
78
|
-
onSelect?: ((
|
|
79
|
-
onOpenEntity?: ((
|
|
197
|
+
onSelect?: ((_id: string) => any) | undefined;
|
|
198
|
+
onOpenEntity?: ((_id: string) => any) | undefined;
|
|
199
|
+
onEdgeHover?: ((_edge: ForceGraphEdge) => any) | undefined;
|
|
80
200
|
}>, {
|
|
81
201
|
class: string;
|
|
82
202
|
label: string;
|
|
203
|
+
legend: ForceGraphLegendEntry[];
|
|
204
|
+
onSelect: (id: string) => void;
|
|
205
|
+
width: number;
|
|
206
|
+
height: number;
|
|
207
|
+
nodeRadius: number;
|
|
208
|
+
showLabels: boolean;
|
|
209
|
+
iterations: number;
|
|
83
210
|
selectedIds: string[];
|
|
84
211
|
focusId: string | null;
|
|
212
|
+
onOpenEntity: (id: string) => void;
|
|
213
|
+
onEdgeHover: (edge: ForceGraphEdge) => void;
|
|
85
214
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
86
215
|
//# sourceMappingURL=ForceGraph.d.ts.map
|
package/dist/ForceGraph.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ForceGraph.d.ts","sourceRoot":"","sources":["../src/ForceGraph.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ForceGraph.d.ts","sourceRoot":"","sources":["../src/ForceGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,QAAQ,EACb,KAAK,KAAK,EACX,MAAM,KAAK,CAAC;AAMb,MAAM,MAAM,cAAc,GACtB,WAAW,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW,GACrD,WAAW,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW,CAAC;AAE1D,MAAM,MAAM,mBAAmB,GAC3B,KAAK,GAAG,QAAQ,GAChB,SAAS,GACT,MAAM,GACN,SAAS,GACT,KAAK,GAAG,QAAQ,GAChB,UAAU,CAAC;AAEf,MAAM,MAAM,cAAc,GAAG;IAC3B,8CAA8C;IAC9C,EAAE,EAAE,MAAM,CAAC;IACX,wCAAwC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,gEAAgE;IAChE,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,mDAAmD;IACnD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oEAAoE;IACpE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,KAAK,CAAC,EAAE,mBAAmB,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,sBAAsB;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,sBAAsB;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,uEAAuE;IACvE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,IAAI,CAAC,E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