@darajs/ui-causal-graph-editor 1.0.0-a.1
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/dist/graph-viewer/causal-graph-editor.d.ts +44 -0
- package/dist/graph-viewer/causal-graph-editor.d.ts.map +1 -0
- package/dist/graph-viewer/causal-graph-editor.js +357 -0
- package/dist/graph-viewer/causal-graph-editor.js.map +1 -0
- package/dist/graph-viewer/utils/use-iterate-edges.d.ts +32 -0
- package/dist/graph-viewer/utils/use-iterate-edges.d.ts.map +1 -0
- package/dist/graph-viewer/utils/use-iterate-edges.js +34 -0
- package/dist/graph-viewer/utils/use-iterate-edges.js.map +1 -0
- package/dist/graph-viewer/utils/use-iterate-nodes.d.ts +32 -0
- package/dist/graph-viewer/utils/use-iterate-nodes.d.ts.map +1 -0
- package/dist/graph-viewer/utils/use-iterate-nodes.js +30 -0
- package/dist/graph-viewer/utils/use-iterate-nodes.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/dist/jest-setup.d.ts +18 -0
- package/dist/jest-setup.d.ts.map +1 -0
- package/dist/jest-setup.js +18 -0
- package/dist/jest-setup.js.map +1 -0
- package/dist/node-hierarchy-builder/index.d.ts +19 -0
- package/dist/node-hierarchy-builder/index.d.ts.map +1 -0
- package/dist/node-hierarchy-builder/index.js +18 -0
- package/dist/node-hierarchy-builder/index.js.map +1 -0
- package/dist/node-hierarchy-builder/layer-divider.d.ts +15 -0
- package/dist/node-hierarchy-builder/layer-divider.d.ts.map +1 -0
- package/dist/node-hierarchy-builder/layer-divider.js +122 -0
- package/dist/node-hierarchy-builder/layer-divider.js.map +1 -0
- package/dist/node-hierarchy-builder/layer-label-editor.d.ts +24 -0
- package/dist/node-hierarchy-builder/layer-label-editor.d.ts.map +1 -0
- package/dist/node-hierarchy-builder/layer-label-editor.js +93 -0
- package/dist/node-hierarchy-builder/layer-label-editor.js.map +1 -0
- package/dist/node-hierarchy-builder/layer.d.ts +35 -0
- package/dist/node-hierarchy-builder/layer.d.ts.map +1 -0
- package/dist/node-hierarchy-builder/layer.js +114 -0
- package/dist/node-hierarchy-builder/layer.js.map +1 -0
- package/dist/node-hierarchy-builder/node-hierarchy-builder.d.ts +27 -0
- package/dist/node-hierarchy-builder/node-hierarchy-builder.d.ts.map +1 -0
- package/dist/node-hierarchy-builder/node-hierarchy-builder.js +190 -0
- package/dist/node-hierarchy-builder/node-hierarchy-builder.js.map +1 -0
- package/dist/node-hierarchy-builder/node.d.ts +21 -0
- package/dist/node-hierarchy-builder/node.d.ts.map +1 -0
- package/dist/node-hierarchy-builder/node.js +90 -0
- package/dist/node-hierarchy-builder/node.js.map +1 -0
- package/dist/node-hierarchy-builder/shared.d.ts +93 -0
- package/dist/node-hierarchy-builder/shared.d.ts.map +1 -0
- package/dist/node-hierarchy-builder/shared.js +88 -0
- package/dist/node-hierarchy-builder/shared.js.map +1 -0
- package/dist/shared/causal-graph-store.d.ts +107 -0
- package/dist/shared/causal-graph-store.d.ts.map +1 -0
- package/dist/shared/causal-graph-store.js +142 -0
- package/dist/shared/causal-graph-store.js.map +1 -0
- package/dist/shared/editor-overlay/buttons/add-node-button.d.ts +7 -0
- package/dist/shared/editor-overlay/buttons/add-node-button.d.ts.map +1 -0
- package/dist/shared/editor-overlay/buttons/add-node-button.js +31 -0
- package/dist/shared/editor-overlay/buttons/add-node-button.js.map +1 -0
- package/dist/shared/editor-overlay/buttons/center-graph-button.d.ts +7 -0
- package/dist/shared/editor-overlay/buttons/center-graph-button.d.ts.map +1 -0
- package/dist/shared/editor-overlay/buttons/center-graph-button.js +32 -0
- package/dist/shared/editor-overlay/buttons/center-graph-button.js.map +1 -0
- package/dist/shared/editor-overlay/buttons/drag-mode-button.d.ts +27 -0
- package/dist/shared/editor-overlay/buttons/drag-mode-button.d.ts.map +1 -0
- package/dist/shared/editor-overlay/buttons/drag-mode-button.js +35 -0
- package/dist/shared/editor-overlay/buttons/drag-mode-button.js.map +1 -0
- package/dist/shared/editor-overlay/buttons/index.d.ts +21 -0
- package/dist/shared/editor-overlay/buttons/index.d.ts.map +1 -0
- package/dist/shared/editor-overlay/buttons/index.js +21 -0
- package/dist/shared/editor-overlay/buttons/index.js.map +1 -0
- package/dist/shared/editor-overlay/buttons/recalculate-layout-button.d.ts +7 -0
- package/dist/shared/editor-overlay/buttons/recalculate-layout-button.d.ts.map +1 -0
- package/dist/shared/editor-overlay/buttons/recalculate-layout-button.js +28 -0
- package/dist/shared/editor-overlay/buttons/recalculate-layout-button.js.map +1 -0
- package/dist/shared/editor-overlay/floating-elements.d.ts +29 -0
- package/dist/shared/editor-overlay/floating-elements.d.ts.map +1 -0
- package/dist/shared/editor-overlay/floating-elements.js +17 -0
- package/dist/shared/editor-overlay/floating-elements.js.map +1 -0
- package/dist/shared/editor-overlay/index.d.ts +22 -0
- package/dist/shared/editor-overlay/index.d.ts.map +1 -0
- package/dist/shared/editor-overlay/index.js +22 -0
- package/dist/shared/editor-overlay/index.js.map +1 -0
- package/dist/shared/editor-overlay/legend/index.d.ts +19 -0
- package/dist/shared/editor-overlay/legend/index.d.ts.map +1 -0
- package/dist/shared/editor-overlay/legend/index.js +19 -0
- package/dist/shared/editor-overlay/legend/index.js.map +1 -0
- package/dist/shared/editor-overlay/legend/legend-data.d.ts +34 -0
- package/dist/shared/editor-overlay/legend/legend-data.d.ts.map +1 -0
- package/dist/shared/editor-overlay/legend/legend-data.js +41 -0
- package/dist/shared/editor-overlay/legend/legend-data.js.map +1 -0
- package/dist/shared/editor-overlay/legend/legend-list.d.ts +6 -0
- package/dist/shared/editor-overlay/legend/legend-list.d.ts.map +1 -0
- package/dist/shared/editor-overlay/legend/legend-list.js +96 -0
- package/dist/shared/editor-overlay/legend/legend-list.js.map +1 -0
- package/dist/shared/editor-overlay/legend/legend.d.ts +7 -0
- package/dist/shared/editor-overlay/legend/legend.d.ts.map +1 -0
- package/dist/shared/editor-overlay/legend/legend.js +80 -0
- package/dist/shared/editor-overlay/legend/legend.js.map +1 -0
- package/dist/shared/editor-overlay/overlay.d.ts +35 -0
- package/dist/shared/editor-overlay/overlay.d.ts.map +1 -0
- package/dist/shared/editor-overlay/overlay.js +41 -0
- package/dist/shared/editor-overlay/overlay.js.map +1 -0
- package/dist/shared/editor-overlay/panel-content/edge/edge-editor.d.ts +8 -0
- package/dist/shared/editor-overlay/panel-content/edge/edge-editor.d.ts.map +1 -0
- package/dist/shared/editor-overlay/panel-content/edge/edge-editor.js +40 -0
- package/dist/shared/editor-overlay/panel-content/edge/edge-editor.js.map +1 -0
- package/dist/shared/editor-overlay/panel-content/edge/edge-info-content.d.ts +22 -0
- package/dist/shared/editor-overlay/panel-content/edge/edge-info-content.d.ts.map +1 -0
- package/dist/shared/editor-overlay/panel-content/edge/edge-info-content.js +36 -0
- package/dist/shared/editor-overlay/panel-content/edge/edge-info-content.js.map +1 -0
- package/dist/shared/editor-overlay/panel-content/edge/editor-props.d.ts +35 -0
- package/dist/shared/editor-overlay/panel-content/edge/editor-props.d.ts.map +1 -0
- package/dist/shared/editor-overlay/panel-content/edge/editor-props.js +2 -0
- package/dist/shared/editor-overlay/panel-content/edge/editor-props.js.map +1 -0
- package/dist/shared/editor-overlay/panel-content/edge/encoder-editor.d.ts +23 -0
- package/dist/shared/editor-overlay/panel-content/edge/encoder-editor.d.ts.map +1 -0
- package/dist/shared/editor-overlay/panel-content/edge/encoder-editor.js +10 -0
- package/dist/shared/editor-overlay/panel-content/edge/encoder-editor.js.map +1 -0
- package/dist/shared/editor-overlay/panel-content/edge/index.d.ts +18 -0
- package/dist/shared/editor-overlay/panel-content/edge/index.d.ts.map +1 -0
- package/dist/shared/editor-overlay/panel-content/edge/index.js +18 -0
- package/dist/shared/editor-overlay/panel-content/edge/index.js.map +1 -0
- package/dist/shared/editor-overlay/panel-content/edge/pag-editor.d.ts +23 -0
- package/dist/shared/editor-overlay/panel-content/edge/pag-editor.d.ts.map +1 -0
- package/dist/shared/editor-overlay/panel-content/edge/pag-editor.js +10 -0
- package/dist/shared/editor-overlay/panel-content/edge/pag-editor.js.map +1 -0
- package/dist/shared/editor-overlay/panel-content/edge/resolver-editor.d.ts +7 -0
- package/dist/shared/editor-overlay/panel-content/edge/resolver-editor.d.ts.map +1 -0
- package/dist/shared/editor-overlay/panel-content/edge/resolver-editor.js +31 -0
- package/dist/shared/editor-overlay/panel-content/edge/resolver-editor.js.map +1 -0
- package/dist/shared/editor-overlay/panel-content/edge/sections/constraint-editor.d.ts +27 -0
- package/dist/shared/editor-overlay/panel-content/edge/sections/constraint-editor.d.ts.map +1 -0
- package/dist/shared/editor-overlay/panel-content/edge/sections/constraint-editor.js +53 -0
- package/dist/shared/editor-overlay/panel-content/edge/sections/constraint-editor.js.map +1 -0
- package/dist/shared/editor-overlay/panel-content/edge/sections/description-editor.d.ts +15 -0
- package/dist/shared/editor-overlay/panel-content/edge/sections/description-editor.d.ts.map +1 -0
- package/dist/shared/editor-overlay/panel-content/edge/sections/description-editor.js +60 -0
- package/dist/shared/editor-overlay/panel-content/edge/sections/description-editor.js.map +1 -0
- package/dist/shared/editor-overlay/panel-content/edge/sections/direction-editor.d.ts +21 -0
- package/dist/shared/editor-overlay/panel-content/edge/sections/direction-editor.d.ts.map +1 -0
- package/dist/shared/editor-overlay/panel-content/edge/sections/direction-editor.js +90 -0
- package/dist/shared/editor-overlay/panel-content/edge/sections/direction-editor.js.map +1 -0
- package/dist/shared/editor-overlay/panel-content/edge/sections/edge-type-editor.d.ts +17 -0
- package/dist/shared/editor-overlay/panel-content/edge/sections/edge-type-editor.d.ts.map +1 -0
- package/dist/shared/editor-overlay/panel-content/edge/sections/edge-type-editor.js +61 -0
- package/dist/shared/editor-overlay/panel-content/edge/sections/edge-type-editor.js.map +1 -0
- package/dist/shared/editor-overlay/panel-content/edge/sections/index.d.ts +19 -0
- package/dist/shared/editor-overlay/panel-content/edge/sections/index.d.ts.map +1 -0
- package/dist/shared/editor-overlay/panel-content/edge/sections/index.js +19 -0
- package/dist/shared/editor-overlay/panel-content/edge/sections/index.js.map +1 -0
- package/dist/shared/editor-overlay/panel-content/index.d.ts +20 -0
- package/dist/shared/editor-overlay/panel-content/index.d.ts.map +1 -0
- package/dist/shared/editor-overlay/panel-content/index.js +20 -0
- package/dist/shared/editor-overlay/panel-content/index.js.map +1 -0
- package/dist/shared/editor-overlay/panel-content/node/index.d.ts +18 -0
- package/dist/shared/editor-overlay/panel-content/node/index.d.ts.map +1 -0
- package/dist/shared/editor-overlay/panel-content/node/index.js +18 -0
- package/dist/shared/editor-overlay/panel-content/node/index.js.map +1 -0
- package/dist/shared/editor-overlay/panel-content/node/label-editor.d.ts +11 -0
- package/dist/shared/editor-overlay/panel-content/node/label-editor.d.ts.map +1 -0
- package/dist/shared/editor-overlay/panel-content/node/label-editor.js +89 -0
- package/dist/shared/editor-overlay/panel-content/node/label-editor.js.map +1 -0
- package/dist/shared/editor-overlay/panel-content/node/node-info-content.d.ts +32 -0
- package/dist/shared/editor-overlay/panel-content/node/node-info-content.d.ts.map +1 -0
- package/dist/shared/editor-overlay/panel-content/node/node-info-content.js +12 -0
- package/dist/shared/editor-overlay/panel-content/node/node-info-content.js.map +1 -0
- package/dist/shared/editor-overlay/panel-content/panel-content.d.ts +17 -0
- package/dist/shared/editor-overlay/panel-content/panel-content.d.ts.map +1 -0
- package/dist/shared/editor-overlay/panel-content/panel-content.js +27 -0
- package/dist/shared/editor-overlay/panel-content/panel-content.js.map +1 -0
- package/dist/shared/editor-overlay/panel-content/panel-title.d.ts +12 -0
- package/dist/shared/editor-overlay/panel-content/panel-title.d.ts.map +1 -0
- package/dist/shared/editor-overlay/panel-content/panel-title.js +48 -0
- package/dist/shared/editor-overlay/panel-content/panel-title.js.map +1 -0
- package/dist/shared/editor-overlay/panel-content/styled.d.ts +9 -0
- package/dist/shared/editor-overlay/panel-content/styled.d.ts.map +1 -0
- package/dist/shared/editor-overlay/panel-content/styled.js +43 -0
- package/dist/shared/editor-overlay/panel-content/styled.js.map +1 -0
- package/dist/shared/editor-overlay/positional-divs.d.ts +14 -0
- package/dist/shared/editor-overlay/positional-divs.d.ts.map +1 -0
- package/dist/shared/editor-overlay/positional-divs.js +117 -0
- package/dist/shared/editor-overlay/positional-divs.js.map +1 -0
- package/dist/shared/editor-overlay/search-bar/index.d.ts +19 -0
- package/dist/shared/editor-overlay/search-bar/index.d.ts.map +1 -0
- package/dist/shared/editor-overlay/search-bar/index.js +19 -0
- package/dist/shared/editor-overlay/search-bar/index.js.map +1 -0
- package/dist/shared/editor-overlay/search-bar/search-bar.d.ts +21 -0
- package/dist/shared/editor-overlay/search-bar/search-bar.d.ts.map +1 -0
- package/dist/shared/editor-overlay/search-bar/search-bar.js +160 -0
- package/dist/shared/editor-overlay/search-bar/search-bar.js.map +1 -0
- package/dist/shared/editor-overlay/search-bar/use-search.d.ts +32 -0
- package/dist/shared/editor-overlay/search-bar/use-search.d.ts.map +1 -0
- package/dist/shared/editor-overlay/search-bar/use-search.js +75 -0
- package/dist/shared/editor-overlay/search-bar/use-search.js.map +1 -0
- package/dist/shared/graph-layout/circular-layout.d.ts +18 -0
- package/dist/shared/graph-layout/circular-layout.d.ts.map +1 -0
- package/dist/shared/graph-layout/circular-layout.js +38 -0
- package/dist/shared/graph-layout/circular-layout.js.map +1 -0
- package/dist/shared/graph-layout/common.d.ts +64 -0
- package/dist/shared/graph-layout/common.d.ts.map +1 -0
- package/dist/shared/graph-layout/common.js +42 -0
- package/dist/shared/graph-layout/common.js.map +1 -0
- package/dist/shared/graph-layout/custom-layout.d.ts +35 -0
- package/dist/shared/graph-layout/custom-layout.d.ts.map +1 -0
- package/dist/shared/graph-layout/custom-layout.js +29 -0
- package/dist/shared/graph-layout/custom-layout.js.map +1 -0
- package/dist/shared/graph-layout/fcose-layout.d.ts +88 -0
- package/dist/shared/graph-layout/fcose-layout.d.ts.map +1 -0
- package/dist/shared/graph-layout/fcose-layout.js +196 -0
- package/dist/shared/graph-layout/fcose-layout.js.map +1 -0
- package/dist/shared/graph-layout/force-atlas-layout.d.ts +79 -0
- package/dist/shared/graph-layout/force-atlas-layout.d.ts.map +1 -0
- package/dist/shared/graph-layout/force-atlas-layout.js +163 -0
- package/dist/shared/graph-layout/force-atlas-layout.js.map +1 -0
- package/dist/shared/graph-layout/index.d.ts +25 -0
- package/dist/shared/graph-layout/index.d.ts.map +1 -0
- package/dist/shared/graph-layout/index.js +25 -0
- package/dist/shared/graph-layout/index.js.map +1 -0
- package/dist/shared/graph-layout/marketing-layout.d.ts +30 -0
- package/dist/shared/graph-layout/marketing-layout.d.ts.map +1 -0
- package/dist/shared/graph-layout/marketing-layout.js +105 -0
- package/dist/shared/graph-layout/marketing-layout.js.map +1 -0
- package/dist/shared/graph-layout/planar-layout.d.ts +32 -0
- package/dist/shared/graph-layout/planar-layout.d.ts.map +1 -0
- package/dist/shared/graph-layout/planar-layout.js +95 -0
- package/dist/shared/graph-layout/planar-layout.js.map +1 -0
- package/dist/shared/graph-layout/spring-layout.d.ts +56 -0
- package/dist/shared/graph-layout/spring-layout.d.ts.map +1 -0
- package/dist/shared/graph-layout/spring-layout.js +148 -0
- package/dist/shared/graph-layout/spring-layout.js.map +1 -0
- package/dist/shared/parsers.d.ts +63 -0
- package/dist/shared/parsers.d.ts.map +1 -0
- package/dist/shared/parsers.js +176 -0
- package/dist/shared/parsers.js.map +1 -0
- package/dist/shared/pointer-context.d.ts +21 -0
- package/dist/shared/pointer-context.d.ts.map +1 -0
- package/dist/shared/pointer-context.js +23 -0
- package/dist/shared/pointer-context.js.map +1 -0
- package/dist/shared/rendering/background.d.ts +32 -0
- package/dist/shared/rendering/background.d.ts.map +1 -0
- package/dist/shared/rendering/background.js +91 -0
- package/dist/shared/rendering/background.js.map +1 -0
- package/dist/shared/rendering/colors.d.ts +27 -0
- package/dist/shared/rendering/colors.d.ts.map +1 -0
- package/dist/shared/rendering/colors.js +14 -0
- package/dist/shared/rendering/colors.js.map +1 -0
- package/dist/shared/rendering/edge/curve.d.ts +51 -0
- package/dist/shared/rendering/edge/curve.d.ts.map +1 -0
- package/dist/shared/rendering/edge/curve.js +122 -0
- package/dist/shared/rendering/edge/curve.js.map +1 -0
- package/dist/shared/rendering/edge/definitions.d.ts +71 -0
- package/dist/shared/rendering/edge/definitions.d.ts.map +1 -0
- package/dist/shared/rendering/edge/definitions.js +31 -0
- package/dist/shared/rendering/edge/definitions.js.map +1 -0
- package/dist/shared/rendering/edge/edge-object.d.ts +93 -0
- package/dist/shared/rendering/edge/edge-object.d.ts.map +1 -0
- package/dist/shared/rendering/edge/edge-object.js +483 -0
- package/dist/shared/rendering/edge/edge-object.js.map +1 -0
- package/dist/shared/rendering/edge/index.d.ts +19 -0
- package/dist/shared/rendering/edge/index.d.ts.map +1 -0
- package/dist/shared/rendering/edge/index.js +19 -0
- package/dist/shared/rendering/edge/index.js.map +1 -0
- package/dist/shared/rendering/edge/symbols.d.ts +40 -0
- package/dist/shared/rendering/edge/symbols.d.ts.map +1 -0
- package/dist/shared/rendering/edge/symbols.js +150 -0
- package/dist/shared/rendering/edge/symbols.js.map +1 -0
- package/dist/shared/rendering/engine.d.ts +342 -0
- package/dist/shared/rendering/engine.d.ts.map +1 -0
- package/dist/shared/rendering/engine.js +990 -0
- package/dist/shared/rendering/engine.js.map +1 -0
- package/dist/shared/rendering/node/definitions.d.ts +57 -0
- package/dist/shared/rendering/node/definitions.d.ts.map +1 -0
- package/dist/shared/rendering/node/definitions.js +2 -0
- package/dist/shared/rendering/node/definitions.js.map +1 -0
- package/dist/shared/rendering/node/index.d.ts +20 -0
- package/dist/shared/rendering/node/index.d.ts.map +1 -0
- package/dist/shared/rendering/node/index.js +19 -0
- package/dist/shared/rendering/node/index.js.map +1 -0
- package/dist/shared/rendering/node/node-object.d.ts +77 -0
- package/dist/shared/rendering/node/node-object.d.ts.map +1 -0
- package/dist/shared/rendering/node/node-object.js +241 -0
- package/dist/shared/rendering/node/node-object.js.map +1 -0
- package/dist/shared/rendering/node/utils.d.ts +33 -0
- package/dist/shared/rendering/node/utils.d.ts.map +1 -0
- package/dist/shared/rendering/node/utils.js +27 -0
- package/dist/shared/rendering/node/utils.js.map +1 -0
- package/dist/shared/rendering/svg.d.ts +26 -0
- package/dist/shared/rendering/svg.d.ts.map +1 -0
- package/dist/shared/rendering/svg.js +44 -0
- package/dist/shared/rendering/svg.js.map +1 -0
- package/dist/shared/rendering/text.d.ts +33 -0
- package/dist/shared/rendering/text.d.ts.map +1 -0
- package/dist/shared/rendering/text.js +107 -0
- package/dist/shared/rendering/text.js.map +1 -0
- package/dist/shared/rendering/texture-cache.d.ts +32 -0
- package/dist/shared/rendering/texture-cache.d.ts.map +1 -0
- package/dist/shared/rendering/texture-cache.js +76 -0
- package/dist/shared/rendering/texture-cache.js.map +1 -0
- package/dist/shared/rendering/use-render-engine.d.ts +86 -0
- package/dist/shared/rendering/use-render-engine.d.ts.map +1 -0
- package/dist/shared/rendering/use-render-engine.js +89 -0
- package/dist/shared/rendering/use-render-engine.js.map +1 -0
- package/dist/shared/rendering/utils.d.ts +24 -0
- package/dist/shared/rendering/utils.d.ts.map +1 -0
- package/dist/shared/rendering/utils.js +60 -0
- package/dist/shared/rendering/utils.js.map +1 -0
- package/dist/shared/serializer.d.ts +39 -0
- package/dist/shared/serializer.d.ts.map +1 -0
- package/dist/shared/serializer.js +131 -0
- package/dist/shared/serializer.js.map +1 -0
- package/dist/shared/settings-context.d.ts +56 -0
- package/dist/shared/settings-context.d.ts.map +1 -0
- package/dist/shared/settings-context.js +36 -0
- package/dist/shared/settings-context.js.map +1 -0
- package/dist/shared/styles.d.ts +4 -0
- package/dist/shared/styles.d.ts.map +1 -0
- package/dist/shared/styles.js +52 -0
- package/dist/shared/styles.js.map +1 -0
- package/dist/shared/use-causal-graph-editor.d.ts +19 -0
- package/dist/shared/use-causal-graph-editor.d.ts.map +1 -0
- package/dist/shared/use-causal-graph-editor.js +58 -0
- package/dist/shared/use-causal-graph-editor.js.map +1 -0
- package/dist/shared/use-drag-mode.d.ts +33 -0
- package/dist/shared/use-drag-mode.d.ts.map +1 -0
- package/dist/shared/use-drag-mode.js +75 -0
- package/dist/shared/use-drag-mode.js.map +1 -0
- package/dist/shared/use-edge-encoder.d.ts +45 -0
- package/dist/shared/use-edge-encoder.d.ts.map +1 -0
- package/dist/shared/use-edge-encoder.js +121 -0
- package/dist/shared/use-edge-encoder.js.map +1 -0
- package/dist/shared/utils.d.ts +52 -0
- package/dist/shared/utils.d.ts.map +1 -0
- package/dist/shared/utils.js +99 -0
- package/dist/shared/utils.js.map +1 -0
- package/dist/types.d.ts +213 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +98 -0
- package/dist/types.js.map +1 -0
- package/package.json +123 -0
|
@@ -0,0 +1,150 @@
|
|
|
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 { SmoothGraphics } from '@pixi/graphics-smooth';
|
|
18
|
+
import * as PIXI from 'pixi.js';
|
|
19
|
+
import { EdgeConstraintType, EdgeType, EditorMode } from '../../../types';
|
|
20
|
+
import { QUESTION_MARK, drawPath } from '../svg';
|
|
21
|
+
/**
|
|
22
|
+
* Create a graphics object for a side (top or bottom) edge symbol
|
|
23
|
+
*
|
|
24
|
+
* @param style edge style
|
|
25
|
+
* @param position position of the object on the edge
|
|
26
|
+
* @param tint tint of the symbol
|
|
27
|
+
* @param bgTint tint of the background behind the symbol, e.g. to make it not transparent
|
|
28
|
+
*/
|
|
29
|
+
export function createSideSymbol(style, position, tint, bgTint) {
|
|
30
|
+
var _a;
|
|
31
|
+
const gfx = new SmoothGraphics();
|
|
32
|
+
const color = tint;
|
|
33
|
+
// normal arrow in normal/resolver mode
|
|
34
|
+
if ([EditorMode.RESOLVER, EditorMode.DEFAULT, EditorMode.EDGE_ENCODER].includes(style.editorMode)) {
|
|
35
|
+
// Bottom arrows don't exist here
|
|
36
|
+
if (position === 'bottom') {
|
|
37
|
+
return gfx;
|
|
38
|
+
}
|
|
39
|
+
if (EditorMode.RESOLVER === style.editorMode) {
|
|
40
|
+
// Resolver - only show arrow for directed edge
|
|
41
|
+
if (style.type !== EdgeType.DIRECTED_EDGE) {
|
|
42
|
+
return gfx;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (style.editorMode === EditorMode.EDGE_ENCODER) {
|
|
46
|
+
// Encoder - only show arrow for directed constraint
|
|
47
|
+
if (((_a = style.constraint) === null || _a === void 0 ? void 0 : _a.type) !== EdgeConstraintType.DIRECTED) {
|
|
48
|
+
return gfx;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
gfx.lineStyle({ cap: PIXI.LINE_CAP.ROUND, color, width: 2 });
|
|
52
|
+
gfx.moveTo(0, 8);
|
|
53
|
+
gfx.lineTo(-8, 0);
|
|
54
|
+
gfx.moveTo(0, 8);
|
|
55
|
+
gfx.lineTo(8, 0);
|
|
56
|
+
}
|
|
57
|
+
// Multiplier for Y values - flip bottom position graphics
|
|
58
|
+
const my = position === 'top' ? 1 : -1;
|
|
59
|
+
// Pag-style arrow
|
|
60
|
+
if (style.editorMode === EditorMode.PAG_VIEWER) {
|
|
61
|
+
const symbol = style.type[position === 'top' ? 1 : 0];
|
|
62
|
+
// Fill for arrows
|
|
63
|
+
if (['<', '>'].includes(symbol)) {
|
|
64
|
+
gfx.beginFill(color, 1, true);
|
|
65
|
+
gfx.drawPolygon([0, my * 10, -8, 0, 8, 0]);
|
|
66
|
+
gfx.endFill();
|
|
67
|
+
}
|
|
68
|
+
else if (symbol === 'o') {
|
|
69
|
+
gfx.beginFill(bgTint, 1);
|
|
70
|
+
gfx.drawCircle(0, 0, 6);
|
|
71
|
+
gfx.endFill();
|
|
72
|
+
// stroke for circles
|
|
73
|
+
gfx.lineStyle({ color, width: 3 });
|
|
74
|
+
gfx.drawCircle(0, 0, 5);
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
// undirected - no symbol
|
|
78
|
+
return gfx;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return gfx;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Create a graphics object for the edge strength symbol
|
|
85
|
+
*
|
|
86
|
+
* @param dots number of dots to include in the symbol
|
|
87
|
+
*/
|
|
88
|
+
export function createStrengthSymbol(dots) {
|
|
89
|
+
const gfx = new SmoothGraphics();
|
|
90
|
+
if (!dots) {
|
|
91
|
+
return gfx;
|
|
92
|
+
}
|
|
93
|
+
gfx.beginFill(0xffffff, 1, true);
|
|
94
|
+
// Draw a circle for each dot
|
|
95
|
+
for (let i = 0; i < dots; i++) {
|
|
96
|
+
gfx.drawCircle(0, -10 * i, 4);
|
|
97
|
+
}
|
|
98
|
+
gfx.endFill();
|
|
99
|
+
return gfx;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Create a graphics object for center edge symbol
|
|
103
|
+
*
|
|
104
|
+
* @param style edge style
|
|
105
|
+
*/
|
|
106
|
+
export function createCenterSymbol(style) {
|
|
107
|
+
const gfx = new SmoothGraphics();
|
|
108
|
+
// In resolver modes, draw a question mark for unresolved direction edges
|
|
109
|
+
if (EditorMode.RESOLVER === style.editorMode) {
|
|
110
|
+
if (style.type !== EdgeType.DIRECTED_EDGE) {
|
|
111
|
+
gfx.lineStyle({
|
|
112
|
+
cap: PIXI.LINE_CAP.ROUND,
|
|
113
|
+
color: 0xffffff,
|
|
114
|
+
width: 1,
|
|
115
|
+
});
|
|
116
|
+
gfx.beginFill(0xffffff, 1, true);
|
|
117
|
+
drawPath(QUESTION_MARK, gfx);
|
|
118
|
+
gfx.endFill();
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
// In edge encoder, show prohibited/undirected in the center
|
|
122
|
+
if (style.editorMode === EditorMode.EDGE_ENCODER && style.constraint) {
|
|
123
|
+
if (style.constraint.type === EdgeConstraintType.FORBIDDEN) {
|
|
124
|
+
gfx.lineStyle({
|
|
125
|
+
cap: PIXI.LINE_CAP.ROUND,
|
|
126
|
+
color: 0xffffff,
|
|
127
|
+
width: 2,
|
|
128
|
+
});
|
|
129
|
+
gfx.moveTo(-6, 6);
|
|
130
|
+
gfx.lineTo(6, -6);
|
|
131
|
+
gfx.moveTo(6, 6);
|
|
132
|
+
gfx.lineTo(-6, -6);
|
|
133
|
+
}
|
|
134
|
+
else if (style.constraint.type === EdgeConstraintType.UNDIRECTED) {
|
|
135
|
+
gfx.lineStyle({
|
|
136
|
+
cap: PIXI.LINE_CAP.ROUND,
|
|
137
|
+
color: 0xffffff,
|
|
138
|
+
width: 2,
|
|
139
|
+
});
|
|
140
|
+
gfx.moveTo(-8, 4);
|
|
141
|
+
gfx.lineTo(0, 12);
|
|
142
|
+
gfx.lineTo(8, 4);
|
|
143
|
+
gfx.moveTo(-8, -4);
|
|
144
|
+
gfx.lineTo(0, -12);
|
|
145
|
+
gfx.lineTo(8, -4);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
return gfx;
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=symbols.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"symbols.js","sourceRoot":"","sources":["../../../../src/shared/rendering/edge/symbols.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,uBA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
+
import { DefaultTheme } from '@darajs/styled-components';
|
|
4
|
+
import { GraphLayout } from '../graph-layout';
|
|
5
|
+
import { DragMode } from '../use-drag-mode';
|
|
6
|
+
import { EdgeConstraint, EditorMode, SimulationGraph, ZoomThresholds } from '../../types';
|
|
7
|
+
export interface EngineEvents {
|
|
8
|
+
backgroundClick: () => void;
|
|
9
|
+
createEdge: (event: PIXI.FederatedMouseEvent, source: string, target: string) => void;
|
|
10
|
+
dragEnd: () => void;
|
|
11
|
+
dragStart: () => void;
|
|
12
|
+
edgeClick: (event: PIXI.FederatedMouseEvent, source: string, target: string) => void;
|
|
13
|
+
edgeMouseout: (event: PIXI.FederatedMouseEvent, edgeKey: string) => void;
|
|
14
|
+
edgeMouseover: (event: PIXI.FederatedMouseEvent, edgeKey: string) => void;
|
|
15
|
+
nodeClick: (event: PIXI.FederatedMouseEvent, nodeKey: string) => void;
|
|
16
|
+
nodeMouseout: (event: PIXI.FederatedMouseEvent, nodeKey: string) => void;
|
|
17
|
+
nodeMouseover: (event: PIXI.FederatedMouseEvent, nodeKey: string) => void;
|
|
18
|
+
}
|
|
19
|
+
export declare const ENGINE_EVENTS: Array<keyof EngineEvents>;
|
|
20
|
+
export declare class Engine extends PIXI.utils.EventEmitter<EngineEvents> {
|
|
21
|
+
/** App instance */
|
|
22
|
+
private app;
|
|
23
|
+
/** Background object */
|
|
24
|
+
private background;
|
|
25
|
+
/** Available edge constraints */
|
|
26
|
+
private constraints;
|
|
27
|
+
/** Parent container where canvas is rendered in */
|
|
28
|
+
private container;
|
|
29
|
+
/** Debounced version of `this.updateLayout` in case multiple changes come in at the same time */
|
|
30
|
+
debouncedUpdateLayout: import("lodash").DebouncedFunc<() => Promise<void>>;
|
|
31
|
+
/** Current drag mode */
|
|
32
|
+
private dragMode;
|
|
33
|
+
/** Container storing edge graphics */
|
|
34
|
+
private edgeLayer;
|
|
35
|
+
/** Edge ID -> EdgeObject cache */
|
|
36
|
+
private edgeMap;
|
|
37
|
+
/** Container storing edge symbol graphics */
|
|
38
|
+
private edgeSymbolsLayer;
|
|
39
|
+
/** Whether the graph is editable */
|
|
40
|
+
private editable;
|
|
41
|
+
/** Current editor mode */
|
|
42
|
+
private editorMode;
|
|
43
|
+
/** Graph state */
|
|
44
|
+
private graph;
|
|
45
|
+
/** Whether engine has been started */
|
|
46
|
+
initialized: boolean;
|
|
47
|
+
/** Whether there is an edge being created */
|
|
48
|
+
private isCreatingEdge;
|
|
49
|
+
/** Whether a node is being moved */
|
|
50
|
+
private isMovingNode;
|
|
51
|
+
/** Graph layout instance */
|
|
52
|
+
private layout?;
|
|
53
|
+
/** Which edge the user is holding down mouse button on */
|
|
54
|
+
private mousedownEdgeKey;
|
|
55
|
+
/** Which node the user is holding down mouse button on */
|
|
56
|
+
private mousedownNodeKey;
|
|
57
|
+
/** Container storing node label graphics */
|
|
58
|
+
private nodeLabelLayer;
|
|
59
|
+
/** Container storing node graphics */
|
|
60
|
+
private nodeLayer;
|
|
61
|
+
/** Node ID -> NodeObject cache */
|
|
62
|
+
private nodeMap;
|
|
63
|
+
/** Center position of the node user pressed mousedown on, stored while user is holding down mouse1 */
|
|
64
|
+
private nodeMousedownCenterPosition;
|
|
65
|
+
/** Last mousedown event position stored while user is holding down mouse1 */
|
|
66
|
+
private nodeMousedownPosition;
|
|
67
|
+
/** Callback executed when a node is added */
|
|
68
|
+
private onAddNode?;
|
|
69
|
+
/** Callback executed when an edge is added */
|
|
70
|
+
private onAddEdge?;
|
|
71
|
+
/** Callback executed when engine is being destroyed */
|
|
72
|
+
private onCleanup?;
|
|
73
|
+
private onGraphAttributesUpdatedBound;
|
|
74
|
+
private onGraphNodeAddedBound;
|
|
75
|
+
private onGraphEdgeAddedBound;
|
|
76
|
+
private onGraphEdgeDroppedBound;
|
|
77
|
+
private onGraphNodeDroppedBound;
|
|
78
|
+
private onGraphEdgeAttributesUpdatedBound;
|
|
79
|
+
private onGraphNodeAttributesUpdatedBound;
|
|
80
|
+
private onDocumentMouseMoveBound;
|
|
81
|
+
private onDocumentMouseUpBound;
|
|
82
|
+
/** Callback executed when a drag motion is done */
|
|
83
|
+
private onEndDrag?;
|
|
84
|
+
/** Callback executed when a node is being moved */
|
|
85
|
+
private onMove?;
|
|
86
|
+
/** Callback executed when a drag motion is started */
|
|
87
|
+
private onStartDrag?;
|
|
88
|
+
/** Last render request ID - used to skip extra render calls */
|
|
89
|
+
private renderRequestId;
|
|
90
|
+
/** ResizeObserver instance watching window resizes */
|
|
91
|
+
private resizeObserver;
|
|
92
|
+
/** Current node search results */
|
|
93
|
+
private searchResults;
|
|
94
|
+
/** Currently selected edge. We keep track of it here so we can unselect it when need be */
|
|
95
|
+
private selectedEdge;
|
|
96
|
+
/** Currently selected node. We keep track of it here so we can unselect it when need be */
|
|
97
|
+
private selectedNode;
|
|
98
|
+
/** Current range of edge strength values provided in meta attributes */
|
|
99
|
+
private strengthRange;
|
|
100
|
+
/** Texture cache instance */
|
|
101
|
+
private textureCache;
|
|
102
|
+
/** Current theme */
|
|
103
|
+
private theme;
|
|
104
|
+
/** Graph UID */
|
|
105
|
+
private uid;
|
|
106
|
+
/** Viewport instance */
|
|
107
|
+
private viewport;
|
|
108
|
+
/** Optional user-provided zoom thresholds */
|
|
109
|
+
private zoomThresholds?;
|
|
110
|
+
constructor(graph: SimulationGraph, layout: GraphLayout, editable: boolean, editorMode: EditorMode, theme: DefaultTheme, constraints?: EdgeConstraint[], zoomThresholds?: ZoomThresholds);
|
|
111
|
+
/**
|
|
112
|
+
* Get the center position of the rendered viewport
|
|
113
|
+
*/
|
|
114
|
+
getCenterPosition(): PIXI.IPointData;
|
|
115
|
+
/**
|
|
116
|
+
* Cleanup the app appropriately
|
|
117
|
+
*/
|
|
118
|
+
destroy(): void;
|
|
119
|
+
/**
|
|
120
|
+
* Request the graph to be re-rendered
|
|
121
|
+
*/
|
|
122
|
+
requestRender(): void;
|
|
123
|
+
/**
|
|
124
|
+
* Reset the viewport to fit the graph centered on screen
|
|
125
|
+
*/
|
|
126
|
+
resetViewport(): void;
|
|
127
|
+
/**
|
|
128
|
+
* Update matched status based on new search result
|
|
129
|
+
*
|
|
130
|
+
* @param ids ids found in search result
|
|
131
|
+
*/
|
|
132
|
+
searchNodes(ids: string[]): void;
|
|
133
|
+
/**
|
|
134
|
+
* Select an edge with given id
|
|
135
|
+
*
|
|
136
|
+
* @param id id of the edge
|
|
137
|
+
*/
|
|
138
|
+
selectEdge(path: [string, string]): void;
|
|
139
|
+
/**
|
|
140
|
+
* Select a node with given id
|
|
141
|
+
*
|
|
142
|
+
* @param id id of the node
|
|
143
|
+
*/
|
|
144
|
+
selectNode(id: string): void;
|
|
145
|
+
/**
|
|
146
|
+
* Update drag mode
|
|
147
|
+
*
|
|
148
|
+
* @param dragMode drag mode to set
|
|
149
|
+
*/
|
|
150
|
+
setDragMode(dragMode: DragMode): void;
|
|
151
|
+
/**
|
|
152
|
+
* Update theme used
|
|
153
|
+
*
|
|
154
|
+
* @param theme theme used
|
|
155
|
+
*/
|
|
156
|
+
setTheme(theme: DefaultTheme): void;
|
|
157
|
+
/**
|
|
158
|
+
* Start the rendering engine
|
|
159
|
+
*
|
|
160
|
+
* @param container container to start in - canvas will be injected into it
|
|
161
|
+
*/
|
|
162
|
+
start(container: HTMLElement): Promise<void>;
|
|
163
|
+
/**
|
|
164
|
+
* Update the set of constraints
|
|
165
|
+
*
|
|
166
|
+
* @param constraints new constraints
|
|
167
|
+
*/
|
|
168
|
+
updateConstraints(constraints: EdgeConstraint[]): void;
|
|
169
|
+
/**
|
|
170
|
+
* Create an edge
|
|
171
|
+
*
|
|
172
|
+
* @param id edge id
|
|
173
|
+
* @param attributes edge attributes
|
|
174
|
+
* @param source source node id
|
|
175
|
+
* @param target target node i
|
|
176
|
+
* @param sourceAttributes source node attributes
|
|
177
|
+
* @param targetAttributes target node attributes
|
|
178
|
+
*/
|
|
179
|
+
private createEdge;
|
|
180
|
+
/**
|
|
181
|
+
* Create the graph.
|
|
182
|
+
*
|
|
183
|
+
* Creates edges and nodes based on current graph state.
|
|
184
|
+
*/
|
|
185
|
+
private createGraph;
|
|
186
|
+
/**
|
|
187
|
+
* Create a node
|
|
188
|
+
*
|
|
189
|
+
* @param id node id
|
|
190
|
+
* @param attributes node attributes
|
|
191
|
+
*/
|
|
192
|
+
private createNode;
|
|
193
|
+
/**
|
|
194
|
+
* Drop the edge graphics from the renderer
|
|
195
|
+
*
|
|
196
|
+
* @param id edge id
|
|
197
|
+
*/
|
|
198
|
+
private dropEdge;
|
|
199
|
+
/**
|
|
200
|
+
* Drop the node graphics from the renderer
|
|
201
|
+
*
|
|
202
|
+
* @param id node id
|
|
203
|
+
*/
|
|
204
|
+
private dropNode;
|
|
205
|
+
/**
|
|
206
|
+
* Enables drag behaviour
|
|
207
|
+
*
|
|
208
|
+
* Pauses viewport dragging and installs listeners for mouse movement
|
|
209
|
+
*/
|
|
210
|
+
private enableDragBehaviour;
|
|
211
|
+
/**
|
|
212
|
+
* Get constraint for given edge
|
|
213
|
+
*
|
|
214
|
+
* @param source edge source
|
|
215
|
+
* @param target edge target
|
|
216
|
+
*/
|
|
217
|
+
private getConstraint;
|
|
218
|
+
/**
|
|
219
|
+
* Get style object to determine edge behaviour
|
|
220
|
+
*
|
|
221
|
+
* @param edge edge object to get styles for
|
|
222
|
+
* @param attributes edge attributes
|
|
223
|
+
* @param constraint optional attached constraint, used in edge encoder mode
|
|
224
|
+
*/
|
|
225
|
+
private getEdgeStyle;
|
|
226
|
+
/**
|
|
227
|
+
* Get style object to determine node behaviour
|
|
228
|
+
*
|
|
229
|
+
* @param node node object to get styles for
|
|
230
|
+
* @param attributes node attributes
|
|
231
|
+
*/
|
|
232
|
+
private getNodeStyle;
|
|
233
|
+
/**
|
|
234
|
+
* Enable hover state for given edge
|
|
235
|
+
*
|
|
236
|
+
* @param id id of edge to hover
|
|
237
|
+
*/
|
|
238
|
+
private hoverEdge;
|
|
239
|
+
/**
|
|
240
|
+
* Enable hover state for given node
|
|
241
|
+
*
|
|
242
|
+
* @param id id of node to hover
|
|
243
|
+
*/
|
|
244
|
+
private hoverNode;
|
|
245
|
+
/**
|
|
246
|
+
* Move given node to target position
|
|
247
|
+
*
|
|
248
|
+
* @param nodeKey id of node to move
|
|
249
|
+
* @param point target position
|
|
250
|
+
*/
|
|
251
|
+
private moveNode;
|
|
252
|
+
/**
|
|
253
|
+
* Move handler - drag behaviour
|
|
254
|
+
*
|
|
255
|
+
* @param event mouse event
|
|
256
|
+
*/
|
|
257
|
+
private onDocumentMouseMove;
|
|
258
|
+
/**
|
|
259
|
+
* On mouse up, stop drag - reset stored mousedown keys and remove moving listener
|
|
260
|
+
*/
|
|
261
|
+
private onDocumentMouseUp;
|
|
262
|
+
private onGraphAttributesUpdated;
|
|
263
|
+
private onGraphNodeAdded;
|
|
264
|
+
private onGraphEdgeAdded;
|
|
265
|
+
private onGraphEdgeDropped;
|
|
266
|
+
private onGraphNodeDropped;
|
|
267
|
+
private onGraphEdgeAttributesUpdated;
|
|
268
|
+
private onGraphNodeAttributesUpdated;
|
|
269
|
+
/**
|
|
270
|
+
* Apply a given layout to the graph
|
|
271
|
+
*
|
|
272
|
+
* @param layout layout to apply
|
|
273
|
+
*/
|
|
274
|
+
private setLayout;
|
|
275
|
+
/**
|
|
276
|
+
* Get relative strength definition based on all edge thickness provided
|
|
277
|
+
*
|
|
278
|
+
* @param attributes edge attributes
|
|
279
|
+
*/
|
|
280
|
+
private getRelativeStrength;
|
|
281
|
+
/**
|
|
282
|
+
* Disable hover state for given edge
|
|
283
|
+
*
|
|
284
|
+
* @param id id of edge to unhover
|
|
285
|
+
*/
|
|
286
|
+
private unhoverEdge;
|
|
287
|
+
/**
|
|
288
|
+
* Disable hover state for given node
|
|
289
|
+
*
|
|
290
|
+
* @param id id of node to unhover
|
|
291
|
+
*/
|
|
292
|
+
private unhoverNode;
|
|
293
|
+
/**
|
|
294
|
+
* Update edge style
|
|
295
|
+
*
|
|
296
|
+
* @param id id of edge to update
|
|
297
|
+
* @param attributes edge attributes
|
|
298
|
+
* @param source source node ID
|
|
299
|
+
* @param target target node ID
|
|
300
|
+
* @param sourceNodeAttributes source node attributes
|
|
301
|
+
* @param targetNodeAttributes target node attributes
|
|
302
|
+
*/
|
|
303
|
+
private updateEdgeStyle;
|
|
304
|
+
/**
|
|
305
|
+
* Update style for given edge
|
|
306
|
+
*
|
|
307
|
+
* @param edgeKey id of edge to update
|
|
308
|
+
*/
|
|
309
|
+
private updateEdgeStyleByKey;
|
|
310
|
+
/**
|
|
311
|
+
* Update visibility of graph parts.
|
|
312
|
+
*
|
|
313
|
+
* Applies culling to hide off-screen graphics, updates LOD based on zoom level
|
|
314
|
+
*/
|
|
315
|
+
private updateGraphVisibility;
|
|
316
|
+
/**
|
|
317
|
+
* Recompute the layout and apply it
|
|
318
|
+
*/
|
|
319
|
+
private updateLayout;
|
|
320
|
+
/**
|
|
321
|
+
* Update style of given node
|
|
322
|
+
*
|
|
323
|
+
* @param id id of node to update
|
|
324
|
+
* @param attributes node attributes
|
|
325
|
+
*/
|
|
326
|
+
private updateNodeStyle;
|
|
327
|
+
/**
|
|
328
|
+
* Update style for given node
|
|
329
|
+
*
|
|
330
|
+
* @param nodeKey id of node to update
|
|
331
|
+
*/
|
|
332
|
+
private updateNodeStyleByKey;
|
|
333
|
+
/**
|
|
334
|
+
* Recalculate current strength range based on thickness properties
|
|
335
|
+
*/
|
|
336
|
+
private updateStrengthRange;
|
|
337
|
+
/**
|
|
338
|
+
* Update the visuals of each node and edge
|
|
339
|
+
*/
|
|
340
|
+
private updateStyles;
|
|
341
|
+
}
|
|
342
|
+
//# sourceMappingURL=engine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../../src/shared/rendering/engine.tsx"],"names":[],"mappings":";AAqBA,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAEhC,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,OAAO,EAA6B,WAAW,E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