@reltio/components 1.4.1844 → 1.4.1846
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/cjs/EmptyState/EmptyState.d.ts +1 -0
- package/cjs/EmptyState/EmptyState.js +3 -1
- package/cjs/features/graph/DataModelGraph/DataModelGraph.d.ts +12 -0
- package/cjs/features/graph/DataModelGraph/DataModelGraph.js +28 -0
- package/cjs/features/graph/DataModelGraph/DataModelGraph.test.d.ts +1 -0
- package/cjs/features/graph/DataModelGraph/DataModelGraph.test.js +63 -0
- package/cjs/features/graph/DataModelGraph/components/DataModelCircleLayout/DataModelCircleLayuot.d.ts +11 -0
- package/cjs/features/graph/DataModelGraph/components/DataModelCircleLayout/DataModelCircleLayuot.js +21 -0
- package/cjs/features/graph/DataModelGraph/helpers/edgeLabelHelpers.d.ts +9 -0
- package/cjs/features/graph/DataModelGraph/helpers/edgeLabelHelpers.js +38 -0
- package/cjs/features/graph/DataModelGraph/helpers/edgeLabelHelpers.test.d.ts +1 -0
- package/cjs/features/graph/DataModelGraph/helpers/edgeLabelHelpers.test.js +74 -0
- package/cjs/features/graph/DataModelGraph/hooks/defaultGraph.test-data.d.ts +2 -0
- package/cjs/features/graph/DataModelGraph/hooks/defaultGraph.test-data.js +52 -0
- package/cjs/features/graph/DataModelGraph/hooks/useDataModelGraphAppearance.d.ts +17 -0
- package/cjs/features/graph/DataModelGraph/hooks/useDataModelGraphAppearance.js +139 -0
- package/cjs/features/graph/DataModelGraph/hooks/useDataModelGraphAppearance.test.d.ts +1 -0
- package/cjs/features/graph/DataModelGraph/hooks/useDataModelGraphAppearance.test.js +192 -0
- package/cjs/features/graph/DataModelGraph/hooks/useEdgeLabelsRenderer.d.ts +10 -0
- package/cjs/features/graph/DataModelGraph/hooks/useEdgeLabelsRenderer.js +171 -0
- package/cjs/features/graph/DataModelGraph/hooks/useEdgeLabelsRenderer.test.d.ts +1 -0
- package/cjs/features/graph/DataModelGraph/hooks/useEdgeLabelsRenderer.test.js +176 -0
- package/cjs/features/graph/DataModelGraph/hooks/useFakeCenterNode.d.ts +8 -0
- package/cjs/features/graph/DataModelGraph/hooks/useFakeCenterNode.js +36 -0
- package/cjs/features/graph/DataModelGraph/hooks/useFakeCenterNode.test.d.ts +1 -0
- package/cjs/features/graph/DataModelGraph/hooks/useFakeCenterNode.test.js +37 -0
- package/cjs/features/graph/DataModelGraph/hooks/useSelectedNodeRenderer.d.ts +2 -0
- package/cjs/features/graph/DataModelGraph/hooks/useSelectedNodeRenderer.js +41 -0
- package/cjs/features/graph/DataModelGraph/hooks/useSelectedNodeRenderer.test.d.ts +1 -0
- package/cjs/features/graph/DataModelGraph/hooks/useSelectedNodeRenderer.test.js +63 -0
- package/cjs/features/graph/DataModelGraph/icons/interaction.inline.svg.d.ts +1 -0
- package/cjs/features/graph/DataModelGraph/icons/interaction.inline.svg.js +4 -0
- package/cjs/features/graph/DataModelGraph/index.d.ts +1 -0
- package/cjs/features/graph/DataModelGraph/index.js +5 -0
- package/cjs/features/graph/DataModelGraph/styles.d.ts +1 -0
- package/cjs/features/graph/DataModelGraph/styles.js +26 -0
- package/cjs/features/graph/SigmaCustomRenderersContainer/SigmaCustomRenderersContainer.d.ts +6 -0
- package/cjs/features/graph/SigmaCustomRenderersContainer/SigmaCustomRenderersContainer.js +15 -0
- package/cjs/features/graph/SigmaCustomRenderersContainer/index.d.ts +1 -0
- package/cjs/features/graph/SigmaCustomRenderersContainer/index.js +5 -0
- package/cjs/features/graph/SigmaGraphContainer/SigmaGraphContainer.d.ts +9 -0
- package/cjs/features/graph/SigmaGraphContainer/SigmaGraphContainer.js +86 -0
- package/cjs/features/graph/SigmaGraphContainer/SigmaGraphContainer.test.d.ts +1 -0
- package/cjs/features/graph/SigmaGraphContainer/SigmaGraphContainer.test.js +26 -0
- package/cjs/features/graph/SigmaGraphContainer/index.d.ts +1 -0
- package/cjs/features/graph/SigmaGraphContainer/index.js +5 -0
- package/cjs/features/graph/SigmaGraphResizer/SigmaGraphResizer.d.ts +1 -0
- package/cjs/features/graph/SigmaGraphResizer/SigmaGraphResizer.js +40 -0
- package/cjs/features/graph/SigmaGraphResizer/SigmaGraphResizer.test.d.ts +1 -0
- package/cjs/features/graph/SigmaGraphResizer/SigmaGraphResizer.test.js +37 -0
- package/cjs/features/graph/SigmaGraphResizer/index.d.ts +1 -0
- package/cjs/features/graph/SigmaGraphResizer/index.js +5 -0
- package/cjs/features/graph/ZoomSlider/ZoomSlider.d.ts +7 -0
- package/cjs/features/graph/ZoomSlider/ZoomSlider.js +113 -0
- package/cjs/features/graph/ZoomSlider/ZoomSlider.test.d.ts +1 -0
- package/cjs/features/graph/ZoomSlider/ZoomSlider.test.js +83 -0
- package/cjs/features/graph/ZoomSlider/index.d.ts +1 -0
- package/cjs/features/graph/ZoomSlider/index.js +5 -0
- package/cjs/features/graph/ZoomSlider/styles.d.ts +1 -0
- package/cjs/features/graph/ZoomSlider/styles.js +63 -0
- package/cjs/features/graph/contexts/SigmaCustomRenderersContext.d.ts +9 -0
- package/cjs/features/graph/contexts/SigmaCustomRenderersContext.js +15 -0
- package/cjs/features/graph/hooks/useAnimatedGraphLayout.d.ts +13 -0
- package/cjs/features/graph/hooks/useAnimatedGraphLayout.js +35 -0
- package/cjs/features/graph/hooks/useCircleLayout.d.ts +9 -0
- package/cjs/features/graph/hooks/useCircleLayout.js +50 -0
- package/cjs/features/graph/hooks/useLoopRenderer.d.ts +5 -0
- package/cjs/features/graph/hooks/useLoopRenderer.js +47 -0
- package/cjs/features/graph/hooks/useLoopRenderer.test.d.ts +1 -0
- package/cjs/features/graph/hooks/useLoopRenderer.test.js +221 -0
- package/cjs/features/graph/hooks/useSigmaCustomRenderers.d.ts +7 -0
- package/cjs/features/graph/hooks/useSigmaCustomRenderers.js +95 -0
- package/cjs/features/graph/hooks/useSigmaCustomRenderers.test.d.ts +1 -0
- package/cjs/features/graph/hooks/useSigmaCustomRenderers.test.js +200 -0
- package/cjs/features/graph/index.d.ts +16 -0
- package/cjs/features/graph/index.js +34 -0
- package/cjs/features/graph/rendering/canvas/hover.d.ts +2 -0
- package/cjs/features/graph/rendering/canvas/hover.js +10 -0
- package/cjs/features/graph/rendering/canvas/hover.spec.d.ts +1 -0
- package/cjs/features/graph/rendering/canvas/hover.spec.js +26 -0
- package/cjs/features/graph/rendering/canvas/label.d.ts +7 -0
- package/cjs/features/graph/rendering/canvas/label.js +32 -0
- package/cjs/features/graph/rendering/canvas/label.spec.d.ts +1 -0
- package/cjs/features/graph/rendering/canvas/label.spec.js +81 -0
- package/cjs/features/graph/rendering/canvas/labelBackground.d.ts +9 -0
- package/cjs/features/graph/rendering/canvas/labelBackground.js +37 -0
- package/cjs/features/graph/rendering/canvas/labelBackground.spec.d.ts +1 -0
- package/cjs/features/graph/rendering/canvas/labelBackground.spec.js +92 -0
- package/cjs/features/graph/rendering/canvas/nodeArc.d.ts +10 -0
- package/cjs/features/graph/rendering/canvas/nodeArc.js +33 -0
- package/cjs/features/graph/rendering/canvas/selfRelationLoop.d.ts +11 -0
- package/cjs/features/graph/rendering/canvas/selfRelationLoop.js +73 -0
- package/cjs/features/graph/rendering/canvas/selfRelationLoop.spec.d.ts +1 -0
- package/cjs/features/graph/rendering/canvas/selfRelationLoop.spec.js +92 -0
- package/cjs/features/graph/rendering/canvas/tooltip.d.ts +2 -0
- package/cjs/features/graph/rendering/canvas/tooltip.js +28 -0
- package/cjs/features/graph/rendering/canvas/tooltip.spec.d.ts +1 -0
- package/cjs/features/graph/rendering/canvas/tooltip.spec.js +32 -0
- package/cjs/features/graph/rendering/canvas/utils.d.ts +4 -0
- package/cjs/features/graph/rendering/canvas/utils.js +10 -0
- package/cjs/features/graph/rendering/canvas/utils.spec.d.ts +1 -0
- package/cjs/features/graph/rendering/canvas/utils.spec.js +22 -0
- package/cjs/features/graph/rendering/icons/no_photo.inline.svg.d.ts +1 -0
- package/cjs/features/graph/rendering/icons/no_photo.inline.svg.js +4 -0
- package/cjs/features/graph/rendering/webgl/edge.arrowHead.d.ts +8 -0
- package/cjs/features/graph/rendering/webgl/edge.arrowHead.js +84 -0
- package/cjs/features/graph/rendering/webgl/edge.clamped.d.ts +29 -0
- package/cjs/features/graph/rendering/webgl/edge.clamped.js +176 -0
- package/cjs/features/graph/rendering/webgl/edge.dashed.d.ts +23 -0
- package/cjs/features/graph/rendering/webgl/edge.dashed.js +162 -0
- package/cjs/features/graph/rendering/webgl/edge.reversedArrowHead.d.ts +5 -0
- package/cjs/features/graph/rendering/webgl/edge.reversedArrowHead.js +32 -0
- package/cjs/features/graph/rendering/webgl/helpers/imageHelper.d.ts +17 -0
- package/cjs/features/graph/rendering/webgl/helpers/imageHelper.js +9 -0
- package/cjs/features/graph/rendering/webgl/helpers/imageHelper.spec.d.ts +1 -0
- package/cjs/features/graph/rendering/webgl/helpers/imageHelper.spec.js +29 -0
- package/cjs/features/graph/rendering/webgl/image.d.ts +17 -0
- package/cjs/features/graph/rendering/webgl/image.js +115 -0
- package/cjs/features/graph/rendering/webgl/node.border.d.ts +11 -0
- package/cjs/features/graph/rendering/webgl/node.border.js +79 -0
- package/cjs/features/graph/rendering/webgl/node.dashed.border.d.ts +11 -0
- package/cjs/features/graph/rendering/webgl/node.dashed.border.js +77 -0
- package/cjs/features/graph/rendering/webgl/node.image.d.ts +18 -0
- package/cjs/features/graph/rendering/webgl/node.image.js +147 -0
- package/cjs/features/graph/rendering/webgl/shaders/edge.clamped.vert.glsl.d.ts +1 -0
- package/cjs/features/graph/rendering/webgl/shaders/edge.clamped.vert.glsl.js +8 -0
- package/cjs/features/graph/rendering/webgl/shaders/edge.dashed.frag.glsl.d.ts +1 -0
- package/cjs/features/graph/rendering/webgl/shaders/edge.dashed.frag.glsl.js +8 -0
- package/cjs/features/graph/rendering/webgl/shaders/edge.dashed.vert.glsl.d.ts +1 -0
- package/cjs/features/graph/rendering/webgl/shaders/edge.dashed.vert.glsl.js +8 -0
- package/cjs/features/graph/rendering/webgl/shaders/node.border.frag.glsl.d.ts +1 -0
- package/cjs/features/graph/rendering/webgl/shaders/node.border.frag.glsl.js +9 -0
- package/cjs/features/graph/rendering/webgl/shaders/node.border.vert.glsl.d.ts +1 -0
- package/cjs/features/graph/rendering/webgl/shaders/node.border.vert.glsl.js +8 -0
- package/cjs/features/graph/rendering/webgl/shaders/node.dashed.border.frag.glsl.d.ts +1 -0
- package/cjs/features/graph/rendering/webgl/shaders/node.dashed.border.frag.glsl.js +8 -0
- package/cjs/features/graph/rendering/webgl/shaders/node.image.frag.glsl.d.ts +1 -0
- package/cjs/features/graph/rendering/webgl/shaders/node.image.frag.glsl.js +5 -0
- package/cjs/features/graph/rendering/webgl/shaders/node.image.vert.glsl.d.ts +1 -0
- package/cjs/features/graph/rendering/webgl/shaders/node.image.vert.glsl.js +8 -0
- package/cjs/features/graph/rendering/webgl/shaders/utils.d.ts +1 -0
- package/cjs/features/graph/rendering/webgl/shaders/utils.js +4 -0
- package/cjs/features/graph/types/graphDataTypes.d.ts +51 -0
- package/cjs/features/graph/types/graphDataTypes.js +8 -0
- package/cjs/features/graph/types/sigmaCustomRenderersTypes.d.ts +11 -0
- package/cjs/features/graph/types/sigmaCustomRenderersTypes.js +2 -0
- package/cjs/icons/EmptyLoading.d.ts +3 -0
- package/cjs/icons/EmptyLoading.js +150 -0
- package/cjs/icons/index.d.ts +1 -0
- package/cjs/icons/index.js +4 -2
- package/cjs/index.d.ts +1 -0
- package/cjs/index.js +2 -0
- package/esm/EmptyState/EmptyState.d.ts +1 -0
- package/esm/EmptyState/EmptyState.js +3 -1
- package/esm/features/graph/DataModelGraph/DataModelGraph.d.ts +12 -0
- package/esm/features/graph/DataModelGraph/DataModelGraph.js +21 -0
- package/esm/features/graph/DataModelGraph/DataModelGraph.test.d.ts +1 -0
- package/esm/features/graph/DataModelGraph/DataModelGraph.test.js +58 -0
- package/esm/features/graph/DataModelGraph/components/DataModelCircleLayout/DataModelCircleLayuot.d.ts +11 -0
- package/esm/features/graph/DataModelGraph/components/DataModelCircleLayout/DataModelCircleLayuot.js +17 -0
- package/esm/features/graph/DataModelGraph/helpers/edgeLabelHelpers.d.ts +9 -0
- package/esm/features/graph/DataModelGraph/helpers/edgeLabelHelpers.js +33 -0
- package/esm/features/graph/DataModelGraph/helpers/edgeLabelHelpers.test.d.ts +1 -0
- package/esm/features/graph/DataModelGraph/helpers/edgeLabelHelpers.test.js +72 -0
- package/esm/features/graph/DataModelGraph/hooks/defaultGraph.test-data.d.ts +2 -0
- package/esm/features/graph/DataModelGraph/hooks/defaultGraph.test-data.js +45 -0
- package/esm/features/graph/DataModelGraph/hooks/useDataModelGraphAppearance.d.ts +17 -0
- package/esm/features/graph/DataModelGraph/hooks/useDataModelGraphAppearance.js +135 -0
- package/esm/features/graph/DataModelGraph/hooks/useDataModelGraphAppearance.test.d.ts +1 -0
- package/esm/features/graph/DataModelGraph/hooks/useDataModelGraphAppearance.test.js +190 -0
- package/esm/features/graph/DataModelGraph/hooks/useEdgeLabelsRenderer.d.ts +10 -0
- package/esm/features/graph/DataModelGraph/hooks/useEdgeLabelsRenderer.js +167 -0
- package/esm/features/graph/DataModelGraph/hooks/useEdgeLabelsRenderer.test.d.ts +1 -0
- package/esm/features/graph/DataModelGraph/hooks/useEdgeLabelsRenderer.test.js +174 -0
- package/esm/features/graph/DataModelGraph/hooks/useFakeCenterNode.d.ts +8 -0
- package/esm/features/graph/DataModelGraph/hooks/useFakeCenterNode.js +32 -0
- package/esm/features/graph/DataModelGraph/hooks/useFakeCenterNode.test.d.ts +1 -0
- package/esm/features/graph/DataModelGraph/hooks/useFakeCenterNode.test.js +35 -0
- package/esm/features/graph/DataModelGraph/hooks/useSelectedNodeRenderer.d.ts +2 -0
- package/esm/features/graph/DataModelGraph/hooks/useSelectedNodeRenderer.js +37 -0
- package/esm/features/graph/DataModelGraph/hooks/useSelectedNodeRenderer.test.d.ts +1 -0
- package/esm/features/graph/DataModelGraph/hooks/useSelectedNodeRenderer.test.js +61 -0
- package/esm/features/graph/DataModelGraph/icons/interaction.inline.svg.d.ts +1 -0
- package/esm/features/graph/DataModelGraph/icons/interaction.inline.svg.js +1 -0
- package/esm/features/graph/DataModelGraph/index.d.ts +1 -0
- package/esm/features/graph/DataModelGraph/index.js +1 -0
- package/esm/features/graph/DataModelGraph/styles.d.ts +1 -0
- package/esm/features/graph/DataModelGraph/styles.js +23 -0
- package/esm/features/graph/SigmaCustomRenderersContainer/SigmaCustomRenderersContainer.d.ts +6 -0
- package/esm/features/graph/SigmaCustomRenderersContainer/SigmaCustomRenderersContainer.js +8 -0
- package/esm/features/graph/SigmaCustomRenderersContainer/index.d.ts +1 -0
- package/esm/features/graph/SigmaCustomRenderersContainer/index.js +1 -0
- package/esm/features/graph/SigmaGraphContainer/SigmaGraphContainer.d.ts +9 -0
- package/esm/features/graph/SigmaGraphContainer/SigmaGraphContainer.js +56 -0
- package/esm/features/graph/SigmaGraphContainer/SigmaGraphContainer.test.d.ts +1 -0
- package/esm/features/graph/SigmaGraphContainer/SigmaGraphContainer.test.js +21 -0
- package/esm/features/graph/SigmaGraphContainer/index.d.ts +1 -0
- package/esm/features/graph/SigmaGraphContainer/index.js +1 -0
- package/esm/features/graph/SigmaGraphResizer/SigmaGraphResizer.d.ts +1 -0
- package/esm/features/graph/SigmaGraphResizer/SigmaGraphResizer.js +10 -0
- package/esm/features/graph/SigmaGraphResizer/SigmaGraphResizer.test.d.ts +1 -0
- package/esm/features/graph/SigmaGraphResizer/SigmaGraphResizer.test.js +32 -0
- package/esm/features/graph/SigmaGraphResizer/index.d.ts +1 -0
- package/esm/features/graph/SigmaGraphResizer/index.js +1 -0
- package/esm/features/graph/ZoomSlider/ZoomSlider.d.ts +7 -0
- package/esm/features/graph/ZoomSlider/ZoomSlider.js +83 -0
- package/esm/features/graph/ZoomSlider/ZoomSlider.test.d.ts +1 -0
- package/esm/features/graph/ZoomSlider/ZoomSlider.test.js +78 -0
- package/esm/features/graph/ZoomSlider/index.d.ts +1 -0
- package/esm/features/graph/ZoomSlider/index.js +1 -0
- package/esm/features/graph/ZoomSlider/styles.d.ts +1 -0
- package/esm/features/graph/ZoomSlider/styles.js +60 -0
- package/esm/features/graph/contexts/SigmaCustomRenderersContext.d.ts +9 -0
- package/esm/features/graph/contexts/SigmaCustomRenderersContext.js +11 -0
- package/esm/features/graph/hooks/useAnimatedGraphLayout.d.ts +13 -0
- package/esm/features/graph/hooks/useAnimatedGraphLayout.js +31 -0
- package/esm/features/graph/hooks/useCircleLayout.d.ts +9 -0
- package/esm/features/graph/hooks/useCircleLayout.js +43 -0
- package/esm/features/graph/hooks/useLoopRenderer.d.ts +5 -0
- package/esm/features/graph/hooks/useLoopRenderer.js +43 -0
- package/esm/features/graph/hooks/useLoopRenderer.test.d.ts +1 -0
- package/esm/features/graph/hooks/useLoopRenderer.test.js +219 -0
- package/esm/features/graph/hooks/useSigmaCustomRenderers.d.ts +7 -0
- package/esm/features/graph/hooks/useSigmaCustomRenderers.js +91 -0
- package/esm/features/graph/hooks/useSigmaCustomRenderers.test.d.ts +1 -0
- package/esm/features/graph/hooks/useSigmaCustomRenderers.test.js +198 -0
- package/esm/features/graph/index.d.ts +16 -0
- package/esm/features/graph/index.js +17 -0
- package/esm/features/graph/rendering/canvas/hover.d.ts +2 -0
- package/esm/features/graph/rendering/canvas/hover.js +6 -0
- package/esm/features/graph/rendering/canvas/hover.spec.d.ts +1 -0
- package/esm/features/graph/rendering/canvas/hover.spec.js +24 -0
- package/esm/features/graph/rendering/canvas/label.d.ts +7 -0
- package/esm/features/graph/rendering/canvas/label.js +28 -0
- package/esm/features/graph/rendering/canvas/label.spec.d.ts +1 -0
- package/esm/features/graph/rendering/canvas/label.spec.js +79 -0
- package/esm/features/graph/rendering/canvas/labelBackground.d.ts +9 -0
- package/esm/features/graph/rendering/canvas/labelBackground.js +33 -0
- package/esm/features/graph/rendering/canvas/labelBackground.spec.d.ts +1 -0
- package/esm/features/graph/rendering/canvas/labelBackground.spec.js +90 -0
- package/esm/features/graph/rendering/canvas/nodeArc.d.ts +10 -0
- package/esm/features/graph/rendering/canvas/nodeArc.js +27 -0
- package/esm/features/graph/rendering/canvas/selfRelationLoop.d.ts +11 -0
- package/esm/features/graph/rendering/canvas/selfRelationLoop.js +69 -0
- package/esm/features/graph/rendering/canvas/selfRelationLoop.spec.d.ts +1 -0
- package/esm/features/graph/rendering/canvas/selfRelationLoop.spec.js +90 -0
- package/esm/features/graph/rendering/canvas/tooltip.d.ts +2 -0
- package/esm/features/graph/rendering/canvas/tooltip.js +25 -0
- package/esm/features/graph/rendering/canvas/tooltip.spec.d.ts +1 -0
- package/esm/features/graph/rendering/canvas/tooltip.spec.js +30 -0
- package/esm/features/graph/rendering/canvas/utils.d.ts +4 -0
- package/esm/features/graph/rendering/canvas/utils.js +6 -0
- package/esm/features/graph/rendering/canvas/utils.spec.d.ts +1 -0
- package/esm/features/graph/rendering/canvas/utils.spec.js +20 -0
- package/esm/features/graph/rendering/icons/no_photo.inline.svg.d.ts +1 -0
- package/esm/features/graph/rendering/icons/no_photo.inline.svg.js +1 -0
- package/esm/features/graph/rendering/webgl/edge.arrowHead.d.ts +8 -0
- package/esm/features/graph/rendering/webgl/edge.arrowHead.js +79 -0
- package/esm/features/graph/rendering/webgl/edge.clamped.d.ts +29 -0
- package/esm/features/graph/rendering/webgl/edge.clamped.js +171 -0
- package/esm/features/graph/rendering/webgl/edge.dashed.d.ts +23 -0
- package/esm/features/graph/rendering/webgl/edge.dashed.js +160 -0
- package/esm/features/graph/rendering/webgl/edge.reversedArrowHead.d.ts +5 -0
- package/esm/features/graph/rendering/webgl/edge.reversedArrowHead.js +27 -0
- package/esm/features/graph/rendering/webgl/helpers/imageHelper.d.ts +17 -0
- package/esm/features/graph/rendering/webgl/helpers/imageHelper.js +5 -0
- package/esm/features/graph/rendering/webgl/helpers/imageHelper.spec.d.ts +1 -0
- package/esm/features/graph/rendering/webgl/helpers/imageHelper.spec.js +27 -0
- package/esm/features/graph/rendering/webgl/image.d.ts +17 -0
- package/esm/features/graph/rendering/webgl/image.js +112 -0
- package/esm/features/graph/rendering/webgl/node.border.d.ts +11 -0
- package/esm/features/graph/rendering/webgl/node.border.js +76 -0
- package/esm/features/graph/rendering/webgl/node.dashed.border.d.ts +11 -0
- package/esm/features/graph/rendering/webgl/node.dashed.border.js +74 -0
- package/esm/features/graph/rendering/webgl/node.image.d.ts +18 -0
- package/esm/features/graph/rendering/webgl/node.image.js +144 -0
- package/esm/features/graph/rendering/webgl/shaders/edge.clamped.vert.glsl.d.ts +1 -0
- package/esm/features/graph/rendering/webgl/shaders/edge.clamped.vert.glsl.js +5 -0
- package/esm/features/graph/rendering/webgl/shaders/edge.dashed.frag.glsl.d.ts +1 -0
- package/esm/features/graph/rendering/webgl/shaders/edge.dashed.frag.glsl.js +5 -0
- package/esm/features/graph/rendering/webgl/shaders/edge.dashed.vert.glsl.d.ts +1 -0
- package/esm/features/graph/rendering/webgl/shaders/edge.dashed.vert.glsl.js +5 -0
- package/esm/features/graph/rendering/webgl/shaders/node.border.frag.glsl.d.ts +1 -0
- package/esm/features/graph/rendering/webgl/shaders/node.border.frag.glsl.js +6 -0
- package/esm/features/graph/rendering/webgl/shaders/node.border.vert.glsl.d.ts +1 -0
- package/esm/features/graph/rendering/webgl/shaders/node.border.vert.glsl.js +5 -0
- package/esm/features/graph/rendering/webgl/shaders/node.dashed.border.frag.glsl.d.ts +1 -0
- package/esm/features/graph/rendering/webgl/shaders/node.dashed.border.frag.glsl.js +5 -0
- package/esm/features/graph/rendering/webgl/shaders/node.image.frag.glsl.d.ts +1 -0
- package/esm/features/graph/rendering/webgl/shaders/node.image.frag.glsl.js +2 -0
- package/esm/features/graph/rendering/webgl/shaders/node.image.vert.glsl.d.ts +1 -0
- package/esm/features/graph/rendering/webgl/shaders/node.image.vert.glsl.js +5 -0
- package/esm/features/graph/rendering/webgl/shaders/utils.d.ts +1 -0
- package/esm/features/graph/rendering/webgl/shaders/utils.js +1 -0
- package/esm/features/graph/types/graphDataTypes.d.ts +51 -0
- package/esm/features/graph/types/graphDataTypes.js +5 -0
- package/esm/features/graph/types/sigmaCustomRenderersTypes.d.ts +11 -0
- package/esm/features/graph/types/sigmaCustomRenderersTypes.js +1 -0
- package/esm/icons/EmptyLoading.d.ts +3 -0
- package/esm/icons/EmptyLoading.js +145 -0
- package/esm/icons/index.d.ts +1 -0
- package/esm/icons/index.js +1 -0
- package/esm/index.d.ts +1 -0
- package/esm/index.js +2 -0
- package/package.json +7 -2
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
/**
|
|
17
|
+
* This class extends src/rendering/webgl/programs/edge.arrowHead.ts for arrowSizeRatio support
|
|
18
|
+
*/
|
|
19
|
+
import SigmaEdgeArrowHeadProgram from 'sigma/rendering/webgl/programs/edge.arrowHead';
|
|
20
|
+
import { floatColor } from 'sigma/utils';
|
|
21
|
+
var POINTS = 3, ATTRIBUTES = 9, STRIDE = POINTS * ATTRIBUTES;
|
|
22
|
+
var EdgeArrowHeadProgram = /** @class */ (function (_super) {
|
|
23
|
+
__extends(EdgeArrowHeadProgram, _super);
|
|
24
|
+
function EdgeArrowHeadProgram() {
|
|
25
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
26
|
+
}
|
|
27
|
+
EdgeArrowHeadProgram.prototype.process = function (sourceData, targetData, data, hidden, offset) {
|
|
28
|
+
if (hidden) {
|
|
29
|
+
for (var i_1 = offset * STRIDE, l = i_1 + STRIDE; i_1 < l; i_1++)
|
|
30
|
+
this.array[i_1] = 0;
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
// Our changes - added arrowSizeRatio support
|
|
34
|
+
var arrowSizeRatio = data.arrowSizeRatio || 1;
|
|
35
|
+
var thickness = data.size * arrowSizeRatio || 1, radius = targetData.size || 1, x1 = sourceData.x, y1 = sourceData.y, x2 = targetData.x, y2 = targetData.y, color = floatColor(data.color);
|
|
36
|
+
// Computing normals
|
|
37
|
+
var dx = x2 - x1, dy = y2 - y1;
|
|
38
|
+
var len = dx * dx + dy * dy, n1 = 0, n2 = 0;
|
|
39
|
+
if (len) {
|
|
40
|
+
len = 1 / Math.sqrt(len);
|
|
41
|
+
n1 = -dy * len * thickness;
|
|
42
|
+
n2 = dx * len * thickness;
|
|
43
|
+
}
|
|
44
|
+
var i = POINTS * ATTRIBUTES * offset;
|
|
45
|
+
var array = this.array;
|
|
46
|
+
// First point
|
|
47
|
+
array[i++] = x2;
|
|
48
|
+
array[i++] = y2;
|
|
49
|
+
array[i++] = -n1;
|
|
50
|
+
array[i++] = -n2;
|
|
51
|
+
array[i++] = radius;
|
|
52
|
+
array[i++] = color;
|
|
53
|
+
array[i++] = 1;
|
|
54
|
+
array[i++] = 0;
|
|
55
|
+
array[i++] = 0;
|
|
56
|
+
// Second point
|
|
57
|
+
array[i++] = x2;
|
|
58
|
+
array[i++] = y2;
|
|
59
|
+
array[i++] = -n1;
|
|
60
|
+
array[i++] = -n2;
|
|
61
|
+
array[i++] = radius;
|
|
62
|
+
array[i++] = color;
|
|
63
|
+
array[i++] = 0;
|
|
64
|
+
array[i++] = 1;
|
|
65
|
+
array[i++] = 0;
|
|
66
|
+
// Third point
|
|
67
|
+
array[i++] = x2;
|
|
68
|
+
array[i++] = y2;
|
|
69
|
+
array[i++] = -n1;
|
|
70
|
+
array[i++] = -n2;
|
|
71
|
+
array[i++] = radius;
|
|
72
|
+
array[i++] = color;
|
|
73
|
+
array[i++] = 0;
|
|
74
|
+
array[i++] = 0;
|
|
75
|
+
array[i] = 1;
|
|
76
|
+
};
|
|
77
|
+
return EdgeArrowHeadProgram;
|
|
78
|
+
}(SigmaEdgeArrowHeadProgram));
|
|
79
|
+
export default EdgeArrowHeadProgram;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This class copies src/rendering/webgl/programs/edge.clamped.ts, but with a some difference:
|
|
3
|
+
* implemented arrowSizeRatio edge attribute, forwarded it to shaders as a_arrowSizeRatio
|
|
4
|
+
* implemented 'doubleArrow' edge type support
|
|
5
|
+
*/
|
|
6
|
+
import { AbstractEdgeProgram } from 'sigma/rendering/webgl/programs/common/edge';
|
|
7
|
+
import { RenderParams } from 'sigma/rendering/webgl/programs/common/program';
|
|
8
|
+
import { GraphEdgeAttributes, GraphNodeAttributes } from '../../types/graphDataTypes';
|
|
9
|
+
export default class EdgeClampedProgram extends AbstractEdgeProgram {
|
|
10
|
+
IndicesArray: Uint32ArrayConstructor | Uint16ArrayConstructor;
|
|
11
|
+
indicesArray: Uint32Array | Uint16Array;
|
|
12
|
+
indicesBuffer: WebGLBuffer;
|
|
13
|
+
indicesType: GLenum;
|
|
14
|
+
positionLocation: GLint;
|
|
15
|
+
colorLocation: GLint;
|
|
16
|
+
normalLocation: GLint;
|
|
17
|
+
radiusLocation: GLint;
|
|
18
|
+
arrowSizeRatioLocation: GLint;
|
|
19
|
+
matrixLocation: WebGLUniformLocation;
|
|
20
|
+
sqrtZoomRatioLocation: WebGLUniformLocation;
|
|
21
|
+
correctionRatioLocation: WebGLUniformLocation;
|
|
22
|
+
canUse32BitsIndices: boolean;
|
|
23
|
+
constructor(gl: WebGLRenderingContext);
|
|
24
|
+
bind(): void;
|
|
25
|
+
process(sourceData: GraphNodeAttributes, targetData: GraphNodeAttributes, data: GraphEdgeAttributes, hidden: boolean, offset: number): void;
|
|
26
|
+
computeIndices(): void;
|
|
27
|
+
bufferData(): void;
|
|
28
|
+
render(params: RenderParams): void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This class copies src/rendering/webgl/programs/edge.clamped.ts, but with a some difference:
|
|
3
|
+
* implemented arrowSizeRatio edge attribute, forwarded it to shaders as a_arrowSizeRatio
|
|
4
|
+
* implemented 'doubleArrow' edge type support
|
|
5
|
+
*/
|
|
6
|
+
var __extends = (this && this.__extends) || (function () {
|
|
7
|
+
var extendStatics = function (d, b) {
|
|
8
|
+
extendStatics = Object.setPrototypeOf ||
|
|
9
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
10
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
11
|
+
return extendStatics(d, b);
|
|
12
|
+
};
|
|
13
|
+
return function (d, b) {
|
|
14
|
+
if (typeof b !== "function" && b !== null)
|
|
15
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
16
|
+
extendStatics(d, b);
|
|
17
|
+
function __() { this.constructor = d; }
|
|
18
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
19
|
+
};
|
|
20
|
+
})();
|
|
21
|
+
import { floatColor, canUse32BitsIndices } from 'sigma/utils';
|
|
22
|
+
import { AbstractEdgeProgram } from 'sigma/rendering/webgl/programs/common/edge';
|
|
23
|
+
import fragmentShaderSource from 'sigma/rendering/webgl/shaders/edge.frag.glsl';
|
|
24
|
+
import { vertexShaderSource } from './shaders/edge.clamped.vert.glsl';
|
|
25
|
+
var POINTS = 4, ATTRIBUTES = 7, STRIDE = POINTS * ATTRIBUTES;
|
|
26
|
+
var EdgeClampedProgram = /** @class */ (function (_super) {
|
|
27
|
+
__extends(EdgeClampedProgram, _super);
|
|
28
|
+
function EdgeClampedProgram(gl) {
|
|
29
|
+
var _this = _super.call(this, gl, vertexShaderSource, fragmentShaderSource, POINTS, ATTRIBUTES) || this;
|
|
30
|
+
// Initializing indices buffer
|
|
31
|
+
var indicesBuffer = gl.createBuffer();
|
|
32
|
+
if (indicesBuffer === null)
|
|
33
|
+
throw new Error('EdgeClampedProgram: error while getting resolutionLocation');
|
|
34
|
+
_this.indicesBuffer = indicesBuffer;
|
|
35
|
+
// Locations:
|
|
36
|
+
_this.positionLocation = gl.getAttribLocation(_this.program, 'a_position');
|
|
37
|
+
_this.colorLocation = gl.getAttribLocation(_this.program, 'a_color');
|
|
38
|
+
_this.normalLocation = gl.getAttribLocation(_this.program, 'a_normal');
|
|
39
|
+
_this.radiusLocation = gl.getAttribLocation(_this.program, 'a_radius');
|
|
40
|
+
_this.arrowSizeRatioLocation = gl.getAttribLocation(_this.program, 'a_arrowSizeRatio'); // our change
|
|
41
|
+
// Uniform locations
|
|
42
|
+
var matrixLocation = gl.getUniformLocation(_this.program, 'u_matrix');
|
|
43
|
+
if (matrixLocation === null)
|
|
44
|
+
throw new Error('EdgeClampedProgram: error while getting matrixLocation');
|
|
45
|
+
_this.matrixLocation = matrixLocation;
|
|
46
|
+
var sqrtZoomRatioLocation = gl.getUniformLocation(_this.program, 'u_sqrtZoomRatio');
|
|
47
|
+
if (sqrtZoomRatioLocation === null)
|
|
48
|
+
throw new Error('EdgeClampedProgram: error while getting cameraRatioLocation');
|
|
49
|
+
_this.sqrtZoomRatioLocation = sqrtZoomRatioLocation;
|
|
50
|
+
var correctionRatioLocation = gl.getUniformLocation(_this.program, 'u_correctionRatio');
|
|
51
|
+
if (correctionRatioLocation === null)
|
|
52
|
+
throw new Error('EdgeClampedProgram: error while getting viewportRatioLocation');
|
|
53
|
+
_this.correctionRatioLocation = correctionRatioLocation;
|
|
54
|
+
// Enabling the OES_element_index_uint extension
|
|
55
|
+
// NOTE: on older GPUs, this means that really large graphs won't
|
|
56
|
+
// have all their edges rendered. But it seems that the
|
|
57
|
+
// `OES_element_index_uint` is quite everywhere so we'll handle
|
|
58
|
+
// the potential issue if it really arises.
|
|
59
|
+
// NOTE: when using webgl2, the extension is enabled by default
|
|
60
|
+
_this.canUse32BitsIndices = canUse32BitsIndices(gl);
|
|
61
|
+
_this.IndicesArray = _this.canUse32BitsIndices ? Uint32Array : Uint16Array;
|
|
62
|
+
_this.indicesArray = new _this.IndicesArray();
|
|
63
|
+
_this.indicesType = _this.canUse32BitsIndices ? gl.UNSIGNED_INT : gl.UNSIGNED_SHORT;
|
|
64
|
+
_this.bind();
|
|
65
|
+
return _this;
|
|
66
|
+
}
|
|
67
|
+
EdgeClampedProgram.prototype.bind = function () {
|
|
68
|
+
var gl = this.gl;
|
|
69
|
+
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indicesBuffer);
|
|
70
|
+
// Bindings
|
|
71
|
+
gl.enableVertexAttribArray(this.positionLocation);
|
|
72
|
+
gl.enableVertexAttribArray(this.normalLocation);
|
|
73
|
+
gl.enableVertexAttribArray(this.colorLocation);
|
|
74
|
+
gl.enableVertexAttribArray(this.radiusLocation);
|
|
75
|
+
gl.enableVertexAttribArray(this.arrowSizeRatioLocation); // our change
|
|
76
|
+
gl.vertexAttribPointer(this.positionLocation, 2, gl.FLOAT, false, ATTRIBUTES * Float32Array.BYTES_PER_ELEMENT, 0);
|
|
77
|
+
gl.vertexAttribPointer(this.normalLocation, 2, gl.FLOAT, false, ATTRIBUTES * Float32Array.BYTES_PER_ELEMENT, 8);
|
|
78
|
+
gl.vertexAttribPointer(this.colorLocation, 4, gl.UNSIGNED_BYTE, true, ATTRIBUTES * Float32Array.BYTES_PER_ELEMENT, 16);
|
|
79
|
+
gl.vertexAttribPointer(this.radiusLocation, 1, gl.FLOAT, false, ATTRIBUTES * Float32Array.BYTES_PER_ELEMENT, 20);
|
|
80
|
+
// our change
|
|
81
|
+
gl.vertexAttribPointer(this.arrowSizeRatioLocation, 1, gl.FLOAT, false, ATTRIBUTES * Float32Array.BYTES_PER_ELEMENT, 24);
|
|
82
|
+
};
|
|
83
|
+
EdgeClampedProgram.prototype.process = function (sourceData, targetData, data, hidden, offset) {
|
|
84
|
+
if (hidden) {
|
|
85
|
+
for (var i_1 = offset * STRIDE, l = i_1 + STRIDE; i_1 < l; i_1++)
|
|
86
|
+
this.array[i_1] = 0;
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
var arrowSizeRatio = data.arrowSizeRatio || 1; // our change
|
|
90
|
+
var thickness = data.size || 1, x1 = sourceData.x, y1 = sourceData.y, x2 = targetData.x, y2 = targetData.y,
|
|
91
|
+
//our change - added sourceRadius
|
|
92
|
+
sourceRadius = data.type === 'doubleArrow' ? sourceData.size || 1 : 0, targetRadius = targetData.size || 1, color = floatColor(data.color);
|
|
93
|
+
// Computing normals
|
|
94
|
+
var dx = x2 - x1, dy = y2 - y1;
|
|
95
|
+
var len = dx * dx + dy * dy, n1 = 0, n2 = 0;
|
|
96
|
+
if (len) {
|
|
97
|
+
len = 1 / Math.sqrt(len);
|
|
98
|
+
n1 = -dy * len * thickness;
|
|
99
|
+
n2 = dx * len * thickness;
|
|
100
|
+
}
|
|
101
|
+
var i = POINTS * ATTRIBUTES * offset;
|
|
102
|
+
var array = this.array;
|
|
103
|
+
// First point
|
|
104
|
+
array[i++] = x1;
|
|
105
|
+
array[i++] = y1;
|
|
106
|
+
array[i++] = n1;
|
|
107
|
+
array[i++] = n2;
|
|
108
|
+
array[i++] = color;
|
|
109
|
+
array[i++] = -sourceRadius;
|
|
110
|
+
array[i++] = arrowSizeRatio;
|
|
111
|
+
// First point flipped
|
|
112
|
+
array[i++] = x1;
|
|
113
|
+
array[i++] = y1;
|
|
114
|
+
array[i++] = -n1;
|
|
115
|
+
array[i++] = -n2;
|
|
116
|
+
array[i++] = color;
|
|
117
|
+
array[i++] = sourceRadius;
|
|
118
|
+
array[i++] = arrowSizeRatio;
|
|
119
|
+
// Second point
|
|
120
|
+
array[i++] = x2;
|
|
121
|
+
array[i++] = y2;
|
|
122
|
+
array[i++] = n1;
|
|
123
|
+
array[i++] = n2;
|
|
124
|
+
array[i++] = color;
|
|
125
|
+
array[i++] = targetRadius;
|
|
126
|
+
array[i++] = arrowSizeRatio;
|
|
127
|
+
// Second point flipped
|
|
128
|
+
array[i++] = x2;
|
|
129
|
+
array[i++] = y2;
|
|
130
|
+
array[i++] = -n1;
|
|
131
|
+
array[i++] = -n2;
|
|
132
|
+
array[i++] = color;
|
|
133
|
+
array[i++] = -targetRadius;
|
|
134
|
+
array[i] = arrowSizeRatio;
|
|
135
|
+
};
|
|
136
|
+
EdgeClampedProgram.prototype.computeIndices = function () {
|
|
137
|
+
var l = this.array.length / ATTRIBUTES;
|
|
138
|
+
var size = l + l / 2;
|
|
139
|
+
var indices = new this.IndicesArray(size);
|
|
140
|
+
for (var i = 0, c = 0; i < l; i += 4) {
|
|
141
|
+
indices[c++] = i;
|
|
142
|
+
indices[c++] = i + 1;
|
|
143
|
+
indices[c++] = i + 2;
|
|
144
|
+
indices[c++] = i + 2;
|
|
145
|
+
indices[c++] = i + 1;
|
|
146
|
+
indices[c++] = i + 3;
|
|
147
|
+
}
|
|
148
|
+
this.indicesArray = indices;
|
|
149
|
+
};
|
|
150
|
+
EdgeClampedProgram.prototype.bufferData = function () {
|
|
151
|
+
_super.prototype.bufferData.call(this);
|
|
152
|
+
// Indices data
|
|
153
|
+
var gl = this.gl;
|
|
154
|
+
gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indicesArray, gl.STATIC_DRAW);
|
|
155
|
+
};
|
|
156
|
+
EdgeClampedProgram.prototype.render = function (params) {
|
|
157
|
+
if (this.hasNothingToRender())
|
|
158
|
+
return;
|
|
159
|
+
var gl = this.gl;
|
|
160
|
+
var program = this.program;
|
|
161
|
+
gl.useProgram(program);
|
|
162
|
+
// Binding uniforms
|
|
163
|
+
gl.uniformMatrix3fv(this.matrixLocation, false, params.matrix);
|
|
164
|
+
gl.uniform1f(this.sqrtZoomRatioLocation, Math.sqrt(params.ratio));
|
|
165
|
+
gl.uniform1f(this.correctionRatioLocation, params.correctionRatio);
|
|
166
|
+
// Drawing:
|
|
167
|
+
gl.drawElements(gl.TRIANGLES, this.indicesArray.length, this.indicesType, 0);
|
|
168
|
+
};
|
|
169
|
+
return EdgeClampedProgram;
|
|
170
|
+
}(AbstractEdgeProgram));
|
|
171
|
+
export default EdgeClampedProgram;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { AbstractEdgeProgram } from 'sigma/rendering/webgl/programs/common/edge';
|
|
2
|
+
import { RenderParams } from 'sigma/rendering/webgl/programs/common/program';
|
|
3
|
+
import { EdgeDisplayData, NodeDisplayData } from 'sigma/types';
|
|
4
|
+
export default class DashedEdgeProgram extends AbstractEdgeProgram {
|
|
5
|
+
IndicesArray: Uint32ArrayConstructor | Uint16ArrayConstructor;
|
|
6
|
+
indicesArray: Uint32Array | Uint16Array;
|
|
7
|
+
indicesBuffer: WebGLBuffer;
|
|
8
|
+
indicesType: GLenum;
|
|
9
|
+
canUse32BitsIndices: boolean;
|
|
10
|
+
positionLocation: GLint;
|
|
11
|
+
colorLocation: GLint;
|
|
12
|
+
normalLocation: GLint;
|
|
13
|
+
lineLengthLocation: GLint;
|
|
14
|
+
matrixLocation: WebGLUniformLocation;
|
|
15
|
+
sqrtZoomRatioLocation: WebGLUniformLocation;
|
|
16
|
+
correctionRatioLocation: WebGLUniformLocation;
|
|
17
|
+
constructor(gl: WebGLRenderingContext);
|
|
18
|
+
bind(): void;
|
|
19
|
+
computeIndices(): void;
|
|
20
|
+
bufferData(): void;
|
|
21
|
+
process(sourceData: NodeDisplayData, targetData: NodeDisplayData, data: EdgeDisplayData, hidden: boolean, offset: number): void;
|
|
22
|
+
render(params: RenderParams): void;
|
|
23
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
/**
|
|
17
|
+
* This is a copy of sigma/src/rendering/webgl/programs/edge.ts
|
|
18
|
+
* with changes to add dashed edge support
|
|
19
|
+
*/
|
|
20
|
+
import { floatColor, canUse32BitsIndices } from 'sigma/utils';
|
|
21
|
+
import { AbstractEdgeProgram } from 'sigma/rendering/webgl/programs/common/edge';
|
|
22
|
+
import { fragmentShaderSource } from './shaders/edge.dashed.frag.glsl';
|
|
23
|
+
import { vertexShaderSource } from './shaders/edge.dashed.vert.glsl';
|
|
24
|
+
var POINTS = 4, ATTRIBUTES = 6, // our change 5 -> 6
|
|
25
|
+
STRIDE = POINTS * ATTRIBUTES;
|
|
26
|
+
var DashedEdgeProgram = /** @class */ (function (_super) {
|
|
27
|
+
__extends(DashedEdgeProgram, _super);
|
|
28
|
+
function DashedEdgeProgram(gl) {
|
|
29
|
+
var _this = _super.call(this, gl, vertexShaderSource, fragmentShaderSource, POINTS, ATTRIBUTES) || this;
|
|
30
|
+
// Initializing indices buffer
|
|
31
|
+
var indicesBuffer = gl.createBuffer();
|
|
32
|
+
if (indicesBuffer === null)
|
|
33
|
+
throw new Error('EdgeProgram: error while creating indicesBuffer');
|
|
34
|
+
_this.indicesBuffer = indicesBuffer;
|
|
35
|
+
// Locations
|
|
36
|
+
_this.positionLocation = gl.getAttribLocation(_this.program, 'a_position');
|
|
37
|
+
_this.colorLocation = gl.getAttribLocation(_this.program, 'a_color');
|
|
38
|
+
_this.normalLocation = gl.getAttribLocation(_this.program, 'a_normal');
|
|
39
|
+
_this.lineLengthLocation = gl.getAttribLocation(_this.program, 'a_lineLength'); // our addition
|
|
40
|
+
var matrixLocation = gl.getUniformLocation(_this.program, 'u_matrix');
|
|
41
|
+
if (matrixLocation === null)
|
|
42
|
+
throw new Error('EdgeProgram: error while getting matrixLocation');
|
|
43
|
+
_this.matrixLocation = matrixLocation;
|
|
44
|
+
var correctionRatioLocation = gl.getUniformLocation(_this.program, 'u_correctionRatio');
|
|
45
|
+
if (correctionRatioLocation === null)
|
|
46
|
+
throw new Error('EdgeProgram: error while getting correctionRatioLocation');
|
|
47
|
+
_this.correctionRatioLocation = correctionRatioLocation;
|
|
48
|
+
var sqrtZoomRatioLocation = gl.getUniformLocation(_this.program, 'u_sqrtZoomRatio');
|
|
49
|
+
if (sqrtZoomRatioLocation === null)
|
|
50
|
+
throw new Error('EdgeProgram: error while getting sqrtZoomRatioLocation');
|
|
51
|
+
_this.sqrtZoomRatioLocation = sqrtZoomRatioLocation;
|
|
52
|
+
// Enabling the OES_element_index_uint extension
|
|
53
|
+
// NOTE: on older GPUs, this means that really large graphs won't
|
|
54
|
+
// have all their edges rendered. But it seems that the
|
|
55
|
+
// `OES_element_index_uint` is quite everywhere so we'll handle
|
|
56
|
+
// the potential issue if it really arises.
|
|
57
|
+
// NOTE: when using webgl2, the extension is enabled by default
|
|
58
|
+
_this.canUse32BitsIndices = canUse32BitsIndices(gl);
|
|
59
|
+
_this.IndicesArray = _this.canUse32BitsIndices ? Uint32Array : Uint16Array;
|
|
60
|
+
_this.indicesArray = new _this.IndicesArray();
|
|
61
|
+
_this.indicesType = _this.canUse32BitsIndices ? gl.UNSIGNED_INT : gl.UNSIGNED_SHORT;
|
|
62
|
+
_this.bind();
|
|
63
|
+
return _this;
|
|
64
|
+
}
|
|
65
|
+
DashedEdgeProgram.prototype.bind = function () {
|
|
66
|
+
var gl = this.gl;
|
|
67
|
+
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indicesBuffer);
|
|
68
|
+
// Bindings
|
|
69
|
+
gl.enableVertexAttribArray(this.positionLocation);
|
|
70
|
+
gl.enableVertexAttribArray(this.normalLocation);
|
|
71
|
+
gl.enableVertexAttribArray(this.lineLengthLocation); // our addition
|
|
72
|
+
gl.enableVertexAttribArray(this.colorLocation);
|
|
73
|
+
gl.vertexAttribPointer(this.positionLocation, 2, gl.FLOAT, false, ATTRIBUTES * Float32Array.BYTES_PER_ELEMENT, 0);
|
|
74
|
+
gl.vertexAttribPointer(this.normalLocation, 2, gl.FLOAT, false, ATTRIBUTES * Float32Array.BYTES_PER_ELEMENT, 8);
|
|
75
|
+
gl.vertexAttribPointer(this.lineLengthLocation, 1, gl.FLOAT, false, ATTRIBUTES * Float32Array.BYTES_PER_ELEMENT, 16); // our addition
|
|
76
|
+
gl.vertexAttribPointer(this.colorLocation, 4, gl.UNSIGNED_BYTE, true, ATTRIBUTES * Float32Array.BYTES_PER_ELEMENT, 20 // changed from 16 to 20
|
|
77
|
+
);
|
|
78
|
+
};
|
|
79
|
+
DashedEdgeProgram.prototype.computeIndices = function () {
|
|
80
|
+
var l = this.array.length / ATTRIBUTES;
|
|
81
|
+
var size = l + l / 2;
|
|
82
|
+
var indices = new this.IndicesArray(size);
|
|
83
|
+
for (var i = 0, c = 0; i < l; i += 4) {
|
|
84
|
+
indices[c++] = i;
|
|
85
|
+
indices[c++] = i + 1;
|
|
86
|
+
indices[c++] = i + 2;
|
|
87
|
+
indices[c++] = i + 2;
|
|
88
|
+
indices[c++] = i + 1;
|
|
89
|
+
indices[c++] = i + 3;
|
|
90
|
+
}
|
|
91
|
+
this.indicesArray = indices;
|
|
92
|
+
};
|
|
93
|
+
DashedEdgeProgram.prototype.bufferData = function () {
|
|
94
|
+
_super.prototype.bufferData.call(this);
|
|
95
|
+
// Indices data
|
|
96
|
+
var gl = this.gl;
|
|
97
|
+
gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indicesArray, gl.STATIC_DRAW);
|
|
98
|
+
};
|
|
99
|
+
DashedEdgeProgram.prototype.process = function (sourceData, targetData, data, hidden, offset) {
|
|
100
|
+
if (hidden) {
|
|
101
|
+
for (var i_1 = offset * STRIDE, l = i_1 + STRIDE; i_1 < l; i_1++)
|
|
102
|
+
this.array[i_1] = 0;
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
var thickness = data.size || 1, x1 = sourceData.x, y1 = sourceData.y, x2 = targetData.x, y2 = targetData.y, color = floatColor(data.color);
|
|
106
|
+
// Computing normals
|
|
107
|
+
var dx = x2 - x1, dy = y2 - y1;
|
|
108
|
+
var len = dx * dx + dy * dy, n1 = 0, n2 = 0;
|
|
109
|
+
var lineLength = Math.sqrt(len); // our addition
|
|
110
|
+
if (len) {
|
|
111
|
+
len = 1 / Math.sqrt(len);
|
|
112
|
+
n1 = -dy * len * thickness;
|
|
113
|
+
n2 = dx * len * thickness;
|
|
114
|
+
}
|
|
115
|
+
var i = POINTS * ATTRIBUTES * offset;
|
|
116
|
+
var array = this.array;
|
|
117
|
+
// First point
|
|
118
|
+
array[i++] = x1;
|
|
119
|
+
array[i++] = y1;
|
|
120
|
+
array[i++] = n1;
|
|
121
|
+
array[i++] = n2;
|
|
122
|
+
array[i++] = 0; // our addition
|
|
123
|
+
array[i++] = color;
|
|
124
|
+
// First point flipped
|
|
125
|
+
array[i++] = x1;
|
|
126
|
+
array[i++] = y1;
|
|
127
|
+
array[i++] = -n1;
|
|
128
|
+
array[i++] = -n2;
|
|
129
|
+
array[i++] = 0; // our addition
|
|
130
|
+
array[i++] = color;
|
|
131
|
+
// Second point
|
|
132
|
+
array[i++] = x2;
|
|
133
|
+
array[i++] = y2;
|
|
134
|
+
array[i++] = n1;
|
|
135
|
+
array[i++] = n2;
|
|
136
|
+
array[i++] = lineLength; // our addition
|
|
137
|
+
array[i++] = color;
|
|
138
|
+
// Second point flipped
|
|
139
|
+
array[i++] = x2;
|
|
140
|
+
array[i++] = y2;
|
|
141
|
+
array[i++] = -n1;
|
|
142
|
+
array[i++] = -n2;
|
|
143
|
+
array[i++] = lineLength; // our addition
|
|
144
|
+
array[i] = color;
|
|
145
|
+
};
|
|
146
|
+
DashedEdgeProgram.prototype.render = function (params) {
|
|
147
|
+
if (this.hasNothingToRender())
|
|
148
|
+
return;
|
|
149
|
+
var gl = this.gl;
|
|
150
|
+
var program = this.program;
|
|
151
|
+
gl.useProgram(program);
|
|
152
|
+
gl.uniformMatrix3fv(this.matrixLocation, false, params.matrix);
|
|
153
|
+
gl.uniform1f(this.sqrtZoomRatioLocation, Math.sqrt(params.ratio));
|
|
154
|
+
gl.uniform1f(this.correctionRatioLocation, params.correctionRatio);
|
|
155
|
+
// Drawing:
|
|
156
|
+
gl.drawElements(gl.TRIANGLES, this.indicesArray.length, this.indicesType, 0);
|
|
157
|
+
};
|
|
158
|
+
return DashedEdgeProgram;
|
|
159
|
+
}(AbstractEdgeProgram));
|
|
160
|
+
export default DashedEdgeProgram;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { GraphEdgeAttributes, GraphNodeAttributes } from '../../types/graphDataTypes';
|
|
2
|
+
import EdgeArrowHeadProgram from './edge.arrowHead';
|
|
3
|
+
export default class EdgeReversedArrowHeadProgram extends EdgeArrowHeadProgram {
|
|
4
|
+
process(sourceData: GraphNodeAttributes, targetData: GraphNodeAttributes, data: GraphEdgeAttributes, hidden: boolean, offset: number): void;
|
|
5
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
import EdgeArrowHeadProgram from './edge.arrowHead';
|
|
17
|
+
var EdgeReversedArrowHeadProgram = /** @class */ (function (_super) {
|
|
18
|
+
__extends(EdgeReversedArrowHeadProgram, _super);
|
|
19
|
+
function EdgeReversedArrowHeadProgram() {
|
|
20
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
21
|
+
}
|
|
22
|
+
EdgeReversedArrowHeadProgram.prototype.process = function (sourceData, targetData, data, hidden, offset) {
|
|
23
|
+
_super.prototype.process.call(this, targetData, sourceData, data, hidden, offset);
|
|
24
|
+
};
|
|
25
|
+
return EdgeReversedArrowHeadProgram;
|
|
26
|
+
}(EdgeArrowHeadProgram));
|
|
27
|
+
export default EdgeReversedArrowHeadProgram;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Coordinates, Dimensions } from 'sigma/types';
|
|
2
|
+
type ImageLoading = {
|
|
3
|
+
status: 'loading';
|
|
4
|
+
};
|
|
5
|
+
type ImageError = {
|
|
6
|
+
status: 'error';
|
|
7
|
+
};
|
|
8
|
+
type ImagePending = {
|
|
9
|
+
status: 'pending';
|
|
10
|
+
image: HTMLImageElement;
|
|
11
|
+
};
|
|
12
|
+
type ImageReady = {
|
|
13
|
+
status: 'ready';
|
|
14
|
+
} & Coordinates & Dimensions;
|
|
15
|
+
export type ImageType = ImageLoading | ImageError | ImagePending | ImageReady;
|
|
16
|
+
export declare const clearCrossOriginForCORSIfNotSameOrigin: (img: HTMLImageElement, url: string) => void;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { clearCrossOriginForCORSIfNotSameOrigin } from './imageHelper';
|
|
2
|
+
describe('clearCrossOriginForCORSIfNotSameOrigin tests', function () {
|
|
3
|
+
var savedLocation = window.location;
|
|
4
|
+
beforeEach(function () {
|
|
5
|
+
delete window.location;
|
|
6
|
+
window.location = {
|
|
7
|
+
origin: 'http://test'
|
|
8
|
+
};
|
|
9
|
+
});
|
|
10
|
+
afterEach(function () {
|
|
11
|
+
window.location = savedLocation;
|
|
12
|
+
});
|
|
13
|
+
it('should clear crossOrigin if origin is not the same', function () {
|
|
14
|
+
var img = new Image();
|
|
15
|
+
var url = 'http://imagePath/images/123.png';
|
|
16
|
+
img.crossOrigin = 'testValue';
|
|
17
|
+
clearCrossOriginForCORSIfNotSameOrigin(img, url);
|
|
18
|
+
expect(img.crossOrigin).toBe('');
|
|
19
|
+
});
|
|
20
|
+
it('should not clear crossOrigin if origin is the same', function () {
|
|
21
|
+
var img = new Image();
|
|
22
|
+
var url = 'http://test/images/123.png';
|
|
23
|
+
img.crossOrigin = 'testValue';
|
|
24
|
+
clearCrossOriginForCORSIfNotSameOrigin(img, url);
|
|
25
|
+
expect(img.crossOrigin).toBe('testValue');
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ImageType } from './helpers/imageHelper';
|
|
2
|
+
export declare class WebGLImageLoader {
|
|
3
|
+
rebindTextureFns: (() => void)[];
|
|
4
|
+
images: Record<string, ImageType>;
|
|
5
|
+
textureImage: ImageData;
|
|
6
|
+
hasReceivedImages: boolean;
|
|
7
|
+
pendingImagesFrameID: number | undefined;
|
|
8
|
+
constructor();
|
|
9
|
+
/**
|
|
10
|
+
* Helper to load an image:
|
|
11
|
+
*/
|
|
12
|
+
loadImage: (id: string, imageSource: string) => void;
|
|
13
|
+
/**
|
|
14
|
+
* Helper that takes all pending images and adds them into the texture:
|
|
15
|
+
*/
|
|
16
|
+
finalizePendingImages: () => void;
|
|
17
|
+
}
|