@darajs/ui-causal-graph-editor 0.4.8
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/LICENSE +201 -0
- package/README.md +12 -0
- package/dist/CanvasPool.5cd3cdcd.js +30 -0
- package/dist/SharedSystems.140ebe02.js +1905 -0
- package/dist/WebGLRenderer.6ede660f.js +2241 -0
- package/dist/WebGPURenderer.f884c756.js +1544 -0
- package/dist/browserAll.2dcaa9f7.js +953 -0
- package/dist/colorToUniform.7c604fe6.js +76 -0
- package/dist/index.a01cfc5f.js +61895 -0
- package/dist/index.js +35 -0
- package/dist/index.umd.cjs +10287 -0
- package/dist/init.73e5c5e2.js +2602 -0
- package/dist/style.css +1 -0
- package/dist/types/graph-viewer/causal-graph-editor.d.ts +58 -0
- package/dist/types/graph-viewer/causal-graph-editor.d.ts.map +1 -0
- package/dist/types/graph-viewer/storybook/stories-utils.d.ts +1247 -0
- package/dist/types/graph-viewer/storybook/stories-utils.d.ts.map +1 -0
- package/dist/types/graph-viewer/utils/use-iterate-edges.d.ts +32 -0
- package/dist/types/graph-viewer/utils/use-iterate-edges.d.ts.map +1 -0
- package/dist/types/graph-viewer/utils/use-iterate-nodes.d.ts +32 -0
- package/dist/types/graph-viewer/utils/use-iterate-nodes.d.ts.map +1 -0
- package/dist/types/index.d.ts +32 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/jest-setup.d.ts +18 -0
- package/dist/types/jest-setup.d.ts.map +1 -0
- package/dist/types/node-hierarchy-builder/index.d.ts +19 -0
- package/dist/types/node-hierarchy-builder/index.d.ts.map +1 -0
- package/dist/types/node-hierarchy-builder/layer-divider.d.ts +15 -0
- package/dist/types/node-hierarchy-builder/layer-divider.d.ts.map +1 -0
- package/dist/types/node-hierarchy-builder/layer-label-editor.d.ts +24 -0
- package/dist/types/node-hierarchy-builder/layer-label-editor.d.ts.map +1 -0
- package/dist/types/node-hierarchy-builder/layer.d.ts +35 -0
- package/dist/types/node-hierarchy-builder/layer.d.ts.map +1 -0
- package/dist/types/node-hierarchy-builder/node-hierarchy-builder.d.ts +27 -0
- package/dist/types/node-hierarchy-builder/node-hierarchy-builder.d.ts.map +1 -0
- package/dist/types/node-hierarchy-builder/node.d.ts +21 -0
- package/dist/types/node-hierarchy-builder/node.d.ts.map +1 -0
- package/dist/types/node-hierarchy-builder/shared.d.ts +93 -0
- package/dist/types/node-hierarchy-builder/shared.d.ts.map +1 -0
- package/dist/types/shared/causal-graph-store.d.ts +118 -0
- package/dist/types/shared/causal-graph-store.d.ts.map +1 -0
- package/dist/types/shared/editor-overlay/buttons/add-node-button.d.ts +25 -0
- package/dist/types/shared/editor-overlay/buttons/add-node-button.d.ts.map +1 -0
- package/dist/types/shared/editor-overlay/buttons/center-graph-button.d.ts +7 -0
- package/dist/types/shared/editor-overlay/buttons/center-graph-button.d.ts.map +1 -0
- package/dist/types/shared/editor-overlay/buttons/collapse-all-button.d.ts +7 -0
- package/dist/types/shared/editor-overlay/buttons/collapse-all-button.d.ts.map +1 -0
- package/dist/types/shared/editor-overlay/buttons/collapse-expand-button.d.ts +26 -0
- package/dist/types/shared/editor-overlay/buttons/collapse-expand-button.d.ts.map +1 -0
- package/dist/types/shared/editor-overlay/buttons/drag-mode-button.d.ts +27 -0
- package/dist/types/shared/editor-overlay/buttons/drag-mode-button.d.ts.map +1 -0
- package/dist/types/shared/editor-overlay/buttons/index.d.ts +24 -0
- package/dist/types/shared/editor-overlay/buttons/index.d.ts.map +1 -0
- package/dist/types/shared/editor-overlay/buttons/recalculate-layout-button.d.ts +7 -0
- package/dist/types/shared/editor-overlay/buttons/recalculate-layout-button.d.ts.map +1 -0
- package/dist/types/shared/editor-overlay/buttons/save-image-button.d.ts +7 -0
- package/dist/types/shared/editor-overlay/buttons/save-image-button.d.ts.map +1 -0
- package/dist/types/shared/editor-overlay/buttons/soft-edge-arrow-button.d.ts +19 -0
- package/dist/types/shared/editor-overlay/buttons/soft-edge-arrow-button.d.ts.map +1 -0
- package/dist/types/shared/editor-overlay/floating-elements.d.ts +29 -0
- package/dist/types/shared/editor-overlay/floating-elements.d.ts.map +1 -0
- package/dist/types/shared/editor-overlay/index.d.ts +22 -0
- package/dist/types/shared/editor-overlay/index.d.ts.map +1 -0
- package/dist/types/shared/editor-overlay/legend/index.d.ts +19 -0
- package/dist/types/shared/editor-overlay/legend/index.d.ts.map +1 -0
- package/dist/types/shared/editor-overlay/legend/legend-data.d.ts +49 -0
- package/dist/types/shared/editor-overlay/legend/legend-data.d.ts.map +1 -0
- package/dist/types/shared/editor-overlay/legend/legend-list.d.ts +6 -0
- package/dist/types/shared/editor-overlay/legend/legend-list.d.ts.map +1 -0
- package/dist/types/shared/editor-overlay/legend/legend.d.ts +7 -0
- package/dist/types/shared/editor-overlay/legend/legend.d.ts.map +1 -0
- package/dist/types/shared/editor-overlay/overlay.d.ts +42 -0
- package/dist/types/shared/editor-overlay/overlay.d.ts.map +1 -0
- package/dist/types/shared/editor-overlay/panel-content/edge/edge-editor.d.ts +8 -0
- package/dist/types/shared/editor-overlay/panel-content/edge/edge-editor.d.ts.map +1 -0
- package/dist/types/shared/editor-overlay/panel-content/edge/edge-info-content.d.ts +41 -0
- package/dist/types/shared/editor-overlay/panel-content/edge/edge-info-content.d.ts.map +1 -0
- package/dist/types/shared/editor-overlay/panel-content/edge/editor-props.d.ts +35 -0
- package/dist/types/shared/editor-overlay/panel-content/edge/editor-props.d.ts.map +1 -0
- package/dist/types/shared/editor-overlay/panel-content/edge/encoder-editor.d.ts +23 -0
- package/dist/types/shared/editor-overlay/panel-content/edge/encoder-editor.d.ts.map +1 -0
- package/dist/types/shared/editor-overlay/panel-content/edge/index.d.ts +18 -0
- package/dist/types/shared/editor-overlay/panel-content/edge/index.d.ts.map +1 -0
- package/dist/types/shared/editor-overlay/panel-content/edge/pag-editor.d.ts +23 -0
- package/dist/types/shared/editor-overlay/panel-content/edge/pag-editor.d.ts.map +1 -0
- package/dist/types/shared/editor-overlay/panel-content/edge/resolver-editor.d.ts +7 -0
- package/dist/types/shared/editor-overlay/panel-content/edge/resolver-editor.d.ts.map +1 -0
- package/dist/types/shared/editor-overlay/panel-content/edge/sections/constraint-editor.d.ts +27 -0
- package/dist/types/shared/editor-overlay/panel-content/edge/sections/constraint-editor.d.ts.map +1 -0
- package/dist/types/shared/editor-overlay/panel-content/edge/sections/description-editor.d.ts +15 -0
- package/dist/types/shared/editor-overlay/panel-content/edge/sections/description-editor.d.ts.map +1 -0
- package/dist/types/shared/editor-overlay/panel-content/edge/sections/direction-editor.d.ts +21 -0
- package/dist/types/shared/editor-overlay/panel-content/edge/sections/direction-editor.d.ts.map +1 -0
- package/dist/types/shared/editor-overlay/panel-content/edge/sections/edge-type-editor.d.ts +17 -0
- package/dist/types/shared/editor-overlay/panel-content/edge/sections/edge-type-editor.d.ts.map +1 -0
- package/dist/types/shared/editor-overlay/panel-content/edge/sections/index.d.ts +19 -0
- package/dist/types/shared/editor-overlay/panel-content/edge/sections/index.d.ts.map +1 -0
- package/dist/types/shared/editor-overlay/panel-content/index.d.ts +20 -0
- package/dist/types/shared/editor-overlay/panel-content/index.d.ts.map +1 -0
- package/dist/types/shared/editor-overlay/panel-content/node/index.d.ts +18 -0
- package/dist/types/shared/editor-overlay/panel-content/node/index.d.ts.map +1 -0
- package/dist/types/shared/editor-overlay/panel-content/node/label-editor.d.ts +11 -0
- package/dist/types/shared/editor-overlay/panel-content/node/label-editor.d.ts.map +1 -0
- package/dist/types/shared/editor-overlay/panel-content/node/node-info-content.d.ts +34 -0
- package/dist/types/shared/editor-overlay/panel-content/node/node-info-content.d.ts.map +1 -0
- package/dist/types/shared/editor-overlay/panel-content/panel-content.d.ts +17 -0
- package/dist/types/shared/editor-overlay/panel-content/panel-content.d.ts.map +1 -0
- package/dist/types/shared/editor-overlay/panel-content/panel-title.d.ts +12 -0
- package/dist/types/shared/editor-overlay/panel-content/panel-title.d.ts.map +1 -0
- package/dist/types/shared/editor-overlay/panel-content/styled.d.ts +9 -0
- package/dist/types/shared/editor-overlay/panel-content/styled.d.ts.map +1 -0
- package/dist/types/shared/editor-overlay/positional-divs.d.ts +25 -0
- package/dist/types/shared/editor-overlay/positional-divs.d.ts.map +1 -0
- package/dist/types/shared/editor-overlay/search-bar/index.d.ts +19 -0
- package/dist/types/shared/editor-overlay/search-bar/index.d.ts.map +1 -0
- package/dist/types/shared/editor-overlay/search-bar/search-bar.d.ts +21 -0
- package/dist/types/shared/editor-overlay/search-bar/search-bar.d.ts.map +1 -0
- package/dist/types/shared/editor-overlay/search-bar/use-search.d.ts +32 -0
- package/dist/types/shared/editor-overlay/search-bar/use-search.d.ts.map +1 -0
- package/dist/types/shared/editor-overlay/zoom-prompt.d.ts +9 -0
- package/dist/types/shared/editor-overlay/zoom-prompt.d.ts.map +1 -0
- package/dist/types/shared/graph-context.d.ts +26 -0
- package/dist/types/shared/graph-context.d.ts.map +1 -0
- package/dist/types/shared/graph-layout/circular-layout.d.ts +32 -0
- package/dist/types/shared/graph-layout/circular-layout.d.ts.map +1 -0
- package/dist/types/shared/graph-layout/common.d.ts +96 -0
- package/dist/types/shared/graph-layout/common.d.ts.map +1 -0
- package/dist/types/shared/graph-layout/custom-layout.d.ts +36 -0
- package/dist/types/shared/graph-layout/custom-layout.d.ts.map +1 -0
- package/dist/types/shared/graph-layout/fcose-layout.d.ts +132 -0
- package/dist/types/shared/graph-layout/fcose-layout.d.ts.map +1 -0
- package/dist/types/shared/graph-layout/force-atlas-layout.d.ts +103 -0
- package/dist/types/shared/graph-layout/force-atlas-layout.d.ts.map +1 -0
- package/dist/types/shared/graph-layout/index.d.ts +25 -0
- package/dist/types/shared/graph-layout/index.d.ts.map +1 -0
- package/dist/types/shared/graph-layout/marketing-layout.d.ts +63 -0
- package/dist/types/shared/graph-layout/marketing-layout.d.ts.map +1 -0
- package/dist/types/shared/graph-layout/planar-layout.d.ts +67 -0
- package/dist/types/shared/graph-layout/planar-layout.d.ts.map +1 -0
- package/dist/types/shared/graph-layout/spring-layout.d.ts +101 -0
- package/dist/types/shared/graph-layout/spring-layout.d.ts.map +1 -0
- package/dist/types/shared/graph-layout/worker/circular.d.ts +5 -0
- package/dist/types/shared/graph-layout/worker/circular.d.ts.map +1 -0
- package/dist/types/shared/graph-layout/worker/client.d.ts +22 -0
- package/dist/types/shared/graph-layout/worker/client.d.ts.map +1 -0
- package/dist/types/shared/graph-layout/worker/fcose.d.ts +18 -0
- package/dist/types/shared/graph-layout/worker/fcose.d.ts.map +1 -0
- package/dist/types/shared/graph-layout/worker/force-atlas.d.ts +5 -0
- package/dist/types/shared/graph-layout/worker/force-atlas.d.ts.map +1 -0
- package/dist/types/shared/graph-layout/worker/marketing.d.ts +5 -0
- package/dist/types/shared/graph-layout/worker/marketing.d.ts.map +1 -0
- package/dist/types/shared/graph-layout/worker/planar.d.ts +5 -0
- package/dist/types/shared/graph-layout/worker/planar.d.ts.map +1 -0
- package/dist/types/shared/graph-layout/worker/spring.d.ts +19 -0
- package/dist/types/shared/graph-layout/worker/spring.d.ts.map +1 -0
- package/dist/types/shared/graph-layout/worker/worker.d.ts +27 -0
- package/dist/types/shared/graph-layout/worker/worker.d.ts.map +1 -0
- package/dist/types/shared/parsers.d.ts +43 -0
- package/dist/types/shared/parsers.d.ts.map +1 -0
- package/dist/types/shared/pointer-context.d.ts +20 -0
- package/dist/types/shared/pointer-context.d.ts.map +1 -0
- package/dist/types/shared/rendering/background.d.ts +48 -0
- package/dist/types/shared/rendering/background.d.ts.map +1 -0
- package/dist/types/shared/rendering/colors.d.ts +27 -0
- package/dist/types/shared/rendering/colors.d.ts.map +1 -0
- package/dist/types/shared/rendering/edge/curve.d.ts +51 -0
- package/dist/types/shared/rendering/edge/curve.d.ts.map +1 -0
- package/dist/types/shared/rendering/edge/definitions.d.ts +73 -0
- package/dist/types/shared/rendering/edge/definitions.d.ts.map +1 -0
- package/dist/types/shared/rendering/edge/edge-object.d.ts +93 -0
- package/dist/types/shared/rendering/edge/edge-object.d.ts.map +1 -0
- package/dist/types/shared/rendering/edge/index.d.ts +19 -0
- package/dist/types/shared/rendering/edge/index.d.ts.map +1 -0
- package/dist/types/shared/rendering/edge/symbols.d.ts +40 -0
- package/dist/types/shared/rendering/edge/symbols.d.ts.map +1 -0
- package/dist/types/shared/rendering/edge/utils.d.ts +27 -0
- package/dist/types/shared/rendering/edge/utils.d.ts.map +1 -0
- package/dist/types/shared/rendering/engine.d.ts +436 -0
- package/dist/types/shared/rendering/engine.d.ts.map +1 -0
- package/dist/types/shared/rendering/grouping/group-container-object.d.ts +56 -0
- package/dist/types/shared/rendering/grouping/group-container-object.d.ts.map +1 -0
- package/dist/types/shared/rendering/grouping/index.d.ts +2 -0
- package/dist/types/shared/rendering/grouping/index.d.ts.map +1 -0
- package/dist/types/shared/rendering/node/definitions.d.ts +59 -0
- package/dist/types/shared/rendering/node/definitions.d.ts.map +1 -0
- package/dist/types/shared/rendering/node/index.d.ts +20 -0
- package/dist/types/shared/rendering/node/index.d.ts.map +1 -0
- package/dist/types/shared/rendering/node/node-object.d.ts +78 -0
- package/dist/types/shared/rendering/node/node-object.d.ts.map +1 -0
- package/dist/types/shared/rendering/node/utils.d.ts +33 -0
- package/dist/types/shared/rendering/node/utils.d.ts.map +1 -0
- package/dist/types/shared/rendering/svg.d.ts +26 -0
- package/dist/types/shared/rendering/svg.d.ts.map +1 -0
- package/dist/types/shared/rendering/text.d.ts +33 -0
- package/dist/types/shared/rendering/text.d.ts.map +1 -0
- package/dist/types/shared/rendering/texture-cache.d.ts +47 -0
- package/dist/types/shared/rendering/texture-cache.d.ts.map +1 -0
- package/dist/types/shared/rendering/use-render-engine.d.ts +115 -0
- package/dist/types/shared/rendering/use-render-engine.d.ts.map +1 -0
- package/dist/types/shared/rendering/utils.d.ts +27 -0
- package/dist/types/shared/rendering/utils.d.ts.map +1 -0
- package/dist/types/shared/serializer.d.ts +39 -0
- package/dist/types/shared/serializer.d.ts.map +1 -0
- package/dist/types/shared/settings-context.d.ts +56 -0
- package/dist/types/shared/settings-context.d.ts.map +1 -0
- package/dist/types/shared/styles.d.ts +4 -0
- package/dist/types/shared/styles.d.ts.map +1 -0
- package/dist/types/shared/use-causal-graph-editor.d.ts +22 -0
- package/dist/types/shared/use-causal-graph-editor.d.ts.map +1 -0
- package/dist/types/shared/use-drag-mode.d.ts +33 -0
- package/dist/types/shared/use-drag-mode.d.ts.map +1 -0
- package/dist/types/shared/use-edge-encoder.d.ts +45 -0
- package/dist/types/shared/use-edge-encoder.d.ts.map +1 -0
- package/dist/types/shared/use-graph-tooltip.d.ts +15 -0
- package/dist/types/shared/use-graph-tooltip.d.ts.map +1 -0
- package/dist/types/shared/use-pane-visibility.d.ts +12 -0
- package/dist/types/shared/use-pane-visibility.d.ts.map +1 -0
- package/dist/types/shared/utils.d.ts +79 -0
- package/dist/types/shared/utils.d.ts.map +1 -0
- package/dist/types/types.d.ts +277 -0
- package/dist/types/types.d.ts.map +1 -0
- package/dist/webworkerAll.2e3715a5.js +7 -0
- package/package.json +120 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { DefaultTheme } from '@darajs/styled-components';
|
|
2
|
+
import type { GraphTiers, NodeCategory, SimulationGraph } from '../types';
|
|
3
|
+
export declare const DEFAULT_NODE_SIZE = 64;
|
|
4
|
+
export declare const TARGET_NODE_MULTIPLIER = 1.25;
|
|
5
|
+
/**
|
|
6
|
+
* Check if adding an edge to the graph will create a cycle.
|
|
7
|
+
*
|
|
8
|
+
* @param graph current graph state instance
|
|
9
|
+
* @param edge edge to add
|
|
10
|
+
*/
|
|
11
|
+
export declare function willCreateCycle(graphOriginal: SimulationGraph, edge: [string, string]): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Format a given name, i.e. a snake_case label to 'Sentence case'
|
|
14
|
+
*
|
|
15
|
+
* @param name name to format
|
|
16
|
+
*/
|
|
17
|
+
export declare function formatName(name: string): string;
|
|
18
|
+
export declare function coerceToArray<T>(value: T | T[]): T[];
|
|
19
|
+
/**
|
|
20
|
+
* A function that generates a tooltip to be displayed for nodes and edges
|
|
21
|
+
*
|
|
22
|
+
* @param id - the id of the Node or Edge to display on top
|
|
23
|
+
* @param data - the key values pairs of data to be displayed
|
|
24
|
+
* @param label - a label to show instead of the id and preserve the id for the key
|
|
25
|
+
* @param tooltipSize - font size to use for the tooltip
|
|
26
|
+
*/
|
|
27
|
+
export declare function getTooltipContent(id: string, data: {
|
|
28
|
+
[k: string]: any;
|
|
29
|
+
} | string, theme: DefaultTheme, label?: string, tooltipSize?: number): JSX.Element;
|
|
30
|
+
/**
|
|
31
|
+
* Get node category
|
|
32
|
+
*
|
|
33
|
+
* @param graph current graph state instance
|
|
34
|
+
* @param id node id
|
|
35
|
+
* @param isLatent whether the node is latent
|
|
36
|
+
*/
|
|
37
|
+
export declare function getNodeCategory(graph: SimulationGraph, id: string, isLatent?: boolean): NodeCategory;
|
|
38
|
+
/**
|
|
39
|
+
* Defines if a Graph is a DAG (directed acyclic graph). Two criteria must be met for this, the first it must not have cyclews and the second is that all edges must be directed.
|
|
40
|
+
*
|
|
41
|
+
* @param graph current graph state instance
|
|
42
|
+
*/
|
|
43
|
+
export declare function isDag(graph: SimulationGraph): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Based on a node attribute checks if the path is in the attribute or in extras, if not found returns undefined
|
|
46
|
+
* @param attributes node object or a sub attribute of the node object
|
|
47
|
+
* @param path path to the attribute
|
|
48
|
+
* */
|
|
49
|
+
export declare function getPathInNodeAttribute(attributes: Record<string, any>, path: string): any;
|
|
50
|
+
/**
|
|
51
|
+
* Gets nodes grouped by a given attribute
|
|
52
|
+
* @param nodes nodes to be grouped
|
|
53
|
+
* @param group the attribute to group by
|
|
54
|
+
* @param graph the graph
|
|
55
|
+
* @returns a record of group name to an array of nodes
|
|
56
|
+
* */
|
|
57
|
+
export declare function getGroupToNodesMap(nodes: string[], group: string, graph: SimulationGraph): Record<string, string[]>;
|
|
58
|
+
/**
|
|
59
|
+
* Gets the group for each node based on a given attribute
|
|
60
|
+
* @param nodes nodes to be checked
|
|
61
|
+
* @param group the attribute to check
|
|
62
|
+
* @param graph the graph
|
|
63
|
+
* @returns a map of node to group
|
|
64
|
+
*/
|
|
65
|
+
export declare function getNodeToGroupMap(nodes: string[], group: string, graph: SimulationGraph): Record<string, string>;
|
|
66
|
+
/**
|
|
67
|
+
* Gets nodes grouped by a given attribute
|
|
68
|
+
* @param nodes nodes to be grouped
|
|
69
|
+
* @param group the attribute to group by
|
|
70
|
+
* @param graph the graph
|
|
71
|
+
* */
|
|
72
|
+
export declare function getNodeOrder(nodes: string[], orderPath: string, graph: SimulationGraph): Record<string, string>;
|
|
73
|
+
/**
|
|
74
|
+
* Gets an array of array of nodes where if rank is defined in the coorect hierarchical order
|
|
75
|
+
* @param tiers the GraphTiers information passed to the layout
|
|
76
|
+
* @param graph the graph
|
|
77
|
+
* */
|
|
78
|
+
export declare function getTiersArray(tiers: GraphTiers, graph: SimulationGraph): string[][];
|
|
79
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/shared/utils.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAG1E,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAE3C;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,aAAa,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAkD/F;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAK/C;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,CA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|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023 Impulse Innovations Limited
|
|
3
|
+
*
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import type { XYPosition } from 'graphology-layout/utils';
|
|
18
|
+
import type { AbstractGraph, SerializedGraph } from 'graphology-types';
|
|
19
|
+
/**
|
|
20
|
+
* Defines 'modes' that the viewer can run in
|
|
21
|
+
*/
|
|
22
|
+
export declare enum EditorMode {
|
|
23
|
+
/**
|
|
24
|
+
* Standard causalgraph DAG viewer mode
|
|
25
|
+
*/
|
|
26
|
+
DEFAULT = "DEFAULT",
|
|
27
|
+
/**
|
|
28
|
+
* Domain knowledge editor, input/output is a list of constraints and the graph structure serves for visualisation
|
|
29
|
+
*/
|
|
30
|
+
EDGE_ENCODER = "EDGE_ENCODER",
|
|
31
|
+
/**
|
|
32
|
+
* Like default but displays all edge types (PAG mode)
|
|
33
|
+
*/
|
|
34
|
+
PAG_VIEWER = "PAG",
|
|
35
|
+
/**
|
|
36
|
+
* Resolvera mode essentially does the job of both PAG, CAUSAL_GRAPH editors, taking in EDGE_ENCODER domain knowledge
|
|
37
|
+
* Operates on a structure with additional PAG symbols, 'forced' and 'accepted' flags in meta.
|
|
38
|
+
* Uses simplified UI - intended for business user
|
|
39
|
+
*/
|
|
40
|
+
RESOLVER = "RESOLVER"
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Prefix types in an object with `meta.rendering_properties`
|
|
44
|
+
*/
|
|
45
|
+
type RenderingMetaKeys<T> = {
|
|
46
|
+
[K in keyof T as K extends string ? `meta.rendering_properties.${K}` : never]: T[K];
|
|
47
|
+
};
|
|
48
|
+
export interface EdgeRenderingMeta {
|
|
49
|
+
accepted?: boolean;
|
|
50
|
+
color?: string;
|
|
51
|
+
description?: string;
|
|
52
|
+
forced?: boolean;
|
|
53
|
+
thickness?: number;
|
|
54
|
+
tooltip?: string | Record<string, string>;
|
|
55
|
+
collapsedEdgesCount?: number;
|
|
56
|
+
}
|
|
57
|
+
export type FlatEdgeRenderingMeta = RenderingMetaKeys<EdgeRenderingMeta>;
|
|
58
|
+
export interface NodeRenderingMeta {
|
|
59
|
+
color?: string;
|
|
60
|
+
highlight_color?: string;
|
|
61
|
+
label?: string;
|
|
62
|
+
label_color?: string;
|
|
63
|
+
label_size?: number;
|
|
64
|
+
latent?: boolean;
|
|
65
|
+
size?: number;
|
|
66
|
+
tooltip?: string | Record<string, string>;
|
|
67
|
+
x?: number;
|
|
68
|
+
y?: number;
|
|
69
|
+
}
|
|
70
|
+
export type FlatNodeRenderingMeta = RenderingMetaKeys<NodeRenderingMeta>;
|
|
71
|
+
export interface CausalGraphNodeMeta {
|
|
72
|
+
[key: string]: any;
|
|
73
|
+
rendering_properties?: NodeRenderingMeta;
|
|
74
|
+
}
|
|
75
|
+
export interface CausalGraphEdgeMeta {
|
|
76
|
+
[key: string]: any;
|
|
77
|
+
rendering_properties?: EdgeRenderingMeta;
|
|
78
|
+
}
|
|
79
|
+
/** Target structure for parsers/serialisers */
|
|
80
|
+
export interface CausalGraph {
|
|
81
|
+
edges: Record<string, Record<string, CausalGraphEdge>>;
|
|
82
|
+
extras?: Record<string, any>;
|
|
83
|
+
nodes: Record<string, CausalGraphNode>;
|
|
84
|
+
version: string;
|
|
85
|
+
}
|
|
86
|
+
export interface CausalGraphNode {
|
|
87
|
+
extras?: Record<string, any>;
|
|
88
|
+
identifier: string;
|
|
89
|
+
meta: CausalGraphNodeMeta;
|
|
90
|
+
node_class?: string;
|
|
91
|
+
variable_type: string;
|
|
92
|
+
}
|
|
93
|
+
export interface CausalGraphEdge {
|
|
94
|
+
destination: CausalGraphNode;
|
|
95
|
+
edge_type: EdgeType;
|
|
96
|
+
extras?: Record<string, any>;
|
|
97
|
+
meta: CausalGraphEdgeMeta;
|
|
98
|
+
source: CausalGraphNode;
|
|
99
|
+
}
|
|
100
|
+
export declare enum VariableType {
|
|
101
|
+
BINARY = "binary",
|
|
102
|
+
CONTINUOUS = "continuous",
|
|
103
|
+
MULTICLASS = "multiclass",
|
|
104
|
+
ORDINAL = "ordinal",
|
|
105
|
+
UNSPECIFIED = "unspecified"
|
|
106
|
+
}
|
|
107
|
+
export declare enum EdgeType {
|
|
108
|
+
/**
|
|
109
|
+
* This is only used internally as a temporary representation in PAG mode, should be reversed
|
|
110
|
+
* in the serialised output.
|
|
111
|
+
*/
|
|
112
|
+
BACKWARDS_DIRECTED_EDGE = "<-",
|
|
113
|
+
BIDIRECTED_EDGE = "<>",
|
|
114
|
+
DIRECTED_EDGE = "->",
|
|
115
|
+
UNDIRECTED_EDGE = "--",
|
|
116
|
+
UNKNOWN_DIRECTED_EDGE = "o>",
|
|
117
|
+
UNKNOWN_EDGE = "oo",
|
|
118
|
+
UNKNOWN_UNDIRECTED_EDGE = "o-"
|
|
119
|
+
}
|
|
120
|
+
export interface GraphState {
|
|
121
|
+
/** Mode editor is in - set by INIT action */
|
|
122
|
+
editorMode?: EditorMode;
|
|
123
|
+
/** Graphology.Graph holding current state */
|
|
124
|
+
graph?: SimulationGraph;
|
|
125
|
+
/** Whether new nodes require a position */
|
|
126
|
+
newNodesRequirePosition?: boolean;
|
|
127
|
+
/** List of removed nodes that can be restored */
|
|
128
|
+
restorableNodes?: SimulationNode[];
|
|
129
|
+
}
|
|
130
|
+
export type NodeCategory = 'latent' | 'target' | 'other';
|
|
131
|
+
export interface SimulationNode extends FlatNodeRenderingMeta {
|
|
132
|
+
/** extra properties of a node */
|
|
133
|
+
extras?: Record<string, any>;
|
|
134
|
+
/** Whether node is currently hovered */
|
|
135
|
+
hovered?: boolean;
|
|
136
|
+
/** The node id */
|
|
137
|
+
id: string;
|
|
138
|
+
/** The original meta information of the node */
|
|
139
|
+
originalMeta: CausalGraphNodeMeta;
|
|
140
|
+
/** The node size, some layouts need the node size on the node data itself */
|
|
141
|
+
size?: number;
|
|
142
|
+
variable_type: string;
|
|
143
|
+
/** The velocity in the x-axis of the node */
|
|
144
|
+
vx?: number;
|
|
145
|
+
/** The velocity in the y-axis of the node */
|
|
146
|
+
vy?: number;
|
|
147
|
+
/** The x coordinate of the node */
|
|
148
|
+
x?: number;
|
|
149
|
+
/** The y coordinate of the node */
|
|
150
|
+
y?: number;
|
|
151
|
+
}
|
|
152
|
+
/** Node data with type injected */
|
|
153
|
+
export type SimulationNodeWithCategory = SimulationNode & {
|
|
154
|
+
category: NodeCategory;
|
|
155
|
+
};
|
|
156
|
+
export interface SimulationEdge extends FlatEdgeRenderingMeta {
|
|
157
|
+
/** Thetype of the edge */
|
|
158
|
+
edge_type: EdgeType;
|
|
159
|
+
/** Any extra properties of the edge */
|
|
160
|
+
extras?: Record<string, any>;
|
|
161
|
+
/** Original meta information of that edge */
|
|
162
|
+
originalMeta: CausalGraphEdgeMeta;
|
|
163
|
+
/** optional list of positions the edge should be curved through */
|
|
164
|
+
points?: XYPosition[];
|
|
165
|
+
/** The edge id */
|
|
166
|
+
id?: string;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* D3 variant of edge data, requires putting references to source and target
|
|
170
|
+
*/
|
|
171
|
+
export interface D3SimulationEdge extends SimulationEdge {
|
|
172
|
+
source: SimulationNodeWithCategory;
|
|
173
|
+
target: SimulationNodeWithCategory;
|
|
174
|
+
}
|
|
175
|
+
export interface SimulationAttributes {
|
|
176
|
+
extras?: Record<string, any>;
|
|
177
|
+
/**
|
|
178
|
+
* Generic node size param based on layout; can be used for layout approximation
|
|
179
|
+
*/
|
|
180
|
+
size?: number;
|
|
181
|
+
uid?: string;
|
|
182
|
+
version: string;
|
|
183
|
+
}
|
|
184
|
+
export type SimulationGraph = AbstractGraph<SimulationNode, SimulationEdge, SimulationAttributes>;
|
|
185
|
+
export type SerializedSimulationGraph = SerializedGraph<SimulationNode, SimulationEdge, SimulationAttributes>;
|
|
186
|
+
export declare enum PlanarLayeringAlgorithm {
|
|
187
|
+
/** is optimized to minimize the total height of the graph, height being the direction in which the layers are placed */
|
|
188
|
+
LONGEST_PATH = "longest_path",
|
|
189
|
+
/** is optimized to minimize the overall length of edges */
|
|
190
|
+
SIMPLEX = "simplex"
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Type of an edge constraint that can be encoded
|
|
194
|
+
*
|
|
195
|
+
* str values from cai_causal_graph.EdgeConstraint
|
|
196
|
+
*/
|
|
197
|
+
export declare enum EdgeConstraintType {
|
|
198
|
+
FORBIDDEN = "forbidden",
|
|
199
|
+
HARD_DIRECTED = "hard_directed",
|
|
200
|
+
SOFT_DIRECTED = "soft_directed",
|
|
201
|
+
UNDIRECTED = "hard_undirected"
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Encodes domain-knowledge as edge constraint
|
|
205
|
+
*/
|
|
206
|
+
export interface EdgeConstraint {
|
|
207
|
+
extras?: Record<string, any>;
|
|
208
|
+
source: string;
|
|
209
|
+
target: string;
|
|
210
|
+
type: EdgeConstraintType;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Internal representation of an edge constraint that includes an internal ID
|
|
214
|
+
*/
|
|
215
|
+
export interface EdgeConstraintItem extends EdgeConstraint {
|
|
216
|
+
id: string;
|
|
217
|
+
}
|
|
218
|
+
export declare enum PagSymbol {
|
|
219
|
+
ARROW = "ARROW",
|
|
220
|
+
CIRCLE = "CIRCLE",
|
|
221
|
+
EMPTY = "EMPTY"
|
|
222
|
+
}
|
|
223
|
+
export declare const headSymbolMap: Record<string, PagSymbol>;
|
|
224
|
+
export declare const tailSymbolMap: Record<string, PagSymbol>;
|
|
225
|
+
/**
|
|
226
|
+
* Parse a PAG symbol (i.e. 'ARROW') into its string representation ('>')
|
|
227
|
+
*/
|
|
228
|
+
export declare function symbolToString(symbol: PagSymbol, position: 'head' | 'tail'): string;
|
|
229
|
+
/**
|
|
230
|
+
* Parse a PAG string ('>') into its symbol ('ARROW')
|
|
231
|
+
*/
|
|
232
|
+
export declare function stringToSymbol(string: string, position: 'head' | 'tail'): PagSymbol;
|
|
233
|
+
/**
|
|
234
|
+
* Defines minimum scale at which a given element should be rendered
|
|
235
|
+
* Should be a number larger than 0 (most likely between 0-1)
|
|
236
|
+
*/
|
|
237
|
+
export interface ZoomThresholds {
|
|
238
|
+
edge: number;
|
|
239
|
+
label: number;
|
|
240
|
+
shadow: number;
|
|
241
|
+
symbol: number;
|
|
242
|
+
}
|
|
243
|
+
export type ZoomState = Record<keyof ZoomThresholds, boolean>;
|
|
244
|
+
export type DirectionType = 'horizontal' | 'vertical';
|
|
245
|
+
export interface TiersConfig {
|
|
246
|
+
/** The path for the property in the node that should be used for defining their layer */
|
|
247
|
+
group: string;
|
|
248
|
+
/** The path for the property in the node that should be used for defining their order within each layer */
|
|
249
|
+
order_nodes_by?: string;
|
|
250
|
+
/** A list of layer names to define the order in which they appear */
|
|
251
|
+
rank?: string[];
|
|
252
|
+
}
|
|
253
|
+
export type GraphTiers = string[][] | TiersConfig;
|
|
254
|
+
/**
|
|
255
|
+
* Defines necessary properties that need to be implemented by graph layouts to support tiered layouts
|
|
256
|
+
*/
|
|
257
|
+
export interface TieredGraphLayoutBuilder {
|
|
258
|
+
orientation?: DirectionType;
|
|
259
|
+
tiers: GraphTiers;
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Defines necessary properties that need to be implemented by graph layouts to support grouping/cluster layouts
|
|
263
|
+
*/
|
|
264
|
+
export interface GroupingLayoutBuilder {
|
|
265
|
+
/** The path for the property in the node that should be used for defining their layer */
|
|
266
|
+
group: string;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Defines necessary properties for a group node to be drawn on the graph
|
|
270
|
+
*/
|
|
271
|
+
export interface GroupNode {
|
|
272
|
+
id: string;
|
|
273
|
+
originalMeta: CausalGraphNodeMeta;
|
|
274
|
+
variable_type: 'groupNode';
|
|
275
|
+
}
|
|
276
|
+
export {};
|
|
277
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEvE;;GAEG;AACH,oBAAY,UAAU;IAClB;;OAEG;IACH,OAAO,YAAY;IACnB;;OAEG;IACH,YAAY,iBAAiB;IAC7B;;OAEG;IACH,UAAU,QAAQ;IAClB;;;;OAIG;IACH,QAAQ,aAAa;CACxB;AAED;;GAEG;AACH,KAAK,iBAAiB,CAAC,CAAC,IAAI;KACvB,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,MAAM,GAAG,6BAA6B,CAAC,EAAE,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;CACtF,CAAC;AAEF,MAAM,WAAW,iBAAiB;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,mBAAmB,CAAC,EAAE,MAAM,C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W;IACxB,yFAAyF;IACzF,KAAK,EAAE,MAAM,CAAC;IACd,2GAA2G;IAC3G,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qEAAqE;IACrE,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,MAAM,UAAU,GAAG,MAAM,EAAE,EAAE,GAAG,WAAW,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACrC,WAAW,CAAC,EAAE,aAAa,CAAC;IAC5B,KAAK,EAAE,UAAU,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IAClC,yFAAyF;IACzF,KAAK,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,mBAAmB,CAAC;IAClC,aAAa,EAAE,WAAW,CAAC;CAC9B"}
|
package/package.json
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@darajs/ui-causal-graph-editor",
|
|
3
|
+
"version": "0.4.8",
|
|
4
|
+
"description": "CausalGraph editor for the Dara UI framework",
|
|
5
|
+
"main": "dist/index.umd.cjs",
|
|
6
|
+
"module": "dist/index.js",
|
|
7
|
+
"types": "dist/types/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"require": "./dist/index.umd.cjs",
|
|
12
|
+
"types": "./dist/types/index.d.ts"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"type": "module",
|
|
16
|
+
"jsnext:main": "dist/index.js",
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "rimraf dist && vite build && tsc && tsc-alias",
|
|
19
|
+
"lint": "tsc && eslint src --ext .ts,.tsx --max-warnings 0 && stylelint './src/**/*.{ts,tsx}'",
|
|
20
|
+
"format": "prettier src --write",
|
|
21
|
+
"format:check": "prettier src --check",
|
|
22
|
+
"lint:fix": "tsc && eslint src --ext .ts,.tsx --max-warnings 0 --fix && stylelint './src/**/*.{ts,tsx}' --fix",
|
|
23
|
+
"test-watch": "jest --watch",
|
|
24
|
+
"test": "jest",
|
|
25
|
+
"storybook": "start-storybook -p 6006",
|
|
26
|
+
"build-storybook": "build-storybook"
|
|
27
|
+
},
|
|
28
|
+
"author": "Krzysztof Bielikowicz <krzysztof@causalens.com>",
|
|
29
|
+
"license": "Apache-2.0",
|
|
30
|
+
"prettier": "@darajs/prettier-config",
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@babel/core": "^7.15.8",
|
|
33
|
+
"@babel/preset-env": "^7.15.8",
|
|
34
|
+
"@babel/preset-react": "^7.14.5",
|
|
35
|
+
"@babel/preset-typescript": "^7.15.0",
|
|
36
|
+
"@darajs/eslint-config": "0.4.8",
|
|
37
|
+
"@darajs/prettier-config": "0.4.8",
|
|
38
|
+
"@darajs/stylelint-config": "0.4.8",
|
|
39
|
+
"@storybook/addon-a11y": "^6.5.16",
|
|
40
|
+
"@storybook/addon-actions": "^6.5.16",
|
|
41
|
+
"@storybook/addon-essentials": "^6.5.16",
|
|
42
|
+
"@storybook/addon-links": "^6.5.16",
|
|
43
|
+
"@storybook/addon-styling": "^0.3.2",
|
|
44
|
+
"@storybook/builder-webpack5": "^6.5.16",
|
|
45
|
+
"@storybook/manager-webpack5": "^6.5.16",
|
|
46
|
+
"@storybook/react": "^6.5.16",
|
|
47
|
+
"@storybook/theming": "^6.5.16",
|
|
48
|
+
"@testing-library/dom": "^9.3.0",
|
|
49
|
+
"@testing-library/jest-dom": "^5.16.5",
|
|
50
|
+
"@testing-library/react": "^14.0.0",
|
|
51
|
+
"@types/cytoscape": "^3.19.9",
|
|
52
|
+
"@types/cytoscape-fcose": "^2.2.0",
|
|
53
|
+
"@types/d3": "^6.2.0",
|
|
54
|
+
"@types/fontfaceobserver": "^2.1.0",
|
|
55
|
+
"@types/jest": "^25.2.3",
|
|
56
|
+
"@types/lodash": "^4.14.155",
|
|
57
|
+
"@types/react": "^18.0",
|
|
58
|
+
"@types/styled-components": "^5.1.26",
|
|
59
|
+
"@types/svg-path-parser": "^1.1.3",
|
|
60
|
+
"@vitejs/plugin-react": "^3.1.0",
|
|
61
|
+
"babel-jest": "^29.5.0",
|
|
62
|
+
"babel-loader": "^8.2.2",
|
|
63
|
+
"eslint": "^7.32.0",
|
|
64
|
+
"graphology-generators": "^0.11.2",
|
|
65
|
+
"jest": "^29.5.0",
|
|
66
|
+
"jest-css-modules": "^2.1.0",
|
|
67
|
+
"prettier": "^3.0.0",
|
|
68
|
+
"react-docgen-typescript-plugin": "^1.0.5",
|
|
69
|
+
"react-test-renderer": "^17.0",
|
|
70
|
+
"rimraf": "^3.0.2",
|
|
71
|
+
"storybook-dark-mode": "^2.1.1",
|
|
72
|
+
"stylelint": "^15.0.0",
|
|
73
|
+
"ts-jest": "^29.1.0",
|
|
74
|
+
"tsc-alias": "^1.8.5",
|
|
75
|
+
"typescript": "^5.0.4"
|
|
76
|
+
},
|
|
77
|
+
"dependencies": {
|
|
78
|
+
"@darajs/styled-components": "0.4.8",
|
|
79
|
+
"@darajs/ui-components": "0.4.8",
|
|
80
|
+
"@darajs/ui-icons": "0.4.8",
|
|
81
|
+
"@darajs/ui-notifications": "0.4.8",
|
|
82
|
+
"@darajs/ui-utils": "0.4.8",
|
|
83
|
+
"@darajs/ui-widgets": "0.4.8",
|
|
84
|
+
"comlink": "^4.4.1",
|
|
85
|
+
"cytoscape": "^3.23.0",
|
|
86
|
+
"cytoscape-fcose": "^2.2.0",
|
|
87
|
+
"d3": "6.2.0",
|
|
88
|
+
"d3-dag": "^1.1.0",
|
|
89
|
+
"d3-scale": "3.2.1",
|
|
90
|
+
"fontfaceobserver": "^2.3.0",
|
|
91
|
+
"graphology": "^0.25.1",
|
|
92
|
+
"graphology-dag": "^0.2.0",
|
|
93
|
+
"graphology-layout": "^0.6.1",
|
|
94
|
+
"graphology-layout-forceatlas2": "^0.10.1",
|
|
95
|
+
"graphology-layout-noverlap": "^0.4.2",
|
|
96
|
+
"graphology-types": "^0.24.7",
|
|
97
|
+
"immer": "^10.0.4",
|
|
98
|
+
"lodash": "4.17.21",
|
|
99
|
+
"nanoid": "^3.3.0",
|
|
100
|
+
"pixi-filters": "^6.0.4",
|
|
101
|
+
"pixi-viewport": "5.0.3",
|
|
102
|
+
"pixi.js": "^8.0.0",
|
|
103
|
+
"polished": "^4.1.1",
|
|
104
|
+
"react": "^18.0",
|
|
105
|
+
"react-dnd": "^14.0.5",
|
|
106
|
+
"react-dnd-html5-backend": "^14.1.0",
|
|
107
|
+
"svg-path-parser": "^1.1.0",
|
|
108
|
+
"tippy.js": "6.2.6",
|
|
109
|
+
"use-immer": "^0.9.0",
|
|
110
|
+
"vis-data": "^7.1.2",
|
|
111
|
+
"vis-network": "^9.1.0"
|
|
112
|
+
},
|
|
113
|
+
"files": [
|
|
114
|
+
"dist"
|
|
115
|
+
],
|
|
116
|
+
"publishConfig": {
|
|
117
|
+
"access": "public"
|
|
118
|
+
},
|
|
119
|
+
"gitHead": "28ec9380d883a6f5f0fcd05f27beda7e412fa95f"
|
|
120
|
+
}
|