@retikz/core 0.0.1-rc.0

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.
Files changed (233) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +2 -0
  3. package/dist/es/_virtual/jsx-runtime.js +5 -0
  4. package/dist/es/_virtual/jsx-runtime2.js +4 -0
  5. package/dist/es/_virtual/react-jsx-runtime.development.js +4 -0
  6. package/dist/es/_virtual/react-jsx-runtime.production.js +4 -0
  7. package/dist/es/components/Scope.d.ts +6 -0
  8. package/dist/es/components/Scope.js +10 -0
  9. package/dist/es/components/TikZ.d.ts +9 -0
  10. package/dist/es/components/TikZ.js +12 -0
  11. package/dist/es/components/draw/Draw.d.ts +18 -0
  12. package/dist/es/components/draw/Draw.js +34 -0
  13. package/dist/es/components/draw/InnerDraw.d.ts +13 -0
  14. package/dist/es/components/draw/InnerDraw.js +47 -0
  15. package/dist/es/components/draw/arrow/index.d.ts +9 -0
  16. package/dist/es/components/draw/arrow/index.js +10 -0
  17. package/dist/es/components/draw/arrow/stealth.d.ts +7 -0
  18. package/dist/es/components/draw/arrow/stealth.js +29 -0
  19. package/dist/es/components/draw/arrow/types.d.ts +21 -0
  20. package/dist/es/components/draw/common.d.ts +4 -0
  21. package/dist/es/components/draw/common.js +12 -0
  22. package/dist/es/components/draw/index.d.ts +3 -0
  23. package/dist/es/components/draw/segment/Segment.d.ts +12 -0
  24. package/dist/es/components/draw/segment/Segment.js +41 -0
  25. package/dist/es/components/draw/segment/index.d.ts +19 -0
  26. package/dist/es/components/draw/segment/index.js +41 -0
  27. package/dist/es/components/draw/segment/useArrow.d.ts +12 -0
  28. package/dist/es/components/draw/segment/useArrow.js +52 -0
  29. package/dist/es/components/draw/segment/useConvertWay.d.ts +14 -0
  30. package/dist/es/components/draw/segment/useConvertWay.js +95 -0
  31. package/dist/es/components/draw/types.d.ts +29 -0
  32. package/dist/es/components/node/InnerNode.d.ts +33 -0
  33. package/dist/es/components/node/InnerNode.js +88 -0
  34. package/dist/es/components/node/Node.d.ts +54 -0
  35. package/dist/es/components/node/Node.js +87 -0
  36. package/dist/es/components/node/_hooks/useNodeConfig.d.ts +3 -0
  37. package/dist/es/components/node/_hooks/useNodeConfig.js +13 -0
  38. package/dist/es/components/node/_hooks/useNodeContent.d.ts +4 -0
  39. package/dist/es/components/node/_hooks/useNodeContent.js +27 -0
  40. package/dist/es/components/node/_hooks/useNodeShape.d.ts +4 -0
  41. package/dist/es/components/node/_hooks/useNodeShape.js +34 -0
  42. package/dist/es/components/node/index.d.ts +3 -0
  43. package/dist/es/components/node/index.js +4 -0
  44. package/dist/es/components/pathNode/PathNode.d.ts +39 -0
  45. package/dist/es/components/pathNode/PathNode.js +76 -0
  46. package/dist/es/components/pathNode/index.d.ts +3 -0
  47. package/dist/es/components/pathNode/index.js +4 -0
  48. package/dist/es/components/pathNode/useAnchor.d.ts +6 -0
  49. package/dist/es/components/pathNode/useAnchor.js +49 -0
  50. package/dist/es/container/Group.d.ts +6 -0
  51. package/dist/es/container/Group.js +7 -0
  52. package/dist/es/container/Surface.d.ts +17 -0
  53. package/dist/es/container/Surface.js +23 -0
  54. package/dist/es/elements/Path.d.ts +4 -0
  55. package/dist/es/elements/Path.js +13 -0
  56. package/dist/es/elements/Rect.d.ts +6 -0
  57. package/dist/es/elements/Rect.js +8 -0
  58. package/dist/es/elements/Text.d.ts +19 -0
  59. package/dist/es/elements/Text.js +35 -0
  60. package/dist/es/hooks/context/useCalculate.d.ts +7 -0
  61. package/dist/es/hooks/context/useCalculate.js +9 -0
  62. package/dist/es/hooks/context/useNodes.d.ts +9 -0
  63. package/dist/es/hooks/context/useNodes.js +33 -0
  64. package/dist/es/hooks/context/usePath.d.ts +13 -0
  65. package/dist/es/hooks/context/usePath.js +20 -0
  66. package/dist/es/hooks/context/useScope.d.ts +11 -0
  67. package/dist/es/hooks/context/useScope.js +7 -0
  68. package/dist/es/hooks/useForceUpdate.d.ts +2 -0
  69. package/dist/es/hooks/useForceUpdate.js +8 -0
  70. package/dist/es/index.d.ts +10 -0
  71. package/dist/es/index.js +12 -0
  72. package/dist/es/model/component/node.d.ts +45 -0
  73. package/dist/es/model/component/node.js +164 -0
  74. package/dist/es/model/component/path.d.ts +19 -0
  75. package/dist/es/model/component/path.js +47 -0
  76. package/dist/es/model/equation/line.d.ts +21 -0
  77. package/dist/es/model/equation/line.js +75 -0
  78. package/dist/es/model/geometry/point/DescartesPoint.d.ts +21 -0
  79. package/dist/es/model/geometry/point/DescartesPoint.js +50 -0
  80. package/dist/es/model/geometry/point/PolarPoint.d.ts +14 -0
  81. package/dist/es/model/geometry/point/PolarPoint.js +27 -0
  82. package/dist/es/node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/color.js +338 -0
  83. package/dist/es/node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/define.js +13 -0
  84. package/dist/es/node_modules/.pnpm/d3-path@3.1.0/node_modules/d3-path/src/path.js +88 -0
  85. package/dist/es/node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/array.js +6 -0
  86. package/dist/es/node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/constant.js +8 -0
  87. package/dist/es/node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/linear.js +39 -0
  88. package/dist/es/node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/line.js +41 -0
  89. package/dist/es/node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/path.js +19 -0
  90. package/dist/es/node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/point.js +10 -0
  91. package/dist/es/node_modules/.pnpm/react@19.0.0/node_modules/react/cjs/react-jsx-runtime.development.js +20 -0
  92. package/dist/es/node_modules/.pnpm/react@19.0.0/node_modules/react/cjs/react-jsx-runtime.production.js +41 -0
  93. package/dist/es/node_modules/.pnpm/react@19.0.0/node_modules/react/jsx-runtime.js +17 -0
  94. package/dist/es/types/coordinate/descartes.d.ts +23 -0
  95. package/dist/es/types/coordinate/index.d.ts +5 -0
  96. package/dist/es/types/coordinate/polar.d.ts +5 -0
  97. package/dist/es/types/distance/index.d.ts +8 -0
  98. package/dist/es/types/distance/sep.d.ts +9 -0
  99. package/dist/es/types/shape/index.d.ts +8 -0
  100. package/dist/es/types/shape/index.js +9 -0
  101. package/dist/es/types/shape/rect.d.ts +25 -0
  102. package/dist/es/types/shape/rect.js +30 -0
  103. package/dist/es/types/svg/font.d.ts +10 -0
  104. package/dist/es/types/svg/stroke.d.ts +10 -0
  105. package/dist/es/types/tikz/index.d.ts +6 -0
  106. package/dist/es/utils/compare.d.ts +4 -0
  107. package/dist/es/utils/compare.js +20 -0
  108. package/dist/es/utils/css.d.ts +6 -0
  109. package/dist/es/utils/css.js +26 -0
  110. package/dist/es/utils/math.d.ts +9 -0
  111. package/dist/es/utils/math.js +26 -0
  112. package/dist/es/utils/string.d.ts +7 -0
  113. package/dist/es/utils/string.js +7 -0
  114. package/dist/es/utils/style/font.d.ts +17 -0
  115. package/dist/es/utils/style/font.js +34 -0
  116. package/dist/es/utils/style/stroke.d.ts +19 -0
  117. package/dist/es/utils/style/stroke.js +40 -0
  118. package/dist/lib/_virtual/jsx-runtime.cjs +5 -0
  119. package/dist/lib/_virtual/jsx-runtime2.cjs +4 -0
  120. package/dist/lib/_virtual/react-jsx-runtime.development.cjs +4 -0
  121. package/dist/lib/_virtual/react-jsx-runtime.production.cjs +4 -0
  122. package/dist/lib/components/Scope.cjs +10 -0
  123. package/dist/lib/components/Scope.d.ts +6 -0
  124. package/dist/lib/components/TikZ.cjs +12 -0
  125. package/dist/lib/components/TikZ.d.ts +9 -0
  126. package/dist/lib/components/draw/Draw.cjs +34 -0
  127. package/dist/lib/components/draw/Draw.d.ts +18 -0
  128. package/dist/lib/components/draw/InnerDraw.cjs +47 -0
  129. package/dist/lib/components/draw/InnerDraw.d.ts +13 -0
  130. package/dist/lib/components/draw/arrow/index.cjs +10 -0
  131. package/dist/lib/components/draw/arrow/index.d.ts +9 -0
  132. package/dist/lib/components/draw/arrow/stealth.cjs +29 -0
  133. package/dist/lib/components/draw/arrow/stealth.d.ts +7 -0
  134. package/dist/lib/components/draw/arrow/types.d.ts +21 -0
  135. package/dist/lib/components/draw/common.cjs +12 -0
  136. package/dist/lib/components/draw/common.d.ts +4 -0
  137. package/dist/lib/components/draw/index.d.ts +3 -0
  138. package/dist/lib/components/draw/segment/Segment.cjs +41 -0
  139. package/dist/lib/components/draw/segment/Segment.d.ts +12 -0
  140. package/dist/lib/components/draw/segment/index.cjs +41 -0
  141. package/dist/lib/components/draw/segment/index.d.ts +19 -0
  142. package/dist/lib/components/draw/segment/useArrow.cjs +52 -0
  143. package/dist/lib/components/draw/segment/useArrow.d.ts +12 -0
  144. package/dist/lib/components/draw/segment/useConvertWay.cjs +95 -0
  145. package/dist/lib/components/draw/segment/useConvertWay.d.ts +14 -0
  146. package/dist/lib/components/draw/types.d.ts +29 -0
  147. package/dist/lib/components/node/InnerNode.cjs +88 -0
  148. package/dist/lib/components/node/InnerNode.d.ts +33 -0
  149. package/dist/lib/components/node/Node.cjs +87 -0
  150. package/dist/lib/components/node/Node.d.ts +54 -0
  151. package/dist/lib/components/node/_hooks/useNodeConfig.cjs +13 -0
  152. package/dist/lib/components/node/_hooks/useNodeConfig.d.ts +3 -0
  153. package/dist/lib/components/node/_hooks/useNodeContent.cjs +27 -0
  154. package/dist/lib/components/node/_hooks/useNodeContent.d.ts +4 -0
  155. package/dist/lib/components/node/_hooks/useNodeShape.cjs +34 -0
  156. package/dist/lib/components/node/_hooks/useNodeShape.d.ts +4 -0
  157. package/dist/lib/components/node/index.cjs +4 -0
  158. package/dist/lib/components/node/index.d.ts +3 -0
  159. package/dist/lib/components/pathNode/PathNode.cjs +76 -0
  160. package/dist/lib/components/pathNode/PathNode.d.ts +39 -0
  161. package/dist/lib/components/pathNode/index.cjs +4 -0
  162. package/dist/lib/components/pathNode/index.d.ts +3 -0
  163. package/dist/lib/components/pathNode/useAnchor.cjs +49 -0
  164. package/dist/lib/components/pathNode/useAnchor.d.ts +6 -0
  165. package/dist/lib/container/Group.cjs +7 -0
  166. package/dist/lib/container/Group.d.ts +6 -0
  167. package/dist/lib/container/Surface.cjs +23 -0
  168. package/dist/lib/container/Surface.d.ts +17 -0
  169. package/dist/lib/elements/Path.cjs +13 -0
  170. package/dist/lib/elements/Path.d.ts +4 -0
  171. package/dist/lib/elements/Rect.cjs +8 -0
  172. package/dist/lib/elements/Rect.d.ts +6 -0
  173. package/dist/lib/elements/Text.cjs +35 -0
  174. package/dist/lib/elements/Text.d.ts +19 -0
  175. package/dist/lib/hooks/context/useCalculate.cjs +9 -0
  176. package/dist/lib/hooks/context/useCalculate.d.ts +7 -0
  177. package/dist/lib/hooks/context/useNodes.cjs +33 -0
  178. package/dist/lib/hooks/context/useNodes.d.ts +9 -0
  179. package/dist/lib/hooks/context/usePath.cjs +20 -0
  180. package/dist/lib/hooks/context/usePath.d.ts +13 -0
  181. package/dist/lib/hooks/context/useScope.cjs +7 -0
  182. package/dist/lib/hooks/context/useScope.d.ts +11 -0
  183. package/dist/lib/hooks/useForceUpdate.cjs +8 -0
  184. package/dist/lib/hooks/useForceUpdate.d.ts +2 -0
  185. package/dist/lib/index.cjs +12 -0
  186. package/dist/lib/index.d.ts +10 -0
  187. package/dist/lib/model/component/node.cjs +164 -0
  188. package/dist/lib/model/component/node.d.ts +45 -0
  189. package/dist/lib/model/component/path.cjs +47 -0
  190. package/dist/lib/model/component/path.d.ts +19 -0
  191. package/dist/lib/model/equation/line.cjs +75 -0
  192. package/dist/lib/model/equation/line.d.ts +21 -0
  193. package/dist/lib/model/geometry/point/DescartesPoint.cjs +50 -0
  194. package/dist/lib/model/geometry/point/DescartesPoint.d.ts +21 -0
  195. package/dist/lib/model/geometry/point/PolarPoint.cjs +27 -0
  196. package/dist/lib/model/geometry/point/PolarPoint.d.ts +14 -0
  197. package/dist/lib/node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/color.cjs +338 -0
  198. package/dist/lib/node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/define.cjs +13 -0
  199. package/dist/lib/node_modules/.pnpm/d3-path@3.1.0/node_modules/d3-path/src/path.cjs +88 -0
  200. package/dist/lib/node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/array.cjs +6 -0
  201. package/dist/lib/node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/constant.cjs +8 -0
  202. package/dist/lib/node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/linear.cjs +39 -0
  203. package/dist/lib/node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/line.cjs +41 -0
  204. package/dist/lib/node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/path.cjs +19 -0
  205. package/dist/lib/node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/point.cjs +10 -0
  206. package/dist/lib/node_modules/.pnpm/react@19.0.0/node_modules/react/cjs/react-jsx-runtime.development.cjs +20 -0
  207. package/dist/lib/node_modules/.pnpm/react@19.0.0/node_modules/react/cjs/react-jsx-runtime.production.cjs +41 -0
  208. package/dist/lib/node_modules/.pnpm/react@19.0.0/node_modules/react/jsx-runtime.cjs +17 -0
  209. package/dist/lib/types/coordinate/descartes.d.ts +23 -0
  210. package/dist/lib/types/coordinate/index.d.ts +5 -0
  211. package/dist/lib/types/coordinate/polar.d.ts +5 -0
  212. package/dist/lib/types/distance/index.d.ts +8 -0
  213. package/dist/lib/types/distance/sep.d.ts +9 -0
  214. package/dist/lib/types/shape/index.cjs +9 -0
  215. package/dist/lib/types/shape/index.d.ts +8 -0
  216. package/dist/lib/types/shape/rect.cjs +30 -0
  217. package/dist/lib/types/shape/rect.d.ts +25 -0
  218. package/dist/lib/types/svg/font.d.ts +10 -0
  219. package/dist/lib/types/svg/stroke.d.ts +10 -0
  220. package/dist/lib/types/tikz/index.d.ts +6 -0
  221. package/dist/lib/utils/compare.cjs +20 -0
  222. package/dist/lib/utils/compare.d.ts +4 -0
  223. package/dist/lib/utils/css.cjs +26 -0
  224. package/dist/lib/utils/css.d.ts +6 -0
  225. package/dist/lib/utils/math.cjs +26 -0
  226. package/dist/lib/utils/math.d.ts +9 -0
  227. package/dist/lib/utils/string.cjs +7 -0
  228. package/dist/lib/utils/string.d.ts +7 -0
  229. package/dist/lib/utils/style/font.cjs +34 -0
  230. package/dist/lib/utils/style/font.d.ts +17 -0
  231. package/dist/lib/utils/style/stroke.cjs +40 -0
  232. package/dist/lib/utils/style/stroke.d.ts +19 -0
  233. package/package.json +57 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 pionpill
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,2 @@
1
+ # retikz
2
+ 使用 react,d3 实现 tikz 绘制流程图
@@ -0,0 +1,5 @@
1
+ import { __require as requireJsxRuntime } from "../node_modules/.pnpm/react@19.0.0/node_modules/react/jsx-runtime.js";
2
+ var jsxRuntimeExports = requireJsxRuntime();
3
+ export {
4
+ jsxRuntimeExports as j
5
+ };
@@ -0,0 +1,4 @@
1
+ var jsxRuntime = { exports: {} };
2
+ export {
3
+ jsxRuntime as __module
4
+ };
@@ -0,0 +1,4 @@
1
+ var reactJsxRuntime_development = {};
2
+ export {
3
+ reactJsxRuntime_development as __exports
4
+ };
@@ -0,0 +1,4 @@
1
+ var reactJsxRuntime_production = {};
2
+ export {
3
+ reactJsxRuntime_production as __exports
4
+ };
@@ -0,0 +1,6 @@
1
+ import { FC, 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: FC<PropsWithChildren<ScopeProps>>;
6
+ export default Scope;
@@ -0,0 +1,10 @@
1
+ import { j as jsxRuntimeExports } from "../_virtual/jsx-runtime.js";
2
+ import { ScopeContext } from "../hooks/context/useScope.js";
3
+ import Group from "../container/Group.js";
4
+ const Scope = (props) => {
5
+ const { children, ref, ...resProps } = props;
6
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(ScopeContext, { value: resProps, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Group, { ref, children }) });
7
+ };
8
+ export {
9
+ Scope as default
10
+ };
@@ -0,0 +1,9 @@
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;
@@ -0,0 +1,12 @@
1
+ import { j as jsxRuntimeExports } from "../_virtual/jsx-runtime.js";
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__ */ jsxRuntimeExports.jsx(NodesContext, { value: /* @__PURE__ */ new Map(), children: /* @__PURE__ */ jsxRuntimeExports.jsx(CalculateContext, { value: { precision }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ScopeContext, { value: { offset, node, draw }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Surface, { ...resProps }) }) }) });
9
+ };
10
+ export {
11
+ TikZ as default
12
+ };
@@ -0,0 +1,18 @@
1
+ import { FC, ReactElement, Ref } 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
+ ref?: Ref<SVGPathElement>;
8
+ way: DrawWayType[];
9
+ /** 位置偏移 */
10
+ offset?: PointPosition;
11
+ /** 同 stroke */
12
+ color?: string;
13
+ /** 线段样式快捷属性 */
14
+ strokeType?: StrokeType;
15
+ children?: ReactElement | ReactElement[] | null;
16
+ } & StrokeProps & StrokeShortcutProps & ArrowProps;
17
+ declare const Draw: FC<DrawProps>;
18
+ export default Draw;
@@ -0,0 +1,34 @@
1
+ import { j as jsxRuntimeExports } from "../../_virtual/jsx-runtime.js";
2
+ import useScope from "../../hooks/context/useScope.js";
3
+ import DescartesPoint from "../../model/geometry/point/DescartesPoint.js";
4
+ import { convertStrokeType, convertStrokeShortcut } from "../../utils/style/stroke.js";
5
+ import InnerDraw from "./InnerDraw.js";
6
+ const Draw = (props) => {
7
+ const { draw: scopeProps } = useScope();
8
+ const realProps = { ...scopeProps, ...props };
9
+ const { offset, color, stroke, strokeWidth, startArrow, startArrows, endArrow, endArrows, ...drawProps } = realProps;
10
+ const realStroke = stroke || color;
11
+ const realStartArrow = typeof startArrow === "string" ? { type: startArrow } : startArrow;
12
+ const realStartArrows = typeof startArrows === "string" ? { type: startArrows } : startArrows;
13
+ const realEndArrow = typeof endArrow === "string" ? { type: endArrow } : endArrow;
14
+ const realEndArrows = typeof endArrows === "string" ? { type: endArrows } : endArrows;
15
+ const convertOffset = offset ? DescartesPoint.formatPosition(offset) : [0, 0];
16
+ const getStrokeTypes = () => drawProps.strokeType ? convertStrokeType(drawProps.strokeType, strokeWidth || 1) : convertStrokeShortcut(drawProps, strokeWidth || 1);
17
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
18
+ InnerDraw,
19
+ {
20
+ ...getStrokeTypes(),
21
+ offset: convertOffset,
22
+ stroke: realStroke,
23
+ strokeWidth: strokeWidth || 1,
24
+ startArrow: realStartArrow,
25
+ startArrows: realStartArrows,
26
+ endArrow: realEndArrow,
27
+ endArrows: realEndArrows,
28
+ ...drawProps
29
+ }
30
+ );
31
+ };
32
+ export {
33
+ Draw as default
34
+ };
@@ -0,0 +1,13 @@
1
+ import { FC, ReactNode, Ref } 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
+ ref?: Ref<SVGPathElement>;
7
+ /** 位置偏移 */
8
+ offset: Position;
9
+ way: DrawWayType[];
10
+ children?: ReactNode;
11
+ } & StrokeProps & ArrowProps<ArrowConfig>;
12
+ declare const InnerDraw: FC<InnerDrawProps>;
13
+ export default InnerDraw;
@@ -0,0 +1,47 @@
1
+ import { j as jsxRuntimeExports } from "../../_virtual/jsx-runtime.js";
2
+ import { 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 = (props) => {
9
+ const { way, ref, 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__ */ jsxRuntimeExports.jsx(PathContext, { value: new PathModel(new Array(waySegments.length).fill([]), strokeProps.strokeWidth || 1, false), children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Group, { ref, transform: `translate(${offset[0]}, ${offset[1]})`, children: [
30
+ waySegments.map((segment, index) => /* @__PURE__ */ jsxRuntimeExports.jsx(
31
+ DrawSegment,
32
+ {
33
+ index,
34
+ isLastSegment: index === waySegments.length - 1,
35
+ way: segment,
36
+ ...strokeProps,
37
+ endArrow: index === waySegments.length - 1 ? endArrow || endArrows : endArrows,
38
+ startArrow: index === waySegments.length - 1 ? startArrow || startArrows : startArrows
39
+ },
40
+ JSON.stringify(segment)
41
+ )),
42
+ children
43
+ ] }) });
44
+ };
45
+ export {
46
+ InnerDraw as default
47
+ };
@@ -0,0 +1,9 @@
1
+ import { ArrowAttributes, ArrowPathConfig } from './types';
2
+ export type { ArrowAttributes as ArrowPositionAttributes, ArrowPathConfig };
3
+ export type ArrowType = 'Stealth';
4
+ declare const getArrowPath: (type: ArrowType, attributes: ArrowAttributes) => {
5
+ d: string;
6
+ offsetDistance: number;
7
+ insertDistance: number;
8
+ };
9
+ export default getArrowPath;
@@ -0,0 +1,10 @@
1
+ import getStealthPath from "./stealth.js";
2
+ const getArrowPath = (type, attributes) => {
3
+ switch (type) {
4
+ case "Stealth":
5
+ return getStealthPath(attributes);
6
+ }
7
+ };
8
+ export {
9
+ getArrowPath as default
10
+ };
@@ -0,0 +1,7 @@
1
+ import { ArrowAttributes } from './types';
2
+ declare const getStealthPath: (attributes: ArrowAttributes) => {
3
+ d: string;
4
+ offsetDistance: number;
5
+ insertDistance: number;
6
+ };
7
+ export default getStealthPath;
@@ -0,0 +1,29 @@
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
+ };
@@ -0,0 +1,21 @@
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
+ };
@@ -0,0 +1,4 @@
1
+ import { PointPosition } from '../../types/coordinate';
2
+ import { DrawPointType } from './types';
3
+ /** 获取点类型 */
4
+ export declare const getDrawPointType: (point: string | PointPosition) => DrawPointType;
@@ -0,0 +1,12 @@
1
+ const offsetReg = /\+[[(]?[+-]?\d+(?:\.\d+)?,\s*[+-]?\d+(?:\.\d+)?[)\]]?/;
2
+ const moveReg = /\+\+[[(]?[+-]?\d+(?:\.\d+)?,\s*[+-]?\d+(?:\.\d+)?[)\]]?/;
3
+ const getDrawPointType = (point) => {
4
+ if (typeof point !== "string") return "coordinate";
5
+ if (["-|", "|-"].includes(point)) return "vertical";
6
+ if (point.match(moveReg)) return "move";
7
+ if (point.match(offsetReg)) return "offset";
8
+ return "node";
9
+ };
10
+ export {
11
+ getDrawPointType
12
+ };
@@ -0,0 +1,3 @@
1
+ import { default as Draw } from './Draw';
2
+ export type { DrawProps } from './Draw';
3
+ export default Draw;
@@ -0,0 +1,12 @@
1
+ import { FC } from 'react';
2
+ import { Position } from '../../../types/coordinate/descartes';
3
+ import { StrokeProps } from '../../../types/svg/stroke';
4
+ import { ArrowConfig } from '../types';
5
+ export type InnerDrawSegmentProps = {
6
+ /** 路径,始末节点为 undefined 表示临近点在 node 外边界内 */
7
+ way: Position[];
8
+ startArrow?: ArrowConfig;
9
+ endArrow?: ArrowConfig;
10
+ } & StrokeProps;
11
+ declare const InnerDrawSegment: FC<InnerDrawSegmentProps>;
12
+ export default InnerDrawSegment;
@@ -0,0 +1,41 @@
1
+ import { j as jsxRuntimeExports } from "../../../_virtual/jsx-runtime.js";
2
+ import { useMemo } from "react";
3
+ import Path from "../../../elements/Path.js";
4
+ import Group from "../../../container/Group.js";
5
+ import useArrow from "./useArrow.js";
6
+ import line from "../../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/line.js";
7
+ const InnerDrawSegment = (props) => {
8
+ const { way, startArrow, endArrow, ...strokeProps } = props;
9
+ const pickedArrowStrokeProps = {
10
+ stroke: strokeProps.stroke,
11
+ strokeWidth: strokeProps.strokeWidth,
12
+ strokeOpacity: strokeProps.strokeOpacity
13
+ };
14
+ const startArrowPath = useArrow(
15
+ { position: way[0], nearPosition: way[1], arrowType: "start" },
16
+ startArrow ? { ...pickedArrowStrokeProps, ...startArrow } : void 0
17
+ );
18
+ const endArrowPath = useArrow(
19
+ { position: way[way.length - 1], nearPosition: way[way.length - 2], arrowType: "end" },
20
+ endArrow ? { ...pickedArrowStrokeProps, ...endArrow } : void 0
21
+ );
22
+ const d = useMemo(() => {
23
+ const realWay = [...way];
24
+ if (startArrowPath) {
25
+ realWay[0] = startArrowPath.linkPoint;
26
+ }
27
+ if (endArrowPath) {
28
+ realWay[realWay.length - 1] = endArrowPath.linkPoint;
29
+ }
30
+ const straightLine = line().x((d2) => d2[0]).y((d2) => d2[1]);
31
+ return straightLine(realWay);
32
+ }, [way]);
33
+ return endArrowPath || startArrowPath ? /* @__PURE__ */ jsxRuntimeExports.jsxs(Group, { children: [
34
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Path, { d: d ?? "", ...strokeProps }),
35
+ startArrowPath ? startArrowPath.arrowPath : null,
36
+ endArrowPath ? endArrowPath.arrowPath : null
37
+ ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Path, { d: d ?? "", ...strokeProps });
38
+ };
39
+ export {
40
+ InnerDrawSegment as default
41
+ };
@@ -0,0 +1,19 @@
1
+ import { FC } from 'react';
2
+ import { StrokeProps } from '../../../types/svg/stroke';
3
+ import { TikZKey } from '../../../types/tikz';
4
+ import { ArrowConfig, DrawWaySegmentType } from '../types';
5
+ export type DrawSegmentProps = {
6
+ /** 路径,首位可以是 Node,其他必须是坐标 */
7
+ way: DrawWaySegmentType;
8
+ index: number;
9
+ isLastSegment: boolean;
10
+ /** 线段颜色 */
11
+ color?: TikZKey;
12
+ /** 线段样式 */
13
+ strokeType?: 'solid' | 'dashed' | 'dotted';
14
+ startArrow?: ArrowConfig;
15
+ endArrow?: ArrowConfig;
16
+ } & StrokeProps;
17
+ /** 单条连续的路径 */
18
+ declare const DrawSegment: FC<DrawSegmentProps>;
19
+ export default DrawSegment;
@@ -0,0 +1,41 @@
1
+ import { j as jsxRuntimeExports } from "../../../_virtual/jsx-runtime.js";
2
+ import { useMemo } from "react";
3
+ import NodeModel from "../../../model/component/node.js";
4
+ import { convertStrokeType } from "../../../utils/style/stroke.js";
5
+ import InnerDrawSegment from "./Segment.js";
6
+ import useConvertWay from "./useConvertWay.js";
7
+ import usePath from "../../../hooks/context/usePath.js";
8
+ const DrawSegment = (props) => {
9
+ const { way, index, color, startArrow, endArrow, isLastSegment, ...resProps } = props;
10
+ const { strokeType = "solid", strokeWidth = 1, ...strokeProps } = resProps;
11
+ const [convertedWay, nodesInit] = useConvertWay(way);
12
+ const { model, updateModel } = usePath();
13
+ const pointWay = useMemo(() => {
14
+ const realWay = convertedWay.map((wayPoint, index2) => {
15
+ if (wayPoint instanceof NodeModel) {
16
+ const neighborPoint = index2 === 0 ? convertedWay[1] : convertedWay[index2 - 1];
17
+ return wayPoint.getCrossPoint(neighborPoint instanceof NodeModel ? neighborPoint.center : neighborPoint);
18
+ }
19
+ return wayPoint;
20
+ });
21
+ const newWay = [...model == null ? void 0 : model.ways];
22
+ newWay[index] = realWay;
23
+ updateModel({ ways: newWay, init: nodesInit });
24
+ return realWay;
25
+ }, [convertedWay]);
26
+ if (!nodesInit) return null;
27
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
28
+ InnerDrawSegment,
29
+ {
30
+ way: pointWay,
31
+ startArrow,
32
+ endArrow,
33
+ strokeWidth,
34
+ ...convertStrokeType(strokeType, strokeWidth),
35
+ ...strokeProps
36
+ }
37
+ );
38
+ };
39
+ export {
40
+ DrawSegment as default
41
+ };
@@ -0,0 +1,12 @@
1
+ import { ArrowConfig } from '../types';
2
+ import { Position } from '../../../types/coordinate/descartes';
3
+ export type ArrowLinkConfig = {
4
+ nearPosition: Position;
5
+ position: Position;
6
+ arrowType: 'start' | 'end';
7
+ };
8
+ declare const useArrow: (linkConfig: ArrowLinkConfig, arrowConfig?: ArrowConfig) => {
9
+ linkPoint: Position;
10
+ arrowPath: import("react/jsx-runtime").JSX.Element;
11
+ } | null;
12
+ export default useArrow;
@@ -0,0 +1,52 @@
1
+ import { j as jsxRuntimeExports } from "../../../_virtual/jsx-runtime.js";
2
+ import { useMemo } from "react";
3
+ import useCalculate from "../../../hooks/context/useCalculate.js";
4
+ import getArrowPath from "../arrow/index.js";
5
+ import Path from "../../../elements/Path.js";
6
+ import Line from "../../../model/equation/line.js";
7
+ import { convertPrecision } from "../../../utils/math.js";
8
+ const useArrow = (linkConfig, arrowConfig) => {
9
+ const { precision } = useCalculate();
10
+ return useMemo(() => {
11
+ if (!arrowConfig) return null;
12
+ const { position, nearPosition } = linkConfig;
13
+ const { type, stroke, linkType = "end", round, strokeLinejoin, strokeWidth, ...strokeProps } = arrowConfig;
14
+ const degree = Line.getDegree(nearPosition, position);
15
+ const isRound = round || strokeLinejoin === "round";
16
+ const realStrokeWidth = strokeWidth ?? 1;
17
+ const { d, offsetDistance, insertDistance } = getArrowPath(type, arrowConfig);
18
+ const endOffset = [
19
+ (isRound ? realStrokeWidth : offsetDistance) * Math.cos(degree),
20
+ (isRound ? realStrokeWidth : offsetDistance) * Math.sin(degree)
21
+ ];
22
+ const translatePosition = linkType === "end" ? [position[0] - endOffset[0], position[1] - endOffset[1]] : [position[0] + insertDistance * Math.cos(degree), position[1] + insertDistance * Math.sin(degree)];
23
+ const linkPoint = linkType === "end" ? [
24
+ position[0] - insertDistance * Math.cos(degree) - endOffset[0],
25
+ position[1] - insertDistance * Math.sin(degree) - endOffset[1]
26
+ ] : position;
27
+ const transform = `translate(
28
+ ${convertPrecision(translatePosition[0], precision)}, ${convertPrecision(
29
+ translatePosition[1],
30
+ precision
31
+ )}) rotate(${convertPrecision(degree * (180 / Math.PI), precision)})`;
32
+ return {
33
+ linkPoint,
34
+ arrowPath: /* @__PURE__ */ jsxRuntimeExports.jsx(
35
+ Path,
36
+ {
37
+ d,
38
+ strokeWidth,
39
+ strokeLinejoin: round ? "round" : "miter",
40
+ strokeMiterlimit: 10,
41
+ fill: stroke || "currentColor",
42
+ stroke,
43
+ transform,
44
+ ...strokeProps
45
+ }
46
+ )
47
+ };
48
+ }, [arrowConfig, linkConfig]);
49
+ };
50
+ export {
51
+ useArrow as default
52
+ };
@@ -0,0 +1,14 @@
1
+ import { default as NodeModel } from '../../../model/component/node';
2
+ import { PointPosition } from '../../../types/coordinate';
3
+ import { Position } from '../../../types/coordinate/descartes';
4
+ import { DrawWaySegmentType } from '../types';
5
+ /** 将坐标格式转换为笛卡尔坐标数组形式 */
6
+ export declare const formatPointPosition: (point: PointPosition) => Position;
7
+ /** 获取两点间的垂直点 */
8
+ export declare const getVerticalPoint: (point1: PointPosition, point2: PointPosition, type: "-|" | "|-") => Position;
9
+ /**
10
+ * 将特殊路径点转换为坐标,Node 节点转换为对应的 Model
11
+ * 目前支持的节点类型:node,各种坐标,垂点,位移点
12
+ */
13
+ declare const useConvertWay: (way: DrawWaySegmentType) => [Array<Position | NodeModel>, boolean];
14
+ export default useConvertWay;
@@ -0,0 +1,95 @@
1
+ import { useRef, useMemo, useLayoutEffect } from "react";
2
+ import useNodes from "../../../hooks/context/useNodes.js";
3
+ import useForceUpdate from "../../../hooks/useForceUpdate.js";
4
+ import DescartesPoint from "../../../model/geometry/point/DescartesPoint.js";
5
+ import PolarPoint from "../../../model/geometry/point/PolarPoint.js";
6
+ import { getDrawPointType } from "../common.js";
7
+ const formatPointPosition = (point) => {
8
+ if (Array.isArray(point)) return point;
9
+ if (point.hasOwnProperty("x") && point.hasOwnProperty("y")) {
10
+ const p = point;
11
+ return [p.x, p.y];
12
+ }
13
+ return PolarPoint.convertPolarToDescartesPosition(point);
14
+ };
15
+ const getVerticalPoint = (point1, point2, type) => {
16
+ const p1 = formatPointPosition(point1);
17
+ const p2 = formatPointPosition(point2);
18
+ return type === "-|" ? [p2[0], p1[1]] : [p1[0], p2[1]];
19
+ };
20
+ const convertOffsetAndMovePoint = (point) => {
21
+ const filterPoint = point.replace(/[+()\[\]\s]/g, "");
22
+ return filterPoint.split(",").map((item) => parseFloat(item));
23
+ };
24
+ const useConvertWay = (way) => {
25
+ const { getModel, subscribeModel } = useNodes();
26
+ const forceUpdate = useForceUpdate();
27
+ const nodeUpdateCount = useRef(0);
28
+ let cursor = [0, 0];
29
+ const tryGetModel = (name) => {
30
+ const model = getModel(name);
31
+ if (!model) {
32
+ throw new Error(`Node ${name} is not defined`);
33
+ }
34
+ cursor = model.center;
35
+ return model;
36
+ };
37
+ const subscribeCbs = [];
38
+ let allNodeInit = true;
39
+ const result = useMemo(
40
+ () => way.map((item, index) => {
41
+ const type = getDrawPointType(item);
42
+ switch (type) {
43
+ case "coordinate":
44
+ const corPosition = formatPointPosition(item);
45
+ cursor = corPosition;
46
+ return corPosition;
47
+ case "node":
48
+ if (![0, way.length - 1].includes(index)) {
49
+ throw new Error(
50
+ "Node can only be the first or last point on DrawSegment component, this may be a retikz bug, please report it."
51
+ );
52
+ }
53
+ const nodeModel = tryGetModel(item);
54
+ if (!nodeModel.init) allNodeInit = false;
55
+ const cb = subscribeModel(item, () => {
56
+ nodeUpdateCount.current += 1;
57
+ forceUpdate();
58
+ });
59
+ if (cb) subscribeCbs.push(cb);
60
+ cursor = nodeModel.center;
61
+ return nodeModel;
62
+ case "vertical":
63
+ if ([0, way.length - 1].includes(index)) {
64
+ throw new Error("Vertical point can not be the first point on path.");
65
+ }
66
+ const beforePosition = cursor;
67
+ const afterPoint = way[index + 1];
68
+ const afterPointType = getDrawPointType(afterPoint);
69
+ if (["vertical", "offset", "move"].includes(afterPointType)) {
70
+ throw new Error("Vertical point can not be followed by these point type: vertical offset move.");
71
+ }
72
+ const afterPosition = afterPointType === "node" ? tryGetModel(afterPoint).center : formatPointPosition(afterPoint);
73
+ const verPosition = getVerticalPoint(beforePosition, afterPosition, item);
74
+ cursor = verPosition;
75
+ return cursor;
76
+ default:
77
+ if (index === 0) throw new Error("offset/move point can not be the first point on path.");
78
+ const convertedPos = convertOffsetAndMovePoint(item);
79
+ const curPos = DescartesPoint.plus(convertedPos, cursor);
80
+ if (type === "move") cursor = curPos;
81
+ return curPos;
82
+ }
83
+ }),
84
+ [way, nodeUpdateCount.current]
85
+ );
86
+ useLayoutEffect(() => () => {
87
+ subscribeCbs.forEach((cb) => cb && cb());
88
+ });
89
+ return [result, allNodeInit];
90
+ };
91
+ export {
92
+ useConvertWay as default,
93
+ formatPointPosition,
94
+ getVerticalPoint
95
+ };
@@ -0,0 +1,29 @@
1
+ import { PointPosition } from '../../types/coordinate';
2
+ import { StrokeProps } from '../../types/svg/stroke';
3
+ import { TikZKey } from '../../types/tikz';
4
+ import { ArrowPositionAttributes, ArrowType } from './arrow';
5
+ export type ArrowConfig = {
6
+ type: ArrowType;
7
+ fill?: string;
8
+ } & ArrowPositionAttributes & StrokeProps;
9
+ /** 垂直路径点,临近的节点不能都是特殊路径点 */
10
+ export type VerticalDrawPosition = '-|' | '|-';
11
+ /** 偏移与移动点 */
12
+ export type OffSetOrMovePosition = string;
13
+ /** 路径点类型:节点,坐标,垂点,偏移点,移动点 */
14
+ export type DrawPointType = 'node' | 'coordinate' | 'vertical' | 'offset' | 'move';
15
+ /** 路径节点类型 */
16
+ export type DrawWayType = TikZKey | PointPosition | VerticalDrawPosition | OffSetOrMovePosition;
17
+ /** 路径片段节点类型 */
18
+ export type DrawWaySegmentType = [
19
+ TikZKey | PointPosition,
20
+ ...Array<PointPosition | VerticalDrawPosition | OffSetOrMovePosition>,
21
+ TikZKey | PointPosition
22
+ ];
23
+ /** 箭头属性 */
24
+ export type ArrowProps<T = ArrowType | ArrowConfig> = {
25
+ startArrow?: T;
26
+ startArrows?: T;
27
+ endArrow?: T;
28
+ endArrows?: T;
29
+ };