@retikz/core 0.1.0-rc.1 → 0.1.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.
- package/dist/es/compile/compile.d.ts.map +1 -1
- package/dist/es/compile/compile.js +8 -3
- package/dist/es/compile/node.js +1 -1
- package/dist/es/compile/path/arrow-geometry.js +1 -1
- package/dist/es/compile/path/shrink.d.ts.map +1 -1
- package/dist/es/compile/path/shrink.js +2 -1
- package/dist/es/index.d.ts +1 -1
- package/dist/es/index.d.ts.map +1 -1
- package/dist/es/index.js +2 -2
- package/dist/es/ir/node.d.ts +1 -1
- package/dist/es/ir/node.js +2 -2
- package/dist/es/ir/path/arrow.d.ts +3 -1
- package/dist/es/ir/path/arrow.d.ts.map +1 -1
- package/dist/es/ir/path/arrow.js +5 -3
- package/dist/es/ir/path/path.js +1 -1
- package/dist/lib/compile/compile.cjs +8 -3
- package/dist/lib/compile/compile.d.ts.map +1 -1
- package/dist/lib/compile/node.cjs +1 -1
- package/dist/lib/compile/path/arrow-geometry.cjs +1 -1
- package/dist/lib/compile/path/shrink.cjs +2 -1
- package/dist/lib/compile/path/shrink.d.ts.map +1 -1
- package/dist/lib/index.cjs +1 -0
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/ir/node.cjs +2 -2
- package/dist/lib/ir/node.d.ts +1 -1
- package/dist/lib/ir/path/arrow.cjs +5 -2
- package/dist/lib/ir/path/arrow.d.ts +3 -1
- package/dist/lib/ir/path/arrow.d.ts.map +1 -1
- package/dist/lib/ir/path/path.cjs +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../../src/compile/compile.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAc,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAK,EAAE,KAAK,EAAkB,MAAM,cAAc,CAAC;AAK1D,OA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C9B,oBAAoB,GACpB,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IAClB,iBAAiB;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,2BAA2B;AAC3B,MAAM,MAAM,cAAc,GAAG;IAC3B,oCAAoC;IACpC,WAAW,CAAC,EAAE,YAAY,CAAC;IAC3B,qCAAqC;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;CAC5C,CAAC;AAWF;;;GAGG;AACH,eAAO,MAAM,cAAc,GAAI,IAAI,EAAE,EAAE,UAAS,cAAmB,KAAG,KAwErE,CAAC"}
|
|
@@ -49,13 +49,13 @@ var compileToScene = (ir, options = {}) => {
|
|
|
49
49
|
const primitives = [];
|
|
50
50
|
const nodeIndex = /* @__PURE__ */ new Map();
|
|
51
51
|
const allPoints = [];
|
|
52
|
+
const nodeLayouts = /* @__PURE__ */ new Map();
|
|
52
53
|
for (let i = 0; i < ir.children.length; i++) {
|
|
53
54
|
const child = ir.children[i];
|
|
54
55
|
if (child.type === "node") {
|
|
55
56
|
const layout = layoutNode(child, measureText, nodeIndex, nodeDistance);
|
|
56
57
|
if (child.id) nodeIndex.set(child.id, layout);
|
|
57
|
-
|
|
58
|
-
allPoints.push(rect.anchor(layout.rect, "north-west"), rect.anchor(layout.rect, "north-east"), rect.anchor(layout.rect, "south-west"), rect.anchor(layout.rect, "south-east"));
|
|
58
|
+
nodeLayouts.set(i, layout);
|
|
59
59
|
} else if (child.type === "coordinate") {
|
|
60
60
|
const center = resolvePosition(child.position, nodeIndex, nodeDistance);
|
|
61
61
|
if (!center) {
|
|
@@ -71,7 +71,12 @@ var compileToScene = (ir, options = {}) => {
|
|
|
71
71
|
}
|
|
72
72
|
for (let i = 0; i < ir.children.length; i++) {
|
|
73
73
|
const child = ir.children[i];
|
|
74
|
-
if (child.type === "
|
|
74
|
+
if (child.type === "node") {
|
|
75
|
+
const layout = nodeLayouts.get(i);
|
|
76
|
+
if (!layout) continue;
|
|
77
|
+
for (const prim of emitNodePrimitives(layout, round)) primitives.push(prim);
|
|
78
|
+
allPoints.push(rect.anchor(layout.rect, "north-west"), rect.anchor(layout.rect, "north-east"), rect.anchor(layout.rect, "south-west"), rect.anchor(layout.rect, "south-east"));
|
|
79
|
+
} else if (child.type === "path") {
|
|
75
80
|
const result = emitPathPrimitive(child, nodeIndex, round, measureText, {
|
|
76
81
|
onWarn,
|
|
77
82
|
irPath: `children[${i}].path`
|
package/dist/es/compile/node.js
CHANGED
|
@@ -9,7 +9,7 @@ var DEFAULT_PADDING = 8;
|
|
|
9
9
|
var DEFAULT_LINE_HEIGHT_FACTOR = 1.2;
|
|
10
10
|
var DEG_TO_RAD = Math.PI / 180;
|
|
11
11
|
/** Node label 与 node 边界默认距离(TikZ 默认 0pt 视觉太贴) */
|
|
12
|
-
var DEFAULT_LABEL_DISTANCE =
|
|
12
|
+
var DEFAULT_LABEL_DISTANCE = 12;
|
|
13
13
|
var SQRT2 = Math.SQRT2;
|
|
14
14
|
/** dashed 预设:4 px 实线 + 2 px 间隙循环 */
|
|
15
15
|
var DASHED_PATTERN = [4, 2];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shrink.d.ts","sourceRoot":"","sources":["../../../../src/compile/path/shrink.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"shrink.d.ts","sourceRoot":"","sources":["../../../../src/compile/path/shrink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,aAAa,EAA0C,MAAM,UAAU,CAAC;AAC3G,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAmCjE,gEAAgE;AAChE,eAAO,MAAM,cAAc,GACzB,OAAO,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,SAAS,EAC/C,QAAQ,aAAa,GAAG,SAAS,KAChC;IAAE,UAAU,CAAC,EAAE,YAAY,CAAC;IAAC,QAAQ,CAAC,EAAE,YAAY,CAAA;CAatD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,GAAI,MAAM,YAAY,KAAG,MAIlD,CAAC;AAiDF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAC5B,UAAU,KAAK,CAAC,WAAW,CAAC,EAC5B,aAAa,MAAM,EACnB,WAAW,MAAM,EACjB,aAAa,MAAM,EACnB,OAAO,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,KAC3B,IA4CF,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DEFAULT_ARROW_SHAPE } from "../../ir/path/arrow.js";
|
|
1
2
|
import { shiftToward } from "./anchor.js";
|
|
2
3
|
import { isHollowArrowShape, resolveArrowShapeGeometry } from "./arrow-geometry.js";
|
|
3
4
|
//#region src/compile/path/shrink.ts
|
|
@@ -6,7 +7,7 @@ import { isHollowArrowShape, resolveArrowShapeGeometry } from "./arrow-geometry.
|
|
|
6
7
|
* @description 缺省字段继承顶层(不是"完全替换");空心 shape 上 fill 字段被丢(silent no-op)
|
|
7
8
|
*/
|
|
8
9
|
var resolveArrowEndSpec = (topLevel, endSide) => {
|
|
9
|
-
const baseShape = endSide?.shape ?? topLevel.shape ??
|
|
10
|
+
const baseShape = endSide?.shape ?? topLevel.shape ?? DEFAULT_ARROW_SHAPE;
|
|
10
11
|
const out = { shape: baseShape };
|
|
11
12
|
const scale = endSide?.scale ?? topLevel.scale;
|
|
12
13
|
if (scale !== void 0) out.scale = scale;
|
package/dist/es/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
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, ChildSchema, SceneSchema, CURRENT_IR_VERSION, } from './ir';
|
|
6
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, IRChild, IR, ArrowShape, IRArrowDetail, IRArrowEndDetail, NodeShape, NodeTextAlign, } from './ir';
|
|
7
|
-
export { ARROW_SHAPES, HOLLOW_ARROW_SHAPES, ARROW_MARKER_DEFAULT_SIZE, ARROW_MARKER_HOLLOW_DEFAULT_LINE_WIDTH, NODE_SHAPES, NODE_TEXT_ALIGNS, } from './ir';
|
|
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<>) */
|
|
10
10
|
MovePathCommand, LinePathCommand, QuadPathCommand, CubicPathCommand, ArcPathCommand, EllipseArcPathCommand, ClosePathCommand, ArrowEndSpec, GroupPrim, Transform,
|
package/dist/es/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,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,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,MAAM,EACN,MAAM,EACN,WAAW,EACX,YAAY,EACZ,MAAM,EACN,UAAU,EACV,WAAW,EACX,MAAM,EACN,OAAO,EACP,EAAE,EACF,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,SAAS,EACT,aAAa,GACd,MAAM,MAAM,CAAC;AACd,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,yBAAyB,EACzB,sCAAsC,EACtC,WAAW,EACX,gBAAgB,GACjB,MAAM,MAAM,CAAC;AAGd,YAAY,EACV,cAAc,EACd,QAAQ,EACR,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,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,EAC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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,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
|
package/dist/es/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { AT_DIRECTIONS, AtPositionSchema } from "./ir/position/at-position.js";
|
|
|
4
4
|
import { OffsetPositionSchema } from "./ir/position/offset-position.js";
|
|
5
5
|
import { FontSchema } from "./ir/font.js";
|
|
6
6
|
import { LineSpecSchema, TextBlockSchema } from "./ir/text.js";
|
|
7
|
-
import { ARROW_MARKER_DEFAULT_SIZE, ARROW_MARKER_HOLLOW_DEFAULT_LINE_WIDTH, ARROW_SHAPES, ArrowDetailSchema, ArrowEndDetailSchema, HOLLOW_ARROW_SHAPES } from "./ir/path/arrow.js";
|
|
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
9
|
import { ArcStepSchema, BendStepSchema, CirclePathStepSchema, ControlPointSchema, CubicStepSchema, CurveStepSchema, CycleStepSchema, EllipsePathStepSchema, FoldStepSchema, LineStepSchema, MoveStepSchema, StepLabelSchema, StepSchema } from "./ir/path/step.js";
|
|
10
10
|
import { PathSchema } from "./ir/path/path.js";
|
|
@@ -22,4 +22,4 @@ import { parseTargetSugar } from "./parsers/parseTargetSugar.js";
|
|
|
22
22
|
import { DrawWay, parseWay } from "./parsers/parseWay.js";
|
|
23
23
|
import { polar } from "./geometry/polar.js";
|
|
24
24
|
import { point } from "./geometry/point.js";
|
|
25
|
-
export { ARROW_MARKER_DEFAULT_SIZE, ARROW_MARKER_HOLLOW_DEFAULT_LINE_WIDTH, ARROW_SHAPES, AT_DIRECTIONS, ArcStepSchema, ArrowDetailSchema, ArrowEndDetailSchema, AtPositionSchema, BendStepSchema, CURRENT_IR_VERSION, ChildSchema, CirclePathStepSchema, ControlPointSchema, CoordinateSchema, CubicStepSchema, CurveStepSchema, CycleStepSchema, DrawWay, EllipsePathStepSchema, FoldStepSchema, FontSchema, HOLLOW_ARROW_SHAPES, LineSpecSchema, LineStepSchema, MoveStepSchema, NODE_SHAPES, NODE_TEXT_ALIGNS, NodeLabelSchema, NodeSchema, OffsetPositionSchema, PathSchema, PolarPositionSchema, PositionSchema, RECT_ANCHORS, RelativeAccumulateTargetSchema, RelativeTargetSchema, SceneSchema, StepLabelSchema, StepSchema, TargetSchema, TextBlockSchema, circle, compileToScene, computeLayout, diamond, ellipse, fallbackMeasurer, parseTargetSugar, parseWay, point, polar, rect };
|
|
25
|
+
export { ARROW_MARKER_DEFAULT_SIZE, ARROW_MARKER_HOLLOW_DEFAULT_LINE_WIDTH, ARROW_SHAPES, AT_DIRECTIONS, ArcStepSchema, ArrowDetailSchema, ArrowEndDetailSchema, AtPositionSchema, BendStepSchema, CURRENT_IR_VERSION, ChildSchema, CirclePathStepSchema, ControlPointSchema, CoordinateSchema, CubicStepSchema, CurveStepSchema, CycleStepSchema, DEFAULT_ARROW_SHAPE, DrawWay, EllipsePathStepSchema, FoldStepSchema, FontSchema, HOLLOW_ARROW_SHAPES, LineSpecSchema, LineStepSchema, MoveStepSchema, NODE_SHAPES, NODE_TEXT_ALIGNS, NodeLabelSchema, NodeSchema, OffsetPositionSchema, PathSchema, PolarPositionSchema, PositionSchema, RECT_ANCHORS, RelativeAccumulateTargetSchema, RelativeTargetSchema, SceneSchema, StepLabelSchema, StepSchema, TargetSchema, TextBlockSchema, circle, compileToScene, computeLayout, diamond, ellipse, fallbackMeasurer, parseTargetSugar, parseWay, point, polar, rect };
|
package/dist/es/ir/node.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export declare const NODE_TEXT_ALIGNS: {
|
|
|
21
21
|
export type NodeTextAlign = ValueOf<typeof NODE_TEXT_ALIGNS>;
|
|
22
22
|
/**
|
|
23
23
|
* 节点附属标签 label(TikZ `[label=above:foo]` 同义)
|
|
24
|
-
* @description 可挂多个;label 不参与 layout。position 支持 8 方向枚举或数字角度(polar 约定:0°=+x,90°=+y 屏幕下方);默认 position='above',distance=
|
|
24
|
+
* @description 可挂多个;label 不参与 layout。position 支持 8 方向枚举或数字角度(polar 约定:0°=+x,90°=+y 屏幕下方);默认 position='above',distance=12
|
|
25
25
|
*/
|
|
26
26
|
export declare const NodeLabelSchema: z.ZodObject<{
|
|
27
27
|
text: z.ZodString;
|
package/dist/es/ir/node.js
CHANGED
|
@@ -24,12 +24,12 @@ var NODE_TEXT_ALIGNS = {
|
|
|
24
24
|
};
|
|
25
25
|
/**
|
|
26
26
|
* 节点附属标签 label(TikZ `[label=above:foo]` 同义)
|
|
27
|
-
* @description 可挂多个;label 不参与 layout。position 支持 8 方向枚举或数字角度(polar 约定:0°=+x,90°=+y 屏幕下方);默认 position='above',distance=
|
|
27
|
+
* @description 可挂多个;label 不参与 layout。position 支持 8 方向枚举或数字角度(polar 约定:0°=+x,90°=+y 屏幕下方);默认 position='above',distance=12
|
|
28
28
|
*/
|
|
29
29
|
var NodeLabelSchema = z.object({
|
|
30
30
|
text: z.string().describe("Label text content; rendered as a single line."),
|
|
31
31
|
position: z.union([z.nativeEnum(AT_DIRECTIONS), z.number()]).optional().describe("Placement around the node border: 8-direction enum (above / right / above-left / ...) or numeric angle in degrees (`label=30:foo` for radial placement). Default `above`. Numeric uses the polar convention (0° = +x, 90° = +y, screen-down)."),
|
|
32
|
-
distance: z.number().nonnegative().optional().describe("Gap between the node border and the label center, in user units. Default
|
|
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
35
|
font: FontSchema.optional().describe("Label font overrides; missing fields inherit from the parent node font, then renderer defaults.")
|
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { ValueOf } from '../../types';
|
|
3
3
|
/**
|
|
4
4
|
* 箭头形状常量(用 const 而非 TS enum 避免 reverse-mapping 和字面量不互通)
|
|
5
|
-
* @description normal
|
|
5
|
+
* @description normal 实心三角;open 空心三角(UML 泛化/继承);stealth 尖锐倒钩(默认);diamond 实心菱形(UML 组合);openDiamond 空心菱形(聚合);circle 实心圆点;openCircle 空心圆点
|
|
6
6
|
*/
|
|
7
7
|
export declare const ARROW_SHAPES: {
|
|
8
8
|
readonly normal: "normal";
|
|
@@ -15,6 +15,8 @@ export declare const ARROW_SHAPES: {
|
|
|
15
15
|
};
|
|
16
16
|
/** 箭头形状字面量类型 */
|
|
17
17
|
export type ArrowShape = ValueOf<typeof ARROW_SHAPES>;
|
|
18
|
+
/** 箭头默认形状 */
|
|
19
|
+
export declare const DEFAULT_ARROW_SHAPE: "stealth";
|
|
18
20
|
/**
|
|
19
21
|
* 空心 shape 集合(fill 字段在这些 shape 上 silent no-op)
|
|
20
22
|
* @description compile 与 render 都引用此表判定 fill 是否丢弃;空心 shape 用 color 主导描边、lineWidth 控描边粗
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrow.d.ts","sourceRoot":"","sources":["../../../../src/ir/path/arrow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,YAAY;;;;;;;;CAQf,CAAC;AAEX,gBAAgB;AAChB,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,YAAY,CAAC,CAAC;AAEtD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,iBAA6D,CAAC;AAE9F,wCAAwC;AACxC,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAE3C,0CAA0C;AAC1C,eAAO,MAAM,sCAAsC,MAAM,CAAC;AAE1D;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2D9B,CAAC;AAEJ;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAS7B,CAAC;AAEF,gBAAgB;AAChB,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACpE,mBAAmB;AACnB,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"arrow.d.ts","sourceRoot":"","sources":["../../../../src/ir/path/arrow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,YAAY;;;;;;;;CAQf,CAAC;AAEX,gBAAgB;AAChB,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,YAAY,CAAC,CAAC;AAEtD,aAAa;AACb,eAAO,MAAM,mBAAmB,WAAuB,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,iBAA6D,CAAC;AAE9F,wCAAwC;AACxC,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAE3C,0CAA0C;AAC1C,eAAO,MAAM,sCAAsC,MAAM,CAAC;AAE1D;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2D9B,CAAC;AAEJ;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAS7B,CAAC;AAEF,gBAAgB;AAChB,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACpE,mBAAmB;AACnB,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
package/dist/es/ir/path/arrow.js
CHANGED
|
@@ -2,7 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
//#region src/ir/path/arrow.ts
|
|
3
3
|
/**
|
|
4
4
|
* 箭头形状常量(用 const 而非 TS enum 避免 reverse-mapping 和字面量不互通)
|
|
5
|
-
* @description normal
|
|
5
|
+
* @description normal 实心三角;open 空心三角(UML 泛化/继承);stealth 尖锐倒钩(默认);diamond 实心菱形(UML 组合);openDiamond 空心菱形(聚合);circle 实心圆点;openCircle 空心圆点
|
|
6
6
|
*/
|
|
7
7
|
var ARROW_SHAPES = {
|
|
8
8
|
normal: "normal",
|
|
@@ -13,6 +13,8 @@ var ARROW_SHAPES = {
|
|
|
13
13
|
circle: "circle",
|
|
14
14
|
openCircle: "openCircle"
|
|
15
15
|
};
|
|
16
|
+
/** 箭头默认形状 */
|
|
17
|
+
var DEFAULT_ARROW_SHAPE = ARROW_SHAPES.stealth;
|
|
16
18
|
/**
|
|
17
19
|
* 空心 shape 集合(fill 字段在这些 shape 上 silent no-op)
|
|
18
20
|
* @description compile 与 render 都引用此表判定 fill 是否丢弃;空心 shape 用 color 主导描边、lineWidth 控描边粗
|
|
@@ -31,7 +33,7 @@ var ARROW_MARKER_HOLLOW_DEFAULT_LINE_WIDTH = 1.5;
|
|
|
31
33
|
* @description 顶层 8 字段全 optional;fill 在空心 shape 上 silent no-op(schema 不拒绝、compile/render 丢字段);start/end 子对象用相同字段集(无 start/end 递归)
|
|
32
34
|
*/
|
|
33
35
|
var ArrowEndDetailSchema = z.object({
|
|
34
|
-
shape: z.nativeEnum(ARROW_SHAPES).optional().describe("Arrow tip shape. Defaults to `
|
|
36
|
+
shape: z.nativeEnum(ARROW_SHAPES).optional().describe("Arrow tip shape. Defaults to `stealth` (sharp barb). Other values: `normal` (filled triangle), `open` (hollow triangle), `diamond`, `openDiamond`, `circle`, `openCircle`."),
|
|
35
37
|
scale: z.number().positive().optional().describe("Uniform tip scale factor; multiplies `length` and `width` (e.g. `length=10, scale=1.5` → effective 15). Defaults to 1."),
|
|
36
38
|
length: z.number().nonnegative().optional().describe("Tip length in user units (the dimension along the path direction). Defaults to ~6."),
|
|
37
39
|
width: z.number().nonnegative().optional().describe("Tip width in user units (perpendicular to the path). Defaults to ~6."),
|
|
@@ -49,4 +51,4 @@ var ArrowDetailSchema = ArrowEndDetailSchema.extend({
|
|
|
49
51
|
end: ArrowEndDetailSchema.optional().describe("End-end override (effective only when `arrow` includes an end arrow: `->` / `<->`). Fields merge into the top-level defaults; omitted fields inherit, present fields override.")
|
|
50
52
|
}).describe("Path-level arrow detail. Top-level visual fields (shape / scale / length / width / color / fill / opacity / lineWidth) act as shared defaults for both ends; `start` / `end` sub-objects per-field override the defaults.");
|
|
51
53
|
//#endregion
|
|
52
|
-
export { ARROW_MARKER_DEFAULT_SIZE, ARROW_MARKER_HOLLOW_DEFAULT_LINE_WIDTH, ARROW_SHAPES, ArrowDetailSchema, ArrowEndDetailSchema, HOLLOW_ARROW_SHAPES };
|
|
54
|
+
export { ARROW_MARKER_DEFAULT_SIZE, ARROW_MARKER_HOLLOW_DEFAULT_LINE_WIDTH, ARROW_SHAPES, ArrowDetailSchema, ArrowEndDetailSchema, DEFAULT_ARROW_SHAPE, HOLLOW_ARROW_SHAPES };
|
package/dist/es/ir/path/path.js
CHANGED
|
@@ -13,7 +13,7 @@ var PathSchema = z.object({
|
|
|
13
13
|
"<-",
|
|
14
14
|
"<->"
|
|
15
15
|
]).optional().describe("Path-level arrow direction. omitted/`none` = no arrows; `->` = arrow at end; `<-` = at start; `<->` = both."),
|
|
16
|
-
arrowDetail: ArrowDetailSchema.optional().describe("Detailed arrow visual config (shape / scale / length / width / color / fill / opacity / lineWidth) with optional `start` / `end` per-end overrides. Omitted = built-in defaults (shape `
|
|
16
|
+
arrowDetail: ArrowDetailSchema.optional().describe("Detailed arrow visual config (shape / scale / length / width / color / fill / opacity / lineWidth) with optional `start` / `end` per-end overrides. Omitted = built-in defaults (shape `stealth`, all visuals inherit from path stroke / opacity)."),
|
|
17
17
|
fill: z.string().optional().describe("Fill color of the closed region; any CSS color. Omitted = no fill (stroke only). Pairs with `cycle` step for filled shapes."),
|
|
18
18
|
fillRule: z.enum(["nonzero", "evenodd"]).optional().describe("How self-intersecting / nested sub-paths are filled. `nonzero` (default) winds-by-direction; `evenodd` toggles fill on each crossing — useful for ring / donut shapes."),
|
|
19
19
|
lineCap: z.enum([
|
|
@@ -49,13 +49,13 @@ var compileToScene = (ir, options = {}) => {
|
|
|
49
49
|
const primitives = [];
|
|
50
50
|
const nodeIndex = /* @__PURE__ */ new Map();
|
|
51
51
|
const allPoints = [];
|
|
52
|
+
const nodeLayouts = /* @__PURE__ */ new Map();
|
|
52
53
|
for (let i = 0; i < ir.children.length; i++) {
|
|
53
54
|
const child = ir.children[i];
|
|
54
55
|
if (child.type === "node") {
|
|
55
56
|
const layout = require_node.layoutNode(child, measureText, nodeIndex, nodeDistance);
|
|
56
57
|
if (child.id) nodeIndex.set(child.id, layout);
|
|
57
|
-
|
|
58
|
-
allPoints.push(require_rect.rect.anchor(layout.rect, "north-west"), require_rect.rect.anchor(layout.rect, "north-east"), require_rect.rect.anchor(layout.rect, "south-west"), require_rect.rect.anchor(layout.rect, "south-east"));
|
|
58
|
+
nodeLayouts.set(i, layout);
|
|
59
59
|
} else if (child.type === "coordinate") {
|
|
60
60
|
const center = require_position.resolvePosition(child.position, nodeIndex, nodeDistance);
|
|
61
61
|
if (!center) {
|
|
@@ -71,7 +71,12 @@ var compileToScene = (ir, options = {}) => {
|
|
|
71
71
|
}
|
|
72
72
|
for (let i = 0; i < ir.children.length; i++) {
|
|
73
73
|
const child = ir.children[i];
|
|
74
|
-
if (child.type === "
|
|
74
|
+
if (child.type === "node") {
|
|
75
|
+
const layout = nodeLayouts.get(i);
|
|
76
|
+
if (!layout) continue;
|
|
77
|
+
for (const prim of require_node.emitNodePrimitives(layout, round)) primitives.push(prim);
|
|
78
|
+
allPoints.push(require_rect.rect.anchor(layout.rect, "north-west"), require_rect.rect.anchor(layout.rect, "north-east"), require_rect.rect.anchor(layout.rect, "south-west"), require_rect.rect.anchor(layout.rect, "south-east"));
|
|
79
|
+
} else if (child.type === "path") {
|
|
75
80
|
const result = require_index.emitPathPrimitive(child, nodeIndex, round, measureText, {
|
|
76
81
|
onWarn,
|
|
77
82
|
irPath: `children[${i}].path`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../../src/compile/compile.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAc,MAAM,OAAO,CAAC;AAC5C,OAAO,KA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AwB,GACxB,yBAAyB,GACzB,sBAAsB,GACtB,8BAA8B,GAC9B,oBAAoB,GACpB,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IAClB,iBAAiB;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,2BAA2B;AAC3B,MAAM,MAAM,cAAc,GAAG;IAC3B,oCAAoC;IACpC,WAAW,CAAC,EAAE,YAAY,CAAC;IAC3B,qCAAqC;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;CAC5C,CAAC;AAWF;;;GAGG;AACH,eAAO,MAAM,cAAc,GAAI,IAAI,EAAE,EAAE,UAAS,cAAmB,KAAG,KAwErE,CAAC"}
|
|
@@ -9,7 +9,7 @@ var DEFAULT_PADDING = 8;
|
|
|
9
9
|
var DEFAULT_LINE_HEIGHT_FACTOR = 1.2;
|
|
10
10
|
var DEG_TO_RAD = Math.PI / 180;
|
|
11
11
|
/** Node label 与 node 边界默认距离(TikZ 默认 0pt 视觉太贴) */
|
|
12
|
-
var DEFAULT_LABEL_DISTANCE =
|
|
12
|
+
var DEFAULT_LABEL_DISTANCE = 12;
|
|
13
13
|
var SQRT2 = Math.SQRT2;
|
|
14
14
|
/** dashed 预设:4 px 实线 + 2 px 间隙循环 */
|
|
15
15
|
var DASHED_PATTERN = [4, 2];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const require_arrow = require("../../ir/path/arrow.cjs");
|
|
1
2
|
const require_anchor = require("./anchor.cjs");
|
|
2
3
|
const require_arrow_geometry = require("./arrow-geometry.cjs");
|
|
3
4
|
//#region src/compile/path/shrink.ts
|
|
@@ -6,7 +7,7 @@ const require_arrow_geometry = require("./arrow-geometry.cjs");
|
|
|
6
7
|
* @description 缺省字段继承顶层(不是"完全替换");空心 shape 上 fill 字段被丢(silent no-op)
|
|
7
8
|
*/
|
|
8
9
|
var resolveArrowEndSpec = (topLevel, endSide) => {
|
|
9
|
-
const baseShape = endSide?.shape ?? topLevel.shape ??
|
|
10
|
+
const baseShape = endSide?.shape ?? topLevel.shape ?? require_arrow.DEFAULT_ARROW_SHAPE;
|
|
10
11
|
const out = { shape: baseShape };
|
|
11
12
|
const scale = endSide?.scale ?? topLevel.scale;
|
|
12
13
|
if (scale !== void 0) out.scale = scale;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shrink.d.ts","sourceRoot":"","sources":["../../../../src/compile/path/shrink.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"shrink.d.ts","sourceRoot":"","sources":["../../../../src/compile/path/shrink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,aAAa,EAA0C,MAAM,UAAU,CAAC;AAC3G,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAmCjE,gEAAgE;AAChE,eAAO,MAAM,cAAc,GACzB,OAAO,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,SAAS,EAC/C,QAAQ,aAAa,GAAG,SAAS,KAChC;IAAE,UAAU,CAAC,EAAE,YAAY,CAAC;IAAC,QAAQ,CAAC,EAAE,YAAY,CAAA;CAatD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,GAAI,MAAM,YAAY,KAAG,MAIlD,CAAC;AAiDF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAC5B,UAAU,KAAK,CAAC,WAAW,CAAC,EAC5B,aAAa,MAAM,EACnB,WAAW,MAAM,EACjB,aAAa,MAAM,EACnB,OAAO,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,KAC3B,IA4CF,CAAC"}
|
package/dist/lib/index.cjs
CHANGED
|
@@ -40,6 +40,7 @@ exports.CoordinateSchema = require_coordinate.CoordinateSchema;
|
|
|
40
40
|
exports.CubicStepSchema = require_step.CubicStepSchema;
|
|
41
41
|
exports.CurveStepSchema = require_step.CurveStepSchema;
|
|
42
42
|
exports.CycleStepSchema = require_step.CycleStepSchema;
|
|
43
|
+
exports.DEFAULT_ARROW_SHAPE = require_arrow.DEFAULT_ARROW_SHAPE;
|
|
43
44
|
exports.DrawWay = require_parseWay.DrawWay;
|
|
44
45
|
exports.EllipsePathStepSchema = require_step.EllipsePathStepSchema;
|
|
45
46
|
exports.FoldStepSchema = require_step.FoldStepSchema;
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
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, ChildSchema, SceneSchema, CURRENT_IR_VERSION, } from './ir';
|
|
6
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, IRChild, IR, ArrowShape, IRArrowDetail, IRArrowEndDetail, NodeShape, NodeTextAlign, } from './ir';
|
|
7
|
-
export { ARROW_SHAPES, HOLLOW_ARROW_SHAPES, ARROW_MARKER_DEFAULT_SIZE, ARROW_MARKER_HOLLOW_DEFAULT_LINE_WIDTH, NODE_SHAPES, NODE_TEXT_ALIGNS, } from './ir';
|
|
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<>) */
|
|
10
10
|
MovePathCommand, LinePathCommand, QuadPathCommand, CubicPathCommand, ArcPathCommand, EllipseArcPathCommand, ClosePathCommand, ArrowEndSpec, GroupPrim, Transform,
|
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,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,WAAW,EACX,kBAAkB,GACnB,MAAM,MAAM,CAAC;AACd,YAAY,EACV,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,QAAQ,EACR,gBAAgB,EAChB,0BAA0B,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,CAAC;AACpB,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAGxF,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,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,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,MAAM,EACN,MAAM,EACN,WAAW,EACX,YAAY,EACZ,MAAM,EACN,UAAU,EACV,WAAW,EACX,MAAM,EACN,OAAO,EACP,EAAE,EACF,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,SAAS,EACT,aAAa,GACd,MAAM,MAAM,CAAC;AACd,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,sCAAsC,EACtC,WAAW,EACX,gBAAgB,GACjB,MAAM,MAAM,CAAC;AAGd,YAAY,EACV,cAAc,EACd,QAAQ,EACR,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,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
|
package/dist/lib/ir/node.cjs
CHANGED
|
@@ -24,12 +24,12 @@ var NODE_TEXT_ALIGNS = {
|
|
|
24
24
|
};
|
|
25
25
|
/**
|
|
26
26
|
* 节点附属标签 label(TikZ `[label=above:foo]` 同义)
|
|
27
|
-
* @description 可挂多个;label 不参与 layout。position 支持 8 方向枚举或数字角度(polar 约定:0°=+x,90°=+y 屏幕下方);默认 position='above',distance=
|
|
27
|
+
* @description 可挂多个;label 不参与 layout。position 支持 8 方向枚举或数字角度(polar 约定:0°=+x,90°=+y 屏幕下方);默认 position='above',distance=12
|
|
28
28
|
*/
|
|
29
29
|
var NodeLabelSchema = zod.z.object({
|
|
30
30
|
text: zod.z.string().describe("Label text content; rendered as a single line."),
|
|
31
31
|
position: zod.z.union([zod.z.nativeEnum(require_at_position.AT_DIRECTIONS), zod.z.number()]).optional().describe("Placement around the node border: 8-direction enum (above / right / above-left / ...) or numeric angle in degrees (`label=30:foo` for radial placement). Default `above`. Numeric uses the polar convention (0° = +x, 90° = +y, screen-down)."),
|
|
32
|
-
distance: zod.z.number().nonnegative().optional().describe("Gap between the node border and the label center, in user units. Default
|
|
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
35
|
font: require_font.FontSchema.optional().describe("Label font overrides; missing fields inherit from the parent node font, then renderer defaults.")
|
package/dist/lib/ir/node.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export declare const NODE_TEXT_ALIGNS: {
|
|
|
21
21
|
export type NodeTextAlign = ValueOf<typeof NODE_TEXT_ALIGNS>;
|
|
22
22
|
/**
|
|
23
23
|
* 节点附属标签 label(TikZ `[label=above:foo]` 同义)
|
|
24
|
-
* @description 可挂多个;label 不参与 layout。position 支持 8 方向枚举或数字角度(polar 约定:0°=+x,90°=+y 屏幕下方);默认 position='above',distance=
|
|
24
|
+
* @description 可挂多个;label 不参与 layout。position 支持 8 方向枚举或数字角度(polar 约定:0°=+x,90°=+y 屏幕下方);默认 position='above',distance=12
|
|
25
25
|
*/
|
|
26
26
|
export declare const NodeLabelSchema: z.ZodObject<{
|
|
27
27
|
text: z.ZodString;
|
|
@@ -2,7 +2,7 @@ let zod = require("zod");
|
|
|
2
2
|
//#region src/ir/path/arrow.ts
|
|
3
3
|
/**
|
|
4
4
|
* 箭头形状常量(用 const 而非 TS enum 避免 reverse-mapping 和字面量不互通)
|
|
5
|
-
* @description normal
|
|
5
|
+
* @description normal 实心三角;open 空心三角(UML 泛化/继承);stealth 尖锐倒钩(默认);diamond 实心菱形(UML 组合);openDiamond 空心菱形(聚合);circle 实心圆点;openCircle 空心圆点
|
|
6
6
|
*/
|
|
7
7
|
var ARROW_SHAPES = {
|
|
8
8
|
normal: "normal",
|
|
@@ -13,6 +13,8 @@ var ARROW_SHAPES = {
|
|
|
13
13
|
circle: "circle",
|
|
14
14
|
openCircle: "openCircle"
|
|
15
15
|
};
|
|
16
|
+
/** 箭头默认形状 */
|
|
17
|
+
var DEFAULT_ARROW_SHAPE = ARROW_SHAPES.stealth;
|
|
16
18
|
/**
|
|
17
19
|
* 空心 shape 集合(fill 字段在这些 shape 上 silent no-op)
|
|
18
20
|
* @description compile 与 render 都引用此表判定 fill 是否丢弃;空心 shape 用 color 主导描边、lineWidth 控描边粗
|
|
@@ -31,7 +33,7 @@ var ARROW_MARKER_HOLLOW_DEFAULT_LINE_WIDTH = 1.5;
|
|
|
31
33
|
* @description 顶层 8 字段全 optional;fill 在空心 shape 上 silent no-op(schema 不拒绝、compile/render 丢字段);start/end 子对象用相同字段集(无 start/end 递归)
|
|
32
34
|
*/
|
|
33
35
|
var ArrowEndDetailSchema = zod.z.object({
|
|
34
|
-
shape: zod.z.nativeEnum(ARROW_SHAPES).optional().describe("Arrow tip shape. Defaults to `
|
|
36
|
+
shape: zod.z.nativeEnum(ARROW_SHAPES).optional().describe("Arrow tip shape. Defaults to `stealth` (sharp barb). Other values: `normal` (filled triangle), `open` (hollow triangle), `diamond`, `openDiamond`, `circle`, `openCircle`."),
|
|
35
37
|
scale: zod.z.number().positive().optional().describe("Uniform tip scale factor; multiplies `length` and `width` (e.g. `length=10, scale=1.5` → effective 15). Defaults to 1."),
|
|
36
38
|
length: zod.z.number().nonnegative().optional().describe("Tip length in user units (the dimension along the path direction). Defaults to ~6."),
|
|
37
39
|
width: zod.z.number().nonnegative().optional().describe("Tip width in user units (perpendicular to the path). Defaults to ~6."),
|
|
@@ -54,4 +56,5 @@ exports.ARROW_MARKER_HOLLOW_DEFAULT_LINE_WIDTH = ARROW_MARKER_HOLLOW_DEFAULT_LIN
|
|
|
54
56
|
exports.ARROW_SHAPES = ARROW_SHAPES;
|
|
55
57
|
exports.ArrowDetailSchema = ArrowDetailSchema;
|
|
56
58
|
exports.ArrowEndDetailSchema = ArrowEndDetailSchema;
|
|
59
|
+
exports.DEFAULT_ARROW_SHAPE = DEFAULT_ARROW_SHAPE;
|
|
57
60
|
exports.HOLLOW_ARROW_SHAPES = HOLLOW_ARROW_SHAPES;
|
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { ValueOf } from '../../types';
|
|
3
3
|
/**
|
|
4
4
|
* 箭头形状常量(用 const 而非 TS enum 避免 reverse-mapping 和字面量不互通)
|
|
5
|
-
* @description normal
|
|
5
|
+
* @description normal 实心三角;open 空心三角(UML 泛化/继承);stealth 尖锐倒钩(默认);diamond 实心菱形(UML 组合);openDiamond 空心菱形(聚合);circle 实心圆点;openCircle 空心圆点
|
|
6
6
|
*/
|
|
7
7
|
export declare const ARROW_SHAPES: {
|
|
8
8
|
readonly normal: "normal";
|
|
@@ -15,6 +15,8 @@ export declare const ARROW_SHAPES: {
|
|
|
15
15
|
};
|
|
16
16
|
/** 箭头形状字面量类型 */
|
|
17
17
|
export type ArrowShape = ValueOf<typeof ARROW_SHAPES>;
|
|
18
|
+
/** 箭头默认形状 */
|
|
19
|
+
export declare const DEFAULT_ARROW_SHAPE: "stealth";
|
|
18
20
|
/**
|
|
19
21
|
* 空心 shape 集合(fill 字段在这些 shape 上 silent no-op)
|
|
20
22
|
* @description compile 与 render 都引用此表判定 fill 是否丢弃;空心 shape 用 color 主导描边、lineWidth 控描边粗
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrow.d.ts","sourceRoot":"","sources":["../../../../src/ir/path/arrow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,YAAY;;;;;;;;CAQf,CAAC;AAEX,gBAAgB;AAChB,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,YAAY,CAAC,CAAC;AAEtD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,iBAA6D,CAAC;AAE9F,wCAAwC;AACxC,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAE3C,0CAA0C;AAC1C,eAAO,MAAM,sCAAsC,MAAM,CAAC;AAE1D;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2D9B,CAAC;AAEJ;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAS7B,CAAC;AAEF,gBAAgB;AAChB,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACpE,mBAAmB;AACnB,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"arrow.d.ts","sourceRoot":"","sources":["../../../../src/ir/path/arrow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,YAAY;;;;;;;;CAQf,CAAC;AAEX,gBAAgB;AAChB,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,YAAY,CAAC,CAAC;AAEtD,aAAa;AACb,eAAO,MAAM,mBAAmB,WAAuB,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,iBAA6D,CAAC;AAE9F,wCAAwC;AACxC,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAE3C,0CAA0C;AAC1C,eAAO,MAAM,sCAAsC,MAAM,CAAC;AAE1D;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2D9B,CAAC;AAEJ;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAS7B,CAAC;AAEF,gBAAgB;AAChB,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACpE,mBAAmB;AACnB,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -13,7 +13,7 @@ var PathSchema = zod.z.object({
|
|
|
13
13
|
"<-",
|
|
14
14
|
"<->"
|
|
15
15
|
]).optional().describe("Path-level arrow direction. omitted/`none` = no arrows; `->` = arrow at end; `<-` = at start; `<->` = both."),
|
|
16
|
-
arrowDetail: require_arrow.ArrowDetailSchema.optional().describe("Detailed arrow visual config (shape / scale / length / width / color / fill / opacity / lineWidth) with optional `start` / `end` per-end overrides. Omitted = built-in defaults (shape `
|
|
16
|
+
arrowDetail: require_arrow.ArrowDetailSchema.optional().describe("Detailed arrow visual config (shape / scale / length / width / color / fill / opacity / lineWidth) with optional `start` / `end` per-end overrides. Omitted = built-in defaults (shape `stealth`, all visuals inherit from path stroke / opacity)."),
|
|
17
17
|
fill: zod.z.string().optional().describe("Fill color of the closed region; any CSS color. Omitted = no fill (stroke only). Pairs with `cycle` step for filled shapes."),
|
|
18
18
|
fillRule: zod.z.enum(["nonzero", "evenodd"]).optional().describe("How self-intersecting / nested sub-paths are filled. `nonzero` (default) winds-by-direction; `evenodd` toggles fill on each crossing — useful for ring / donut shapes."),
|
|
19
19
|
lineCap: zod.z.enum([
|