@retikz/core 0.2.0-alpha.6 → 0.2.0-alpha.8
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/arrows/index.d.ts +13 -0
- package/dist/es/arrows/index.d.ts.map +1 -0
- package/dist/es/arrows/index.js +118 -0
- package/dist/es/arrows/types.d.ts +43 -0
- package/dist/es/arrows/types.d.ts.map +1 -0
- package/dist/es/compile/compile.d.ts +26 -1
- package/dist/es/compile/compile.d.ts.map +1 -1
- package/dist/es/compile/compile.js +37 -4
- package/dist/es/compile/marker-prim.d.ts +22 -0
- package/dist/es/compile/marker-prim.d.ts.map +1 -0
- package/dist/es/compile/marker-prim.js +63 -0
- package/dist/es/compile/node.d.ts +19 -4
- package/dist/es/compile/node.d.ts.map +1 -1
- package/dist/es/compile/node.js +159 -29
- package/dist/es/compile/paint.d.ts +21 -0
- package/dist/es/compile/paint.d.ts.map +1 -0
- package/dist/es/compile/paint.js +94 -0
- package/dist/es/compile/path/index.d.ts +18 -0
- package/dist/es/compile/path/index.d.ts.map +1 -1
- package/dist/es/compile/path/index.js +260 -11
- package/dist/es/compile/path/relative.d.ts.map +1 -1
- package/dist/es/compile/path/relative.js +8 -0
- package/dist/es/compile/path/shrink.d.ts +19 -6
- package/dist/es/compile/path/shrink.d.ts.map +1 -1
- package/dist/es/compile/path/shrink.js +147 -25
- package/dist/es/geometry/bend.d.ts +7 -0
- package/dist/es/geometry/bend.d.ts.map +1 -1
- package/dist/es/geometry/bend.js +26 -1
- package/dist/es/index.d.ts +14 -4
- package/dist/es/index.d.ts.map +1 -1
- package/dist/es/index.js +7 -2
- package/dist/es/ir/index.d.ts +2 -0
- package/dist/es/ir/index.d.ts.map +1 -1
- package/dist/es/ir/json.d.ts +22 -0
- package/dist/es/ir/json.d.ts.map +1 -0
- package/dist/es/ir/json.js +25 -0
- package/dist/es/ir/node.d.ts +262 -9
- package/dist/es/ir/node.d.ts.map +1 -1
- package/dist/es/ir/node.js +9 -2
- package/dist/es/ir/paint.d.ts +154 -0
- package/dist/es/ir/paint.d.ts.map +1 -0
- package/dist/es/ir/paint.js +59 -0
- package/dist/es/ir/path/arrow.d.ts +52 -72
- package/dist/es/ir/path/arrow.d.ts.map +1 -1
- package/dist/es/ir/path/arrow.js +5 -5
- package/dist/es/ir/path/path.d.ts +637 -87
- package/dist/es/ir/path/path.d.ts.map +1 -1
- package/dist/es/ir/path/path.js +23 -2
- package/dist/es/ir/path/step.d.ts +363 -8
- package/dist/es/ir/path/step.d.ts.map +1 -1
- package/dist/es/ir/path/step.js +17 -4
- package/dist/es/ir/scope.d.ts +1874 -338
- package/dist/es/ir/scope.d.ts.map +1 -1
- package/dist/es/ir/scope.js +2 -1
- package/dist/es/pathGenerators/define.d.ts +16 -0
- package/dist/es/pathGenerators/define.d.ts.map +1 -0
- package/dist/es/pathGenerators/define.js +23 -0
- package/dist/es/pathGenerators/index.d.ts +9 -0
- package/dist/es/pathGenerators/index.d.ts.map +1 -0
- package/dist/es/pathGenerators/types.d.ts +45 -0
- package/dist/es/pathGenerators/types.d.ts.map +1 -0
- package/dist/es/patterns/index.d.ts +10 -0
- package/dist/es/patterns/index.d.ts.map +1 -0
- package/dist/es/patterns/index.js +83 -0
- package/dist/es/patterns/types.d.ts +38 -0
- package/dist/es/patterns/types.d.ts.map +1 -0
- package/dist/es/primitive/ellipse.d.ts +3 -5
- package/dist/es/primitive/ellipse.d.ts.map +1 -1
- package/dist/es/primitive/index.d.ts +1 -0
- package/dist/es/primitive/index.d.ts.map +1 -1
- package/dist/es/primitive/marker.d.ts +160 -0
- package/dist/es/primitive/marker.d.ts.map +1 -0
- package/dist/es/primitive/paint.d.ts +46 -0
- package/dist/es/primitive/paint.d.ts.map +1 -0
- package/dist/es/primitive/path.d.ts +25 -20
- package/dist/es/primitive/path.d.ts.map +1 -1
- package/dist/es/primitive/rect.d.ts +3 -2
- package/dist/es/primitive/rect.d.ts.map +1 -1
- package/dist/es/primitive/scene.d.ts +4 -0
- package/dist/es/primitive/scene.d.ts.map +1 -1
- package/dist/es/shapes/types.d.ts +2 -2
- package/dist/es/shapes/types.d.ts.map +1 -1
- package/dist/lib/arrows/index.cjs +118 -0
- package/dist/lib/arrows/index.d.ts +13 -0
- package/dist/lib/arrows/index.d.ts.map +1 -0
- package/dist/lib/arrows/types.d.ts +43 -0
- package/dist/lib/arrows/types.d.ts.map +1 -0
- package/dist/lib/compile/compile.cjs +38 -5
- package/dist/lib/compile/compile.d.ts +26 -1
- package/dist/lib/compile/compile.d.ts.map +1 -1
- package/dist/lib/compile/marker-prim.cjs +63 -0
- package/dist/lib/compile/marker-prim.d.ts +22 -0
- package/dist/lib/compile/marker-prim.d.ts.map +1 -0
- package/dist/lib/compile/node.cjs +159 -28
- package/dist/lib/compile/node.d.ts +19 -4
- package/dist/lib/compile/node.d.ts.map +1 -1
- package/dist/lib/compile/paint.cjs +94 -0
- package/dist/lib/compile/paint.d.ts +21 -0
- package/dist/lib/compile/paint.d.ts.map +1 -0
- package/dist/lib/compile/path/index.cjs +258 -9
- package/dist/lib/compile/path/index.d.ts +18 -0
- package/dist/lib/compile/path/index.d.ts.map +1 -1
- package/dist/lib/compile/path/relative.cjs +8 -0
- package/dist/lib/compile/path/relative.d.ts.map +1 -1
- package/dist/lib/compile/path/shrink.cjs +147 -25
- package/dist/lib/compile/path/shrink.d.ts +19 -6
- package/dist/lib/compile/path/shrink.d.ts.map +1 -1
- package/dist/lib/geometry/bend.cjs +26 -0
- package/dist/lib/geometry/bend.d.ts +7 -0
- package/dist/lib/geometry/bend.d.ts.map +1 -1
- package/dist/lib/index.cjs +14 -0
- package/dist/lib/index.d.ts +14 -4
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/ir/index.d.ts +2 -0
- package/dist/lib/ir/index.d.ts.map +1 -1
- package/dist/lib/ir/json.cjs +26 -0
- package/dist/lib/ir/json.d.ts +22 -0
- package/dist/lib/ir/json.d.ts.map +1 -0
- package/dist/lib/ir/node.cjs +9 -2
- package/dist/lib/ir/node.d.ts +262 -9
- package/dist/lib/ir/node.d.ts.map +1 -1
- package/dist/lib/ir/paint.cjs +61 -0
- package/dist/lib/ir/paint.d.ts +154 -0
- package/dist/lib/ir/paint.d.ts.map +1 -0
- package/dist/lib/ir/path/arrow.cjs +5 -5
- package/dist/lib/ir/path/arrow.d.ts +52 -72
- package/dist/lib/ir/path/arrow.d.ts.map +1 -1
- package/dist/lib/ir/path/path.cjs +22 -1
- package/dist/lib/ir/path/path.d.ts +637 -87
- package/dist/lib/ir/path/path.d.ts.map +1 -1
- package/dist/lib/ir/path/step.cjs +17 -3
- package/dist/lib/ir/path/step.d.ts +363 -8
- package/dist/lib/ir/path/step.d.ts.map +1 -1
- package/dist/lib/ir/scope.cjs +2 -1
- package/dist/lib/ir/scope.d.ts +1874 -338
- package/dist/lib/ir/scope.d.ts.map +1 -1
- package/dist/lib/pathGenerators/define.cjs +23 -0
- package/dist/lib/pathGenerators/define.d.ts +16 -0
- package/dist/lib/pathGenerators/define.d.ts.map +1 -0
- package/dist/lib/pathGenerators/index.d.ts +9 -0
- package/dist/lib/pathGenerators/index.d.ts.map +1 -0
- package/dist/lib/pathGenerators/types.d.ts +45 -0
- package/dist/lib/pathGenerators/types.d.ts.map +1 -0
- package/dist/lib/patterns/index.cjs +83 -0
- package/dist/lib/patterns/index.d.ts +10 -0
- package/dist/lib/patterns/index.d.ts.map +1 -0
- package/dist/lib/patterns/types.d.ts +38 -0
- package/dist/lib/patterns/types.d.ts.map +1 -0
- package/dist/lib/primitive/ellipse.d.ts +3 -5
- package/dist/lib/primitive/ellipse.d.ts.map +1 -1
- package/dist/lib/primitive/index.d.ts +1 -0
- package/dist/lib/primitive/index.d.ts.map +1 -1
- package/dist/lib/primitive/marker.d.ts +160 -0
- package/dist/lib/primitive/marker.d.ts.map +1 -0
- package/dist/lib/primitive/paint.d.ts +46 -0
- package/dist/lib/primitive/paint.d.ts.map +1 -0
- package/dist/lib/primitive/path.d.ts +25 -20
- package/dist/lib/primitive/path.d.ts.map +1 -1
- package/dist/lib/primitive/rect.d.ts +3 -2
- package/dist/lib/primitive/rect.d.ts.map +1 -1
- package/dist/lib/primitive/scene.d.ts +4 -0
- package/dist/lib/primitive/scene.d.ts.map +1 -1
- package/dist/lib/shapes/types.d.ts +2 -2
- package/dist/lib/shapes/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/es/compile/path/arrow-geometry.d.ts +0 -22
- package/dist/es/compile/path/arrow-geometry.d.ts.map +0 -1
- package/dist/es/compile/path/arrow-geometry.js +0 -40
- package/dist/lib/compile/path/arrow-geometry.cjs +0 -41
- package/dist/lib/compile/path/arrow-geometry.d.ts +0 -22
- package/dist/lib/compile/path/arrow-geometry.d.ts.map +0 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PaintValue } from './paint';
|
|
1
2
|
/** 矩形原语 */
|
|
2
3
|
export type RectPrim = {
|
|
3
4
|
/** 类型判别符 */
|
|
@@ -10,8 +11,8 @@ export type RectPrim = {
|
|
|
10
11
|
width: number;
|
|
11
12
|
/** 矩形高度 */
|
|
12
13
|
height: number;
|
|
13
|
-
/**
|
|
14
|
-
fill?:
|
|
14
|
+
/** 填充:纯色 CSS 串、或指向资源表的 paint server(gradient)、或 contextStroke */
|
|
15
|
+
fill?: PaintValue;
|
|
15
16
|
/** 填充透明度 0~1 */
|
|
16
17
|
fillOpacity?: number;
|
|
17
18
|
/** 描边色 */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rect.d.ts","sourceRoot":"","sources":["../../../src/primitive/rect.ts"],"names":[],"mappings":"AAAA,WAAW;AACX,MAAM,MAAM,QAAQ,GAAG;IACrB,YAAY;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,aAAa;IACb,CAAC,EAAE,MAAM,CAAC;IACV,aAAa;IACb,CAAC,EAAE,MAAM,CAAC;IACV,WAAW;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW;IACX,MAAM,EAAE,MAAM,CAAC;IACf,
|
|
1
|
+
{"version":3,"file":"rect.d.ts","sourceRoot":"","sources":["../../../src/primitive/rect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,WAAW;AACX,MAAM,MAAM,QAAQ,GAAG;IACrB,YAAY;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,aAAa;IACb,CAAC,EAAE,MAAM,CAAC;IACV,aAAa;IACb,CAAC,EAAE,MAAM,CAAC;IACV,WAAW;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW;IACX,MAAM,EAAE,MAAM,CAAC;IACf,iEAAiE;IACjE,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,gBAAgB;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU;IACV,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gCAAgC;IAChC,WAAW,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC5B,wBAAwB;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC"}
|
|
@@ -4,6 +4,8 @@ import { PathPrim } from './path';
|
|
|
4
4
|
import { RectPrim } from './rect';
|
|
5
5
|
import { TextPrim } from './text';
|
|
6
6
|
import { Layout } from './layout';
|
|
7
|
+
import { SceneResource } from './paint';
|
|
8
|
+
export type { PaintValue, SceneResource, ResolvedPatternTile } from './paint';
|
|
7
9
|
/**
|
|
8
10
|
* Scene primitive:渲染目标无关的最大公约子集
|
|
9
11
|
* @description 所有 adapter(SVG/Canvas/PDF/Skia)都应能消费;不允许出现 SVG-only 或 Canvas-only 特性(filter/marker/imageData)
|
|
@@ -15,5 +17,7 @@ export type Scene = {
|
|
|
15
17
|
primitives: Array<ScenePrimitive>;
|
|
16
18
|
/** 整个场景的布局边界 */
|
|
17
19
|
layout: Layout;
|
|
20
|
+
/** 渲染无关资源表(paint server 等);adapter 物化(SVG → `<defs>`)。无资源时省略 */
|
|
21
|
+
resources?: Array<SceneResource>;
|
|
18
22
|
};
|
|
19
23
|
//# sourceMappingURL=scene.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scene.d.ts","sourceRoot":"","sources":["../../../src/primitive/scene.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"scene.d.ts","sourceRoot":"","sources":["../../../src/primitive/scene.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE9E;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,WAAW,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEtF,qCAAqC;AACrC,MAAM,MAAM,KAAK,GAAG;IAClB,wBAAwB;IACxB,UAAU,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;IAClC,gBAAgB;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,gEAAgE;IAChE,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;CAClC,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Position } from '../geometry/point';
|
|
2
2
|
import { Rect } from '../geometry/rect';
|
|
3
|
-
import { ScenePrimitive } from '../primitive';
|
|
3
|
+
import { PaintValue, ScenePrimitive } from '../primitive';
|
|
4
4
|
/**
|
|
5
5
|
* emit 需要的视觉样式子集
|
|
6
6
|
* @description 从 NodeLayout 的样式字段收敛(不含几何 / 文本);独立 type,不耦合内部 NodeLayout。
|
|
7
7
|
* 字段名与 NodeLayout 样式字段一致(单一词汇表)。
|
|
8
8
|
*/
|
|
9
9
|
export type ShapeStyle = {
|
|
10
|
-
fill?:
|
|
10
|
+
fill?: PaintValue;
|
|
11
11
|
fillOpacity?: number;
|
|
12
12
|
stroke?: string;
|
|
13
13
|
strokeOpacity?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/shapes/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/shapes/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE/D;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;;OAGG;IACH,YAAY,EAAE,CACZ,cAAc,EAAE,MAAM,EACtB,eAAe,EAAE,MAAM,KACpB;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/C,0CAA0C;IAC1C,aAAa,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,KAAK,QAAQ,CAAC;IAC1D,6DAA6D;IAC7D,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,KAAK,QAAQ,GAAG,SAAS,CAAC;IAC3D;;;;OAIG;IACH,SAAS,CAAC,EAAE,CACV,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,EACzC,CAAC,EAAE,MAAM,KACN,QAAQ,CAAC;IACd,4DAA4D;IAC5D,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,KAAK,QAAQ,CAAC,cAAc,CAAC,CAAC;CACjG,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ArrowShape } from '../../ir';
|
|
2
|
-
import { ArrowEndSpec } from '../../primitive';
|
|
3
|
-
/** 箭头形状几何:供路径端点收缩计算使用 */
|
|
4
|
-
export type ArrowShapeGeometry = {
|
|
5
|
-
/** 标准局部坐标基准尺寸 */
|
|
6
|
-
baseSize: number;
|
|
7
|
-
/** 箭头尖端在标准局部坐标里的 x 位置 */
|
|
8
|
-
tipX: number;
|
|
9
|
-
/** 路径线段应接触箭头尾部或凹口的位置 */
|
|
10
|
-
lineContactX: number;
|
|
11
|
-
/** 默认箭头长度 */
|
|
12
|
-
defaultLength: number;
|
|
13
|
-
/** 默认箭头宽度 */
|
|
14
|
-
defaultWidth: number;
|
|
15
|
-
/** 空心箭头默认描边宽度 */
|
|
16
|
-
hollowLineWidth?: number;
|
|
17
|
-
};
|
|
18
|
-
/** 箭头形状是否为空心描边形状 */
|
|
19
|
-
export declare const isHollowArrowShape: (shape: ArrowShape) => boolean;
|
|
20
|
-
/** 解析端点箭头在标准局部坐标中的中性几何 */
|
|
21
|
-
export declare const resolveArrowShapeGeometry: (spec: ArrowEndSpec) => ArrowShapeGeometry;
|
|
22
|
-
//# sourceMappingURL=arrow-geometry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"arrow-geometry.d.ts","sourceRoot":"","sources":["../../../../src/compile/path/arrow-geometry.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAKpD,yBAAyB;AACzB,MAAM,MAAM,kBAAkB,GAAG;IAC/B,iBAAiB;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,wBAAwB;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,oBAAoB;AACpB,eAAO,MAAM,kBAAkB,GAAI,OAAO,UAAU,KAAG,OACvB,CAAC;AAEjC,0BAA0B;AAC1B,eAAO,MAAM,yBAAyB,GAAI,MAAM,YAAY,KAAG,kBAgC9D,CAAC"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { HOLLOW_ARROW_SHAPES } from "../../ir/path/arrow.js";
|
|
2
|
-
//#region src/compile/path/arrow-geometry.ts
|
|
3
|
-
/** 标准箭头局部坐标基准尺寸 */
|
|
4
|
-
var ARROW_GEOMETRY_BASE_SIZE = 10;
|
|
5
|
-
/** 箭头形状是否为空心描边形状 */
|
|
6
|
-
var isHollowArrowShape = (shape) => HOLLOW_ARROW_SHAPES.has(shape);
|
|
7
|
-
/** 解析端点箭头在标准局部坐标中的中性几何 */
|
|
8
|
-
var resolveArrowShapeGeometry = (spec) => {
|
|
9
|
-
const lineWidth = spec.lineWidth ?? 1.5;
|
|
10
|
-
const base = {
|
|
11
|
-
baseSize: ARROW_GEOMETRY_BASE_SIZE,
|
|
12
|
-
tipX: ARROW_GEOMETRY_BASE_SIZE,
|
|
13
|
-
lineContactX: 0,
|
|
14
|
-
defaultLength: 6,
|
|
15
|
-
defaultWidth: 6
|
|
16
|
-
};
|
|
17
|
-
switch (spec.shape) {
|
|
18
|
-
case "normal":
|
|
19
|
-
case "diamond":
|
|
20
|
-
case "circle": return base;
|
|
21
|
-
case "stealth": return {
|
|
22
|
-
...base,
|
|
23
|
-
lineContactX: 3
|
|
24
|
-
};
|
|
25
|
-
case "open":
|
|
26
|
-
case "openDiamond": return {
|
|
27
|
-
...base,
|
|
28
|
-
tipX: 9,
|
|
29
|
-
lineContactX: 1 - lineWidth / 2,
|
|
30
|
-
hollowLineWidth: lineWidth
|
|
31
|
-
};
|
|
32
|
-
case "openCircle": return {
|
|
33
|
-
...base,
|
|
34
|
-
lineContactX: .75 - lineWidth / 2,
|
|
35
|
-
hollowLineWidth: lineWidth
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
//#endregion
|
|
40
|
-
export { isHollowArrowShape, resolveArrowShapeGeometry };
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
const require_arrow = require("../../ir/path/arrow.cjs");
|
|
2
|
-
//#region src/compile/path/arrow-geometry.ts
|
|
3
|
-
/** 标准箭头局部坐标基准尺寸 */
|
|
4
|
-
var ARROW_GEOMETRY_BASE_SIZE = 10;
|
|
5
|
-
/** 箭头形状是否为空心描边形状 */
|
|
6
|
-
var isHollowArrowShape = (shape) => require_arrow.HOLLOW_ARROW_SHAPES.has(shape);
|
|
7
|
-
/** 解析端点箭头在标准局部坐标中的中性几何 */
|
|
8
|
-
var resolveArrowShapeGeometry = (spec) => {
|
|
9
|
-
const lineWidth = spec.lineWidth ?? 1.5;
|
|
10
|
-
const base = {
|
|
11
|
-
baseSize: ARROW_GEOMETRY_BASE_SIZE,
|
|
12
|
-
tipX: ARROW_GEOMETRY_BASE_SIZE,
|
|
13
|
-
lineContactX: 0,
|
|
14
|
-
defaultLength: 6,
|
|
15
|
-
defaultWidth: 6
|
|
16
|
-
};
|
|
17
|
-
switch (spec.shape) {
|
|
18
|
-
case "normal":
|
|
19
|
-
case "diamond":
|
|
20
|
-
case "circle": return base;
|
|
21
|
-
case "stealth": return {
|
|
22
|
-
...base,
|
|
23
|
-
lineContactX: 3
|
|
24
|
-
};
|
|
25
|
-
case "open":
|
|
26
|
-
case "openDiamond": return {
|
|
27
|
-
...base,
|
|
28
|
-
tipX: 9,
|
|
29
|
-
lineContactX: 1 - lineWidth / 2,
|
|
30
|
-
hollowLineWidth: lineWidth
|
|
31
|
-
};
|
|
32
|
-
case "openCircle": return {
|
|
33
|
-
...base,
|
|
34
|
-
lineContactX: .75 - lineWidth / 2,
|
|
35
|
-
hollowLineWidth: lineWidth
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
//#endregion
|
|
40
|
-
exports.isHollowArrowShape = isHollowArrowShape;
|
|
41
|
-
exports.resolveArrowShapeGeometry = resolveArrowShapeGeometry;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ArrowShape } from '../../ir';
|
|
2
|
-
import { ArrowEndSpec } from '../../primitive';
|
|
3
|
-
/** 箭头形状几何:供路径端点收缩计算使用 */
|
|
4
|
-
export type ArrowShapeGeometry = {
|
|
5
|
-
/** 标准局部坐标基准尺寸 */
|
|
6
|
-
baseSize: number;
|
|
7
|
-
/** 箭头尖端在标准局部坐标里的 x 位置 */
|
|
8
|
-
tipX: number;
|
|
9
|
-
/** 路径线段应接触箭头尾部或凹口的位置 */
|
|
10
|
-
lineContactX: number;
|
|
11
|
-
/** 默认箭头长度 */
|
|
12
|
-
defaultLength: number;
|
|
13
|
-
/** 默认箭头宽度 */
|
|
14
|
-
defaultWidth: number;
|
|
15
|
-
/** 空心箭头默认描边宽度 */
|
|
16
|
-
hollowLineWidth?: number;
|
|
17
|
-
};
|
|
18
|
-
/** 箭头形状是否为空心描边形状 */
|
|
19
|
-
export declare const isHollowArrowShape: (shape: ArrowShape) => boolean;
|
|
20
|
-
/** 解析端点箭头在标准局部坐标中的中性几何 */
|
|
21
|
-
export declare const resolveArrowShapeGeometry: (spec: ArrowEndSpec) => ArrowShapeGeometry;
|
|
22
|
-
//# sourceMappingURL=arrow-geometry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"arrow-geometry.d.ts","sourceRoot":"","sources":["../../../../src/compile/path/arrow-geometry.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAKpD,yBAAyB;AACzB,MAAM,MAAM,kBAAkB,GAAG;IAC/B,iBAAiB;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,wBAAwB;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,oBAAoB;AACpB,eAAO,MAAM,kBAAkB,GAAI,OAAO,UAAU,KAAG,OACvB,CAAC;AAEjC,0BAA0B;AAC1B,eAAO,MAAM,yBAAyB,GAAI,MAAM,YAAY,KAAG,kBAgC9D,CAAC"}
|