@dxos/react-ui-graph 0.8.4-main.28f8d3d → 0.8.4-main.2c6827d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/{chunk-HLAKLUDC.mjs → chunk-XWA2XJDX.mjs} +119 -122
- package/dist/lib/browser/{chunk-HLAKLUDC.mjs.map → chunk-XWA2XJDX.mjs.map} +3 -3
- package/dist/lib/browser/index.mjs +4 -5
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +1 -1
- package/dist/lib/node-esm/{chunk-O6GWCXDC.mjs → chunk-3RLSFEEV.mjs} +119 -122
- package/dist/lib/node-esm/{chunk-O6GWCXDC.mjs.map → chunk-3RLSFEEV.mjs.map} +3 -3
- package/dist/lib/node-esm/index.mjs +4 -5
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +1 -1
- package/dist/types/src/components/Graph/Graph.stories.d.ts +14 -5
- package/dist/types/src/components/Graph/Graph.stories.d.ts.map +1 -1
- package/dist/types/src/components/Mesh/Mesh.stories.d.ts +9 -5
- package/dist/types/src/components/Mesh/Mesh.stories.d.ts.map +1 -1
- package/dist/types/src/components/SVG/SVG.d.ts.map +1 -1
- package/dist/types/src/components/SVG/Svg.stories.d.ts +10 -8
- package/dist/types/src/components/SVG/Svg.stories.d.ts.map +1 -1
- package/dist/types/src/fx/fx.stories.d.ts +16 -15
- package/dist/types/src/fx/fx.stories.d.ts.map +1 -1
- package/dist/types/src/stories/hooks.stories.d.ts +10 -6
- package/dist/types/src/stories/hooks.stories.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +24 -24
- package/src/components/Graph/Graph.stories.tsx +29 -32
- package/src/components/Graph/Graph.tsx +1 -1
- package/src/components/Mesh/Mesh.stories.tsx +9 -8
- package/src/components/SVG/Markers.tsx +1 -1
- package/src/components/SVG/Svg.stories.tsx +21 -17
- package/src/fx/fx.stories.tsx +13 -10
- package/src/hooks/useStateRef.ts +1 -1
- package/src/stories/hooks.stories.tsx +26 -25
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/graph/markers.ts":{"bytes":7798,"imports":[{"path":"d3","kind":"import-statement","external":true}],"format":"esm"},"src/graph/projector/graph-drag.ts":{"bytes":11603,"imports":[{"path":"d3","kind":"import-statement","external":true}],"format":"esm"},"src/graph/types.ts":{"bytes":3067,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"src/util/events.ts":{"bytes":1866,"imports":[],"format":"esm"},"src/util/fraction.ts":{"bytes":14252,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"src/util/points.ts":{"bytes":7278,"imports":[],"format":"esm"},"src/util/scale.ts":{"bytes":16023,"imports":[{"path":"d3","kind":"import-statement","external":true},{"path":"src/util/fraction.ts","kind":"import-statement","original":"./fraction"}],"format":"esm"},"src/util/screen.ts":{"bytes":8412,"imports":[],"format":"esm"},"src/util/vector.ts":{"bytes":6000,"imports":[{"path":"src/util/fraction.ts","kind":"import-statement","original":"./fraction"}],"format":"esm"},"src/util/index.ts":{"bytes":959,"imports":[{"path":"src/util/events.ts","kind":"import-statement","original":"./events"},{"path":"src/util/fraction.ts","kind":"import-statement","original":"./fraction"},{"path":"src/util/points.ts","kind":"import-statement","original":"./points"},{"path":"src/util/scale.ts","kind":"import-statement","original":"./scale"},{"path":"src/util/screen.ts","kind":"import-statement","original":"./screen"},{"path":"src/util/vector.ts","kind":"import-statement","original":"./vector"}],"format":"esm"},"src/graph/projector/projector.ts":{"bytes":4908,"imports":[{"path":"src/util/index.ts","kind":"import-statement","original":"../../util"},{"path":"src/graph/types.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/graph/projector/graph-projector.ts":{"bytes":8716,"imports":[{"path":"src/graph/types.ts","kind":"import-statement","original":"../types"},{"path":"src/graph/projector/projector.ts","kind":"import-statement","original":"./projector"}],"format":"esm"},"src/graph/projector/graph-forces.ts":{"bytes":2614,"imports":[{"path":"d3","kind":"import-statement","external":true}],"format":"esm"},"src/graph/projector/graph-force-projector.ts":{"bytes":33129,"imports":[{"path":"d3","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"src/graph/projector/graph-forces.ts","kind":"import-statement","original":"./graph-forces"},{"path":"src/graph/projector/graph-projector.ts","kind":"import-statement","original":"./graph-projector"}],"format":"esm"},"src/graph/projector/graph-radial-projector.ts":{"bytes":12893,"imports":[{"path":"d3","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"src/graph/projector/graph-projector.ts","kind":"import-statement","original":"./graph-projector"}],"format":"esm"},"src/graph/projector/graph-hierarchical-projector.ts":{"bytes":8401,"imports":[{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"src/graph/projector/graph-radial-projector.ts","kind":"import-statement","original":"./graph-radial-projector"}],"format":"esm"},"src/graph/projector/graph-relational-projector.ts":{"bytes":11835,"imports":[{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"src/graph/projector/graph-radial-projector.ts","kind":"import-statement","original":"./graph-radial-projector"}],"format":"esm"},"src/graph/projector/index.ts":{"bytes":1188,"imports":[{"path":"src/graph/projector/graph-drag.ts","kind":"import-statement","original":"./graph-drag"},{"path":"src/graph/projector/graph-projector.ts","kind":"import-statement","original":"./graph-projector"},{"path":"src/graph/projector/graph-force-projector.ts","kind":"import-statement","original":"./graph-force-projector"},{"path":"src/graph/projector/graph-hierarchical-projector.ts","kind":"import-statement","original":"./graph-hierarchical-projector"},{"path":"src/graph/projector/graph-relational-projector.ts","kind":"import-statement","original":"./graph-relational-projector"},{"path":"src/graph/projector/graph-radial-projector.ts","kind":"import-statement","original":"./graph-radial-projector"},{"path":"src/graph/projector/projector.ts","kind":"import-statement","original":"./projector"}],"format":"esm"},"src/graph/renderer/bullets.ts":{"bytes":7142,"imports":[{"path":"d3","kind":"import-statement","external":true}],"format":"esm"},"src/graph/renderer/renderer.ts":{"bytes":3478,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"src/graph/types.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/graph/renderer/graph-renderer.ts":{"bytes":47782,"imports":[{"path":"d3","kind":"import-statement","external":true},{"path":"js-clipper","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"src/util/index.ts","kind":"import-statement","original":"../../util"},{"path":"src/graph/renderer/bullets.ts","kind":"import-statement","original":"./bullets"},{"path":"src/graph/renderer/renderer.ts","kind":"import-statement","original":"./renderer"}],"format":"esm"},"src/graph/renderer/linker.ts":{"bytes":3576,"imports":[{"path":"d3","kind":"import-statement","external":true},{"path":"src/util/index.ts","kind":"import-statement","original":"../../util"}],"format":"esm"},"src/graph/renderer/index.ts":{"bytes":656,"imports":[{"path":"src/graph/renderer/graph-renderer.ts","kind":"import-statement","original":"./graph-renderer"},{"path":"src/graph/renderer/linker.ts","kind":"import-statement","original":"./linker"},{"path":"src/graph/renderer/renderer.ts","kind":"import-statement","original":"./renderer"}],"format":"esm"},"src/graph/index.ts":{"bytes":716,"imports":[{"path":"src/graph/markers.ts","kind":"import-statement","original":"./markers"},{"path":"src/graph/projector/index.ts","kind":"import-statement","original":"./projector"},{"path":"src/graph/renderer/index.ts","kind":"import-statement","original":"./renderer"},{"path":"src/graph/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/hooks/useSvgContext.ts":{"bytes":8266,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"src/util/index.ts","kind":"import-statement","original":"../util"}],"format":"esm"},"src/hooks/useGrid.ts":{"bytes":18840,"imports":[{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"src/hooks/useSvgContext.ts","kind":"import-statement","original":"./useSvgContext"}],"format":"esm"},"src/hooks/useStateRef.ts":{"bytes":5717,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/useZoom.ts":{"bytes":10285,"imports":[{"path":"d3","kind":"import-statement","external":true},{"path":"lodash.defaultsdeep","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"src/hooks/useSvgContext.ts","kind":"import-statement","original":"./useSvgContext"}],"format":"esm"},"src/hooks/index.ts":{"bytes":745,"imports":[{"path":"src/hooks/useGrid.ts","kind":"import-statement","original":"./useGrid"},{"path":"src/hooks/useStateRef.ts","kind":"import-statement","original":"./useStateRef"},{"path":"src/hooks/useSvgContext.ts","kind":"import-statement","original":"./useSvgContext"},{"path":"src/hooks/useZoom.ts","kind":"import-statement","original":"./useZoom"}],"format":"esm"},"src/components/Graph/Graph.tsx":{"bytes":12057,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@preact/signals-core","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"src/graph/index.ts","kind":"import-statement","original":"../../graph"},{"path":"src/hooks/index.ts","kind":"import-statement","original":"../../hooks"}],"format":"esm"},"src/components/Graph/index.ts":{"bytes":463,"imports":[{"path":"src/components/Graph/Graph.tsx","kind":"import-statement","original":"./Graph"}],"format":"esm"},"src/components/Mesh/Mesh.tsx":{"bytes":14497,"imports":[{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"topojson-client","kind":"import-statement","external":true},{"path":"src/hooks/index.ts","kind":"import-statement","original":"../../hooks"}],"format":"esm"},"src/components/Mesh/index.ts":{"bytes":461,"imports":[{"path":"src/components/Mesh/Mesh.tsx","kind":"import-statement","original":"./Mesh"}],"format":"esm"},"src/components/SVG/Grid.tsx":{"bytes":1952,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"src/hooks/index.ts","kind":"import-statement","original":"../../hooks"}],"format":"esm"},"src/components/SVG/Markers.tsx":{"bytes":2346,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"src/graph/index.ts","kind":"import-statement","original":"../../graph"}],"format":"esm"},"src/components/SVG/Root.tsx":{"bytes":6528,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"src/hooks/index.ts","kind":"import-statement","original":"../../hooks"}],"format":"esm"},"src/components/SVG/Zoom.tsx":{"bytes":2520,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"src/hooks/index.ts","kind":"import-statement","original":"../../hooks"}],"format":"esm"},"src/components/SVG/SVG.tsx":{"bytes":2070,"imports":[{"path":"src/components/Graph/index.ts","kind":"import-statement","original":"../Graph"},{"path":"src/components/Mesh/index.ts","kind":"import-statement","original":"../Mesh"},{"path":"src/components/SVG/Grid.tsx","kind":"import-statement","original":"./Grid"},{"path":"src/components/SVG/Markers.tsx","kind":"import-statement","original":"./Markers"},{"path":"src/components/SVG/Root.tsx","kind":"import-statement","original":"./Root"},{"path":"src/components/SVG/Zoom.tsx","kind":"import-statement","original":"./Zoom"}],"format":"esm"},"src/components/SVG/index.ts":{"bytes":459,"imports":[{"path":"src/components/SVG/SVG.tsx","kind":"import-statement","original":"./SVG"}],"format":"esm"},"src/components/index.ts":{"bytes":612,"imports":[{"path":"src/components/Graph/index.ts","kind":"import-statement","original":"./Graph"},{"path":"src/components/Mesh/index.ts","kind":"import-statement","original":"./Mesh"},{"path":"src/components/SVG/index.ts","kind":"import-statement","original":"./SVG"}],"format":"esm"},"src/fx/pulsar.ts":{"bytes":5171,"imports":[{"path":"d3","kind":"import-statement","external":true}],"format":"esm"},"src/fx/index.ts":{"bytes":454,"imports":[{"path":"src/fx/pulsar.ts","kind":"import-statement","original":"./pulsar"}],"format":"esm"},"src/index.ts":{"bytes":775,"imports":[{"path":"src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"src/fx/index.ts","kind":"import-statement","original":"./fx"},{"path":"src/graph/index.ts","kind":"import-statement","original":"./graph"},{"path":"src/hooks/index.ts","kind":"import-statement","original":"./hooks"},{"path":"src/util/index.ts","kind":"import-statement","original":"./util"}],"format":"esm"},"src/testing/data.ts":{"bytes":9481,"imports":[{"path":"@dxos/random","kind":"import-statement","external":true}],"format":"esm"},"src/testing/hooks.ts":{"bytes":8048,"imports":[{"path":"immutability-helper","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true},{"path":"src/hooks/index.ts","kind":"import-statement","original":"../hooks"},{"path":"src/testing/data.ts","kind":"import-statement","original":"./data"}],"format":"esm"},"src/testing/model.ts":{"bytes":2997,"imports":[{"path":"@dxos/graph","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true},{"path":"src/testing/data.ts","kind":"import-statement","original":"./data"}],"format":"esm"},"src/testing/index.ts":{"bytes":615,"imports":[{"path":"src/testing/data.ts","kind":"import-statement","original":"./data"},{"path":"src/testing/hooks.ts","kind":"import-statement","original":"./hooks"},{"path":"src/testing/model.ts","kind":"import-statement","original":"./model"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":110070},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-HLAKLUDC.mjs","kind":"import-statement"},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@preact/signals-core","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"js-clipper","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"topojson-client","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true}],"exports":["EventEmitter","FractionUtil","Graph","GraphForceProjector","GraphHierarchicalProjector","GraphInner","GraphProjector","GraphRadialProjector","GraphRelationalProjector","GraphRenderer","GridController","Mesh","Projector","Pulsar","Renderer","SVG","SVGContext","SVGContextProvider","Scale","Screen","Vector","ZoomHandler","createGraphDrag","createMarkers","defaultForceOptions","defaultIdAccessor","emptyGraph","getCircumferencePoints","layoutHorizontal","layoutRadial","layoutVertical","linkerRenderer","normal","offsetPoints","updateNode","useDynamicRef","useGrid","useStateRef","useSvgContext","useTimestamp","useZoom"],"entryPoint":"src/index.ts","inputs":{"src/components/Graph/Graph.tsx":{"bytesInOutput":2792},"src/graph/markers.ts":{"bytesInOutput":1529},"src/graph/index.ts":{"bytesInOutput":0},"src/graph/projector/graph-drag.ts":{"bytesInOutput":2284},"src/graph/projector/index.ts":{"bytesInOutput":0},"src/graph/types.ts":{"bytesInOutput":357},"src/graph/projector/projector.ts":{"bytesInOutput":820},"src/graph/projector/graph-projector.ts":{"bytesInOutput":1681},"src/graph/projector/graph-force-projector.ts":{"bytesInOutput":6113},"src/graph/projector/graph-forces.ts":{"bytesInOutput":419},"src/graph/projector/graph-hierarchical-projector.ts":{"bytesInOutput":1834},"src/graph/projector/graph-radial-projector.ts":{"bytesInOutput":2636},"src/graph/projector/graph-relational-projector.ts":{"bytesInOutput":2611},"src/graph/renderer/graph-renderer.ts":{"bytesInOutput":9670},"src/graph/renderer/bullets.ts":{"bytesInOutput":1267},"src/graph/renderer/renderer.ts":{"bytesInOutput":766},"src/graph/renderer/index.ts":{"bytesInOutput":0},"src/graph/renderer/linker.ts":{"bytesInOutput":612},"src/components/Graph/index.ts":{"bytesInOutput":0},"src/components/index.ts":{"bytesInOutput":0},"src/components/Mesh/Mesh.tsx":{"bytesInOutput":3105},"src/components/Mesh/index.ts":{"bytesInOutput":0},"src/components/SVG/Grid.tsx":{"bytesInOutput":435},"src/components/SVG/Markers.tsx":{"bytesInOutput":569},"src/components/SVG/Root.tsx":{"bytesInOutput":1693},"src/components/SVG/Zoom.tsx":{"bytesInOutput":534},"src/components/SVG/SVG.tsx":{"bytesInOutput":66},"src/components/SVG/index.ts":{"bytesInOutput":0},"src/index.ts":{"bytesInOutput":0},"src/fx/pulsar.ts":{"bytesInOutput":1117},"src/fx/index.ts":{"bytesInOutput":0}},"bytes":44916},"dist/lib/browser/testing/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":10596},"dist/lib/browser/testing/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-HLAKLUDC.mjs","kind":"import-statement"},{"path":"@dxos/random","kind":"import-statement","external":true},{"path":"immutability-helper","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true},{"path":"@dxos/graph","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true}],"exports":["TestGraphModel","convertTreeToGraph","createEdge","createGraph","createNode","createNodes","createTree","seed","useGraphGenerator","useObjectMutator"],"entryPoint":"src/testing/index.ts","inputs":{"src/testing/data.ts":{"bytesInOutput":1836},"src/testing/index.ts":{"bytesInOutput":0},"src/testing/hooks.ts":{"bytesInOutput":1632},"src/testing/model.ts":{"bytesInOutput":548}},"bytes":4352},"dist/lib/browser/chunk-HLAKLUDC.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":47637},"dist/lib/browser/chunk-HLAKLUDC.mjs":{"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"lodash.defaultsdeep","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["EventEmitter","FractionUtil","GridController","SVGContext","SVGContextProvider","Scale","Screen","Vector","ZoomHandler","getCircumferencePoints","normal","offsetPoints","useDynamicRef","useGrid","useStateRef","useSvgContext","useTimestamp","useZoom"],"inputs":{"src/util/events.ts":{"bytesInOutput":301},"src/util/fraction.ts":{"bytesInOutput":3615},"src/util/points.ts":{"bytesInOutput":1312},"src/util/scale.ts":{"bytesInOutput":3948},"src/util/screen.ts":{"bytesInOutput":1839},"src/util/vector.ts":{"bytesInOutput":1366},"src/util/index.ts":{"bytesInOutput":0},"src/hooks/useSvgContext.ts":{"bytesInOutput":1591},"src/hooks/useGrid.ts":{"bytesInOutput":4066},"src/hooks/useStateRef.ts":{"bytesInOutput":955},"src/hooks/useZoom.ts":{"bytesInOutput":2082},"src/hooks/index.ts":{"bytesInOutput":0}},"bytes":21648}}}
|
|
1
|
+
{"inputs":{"src/graph/markers.ts":{"bytes":7798,"imports":[{"path":"d3","kind":"import-statement","external":true}],"format":"esm"},"src/graph/projector/graph-drag.ts":{"bytes":11603,"imports":[{"path":"d3","kind":"import-statement","external":true}],"format":"esm"},"src/graph/types.ts":{"bytes":3067,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"src/util/events.ts":{"bytes":1866,"imports":[],"format":"esm"},"src/util/fraction.ts":{"bytes":14252,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"src/util/points.ts":{"bytes":7278,"imports":[],"format":"esm"},"src/util/scale.ts":{"bytes":15450,"imports":[{"path":"d3","kind":"import-statement","external":true},{"path":"src/util/fraction.ts","kind":"import-statement","original":"./fraction"}],"format":"esm"},"src/util/screen.ts":{"bytes":8412,"imports":[],"format":"esm"},"src/util/vector.ts":{"bytes":6000,"imports":[{"path":"src/util/fraction.ts","kind":"import-statement","original":"./fraction"}],"format":"esm"},"src/util/index.ts":{"bytes":959,"imports":[{"path":"src/util/events.ts","kind":"import-statement","original":"./events"},{"path":"src/util/fraction.ts","kind":"import-statement","original":"./fraction"},{"path":"src/util/points.ts","kind":"import-statement","original":"./points"},{"path":"src/util/scale.ts","kind":"import-statement","original":"./scale"},{"path":"src/util/screen.ts","kind":"import-statement","original":"./screen"},{"path":"src/util/vector.ts","kind":"import-statement","original":"./vector"}],"format":"esm"},"src/graph/projector/projector.ts":{"bytes":4878,"imports":[{"path":"src/util/index.ts","kind":"import-statement","original":"../../util"},{"path":"src/graph/types.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/graph/projector/graph-projector.ts":{"bytes":8716,"imports":[{"path":"src/graph/types.ts","kind":"import-statement","original":"../types"},{"path":"src/graph/projector/projector.ts","kind":"import-statement","original":"./projector"}],"format":"esm"},"src/graph/projector/graph-forces.ts":{"bytes":2614,"imports":[{"path":"d3","kind":"import-statement","external":true}],"format":"esm"},"src/graph/projector/graph-force-projector.ts":{"bytes":33129,"imports":[{"path":"d3","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"src/graph/projector/graph-forces.ts","kind":"import-statement","original":"./graph-forces"},{"path":"src/graph/projector/graph-projector.ts","kind":"import-statement","original":"./graph-projector"}],"format":"esm"},"src/graph/projector/graph-radial-projector.ts":{"bytes":12893,"imports":[{"path":"d3","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"src/graph/projector/graph-projector.ts","kind":"import-statement","original":"./graph-projector"}],"format":"esm"},"src/graph/projector/graph-hierarchical-projector.ts":{"bytes":8401,"imports":[{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"src/graph/projector/graph-radial-projector.ts","kind":"import-statement","original":"./graph-radial-projector"}],"format":"esm"},"src/graph/projector/graph-relational-projector.ts":{"bytes":11835,"imports":[{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"src/graph/projector/graph-radial-projector.ts","kind":"import-statement","original":"./graph-radial-projector"}],"format":"esm"},"src/graph/projector/index.ts":{"bytes":1188,"imports":[{"path":"src/graph/projector/graph-drag.ts","kind":"import-statement","original":"./graph-drag"},{"path":"src/graph/projector/graph-projector.ts","kind":"import-statement","original":"./graph-projector"},{"path":"src/graph/projector/graph-force-projector.ts","kind":"import-statement","original":"./graph-force-projector"},{"path":"src/graph/projector/graph-hierarchical-projector.ts","kind":"import-statement","original":"./graph-hierarchical-projector"},{"path":"src/graph/projector/graph-relational-projector.ts","kind":"import-statement","original":"./graph-relational-projector"},{"path":"src/graph/projector/graph-radial-projector.ts","kind":"import-statement","original":"./graph-radial-projector"},{"path":"src/graph/projector/projector.ts","kind":"import-statement","original":"./projector"}],"format":"esm"},"src/graph/renderer/bullets.ts":{"bytes":7142,"imports":[{"path":"d3","kind":"import-statement","external":true}],"format":"esm"},"src/graph/renderer/renderer.ts":{"bytes":3478,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"src/graph/types.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/graph/renderer/graph-renderer.ts":{"bytes":47782,"imports":[{"path":"d3","kind":"import-statement","external":true},{"path":"js-clipper","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"src/util/index.ts","kind":"import-statement","original":"../../util"},{"path":"src/graph/renderer/bullets.ts","kind":"import-statement","original":"./bullets"},{"path":"src/graph/renderer/renderer.ts","kind":"import-statement","original":"./renderer"}],"format":"esm"},"src/graph/renderer/linker.ts":{"bytes":3576,"imports":[{"path":"d3","kind":"import-statement","external":true},{"path":"src/util/index.ts","kind":"import-statement","original":"../../util"}],"format":"esm"},"src/graph/renderer/index.ts":{"bytes":656,"imports":[{"path":"src/graph/renderer/graph-renderer.ts","kind":"import-statement","original":"./graph-renderer"},{"path":"src/graph/renderer/linker.ts","kind":"import-statement","original":"./linker"},{"path":"src/graph/renderer/renderer.ts","kind":"import-statement","original":"./renderer"}],"format":"esm"},"src/graph/index.ts":{"bytes":716,"imports":[{"path":"src/graph/markers.ts","kind":"import-statement","original":"./markers"},{"path":"src/graph/projector/index.ts","kind":"import-statement","original":"./projector"},{"path":"src/graph/renderer/index.ts","kind":"import-statement","original":"./renderer"},{"path":"src/graph/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/hooks/useSvgContext.ts":{"bytes":8266,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"src/util/index.ts","kind":"import-statement","original":"../util"}],"format":"esm"},"src/hooks/useGrid.ts":{"bytes":18809,"imports":[{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"src/hooks/useSvgContext.ts","kind":"import-statement","original":"./useSvgContext"}],"format":"esm"},"src/hooks/useStateRef.ts":{"bytes":5733,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/useZoom.ts":{"bytes":10285,"imports":[{"path":"d3","kind":"import-statement","external":true},{"path":"lodash.defaultsdeep","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"src/hooks/useSvgContext.ts","kind":"import-statement","original":"./useSvgContext"}],"format":"esm"},"src/hooks/index.ts":{"bytes":745,"imports":[{"path":"src/hooks/useGrid.ts","kind":"import-statement","original":"./useGrid"},{"path":"src/hooks/useStateRef.ts","kind":"import-statement","original":"./useStateRef"},{"path":"src/hooks/useSvgContext.ts","kind":"import-statement","original":"./useSvgContext"},{"path":"src/hooks/useZoom.ts","kind":"import-statement","original":"./useZoom"}],"format":"esm"},"src/components/Graph/Graph.tsx":{"bytes":12073,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@preact/signals-core","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"src/graph/index.ts","kind":"import-statement","original":"../../graph"},{"path":"src/hooks/index.ts","kind":"import-statement","original":"../../hooks"}],"format":"esm"},"src/components/Graph/index.ts":{"bytes":463,"imports":[{"path":"src/components/Graph/Graph.tsx","kind":"import-statement","original":"./Graph"}],"format":"esm"},"src/components/Mesh/Mesh.tsx":{"bytes":14497,"imports":[{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"topojson-client","kind":"import-statement","external":true},{"path":"src/hooks/index.ts","kind":"import-statement","original":"../../hooks"}],"format":"esm"},"src/components/Mesh/index.ts":{"bytes":461,"imports":[{"path":"src/components/Mesh/Mesh.tsx","kind":"import-statement","original":"./Mesh"}],"format":"esm"},"src/components/SVG/Grid.tsx":{"bytes":1952,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"src/hooks/index.ts","kind":"import-statement","original":"../../hooks"}],"format":"esm"},"src/components/SVG/Markers.tsx":{"bytes":2362,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"src/graph/index.ts","kind":"import-statement","original":"../../graph"}],"format":"esm"},"src/components/SVG/Root.tsx":{"bytes":6528,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"src/hooks/index.ts","kind":"import-statement","original":"../../hooks"}],"format":"esm"},"src/components/SVG/Zoom.tsx":{"bytes":2520,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"src/hooks/index.ts","kind":"import-statement","original":"../../hooks"}],"format":"esm"},"src/components/SVG/SVG.tsx":{"bytes":2070,"imports":[{"path":"src/components/Graph/index.ts","kind":"import-statement","original":"../Graph"},{"path":"src/components/Mesh/index.ts","kind":"import-statement","original":"../Mesh"},{"path":"src/components/SVG/Grid.tsx","kind":"import-statement","original":"./Grid"},{"path":"src/components/SVG/Markers.tsx","kind":"import-statement","original":"./Markers"},{"path":"src/components/SVG/Root.tsx","kind":"import-statement","original":"./Root"},{"path":"src/components/SVG/Zoom.tsx","kind":"import-statement","original":"./Zoom"}],"format":"esm"},"src/components/SVG/index.ts":{"bytes":459,"imports":[{"path":"src/components/SVG/SVG.tsx","kind":"import-statement","original":"./SVG"}],"format":"esm"},"src/components/index.ts":{"bytes":612,"imports":[{"path":"src/components/Graph/index.ts","kind":"import-statement","original":"./Graph"},{"path":"src/components/Mesh/index.ts","kind":"import-statement","original":"./Mesh"},{"path":"src/components/SVG/index.ts","kind":"import-statement","original":"./SVG"}],"format":"esm"},"src/fx/pulsar.ts":{"bytes":5171,"imports":[{"path":"d3","kind":"import-statement","external":true}],"format":"esm"},"src/fx/index.ts":{"bytes":454,"imports":[{"path":"src/fx/pulsar.ts","kind":"import-statement","original":"./pulsar"}],"format":"esm"},"src/index.ts":{"bytes":775,"imports":[{"path":"src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"src/fx/index.ts","kind":"import-statement","original":"./fx"},{"path":"src/graph/index.ts","kind":"import-statement","original":"./graph"},{"path":"src/hooks/index.ts","kind":"import-statement","original":"./hooks"},{"path":"src/util/index.ts","kind":"import-statement","original":"./util"}],"format":"esm"},"src/testing/data.ts":{"bytes":9481,"imports":[{"path":"@dxos/random","kind":"import-statement","external":true}],"format":"esm"},"src/testing/hooks.ts":{"bytes":8048,"imports":[{"path":"immutability-helper","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true},{"path":"src/hooks/index.ts","kind":"import-statement","original":"../hooks"},{"path":"src/testing/data.ts","kind":"import-statement","original":"./data"}],"format":"esm"},"src/testing/model.ts":{"bytes":2997,"imports":[{"path":"@dxos/graph","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true},{"path":"src/testing/data.ts","kind":"import-statement","original":"./data"}],"format":"esm"},"src/testing/index.ts":{"bytes":615,"imports":[{"path":"src/testing/data.ts","kind":"import-statement","original":"./data"},{"path":"src/testing/hooks.ts","kind":"import-statement","original":"./hooks"},{"path":"src/testing/model.ts","kind":"import-statement","original":"./model"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":110082},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-XWA2XJDX.mjs","kind":"import-statement"},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@preact/signals-core","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"js-clipper","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"topojson-client","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true}],"exports":["EventEmitter","FractionUtil","Graph","GraphForceProjector","GraphHierarchicalProjector","GraphInner","GraphProjector","GraphRadialProjector","GraphRelationalProjector","GraphRenderer","GridController","Mesh","Projector","Pulsar","Renderer","SVG","SVGContext","SVGContextProvider","Scale","Screen","Vector","ZoomHandler","createGraphDrag","createMarkers","defaultForceOptions","defaultIdAccessor","emptyGraph","getCircumferencePoints","layoutHorizontal","layoutRadial","layoutVertical","linkerRenderer","normal","offsetPoints","updateNode","useDynamicRef","useGrid","useStateRef","useSvgContext","useTimestamp","useZoom"],"entryPoint":"src/index.ts","inputs":{"src/components/Graph/Graph.tsx":{"bytesInOutput":2796},"src/graph/markers.ts":{"bytesInOutput":1529},"src/graph/index.ts":{"bytesInOutput":0},"src/graph/projector/graph-drag.ts":{"bytesInOutput":2284},"src/graph/projector/index.ts":{"bytesInOutput":0},"src/graph/types.ts":{"bytesInOutput":357},"src/graph/projector/projector.ts":{"bytesInOutput":802},"src/graph/projector/graph-projector.ts":{"bytesInOutput":1681},"src/graph/projector/graph-force-projector.ts":{"bytesInOutput":6113},"src/graph/projector/graph-forces.ts":{"bytesInOutput":419},"src/graph/projector/graph-hierarchical-projector.ts":{"bytesInOutput":1834},"src/graph/projector/graph-radial-projector.ts":{"bytesInOutput":2636},"src/graph/projector/graph-relational-projector.ts":{"bytesInOutput":2611},"src/graph/renderer/graph-renderer.ts":{"bytesInOutput":9670},"src/graph/renderer/bullets.ts":{"bytesInOutput":1267},"src/graph/renderer/renderer.ts":{"bytesInOutput":766},"src/graph/renderer/index.ts":{"bytesInOutput":0},"src/graph/renderer/linker.ts":{"bytesInOutput":612},"src/components/Graph/index.ts":{"bytesInOutput":0},"src/components/index.ts":{"bytesInOutput":0},"src/components/Mesh/Mesh.tsx":{"bytesInOutput":3105},"src/components/Mesh/index.ts":{"bytesInOutput":0},"src/components/SVG/Grid.tsx":{"bytesInOutput":435},"src/components/SVG/Markers.tsx":{"bytesInOutput":573},"src/components/SVG/Root.tsx":{"bytesInOutput":1693},"src/components/SVG/Zoom.tsx":{"bytesInOutput":534},"src/components/SVG/SVG.tsx":{"bytesInOutput":66},"src/components/SVG/index.ts":{"bytesInOutput":0},"src/index.ts":{"bytesInOutput":0},"src/fx/pulsar.ts":{"bytesInOutput":1117},"src/fx/index.ts":{"bytesInOutput":0}},"bytes":44906},"dist/lib/browser/testing/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":10596},"dist/lib/browser/testing/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-XWA2XJDX.mjs","kind":"import-statement"},{"path":"@dxos/random","kind":"import-statement","external":true},{"path":"immutability-helper","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true},{"path":"@dxos/graph","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true}],"exports":["TestGraphModel","convertTreeToGraph","createEdge","createGraph","createNode","createNodes","createTree","seed","useGraphGenerator","useObjectMutator"],"entryPoint":"src/testing/index.ts","inputs":{"src/testing/data.ts":{"bytesInOutput":1836},"src/testing/index.ts":{"bytesInOutput":0},"src/testing/hooks.ts":{"bytesInOutput":1632},"src/testing/model.ts":{"bytesInOutput":548}},"bytes":4352},"dist/lib/browser/chunk-XWA2XJDX.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":47616},"dist/lib/browser/chunk-XWA2XJDX.mjs":{"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"lodash.defaultsdeep","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["EventEmitter","FractionUtil","GridController","SVGContext","SVGContextProvider","Scale","Screen","Vector","ZoomHandler","getCircumferencePoints","normal","offsetPoints","useDynamicRef","useGrid","useStateRef","useSvgContext","useTimestamp","useZoom"],"inputs":{"src/util/events.ts":{"bytesInOutput":301},"src/util/fraction.ts":{"bytesInOutput":3615},"src/util/points.ts":{"bytesInOutput":1312},"src/util/scale.ts":{"bytesInOutput":3687},"src/util/screen.ts":{"bytesInOutput":1839},"src/util/vector.ts":{"bytesInOutput":1366},"src/util/index.ts":{"bytesInOutput":0},"src/hooks/useSvgContext.ts":{"bytesInOutput":1591},"src/hooks/useGrid.ts":{"bytesInOutput":4047},"src/hooks/useStateRef.ts":{"bytesInOutput":959},"src/hooks/useZoom.ts":{"bytesInOutput":2082},"src/hooks/index.ts":{"bytesInOutput":0}},"bytes":21372}}}
|
|
@@ -270,122 +270,6 @@ var Scale = class {
|
|
|
270
270
|
_transform;
|
|
271
271
|
constructor(_gridSize = 32) {
|
|
272
272
|
this._gridSize = _gridSize;
|
|
273
|
-
this.model = {
|
|
274
|
-
// TODO(burdon): Precision depends on scale.
|
|
275
|
-
snapValues: (array) => array.map((n) => FractionUtil.round(n)),
|
|
276
|
-
snapVertex: ({ x, y }) => {
|
|
277
|
-
const [sx, sy] = this.model.snapValues([
|
|
278
|
-
x,
|
|
279
|
-
y
|
|
280
|
-
]);
|
|
281
|
-
return {
|
|
282
|
-
x: sx,
|
|
283
|
-
y: sy
|
|
284
|
-
};
|
|
285
|
-
},
|
|
286
|
-
snapBounds: ({ x, y, width, height }) => {
|
|
287
|
-
[x, y, width, height] = this.model.snapValues([
|
|
288
|
-
x,
|
|
289
|
-
y,
|
|
290
|
-
width,
|
|
291
|
-
height
|
|
292
|
-
]);
|
|
293
|
-
return {
|
|
294
|
-
x,
|
|
295
|
-
y,
|
|
296
|
-
width,
|
|
297
|
-
height
|
|
298
|
-
};
|
|
299
|
-
},
|
|
300
|
-
toValue: (value) => {
|
|
301
|
-
return Math.round(FractionUtil.toNumber(value) * this._gridSize);
|
|
302
|
-
},
|
|
303
|
-
toValues: (values) => {
|
|
304
|
-
return values.map((value) => Math.round(FractionUtil.toNumber(value) * this._gridSize));
|
|
305
|
-
},
|
|
306
|
-
toPoint: (point) => {
|
|
307
|
-
const [x, y] = this.model.toValues([
|
|
308
|
-
point.x,
|
|
309
|
-
point.y
|
|
310
|
-
]);
|
|
311
|
-
return [
|
|
312
|
-
x,
|
|
313
|
-
y === 0 ? 0 : -y
|
|
314
|
-
];
|
|
315
|
-
},
|
|
316
|
-
toBounds: ({ x, y, width, height }) => {
|
|
317
|
-
const point = this.model.toPoint({
|
|
318
|
-
x,
|
|
319
|
-
y
|
|
320
|
-
});
|
|
321
|
-
const [width2, height2] = this.model.toValues([
|
|
322
|
-
width,
|
|
323
|
-
height
|
|
324
|
-
]);
|
|
325
|
-
return {
|
|
326
|
-
x: point[0],
|
|
327
|
-
y: point[1] - height2,
|
|
328
|
-
width: width2,
|
|
329
|
-
height: height2
|
|
330
|
-
};
|
|
331
|
-
}
|
|
332
|
-
};
|
|
333
|
-
this.screen = {
|
|
334
|
-
snapValues: (array) => array.map((n) => Math.round(n / this._gridSize) * this._gridSize),
|
|
335
|
-
snapPoint: ([x, y]) => [
|
|
336
|
-
x,
|
|
337
|
-
y
|
|
338
|
-
].map((n) => Math.round(n / this._gridSize) * this._gridSize),
|
|
339
|
-
snapBounds: ({ x, y, width, height }) => {
|
|
340
|
-
[x, y, width, height] = this.screen.snapValues([
|
|
341
|
-
x,
|
|
342
|
-
y,
|
|
343
|
-
width,
|
|
344
|
-
height
|
|
345
|
-
]);
|
|
346
|
-
return {
|
|
347
|
-
x,
|
|
348
|
-
y,
|
|
349
|
-
width,
|
|
350
|
-
height
|
|
351
|
-
};
|
|
352
|
-
},
|
|
353
|
-
toValue: (value) => {
|
|
354
|
-
return FractionUtil.divide(FractionUtil.toFraction(value), [
|
|
355
|
-
this._gridSize,
|
|
356
|
-
1
|
|
357
|
-
]);
|
|
358
|
-
},
|
|
359
|
-
toValues: (values) => {
|
|
360
|
-
return values.map((value) => FractionUtil.divide(FractionUtil.toFraction(value), [
|
|
361
|
-
this._gridSize,
|
|
362
|
-
1
|
|
363
|
-
]));
|
|
364
|
-
},
|
|
365
|
-
toVertex: (point) => {
|
|
366
|
-
const [x, y] = point;
|
|
367
|
-
return {
|
|
368
|
-
x: FractionUtil.toFraction(x / this._gridSize),
|
|
369
|
-
y: FractionUtil.toFraction(-y / this._gridSize)
|
|
370
|
-
};
|
|
371
|
-
},
|
|
372
|
-
toBounds: (bounds) => {
|
|
373
|
-
const { x, y } = this.screen.toVertex([
|
|
374
|
-
bounds.x,
|
|
375
|
-
bounds.y
|
|
376
|
-
]);
|
|
377
|
-
const [width, height] = this.screen.toValues([
|
|
378
|
-
bounds.width,
|
|
379
|
-
bounds.height
|
|
380
|
-
]);
|
|
381
|
-
return {
|
|
382
|
-
x,
|
|
383
|
-
y: FractionUtil.subtract(y, height),
|
|
384
|
-
width,
|
|
385
|
-
height
|
|
386
|
-
};
|
|
387
|
-
}
|
|
388
|
-
};
|
|
389
273
|
}
|
|
390
274
|
get gridSize() {
|
|
391
275
|
return this._gridSize;
|
|
@@ -419,12 +303,126 @@ var Scale = class {
|
|
|
419
303
|
* Map model to screen.
|
|
420
304
|
* Model points are represented by fractions (to preserve precision) and use normal cartesian coordinates.
|
|
421
305
|
*/
|
|
422
|
-
model
|
|
306
|
+
model = {
|
|
307
|
+
// TODO(burdon): Precision depends on scale.
|
|
308
|
+
snapValues: (array) => array.map((n) => FractionUtil.round(n)),
|
|
309
|
+
snapVertex: ({ x, y }) => {
|
|
310
|
+
const [sx, sy] = this.model.snapValues([
|
|
311
|
+
x,
|
|
312
|
+
y
|
|
313
|
+
]);
|
|
314
|
+
return {
|
|
315
|
+
x: sx,
|
|
316
|
+
y: sy
|
|
317
|
+
};
|
|
318
|
+
},
|
|
319
|
+
snapBounds: ({ x, y, width, height }) => {
|
|
320
|
+
[x, y, width, height] = this.model.snapValues([
|
|
321
|
+
x,
|
|
322
|
+
y,
|
|
323
|
+
width,
|
|
324
|
+
height
|
|
325
|
+
]);
|
|
326
|
+
return {
|
|
327
|
+
x,
|
|
328
|
+
y,
|
|
329
|
+
width,
|
|
330
|
+
height
|
|
331
|
+
};
|
|
332
|
+
},
|
|
333
|
+
toValue: (value) => {
|
|
334
|
+
return Math.round(FractionUtil.toNumber(value) * this._gridSize);
|
|
335
|
+
},
|
|
336
|
+
toValues: (values) => {
|
|
337
|
+
return values.map((value) => Math.round(FractionUtil.toNumber(value) * this._gridSize));
|
|
338
|
+
},
|
|
339
|
+
toPoint: (point) => {
|
|
340
|
+
const [x, y] = this.model.toValues([
|
|
341
|
+
point.x,
|
|
342
|
+
point.y
|
|
343
|
+
]);
|
|
344
|
+
return [
|
|
345
|
+
x,
|
|
346
|
+
y === 0 ? 0 : -y
|
|
347
|
+
];
|
|
348
|
+
},
|
|
349
|
+
toBounds: ({ x, y, width, height }) => {
|
|
350
|
+
const point = this.model.toPoint({
|
|
351
|
+
x,
|
|
352
|
+
y
|
|
353
|
+
});
|
|
354
|
+
const [width2, height2] = this.model.toValues([
|
|
355
|
+
width,
|
|
356
|
+
height
|
|
357
|
+
]);
|
|
358
|
+
return {
|
|
359
|
+
x: point[0],
|
|
360
|
+
y: point[1] - height2,
|
|
361
|
+
width: width2,
|
|
362
|
+
height: height2
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
};
|
|
423
366
|
/**
|
|
424
367
|
* Map screen to model.
|
|
425
368
|
* Screen points are represented by floating numbers and use translated SVG coordinates (with the y-axis inverted).
|
|
426
369
|
*/
|
|
427
|
-
screen
|
|
370
|
+
screen = {
|
|
371
|
+
snapValues: (array) => array.map((n) => Math.round(n / this._gridSize) * this._gridSize),
|
|
372
|
+
snapPoint: ([x, y]) => [
|
|
373
|
+
x,
|
|
374
|
+
y
|
|
375
|
+
].map((n) => Math.round(n / this._gridSize) * this._gridSize),
|
|
376
|
+
snapBounds: ({ x, y, width, height }) => {
|
|
377
|
+
[x, y, width, height] = this.screen.snapValues([
|
|
378
|
+
x,
|
|
379
|
+
y,
|
|
380
|
+
width,
|
|
381
|
+
height
|
|
382
|
+
]);
|
|
383
|
+
return {
|
|
384
|
+
x,
|
|
385
|
+
y,
|
|
386
|
+
width,
|
|
387
|
+
height
|
|
388
|
+
};
|
|
389
|
+
},
|
|
390
|
+
toValue: (value) => {
|
|
391
|
+
return FractionUtil.divide(FractionUtil.toFraction(value), [
|
|
392
|
+
this._gridSize,
|
|
393
|
+
1
|
|
394
|
+
]);
|
|
395
|
+
},
|
|
396
|
+
toValues: (values) => {
|
|
397
|
+
return values.map((value) => FractionUtil.divide(FractionUtil.toFraction(value), [
|
|
398
|
+
this._gridSize,
|
|
399
|
+
1
|
|
400
|
+
]));
|
|
401
|
+
},
|
|
402
|
+
toVertex: (point) => {
|
|
403
|
+
const [x, y] = point;
|
|
404
|
+
return {
|
|
405
|
+
x: FractionUtil.toFraction(x / this._gridSize),
|
|
406
|
+
y: FractionUtil.toFraction(-y / this._gridSize)
|
|
407
|
+
};
|
|
408
|
+
},
|
|
409
|
+
toBounds: (bounds) => {
|
|
410
|
+
const { x, y } = this.screen.toVertex([
|
|
411
|
+
bounds.x,
|
|
412
|
+
bounds.y
|
|
413
|
+
]);
|
|
414
|
+
const [width, height] = this.screen.toValues([
|
|
415
|
+
bounds.width,
|
|
416
|
+
bounds.height
|
|
417
|
+
]);
|
|
418
|
+
return {
|
|
419
|
+
x,
|
|
420
|
+
y: FractionUtil.subtract(y, height),
|
|
421
|
+
width,
|
|
422
|
+
height
|
|
423
|
+
};
|
|
424
|
+
}
|
|
425
|
+
};
|
|
428
426
|
};
|
|
429
427
|
|
|
430
428
|
// src/util/screen.ts
|
|
@@ -766,12 +764,11 @@ var GridController = class {
|
|
|
766
764
|
_ref;
|
|
767
765
|
_context;
|
|
768
766
|
_options;
|
|
769
|
-
_visible;
|
|
767
|
+
_visible = false;
|
|
770
768
|
constructor(_ref, _context, _options) {
|
|
771
769
|
this._ref = _ref;
|
|
772
770
|
this._context = _context;
|
|
773
771
|
this._options = _options;
|
|
774
|
-
this._visible = false;
|
|
775
772
|
this._visible = this._options.visible ?? true;
|
|
776
773
|
}
|
|
777
774
|
get ref() {
|
|
@@ -814,7 +811,7 @@ var useGrid = (options = defaultGridOptions) => {
|
|
|
814
811
|
import { useEffect as useEffect2, useRef as useRef2, useState } from "react";
|
|
815
812
|
var useStateRef = (initialValue) => {
|
|
816
813
|
const [value, setValue] = useState(initialValue);
|
|
817
|
-
const ref = useRef2();
|
|
814
|
+
const ref = useRef2(null);
|
|
818
815
|
useEffect2(() => {
|
|
819
816
|
ref.current = value;
|
|
820
817
|
}, [
|
|
@@ -957,4 +954,4 @@ export {
|
|
|
957
954
|
ZoomHandler,
|
|
958
955
|
useZoom
|
|
959
956
|
};
|
|
960
|
-
//# sourceMappingURL=chunk-
|
|
957
|
+
//# sourceMappingURL=chunk-3RLSFEEV.mjs.map
|