@reltio/components 1.4.1843 → 1.4.1845
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 +2 -2
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
/**
|
|
19
|
+
* This is a copy of sigma/src/rendering/webgl/programs/edge.ts
|
|
20
|
+
* with changes to add dashed edge support
|
|
21
|
+
*/
|
|
22
|
+
var utils_1 = require("sigma/utils");
|
|
23
|
+
var edge_1 = require("sigma/rendering/webgl/programs/common/edge");
|
|
24
|
+
var edge_dashed_frag_glsl_1 = require("./shaders/edge.dashed.frag.glsl");
|
|
25
|
+
var edge_dashed_vert_glsl_1 = require("./shaders/edge.dashed.vert.glsl");
|
|
26
|
+
var POINTS = 4, ATTRIBUTES = 6, // our change 5 -> 6
|
|
27
|
+
STRIDE = POINTS * ATTRIBUTES;
|
|
28
|
+
var DashedEdgeProgram = /** @class */ (function (_super) {
|
|
29
|
+
__extends(DashedEdgeProgram, _super);
|
|
30
|
+
function DashedEdgeProgram(gl) {
|
|
31
|
+
var _this = _super.call(this, gl, edge_dashed_vert_glsl_1.vertexShaderSource, edge_dashed_frag_glsl_1.fragmentShaderSource, POINTS, ATTRIBUTES) || this;
|
|
32
|
+
// Initializing indices buffer
|
|
33
|
+
var indicesBuffer = gl.createBuffer();
|
|
34
|
+
if (indicesBuffer === null)
|
|
35
|
+
throw new Error('EdgeProgram: error while creating indicesBuffer');
|
|
36
|
+
_this.indicesBuffer = indicesBuffer;
|
|
37
|
+
// Locations
|
|
38
|
+
_this.positionLocation = gl.getAttribLocation(_this.program, 'a_position');
|
|
39
|
+
_this.colorLocation = gl.getAttribLocation(_this.program, 'a_color');
|
|
40
|
+
_this.normalLocation = gl.getAttribLocation(_this.program, 'a_normal');
|
|
41
|
+
_this.lineLengthLocation = gl.getAttribLocation(_this.program, 'a_lineLength'); // our addition
|
|
42
|
+
var matrixLocation = gl.getUniformLocation(_this.program, 'u_matrix');
|
|
43
|
+
if (matrixLocation === null)
|
|
44
|
+
throw new Error('EdgeProgram: error while getting matrixLocation');
|
|
45
|
+
_this.matrixLocation = matrixLocation;
|
|
46
|
+
var correctionRatioLocation = gl.getUniformLocation(_this.program, 'u_correctionRatio');
|
|
47
|
+
if (correctionRatioLocation === null)
|
|
48
|
+
throw new Error('EdgeProgram: error while getting correctionRatioLocation');
|
|
49
|
+
_this.correctionRatioLocation = correctionRatioLocation;
|
|
50
|
+
var sqrtZoomRatioLocation = gl.getUniformLocation(_this.program, 'u_sqrtZoomRatio');
|
|
51
|
+
if (sqrtZoomRatioLocation === null)
|
|
52
|
+
throw new Error('EdgeProgram: error while getting sqrtZoomRatioLocation');
|
|
53
|
+
_this.sqrtZoomRatioLocation = sqrtZoomRatioLocation;
|
|
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 = (0, utils_1.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
|
+
DashedEdgeProgram.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.lineLengthLocation); // our addition
|
|
74
|
+
gl.enableVertexAttribArray(this.colorLocation);
|
|
75
|
+
gl.vertexAttribPointer(this.positionLocation, 2, gl.FLOAT, false, ATTRIBUTES * Float32Array.BYTES_PER_ELEMENT, 0);
|
|
76
|
+
gl.vertexAttribPointer(this.normalLocation, 2, gl.FLOAT, false, ATTRIBUTES * Float32Array.BYTES_PER_ELEMENT, 8);
|
|
77
|
+
gl.vertexAttribPointer(this.lineLengthLocation, 1, gl.FLOAT, false, ATTRIBUTES * Float32Array.BYTES_PER_ELEMENT, 16); // our addition
|
|
78
|
+
gl.vertexAttribPointer(this.colorLocation, 4, gl.UNSIGNED_BYTE, true, ATTRIBUTES * Float32Array.BYTES_PER_ELEMENT, 20 // changed from 16 to 20
|
|
79
|
+
);
|
|
80
|
+
};
|
|
81
|
+
DashedEdgeProgram.prototype.computeIndices = function () {
|
|
82
|
+
var l = this.array.length / ATTRIBUTES;
|
|
83
|
+
var size = l + l / 2;
|
|
84
|
+
var indices = new this.IndicesArray(size);
|
|
85
|
+
for (var i = 0, c = 0; i < l; i += 4) {
|
|
86
|
+
indices[c++] = i;
|
|
87
|
+
indices[c++] = i + 1;
|
|
88
|
+
indices[c++] = i + 2;
|
|
89
|
+
indices[c++] = i + 2;
|
|
90
|
+
indices[c++] = i + 1;
|
|
91
|
+
indices[c++] = i + 3;
|
|
92
|
+
}
|
|
93
|
+
this.indicesArray = indices;
|
|
94
|
+
};
|
|
95
|
+
DashedEdgeProgram.prototype.bufferData = function () {
|
|
96
|
+
_super.prototype.bufferData.call(this);
|
|
97
|
+
// Indices data
|
|
98
|
+
var gl = this.gl;
|
|
99
|
+
gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indicesArray, gl.STATIC_DRAW);
|
|
100
|
+
};
|
|
101
|
+
DashedEdgeProgram.prototype.process = function (sourceData, targetData, data, hidden, offset) {
|
|
102
|
+
if (hidden) {
|
|
103
|
+
for (var i_1 = offset * STRIDE, l = i_1 + STRIDE; i_1 < l; i_1++)
|
|
104
|
+
this.array[i_1] = 0;
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
var thickness = data.size || 1, x1 = sourceData.x, y1 = sourceData.y, x2 = targetData.x, y2 = targetData.y, color = (0, utils_1.floatColor)(data.color);
|
|
108
|
+
// Computing normals
|
|
109
|
+
var dx = x2 - x1, dy = y2 - y1;
|
|
110
|
+
var len = dx * dx + dy * dy, n1 = 0, n2 = 0;
|
|
111
|
+
var lineLength = Math.sqrt(len); // our addition
|
|
112
|
+
if (len) {
|
|
113
|
+
len = 1 / Math.sqrt(len);
|
|
114
|
+
n1 = -dy * len * thickness;
|
|
115
|
+
n2 = dx * len * thickness;
|
|
116
|
+
}
|
|
117
|
+
var i = POINTS * ATTRIBUTES * offset;
|
|
118
|
+
var array = this.array;
|
|
119
|
+
// First point
|
|
120
|
+
array[i++] = x1;
|
|
121
|
+
array[i++] = y1;
|
|
122
|
+
array[i++] = n1;
|
|
123
|
+
array[i++] = n2;
|
|
124
|
+
array[i++] = 0; // our addition
|
|
125
|
+
array[i++] = color;
|
|
126
|
+
// First point flipped
|
|
127
|
+
array[i++] = x1;
|
|
128
|
+
array[i++] = y1;
|
|
129
|
+
array[i++] = -n1;
|
|
130
|
+
array[i++] = -n2;
|
|
131
|
+
array[i++] = 0; // our addition
|
|
132
|
+
array[i++] = color;
|
|
133
|
+
// Second point
|
|
134
|
+
array[i++] = x2;
|
|
135
|
+
array[i++] = y2;
|
|
136
|
+
array[i++] = n1;
|
|
137
|
+
array[i++] = n2;
|
|
138
|
+
array[i++] = lineLength; // our addition
|
|
139
|
+
array[i++] = color;
|
|
140
|
+
// Second point flipped
|
|
141
|
+
array[i++] = x2;
|
|
142
|
+
array[i++] = y2;
|
|
143
|
+
array[i++] = -n1;
|
|
144
|
+
array[i++] = -n2;
|
|
145
|
+
array[i++] = lineLength; // our addition
|
|
146
|
+
array[i] = color;
|
|
147
|
+
};
|
|
148
|
+
DashedEdgeProgram.prototype.render = function (params) {
|
|
149
|
+
if (this.hasNothingToRender())
|
|
150
|
+
return;
|
|
151
|
+
var gl = this.gl;
|
|
152
|
+
var program = this.program;
|
|
153
|
+
gl.useProgram(program);
|
|
154
|
+
gl.uniformMatrix3fv(this.matrixLocation, false, params.matrix);
|
|
155
|
+
gl.uniform1f(this.sqrtZoomRatioLocation, Math.sqrt(params.ratio));
|
|
156
|
+
gl.uniform1f(this.correctionRatioLocation, params.correctionRatio);
|
|
157
|
+
// Drawing:
|
|
158
|
+
gl.drawElements(gl.TRIANGLES, this.indicesArray.length, this.indicesType, 0);
|
|
159
|
+
};
|
|
160
|
+
return DashedEdgeProgram;
|
|
161
|
+
}(edge_1.AbstractEdgeProgram));
|
|
162
|
+
exports.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,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
var edge_arrowHead_1 = __importDefault(require("./edge.arrowHead"));
|
|
22
|
+
var EdgeReversedArrowHeadProgram = /** @class */ (function (_super) {
|
|
23
|
+
__extends(EdgeReversedArrowHeadProgram, _super);
|
|
24
|
+
function EdgeReversedArrowHeadProgram() {
|
|
25
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
26
|
+
}
|
|
27
|
+
EdgeReversedArrowHeadProgram.prototype.process = function (sourceData, targetData, data, hidden, offset) {
|
|
28
|
+
_super.prototype.process.call(this, targetData, sourceData, data, hidden, offset);
|
|
29
|
+
};
|
|
30
|
+
return EdgeReversedArrowHeadProgram;
|
|
31
|
+
}(edge_arrowHead_1.default));
|
|
32
|
+
exports.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,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.clearCrossOriginForCORSIfNotSameOrigin = void 0;
|
|
4
|
+
var clearCrossOriginForCORSIfNotSameOrigin = function (img, url) {
|
|
5
|
+
if (new URL(url, window.location.href).origin !== window.location.origin) {
|
|
6
|
+
img.crossOrigin = '';
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
exports.clearCrossOriginForCORSIfNotSameOrigin = clearCrossOriginForCORSIfNotSameOrigin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var imageHelper_1 = require("./imageHelper");
|
|
4
|
+
describe('clearCrossOriginForCORSIfNotSameOrigin tests', function () {
|
|
5
|
+
var savedLocation = window.location;
|
|
6
|
+
beforeEach(function () {
|
|
7
|
+
delete window.location;
|
|
8
|
+
window.location = {
|
|
9
|
+
origin: 'http://test'
|
|
10
|
+
};
|
|
11
|
+
});
|
|
12
|
+
afterEach(function () {
|
|
13
|
+
window.location = savedLocation;
|
|
14
|
+
});
|
|
15
|
+
it('should clear crossOrigin if origin is not the same', function () {
|
|
16
|
+
var img = new Image();
|
|
17
|
+
var url = 'http://imagePath/images/123.png';
|
|
18
|
+
img.crossOrigin = 'testValue';
|
|
19
|
+
(0, imageHelper_1.clearCrossOriginForCORSIfNotSameOrigin)(img, url);
|
|
20
|
+
expect(img.crossOrigin).toBe('');
|
|
21
|
+
});
|
|
22
|
+
it('should not clear crossOrigin if origin is the same', function () {
|
|
23
|
+
var img = new Image();
|
|
24
|
+
var url = 'http://test/images/123.png';
|
|
25
|
+
img.crossOrigin = 'testValue';
|
|
26
|
+
(0, imageHelper_1.clearCrossOriginForCORSIfNotSameOrigin)(img, url);
|
|
27
|
+
expect(img.crossOrigin).toBe('testValue');
|
|
28
|
+
});
|
|
29
|
+
});
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
+
if (ar || !(i in from)) {
|
|
5
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
+
ar[i] = from[i];
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.WebGLImageLoader = void 0;
|
|
13
|
+
var imageHelper_1 = require("./helpers/imageHelper");
|
|
14
|
+
/*
|
|
15
|
+
* ImageLoader is a part of sigma/rendering/webgl/programs/node.image
|
|
16
|
+
* It loads images in one texture, which used for all nodes.
|
|
17
|
+
*/
|
|
18
|
+
var MAX_TEXTURE_SIZE = 128;
|
|
19
|
+
var WebGLImageLoader = /** @class */ (function () {
|
|
20
|
+
function WebGLImageLoader() {
|
|
21
|
+
var _this = this;
|
|
22
|
+
this.rebindTextureFns = [];
|
|
23
|
+
this.images = {};
|
|
24
|
+
this.hasReceivedImages = false;
|
|
25
|
+
this.pendingImagesFrameID = undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Helper to load an image:
|
|
28
|
+
*/
|
|
29
|
+
this.loadImage = function (id, imageSource) {
|
|
30
|
+
if (_this.images[id])
|
|
31
|
+
return;
|
|
32
|
+
var image = new Image();
|
|
33
|
+
image.addEventListener('load', function () {
|
|
34
|
+
_this.images[id] = {
|
|
35
|
+
status: 'pending',
|
|
36
|
+
image: image
|
|
37
|
+
};
|
|
38
|
+
if (typeof _this.pendingImagesFrameID !== 'number') {
|
|
39
|
+
_this.pendingImagesFrameID = requestAnimationFrame(function () { return _this.finalizePendingImages(); });
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
image.addEventListener('error', function () {
|
|
43
|
+
_this.images[id] = { status: 'error' };
|
|
44
|
+
});
|
|
45
|
+
_this.images[id] = { status: 'loading' };
|
|
46
|
+
// Load image:
|
|
47
|
+
(0, imageHelper_1.clearCrossOriginForCORSIfNotSameOrigin)(image, imageSource);
|
|
48
|
+
// add ?not-from-cache parameter for loading image not from cache
|
|
49
|
+
// because cached image does not contain cors headers
|
|
50
|
+
// https://www.hacksoft.io/blog/handle-images-cors-error-in-chrome
|
|
51
|
+
image.src = imageSource.startsWith('data:image') ? imageSource : imageSource + '?not-from-cache';
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Helper that takes all pending images and adds them into the texture:
|
|
55
|
+
*/
|
|
56
|
+
this.finalizePendingImages = function () {
|
|
57
|
+
_this.pendingImagesFrameID = undefined;
|
|
58
|
+
var pendingImages = [];
|
|
59
|
+
// List all pending images:
|
|
60
|
+
for (var id in _this.images) {
|
|
61
|
+
var state = _this.images[id];
|
|
62
|
+
if (state.status === 'pending') {
|
|
63
|
+
pendingImages.push({
|
|
64
|
+
id: id,
|
|
65
|
+
image: state.image,
|
|
66
|
+
size: Math.min(state.image.width, state.image.height) || 1
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
// Add images to texture:
|
|
71
|
+
var canvas = document.createElement('canvas');
|
|
72
|
+
var ctx = canvas.getContext('2d');
|
|
73
|
+
canvas.width = pendingImages.reduce(function (iter, _a) {
|
|
74
|
+
var size = _a.size;
|
|
75
|
+
return iter + size;
|
|
76
|
+
}, _this.hasReceivedImages ? _this.textureImage.width : 0);
|
|
77
|
+
canvas.height = Math.max.apply(Math, __spreadArray([_this.hasReceivedImages ? _this.textureImage.height : 0], pendingImages.map(function (_a) {
|
|
78
|
+
var size = _a.size;
|
|
79
|
+
return size;
|
|
80
|
+
}), false));
|
|
81
|
+
var xOffset = 0;
|
|
82
|
+
if (_this.hasReceivedImages) {
|
|
83
|
+
ctx.putImageData(_this.textureImage, 0, 0);
|
|
84
|
+
xOffset = _this.textureImage.width;
|
|
85
|
+
}
|
|
86
|
+
pendingImages.forEach(function (_a) {
|
|
87
|
+
var id = _a.id, image = _a.image, size = _a.size;
|
|
88
|
+
var imageSizeInTexture = Math.min(MAX_TEXTURE_SIZE, size);
|
|
89
|
+
// Crop image, to only keep the biggest square, centered:
|
|
90
|
+
var dx = 0, dy = 0;
|
|
91
|
+
if ((image.width || 0) > (image.height || 0)) {
|
|
92
|
+
dx = (image.width - image.height) / 2;
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
dy = (image.height - image.width) / 2;
|
|
96
|
+
}
|
|
97
|
+
ctx.drawImage(image, dx, dy, size, size, xOffset, 0, imageSizeInTexture, imageSizeInTexture);
|
|
98
|
+
// Update image state:
|
|
99
|
+
_this.images[id] = {
|
|
100
|
+
status: 'ready',
|
|
101
|
+
x: xOffset,
|
|
102
|
+
y: 0,
|
|
103
|
+
width: imageSizeInTexture,
|
|
104
|
+
height: imageSizeInTexture
|
|
105
|
+
};
|
|
106
|
+
xOffset += imageSizeInTexture;
|
|
107
|
+
});
|
|
108
|
+
_this.textureImage = ctx.getImageData(0, 0, canvas.width, canvas.height);
|
|
109
|
+
_this.hasReceivedImages = true;
|
|
110
|
+
_this.rebindTextureFns.forEach(function (fn) { return fn(); });
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
return WebGLImageLoader;
|
|
114
|
+
}());
|
|
115
|
+
exports.WebGLImageLoader = WebGLImageLoader;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AbstractNodeProgram } from 'sigma/rendering/webgl/programs/common/node';
|
|
2
|
+
import { RenderParams } from 'sigma/rendering/webgl/programs/common/program';
|
|
3
|
+
import { GraphNodeAttributes } from '../../types/graphDataTypes';
|
|
4
|
+
export declare class NodeBorderProgram extends AbstractNodeProgram {
|
|
5
|
+
borderSize: GLint;
|
|
6
|
+
inactive: GLint;
|
|
7
|
+
constructor(gl: WebGLRenderingContext);
|
|
8
|
+
bind(): void;
|
|
9
|
+
process(data: GraphNodeAttributes, hidden: boolean, offset: number): void;
|
|
10
|
+
render(params: RenderParams): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This class copies sigma/examples/custom-rendering/programs/node.border, but with a some
|
|
4
|
+
* difference: The fragment shader ("./node.border.frag.glsl") draws a transparent
|
|
5
|
+
* disc with a colored border. Size of border depends on hasBorder and highlighted props
|
|
6
|
+
*/
|
|
7
|
+
var __extends = (this && this.__extends) || (function () {
|
|
8
|
+
var extendStatics = function (d, b) {
|
|
9
|
+
extendStatics = Object.setPrototypeOf ||
|
|
10
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
11
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
12
|
+
return extendStatics(d, b);
|
|
13
|
+
};
|
|
14
|
+
return function (d, b) {
|
|
15
|
+
if (typeof b !== "function" && b !== null)
|
|
16
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
17
|
+
extendStatics(d, b);
|
|
18
|
+
function __() { this.constructor = d; }
|
|
19
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
20
|
+
};
|
|
21
|
+
})();
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
exports.NodeBorderProgram = void 0;
|
|
24
|
+
var utils_1 = require("sigma/utils");
|
|
25
|
+
var node_1 = require("sigma/rendering/webgl/programs/common/node");
|
|
26
|
+
var node_border_vert_glsl_1 = require("./shaders/node.border.vert.glsl");
|
|
27
|
+
var node_border_frag_glsl_1 = require("./shaders/node.border.frag.glsl");
|
|
28
|
+
var POINTS = 1; // number of vertices for a node
|
|
29
|
+
var ATTRIBUTES = 6; // number of attributes for one vertex
|
|
30
|
+
var NodeBorderProgram = /** @class */ (function (_super) {
|
|
31
|
+
__extends(NodeBorderProgram, _super);
|
|
32
|
+
function NodeBorderProgram(gl) {
|
|
33
|
+
var _this = _super.call(this, gl, node_border_vert_glsl_1.vertexShaderSource, node_border_frag_glsl_1.fragmentShaderSource, POINTS, ATTRIBUTES) || this;
|
|
34
|
+
// Attribute Location
|
|
35
|
+
_this.borderSize = gl.getAttribLocation(_this.program, 'a_borderSize');
|
|
36
|
+
_this.inactive = gl.getAttribLocation(_this.program, 'a_inactive');
|
|
37
|
+
_this.bind();
|
|
38
|
+
return _this;
|
|
39
|
+
}
|
|
40
|
+
NodeBorderProgram.prototype.bind = function () {
|
|
41
|
+
_super.prototype.bind.call(this);
|
|
42
|
+
var gl = this.gl;
|
|
43
|
+
gl.enableVertexAttribArray(this.borderSize);
|
|
44
|
+
gl.enableVertexAttribArray(this.inactive);
|
|
45
|
+
gl.vertexAttribPointer(this.borderSize, 1, gl.FLOAT, false, this.attributes * Float32Array.BYTES_PER_ELEMENT, 16);
|
|
46
|
+
gl.vertexAttribPointer(this.inactive, 1, gl.FLOAT, false, this.attributes * Float32Array.BYTES_PER_ELEMENT, 20);
|
|
47
|
+
};
|
|
48
|
+
NodeBorderProgram.prototype.process = function (data, hidden, offset) {
|
|
49
|
+
var array = this.array;
|
|
50
|
+
var i = offset * POINTS * ATTRIBUTES;
|
|
51
|
+
if (hidden || !data.hasBorder) {
|
|
52
|
+
// draw border only for nodes with hasBorder or not hidden
|
|
53
|
+
array[i++] = 0;
|
|
54
|
+
array[i++] = 0;
|
|
55
|
+
array[i++] = 0;
|
|
56
|
+
array[i++] = 0;
|
|
57
|
+
array[i++] = 0;
|
|
58
|
+
array[i++] = 0;
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
array[i++] = data.x; // position of center
|
|
62
|
+
array[i++] = data.y;
|
|
63
|
+
array[i++] = data.size; // size
|
|
64
|
+
array[i++] = (0, utils_1.floatColor)(data.color); // color
|
|
65
|
+
array[i++] = data.highlighted ? 4 : 2; // size of border in pixels
|
|
66
|
+
array[i] = data.inactive ? 1 : 0; // inactive flag
|
|
67
|
+
};
|
|
68
|
+
NodeBorderProgram.prototype.render = function (params) {
|
|
69
|
+
var gl = this.gl;
|
|
70
|
+
var program = this.program;
|
|
71
|
+
gl.useProgram(program);
|
|
72
|
+
gl.uniform1f(this.ratioLocation, 1 / Math.sqrt(params.ratio));
|
|
73
|
+
gl.uniform1f(this.scaleLocation, params.scalingRatio);
|
|
74
|
+
gl.uniformMatrix3fv(this.matrixLocation, false, params.matrix);
|
|
75
|
+
gl.drawArrays(gl.POINTS, 0, this.array.length / ATTRIBUTES);
|
|
76
|
+
};
|
|
77
|
+
return NodeBorderProgram;
|
|
78
|
+
}(node_1.AbstractNodeProgram));
|
|
79
|
+
exports.NodeBorderProgram = NodeBorderProgram;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AbstractNodeProgram } from 'sigma/rendering/webgl/programs/common/node';
|
|
2
|
+
import { RenderParams } from 'sigma/rendering/webgl/programs/common/program';
|
|
3
|
+
import { GraphNodeAttributes } from '../../types/graphDataTypes';
|
|
4
|
+
export declare class NodeDashedBorderProgram extends AbstractNodeProgram {
|
|
5
|
+
borderSize: GLint;
|
|
6
|
+
inactive: GLint;
|
|
7
|
+
constructor(gl: WebGLRenderingContext);
|
|
8
|
+
bind(): void;
|
|
9
|
+
process(data: GraphNodeAttributes, hidden: boolean, offset: number): void;
|
|
10
|
+
render(params: RenderParams): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This class copies our node.border program, but with another fragment shader to support dashed borders
|
|
4
|
+
*/
|
|
5
|
+
var __extends = (this && this.__extends) || (function () {
|
|
6
|
+
var extendStatics = function (d, b) {
|
|
7
|
+
extendStatics = Object.setPrototypeOf ||
|
|
8
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
9
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
10
|
+
return extendStatics(d, b);
|
|
11
|
+
};
|
|
12
|
+
return function (d, b) {
|
|
13
|
+
if (typeof b !== "function" && b !== null)
|
|
14
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
15
|
+
extendStatics(d, b);
|
|
16
|
+
function __() { this.constructor = d; }
|
|
17
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
18
|
+
};
|
|
19
|
+
})();
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.NodeDashedBorderProgram = void 0;
|
|
22
|
+
var utils_1 = require("sigma/utils");
|
|
23
|
+
var node_1 = require("sigma/rendering/webgl/programs/common/node");
|
|
24
|
+
var node_border_vert_glsl_1 = require("./shaders/node.border.vert.glsl");
|
|
25
|
+
var node_dashed_border_frag_glsl_1 = require("./shaders/node.dashed.border.frag.glsl");
|
|
26
|
+
var POINTS = 1; // number of vertices for a node
|
|
27
|
+
var ATTRIBUTES = 6; // number of attributes for one vertex
|
|
28
|
+
var NodeDashedBorderProgram = /** @class */ (function (_super) {
|
|
29
|
+
__extends(NodeDashedBorderProgram, _super);
|
|
30
|
+
function NodeDashedBorderProgram(gl) {
|
|
31
|
+
var _this = _super.call(this, gl, node_border_vert_glsl_1.vertexShaderSource, node_dashed_border_frag_glsl_1.fragmentShaderSource, POINTS, ATTRIBUTES) || this;
|
|
32
|
+
// Attribute Location
|
|
33
|
+
_this.borderSize = gl.getAttribLocation(_this.program, 'a_borderSize');
|
|
34
|
+
_this.inactive = gl.getAttribLocation(_this.program, 'a_inactive');
|
|
35
|
+
_this.bind();
|
|
36
|
+
return _this;
|
|
37
|
+
}
|
|
38
|
+
NodeDashedBorderProgram.prototype.bind = function () {
|
|
39
|
+
_super.prototype.bind.call(this);
|
|
40
|
+
var gl = this.gl;
|
|
41
|
+
gl.enableVertexAttribArray(this.borderSize);
|
|
42
|
+
gl.enableVertexAttribArray(this.inactive);
|
|
43
|
+
gl.vertexAttribPointer(this.borderSize, 1, gl.FLOAT, false, this.attributes * Float32Array.BYTES_PER_ELEMENT, 16);
|
|
44
|
+
gl.vertexAttribPointer(this.inactive, 1, gl.FLOAT, false, this.attributes * Float32Array.BYTES_PER_ELEMENT, 20);
|
|
45
|
+
};
|
|
46
|
+
NodeDashedBorderProgram.prototype.process = function (data, hidden, offset) {
|
|
47
|
+
var array = this.array;
|
|
48
|
+
var i = offset * POINTS * ATTRIBUTES;
|
|
49
|
+
if (hidden || !data.hasBorder) {
|
|
50
|
+
// draw border only for nodes with hasBorder or not hidden
|
|
51
|
+
array[i++] = 0;
|
|
52
|
+
array[i++] = 0;
|
|
53
|
+
array[i++] = 0;
|
|
54
|
+
array[i++] = 0;
|
|
55
|
+
array[i++] = 0;
|
|
56
|
+
array[i++] = 0;
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
array[i++] = data.x; // position of center
|
|
60
|
+
array[i++] = data.y;
|
|
61
|
+
array[i++] = data.size; // size
|
|
62
|
+
array[i++] = (0, utils_1.floatColor)(data.color); // color
|
|
63
|
+
array[i++] = data.highlighted ? 2 : 1; // size of border in pixels
|
|
64
|
+
array[i] = data.inactive ? 1 : 0; // inactive flag
|
|
65
|
+
};
|
|
66
|
+
NodeDashedBorderProgram.prototype.render = function (params) {
|
|
67
|
+
var gl = this.gl;
|
|
68
|
+
var program = this.program;
|
|
69
|
+
gl.useProgram(program);
|
|
70
|
+
gl.uniform1f(this.ratioLocation, 1 / Math.sqrt(params.ratio));
|
|
71
|
+
gl.uniform1f(this.scaleLocation, params.scalingRatio);
|
|
72
|
+
gl.uniformMatrix3fv(this.matrixLocation, false, params.matrix);
|
|
73
|
+
gl.drawArrays(gl.POINTS, 0, this.array.length / ATTRIBUTES);
|
|
74
|
+
};
|
|
75
|
+
return NodeDashedBorderProgram;
|
|
76
|
+
}(node_1.AbstractNodeProgram));
|
|
77
|
+
exports.NodeDashedBorderProgram = NodeDashedBorderProgram;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AbstractNodeProgram } from 'sigma/rendering/webgl/programs/common/node';
|
|
2
|
+
import { RenderParams } from 'sigma/rendering/webgl/programs/common/program';
|
|
3
|
+
import Sigma from 'sigma/sigma';
|
|
4
|
+
import { WebGLImageLoader } from './image';
|
|
5
|
+
import { GraphNodeAttributes } from '../../types/graphDataTypes';
|
|
6
|
+
export declare class NodeImageProgram extends AbstractNodeProgram {
|
|
7
|
+
imageLoader: WebGLImageLoader;
|
|
8
|
+
texture: WebGLTexture;
|
|
9
|
+
textureLocation: GLint;
|
|
10
|
+
atlasLocation: WebGLUniformLocation;
|
|
11
|
+
latestRenderParams?: RenderParams;
|
|
12
|
+
inactive: GLint;
|
|
13
|
+
constructor(gl: WebGLRenderingContext, renderer: Sigma);
|
|
14
|
+
bind(): void;
|
|
15
|
+
process(data: GraphNodeAttributes, hidden: boolean, offset: number): void;
|
|
16
|
+
render(params: RenderParams): void;
|
|
17
|
+
rebindTexture(): void;
|
|
18
|
+
}
|