elseware-ui 3.0.10 → 3.0.11
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.js +39 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +39 -13
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -14105,19 +14105,6 @@ var Flag = ({
|
|
|
14105
14105
|
);
|
|
14106
14106
|
};
|
|
14107
14107
|
|
|
14108
|
-
// src/components/data-display/graphs/layouts/registry.ts
|
|
14109
|
-
var registry = /* @__PURE__ */ new Map();
|
|
14110
|
-
var registerLayout = (type2, executor) => {
|
|
14111
|
-
registry.set(type2, executor);
|
|
14112
|
-
};
|
|
14113
|
-
var getLayout = (type2) => {
|
|
14114
|
-
const layout = registry.get(type2);
|
|
14115
|
-
if (!layout) {
|
|
14116
|
-
throw new Error(`Layout "${type2}" not registered`);
|
|
14117
|
-
}
|
|
14118
|
-
return layout;
|
|
14119
|
-
};
|
|
14120
|
-
|
|
14121
14108
|
// node_modules/d3-dispatch/src/dispatch.js
|
|
14122
14109
|
var noop = { value: () => {
|
|
14123
14110
|
} };
|
|
@@ -17101,6 +17088,45 @@ function createTreeLayout(nodes, edges, width, height) {
|
|
|
17101
17088
|
};
|
|
17102
17089
|
});
|
|
17103
17090
|
}
|
|
17091
|
+
|
|
17092
|
+
// src/components/data-display/graphs/layouts/registry.ts
|
|
17093
|
+
var registry = /* @__PURE__ */ new Map();
|
|
17094
|
+
var defaultLayoutsRegistered = false;
|
|
17095
|
+
var registerLayout = (type2, executor) => {
|
|
17096
|
+
registry.set(type2, executor);
|
|
17097
|
+
};
|
|
17098
|
+
var registerDefaultLayouts = () => {
|
|
17099
|
+
if (defaultLayoutsRegistered) return;
|
|
17100
|
+
registerLayout("force", ({ nodes, edges, width, height, onTick }) => {
|
|
17101
|
+
const sim = createForceLayout(nodes, edges, width, height);
|
|
17102
|
+
sim.on("tick", () => {
|
|
17103
|
+
onTick?.([...nodes]);
|
|
17104
|
+
});
|
|
17105
|
+
return {
|
|
17106
|
+
type: "simulation",
|
|
17107
|
+
stop: () => sim.stop()
|
|
17108
|
+
};
|
|
17109
|
+
});
|
|
17110
|
+
registerLayout("grid", ({ nodes, width, height, onTick }) => {
|
|
17111
|
+
const result = createGridLayout(nodes, width, height);
|
|
17112
|
+
onTick?.(result);
|
|
17113
|
+
return { type: "static" };
|
|
17114
|
+
});
|
|
17115
|
+
registerLayout("tree", ({ nodes, edges, width, height, onTick }) => {
|
|
17116
|
+
const result = createTreeLayout(nodes, edges, width, height);
|
|
17117
|
+
onTick?.(result);
|
|
17118
|
+
return { type: "static" };
|
|
17119
|
+
});
|
|
17120
|
+
defaultLayoutsRegistered = true;
|
|
17121
|
+
};
|
|
17122
|
+
var getLayout = (type2) => {
|
|
17123
|
+
registerDefaultLayouts();
|
|
17124
|
+
const layout = registry.get(type2);
|
|
17125
|
+
if (!layout) {
|
|
17126
|
+
throw new Error(`Layout "${type2}" not registered`);
|
|
17127
|
+
}
|
|
17128
|
+
return layout;
|
|
17129
|
+
};
|
|
17104
17130
|
var NODE_SIZE = 48;
|
|
17105
17131
|
var GraphNode = ({ node: node2, renderCustom }) => {
|
|
17106
17132
|
if (node2.x === void 0 || node2.y === void 0) return null;
|