@retikz/core 0.0.1-rc.3 → 0.1.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/dist/es/compile/compile.d.ts +27 -0
- package/dist/es/compile/compile.d.ts.map +1 -0
- package/dist/es/compile/compile.js +43 -0
- package/dist/es/compile/index.d.ts +9 -0
- package/dist/es/compile/index.d.ts.map +1 -0
- package/dist/es/compile/node.d.ts +76 -0
- package/dist/es/compile/node.d.ts.map +1 -0
- package/dist/es/compile/node.js +240 -0
- package/dist/es/compile/parseTarget.d.ts +25 -0
- package/dist/es/compile/parseTarget.d.ts.map +1 -0
- package/dist/es/compile/parseTarget.js +48 -0
- package/dist/es/compile/path.d.ts +29 -0
- package/dist/es/compile/path.d.ts.map +1 -0
- package/dist/es/compile/path.js +298 -0
- package/dist/es/compile/position.d.ts +9 -0
- package/dist/es/compile/position.d.ts.map +1 -0
- package/dist/es/compile/position.js +24 -0
- package/dist/es/compile/precision.d.ts +5 -0
- package/dist/es/compile/precision.d.ts.map +1 -0
- package/dist/es/compile/precision.js +8 -0
- package/dist/es/compile/text-metrics.d.ts +32 -0
- package/dist/es/compile/text-metrics.d.ts.map +1 -0
- package/dist/es/compile/text-metrics.js +8 -0
- package/dist/es/compile/view-box.d.ts +8 -0
- package/dist/es/compile/view-box.d.ts.map +1 -0
- package/dist/es/compile/view-box.js +31 -0
- package/dist/es/geometry/circle.d.ts +32 -0
- package/dist/es/geometry/circle.d.ts.map +1 -0
- package/dist/es/geometry/circle.js +79 -0
- package/dist/es/geometry/diamond.d.ts +44 -0
- package/dist/es/geometry/diamond.d.ts.map +1 -0
- package/dist/es/geometry/diamond.js +87 -0
- package/dist/es/geometry/ellipse.d.ts +38 -0
- package/dist/es/geometry/ellipse.d.ts.map +1 -0
- package/dist/es/geometry/ellipse.js +86 -0
- package/dist/es/geometry/index.d.ts +7 -0
- package/dist/es/geometry/index.d.ts.map +1 -0
- package/dist/es/geometry/point.d.ts +25 -0
- package/dist/es/geometry/point.d.ts.map +1 -0
- package/dist/es/geometry/point.js +34 -0
- package/dist/es/geometry/polar.d.ts +44 -0
- package/dist/es/geometry/polar.d.ts.map +1 -0
- package/dist/es/geometry/polar.js +45 -0
- package/dist/es/geometry/rect.d.ts +59 -0
- package/dist/es/geometry/rect.d.ts.map +1 -0
- package/dist/es/geometry/rect.js +120 -0
- package/dist/es/index.d.ts +20 -10
- package/dist/es/index.d.ts.map +1 -0
- package/dist/es/index.js +18 -12
- package/dist/es/ir/index.d.ts +5 -0
- package/dist/es/ir/index.d.ts.map +1 -0
- package/dist/es/ir/node.d.ts +73 -0
- package/dist/es/ir/node.d.ts.map +1 -0
- package/dist/es/ir/node.js +41 -0
- package/dist/es/ir/path/arrow.d.ts +26 -0
- package/dist/es/ir/path/arrow.d.ts.map +1 -0
- package/dist/es/ir/path/arrow.js +25 -0
- package/dist/es/ir/path/index.d.ts +5 -0
- package/dist/es/ir/path/index.d.ts.map +1 -0
- package/dist/es/ir/path/path.d.ts +123 -0
- package/dist/es/ir/path/path.d.ts.map +1 -0
- package/dist/es/ir/path/path.js +22 -0
- package/dist/es/ir/path/step.d.ts +116 -0
- package/dist/es/ir/path/step.d.ts.map +1 -0
- package/dist/es/ir/path/step.js +31 -0
- package/dist/es/ir/path/target.d.ts +5 -0
- package/dist/es/ir/path/target.d.ts.map +1 -0
- package/dist/es/ir/path/target.js +11 -0
- package/dist/es/ir/position/index.d.ts +3 -0
- package/dist/es/ir/position/index.d.ts.map +1 -0
- package/dist/es/ir/position/polar-position.d.ts +9 -0
- package/dist/es/ir/position/polar-position.d.ts.map +1 -0
- package/dist/es/ir/position/polar-position.js +18 -0
- package/dist/es/ir/position/position.d.ts +5 -0
- package/dist/es/ir/position/position.d.ts.map +1 -0
- package/dist/es/ir/position/position.js +5 -0
- package/dist/es/ir/scene.d.ts +424 -0
- package/dist/es/ir/scene.d.ts.map +1 -0
- package/dist/es/ir/scene.js +14 -0
- package/dist/es/parsers/index.d.ts +2 -0
- package/dist/es/parsers/index.d.ts.map +1 -0
- package/dist/es/parsers/parseWay.d.ts +71 -0
- package/dist/es/parsers/parseWay.d.ts.map +1 -0
- package/dist/es/parsers/parseWay.js +92 -0
- package/dist/es/primitive/ellipse.d.ts +32 -0
- package/dist/es/primitive/ellipse.d.ts.map +1 -0
- package/dist/es/primitive/group.d.ts +11 -0
- package/dist/es/primitive/group.d.ts.map +1 -0
- package/dist/es/primitive/index.d.ts +8 -0
- package/dist/es/primitive/index.d.ts.map +1 -0
- package/dist/es/primitive/path.d.ts +29 -0
- package/dist/es/primitive/path.d.ts.map +1 -0
- package/dist/es/primitive/rect.d.ts +28 -0
- package/dist/es/primitive/rect.d.ts.map +1 -0
- package/dist/es/primitive/scene.d.ts +21 -0
- package/dist/es/primitive/scene.d.ts.map +1 -0
- package/dist/es/primitive/text.d.ts +32 -0
- package/dist/es/primitive/text.d.ts.map +1 -0
- package/dist/es/primitive/view-box.d.ts +12 -0
- package/dist/es/primitive/view-box.d.ts.map +1 -0
- package/dist/es/types.d.ts +3 -0
- package/dist/es/types.d.ts.map +1 -0
- package/dist/lib/compile/compile.cjs +43 -0
- package/dist/lib/compile/compile.d.ts +27 -0
- package/dist/lib/compile/compile.d.ts.map +1 -0
- package/dist/lib/compile/index.d.ts +9 -0
- package/dist/lib/compile/index.d.ts.map +1 -0
- package/dist/lib/compile/node.cjs +244 -0
- package/dist/lib/compile/node.d.ts +76 -0
- package/dist/lib/compile/node.d.ts.map +1 -0
- package/dist/lib/compile/parseTarget.cjs +48 -0
- package/dist/lib/compile/parseTarget.d.ts +25 -0
- package/dist/lib/compile/parseTarget.d.ts.map +1 -0
- package/dist/lib/compile/path.cjs +298 -0
- package/dist/lib/compile/path.d.ts +29 -0
- package/dist/lib/compile/path.d.ts.map +1 -0
- package/dist/lib/compile/position.cjs +24 -0
- package/dist/lib/compile/position.d.ts +9 -0
- package/dist/lib/compile/position.d.ts.map +1 -0
- package/dist/lib/compile/precision.cjs +8 -0
- package/dist/lib/compile/precision.d.ts +5 -0
- package/dist/lib/compile/precision.d.ts.map +1 -0
- package/dist/lib/compile/text-metrics.cjs +8 -0
- package/dist/lib/compile/text-metrics.d.ts +32 -0
- package/dist/lib/compile/text-metrics.d.ts.map +1 -0
- package/dist/lib/compile/view-box.cjs +31 -0
- package/dist/lib/compile/view-box.d.ts +8 -0
- package/dist/lib/compile/view-box.d.ts.map +1 -0
- package/dist/lib/geometry/circle.cjs +79 -0
- package/dist/lib/geometry/circle.d.ts +32 -0
- package/dist/lib/geometry/circle.d.ts.map +1 -0
- package/dist/lib/geometry/diamond.cjs +87 -0
- package/dist/lib/geometry/diamond.d.ts +44 -0
- package/dist/lib/geometry/diamond.d.ts.map +1 -0
- package/dist/lib/geometry/ellipse.cjs +86 -0
- package/dist/lib/geometry/ellipse.d.ts +38 -0
- package/dist/lib/geometry/ellipse.d.ts.map +1 -0
- package/dist/lib/geometry/index.d.ts +7 -0
- package/dist/lib/geometry/index.d.ts.map +1 -0
- package/dist/lib/geometry/point.cjs +34 -0
- package/dist/lib/geometry/point.d.ts +25 -0
- package/dist/lib/geometry/point.d.ts.map +1 -0
- package/dist/lib/geometry/polar.cjs +45 -0
- package/dist/lib/geometry/polar.d.ts +44 -0
- package/dist/lib/geometry/polar.d.ts.map +1 -0
- package/dist/lib/geometry/rect.cjs +121 -0
- package/dist/lib/geometry/rect.d.ts +59 -0
- package/dist/lib/geometry/rect.d.ts.map +1 -0
- package/dist/lib/index.cjs +43 -11
- package/dist/lib/index.d.ts +20 -10
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/ir/index.d.ts +5 -0
- package/dist/lib/ir/index.d.ts.map +1 -0
- package/dist/lib/ir/node.cjs +42 -0
- package/dist/lib/ir/node.d.ts +73 -0
- package/dist/lib/ir/node.d.ts.map +1 -0
- package/dist/lib/ir/path/arrow.cjs +25 -0
- package/dist/lib/ir/path/arrow.d.ts +26 -0
- package/dist/lib/ir/path/arrow.d.ts.map +1 -0
- package/dist/lib/ir/path/index.d.ts +5 -0
- package/dist/lib/ir/path/index.d.ts.map +1 -0
- package/dist/lib/ir/path/path.cjs +22 -0
- package/dist/lib/ir/path/path.d.ts +123 -0
- package/dist/lib/ir/path/path.d.ts.map +1 -0
- package/dist/lib/ir/path/step.cjs +35 -0
- package/dist/lib/ir/path/step.d.ts +116 -0
- package/dist/lib/ir/path/step.d.ts.map +1 -0
- package/dist/lib/ir/path/target.cjs +11 -0
- package/dist/lib/ir/path/target.d.ts +5 -0
- package/dist/lib/ir/path/target.d.ts.map +1 -0
- package/dist/lib/ir/position/index.d.ts +3 -0
- package/dist/lib/ir/position/index.d.ts.map +1 -0
- package/dist/lib/ir/position/polar-position.cjs +18 -0
- package/dist/lib/ir/position/polar-position.d.ts +9 -0
- package/dist/lib/ir/position/polar-position.d.ts.map +1 -0
- package/dist/lib/ir/position/position.cjs +5 -0
- package/dist/lib/ir/position/position.d.ts +5 -0
- package/dist/lib/ir/position/position.d.ts.map +1 -0
- package/dist/lib/ir/scene.cjs +16 -0
- package/dist/lib/ir/scene.d.ts +424 -0
- package/dist/lib/ir/scene.d.ts.map +1 -0
- package/dist/lib/parsers/index.d.ts +2 -0
- package/dist/lib/parsers/index.d.ts.map +1 -0
- package/dist/lib/parsers/parseWay.cjs +93 -0
- package/dist/lib/parsers/parseWay.d.ts +71 -0
- package/dist/lib/parsers/parseWay.d.ts.map +1 -0
- package/dist/lib/primitive/ellipse.d.ts +32 -0
- package/dist/lib/primitive/ellipse.d.ts.map +1 -0
- package/dist/lib/primitive/group.d.ts +11 -0
- package/dist/lib/primitive/group.d.ts.map +1 -0
- package/dist/lib/primitive/index.d.ts +8 -0
- package/dist/lib/primitive/index.d.ts.map +1 -0
- package/dist/lib/primitive/path.d.ts +29 -0
- package/dist/lib/primitive/path.d.ts.map +1 -0
- package/dist/lib/primitive/rect.d.ts +28 -0
- package/dist/lib/primitive/rect.d.ts.map +1 -0
- package/dist/lib/primitive/scene.d.ts +21 -0
- package/dist/lib/primitive/scene.d.ts.map +1 -0
- package/dist/lib/primitive/text.d.ts +32 -0
- package/dist/lib/primitive/text.d.ts.map +1 -0
- package/dist/lib/primitive/view-box.d.ts +12 -0
- package/dist/lib/primitive/view-box.d.ts.map +1 -0
- package/dist/lib/types.d.ts +3 -0
- package/dist/lib/types.d.ts.map +1 -0
- package/package.json +26 -34
- package/README.md +0 -2
- package/dist/es/components/Scope.d.ts +0 -6
- package/dist/es/components/Scope.js +0 -12
- package/dist/es/components/TikZ.d.ts +0 -9
- package/dist/es/components/TikZ.js +0 -12
- package/dist/es/components/draw/Draw.d.ts +0 -26
- package/dist/es/components/draw/Draw.js +0 -59
- package/dist/es/components/draw/InnerDraw.d.ts +0 -17
- package/dist/es/components/draw/InnerDraw.js +0 -52
- package/dist/es/components/draw/arrow/circle.d.ts +0 -7
- package/dist/es/components/draw/arrow/circle.js +0 -20
- package/dist/es/components/draw/arrow/index.d.ts +0 -9
- package/dist/es/components/draw/arrow/index.js +0 -13
- package/dist/es/components/draw/arrow/stealth.d.ts +0 -7
- package/dist/es/components/draw/arrow/stealth.js +0 -29
- package/dist/es/components/draw/arrow/types.d.ts +0 -21
- package/dist/es/components/draw/common.d.ts +0 -4
- package/dist/es/components/draw/common.js +0 -12
- package/dist/es/components/draw/index.d.ts +0 -3
- package/dist/es/components/draw/index.js +0 -4
- package/dist/es/components/draw/segment/Segment.d.ts +0 -12
- package/dist/es/components/draw/segment/Segment.js +0 -41
- package/dist/es/components/draw/segment/index.d.ts +0 -15
- package/dist/es/components/draw/segment/index.js +0 -41
- package/dist/es/components/draw/segment/useArrow.d.ts +0 -12
- package/dist/es/components/draw/segment/useArrow.js +0 -52
- package/dist/es/components/draw/segment/useConvertWay.d.ts +0 -14
- package/dist/es/components/draw/segment/useConvertWay.js +0 -117
- package/dist/es/components/draw/types.d.ts +0 -29
- package/dist/es/components/node/InnerNode.d.ts +0 -33
- package/dist/es/components/node/InnerNode.js +0 -88
- package/dist/es/components/node/Node.d.ts +0 -93
- package/dist/es/components/node/Node.js +0 -88
- package/dist/es/components/node/_hooks/useNodeConfig.d.ts +0 -3
- package/dist/es/components/node/_hooks/useNodeConfig.js +0 -13
- package/dist/es/components/node/_hooks/useNodeContent.d.ts +0 -4
- package/dist/es/components/node/_hooks/useNodeContent.js +0 -30
- package/dist/es/components/node/_hooks/useNodeShape.d.ts +0 -4
- package/dist/es/components/node/_hooks/useNodeShape.js +0 -34
- package/dist/es/components/node/index.d.ts +0 -3
- package/dist/es/components/node/index.js +0 -4
- package/dist/es/components/path-node/PathNode.d.ts +0 -48
- package/dist/es/components/path-node/PathNode.js +0 -76
- package/dist/es/components/path-node/index.d.ts +0 -3
- package/dist/es/components/path-node/index.js +0 -4
- package/dist/es/components/path-node/useAnchor.d.ts +0 -6
- package/dist/es/components/path-node/useAnchor.js +0 -49
- package/dist/es/container/Group.d.ts +0 -6
- package/dist/es/container/Group.js +0 -8
- package/dist/es/container/Surface.d.ts +0 -19
- package/dist/es/container/Surface.js +0 -23
- package/dist/es/elements/Path.d.ts +0 -4
- package/dist/es/elements/Path.js +0 -14
- package/dist/es/elements/Rect.d.ts +0 -4
- package/dist/es/elements/Rect.js +0 -9
- package/dist/es/elements/Text.d.ts +0 -18
- package/dist/es/elements/Text.js +0 -35
- package/dist/es/hooks/context/useCalculate.d.ts +0 -7
- package/dist/es/hooks/context/useCalculate.js +0 -9
- package/dist/es/hooks/context/useNodes.d.ts +0 -9
- package/dist/es/hooks/context/useNodes.js +0 -33
- package/dist/es/hooks/context/usePath.d.ts +0 -13
- package/dist/es/hooks/context/usePath.js +0 -20
- package/dist/es/hooks/context/useScope.d.ts +0 -11
- package/dist/es/hooks/context/useScope.js +0 -7
- package/dist/es/hooks/useForceUpdate.d.ts +0 -2
- package/dist/es/hooks/useForceUpdate.js +0 -8
- package/dist/es/model/component/node.d.ts +0 -45
- package/dist/es/model/component/node.js +0 -164
- package/dist/es/model/component/path.d.ts +0 -19
- package/dist/es/model/component/path.js +0 -47
- package/dist/es/model/equation/line.d.ts +0 -21
- package/dist/es/model/equation/line.js +0 -76
- package/dist/es/model/geometry/point/DescartesPoint.d.ts +0 -21
- package/dist/es/model/geometry/point/DescartesPoint.js +0 -50
- package/dist/es/model/geometry/point/PolarPoint.d.ts +0 -14
- package/dist/es/model/geometry/point/PolarPoint.js +0 -27
- package/dist/es/node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/color.js +0 -338
- package/dist/es/node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/define.js +0 -13
- package/dist/es/node_modules/.pnpm/d3-path@3.1.0/node_modules/d3-path/src/path.js +0 -88
- package/dist/es/node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/array.js +0 -6
- package/dist/es/node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/constant.js +0 -8
- package/dist/es/node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/linear.js +0 -39
- package/dist/es/node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/line.js +0 -41
- package/dist/es/node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/path.js +0 -19
- package/dist/es/node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/point.js +0 -10
- package/dist/es/test.d.ts +0 -3
- package/dist/es/types/coordinate/descartes.d.ts +0 -23
- package/dist/es/types/coordinate/index.d.ts +0 -5
- package/dist/es/types/coordinate/polar.d.ts +0 -5
- package/dist/es/types/distance/index.d.ts +0 -8
- package/dist/es/types/distance/sep.d.ts +0 -9
- package/dist/es/types/shape/index.d.ts +0 -8
- package/dist/es/types/shape/index.js +0 -9
- package/dist/es/types/shape/rect.d.ts +0 -25
- package/dist/es/types/shape/rect.js +0 -30
- package/dist/es/types/svg/font.d.ts +0 -10
- package/dist/es/types/svg/stroke.d.ts +0 -10
- package/dist/es/types/tikz/index.d.ts +0 -6
- package/dist/es/utils/compare.d.ts +0 -4
- package/dist/es/utils/compare.js +0 -20
- package/dist/es/utils/css.d.ts +0 -6
- package/dist/es/utils/css.js +0 -26
- package/dist/es/utils/math.d.ts +0 -9
- package/dist/es/utils/math.js +0 -26
- package/dist/es/utils/string.d.ts +0 -7
- package/dist/es/utils/string.js +0 -7
- package/dist/es/utils/style/font.d.ts +0 -17
- package/dist/es/utils/style/font.js +0 -34
- package/dist/es/utils/style/stroke.d.ts +0 -20
- package/dist/es/utils/style/stroke.js +0 -42
- package/dist/lib/components/Scope.cjs +0 -12
- package/dist/lib/components/Scope.d.ts +0 -6
- package/dist/lib/components/TikZ.cjs +0 -12
- package/dist/lib/components/TikZ.d.ts +0 -9
- package/dist/lib/components/draw/Draw.cjs +0 -59
- package/dist/lib/components/draw/Draw.d.ts +0 -26
- package/dist/lib/components/draw/InnerDraw.cjs +0 -52
- package/dist/lib/components/draw/InnerDraw.d.ts +0 -17
- package/dist/lib/components/draw/arrow/circle.cjs +0 -20
- package/dist/lib/components/draw/arrow/circle.d.ts +0 -7
- package/dist/lib/components/draw/arrow/index.cjs +0 -13
- package/dist/lib/components/draw/arrow/index.d.ts +0 -9
- package/dist/lib/components/draw/arrow/stealth.cjs +0 -29
- package/dist/lib/components/draw/arrow/stealth.d.ts +0 -7
- package/dist/lib/components/draw/arrow/types.d.ts +0 -21
- package/dist/lib/components/draw/common.cjs +0 -12
- package/dist/lib/components/draw/common.d.ts +0 -4
- package/dist/lib/components/draw/index.cjs +0 -4
- package/dist/lib/components/draw/index.d.ts +0 -3
- package/dist/lib/components/draw/segment/Segment.cjs +0 -41
- package/dist/lib/components/draw/segment/Segment.d.ts +0 -12
- package/dist/lib/components/draw/segment/index.cjs +0 -41
- package/dist/lib/components/draw/segment/index.d.ts +0 -15
- package/dist/lib/components/draw/segment/useArrow.cjs +0 -52
- package/dist/lib/components/draw/segment/useArrow.d.ts +0 -12
- package/dist/lib/components/draw/segment/useConvertWay.cjs +0 -117
- package/dist/lib/components/draw/segment/useConvertWay.d.ts +0 -14
- package/dist/lib/components/draw/types.d.ts +0 -29
- package/dist/lib/components/node/InnerNode.cjs +0 -88
- package/dist/lib/components/node/InnerNode.d.ts +0 -33
- package/dist/lib/components/node/Node.cjs +0 -88
- package/dist/lib/components/node/Node.d.ts +0 -93
- package/dist/lib/components/node/_hooks/useNodeConfig.cjs +0 -13
- package/dist/lib/components/node/_hooks/useNodeConfig.d.ts +0 -3
- package/dist/lib/components/node/_hooks/useNodeContent.cjs +0 -30
- package/dist/lib/components/node/_hooks/useNodeContent.d.ts +0 -4
- package/dist/lib/components/node/_hooks/useNodeShape.cjs +0 -34
- package/dist/lib/components/node/_hooks/useNodeShape.d.ts +0 -4
- package/dist/lib/components/node/index.cjs +0 -4
- package/dist/lib/components/node/index.d.ts +0 -3
- package/dist/lib/components/path-node/PathNode.cjs +0 -76
- package/dist/lib/components/path-node/PathNode.d.ts +0 -48
- package/dist/lib/components/path-node/index.cjs +0 -4
- package/dist/lib/components/path-node/index.d.ts +0 -3
- package/dist/lib/components/path-node/useAnchor.cjs +0 -49
- package/dist/lib/components/path-node/useAnchor.d.ts +0 -6
- package/dist/lib/container/Group.cjs +0 -8
- package/dist/lib/container/Group.d.ts +0 -6
- package/dist/lib/container/Surface.cjs +0 -23
- package/dist/lib/container/Surface.d.ts +0 -19
- package/dist/lib/elements/Path.cjs +0 -14
- package/dist/lib/elements/Path.d.ts +0 -4
- package/dist/lib/elements/Rect.cjs +0 -9
- package/dist/lib/elements/Rect.d.ts +0 -4
- package/dist/lib/elements/Text.cjs +0 -35
- package/dist/lib/elements/Text.d.ts +0 -18
- package/dist/lib/hooks/context/useCalculate.cjs +0 -9
- package/dist/lib/hooks/context/useCalculate.d.ts +0 -7
- package/dist/lib/hooks/context/useNodes.cjs +0 -33
- package/dist/lib/hooks/context/useNodes.d.ts +0 -9
- package/dist/lib/hooks/context/usePath.cjs +0 -20
- package/dist/lib/hooks/context/usePath.d.ts +0 -13
- package/dist/lib/hooks/context/useScope.cjs +0 -7
- package/dist/lib/hooks/context/useScope.d.ts +0 -11
- package/dist/lib/hooks/useForceUpdate.cjs +0 -8
- package/dist/lib/hooks/useForceUpdate.d.ts +0 -2
- package/dist/lib/model/component/node.cjs +0 -164
- package/dist/lib/model/component/node.d.ts +0 -45
- package/dist/lib/model/component/path.cjs +0 -47
- package/dist/lib/model/component/path.d.ts +0 -19
- package/dist/lib/model/equation/line.cjs +0 -76
- package/dist/lib/model/equation/line.d.ts +0 -21
- package/dist/lib/model/geometry/point/DescartesPoint.cjs +0 -50
- package/dist/lib/model/geometry/point/DescartesPoint.d.ts +0 -21
- package/dist/lib/model/geometry/point/PolarPoint.cjs +0 -27
- package/dist/lib/model/geometry/point/PolarPoint.d.ts +0 -14
- package/dist/lib/node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/color.cjs +0 -338
- package/dist/lib/node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/define.cjs +0 -13
- package/dist/lib/node_modules/.pnpm/d3-path@3.1.0/node_modules/d3-path/src/path.cjs +0 -88
- package/dist/lib/node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/array.cjs +0 -6
- package/dist/lib/node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/constant.cjs +0 -8
- package/dist/lib/node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/linear.cjs +0 -39
- package/dist/lib/node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/line.cjs +0 -41
- package/dist/lib/node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/path.cjs +0 -19
- package/dist/lib/node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/point.cjs +0 -10
- package/dist/lib/test.d.ts +0 -3
- package/dist/lib/types/coordinate/descartes.d.ts +0 -23
- package/dist/lib/types/coordinate/index.d.ts +0 -5
- package/dist/lib/types/coordinate/polar.d.ts +0 -5
- package/dist/lib/types/distance/index.d.ts +0 -8
- package/dist/lib/types/distance/sep.d.ts +0 -9
- package/dist/lib/types/shape/index.cjs +0 -9
- package/dist/lib/types/shape/index.d.ts +0 -8
- package/dist/lib/types/shape/rect.cjs +0 -30
- package/dist/lib/types/shape/rect.d.ts +0 -25
- package/dist/lib/types/svg/font.d.ts +0 -10
- package/dist/lib/types/svg/stroke.d.ts +0 -10
- package/dist/lib/types/tikz/index.d.ts +0 -6
- package/dist/lib/utils/compare.cjs +0 -20
- package/dist/lib/utils/compare.d.ts +0 -4
- package/dist/lib/utils/css.cjs +0 -26
- package/dist/lib/utils/css.d.ts +0 -6
- package/dist/lib/utils/math.cjs +0 -26
- package/dist/lib/utils/math.d.ts +0 -9
- package/dist/lib/utils/string.cjs +0 -7
- package/dist/lib/utils/string.d.ts +0 -7
- package/dist/lib/utils/style/font.cjs +0 -34
- package/dist/lib/utils/style/font.d.ts +0 -17
- package/dist/lib/utils/style/stroke.cjs +0 -42
- package/dist/lib/utils/style/stroke.d.ts +0 -20
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseWay.d.ts","sourceRoot":"","sources":["../../../src/parsers/parseWay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAKV,MAAM,EACN,QAAQ,EACT,MAAM,OAAO,CAAC;AAEf;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,OAAO;IAClB;;;OAGG;;IAEH,2BAA2B;;IAE3B,2BAA2B;;CAEnB,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG,OAAO,OAAO,CAAC,EAAE,GAAG,OAAO,OAAO,CAAC,EAAE,CAAC;AAE3D;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,OAAO,OAAO,CAAC,KAAK,CAAC;AAE5C;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEnD,kDAAkD;AAClD,MAAM,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;AAapC;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,QAAQ,GAAI,KAAK,MAAM,KAAG,KAAK,CAAC,MAAM,CAoClD,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 椭圆原语:SVG `<ellipse>` 直对应。
|
|
3
|
+
* 圆形(半长轴 = 半短轴)用同一个 EllipsePrim 表示,让 renderer 单一 case 处理。
|
|
4
|
+
* 旋转走 `rotate` 字段(度数,绕中心);非零时 renderer 用 SVG transform 包裹。
|
|
5
|
+
*/
|
|
6
|
+
export type EllipsePrim = {
|
|
7
|
+
/** 类型判别符 */
|
|
8
|
+
type: 'ellipse';
|
|
9
|
+
/** 中心横坐标 */
|
|
10
|
+
cx: number;
|
|
11
|
+
/** 中心纵坐标 */
|
|
12
|
+
cy: number;
|
|
13
|
+
/** 水平半轴 */
|
|
14
|
+
rx: number;
|
|
15
|
+
/** 垂直半轴 */
|
|
16
|
+
ry: number;
|
|
17
|
+
/** 绕中心的旋转角(度数,与 RectPrim 风格一致);省略或 0 不旋转 */
|
|
18
|
+
rotate?: number;
|
|
19
|
+
/** 填充色 */
|
|
20
|
+
fill?: string;
|
|
21
|
+
/** 填充透明度 0~1 */
|
|
22
|
+
fillOpacity?: number;
|
|
23
|
+
/** 描边色 */
|
|
24
|
+
stroke?: string;
|
|
25
|
+
/** 描边宽度 */
|
|
26
|
+
strokeWidth?: number;
|
|
27
|
+
/** SVG stroke-dasharray 模式 */
|
|
28
|
+
strokeDasharray?: string;
|
|
29
|
+
/** 整体透明度 0~1 */
|
|
30
|
+
opacity?: number;
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=ellipse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ellipse.d.ts","sourceRoot":"","sources":["../../../src/primitive/ellipse.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,YAAY;IACZ,IAAI,EAAE,SAAS,CAAC;IAChB,YAAY;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,YAAY;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,WAAW;IACX,EAAE,EAAE,MAAM,CAAC;IACX,WAAW;IACX,EAAE,EAAE,MAAM,CAAC;IACX,4CAA4C;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU;IACV,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gBAAgB;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU;IACV,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8BAA8B;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ScenePrimitive } from './scene';
|
|
2
|
+
/** 编组:把若干 primitive 用 transform 包起来 */
|
|
3
|
+
export type GroupPrim = {
|
|
4
|
+
/** 类型判别符 */
|
|
5
|
+
type: 'group';
|
|
6
|
+
/** SVG transform 字符串(translate / rotate / scale 等) */
|
|
7
|
+
transform?: string;
|
|
8
|
+
/** 组内子原语 */
|
|
9
|
+
children: Array<ScenePrimitive>;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group.d.ts","sourceRoot":"","sources":["../../../src/primitive/group.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,uCAAuC;AACvC,MAAM,MAAM,SAAS,GAAG;IACtB,YAAY;IACZ,IAAI,EAAE,OAAO,CAAC;IACd,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY;IACZ,QAAQ,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;CACjC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/primitive/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ArrowShape } from '../ir/path/arrow';
|
|
2
|
+
/** 路径原语:SVG path d 字符串;Canvas/PDF renderer 自行解析 */
|
|
3
|
+
export type PathPrim = {
|
|
4
|
+
/** 类型判别符 */
|
|
5
|
+
type: 'path';
|
|
6
|
+
/** SVG path d 字符串 */
|
|
7
|
+
d: string;
|
|
8
|
+
/** 填充色;不填表示不填充 */
|
|
9
|
+
fill?: string;
|
|
10
|
+
/** SVG fill-rule:`nonzero`(默认)/ `evenodd`(环形 / 孔洞场景) */
|
|
11
|
+
fillRule?: 'nonzero' | 'evenodd';
|
|
12
|
+
/** 描边色 */
|
|
13
|
+
stroke?: string;
|
|
14
|
+
/** 描边宽度 */
|
|
15
|
+
strokeWidth?: number;
|
|
16
|
+
/** SVG stroke-dasharray 模式 */
|
|
17
|
+
strokeDasharray?: string;
|
|
18
|
+
/** 端点形状 */
|
|
19
|
+
strokeLinecap?: 'butt' | 'round' | 'square';
|
|
20
|
+
/** 拐点形状 */
|
|
21
|
+
strokeLinejoin?: 'miter' | 'round' | 'bevel';
|
|
22
|
+
/** 起点箭头形状;undefined = 无 */
|
|
23
|
+
arrowStart?: ArrowShape;
|
|
24
|
+
/** 终点箭头形状;undefined = 无 */
|
|
25
|
+
arrowEnd?: ArrowShape;
|
|
26
|
+
/** 整体透明度 0~1 */
|
|
27
|
+
opacity?: number;
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=path.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../../src/primitive/path.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,mDAAmD;AACnD,MAAM,MAAM,QAAQ,GAAG;IACrB,YAAY;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,qBAAqB;IACrB,CAAC,EAAE,MAAM,CAAC;IACV,kBAAkB;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wDAAwD;IACxD,QAAQ,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IACjC,UAAU;IACV,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8BAA8B;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW;IACX,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;IAC5C,WAAW;IACX,cAAc,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;IAC7C,2BAA2B;IAC3B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,UAAU,CAAC;IACtB,gBAAgB;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** 矩形原语 */
|
|
2
|
+
export type RectPrim = {
|
|
3
|
+
/** 类型判别符 */
|
|
4
|
+
type: 'rect';
|
|
5
|
+
/** 左上角横坐标 */
|
|
6
|
+
x: number;
|
|
7
|
+
/** 左上角纵坐标 */
|
|
8
|
+
y: number;
|
|
9
|
+
/** 矩形宽度 */
|
|
10
|
+
width: number;
|
|
11
|
+
/** 矩形高度 */
|
|
12
|
+
height: number;
|
|
13
|
+
/** 填充色,CSS 颜色字符串 */
|
|
14
|
+
fill?: string;
|
|
15
|
+
/** 填充透明度 0~1 */
|
|
16
|
+
fillOpacity?: number;
|
|
17
|
+
/** 描边色 */
|
|
18
|
+
stroke?: string;
|
|
19
|
+
/** 描边宽度 */
|
|
20
|
+
strokeWidth?: number;
|
|
21
|
+
/** SVG stroke-dasharray 模式 */
|
|
22
|
+
strokeDasharray?: string;
|
|
23
|
+
/** 圆角半径(同时作用于 rx/ry) */
|
|
24
|
+
cornerRadius?: number;
|
|
25
|
+
/** 整体透明度 0~1 */
|
|
26
|
+
opacity?: number;
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=rect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rect.d.ts","sourceRoot":"","sources":["../../../src/primitive/rect.ts"],"names":[],"mappings":"AAAA,WAAW;AACX,MAAM,MAAM,QAAQ,GAAG;IACrB,YAAY;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,aAAa;IACb,CAAC,EAAE,MAAM,CAAC;IACV,aAAa;IACb,CAAC,EAAE,MAAM,CAAC;IACV,WAAW;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW;IACX,MAAM,EAAE,MAAM,CAAC;IACf,oBAAoB;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gBAAgB;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU;IACV,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8BAA8B;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,wBAAwB;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { EllipsePrim } from './ellipse';
|
|
2
|
+
import { GroupPrim } from './group';
|
|
3
|
+
import { PathPrim } from './path';
|
|
4
|
+
import { RectPrim } from './rect';
|
|
5
|
+
import { TextPrim } from './text';
|
|
6
|
+
import { ViewBox } from './view-box';
|
|
7
|
+
/**
|
|
8
|
+
* Scene primitive:渲染目标无关的最大公约子集。
|
|
9
|
+
* 所有 adapter(SVG / Canvas / PDF / Skia)都应能消费这些原语。
|
|
10
|
+
*
|
|
11
|
+
* 不允许出现 SVG-only 或 Canvas-only 特性(filter、marker、imageData 等)。
|
|
12
|
+
*/
|
|
13
|
+
export type ScenePrimitive = RectPrim | EllipsePrim | TextPrim | PathPrim | GroupPrim;
|
|
14
|
+
/** 场景:渲染目标无关的"已布局好的图元集合 + viewBox" */
|
|
15
|
+
export type Scene = {
|
|
16
|
+
/** 已布局好的图元数组,按渲染顺序排列 */
|
|
17
|
+
primitives: Array<ScenePrimitive>;
|
|
18
|
+
/** 整个场景的视口范围 */
|
|
19
|
+
viewBox: ViewBox;
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=scene.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scene.d.ts","sourceRoot":"","sources":["../../../src/primitive/scene.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,WAAW,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEtF,sCAAsC;AACtC,MAAM,MAAM,KAAK,GAAG;IAClB,wBAAwB;IACxB,UAAU,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;IAClC,gBAAgB;IAChB,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** 文本原语;measuredWidth/Height 由 Scene 编译阶段算好,下游直接信任 */
|
|
2
|
+
export type TextPrim = {
|
|
3
|
+
/** 类型判别符 */
|
|
4
|
+
type: 'text';
|
|
5
|
+
/** 锚点横坐标(具体含义由 align 决定) */
|
|
6
|
+
x: number;
|
|
7
|
+
/** 锚点纵坐标(具体含义由 baseline 决定) */
|
|
8
|
+
y: number;
|
|
9
|
+
/** 文本内容 */
|
|
10
|
+
content: string;
|
|
11
|
+
/** 字号 */
|
|
12
|
+
fontSize: number;
|
|
13
|
+
/** 字体族 */
|
|
14
|
+
fontFamily?: string;
|
|
15
|
+
/** 字重 */
|
|
16
|
+
fontWeight?: string | number;
|
|
17
|
+
/** 字形 */
|
|
18
|
+
fontStyle?: 'normal' | 'italic';
|
|
19
|
+
/** 水平对齐:start / middle / end 锚点位置 */
|
|
20
|
+
align: 'start' | 'middle' | 'end';
|
|
21
|
+
/** 垂直基线对齐方式 */
|
|
22
|
+
baseline: 'top' | 'middle' | 'bottom' | 'alphabetic';
|
|
23
|
+
/** 编译期算好的文字宽度(user units) */
|
|
24
|
+
measuredWidth: number;
|
|
25
|
+
/** 编译期算好的文字高度(user units) */
|
|
26
|
+
measuredHeight: number;
|
|
27
|
+
/** 文字颜色 */
|
|
28
|
+
fill?: string;
|
|
29
|
+
/** 整体透明度 0~1 */
|
|
30
|
+
opacity?: number;
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../src/primitive/text.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,MAAM,MAAM,QAAQ,GAAG;IACrB,YAAY;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,CAAC,EAAE,MAAM,CAAC;IACV,+BAA+B;IAC/B,CAAC,EAAE,MAAM,CAAC;IACV,WAAW;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS;IACT,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU;IACV,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS;IACT,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,SAAS;IACT,SAAS,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAChC,qCAAqC;IACrC,KAAK,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IAClC,eAAe;IACf,QAAQ,EAAE,KAAK,GAAG,QAAQ,GAAG,QAAQ,GAAG,YAAY,CAAC;IACrD,6BAA6B;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,6BAA6B;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gBAAgB;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view-box.d.ts","sourceRoot":"","sources":["../../../src/primitive/view-box.ts"],"names":[],"mappings":"AAAA,wBAAwB;AACxB,MAAM,MAAM,OAAO,GAAG;IACpB,eAAe;IACf,CAAC,EAAE,MAAM,CAAC;IACV,eAAe;IACf,CAAC,EAAE,MAAM,CAAC;IACV,WAAW;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW;IACX,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@retikz/core",
|
|
3
|
-
"version": "0.0.1
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.0-alpha.1",
|
|
4
|
+
"description": "retikz v0.1 core: framework-agnostic IR, scene compiler, and pure parsers.",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"homepage": "https://pionpill.github.io/retikz
|
|
6
|
+
"homepage": "https://pionpill.github.io/retikz/",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"react",
|
|
9
9
|
"tikz",
|
|
@@ -11,48 +11,40 @@
|
|
|
11
11
|
],
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"repository": "https://github.com/Pionpill/retikz",
|
|
14
|
+
"sideEffects": false,
|
|
14
15
|
"main": "dist/lib/index.cjs",
|
|
15
16
|
"module": "dist/es/index.js",
|
|
16
17
|
"types": "dist/lib/index.d.ts",
|
|
17
|
-
"
|
|
18
|
-
"
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/lib/index.d.ts",
|
|
21
|
+
"import": "./dist/es/index.js",
|
|
22
|
+
"require": "./dist/lib/index.cjs",
|
|
23
|
+
"default": "./dist/es/index.js"
|
|
24
|
+
}
|
|
19
25
|
},
|
|
20
26
|
"files": [
|
|
21
27
|
"LICENSE",
|
|
22
28
|
"README.md",
|
|
23
29
|
"dist/**/*"
|
|
24
30
|
],
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"zod": "^3.23.8"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@types/node": "^25.6.0",
|
|
36
|
+
"typescript": "^6.0.3",
|
|
37
|
+
"vite": "^8.0.10",
|
|
38
|
+
"vite-plugin-dts": "^4.5.4",
|
|
39
|
+
"vite-tsconfig-paths": "^6.1.1",
|
|
40
|
+
"vitest": "^4.1.5"
|
|
41
|
+
},
|
|
25
42
|
"scripts": {
|
|
26
43
|
"dev": "vite",
|
|
27
44
|
"build": "vite build",
|
|
28
45
|
"lint": "eslint .",
|
|
29
|
-
"preview": "vite preview"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"react": ">=18",
|
|
33
|
-
"react-dom": ">=18"
|
|
34
|
-
},
|
|
35
|
-
"dependencies": {
|
|
36
|
-
"d3-color": "^3.1.0",
|
|
37
|
-
"d3-shape": "^3.2.0",
|
|
38
|
-
"react": "~18.3",
|
|
39
|
-
"react-dom": "~18.3"
|
|
40
|
-
},
|
|
41
|
-
"devDependencies": {
|
|
42
|
-
"@eslint/js": "^9.15.0",
|
|
43
|
-
"@types/d3-color": "^3.1.3",
|
|
44
|
-
"@types/d3-shape": "^3.1.6",
|
|
45
|
-
"@types/node": "^22.10.7",
|
|
46
|
-
"@types/react": "~18.3",
|
|
47
|
-
"@types/react-dom": "~18.3",
|
|
48
|
-
"@vitejs/plugin-react": "^4.3.4",
|
|
49
|
-
"eslint": "^9.15.0",
|
|
50
|
-
"eslint-plugin-react-hooks": "^5.0.0",
|
|
51
|
-
"eslint-plugin-react-refresh": "^0.4.14",
|
|
52
|
-
"globals": "^15.12.0",
|
|
53
|
-
"typescript": "~5.6.2",
|
|
54
|
-
"typescript-eslint": "^8.15.0",
|
|
55
|
-
"vite": "^6.0.1",
|
|
56
|
-
"vite-plugin-dts": "^4.5.0"
|
|
46
|
+
"preview": "vite preview",
|
|
47
|
+
"test": "vitest",
|
|
48
|
+
"test:run": "vitest run"
|
|
57
49
|
}
|
|
58
|
-
}
|
|
50
|
+
}
|
package/README.md
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
2
|
-
import { ScopeProps as ScopeContextProps } from '../hooks/context/useScope';
|
|
3
|
-
import { GroupProps } from '../container/Group';
|
|
4
|
-
export type ScopeProps = ScopeContextProps & Omit<GroupProps, 'offset'>;
|
|
5
|
-
declare const Scope: import('react').ForwardRefExoticComponent<Omit<PropsWithChildren<ScopeProps>, "ref"> & import('react').RefAttributes<SVGGElement>>;
|
|
6
|
-
export default Scope;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
|
-
import useScope, { ScopeContext } from "../hooks/context/useScope.js";
|
|
4
|
-
import Group from "../container/Group.js";
|
|
5
|
-
const Scope = forwardRef((props, ref) => {
|
|
6
|
-
const { children, ...resProps } = props;
|
|
7
|
-
const baseScopeValue = useScope();
|
|
8
|
-
return /* @__PURE__ */ jsx(ScopeContext.Provider, { value: { ...baseScopeValue, ...resProps }, children: /* @__PURE__ */ jsx(Group, { ref, children }) });
|
|
9
|
-
});
|
|
10
|
-
export {
|
|
11
|
-
Scope as default
|
|
12
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { FC, ReactNode } from 'react';
|
|
2
|
-
import { SurfaceProps } from '../container/Surface';
|
|
3
|
-
import { CalculateProps } from '../hooks/context/useCalculate';
|
|
4
|
-
import { ScopeProps } from '../hooks/context/useScope';
|
|
5
|
-
export type TikZProps = {
|
|
6
|
-
children: ReactNode;
|
|
7
|
-
} & Partial<CalculateProps> & ScopeProps & SurfaceProps;
|
|
8
|
-
declare const TikZ: FC<TikZProps>;
|
|
9
|
-
export default TikZ;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import Surface from "../container/Surface.js";
|
|
3
|
-
import { CalculateContext } from "../hooks/context/useCalculate.js";
|
|
4
|
-
import { NodesContext } from "../hooks/context/useNodes.js";
|
|
5
|
-
import { ScopeContext } from "../hooks/context/useScope.js";
|
|
6
|
-
const TikZ = (props) => {
|
|
7
|
-
const { precision = 2, offset, node, draw, ...resProps } = props;
|
|
8
|
-
return /* @__PURE__ */ jsx(NodesContext.Provider, { value: /* @__PURE__ */ new Map(), children: /* @__PURE__ */ jsx(CalculateContext.Provider, { value: { precision }, children: /* @__PURE__ */ jsx(ScopeContext.Provider, { value: { offset, node, draw }, children: /* @__PURE__ */ jsx(Surface, { ...resProps }) }) }) });
|
|
9
|
-
};
|
|
10
|
-
export {
|
|
11
|
-
TikZ as default
|
|
12
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
|
-
import { PointPosition } from '../../types/coordinate';
|
|
3
|
-
import { StrokeProps } from '../../types/svg/stroke';
|
|
4
|
-
import { StrokeShortcutProps, StrokeType } from '../../utils/style/stroke';
|
|
5
|
-
import { ArrowProps, DrawWayType } from './types';
|
|
6
|
-
export type DrawProps = {
|
|
7
|
-
way: DrawWayType[];
|
|
8
|
-
/** 位置偏移 */
|
|
9
|
-
offset?: PointPosition;
|
|
10
|
-
/** 同 stroke */
|
|
11
|
-
color?: string;
|
|
12
|
-
/** 线段样式快捷属性 */
|
|
13
|
-
strokeType?: StrokeType;
|
|
14
|
-
children?: ReactElement | ReactElement[] | null;
|
|
15
|
-
} & StrokeProps & StrokeShortcutProps & ArrowProps;
|
|
16
|
-
declare const Draw: import('react').ForwardRefExoticComponent<{
|
|
17
|
-
way: DrawWayType[];
|
|
18
|
-
/** 位置偏移 */
|
|
19
|
-
offset?: PointPosition;
|
|
20
|
-
/** 同 stroke */
|
|
21
|
-
color?: string;
|
|
22
|
-
/** 线段样式快捷属性 */
|
|
23
|
-
strokeType?: StrokeType;
|
|
24
|
-
children?: ReactElement | ReactElement[] | null;
|
|
25
|
-
} & StrokeProps & StrokeShortcutProps & ArrowProps & import('react').RefAttributes<SVGPathElement>>;
|
|
26
|
-
export default Draw;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef, useMemo } from "react";
|
|
3
|
-
import useScope from "../../hooks/context/useScope.js";
|
|
4
|
-
import DescartesPoint from "../../model/geometry/point/DescartesPoint.js";
|
|
5
|
-
import { convertStrokeType, convertStrokeShortcut } from "../../utils/style/stroke.js";
|
|
6
|
-
import InnerDraw from "./InnerDraw.js";
|
|
7
|
-
const Draw = forwardRef((props, ref) => {
|
|
8
|
-
const { draw: scopeProps } = useScope();
|
|
9
|
-
const realProps = { ...scopeProps, ...props };
|
|
10
|
-
const { offset, color, stroke, strokeWidth, startArrow, startArrows, endArrow, endArrows, ...resProps } = realProps;
|
|
11
|
-
const realStroke = stroke || color;
|
|
12
|
-
const realStartArrow = typeof startArrow === "string" ? { type: startArrow } : startArrow;
|
|
13
|
-
const realStartArrows = typeof startArrows === "string" ? { type: startArrows } : startArrows;
|
|
14
|
-
const realEndArrow = typeof endArrow === "string" ? { type: endArrow } : endArrow;
|
|
15
|
-
const realEndArrows = typeof endArrows === "string" ? { type: endArrows } : endArrows;
|
|
16
|
-
const convertOffset = offset ? DescartesPoint.formatPosition(offset) : [0, 0];
|
|
17
|
-
const getStrokeTypes = () => resProps.strokeType ? convertStrokeType(resProps.strokeType, strokeWidth ?? 1) : convertStrokeShortcut(resProps, strokeWidth ?? 1);
|
|
18
|
-
const drawProps = useMemo(() => {
|
|
19
|
-
const props2 = { ...resProps };
|
|
20
|
-
[
|
|
21
|
-
"solid",
|
|
22
|
-
"dashed",
|
|
23
|
-
"denselyDashed",
|
|
24
|
-
"looselyDashed",
|
|
25
|
-
"dotted",
|
|
26
|
-
"denselyDotted",
|
|
27
|
-
"looselyDotted",
|
|
28
|
-
"dashDot",
|
|
29
|
-
"denselyDashDot",
|
|
30
|
-
"looselyDashDot",
|
|
31
|
-
"dashDashDot",
|
|
32
|
-
"denselyDashDashDot",
|
|
33
|
-
"looselyDashDashDot"
|
|
34
|
-
].forEach((key) => {
|
|
35
|
-
if (key in props2) {
|
|
36
|
-
delete props2[key];
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
return props2;
|
|
40
|
-
}, [props]);
|
|
41
|
-
return /* @__PURE__ */ jsx(
|
|
42
|
-
InnerDraw,
|
|
43
|
-
{
|
|
44
|
-
ref,
|
|
45
|
-
...getStrokeTypes(),
|
|
46
|
-
offset: convertOffset,
|
|
47
|
-
stroke: realStroke,
|
|
48
|
-
strokeWidth: strokeWidth || 1,
|
|
49
|
-
startArrow: realStartArrow,
|
|
50
|
-
startArrows: realStartArrows,
|
|
51
|
-
endArrow: realEndArrow,
|
|
52
|
-
endArrows: realEndArrows,
|
|
53
|
-
...drawProps
|
|
54
|
-
}
|
|
55
|
-
);
|
|
56
|
-
});
|
|
57
|
-
export {
|
|
58
|
-
Draw as default
|
|
59
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { Position } from '../../types/coordinate/descartes';
|
|
3
|
-
import { StrokeProps } from '../../types/svg/stroke';
|
|
4
|
-
import { ArrowConfig, ArrowProps, DrawWayType } from './types';
|
|
5
|
-
export type InnerDrawProps = {
|
|
6
|
-
/** 位置偏移 */
|
|
7
|
-
offset: Position;
|
|
8
|
-
way: DrawWayType[];
|
|
9
|
-
children?: ReactNode;
|
|
10
|
-
} & StrokeProps & ArrowProps<ArrowConfig>;
|
|
11
|
-
declare const InnerDraw: import('react').ForwardRefExoticComponent<{
|
|
12
|
-
/** 位置偏移 */
|
|
13
|
-
offset: Position;
|
|
14
|
-
way: DrawWayType[];
|
|
15
|
-
children?: ReactNode;
|
|
16
|
-
} & StrokeProps & ArrowProps<ArrowConfig> & import('react').RefAttributes<SVGPathElement>>;
|
|
17
|
-
export default InnerDraw;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef, useMemo } from "react";
|
|
3
|
-
import Group from "../../container/Group.js";
|
|
4
|
-
import { PathContext } from "../../hooks/context/usePath.js";
|
|
5
|
-
import PathModel from "../../model/component/path.js";
|
|
6
|
-
import { getDrawPointType } from "./common.js";
|
|
7
|
-
import DrawSegment from "./segment/index.js";
|
|
8
|
-
const InnerDraw = forwardRef((props, ref) => {
|
|
9
|
-
const { way, offset, startArrow, startArrows, endArrow, endArrows, children, ...strokeProps } = props;
|
|
10
|
-
const waySegments = useMemo(() => {
|
|
11
|
-
let preNodeType = "coordinate";
|
|
12
|
-
const waySegments2 = [];
|
|
13
|
-
let waySegment = [];
|
|
14
|
-
for (let i = 0; i < way.length; i++) {
|
|
15
|
-
const point = way[i];
|
|
16
|
-
const currentNodeType = getDrawPointType(point);
|
|
17
|
-
waySegment.push(point);
|
|
18
|
-
if (currentNodeType === "node" && preNodeType === "node" && waySegment.length >= 2) {
|
|
19
|
-
waySegments2.push(waySegment);
|
|
20
|
-
waySegment = [waySegment[waySegment.length - 1]];
|
|
21
|
-
}
|
|
22
|
-
if (i === way.length - 1 && waySegment.length > 1) {
|
|
23
|
-
waySegments2.push(waySegment);
|
|
24
|
-
}
|
|
25
|
-
preNodeType = currentNodeType;
|
|
26
|
-
}
|
|
27
|
-
return waySegments2;
|
|
28
|
-
}, [way]);
|
|
29
|
-
return /* @__PURE__ */ jsx(
|
|
30
|
-
PathContext.Provider,
|
|
31
|
-
{
|
|
32
|
-
value: new PathModel(new Array(waySegments.length).fill([]), Number(strokeProps.strokeWidth) || 1, false),
|
|
33
|
-
children: /* @__PURE__ */ jsxs(Group, { ref, transform: `translate(${offset[0]}, ${offset[1]})`, children: [
|
|
34
|
-
waySegments.map((segment, index) => /* @__PURE__ */ jsx(
|
|
35
|
-
DrawSegment,
|
|
36
|
-
{
|
|
37
|
-
index,
|
|
38
|
-
way: segment,
|
|
39
|
-
...strokeProps,
|
|
40
|
-
endArrow: index === waySegments.length - 1 ? endArrow || endArrows : endArrows,
|
|
41
|
-
startArrow: index === waySegments.length - 1 ? startArrow || startArrows : startArrows
|
|
42
|
-
},
|
|
43
|
-
JSON.stringify(segment)
|
|
44
|
-
)),
|
|
45
|
-
children
|
|
46
|
-
] })
|
|
47
|
-
}
|
|
48
|
-
);
|
|
49
|
-
});
|
|
50
|
-
export {
|
|
51
|
-
InnerDraw as default
|
|
52
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
const getCirclePath = (attributes) => {
|
|
2
|
-
const {
|
|
3
|
-
width = 5,
|
|
4
|
-
left = false,
|
|
5
|
-
right = false,
|
|
6
|
-
scale = 1
|
|
7
|
-
} = attributes;
|
|
8
|
-
const radius = width / 2 * scale;
|
|
9
|
-
const diameter = width * scale;
|
|
10
|
-
const startPoint = [0, 0];
|
|
11
|
-
const path = `M ${startPoint.join(",")} ` + (left ? `A ${radius},${radius} 0 1,0 ${-diameter},0 Z` : right ? `A ${radius},${radius} 0 1,1 ${-diameter},0 Z` : `A ${radius},${radius} 0 1,0 ${-diameter},0A ${radius},${radius} 0 1,0 ${startPoint.join(",")} Z`);
|
|
12
|
-
return {
|
|
13
|
-
d: path,
|
|
14
|
-
offsetDistance: radius,
|
|
15
|
-
insertDistance: radius
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export {
|
|
19
|
-
getCirclePath as default
|
|
20
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ArrowAttributes, ArrowPathConfig } from './types';
|
|
2
|
-
export type { ArrowAttributes as ArrowPositionAttributes, ArrowPathConfig };
|
|
3
|
-
export type ArrowType = 'Stealth' | 'Circle';
|
|
4
|
-
declare const getArrowPath: (type: ArrowType, attributes: ArrowAttributes) => {
|
|
5
|
-
d: string;
|
|
6
|
-
offsetDistance: number;
|
|
7
|
-
insertDistance: number;
|
|
8
|
-
};
|
|
9
|
-
export default getArrowPath;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import getCirclePath from "./circle.js";
|
|
2
|
-
import getStealthPath from "./stealth.js";
|
|
3
|
-
const getArrowPath = (type, attributes) => {
|
|
4
|
-
switch (type) {
|
|
5
|
-
case "Stealth":
|
|
6
|
-
return getStealthPath(attributes);
|
|
7
|
-
case "Circle":
|
|
8
|
-
return getCirclePath(attributes);
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
export {
|
|
12
|
-
getArrowPath as default
|
|
13
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import line from "../../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/line.js";
|
|
2
|
-
const getStealthPath = (attributes) => {
|
|
3
|
-
const {
|
|
4
|
-
width = 4,
|
|
5
|
-
length = 5,
|
|
6
|
-
insert = 1.75,
|
|
7
|
-
left = false,
|
|
8
|
-
right = false,
|
|
9
|
-
scale = 1,
|
|
10
|
-
strokeWidth = 1,
|
|
11
|
-
round,
|
|
12
|
-
strokeLinejoin = "miter"
|
|
13
|
-
} = attributes;
|
|
14
|
-
const startPoint = [0, 0];
|
|
15
|
-
const leftPoint = [-length * scale, -width / 2 * scale];
|
|
16
|
-
const insertPoint = [(-length + insert) * scale, 0];
|
|
17
|
-
const rightPoint = [-length * scale, width / 2 * scale];
|
|
18
|
-
const way = left ? [startPoint, leftPoint, insertPoint] : right ? [startPoint, rightPoint, insertPoint] : [startPoint, leftPoint, insertPoint, rightPoint];
|
|
19
|
-
const straightLine = line().x((d) => d[0]).y((d) => d[1]);
|
|
20
|
-
const radio = width / 2 / Math.sqrt(length ** 2 + (width / 2) ** 2);
|
|
21
|
-
return {
|
|
22
|
-
d: straightLine(way) + "Z",
|
|
23
|
-
offsetDistance: round || strokeLinejoin === "round" ? strokeWidth / 2 : strokeWidth / (2 * radio),
|
|
24
|
-
insertDistance: length - insert
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
export {
|
|
28
|
-
getStealthPath as default
|
|
29
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/** 箭头属性 */
|
|
2
|
-
export type ArrowAttributes = {
|
|
3
|
-
width?: number;
|
|
4
|
-
length?: number;
|
|
5
|
-
insert?: number;
|
|
6
|
-
left?: boolean;
|
|
7
|
-
right?: boolean;
|
|
8
|
-
round?: boolean;
|
|
9
|
-
strokeWidth?: number;
|
|
10
|
-
scale?: number;
|
|
11
|
-
linkType?: 'center' | 'end';
|
|
12
|
-
strokeLinejoin?: "round" | "inherit" | "bevel" | "miter";
|
|
13
|
-
};
|
|
14
|
-
export type ArrowPathConfig = {
|
|
15
|
-
/** path d 属性路径 */
|
|
16
|
-
d: string;
|
|
17
|
-
/** 箭头顶点与 path 顶点的距离 */
|
|
18
|
-
offsetDistance: number;
|
|
19
|
-
/** insert 点与 path 顶点的距离 */
|
|
20
|
-
insertDistance: number;
|
|
21
|
-
};
|