@retikz/core 0.2.0-alpha.3 → 0.2.0-alpha.5

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 (67) hide show
  1. package/dist/es/compile/compile.d.ts.map +1 -1
  2. package/dist/es/compile/compile.js +74 -12
  3. package/dist/es/compile/node.d.ts +4 -0
  4. package/dist/es/compile/node.d.ts.map +1 -1
  5. package/dist/es/compile/node.js +83 -32
  6. package/dist/es/compile/path/index.d.ts.map +1 -1
  7. package/dist/es/compile/path/index.js +91 -12
  8. package/dist/es/compile/path/relative.d.ts.map +1 -1
  9. package/dist/es/compile/path/relative.js +5 -1
  10. package/dist/es/geometry/arc.d.ts +11 -0
  11. package/dist/es/geometry/arc.d.ts.map +1 -1
  12. package/dist/es/geometry/arc.js +27 -1
  13. package/dist/es/geometry/rect.d.ts +23 -0
  14. package/dist/es/geometry/rect.d.ts.map +1 -1
  15. package/dist/es/geometry/rect.js +84 -1
  16. package/dist/es/geometry/segment.d.ts +2 -0
  17. package/dist/es/geometry/segment.d.ts.map +1 -1
  18. package/dist/es/geometry/segment.js +12 -1
  19. package/dist/es/index.d.ts +2 -2
  20. package/dist/es/index.d.ts.map +1 -1
  21. package/dist/es/index.js +2 -2
  22. package/dist/es/ir/node.d.ts +33 -4
  23. package/dist/es/ir/node.d.ts.map +1 -1
  24. package/dist/es/ir/node.js +9 -2
  25. package/dist/es/ir/path/path.d.ts +230 -5
  26. package/dist/es/ir/path/path.d.ts.map +1 -1
  27. package/dist/es/ir/path/path.js +1 -0
  28. package/dist/es/ir/path/step.d.ts +311 -8
  29. package/dist/es/ir/path/step.d.ts.map +1 -1
  30. package/dist/es/ir/path/step.js +36 -11
  31. package/dist/es/ir/scope.d.ts +348 -16
  32. package/dist/es/ir/scope.d.ts.map +1 -1
  33. package/dist/es/ir/scope.js +5 -2
  34. package/dist/lib/compile/compile.cjs +74 -12
  35. package/dist/lib/compile/compile.d.ts.map +1 -1
  36. package/dist/lib/compile/node.cjs +83 -32
  37. package/dist/lib/compile/node.d.ts +4 -0
  38. package/dist/lib/compile/node.d.ts.map +1 -1
  39. package/dist/lib/compile/path/index.cjs +89 -10
  40. package/dist/lib/compile/path/index.d.ts.map +1 -1
  41. package/dist/lib/compile/path/relative.cjs +5 -1
  42. package/dist/lib/compile/path/relative.d.ts.map +1 -1
  43. package/dist/lib/geometry/arc.cjs +28 -0
  44. package/dist/lib/geometry/arc.d.ts +11 -0
  45. package/dist/lib/geometry/arc.d.ts.map +1 -1
  46. package/dist/lib/geometry/rect.cjs +84 -0
  47. package/dist/lib/geometry/rect.d.ts +23 -0
  48. package/dist/lib/geometry/rect.d.ts.map +1 -1
  49. package/dist/lib/geometry/segment.cjs +12 -0
  50. package/dist/lib/geometry/segment.d.ts +2 -0
  51. package/dist/lib/geometry/segment.d.ts.map +1 -1
  52. package/dist/lib/index.cjs +1 -0
  53. package/dist/lib/index.d.ts +2 -2
  54. package/dist/lib/index.d.ts.map +1 -1
  55. package/dist/lib/ir/node.cjs +9 -2
  56. package/dist/lib/ir/node.d.ts +33 -4
  57. package/dist/lib/ir/node.d.ts.map +1 -1
  58. package/dist/lib/ir/path/path.cjs +1 -0
  59. package/dist/lib/ir/path/path.d.ts +230 -5
  60. package/dist/lib/ir/path/path.d.ts.map +1 -1
  61. package/dist/lib/ir/path/step.cjs +36 -10
  62. package/dist/lib/ir/path/step.d.ts +311 -8
  63. package/dist/lib/ir/path/step.d.ts.map +1 -1
  64. package/dist/lib/ir/scope.cjs +5 -2
  65. package/dist/lib/ir/scope.d.ts +348 -16
  66. package/dist/lib/ir/scope.d.ts.map +1 -1
  67. package/package.json +1 -1
@@ -73,5 +73,88 @@ var rect = {
73
73
  return localToWorld(r, [localX * t, localY * t]);
74
74
  }
75
75
  };
76
+ /**
77
+ * 矩形 outline:两对角 → 顺时针 path 算子序列
78
+ * @description from/to 任意顺序,归一化 (x0,y0)=min、(x1,y1)=max。直角 = 4 line + close(起点左上 (x0,y0));
79
+ * 圆角 = 4 line + 4 quarter-arc + close(起点 (x0+r, y0))。roundedCorners clamp 到 min(w,h)/2。
80
+ * 角度约定同 geometry/arc(y-down:0=+x, 90=+y/下, 180=-x, 270=-y/上)。
81
+ */
82
+ var rectOutline = (from, to, roundedCorners) => {
83
+ const x0 = Math.min(from[0], to[0]);
84
+ const x1 = Math.max(from[0], to[0]);
85
+ const y0 = Math.min(from[1], to[1]);
86
+ const y1 = Math.max(from[1], to[1]);
87
+ const r = roundedCorners === void 0 ? 0 : Math.min(roundedCorners, (x1 - x0) / 2, (y1 - y0) / 2);
88
+ if (r <= 0) return [
89
+ {
90
+ kind: "move",
91
+ to: [x0, y0]
92
+ },
93
+ {
94
+ kind: "line",
95
+ to: [x1, y0]
96
+ },
97
+ {
98
+ kind: "line",
99
+ to: [x1, y1]
100
+ },
101
+ {
102
+ kind: "line",
103
+ to: [x0, y1]
104
+ },
105
+ { kind: "close" }
106
+ ];
107
+ return [
108
+ {
109
+ kind: "move",
110
+ to: [x0 + r, y0]
111
+ },
112
+ {
113
+ kind: "line",
114
+ to: [x1 - r, y0]
115
+ },
116
+ {
117
+ kind: "arc",
118
+ center: [x1 - r, y0 + r],
119
+ radius: r,
120
+ startAngle: 270,
121
+ endAngle: 360
122
+ },
123
+ {
124
+ kind: "line",
125
+ to: [x1, y1 - r]
126
+ },
127
+ {
128
+ kind: "arc",
129
+ center: [x1 - r, y1 - r],
130
+ radius: r,
131
+ startAngle: 0,
132
+ endAngle: 90
133
+ },
134
+ {
135
+ kind: "line",
136
+ to: [x0 + r, y1]
137
+ },
138
+ {
139
+ kind: "arc",
140
+ center: [x0 + r, y1 - r],
141
+ radius: r,
142
+ startAngle: 90,
143
+ endAngle: 180
144
+ },
145
+ {
146
+ kind: "line",
147
+ to: [x0, y0 + r]
148
+ },
149
+ {
150
+ kind: "arc",
151
+ center: [x0 + r, y0 + r],
152
+ radius: r,
153
+ startAngle: 180,
154
+ endAngle: 270
155
+ },
156
+ { kind: "close" }
157
+ ];
158
+ };
76
159
  //#endregion
77
- export { RECT_ANCHORS, rect };
160
+ export { RECT_ANCHORS, rect, rectOutline };
@@ -28,6 +28,8 @@ export declare const cubicSegmentSample: (from: Position, c1: Position, c2: Posi
28
28
  export declare const foldSegmentSample: (from: Position, corner: Position, to: Position, t: number) => SegmentSample;
29
29
  /** 弧段(角度度数,与 ir/path arc 同约定);切线沿扫描方向:endAngle ≥ start 取 (-sin,cos),否则反向 */
30
30
  export declare const arcSegmentSample: (center: Position, radius: number, startAngleDeg: number, endAngleDeg: number, t: number) => SegmentSample;
31
+ /** 椭圆弧段(参数角度数,与 ir/path arc 同约定);点用 (rx·cos, ry·sin),切线沿扫描方向 */
32
+ export declare const ellipseArcSegmentSample: (center: Position, rx: number, ry: number, startAngleDeg: number, endAngleDeg: number, t: number) => SegmentSample;
31
33
  /** 整圆,从 0°(east) 开始,与 compile/path circlePath 输出方向(右→左→右,sweep=1)一致 */
32
34
  export declare const circleSegmentSample: (center: Position, radius: number, t: number) => SegmentSample;
33
35
  /** 整椭圆,参数化 (rx·cos(2πt), ry·sin(2πt)) */
@@ -1 +1 @@
1
- {"version":3,"file":"segment.d.ts","sourceRoot":"","sources":["../../../src/geometry/segment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAiBxC;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,wBAAwB;IACxB,KAAK,EAAE,QAAQ,CAAC;IAChB,iCAAiC;IACjC,OAAO,EAAE,QAAQ,CAAC;CACnB,CAAC;AAQF,oBAAoB;AACpB,eAAO,MAAM,iBAAiB,GAC5B,MAAM,QAAQ,EACd,IAAI,QAAQ,EACZ,GAAG,MAAM,KACR,aAGD,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAC5B,MAAM,QAAQ,EACd,SAAS,QAAQ,EACjB,IAAI,QAAQ,EACZ,GAAG,MAAM,KACR,aASF,CAAC;AAEF;;;G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,kBAAkB,GAC7B,MAAM,QAAQ,EACd,IAAI,QAAQ,EACZ,IAAI,QAAQ,EACZ,IAAI,QAAQ,EACZ,GAAG,MAAM,KACR,aAqBF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAC5B,MAAM,QAAQ,EACd,QAAQ,QAAQ,EAChB,IAAI,QAAQ,EACZ,GAAG,MAAM,KACR,aAGF,CAAC;AAEF,4EAA4E;AAC5E,eAAO,MAAM,gBAAgB,GAC3B,QAAQ,QAAQ,EAChB,QAAQ,MAAM,EACd,eAAe,MAAM,EACrB,aAAa,MAAM,EACnB,GAAG,MAAM,KACR,aAUF,CAAC;AAEF,gEAAgE;AAChE,eAAO,MAAM,uBAAuB,GAClC,QAAQ,QAAQ,EAChB,IAAI,MAAM,EACV,IAAI,MAAM,EACV,eAAe,MAAM,EACrB,aAAa,MAAM,EACnB,GAAG,MAAM,KACR,aAUF,CAAC;AAEF,uEAAuE;AACvE,eAAO,MAAM,mBAAmB,GAC9B,QAAQ,QAAQ,EAChB,QAAQ,MAAM,EACd,GAAG,MAAM,KACR,aASF,CAAC;AAEF,yCAAyC;AACzC,eAAO,MAAM,oBAAoB,GAC/B,QAAQ,QAAQ,EAChB,IAAI,MAAM,EACV,IAAI,MAAM,EACV,GAAG,MAAM,KACR,aASF,CAAC"}
@@ -51,6 +51,17 @@ var arcSegmentSample = (center, radius, startAngleDeg, endAngleDeg, t) => {
51
51
  tangent: normalize([-sin * sweepSign, cos * sweepSign])
52
52
  };
53
53
  };
54
+ /** 椭圆弧段(参数角度数,与 ir/path arc 同约定);点用 (rx·cos, ry·sin),切线沿扫描方向 */
55
+ var ellipseArcSegmentSample = (center, rx, ry, startAngleDeg, endAngleDeg, t) => {
56
+ const rad = (startAngleDeg + t * (endAngleDeg - startAngleDeg)) * DEG_TO_RAD;
57
+ const cos = Math.cos(rad);
58
+ const sin = Math.sin(rad);
59
+ const sweepSign = endAngleDeg >= startAngleDeg ? 1 : -1;
60
+ return {
61
+ point: [center[0] + rx * cos, center[1] + ry * sin],
62
+ tangent: normalize([-rx * sin * sweepSign, ry * cos * sweepSign])
63
+ };
64
+ };
54
65
  /** 整圆,从 0°(east) 开始,与 compile/path circlePath 输出方向(右→左→右,sweep=1)一致 */
55
66
  var circleSegmentSample = (center, radius, t) => {
56
67
  const rad = t * 360 * DEG_TO_RAD;
@@ -72,4 +83,4 @@ var ellipseSegmentSample = (center, rx, ry, t) => {
72
83
  };
73
84
  };
74
85
  //#endregion
75
- export { arcSegmentSample, circleSegmentSample, cubicSegmentSample, ellipseSegmentSample, foldSegmentSample, lineSegmentSample, quadSegmentSample };
86
+ export { arcSegmentSample, circleSegmentSample, cubicSegmentSample, ellipseArcSegmentSample, ellipseSegmentSample, foldSegmentSample, lineSegmentSample, quadSegmentSample };
@@ -2,8 +2,8 @@
2
2
  * @retikz/core 公开 API
3
3
  * @description 任何 framework adapter(@retikz/react、@retikz/vue、@retikz/canvas、@retikz/ssr)只能 import 本文件导出内容,不准走子路径。本包零 React/零 DOM 依赖
4
4
  */
5
- export { PositionSchema, PolarPositionSchema, AtPositionSchema, OffsetPositionSchema, AT_DIRECTIONS, TargetSchema, RelativeTargetSchema, RelativeAccumulateTargetSchema, MoveStepSchema, LineStepSchema, FoldStepSchema, CycleStepSchema, CurveStepSchema, CubicStepSchema, BendStepSchema, ArcStepSchema, CirclePathStepSchema, EllipsePathStepSchema, ControlPointSchema, StepLabelSchema, StepSchema, NodeSchema, NodeLabelSchema, CoordinateSchema, FontSchema, TextBlockSchema, LineSpecSchema, PathSchema, ArrowDetailSchema, ArrowEndDetailSchema, ScopeSchema, NodeDefaultSchema, PathDefaultSchema, LabelDefaultSchema, ArrowDefaultSchema, TransformSchema, ChildSchema, SceneSchema, CURRENT_IR_VERSION, } from './ir';
6
- export type { IRPosition, IRAtPosition, IROffsetPosition, AtDirection, IRTarget, IRRelativeTarget, IRRelativeAccumulateTarget, IRMoveStep, IRLineStep, IRFoldStep, IRCycleStep, IRCurveStep, IRCubicStep, IRBendStep, IRArcStep, IRCirclePathStep, IREllipsePathStep, IRControlPoint, IRStepLabel, IRStep, IRNode, IRNodeLabel, IRCoordinate, IRFont, IRLineSpec, IRTextBlock, IRPath, IRScope, IRNodeDefault, IRPathDefault, IRLabelDefault, IRArrowDefault, StyleChannel, IRTransform, IRTranslateTransform, IRPolarTranslateTransform, IRAtTranslateTransform, IROffsetTranslateTransform, IRRotateTransform, IRScaleTransform, IRChild, IR, ArrowShape, IRArrowDetail, IRArrowEndDetail, NodeShape, BuiltinShapeName, NodeTextAlign, } from './ir';
5
+ export { PositionSchema, PolarPositionSchema, AtPositionSchema, OffsetPositionSchema, AT_DIRECTIONS, TargetSchema, RelativeTargetSchema, RelativeAccumulateTargetSchema, MoveStepSchema, LineStepSchema, FoldStepSchema, CycleStepSchema, CurveStepSchema, CubicStepSchema, BendStepSchema, ArcStepSchema, CirclePathStepSchema, EllipsePathStepSchema, RectangleStepSchema, ControlPointSchema, StepLabelSchema, StepSchema, NodeSchema, NodeLabelSchema, CoordinateSchema, FontSchema, TextBlockSchema, LineSpecSchema, PathSchema, ArrowDetailSchema, ArrowEndDetailSchema, ScopeSchema, NodeDefaultSchema, PathDefaultSchema, LabelDefaultSchema, ArrowDefaultSchema, TransformSchema, ChildSchema, SceneSchema, CURRENT_IR_VERSION, } from './ir';
6
+ export type { IRPosition, IRAtPosition, IROffsetPosition, AtDirection, IRTarget, IRRelativeTarget, IRRelativeAccumulateTarget, IRMoveStep, IRLineStep, IRFoldStep, IRCycleStep, IRCurveStep, IRCubicStep, IRBendStep, IRArcStep, IRCirclePathStep, IREllipsePathStep, IRRectangleStep, IRControlPoint, IRStepLabel, IRStep, IRNode, IRNodeLabel, IRCoordinate, IRFont, IRLineSpec, IRTextBlock, IRPath, IRScope, IRNodeDefault, IRPathDefault, IRLabelDefault, IRArrowDefault, StyleChannel, IRTransform, IRTranslateTransform, IRPolarTranslateTransform, IRAtTranslateTransform, IROffsetTranslateTransform, IRRotateTransform, IRScaleTransform, IRChild, IR, ArrowShape, IRArrowDetail, IRArrowEndDetail, NodeShape, BuiltinShapeName, NodeTextAlign, } from './ir';
7
7
  export { ARROW_SHAPES, DEFAULT_ARROW_SHAPE, HOLLOW_ARROW_SHAPES, ARROW_MARKER_DEFAULT_SIZE, ARROW_MARKER_HOLLOW_DEFAULT_LINE_WIDTH, NODE_SHAPES, NODE_TEXT_ALIGNS, } from './ir';
8
8
  export type { ScenePrimitive, RectPrim, EllipsePrim, TextPrim, TextLine, PathPrim, PathCommand,
9
9
  /** 7 个 named PathCommand 分支(便于 wrapper / Pick<>) */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EACb,YAAY,EACZ,oBAAoB,EACpB,8BAA8B,EAC9B,cAAc,EACd,cAAc,EACd,cAAc,EACd,eAAe,EACf,eAAe,EACf,eAAe,EACf,cAAc,EACd,aAAa,EACb,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,EACf,UAAU,EACV,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,cAAc,EACd,UAAU,EACV,iBAAiB,EACjB,oBAAoB,EACpB,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,WAAW,EACX,WAAW,EACX,kBAAkB,GACnB,MAAM,MAAM,CAAC;AACd,YAAY,EACV,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,QAAQ,EACR,gBAAgB,EAChB,0BAA0B,EAC1B,UAAU,EACV,UAAU,EACV,UAAU,EACV,WAAW,EACX,WAAW,EACX,WAAW,EACX,UAAU,EACV,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,WAAW,EACX,MA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ACN,OAAO,EACP,OAAO,EACP,aAAa,GACd,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAGxF,YAAY,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGtE,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EACb,YAAY,EACZ,oBAAoB,EACpB,8BAA8B,EAC9B,cAAc,EACd,cAAc,EACd,cAAc,EACd,eAAe,EACf,eAAe,EACf,eAAe,EACf,cAAc,EACd,aAAa,EACb,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,UAAU,EACV,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,cAAc,EACd,UAAU,EACV,iBAAiB,EACjB,oBAAoB,EACpB,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,WAAW,EACX,WAAW,EACX,kBAAkB,GACnB,MAAM,MAAM,CAAC;AACd,YAAY,EACV,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,QAAQ,EACR,gBAAgB,EAChB,0BAA0B,EAC1B,UAAU,EACV,UAAU,EACV,UAAU,EACV,WAAW,EACX,WAAW,EACX,WAAW,EACX,UAAU,EACV,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,WAA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V,MAAM,EACN,OAAO,EACP,OAAO,EACP,aAAa,GACd,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAGxF,YAAY,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGtE,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
package/dist/es/index.js CHANGED
@@ -6,7 +6,7 @@ import { FontSchema } from "./ir/font.js";
6
6
  import { LineSpecSchema, TextBlockSchema } from "./ir/text.js";
7
7
  import { ARROW_MARKER_DEFAULT_SIZE, ARROW_MARKER_HOLLOW_DEFAULT_LINE_WIDTH, ARROW_SHAPES, ArrowDetailSchema, ArrowEndDetailSchema, DEFAULT_ARROW_SHAPE, HOLLOW_ARROW_SHAPES } from "./ir/path/arrow.js";
8
8
  import { RelativeAccumulateTargetSchema, RelativeTargetSchema, TargetSchema } from "./ir/path/target.js";
9
- import { ArcStepSchema, BendStepSchema, CirclePathStepSchema, ControlPointSchema, CubicStepSchema, CurveStepSchema, CycleStepSchema, EllipsePathStepSchema, FoldStepSchema, LineStepSchema, MoveStepSchema, StepLabelSchema, StepSchema } from "./ir/path/step.js";
9
+ import { ArcStepSchema, BendStepSchema, CirclePathStepSchema, ControlPointSchema, CubicStepSchema, CurveStepSchema, CycleStepSchema, EllipsePathStepSchema, FoldStepSchema, LineStepSchema, MoveStepSchema, RectangleStepSchema, StepLabelSchema, StepSchema } from "./ir/path/step.js";
10
10
  import { PathSchema } from "./ir/path/path.js";
11
11
  import { NODE_SHAPES, NODE_TEXT_ALIGNS, NodeLabelSchema, NodeSchema } from "./ir/node.js";
12
12
  import { CoordinateSchema } from "./ir/coordinate.js";
@@ -26,4 +26,4 @@ import { parseTargetSugar } from "./parsers/parseTargetSugar.js";
26
26
  import { DrawWay, parseWay } from "./parsers/parseWay.js";
27
27
  import { polar } from "./geometry/polar.js";
28
28
  import { point } from "./geometry/point.js";
29
- export { ARROW_MARKER_DEFAULT_SIZE, ARROW_MARKER_HOLLOW_DEFAULT_LINE_WIDTH, ARROW_SHAPES, AT_DIRECTIONS, ArcStepSchema, ArrowDefaultSchema, ArrowDetailSchema, ArrowEndDetailSchema, AtPositionSchema, BUILTIN_SHAPES, BendStepSchema, CURRENT_IR_VERSION, ChildSchema, CirclePathStepSchema, ControlPointSchema, CoordinateSchema, CubicStepSchema, CurveStepSchema, CycleStepSchema, DEFAULT_ARROW_SHAPE, DrawWay, EllipsePathStepSchema, FoldStepSchema, FontSchema, HOLLOW_ARROW_SHAPES, LabelDefaultSchema, LineSpecSchema, LineStepSchema, MoveStepSchema, NODE_SHAPES, NODE_TEXT_ALIGNS, NodeDefaultSchema, NodeLabelSchema, NodeSchema, OffsetPositionSchema, PathDefaultSchema, PathSchema, PolarPositionSchema, PositionSchema, RECT_ANCHORS, RelativeAccumulateTargetSchema, RelativeTargetSchema, SceneSchema, ScopeSchema, StepLabelSchema, StepSchema, TargetSchema, TextBlockSchema, TransformSchema, circle, compileToScene, computeLayout, diamond, ellipse, fallbackMeasurer, localToWorld, parseTargetSugar, parseWay, point, polar, rect, worldToLocal };
29
+ export { ARROW_MARKER_DEFAULT_SIZE, ARROW_MARKER_HOLLOW_DEFAULT_LINE_WIDTH, ARROW_SHAPES, AT_DIRECTIONS, ArcStepSchema, ArrowDefaultSchema, ArrowDetailSchema, ArrowEndDetailSchema, AtPositionSchema, BUILTIN_SHAPES, BendStepSchema, CURRENT_IR_VERSION, ChildSchema, CirclePathStepSchema, ControlPointSchema, CoordinateSchema, CubicStepSchema, CurveStepSchema, CycleStepSchema, DEFAULT_ARROW_SHAPE, DrawWay, EllipsePathStepSchema, FoldStepSchema, FontSchema, HOLLOW_ARROW_SHAPES, LabelDefaultSchema, LineSpecSchema, LineStepSchema, MoveStepSchema, NODE_SHAPES, NODE_TEXT_ALIGNS, NodeDefaultSchema, NodeLabelSchema, NodeSchema, OffsetPositionSchema, PathDefaultSchema, PathSchema, PolarPositionSchema, PositionSchema, RECT_ANCHORS, RectangleStepSchema, RelativeAccumulateTargetSchema, RelativeTargetSchema, SceneSchema, ScopeSchema, StepLabelSchema, StepSchema, TargetSchema, TextBlockSchema, TransformSchema, circle, compileToScene, computeLayout, diamond, ellipse, fallbackMeasurer, localToWorld, parseTargetSugar, parseWay, point, polar, rect, worldToLocal };
@@ -63,6 +63,8 @@ export declare const NodeLabelSchema: z.ZodObject<{
63
63
  weight?: number | "normal" | "bold" | undefined;
64
64
  style?: "normal" | "italic" | "oblique" | undefined;
65
65
  }>>;
66
+ rotate: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["none", "radial", "tangent"]>, z.ZodNumber]>>;
67
+ keepUpright: z.ZodOptional<z.ZodBoolean>;
66
68
  }, "strip", z.ZodTypeAny, {
67
69
  text: string;
68
70
  distance?: number | undefined;
@@ -75,6 +77,8 @@ export declare const NodeLabelSchema: z.ZodObject<{
75
77
  } | undefined;
76
78
  position?: number | "above" | "below" | "left" | "right" | "above-left" | "above-right" | "below-left" | "below-right" | undefined;
77
79
  textColor?: string | undefined;
80
+ rotate?: number | "none" | "radial" | "tangent" | undefined;
81
+ keepUpright?: boolean | undefined;
78
82
  }, {
79
83
  text: string;
80
84
  distance?: number | undefined;
@@ -87,6 +91,8 @@ export declare const NodeLabelSchema: z.ZodObject<{
87
91
  } | undefined;
88
92
  position?: number | "above" | "below" | "left" | "right" | "above-left" | "above-right" | "below-left" | "below-right" | undefined;
89
93
  textColor?: string | undefined;
94
+ rotate?: number | "none" | "radial" | "tangent" | undefined;
95
+ keepUpright?: boolean | undefined;
90
96
  }>;
91
97
  /** Node label IR 类型 */
92
98
  export type IRNodeLabel = z.infer<typeof NodeLabelSchema>;
@@ -243,6 +249,8 @@ export declare const NodeSchema: z.ZodObject<{
243
249
  weight?: number | "normal" | "bold" | undefined;
244
250
  style?: "normal" | "italic" | "oblique" | undefined;
245
251
  }>>;
252
+ rotate: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["none", "radial", "tangent"]>, z.ZodNumber]>>;
253
+ keepUpright: z.ZodOptional<z.ZodBoolean>;
246
254
  }, "strip", z.ZodTypeAny, {
247
255
  text: string;
248
256
  distance?: number | undefined;
@@ -255,6 +263,8 @@ export declare const NodeSchema: z.ZodObject<{
255
263
  } | undefined;
256
264
  position?: number | "above" | "below" | "left" | "right" | "above-left" | "above-right" | "below-left" | "below-right" | undefined;
257
265
  textColor?: string | undefined;
266
+ rotate?: number | "none" | "radial" | "tangent" | undefined;
267
+ keepUpright?: boolean | undefined;
258
268
  }, {
259
269
  text: string;
260
270
  distance?: number | undefined;
@@ -267,6 +277,8 @@ export declare const NodeSchema: z.ZodObject<{
267
277
  } | undefined;
268
278
  position?: number | "above" | "below" | "left" | "right" | "above-left" | "above-right" | "below-left" | "below-right" | undefined;
269
279
  textColor?: string | undefined;
280
+ rotate?: number | "none" | "radial" | "tangent" | undefined;
281
+ keepUpright?: boolean | undefined;
270
282
  }>, z.ZodArray<z.ZodObject<{
271
283
  text: z.ZodString;
272
284
  position: z.ZodOptional<z.ZodUnion<[z.ZodNativeEnum<{
@@ -298,6 +310,8 @@ export declare const NodeSchema: z.ZodObject<{
298
310
  weight?: number | "normal" | "bold" | undefined;
299
311
  style?: "normal" | "italic" | "oblique" | undefined;
300
312
  }>>;
313
+ rotate: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["none", "radial", "tangent"]>, z.ZodNumber]>>;
314
+ keepUpright: z.ZodOptional<z.ZodBoolean>;
301
315
  }, "strip", z.ZodTypeAny, {
302
316
  text: string;
303
317
  distance?: number | undefined;
@@ -310,6 +324,8 @@ export declare const NodeSchema: z.ZodObject<{
310
324
  } | undefined;
311
325
  position?: number | "above" | "below" | "left" | "right" | "above-left" | "above-right" | "below-left" | "below-right" | undefined;
312
326
  textColor?: string | undefined;
327
+ rotate?: number | "none" | "radial" | "tangent" | undefined;
328
+ keepUpright?: boolean | undefined;
313
329
  }, {
314
330
  text: string;
315
331
  distance?: number | undefined;
@@ -322,7 +338,10 @@ export declare const NodeSchema: z.ZodObject<{
322
338
  } | undefined;
323
339
  position?: number | "above" | "below" | "left" | "right" | "above-left" | "above-right" | "below-left" | "below-right" | undefined;
324
340
  textColor?: string | undefined;
341
+ rotate?: number | "none" | "radial" | "tangent" | undefined;
342
+ keepUpright?: boolean | undefined;
325
343
  }>, "many">]>>;
344
+ zIndex: z.ZodOptional<z.ZodNumber>;
326
345
  }, "strip", z.ZodTypeAny, {
327
346
  type: "node";
328
347
  position: [number, number] | import('./position').PolarPosition | {
@@ -368,6 +387,8 @@ export declare const NodeSchema: z.ZodObject<{
368
387
  } | undefined;
369
388
  position?: number | "above" | "below" | "left" | "right" | "above-left" | "above-right" | "below-left" | "below-right" | undefined;
370
389
  textColor?: string | undefined;
390
+ rotate?: number | "none" | "radial" | "tangent" | undefined;
391
+ keepUpright?: boolean | undefined;
371
392
  } | {
372
393
  text: string;
373
394
  distance?: number | undefined;
@@ -380,19 +401,22 @@ export declare const NodeSchema: z.ZodObject<{
380
401
  } | undefined;
381
402
  position?: number | "above" | "below" | "left" | "right" | "above-left" | "above-right" | "below-left" | "below-right" | undefined;
382
403
  textColor?: string | undefined;
404
+ rotate?: number | "none" | "radial" | "tangent" | undefined;
405
+ keepUpright?: boolean | undefined;
383
406
  }[] | undefined;
407
+ roundedCorners?: number | undefined;
384
408
  stroke?: string | undefined;
385
409
  strokeWidth?: number | undefined;
386
410
  fillOpacity?: number | undefined;
387
411
  drawOpacity?: number | undefined;
388
- id?: string | undefined;
412
+ zIndex?: number | undefined;
389
413
  rotate?: number | undefined;
414
+ id?: string | undefined;
390
415
  align?: "left" | "right" | "center" | undefined;
391
416
  lineHeight?: number | undefined;
392
417
  dashed?: boolean | undefined;
393
418
  dotted?: boolean | undefined;
394
419
  dashArray?: number[] | undefined;
395
- roundedCorners?: number | undefined;
396
420
  minimumWidth?: number | undefined;
397
421
  minimumHeight?: number | undefined;
398
422
  minimumSize?: number | undefined;
@@ -448,6 +472,8 @@ export declare const NodeSchema: z.ZodObject<{
448
472
  } | undefined;
449
473
  position?: number | "above" | "below" | "left" | "right" | "above-left" | "above-right" | "below-left" | "below-right" | undefined;
450
474
  textColor?: string | undefined;
475
+ rotate?: number | "none" | "radial" | "tangent" | undefined;
476
+ keepUpright?: boolean | undefined;
451
477
  } | {
452
478
  text: string;
453
479
  distance?: number | undefined;
@@ -460,19 +486,22 @@ export declare const NodeSchema: z.ZodObject<{
460
486
  } | undefined;
461
487
  position?: number | "above" | "below" | "left" | "right" | "above-left" | "above-right" | "below-left" | "below-right" | undefined;
462
488
  textColor?: string | undefined;
489
+ rotate?: number | "none" | "radial" | "tangent" | undefined;
490
+ keepUpright?: boolean | undefined;
463
491
  }[] | undefined;
492
+ roundedCorners?: number | undefined;
464
493
  stroke?: string | undefined;
465
494
  strokeWidth?: number | undefined;
466
495
  fillOpacity?: number | undefined;
467
496
  drawOpacity?: number | undefined;
468
- id?: string | undefined;
497
+ zIndex?: number | undefined;
469
498
  rotate?: number | undefined;
499
+ id?: string | undefined;
470
500
  align?: "left" | "right" | "center" | undefined;
471
501
  lineHeight?: number | undefined;
472
502
  dashed?: boolean | undefined;
473
503
  dotted?: boolean | undefined;
474
504
  dashArray?: number[] | undefined;
475
- roundedCorners?: number | undefined;
476
505
  minimumWidth?: number | undefined;
477
506
  minimumHeight?: number | undefined;
478
507
  minimumSize?: number | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/ir/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAKxC;;;GAGG;AACH,eAAO,MAAM,WAAW;;;;;CAKd,CAAC;AAEX;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AAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC"}
@@ -32,7 +32,13 @@ var NodeLabelSchema = z.object({
32
32
  distance: z.number().nonnegative().optional().describe("Gap between the node border and the label center, in user units. Default 12."),
33
33
  textColor: z.string().optional().describe("Label text color; falls back to currentColor."),
34
34
  opacity: z.number().min(0).max(1).optional().describe("Label-only opacity 0..1; multiplied with the node opacity if both are set."),
35
- font: FontSchema.optional().describe("Label font overrides; missing fields inherit from the parent node font, then renderer defaults.")
35
+ font: FontSchema.optional().describe("Label font overrides; missing fields inherit from the parent node font, then renderer defaults."),
36
+ rotate: z.union([z.enum([
37
+ "none",
38
+ "radial",
39
+ "tangent"
40
+ ]), z.number()]).optional().describe("Rotate the label text around its own center. `none` (default) = horizontal; `radial` = along the node-center -> label-center direction; `tangent` = radial + 90 deg; a number = explicit degrees (screen y-down: 0 = +x, 90 = +y). Only changes text orientation, not placement."),
41
+ keepUpright: z.boolean().optional().describe("When true, flips the rotated label 180 deg if it would otherwise read upside-down (more than 90 deg from upright). Default false (strict geometric angle).")
36
42
  }).describe("Extra text attached around a node border. Multiple labels supported via array form on `Node.label`.");
37
43
  var NodeSchema = z.object({
38
44
  type: z.literal("node").describe("Discriminator marking this child as a node"),
@@ -72,7 +78,8 @@ var NodeSchema = z.object({
72
78
  padding: z.number().nonnegative().optional().describe("Symmetric inner padding (alias for `innerXSep` + `innerYSep`); axis-specific fields take precedence."),
73
79
  margin: z.number().nonnegative().optional().describe("Symmetric outer margin (alias for `outerSep`); axis-specific field takes precedence."),
74
80
  font: FontSchema.optional().describe("Font spec for the inner text label (family / size / weight / style); all fields optional, all fall back to renderer defaults."),
75
- label: z.union([NodeLabelSchema, z.array(NodeLabelSchema)]).optional().describe("Extra label(s) attached around the node border (TikZ `[label=above:foo]`); single object or array form. Compiled into one TextPrim per label, positioned by `position` direction / angle and `distance`.")
81
+ label: z.union([NodeLabelSchema, z.array(NodeLabelSchema)]).optional().describe("Extra label(s) attached around the node border (TikZ `[label=above:foo]`); single object or array form. Compiled into one TextPrim per label, positioned by `position` direction / angle and `distance`."),
82
+ zIndex: z.number().int().finite().optional().describe("Explicit stacking order among sibling IR children. Higher draws on top. Omitted = 0 = source order. Sorting is stable: same zIndex keeps source order. Scoped per group (a node inside a scope only restacks within that scope).")
76
83
  }).describe("Node primitive: a positioned, optionally textual shape (rectangle / circle / ellipse / diamond)");
77
84
  //#endregion
78
85
  export { NODE_SHAPES, NODE_TEXT_ALIGNS, NodeLabelSchema, NodeSchema };