@visualli/core 0.1.6 → 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/README.md +37 -105
- package/dist/chunk-25AJTPMS.js +68 -0
- package/dist/chunk-25AJTPMS.js.map +1 -0
- package/dist/{chunk-6NXADJK2.js → chunk-7NJWM7ZE.js} +84 -117
- package/dist/chunk-7NJWM7ZE.js.map +1 -0
- package/dist/chunk-KVSM3APM.js +96 -0
- package/dist/chunk-KVSM3APM.js.map +1 -0
- package/dist/{chunk-PDP5CVUL.js → chunk-LOQLNYB3.js} +2 -2
- package/dist/chunk-LV3EXUQY.js +753 -0
- package/dist/chunk-LV3EXUQY.js.map +1 -0
- package/dist/chunk-N7HCYULH.js +12 -0
- package/dist/chunk-N7HCYULH.js.map +1 -0
- package/dist/{chunk-I75TMOE4.js → chunk-P6PKWVYF.js} +2 -2
- package/dist/chunk-TPLJJKAU.js +151 -0
- package/dist/chunk-TPLJJKAU.js.map +1 -0
- package/dist/chunk-UAMEJG2C.js +267 -0
- package/dist/chunk-UAMEJG2C.js.map +1 -0
- package/dist/{chunk-LJYSKSCE.js → chunk-W2CAOOJJ.js} +6 -6
- package/dist/chunk-W2CAOOJJ.js.map +1 -0
- package/dist/config/index.cjs +250 -349
- package/dist/config/index.cjs.map +1 -1
- package/dist/config/index.d.cts +107 -66
- package/dist/config/index.d.ts +107 -66
- package/dist/config/index.js +52 -34
- package/dist/constants/index.cjs +14 -333
- package/dist/constants/index.cjs.map +1 -1
- package/dist/constants/index.d.cts +5 -243
- package/dist/constants/index.d.ts +5 -243
- package/dist/constants/index.js +5 -75
- package/dist/designSystem-BOrZHfEq.d.cts +150 -0
- package/dist/designSystem-BOrZHfEq.d.ts +150 -0
- package/dist/document-BFBwn93X.d.ts +26 -0
- package/dist/document-MEJEfxl3.d.cts +26 -0
- package/dist/ideaSize-CLDKeyqD.d.cts +11 -0
- package/dist/ideaSize-DxxGy2E8.d.ts +11 -0
- package/dist/index-BmILeKj6.d.cts +99 -0
- package/dist/index-CcPRwVUL.d.ts +99 -0
- package/dist/index.cjs +1636 -961
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +350 -27
- package/dist/index.d.ts +350 -27
- package/dist/index.js +445 -190
- package/dist/index.js.map +1 -1
- package/dist/{document-B3hnNr-F.d.cts → layer-B2A3Ki48.d.cts} +2 -16
- package/dist/{document-B3hnNr-F.d.ts → layer-B2A3Ki48.d.ts} +2 -16
- package/dist/layout/index.d.cts +2 -1
- package/dist/layout/index.d.ts +2 -1
- package/dist/mindmap-C3Qr0qKW.d.cts +182 -0
- package/dist/mindmap-DHeVa86G.d.ts +182 -0
- package/dist/parser/index.cjs +745 -179
- package/dist/parser/index.cjs.map +1 -1
- package/dist/parser/index.d.cts +23 -8
- package/dist/parser/index.d.ts +23 -8
- package/dist/parser/index.js +7 -2
- package/dist/performance/index.cjs +13 -0
- package/dist/performance/index.cjs.map +1 -1
- package/dist/performance/index.js +2 -2
- package/dist/theme/index.cjs +884 -0
- package/dist/theme/index.cjs.map +1 -0
- package/dist/theme/index.d.cts +2 -0
- package/dist/theme/index.d.ts +2 -0
- package/dist/theme/index.js +53 -0
- package/dist/types/index.d.cts +4 -2
- package/dist/types/index.d.ts +4 -2
- package/dist/viewport/index.cjs +17 -6
- package/dist/viewport/index.cjs.map +1 -1
- package/dist/viewport/index.d.cts +6 -4
- package/dist/viewport/index.d.ts +6 -4
- package/dist/viewport/index.js +2 -2
- package/licenses/visualli-design-system/LICENSE +9 -0
- package/licenses/visualli-design-system/NOTICE.md +6 -0
- package/package.json +13 -5
- package/src/config/README.md +2 -4
- package/src/config/USAGE_EXAMPLES.md +0 -4
- package/src/config/index.ts +3 -4
- package/src/constants/index.ts +1 -1
- package/src/constants/layout.ts +11 -0
- package/src/constants/performanceConstants.ts +8 -27
- package/src/generated/README.md +12 -0
- package/src/generated/designSystem.ts +758 -0
- package/src/generated/geometry/blob.ts +99 -0
- package/src/generated/geometry/blobShapes.ts +4 -0
- package/src/generated/geometry/color.ts +37 -0
- package/src/generated/geometry/container.ts +84 -0
- package/src/generated/geometry/detail.ts +22 -0
- package/src/generated/geometry/idea.ts +56 -0
- package/src/generated/geometry/interaction.ts +122 -0
- package/src/generated/geometry/motion.ts +140 -0
- package/src/index.ts +18 -1
- package/src/parser/configUtils.ts +12 -19
- package/src/parser/visualliConverter.ts +71 -112
- package/src/parser/visualliParser.ts +16 -1
- package/src/rendering/culling.ts +16 -12
- package/src/rendering/ideaSize.ts +21 -0
- package/src/rendering/nodeGeometry.ts +97 -0
- package/src/theme/index.ts +136 -0
- package/src/types/document.ts +9 -0
- package/src/types/layer.ts +1 -1
- package/src/types/mindmap.ts +13 -0
- package/src/utils/navigation.ts +33 -63
- package/src/viewport/viewportUtils.ts +6 -4
- package/dist/animations/index.cjs +0 -146
- package/dist/animations/index.cjs.map +0 -1
- package/dist/animations/index.d.cts +0 -81
- package/dist/animations/index.d.ts +0 -81
- package/dist/animations/index.js +0 -35
- package/dist/chunk-6NXADJK2.js.map +0 -1
- package/dist/chunk-F36SMC3K.js +0 -106
- package/dist/chunk-F36SMC3K.js.map +0 -1
- package/dist/chunk-G5H3P4YZ.js +0 -273
- package/dist/chunk-G5H3P4YZ.js.map +0 -1
- package/dist/chunk-LDJRGT2Q.js +0 -163
- package/dist/chunk-LDJRGT2Q.js.map +0 -1
- package/dist/chunk-LJYSKSCE.js.map +0 -1
- package/dist/chunk-LNTJTDB2.js +0 -349
- package/dist/chunk-LNTJTDB2.js.map +0 -1
- package/dist/mindmap-DWS0WZT_.d.cts +0 -118
- package/dist/mindmap-DWS0WZT_.d.ts +0 -118
- package/src/animations/constants.ts +0 -72
- package/src/animations/easing.ts +0 -70
- package/src/animations/index.ts +0 -2
- package/src/config/blobShapes.ts +0 -146
- package/src/config/textScaling.ts +0 -54
- package/src/constants/design.ts +0 -281
- /package/dist/{chunk-PDP5CVUL.js.map → chunk-LOQLNYB3.js.map} +0 -0
- /package/dist/{chunk-I75TMOE4.js.map → chunk-P6PKWVYF.js.map} +0 -0
- /package/dist/{animations → theme}/index.js.map +0 -0
package/dist/config/index.cjs
CHANGED
|
@@ -20,372 +20,273 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/config/index.ts
|
|
21
21
|
var config_exports = {};
|
|
22
22
|
__export(config_exports, {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
23
|
+
BLOB_SHAPES: () => BLOB_SHAPES,
|
|
24
|
+
IDEA: () => IDEA,
|
|
25
|
+
LABEL_GROWTH: () => LABEL_GROWTH,
|
|
26
|
+
MAX_RINGS: () => MAX_RINGS,
|
|
27
|
+
RINGS: () => RINGS,
|
|
28
|
+
SHAPE: () => SHAPE,
|
|
29
|
+
approximateMeasure: () => approximateMeasure,
|
|
30
|
+
arrowPath: () => arrowPath,
|
|
31
|
+
blobPath: () => blobPath,
|
|
32
|
+
blobRadius: () => blobRadius,
|
|
33
|
+
connectorGeometry: () => connectorGeometry,
|
|
34
|
+
drawBlob: () => drawBlob,
|
|
35
|
+
edgePath: () => edgePath,
|
|
36
|
+
ideaKindOf: () => ideaKindOf,
|
|
37
|
+
ideaSize: () => ideaSize,
|
|
38
|
+
labelGrowth: () => labelGrowth,
|
|
39
|
+
nodeBounds: () => nodeBounds,
|
|
40
|
+
nodeRadii: () => nodeRadii,
|
|
41
|
+
outlineRadius: () => outlineRadius,
|
|
42
|
+
ringCount: () => ringCount,
|
|
43
|
+
ringsFor: () => ringsFor,
|
|
44
|
+
shapeForLevel: () => shapeForLevel,
|
|
45
|
+
shapeOfLevel: () => shapeOfLevel,
|
|
46
|
+
wrapLines: () => wrapLines
|
|
39
47
|
});
|
|
40
48
|
module.exports = __toCommonJS(config_exports);
|
|
41
49
|
|
|
42
|
-
// src/
|
|
43
|
-
var
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
var NODE_LAYER_CONFIG = { opacity: 1, rotation: 0, strokeWidth: 3 };
|
|
52
|
-
var ALL_BLOB_SHAPES = [
|
|
53
|
-
// Shape 0 · Blob 1
|
|
54
|
-
[
|
|
55
|
-
{ x: 1.12, y: 0 },
|
|
56
|
-
{ x: 0.86, y: 0.56 },
|
|
57
|
-
{ x: 0.46, y: 0.94 },
|
|
58
|
-
{ x: -0.08, y: 1.06 },
|
|
59
|
-
{ x: -0.68, y: 0.82 },
|
|
60
|
-
{ x: -0.96, y: 0.08 },
|
|
61
|
-
{ x: -0.55, y: -0.82 },
|
|
62
|
-
{ x: 0.04, y: -1.02 },
|
|
63
|
-
{ x: 0.72, y: -0.8 },
|
|
64
|
-
{ x: 1.08, y: -0.38 }
|
|
65
|
-
],
|
|
66
|
-
// Shape 1 · Blob 2
|
|
67
|
-
[
|
|
68
|
-
{ x: -0.489, y: -0.625 },
|
|
69
|
-
{ x: -0.384, y: -0.716 },
|
|
70
|
-
{ x: -0.285, y: -0.792 },
|
|
71
|
-
{ x: -0.189, y: -0.855 },
|
|
72
|
-
{ x: -0.09, y: -0.903 },
|
|
73
|
-
{ x: 0.014, y: -0.932 },
|
|
74
|
-
{ x: 0.129, y: -0.94 },
|
|
75
|
-
{ x: 0.255, y: -0.924 },
|
|
76
|
-
{ x: 0.412, y: -0.876 },
|
|
77
|
-
{ x: 0.516, y: -0.832 },
|
|
78
|
-
{ x: 0.612, y: -0.78 },
|
|
79
|
-
{ x: 0.695, y: -0.725 },
|
|
80
|
-
{ x: 0.767, y: -0.666 },
|
|
81
|
-
{ x: 0.83, y: -0.606 },
|
|
82
|
-
{ x: 0.885, y: -0.546 },
|
|
83
|
-
{ x: 0.933, y: -0.486 },
|
|
84
|
-
{ x: 0.979, y: -0.425 },
|
|
85
|
-
{ x: 1.006, y: -0.385 },
|
|
86
|
-
{ x: 1.034, y: -0.334 },
|
|
87
|
-
{ x: 1.058, y: -0.276 },
|
|
88
|
-
{ x: 1.078, y: -0.209 },
|
|
89
|
-
{ x: 1.092, y: -0.133 },
|
|
90
|
-
{ x: 1.101, y: -0.046 },
|
|
91
|
-
{ x: 1.102, y: 0.052 },
|
|
92
|
-
{ x: 1.094, y: 0.173 },
|
|
93
|
-
{ x: 1.083, y: 0.244 },
|
|
94
|
-
{ x: 1.063, y: 0.324 },
|
|
95
|
-
{ x: 1.034, y: 0.401 },
|
|
96
|
-
{ x: 0.996, y: 0.477 },
|
|
97
|
-
{ x: 0.948, y: 0.549 },
|
|
98
|
-
{ x: 0.889, y: 0.617 },
|
|
99
|
-
{ x: 0.82, y: 0.681 },
|
|
100
|
-
{ x: 0.735, y: 0.741 },
|
|
101
|
-
{ x: 0.658, y: 0.783 },
|
|
102
|
-
{ x: 0.569, y: 0.822 },
|
|
103
|
-
{ x: 0.474, y: 0.855 },
|
|
104
|
-
{ x: 0.372, y: 0.882 },
|
|
105
|
-
{ x: 0.265, y: 0.904 },
|
|
106
|
-
{ x: 0.156, y: 0.92 },
|
|
107
|
-
{ x: 0.046, y: 0.931 },
|
|
108
|
-
{ x: -0.069, y: 0.938 },
|
|
109
|
-
{ x: -0.155, y: 0.935 },
|
|
110
|
-
{ x: -0.25, y: 0.919 },
|
|
111
|
-
{ x: -0.346, y: 0.89 },
|
|
112
|
-
{ x: -0.443, y: 0.851 },
|
|
113
|
-
{ x: -0.539, y: 0.8 },
|
|
114
|
-
{ x: -0.633, y: 0.738 },
|
|
115
|
-
{ x: -0.723, y: 0.667 },
|
|
116
|
-
{ x: -0.808, y: 0.585 },
|
|
117
|
-
{ x: -0.882, y: 0.501 },
|
|
118
|
-
{ x: -0.944, y: 0.421 },
|
|
119
|
-
{ x: -0.994, y: 0.343 },
|
|
120
|
-
{ x: -1.034, y: 0.267 },
|
|
121
|
-
{ x: -1.064, y: 0.192 },
|
|
122
|
-
{ x: -1.085, y: 0.12 },
|
|
123
|
-
{ x: -1.097, y: 0.042 },
|
|
124
|
-
{ x: -1.102, y: 1e-3 },
|
|
125
|
-
{ x: -1.09, y: -0.243 },
|
|
126
|
-
{ x: -1.05, y: -0.365 },
|
|
127
|
-
{ x: -0.99, y: -0.441 },
|
|
128
|
-
{ x: -0.911, y: -0.479 },
|
|
129
|
-
{ x: -0.819, y: -0.499 },
|
|
130
|
-
{ x: -0.715, y: -0.517 },
|
|
131
|
-
{ x: -0.605, y: -0.551 }
|
|
132
|
-
],
|
|
133
|
-
// Shape 2 · Blob 3
|
|
134
|
-
[
|
|
135
|
-
{ x: 3e-3, y: -0.97 },
|
|
136
|
-
{ x: 0.163, y: -0.984 },
|
|
137
|
-
{ x: 0.286, y: -1.028 },
|
|
138
|
-
{ x: 0.389, y: -1.096 },
|
|
139
|
-
{ x: 0.488, y: -1.174 },
|
|
140
|
-
{ x: 0.597, y: -1.21 },
|
|
141
|
-
{ x: 0.728, y: -1.165 },
|
|
142
|
-
{ x: 0.867, y: -1.036 },
|
|
143
|
-
{ x: 0.996, y: -0.839 },
|
|
144
|
-
{ x: 1.098, y: -0.59 },
|
|
145
|
-
{ x: 1.158, y: -0.304 },
|
|
146
|
-
{ x: 1.153, y: 0.012 },
|
|
147
|
-
{ x: 1.08, y: 0.336 },
|
|
148
|
-
{ x: 0.944, y: 0.639 },
|
|
149
|
-
{ x: 0.756, y: 0.889 },
|
|
150
|
-
{ x: 0.484, y: 1.072 },
|
|
151
|
-
{ x: 0.339, y: 1.079 },
|
|
152
|
-
{ x: 0.219, y: 1.051 },
|
|
153
|
-
{ x: 0.131, y: 0.994 },
|
|
154
|
-
{ x: 0.059, y: 0.939 },
|
|
155
|
-
{ x: 8e-3, y: 0.915 },
|
|
156
|
-
{ x: -0.105, y: 0.931 },
|
|
157
|
-
{ x: -0.176, y: 0.965 },
|
|
158
|
-
{ x: -0.249, y: 1.005 },
|
|
159
|
-
{ x: -0.345, y: 1.039 },
|
|
160
|
-
{ x: -0.497, y: 1.055 },
|
|
161
|
-
{ x: -0.672, y: 1.032 },
|
|
162
|
-
{ x: -0.817, y: 0.952 },
|
|
163
|
-
{ x: -0.945, y: 0.81 },
|
|
164
|
-
{ x: -1.054, y: 0.6 },
|
|
165
|
-
{ x: -1.16, y: 0.302 },
|
|
166
|
-
{ x: -1.187, y: -0.011 },
|
|
167
|
-
{ x: -1.165, y: -0.326 },
|
|
168
|
-
{ x: -1.097, y: -0.599 },
|
|
169
|
-
{ x: -0.991, y: -0.838 },
|
|
170
|
-
{ x: -0.852, y: -0.912 },
|
|
171
|
-
{ x: -0.695, y: -0.958 },
|
|
172
|
-
{ x: -0.53, y: -0.988 },
|
|
173
|
-
{ x: -0.357, y: -0.992 },
|
|
174
|
-
{ x: -0.18, y: -0.983 }
|
|
175
|
-
],
|
|
176
|
-
// Shape 3 · Blob 4
|
|
177
|
-
[
|
|
178
|
-
{ x: -0.734, y: -1.127 },
|
|
179
|
-
{ x: -0.656, y: -1.146 },
|
|
180
|
-
{ x: -0.567, y: -1.142 },
|
|
181
|
-
{ x: -0.468, y: -1.115 },
|
|
182
|
-
{ x: -0.358, y: -1.079 },
|
|
183
|
-
{ x: -0.238, y: -1.034 },
|
|
184
|
-
{ x: -0.107, y: -0.989 },
|
|
185
|
-
{ x: 0.035, y: -0.953 },
|
|
186
|
-
{ x: 0.188, y: -0.929 },
|
|
187
|
-
{ x: 0.325, y: -0.916 },
|
|
188
|
-
{ x: 0.484, y: -0.896 },
|
|
189
|
-
{ x: 0.65, y: -0.854 },
|
|
190
|
-
{ x: 0.811, y: -0.77 },
|
|
191
|
-
{ x: 0.955, y: -0.631 },
|
|
192
|
-
{ x: 1.068, y: -0.422 },
|
|
193
|
-
{ x: 1.138, y: -0.126 },
|
|
194
|
-
{ x: 1.152, y: 0.272 },
|
|
195
|
-
{ x: 1.121, y: 0.451 },
|
|
196
|
-
{ x: 1.046, y: 0.602 },
|
|
197
|
-
{ x: 0.928, y: 0.727 },
|
|
198
|
-
{ x: 0.767, y: 0.833 },
|
|
199
|
-
{ x: 0.565, y: 0.925 },
|
|
200
|
-
{ x: 0.323, y: 1.001 },
|
|
201
|
-
{ x: 0.042, y: 1.075 },
|
|
202
|
-
{ x: -0.277, y: 1.142 },
|
|
203
|
-
{ x: -0.368, y: 1.147 },
|
|
204
|
-
{ x: -0.475, y: 1.136 },
|
|
205
|
-
{ x: -0.589, y: 1.104 },
|
|
206
|
-
{ x: -0.704, y: 1.05 },
|
|
207
|
-
{ x: -0.815, y: 0.973 },
|
|
208
|
-
{ x: -0.913, y: 0.871 },
|
|
209
|
-
{ x: -0.993, y: 0.746 },
|
|
210
|
-
{ x: -1.048, y: 0.593 },
|
|
211
|
-
{ x: -1.109, y: 0.298 },
|
|
212
|
-
{ x: -1.145, y: 0.018 },
|
|
213
|
-
{ x: -1.154, y: -0.243 },
|
|
214
|
-
{ x: -1.135, y: -0.482 },
|
|
215
|
-
{ x: -1.085, y: -0.695 },
|
|
216
|
-
{ x: -1.003, y: -0.874 },
|
|
217
|
-
{ x: -0.886, y: -1.02 }
|
|
218
|
-
],
|
|
219
|
-
// Shape 4 · Blob 5
|
|
220
|
-
[
|
|
221
|
-
{ x: -0.734, y: 1.127 },
|
|
222
|
-
{ x: -0.656, y: 1.146 },
|
|
223
|
-
{ x: -0.567, y: 1.142 },
|
|
224
|
-
{ x: -0.468, y: 1.115 },
|
|
225
|
-
{ x: -0.358, y: 1.079 },
|
|
226
|
-
{ x: -0.238, y: 1.034 },
|
|
227
|
-
{ x: -0.107, y: 0.989 },
|
|
228
|
-
{ x: 0.035, y: 0.953 },
|
|
229
|
-
{ x: 0.188, y: 0.929 },
|
|
230
|
-
{ x: 0.325, y: 0.916 },
|
|
231
|
-
{ x: 0.484, y: 0.896 },
|
|
232
|
-
{ x: 0.65, y: 0.854 },
|
|
233
|
-
{ x: 0.811, y: 0.77 },
|
|
234
|
-
{ x: 0.955, y: 0.631 },
|
|
235
|
-
{ x: 1.068, y: 0.422 },
|
|
236
|
-
{ x: 1.138, y: 0.126 },
|
|
237
|
-
{ x: 1.152, y: -0.272 },
|
|
238
|
-
{ x: 1.121, y: -0.451 },
|
|
239
|
-
{ x: 1.046, y: -0.602 },
|
|
240
|
-
{ x: 0.928, y: -0.727 },
|
|
241
|
-
{ x: 0.767, y: -0.833 },
|
|
242
|
-
{ x: 0.565, y: -0.925 },
|
|
243
|
-
{ x: 0.323, y: -1.001 },
|
|
244
|
-
{ x: 0.042, y: -1.075 },
|
|
245
|
-
{ x: -0.277, y: -1.142 },
|
|
246
|
-
{ x: -0.368, y: -1.147 },
|
|
247
|
-
{ x: -0.475, y: -1.136 },
|
|
248
|
-
{ x: -0.589, y: -1.104 },
|
|
249
|
-
{ x: -0.704, y: -1.05 },
|
|
250
|
-
{ x: -0.815, y: -0.973 },
|
|
251
|
-
{ x: -0.913, y: -0.871 },
|
|
252
|
-
{ x: -0.993, y: -0.746 },
|
|
253
|
-
{ x: -1.048, y: -0.593 },
|
|
254
|
-
{ x: -1.109, y: -0.298 },
|
|
255
|
-
{ x: -1.145, y: -0.018 },
|
|
256
|
-
{ x: -1.154, y: 0.243 },
|
|
257
|
-
{ x: -1.135, y: 0.482 },
|
|
258
|
-
{ x: -1.085, y: 0.695 },
|
|
259
|
-
{ x: -1.003, y: 0.874 },
|
|
260
|
-
{ x: -0.886, y: 1.02 }
|
|
261
|
-
],
|
|
262
|
-
// Shape 5 · Blob 6
|
|
263
|
-
[
|
|
264
|
-
{ x: 1e-3, y: -1.006 },
|
|
265
|
-
{ x: 0.134, y: -1.001 },
|
|
266
|
-
{ x: 0.262, y: -1.024 },
|
|
267
|
-
{ x: 0.382, y: -1.073 },
|
|
268
|
-
{ x: 0.498, y: -1.107 },
|
|
269
|
-
{ x: 0.614, y: -1.105 },
|
|
270
|
-
{ x: 0.733, y: -1.049 },
|
|
271
|
-
{ x: 0.85, y: -0.932 },
|
|
272
|
-
{ x: 0.953, y: -0.755 },
|
|
273
|
-
{ x: 1.03, y: -0.529 },
|
|
274
|
-
{ x: 1.067, y: -0.265 },
|
|
275
|
-
{ x: 1.054, y: 0.018 },
|
|
276
|
-
{ x: 0.986, y: 0.3 },
|
|
277
|
-
{ x: 0.868, y: 0.557 },
|
|
278
|
-
{ x: 0.715, y: 0.766 },
|
|
279
|
-
{ x: 0.55, y: 0.909 },
|
|
280
|
-
{ x: 0.396, y: 0.984 },
|
|
281
|
-
{ x: 0.262, y: 1.005 },
|
|
282
|
-
{ x: 0.148, y: 1.003 },
|
|
283
|
-
{ x: 0.037, y: 1.008 },
|
|
284
|
-
{ x: -0.083, y: 1.04 },
|
|
285
|
-
{ x: -0.22, y: 1.118 },
|
|
286
|
-
{ x: -0.36, y: 1.192 },
|
|
287
|
-
{ x: -0.5, y: 1.234 },
|
|
288
|
-
{ x: -0.65, y: 1.175 },
|
|
289
|
-
{ x: -0.81, y: 1.045 },
|
|
290
|
-
{ x: -0.99, y: 0.855 },
|
|
291
|
-
{ x: -1.14, y: 0.61 },
|
|
292
|
-
{ x: -1.24, y: 0.33 },
|
|
293
|
-
{ x: -1.27, y: 0.04 },
|
|
294
|
-
{ x: -1.275, y: -0.25 },
|
|
295
|
-
{ x: -1.225, y: -0.5 },
|
|
296
|
-
{ x: -1.08, y: -0.72 },
|
|
297
|
-
{ x: -0.89, y: -0.92 },
|
|
298
|
-
{ x: -0.734, y: -1.053 },
|
|
299
|
-
{ x: -0.614, y: -1.112 },
|
|
300
|
-
{ x: -0.498, y: -1.127 },
|
|
301
|
-
{ x: -0.381, y: -1.11 },
|
|
302
|
-
{ x: -0.261, y: -1.095 },
|
|
303
|
-
{ x: -0.133, y: -1.058 },
|
|
304
|
-
{ x: 1e-3, y: -1.01 },
|
|
305
|
-
{ x: 0.134, y: -1.001 }
|
|
306
|
-
]
|
|
307
|
-
];
|
|
308
|
-
var ACTIVE_BLOB_TYPES = [0, 1, 2, 3, 4, 5];
|
|
309
|
-
var BLOB_TEXT_OFFSETS = [0, 0, 0, 0, 0, -0.1];
|
|
310
|
-
function getBlobTypeForLayer(level) {
|
|
311
|
-
const numTypes = ACTIVE_BLOB_TYPES.length;
|
|
312
|
-
if (numTypes <= 1) return ACTIVE_BLOB_TYPES[0] ?? 0;
|
|
313
|
-
let currentType = 0;
|
|
50
|
+
// src/generated/geometry/blobShapes.ts
|
|
51
|
+
var BLOB_SHAPES = [[[1.12, 0], [0.86, 0.56], [0.46, 0.94], [-0.08, 1.06], [-0.68, 0.82], [-0.96, 0.08], [-0.55, -0.82], [0.04, -1.02], [0.72, -0.8], [1.08, -0.38]], [[-0.489, -0.625], [-0.384, -0.716], [-0.285, -0.792], [-0.189, -0.855], [-0.09, -0.903], [0.014, -0.932], [0.129, -0.94], [0.255, -0.924], [0.412, -0.876], [0.516, -0.832], [0.612, -0.78], [0.695, -0.725], [0.767, -0.666], [0.83, -0.606], [0.885, -0.546], [0.933, -0.486], [0.979, -0.425], [1.006, -0.385], [1.034, -0.334], [1.058, -0.276], [1.078, -0.209], [1.092, -0.133], [1.101, -0.046], [1.102, 0.052], [1.094, 0.173], [1.083, 0.244], [1.063, 0.324], [1.034, 0.401], [0.996, 0.477], [0.948, 0.549], [0.889, 0.617], [0.82, 0.681], [0.735, 0.741], [0.658, 0.783], [0.569, 0.822], [0.474, 0.855], [0.372, 0.882], [0.265, 0.904], [0.156, 0.92], [0.046, 0.931], [-0.069, 0.938], [-0.155, 0.935], [-0.25, 0.919], [-0.346, 0.89], [-0.443, 0.851], [-0.539, 0.8], [-0.633, 0.738], [-0.723, 0.667], [-0.808, 0.585], [-0.882, 0.501], [-0.944, 0.421], [-0.994, 0.343], [-1.034, 0.267], [-1.064, 0.192], [-1.085, 0.12], [-1.097, 0.042], [-1.102, 1e-3], [-1.09, -0.243], [-1.05, -0.365], [-0.99, -0.441], [-0.911, -0.479], [-0.819, -0.499], [-0.715, -0.517], [-0.605, -0.551]], [[3e-3, -0.97], [0.163, -0.984], [0.286, -1.028], [0.389, -1.096], [0.488, -1.174], [0.597, -1.21], [0.728, -1.165], [0.867, -1.036], [0.996, -0.839], [1.098, -0.59], [1.158, -0.304], [1.153, 0.012], [1.08, 0.336], [0.944, 0.639], [0.756, 0.889], [0.484, 1.072], [0.339, 1.079], [0.219, 1.051], [0.131, 0.994], [0.059, 0.939], [8e-3, 0.915], [-0.105, 0.931], [-0.176, 0.965], [-0.249, 1.005], [-0.345, 1.039], [-0.497, 1.055], [-0.672, 1.032], [-0.817, 0.952], [-0.945, 0.81], [-1.054, 0.6], [-1.16, 0.302], [-1.187, -0.011], [-1.165, -0.326], [-1.097, -0.599], [-0.991, -0.838], [-0.852, -0.912], [-0.695, -0.958], [-0.53, -0.988], [-0.357, -0.992], [-0.18, -0.983]], [[-0.734, -1.127], [-0.656, -1.146], [-0.567, -1.142], [-0.468, -1.115], [-0.358, -1.079], [-0.238, -1.034], [-0.107, -0.989], [0.035, -0.953], [0.188, -0.929], [0.325, -0.916], [0.484, -0.896], [0.65, -0.854], [0.811, -0.77], [0.955, -0.631], [1.068, -0.422], [1.138, -0.126], [1.152, 0.272], [1.121, 0.451], [1.046, 0.602], [0.928, 0.727], [0.767, 0.833], [0.565, 0.925], [0.323, 1.001], [0.042, 1.075], [-0.277, 1.142], [-0.368, 1.147], [-0.475, 1.136], [-0.589, 1.104], [-0.704, 1.05], [-0.815, 0.973], [-0.913, 0.871], [-0.993, 0.746], [-1.048, 0.593], [-1.109, 0.298], [-1.145, 0.018], [-1.154, -0.243], [-1.135, -0.482], [-1.085, -0.695], [-1.003, -0.874], [-0.886, -1.02]], [[-0.734, 1.127], [-0.656, 1.146], [-0.567, 1.142], [-0.468, 1.115], [-0.358, 1.079], [-0.238, 1.034], [-0.107, 0.989], [0.035, 0.953], [0.188, 0.929], [0.325, 0.916], [0.484, 0.896], [0.65, 0.854], [0.811, 0.77], [0.955, 0.631], [1.068, 0.422], [1.138, 0.126], [1.152, -0.272], [1.121, -0.451], [1.046, -0.602], [0.928, -0.727], [0.767, -0.833], [0.565, -0.925], [0.323, -1.001], [0.042, -1.075], [-0.277, -1.142], [-0.368, -1.147], [-0.475, -1.136], [-0.589, -1.104], [-0.704, -1.05], [-0.815, -0.973], [-0.913, -0.871], [-0.993, -0.746], [-1.048, -0.593], [-1.109, -0.298], [-1.145, -0.018], [-1.154, 0.243], [-1.135, 0.482], [-1.085, 0.695], [-1.003, 0.874], [-0.886, 1.02]], [[1e-3, -1.006], [0.134, -1.001], [0.262, -1.024], [0.382, -1.073], [0.498, -1.107], [0.614, -1.105], [0.733, -1.049], [0.85, -0.932], [0.953, -0.755], [1.03, -0.529], [1.067, -0.265], [1.054, 0.018], [0.986, 0.3], [0.868, 0.557], [0.715, 0.766], [0.55, 0.909], [0.396, 0.984], [0.262, 1.005], [0.148, 1.003], [0.037, 1.008], [-0.083, 1.04], [-0.22, 1.118], [-0.36, 1.192], [-0.5, 1.234], [-0.65, 1.175], [-0.81, 1.045], [-0.99, 0.855], [-1.14, 0.61], [-1.24, 0.33], [-1.27, 0.04], [-1.275, -0.25], [-1.225, -0.5], [-1.08, -0.72], [-0.89, -0.92], [-0.734, -1.053], [-0.614, -1.112], [-0.498, -1.127], [-0.381, -1.11], [-0.261, -1.095], [-0.133, -1.058], [1e-3, -1.01], [0.134, -1.001]]];
|
|
52
|
+
|
|
53
|
+
// src/generated/geometry/blob.ts
|
|
54
|
+
var SHAPE = { idea: 0, varyByLevel: false };
|
|
55
|
+
function shapeForLevel(level) {
|
|
56
|
+
if (!SHAPE.varyByLevel) return SHAPE.idea;
|
|
57
|
+
const n = BLOB_SHAPES.length;
|
|
58
|
+
let cur = SHAPE.idea;
|
|
314
59
|
for (let i = 1; i <= level; i++) {
|
|
315
|
-
const
|
|
316
|
-
|
|
317
|
-
currentType = (currentType + stepOffset) % numTypes;
|
|
60
|
+
const r = Math.floor(Math.abs(Math.sin((i + 1) * 12.9898) * 43758.5453));
|
|
61
|
+
cur = (cur + r % (n - 1) + 1) % n;
|
|
318
62
|
}
|
|
319
|
-
return
|
|
63
|
+
return cur;
|
|
320
64
|
}
|
|
321
|
-
function
|
|
322
|
-
const
|
|
323
|
-
const
|
|
324
|
-
|
|
325
|
-
const
|
|
326
|
-
|
|
327
|
-
ctx.moveTo((last.x + first.x) / 2, (last.y + first.y) / 2);
|
|
65
|
+
function blobPath(shape, rx, ry, cx = 0, cy = 0) {
|
|
66
|
+
const pts = BLOB_SHAPES[(shape % BLOB_SHAPES.length + BLOB_SHAPES.length) % BLOB_SHAPES.length].map(([x, y]) => [cx + x * rx, cy + y * ry]);
|
|
67
|
+
const mid = (a, b) => [(a[0] + b[0]) / 2, (a[1] + b[1]) / 2];
|
|
68
|
+
const f = (n) => n.toFixed(2);
|
|
69
|
+
const start = mid(pts[pts.length - 1], pts[0]);
|
|
70
|
+
let d = `M${f(start[0])} ${f(start[1])}`;
|
|
328
71
|
for (let i = 0; i < pts.length; i++) {
|
|
329
|
-
const
|
|
330
|
-
|
|
331
|
-
ctx.quadraticCurveTo(curr.x, curr.y, (curr.x + next.x) / 2, (curr.y + next.y) / 2);
|
|
72
|
+
const p = pts[i], m = mid(p, pts[(i + 1) % pts.length]);
|
|
73
|
+
d += `Q${f(p[0])} ${f(p[1])} ${f(m[0])} ${f(m[1])}`;
|
|
332
74
|
}
|
|
75
|
+
return d + "Z";
|
|
76
|
+
}
|
|
77
|
+
function drawBlob(ctx, shape, rx, ry, cx = 0, cy = 0) {
|
|
78
|
+
const pts = BLOB_SHAPES[(shape % BLOB_SHAPES.length + BLOB_SHAPES.length) % BLOB_SHAPES.length].map(([x, y]) => [cx + x * rx, cy + y * ry]);
|
|
79
|
+
const mid = (a, b) => [(a[0] + b[0]) / 2, (a[1] + b[1]) / 2];
|
|
80
|
+
const s = mid(pts[pts.length - 1], pts[0]);
|
|
81
|
+
ctx.beginPath();
|
|
82
|
+
ctx.moveTo(s[0], s[1]);
|
|
83
|
+
pts.forEach((p, i) => {
|
|
84
|
+
const m = mid(p, pts[(i + 1) % pts.length]);
|
|
85
|
+
ctx.quadraticCurveTo(p[0], p[1], m[0], m[1]);
|
|
86
|
+
});
|
|
333
87
|
ctx.closePath();
|
|
334
88
|
}
|
|
89
|
+
function blobRadius(shape, rx, ry, angle) {
|
|
90
|
+
const pts = BLOB_SHAPES[(shape % BLOB_SHAPES.length + BLOB_SHAPES.length) % BLOB_SHAPES.length].map(([x, y]) => [x * rx, y * ry]);
|
|
91
|
+
const mid = (a, b) => [(a[0] + b[0]) / 2, (a[1] + b[1]) / 2];
|
|
92
|
+
const poly = [];
|
|
93
|
+
for (let i = 0; i < pts.length; i++) {
|
|
94
|
+
const p0 = mid(pts[(i - 1 + pts.length) % pts.length], pts[i]), c = pts[i], p1 = mid(pts[i], pts[(i + 1) % pts.length]);
|
|
95
|
+
for (let k = 0; k < 8; k++) {
|
|
96
|
+
const t = k / 8, u = 1 - t;
|
|
97
|
+
poly.push([u * u * p0[0] + 2 * u * t * c[0] + t * t * p1[0], u * u * p0[1] + 2 * u * t * c[1] + t * t * p1[1]]);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
const dx = Math.cos(angle), dy = Math.sin(angle);
|
|
101
|
+
let best = 0;
|
|
102
|
+
for (let i = 0; i < poly.length; i++) {
|
|
103
|
+
const [ax, ay] = poly[i], [bx, by] = poly[(i + 1) % poly.length], ex = bx - ax, ey = by - ay;
|
|
104
|
+
const den = dx * ey - dy * ex;
|
|
105
|
+
if (Math.abs(den) < 1e-9) continue;
|
|
106
|
+
const r = (ax * ey - ay * ex) / den, q = (ax * dy - ay * dx) / den;
|
|
107
|
+
if (r > 0 && q >= 0 && q <= 1) best = Math.max(best, r);
|
|
108
|
+
}
|
|
109
|
+
return best || Math.max(rx, ry);
|
|
110
|
+
}
|
|
111
|
+
var RINGS = [
|
|
112
|
+
{ scale: 1.1, opacity: 0.5, rotate: -5, width: 2, dash: "" },
|
|
113
|
+
{ scale: 1.2, opacity: 0.4, rotate: -10, width: 1, dash: "" },
|
|
114
|
+
{ scale: 1.3, opacity: 0.3, rotate: -15, width: 3, dash: "6 4" }
|
|
115
|
+
];
|
|
116
|
+
function edgePath(a, b, bow = 1) {
|
|
117
|
+
const dx = b.x - a.x, dy = b.y - a.y, d = Math.hypot(dx, dy) || 1;
|
|
118
|
+
const arc = Math.min(45, 45 / (1 + Math.max(0, (d - 200) / 400))) * bow;
|
|
119
|
+
const nx = -dy / d, ny = dx / d;
|
|
120
|
+
const mx = (a.x + b.x) / 2 + nx * arc, my = (a.y + b.y) / 2 + ny * arc;
|
|
121
|
+
const c1 = { x: a.x + (mx - a.x) * 0.66 + 0, y: a.y + (my - a.y) * 0.66 };
|
|
122
|
+
const c2 = { x: b.x + (mx - b.x) * 0.66, y: b.y + (my - b.y) * 0.66 };
|
|
123
|
+
const ang = Math.atan2(b.y - c2.y, b.x - c2.x);
|
|
124
|
+
return { d: `M${a.x.toFixed(1)} ${a.y.toFixed(1)}C${c1.x.toFixed(1)} ${c1.y.toFixed(1)} ${c2.x.toFixed(1)} ${c2.y.toFixed(1)} ${b.x.toFixed(1)} ${b.y.toFixed(1)}`, angle: ang, mid: { x: mx, y: my } };
|
|
125
|
+
}
|
|
126
|
+
function arrowPath(p, angle, len = 11) {
|
|
127
|
+
const s = Math.PI / 5.5;
|
|
128
|
+
const a1 = { x: p.x - len * Math.cos(angle - s), y: p.y - len * Math.sin(angle - s) };
|
|
129
|
+
const a2 = { x: p.x - len * Math.cos(angle + s), y: p.y - len * Math.sin(angle + s) };
|
|
130
|
+
return `M${a1.x.toFixed(1)} ${a1.y.toFixed(1)}L${p.x.toFixed(1)} ${p.y.toFixed(1)}L${a2.x.toFixed(1)} ${a2.y.toFixed(1)}`;
|
|
131
|
+
}
|
|
335
132
|
|
|
336
|
-
// src/
|
|
337
|
-
var
|
|
338
|
-
|
|
339
|
-
|
|
133
|
+
// src/generated/designSystem.ts
|
|
134
|
+
var METRICS = {
|
|
135
|
+
"space1": 4,
|
|
136
|
+
"space2": 8,
|
|
137
|
+
"space3": 12,
|
|
138
|
+
"space4": 16,
|
|
139
|
+
"space7": 48,
|
|
140
|
+
"radiusSm": 10,
|
|
141
|
+
"radiusMd": 16,
|
|
142
|
+
"radiusLg": 24,
|
|
143
|
+
"radiusPill": 999,
|
|
144
|
+
"nodeWidth": 200,
|
|
145
|
+
"nodeHeight": 148,
|
|
146
|
+
"nodeStroke": 3,
|
|
147
|
+
"edgeWidth": 2.5,
|
|
148
|
+
"edgeGap": 15,
|
|
149
|
+
"edgeArcMax": 45,
|
|
150
|
+
"immersionAlpha": 0.15,
|
|
151
|
+
"zoomMin": 0.3,
|
|
152
|
+
"zoomMax": 5,
|
|
153
|
+
"durationInstant": 100,
|
|
154
|
+
"durationQuick": 160,
|
|
155
|
+
"durationBase": 240,
|
|
156
|
+
"durationZoom": 500,
|
|
157
|
+
"durationReveal": 420,
|
|
158
|
+
"staggerReveal": 70,
|
|
159
|
+
"zChrome": 10,
|
|
160
|
+
"zCard": 20,
|
|
161
|
+
"zMenu": 40
|
|
162
|
+
};
|
|
340
163
|
|
|
341
|
-
// src/
|
|
342
|
-
var
|
|
343
|
-
var
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
var
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
164
|
+
// src/rendering/nodeGeometry.ts
|
|
165
|
+
var MAX_RINGS = RINGS.length;
|
|
166
|
+
var DEG = Math.PI / 180;
|
|
167
|
+
function nodeRadii(n) {
|
|
168
|
+
return { rx: n.width / 2, ry: n.height / 2 };
|
|
169
|
+
}
|
|
170
|
+
var ringCount = (branchCount) => Math.max(0, Math.min(branchCount ?? 0, MAX_RINGS));
|
|
171
|
+
var ringsFor = (branchCount) => RINGS.slice(0, ringCount(branchCount));
|
|
172
|
+
var shapeCache = /* @__PURE__ */ new Map();
|
|
173
|
+
function shapeOfLevel(level) {
|
|
174
|
+
let s = shapeCache.get(level);
|
|
175
|
+
if (s === void 0) {
|
|
176
|
+
s = shapeForLevel(level);
|
|
177
|
+
shapeCache.set(level, s);
|
|
178
|
+
}
|
|
179
|
+
return s;
|
|
180
|
+
}
|
|
181
|
+
var BLOB_MAX_NORM = Math.max(...BLOB_SHAPES.flatMap((s) => s.map(([x, y]) => Math.hypot(x, y))));
|
|
182
|
+
var VISUAL_MARGIN = METRICS.nodeStroke * 2 + 24;
|
|
183
|
+
function nodeBounds(n) {
|
|
184
|
+
const { rx, ry } = nodeRadii(n);
|
|
185
|
+
const rings = ringCount(n.branchCount);
|
|
186
|
+
const scale = rings > 0 ? RINGS[rings - 1].scale : 1;
|
|
187
|
+
const r = BLOB_MAX_NORM * Math.max(rx, ry) * scale + VISUAL_MARGIN;
|
|
188
|
+
return { minX: n.x - r, minY: n.y - r, maxX: n.x + r, maxY: n.y + r };
|
|
189
|
+
}
|
|
190
|
+
function outlineRadius(n, angle) {
|
|
191
|
+
const { rx, ry } = nodeRadii(n);
|
|
192
|
+
const shape = shapeOfLevel(n.level);
|
|
193
|
+
const rings = ringCount(n.branchCount);
|
|
194
|
+
if (rings === 0) return blobRadius(shape, rx, ry, angle);
|
|
195
|
+
const ring = RINGS[rings - 1];
|
|
196
|
+
return blobRadius(shape, rx * ring.scale, ry * ring.scale, angle - ring.rotate * DEG);
|
|
358
197
|
}
|
|
359
|
-
function
|
|
360
|
-
|
|
198
|
+
function connectorGeometry(from, to, gap = METRICS.edgeGap) {
|
|
199
|
+
const theta = Math.atan2(to.y - from.y, to.x - from.x);
|
|
200
|
+
const ra = outlineRadius(from, theta) + gap;
|
|
201
|
+
const rb = outlineRadius(to, theta + Math.PI) + gap;
|
|
202
|
+
const a = { x: from.x + Math.cos(theta) * ra, y: from.y + Math.sin(theta) * ra };
|
|
203
|
+
const b = { x: to.x - Math.cos(theta) * rb, y: to.y - Math.sin(theta) * rb };
|
|
204
|
+
const e = edgePath(a, b);
|
|
205
|
+
return { a, b, d: e.d, angle: e.angle, mid: e.mid, arrow: arrowPath(b, e.angle) };
|
|
361
206
|
}
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
207
|
+
|
|
208
|
+
// src/generated/geometry/idea.ts
|
|
209
|
+
var LABEL_GROWTH = { idea: 1.3, connector: 1.6 };
|
|
210
|
+
var IDEA = {
|
|
211
|
+
/** Width an idea starts at… */
|
|
212
|
+
baseWidth: { root: 240, node: 200, mini: 120 },
|
|
213
|
+
/** …and the widest it gets before it grows taller instead. */
|
|
214
|
+
maxWidth: { root: 400, node: 360, mini: 200 },
|
|
215
|
+
/** Width grows in steps of this. */
|
|
216
|
+
step: 20,
|
|
217
|
+
/** Height = width × aspect (at least `minRy` × 2), more if the label needs it. */
|
|
218
|
+
aspect: 0.74,
|
|
219
|
+
minRy: 64,
|
|
220
|
+
/** The label's box is the idea's width less this (22 each side). */
|
|
221
|
+
labelInset: 44,
|
|
222
|
+
/** The idea widens until its label fits in this many lines. */
|
|
223
|
+
labelLines: 3,
|
|
224
|
+
/** Label size (before the label scale and zoom growth), weight from the canvas type styles. */
|
|
225
|
+
labelSize: { root: 30, node: 22, mini: 15 },
|
|
226
|
+
labelLineHeight: 1.15,
|
|
227
|
+
/** The label may fill at most this share of the idea's height. */
|
|
228
|
+
labelFillHeight: 0.7
|
|
229
|
+
};
|
|
230
|
+
function wrapLines(text, maxWidth, measure) {
|
|
231
|
+
const words = text.split(/\s+/).filter(Boolean);
|
|
232
|
+
const lines = [];
|
|
233
|
+
let cur = "";
|
|
234
|
+
for (const w of words) {
|
|
235
|
+
const next = cur ? `${cur} ${w}` : w;
|
|
236
|
+
if (cur && measure(next) > maxWidth) {
|
|
237
|
+
lines.push(cur);
|
|
238
|
+
cur = w;
|
|
239
|
+
} else cur = next;
|
|
240
|
+
}
|
|
241
|
+
if (cur) lines.push(cur);
|
|
242
|
+
return lines.length ? lines : [""];
|
|
367
243
|
}
|
|
368
|
-
function
|
|
369
|
-
const
|
|
370
|
-
|
|
244
|
+
function ideaSize(kind, label, measure, labelScale = 1) {
|
|
245
|
+
const px = IDEA.labelSize[kind] * labelScale * LABEL_GROWTH.idea;
|
|
246
|
+
const fit = (w) => wrapLines(label, w - IDEA.labelInset, (t) => measure(t, px));
|
|
247
|
+
const base = IDEA.baseWidth[kind], max = IDEA.maxWidth[kind];
|
|
248
|
+
let width = base, lines = fit(width);
|
|
249
|
+
while (lines.length > IDEA.labelLines && width < max) {
|
|
250
|
+
width = Math.min(max, width + IDEA.step);
|
|
251
|
+
lines = fit(width);
|
|
252
|
+
}
|
|
253
|
+
const rx = width / 2;
|
|
254
|
+
const ry = Math.max(IDEA.minRy, rx * IDEA.aspect, lines.length * px * IDEA.labelLineHeight / 2 / IDEA.labelFillHeight);
|
|
255
|
+
return { width, height: ry * 2, rx, ry, lines };
|
|
256
|
+
}
|
|
257
|
+
function labelGrowth(scale) {
|
|
258
|
+
const inv = 1 / Math.max(scale, 1e-4);
|
|
259
|
+
return { idea: Math.max(1, Math.min(inv, LABEL_GROWTH.idea)), connector: Math.max(1, Math.min(inv, LABEL_GROWTH.connector)) };
|
|
371
260
|
}
|
|
261
|
+
|
|
262
|
+
// src/rendering/ideaSize.ts
|
|
263
|
+
var approximateMeasure = (text, px) => text.length * px * 0.5;
|
|
264
|
+
var ideaKindOf = (layer, index) => layer.level === 0 && (layer.layout ?? "radial") === "radial" && index === 0 ? "root" : "node";
|
|
372
265
|
// Annotate the CommonJS export names for ESM import in node:
|
|
373
266
|
0 && (module.exports = {
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
267
|
+
BLOB_SHAPES,
|
|
268
|
+
IDEA,
|
|
269
|
+
LABEL_GROWTH,
|
|
270
|
+
MAX_RINGS,
|
|
271
|
+
RINGS,
|
|
272
|
+
SHAPE,
|
|
273
|
+
approximateMeasure,
|
|
274
|
+
arrowPath,
|
|
275
|
+
blobPath,
|
|
276
|
+
blobRadius,
|
|
277
|
+
connectorGeometry,
|
|
278
|
+
drawBlob,
|
|
279
|
+
edgePath,
|
|
280
|
+
ideaKindOf,
|
|
281
|
+
ideaSize,
|
|
282
|
+
labelGrowth,
|
|
283
|
+
nodeBounds,
|
|
284
|
+
nodeRadii,
|
|
285
|
+
outlineRadius,
|
|
286
|
+
ringCount,
|
|
287
|
+
ringsFor,
|
|
288
|
+
shapeForLevel,
|
|
289
|
+
shapeOfLevel,
|
|
290
|
+
wrapLines
|
|
390
291
|
});
|
|
391
292
|
//# sourceMappingURL=index.cjs.map
|