@visualli/core 0.1.2 → 0.1.4
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/index.cjs +7 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -10
- package/dist/index.d.ts +4 -10
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/parser/visualliConverter.ts +3 -3
- package/src/parser/visualliParser.ts +1 -6
- package/src/types/index.ts +0 -1
- package/src/types/schema.ts +2 -2
- package/src/utils/navigation.ts +12 -8
package/dist/index.cjs
CHANGED
|
@@ -160,6 +160,7 @@ __export(index_exports, {
|
|
|
160
160
|
easeOutCubic: () => easeOutCubic,
|
|
161
161
|
easeOutQuad: () => easeOutQuad,
|
|
162
162
|
easeZoomTransition: () => easeZoomTransition,
|
|
163
|
+
fetchAndParseVisualli: () => fetchAndParseVisualli,
|
|
163
164
|
flattenNodes: () => flattenNodes,
|
|
164
165
|
focusOnNode: () => focusOnNode,
|
|
165
166
|
generateSampleConfig: () => generateSampleConfig,
|
|
@@ -184,7 +185,6 @@ __export(index_exports, {
|
|
|
184
185
|
getVisibleNodes: () => getVisibleNodes,
|
|
185
186
|
isFeatureEnabled: () => isFeatureEnabled,
|
|
186
187
|
isNodeInViewport: () => isNodeInViewport,
|
|
187
|
-
loadVisualliFile: () => loadVisualliFile,
|
|
188
188
|
loadVisualliFileFromFile: () => loadVisualliFileFromFile,
|
|
189
189
|
optimizeLayout: () => optimizeLayout,
|
|
190
190
|
panViewport: () => panViewport,
|
|
@@ -439,7 +439,7 @@ function parseVisualliFile(content) {
|
|
|
439
439
|
if (!doc.rootLayer) throw new VisualliParseError("Missing root layer (level 0)");
|
|
440
440
|
return doc;
|
|
441
441
|
}
|
|
442
|
-
async function
|
|
442
|
+
async function fetchAndParseVisualli(url) {
|
|
443
443
|
const response = await fetch(url);
|
|
444
444
|
if (!response.ok) {
|
|
445
445
|
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
@@ -1664,7 +1664,7 @@ var RBushSpatialIndex = class {
|
|
|
1664
1664
|
}
|
|
1665
1665
|
};
|
|
1666
1666
|
|
|
1667
|
-
//
|
|
1667
|
+
// ../../../../node_modules/zustand/esm/vanilla.mjs
|
|
1668
1668
|
var import_meta = {};
|
|
1669
1669
|
var createStoreImpl = (createState) => {
|
|
1670
1670
|
let state;
|
|
@@ -1776,7 +1776,9 @@ function calculateFitCenter(nodes) {
|
|
|
1776
1776
|
function getContainersForLayer(doc, layerId) {
|
|
1777
1777
|
const layer = doc.layers.get(layerId);
|
|
1778
1778
|
if (!layer) return [];
|
|
1779
|
-
|
|
1779
|
+
const containers = layer.containers ?? [];
|
|
1780
|
+
if (!Array.isArray(containers)) return [];
|
|
1781
|
+
return containers.map((c) => {
|
|
1780
1782
|
const label = c.data?.label ?? c.id;
|
|
1781
1783
|
return { id: c.id, label, nodeIds: c.nodes, level: layer.level };
|
|
1782
1784
|
});
|
|
@@ -2282,6 +2284,7 @@ function drawBlobPath(ctx, radiusX, radiusY, blobType) {
|
|
|
2282
2284
|
easeOutCubic,
|
|
2283
2285
|
easeOutQuad,
|
|
2284
2286
|
easeZoomTransition,
|
|
2287
|
+
fetchAndParseVisualli,
|
|
2285
2288
|
flattenNodes,
|
|
2286
2289
|
focusOnNode,
|
|
2287
2290
|
generateSampleConfig,
|
|
@@ -2306,7 +2309,6 @@ function drawBlobPath(ctx, radiusX, radiusY, blobType) {
|
|
|
2306
2309
|
getVisibleNodes,
|
|
2307
2310
|
isFeatureEnabled,
|
|
2308
2311
|
isNodeInViewport,
|
|
2309
|
-
loadVisualliFile,
|
|
2310
2312
|
loadVisualliFileFromFile,
|
|
2311
2313
|
optimizeLayout,
|
|
2312
2314
|
panViewport,
|