@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.
- package/dist/es/compile/compile.d.ts.map +1 -1
- package/dist/es/compile/compile.js +74 -12
- package/dist/es/compile/node.d.ts +4 -0
- package/dist/es/compile/node.d.ts.map +1 -1
- package/dist/es/compile/node.js +83 -32
- package/dist/es/compile/path/index.d.ts.map +1 -1
- package/dist/es/compile/path/index.js +91 -12
- package/dist/es/compile/path/relative.d.ts.map +1 -1
- package/dist/es/compile/path/relative.js +5 -1
- package/dist/es/geometry/arc.d.ts +11 -0
- package/dist/es/geometry/arc.d.ts.map +1 -1
- package/dist/es/geometry/arc.js +27 -1
- package/dist/es/geometry/rect.d.ts +23 -0
- package/dist/es/geometry/rect.d.ts.map +1 -1
- package/dist/es/geometry/rect.js +84 -1
- package/dist/es/geometry/segment.d.ts +2 -0
- package/dist/es/geometry/segment.d.ts.map +1 -1
- package/dist/es/geometry/segment.js +12 -1
- package/dist/es/index.d.ts +2 -2
- package/dist/es/index.d.ts.map +1 -1
- package/dist/es/index.js +2 -2
- package/dist/es/ir/node.d.ts +33 -4
- package/dist/es/ir/node.d.ts.map +1 -1
- package/dist/es/ir/node.js +9 -2
- package/dist/es/ir/path/path.d.ts +230 -5
- package/dist/es/ir/path/path.d.ts.map +1 -1
- package/dist/es/ir/path/path.js +1 -0
- package/dist/es/ir/path/step.d.ts +311 -8
- package/dist/es/ir/path/step.d.ts.map +1 -1
- package/dist/es/ir/path/step.js +36 -11
- package/dist/es/ir/scope.d.ts +348 -16
- package/dist/es/ir/scope.d.ts.map +1 -1
- package/dist/es/ir/scope.js +5 -2
- package/dist/lib/compile/compile.cjs +74 -12
- package/dist/lib/compile/compile.d.ts.map +1 -1
- package/dist/lib/compile/node.cjs +83 -32
- package/dist/lib/compile/node.d.ts +4 -0
- package/dist/lib/compile/node.d.ts.map +1 -1
- package/dist/lib/compile/path/index.cjs +89 -10
- package/dist/lib/compile/path/index.d.ts.map +1 -1
- package/dist/lib/compile/path/relative.cjs +5 -1
- package/dist/lib/compile/path/relative.d.ts.map +1 -1
- package/dist/lib/geometry/arc.cjs +28 -0
- package/dist/lib/geometry/arc.d.ts +11 -0
- package/dist/lib/geometry/arc.d.ts.map +1 -1
- package/dist/lib/geometry/rect.cjs +84 -0
- package/dist/lib/geometry/rect.d.ts +23 -0
- package/dist/lib/geometry/rect.d.ts.map +1 -1
- package/dist/lib/geometry/segment.cjs +12 -0
- package/dist/lib/geometry/segment.d.ts +2 -0
- package/dist/lib/geometry/segment.d.ts.map +1 -1
- package/dist/lib/index.cjs +1 -0
- package/dist/lib/index.d.ts +2 -2
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/ir/node.cjs +9 -2
- package/dist/lib/ir/node.d.ts +33 -4
- package/dist/lib/ir/node.d.ts.map +1 -1
- package/dist/lib/ir/path/path.cjs +1 -0
- package/dist/lib/ir/path/path.d.ts +230 -5
- package/dist/lib/ir/path/path.d.ts.map +1 -1
- package/dist/lib/ir/path/step.cjs +36 -10
- package/dist/lib/ir/path/step.d.ts +311 -8
- package/dist/lib/ir/path/step.d.ts.map +1 -1
- package/dist/lib/ir/scope.cjs +5 -2
- package/dist/lib/ir/scope.d.ts +348 -16
- package/dist/lib/ir/scope.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -73,6 +73,90 @@ var rect = {
|
|
|
73
73
|
return require__transform.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
160
|
exports.RECT_ANCHORS = RECT_ANCHORS;
|
|
78
161
|
exports.rect = rect;
|
|
162
|
+
exports.rectOutline = rectOutline;
|
|
@@ -32,4 +32,27 @@ export declare const rect: {
|
|
|
32
32
|
/** 从中心向 toward 方向射线与矩形边界交点(含旋转),Path 端点贴 Node 边界用 */
|
|
33
33
|
boundaryPoint: (r: Rect, toward: Position) => Position;
|
|
34
34
|
};
|
|
35
|
+
/** rectOutline 的命令算子(供 compile 翻译为 PathCommand;几何在 core 下沉,便于未来 rectangle node shape 复用) */
|
|
36
|
+
export type RectOutlineOp = {
|
|
37
|
+
kind: 'move';
|
|
38
|
+
to: Position;
|
|
39
|
+
} | {
|
|
40
|
+
kind: 'line';
|
|
41
|
+
to: Position;
|
|
42
|
+
} | {
|
|
43
|
+
kind: 'arc';
|
|
44
|
+
center: Position;
|
|
45
|
+
radius: number;
|
|
46
|
+
startAngle: number;
|
|
47
|
+
endAngle: number;
|
|
48
|
+
} | {
|
|
49
|
+
kind: 'close';
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* 矩形 outline:两对角 → 顺时针 path 算子序列
|
|
53
|
+
* @description from/to 任意顺序,归一化 (x0,y0)=min、(x1,y1)=max。直角 = 4 line + close(起点左上 (x0,y0));
|
|
54
|
+
* 圆角 = 4 line + 4 quarter-arc + close(起点 (x0+r, y0))。roundedCorners clamp 到 min(w,h)/2。
|
|
55
|
+
* 角度约定同 geometry/arc(y-down:0=+x, 90=+y/下, 180=-x, 270=-y/上)。
|
|
56
|
+
*/
|
|
57
|
+
export declare const rectOutline: (from: Position, to: Position, roundedCorners?: number) => Array<RectOutlineOp>;
|
|
35
58
|
//# sourceMappingURL=rect.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rect.d.ts","sourceRoot":"","sources":["../../../src/geometry/rect.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,gCAAgC;AAChC,MAAM,MAAM,IAAI,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,cAAc;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,qEAAqE;AACrE,eAAO,MAAM,YAAY;;;;;;;;;;CAUf,CAAC;AAEX,+BAA+B;AAC/B,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAE1E,eAAO,MAAM,IAAI;IACf,WAAW;gBACC,IAAI,KAAG,QAAQ;IAC3B,uBAAuB;kBACT,IAAI,KAAK,QAAQ,KAAG,OAAO;IAMzC,sCAAsC;gBAC1B,IAAI,QAAQ,UAAU,KAAG,QAAQ;IAuC7C,qDAAqD;uBAClC,IAAI,UAAU,QAAQ,KAAG,QAAQ;CAUrD,CAAC"}
|
|
1
|
+
{"version":3,"file":"rect.d.ts","sourceRoot":"","sources":["../../../src/geometry/rect.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SA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AngleDeg, 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;
|
|
@@ -75,6 +86,7 @@ var ellipseSegmentSample = (center, rx, ry, t) => {
|
|
|
75
86
|
exports.arcSegmentSample = arcSegmentSample;
|
|
76
87
|
exports.circleSegmentSample = circleSegmentSample;
|
|
77
88
|
exports.cubicSegmentSample = cubicSegmentSample;
|
|
89
|
+
exports.ellipseArcSegmentSample = ellipseArcSegmentSample;
|
|
78
90
|
exports.ellipseSegmentSample = ellipseSegmentSample;
|
|
79
91
|
exports.foldSegmentSample = foldSegmentSample;
|
|
80
92
|
exports.lineSegmentSample = lineSegmentSample;
|
|
@@ -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;;;GAGG;AACH,eAAO,MAAM,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,MAA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,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"}
|
package/dist/lib/index.cjs
CHANGED
|
@@ -67,6 +67,7 @@ exports.PathSchema = require_path.PathSchema;
|
|
|
67
67
|
exports.PolarPositionSchema = require_polar_position.PolarPositionSchema;
|
|
68
68
|
exports.PositionSchema = require_position.PositionSchema;
|
|
69
69
|
exports.RECT_ANCHORS = require_rect.RECT_ANCHORS;
|
|
70
|
+
exports.RectangleStepSchema = require_step.RectangleStepSchema;
|
|
70
71
|
exports.RelativeAccumulateTargetSchema = require_target.RelativeAccumulateTargetSchema;
|
|
71
72
|
exports.RelativeTargetSchema = require_target.RelativeTargetSchema;
|
|
72
73
|
exports.SceneSchema = require_scene.SceneSchema;
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -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<>) */
|
package/dist/lib/index.d.ts.map
CHANGED
|
@@ -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,aAA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ACR,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,WAAW;AACX,oDAAoD;AACpD,eAAe,EACf,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,YAAY,EACZ,SAAS,EACT,SAAS;AACT,6BAA6B;AAC7B,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,MAAM,EACN,KAAK,GACN,MAAM,aAAa,CAAC;AAGrB,YAAY,EACV,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,cAAc,EACd,cAAc,GACf,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAG5E,YAAY,EACV,OAAO,EACP,MAAM,EACN,QAAQ,EACR,MAAM,EACN,eAAe,EACf,QAAQ,EACR,UAAU,GACX,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAIhE,YAAY,EACV,QAAQ,EACR,IAAI,EACJ,UAAU,EACV,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/lib/ir/node.cjs
CHANGED
|
@@ -32,7 +32,13 @@ var NodeLabelSchema = zod.z.object({
|
|
|
32
32
|
distance: zod.z.number().nonnegative().optional().describe("Gap between the node border and the label center, in user units. Default 12."),
|
|
33
33
|
textColor: zod.z.string().optional().describe("Label text color; falls back to currentColor."),
|
|
34
34
|
opacity: zod.z.number().min(0).max(1).optional().describe("Label-only opacity 0..1; multiplied with the node opacity if both are set."),
|
|
35
|
-
font: require_font.FontSchema.optional().describe("Label font overrides; missing fields inherit from the parent node font, then renderer defaults.")
|
|
35
|
+
font: require_font.FontSchema.optional().describe("Label font overrides; missing fields inherit from the parent node font, then renderer defaults."),
|
|
36
|
+
rotate: zod.z.union([zod.z.enum([
|
|
37
|
+
"none",
|
|
38
|
+
"radial",
|
|
39
|
+
"tangent"
|
|
40
|
+
]), zod.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: zod.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 = zod.z.object({
|
|
38
44
|
type: zod.z.literal("node").describe("Discriminator marking this child as a node"),
|
|
@@ -72,7 +78,8 @@ var NodeSchema = zod.z.object({
|
|
|
72
78
|
padding: zod.z.number().nonnegative().optional().describe("Symmetric inner padding (alias for `innerXSep` + `innerYSep`); axis-specific fields take precedence."),
|
|
73
79
|
margin: zod.z.number().nonnegative().optional().describe("Symmetric outer margin (alias for `outerSep`); axis-specific field takes precedence."),
|
|
74
80
|
font: require_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: zod.z.union([NodeLabelSchema, zod.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: zod.z.union([NodeLabelSchema, zod.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: zod.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
|
exports.NODE_SHAPES = NODE_SHAPES;
|
package/dist/lib/ir/node.d.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC;AAE3D;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG,gBAAgB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAEzD,+BAA+B;AAC/B,eAAO,MAAM,gBAAgB;;;;CAInB,CAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+LpB,CAAC;AAEJ,sCAAsC;AACtC,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC"}
|
|
@@ -39,6 +39,7 @@ var PathSchema = zod.z.object({
|
|
|
39
39
|
opacity: zod.z.number().min(0).max(1).optional().describe("Whole-path opacity 0..1; multiplies onto stroke and fill."),
|
|
40
40
|
fillOpacity: zod.z.number().min(0).max(1).optional().describe("Fill opacity 0..1; affects only the closed-region fill."),
|
|
41
41
|
drawOpacity: zod.z.number().min(0).max(1).optional().describe("Stroke opacity 0..1 (TikZ `draw opacity`); affects only the path stroke."),
|
|
42
|
+
zIndex: zod.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 path inside a scope only restacks within that scope)."),
|
|
42
43
|
children: zod.z.array(require_step.StepSchema).min(2).describe("Sequence of step actions defining the path; the first should usually be a `move`")
|
|
43
44
|
}).describe("A drawn path composed of a sequence of step actions (move / line / ...)");
|
|
44
45
|
//#endregion
|