@knowvah/dot-engine 1.2.1 → 1.2.3
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/common/arrows-shapes-poly.d.ts +1 -1
- package/dist/common/arrows-shapes-poly.d.ts.map +1 -1
- package/dist/common/arrows-shapes.d.ts +2 -2
- package/dist/common/arrows-shapes.d.ts.map +1 -1
- package/dist/common/nodeinit.d.ts.map +1 -1
- package/dist/common/poly-inside.d.ts +6 -0
- package/dist/common/poly-inside.d.ts.map +1 -1
- package/dist/common/poly-sizing.d.ts +8 -0
- package/dist/common/poly-sizing.d.ts.map +1 -1
- package/dist/common/poly-vertices.d.ts.map +1 -1
- package/dist/index.js +95 -24
- package/dist/index.js.map +3 -3
- package/dist/layout/dot/edge-route-arrow.d.ts +8 -0
- package/dist/layout/dot/edge-route-arrow.d.ts.map +1 -1
- package/dist/layout/dot/edge-route-helpers.d.ts.map +1 -1
- package/dist/model/geom.d.ts +5 -0
- package/dist/model/geom.d.ts.map +1 -1
- package/dist/render.js +115 -44
- package/dist/render.js.map +4 -4
- package/package.json +1 -1
- package/src/common/arrows-shapes-poly.ts +20 -1
- package/src/common/arrows-shapes.ts +6 -2
- package/src/common/nodeinit.ts +6 -2
- package/src/common/poly-inside.ts +21 -8
- package/src/common/poly-sizing.ts +10 -0
- package/src/common/poly-vertices.ts +37 -4
- package/src/layout/dot/edge-route-arrow.ts +7 -2
- package/src/layout/dot/edge-route-helpers.ts +19 -0
- package/src/model/geom.ts +14 -0
|
@@ -18,7 +18,7 @@ export declare function genTee(p0: Point, u: Point, _arrowsize: number, penwidth
|
|
|
18
18
|
/** @see lib/common/arrows.c:arrow_length_tee (preserves the C `_at_start` reuse) */
|
|
19
19
|
export declare function arrowLengthTee(lenfact: number, arrowsize: number, penwidth: number): number;
|
|
20
20
|
/** @see lib/common/arrows.c:arrow_type_curve */
|
|
21
|
-
export declare function genCurve(p0: Point, u: Point, _arrowsize: number, penwidth: number, flag: number): GenResult;
|
|
21
|
+
export declare function genCurve(p0: Point, u: Point, _arrowsize: number, penwidth: number, flag: number, rankdir?: number): GenResult;
|
|
22
22
|
/** @see lib/common/arrows.c:arrow_length_curve */
|
|
23
23
|
export declare const arrowLengthCurve: (lenfact: number, arrowsize: number, penwidth: number) => number;
|
|
24
24
|
//# sourceMappingURL=arrows-shapes-poly.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrows-shapes-poly.d.ts","sourceRoot":"","sources":["../../src/common/arrows-shapes-poly.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"arrows-shapes-poly.d.ts","sourceRoot":"","sources":["../../src/common/arrows-shapes-poly.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAkGzD,mFAAmF;AACnF,wBAAgB,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,CAOxG;AAED,iDAAiD;AACjD,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAa1G;AAOD,8CAA8C;AAC9C,wBAAgB,MAAM,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,CAG3G;AAOD,8CAA8C;AAC9C,wBAAgB,MAAM,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,CAyBzG;AAED,oFAAoF;AACpF,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAQ3F;AA8BD,gDAAgD;AAChD,wBAAgB,QAAQ,CACtB,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EACvE,OAAO,SAAI,GACV,SAAS,CAgCX;AAED,kDAAkD;AAClD,eAAO,MAAM,gBAAgB,GAAI,SAAS,MAAM,EAAE,WAAW,MAAM,EAAE,UAAU,MAAM,KAAG,MACrC,CAAC"}
|
|
@@ -36,7 +36,7 @@ export declare function arrowLength(comps: ResolvedArrow[], arrowsize: number, p
|
|
|
36
36
|
*
|
|
37
37
|
* @see lib/common/arrows.c:arrow_gen_type
|
|
38
38
|
*/
|
|
39
|
-
export declare function dispatchSimple(r: ResolvedArrow, tip: Point, dir: Point, arrowsize: number, penwidth: number): GenResult;
|
|
39
|
+
export declare function dispatchSimple(r: ResolvedArrow, tip: Point, dir: Point, arrowsize: number, penwidth: number, rankdir?: number): GenResult;
|
|
40
40
|
/**
|
|
41
41
|
* Generate all draw ops for a parsed compound arrow (up to 4 stacked
|
|
42
42
|
* components). Each component is drawn at the running tip and advances the tip
|
|
@@ -44,5 +44,5 @@ export declare function dispatchSimple(r: ResolvedArrow, tip: Point, dir: Point,
|
|
|
44
44
|
*
|
|
45
45
|
* @see lib/common/arrows.c:arrow_gen
|
|
46
46
|
*/
|
|
47
|
-
export declare function arrowDrawOps(comps: ResolvedArrow[], tip: Point, dir: Point, arrowsize: number, penwidth: number): ArrowDrawOp[];
|
|
47
|
+
export declare function arrowDrawOps(comps: ResolvedArrow[], tip: Point, dir: Point, arrowsize: number, penwidth: number, rankdir?: number): ArrowDrawOp[];
|
|
48
48
|
//# sourceMappingURL=arrows-shapes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrows-shapes.d.ts","sourceRoot":"","sources":["../../src/common/arrows-shapes.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAEkB,KAAK,SAAS,EACtC,MAAM,yBAAyB,CAAC;AA2PjC;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAY5F;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,aAAa,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAM/F;AAOD;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,CAAC,EAAE,aAAa,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"arrows-shapes.d.ts","sourceRoot":"","sources":["../../src/common/arrows-shapes.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAEkB,KAAK,SAAS,EACtC,MAAM,yBAAyB,CAAC;AA2PjC;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM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AAS,EACrB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,MAAM,GACd,MAAM,CAKR;AAUD,kEAAkE;AAClE,wBAAgB,cAAc,CAAC,CAAC,EAAE,KAAK,GAAG,YAAY,GAAG,SAAS,CAEjE;AA4CD;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,CAAC,EAAE,IAAI,EACP,CAAC,EAAE,KAAK,EACR,KAAK,EAAE,SAAS,GAAG;IAAE,OAAO,EAAE,QAAQ,CAAA;CAAE,EACxC,UAAU,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,EACpC,IAAI,EAAE,OAAO,GACZ,cAAc,CAgBhB;AAyKD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,GAAG,IAAI,CAItD;AAED,uDAAuD;AACvD,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,KAAK,GAAG,IAAI,CAEjD"}
|
|
@@ -12,9 +12,15 @@
|
|
|
12
12
|
* @see lib/common/shapes.c:same_side
|
|
13
13
|
*/
|
|
14
14
|
import type { Point } from '../model/geom.js';
|
|
15
|
+
import type { PolygonT } from './types.js';
|
|
15
16
|
import type { InsideContext } from './splines-geom.js';
|
|
16
17
|
/** Test if p0 and p1 are on the same side of the line L0-L1. @see shapes.c:same_side */
|
|
17
18
|
export declare function sameSide(p0: Point, p1: Point, L0: Point, L1: Point): boolean;
|
|
19
|
+
/** Vertex-extent box of a fixedshape polygon. @see lib/common/shapes.c:polyBB */
|
|
20
|
+
export declare function fixedShapeSize(poly: PolygonT): {
|
|
21
|
+
w: number;
|
|
22
|
+
h: number;
|
|
23
|
+
};
|
|
18
24
|
export declare function polyInside(ctx: InsideContext, p: Point): boolean;
|
|
19
25
|
/**
|
|
20
26
|
* Point-in-star test. A star is concave, so the generic poly_inside decagon
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"poly-inside.d.ts","sourceRoot":"","sources":["../../src/common/poly-inside.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"poly-inside.d.ts","sourceRoot":"","sources":["../../src/common/poly-inside.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAIvD,wFAAwF;AACxF,wBAAgB,QAAQ,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,GAAG,OAAO,CAO5E;AAED,iFAAiF;AACjF,wBAAgB,cAAc,CAAC,IAAI,EAAE,QAAQ,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAQvE;AAgGD,wBAAgB,UAAU,CAAC,GAAG,EAAE,aAAa,EAAE,CAAC,EAAE,KAAK,GAAG,OAAO,CAchE;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,aAAa,EAAE,CAAC,EAAE,KAAK,GAAG,OAAO,CAwBhE;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,aAAa,EAAE,CAAC,EAAE,KAAK,GAAG,OAAO,CAkBlE"}
|
|
@@ -92,6 +92,14 @@ export interface PolySizeResult extends NodeSize {
|
|
|
92
92
|
*/
|
|
93
93
|
baseW: number;
|
|
94
94
|
baseH: number;
|
|
95
|
+
/**
|
|
96
|
+
* fixedsize="shape": the drawn shape stays at the attr box while
|
|
97
|
+
* width/height grow to max(label, shape). Installed on the polygon
|
|
98
|
+
* descriptor as `option.fixedshape`; vertex generation and insideness
|
|
99
|
+
* must read the base box, not the label-grown width.
|
|
100
|
+
* @see lib/common/shapes.c:poly_init (poly->option.fixedshape)
|
|
101
|
+
*/
|
|
102
|
+
fixedshape: boolean;
|
|
95
103
|
/**
|
|
96
104
|
* Justification borders — the space available for the label within the node
|
|
97
105
|
* box. `emit_label` reads this (not `dimen`) for `labelloc` top/bottom and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"poly-sizing.d.ts","sourceRoot":"","sources":["../../src/common/poly-sizing.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAK9C,4FAA4F;AAC5F,eAAO,MAAM,GAAG,IAAI,CAAC;AAUrB;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,oDAAoD;IACpD,UAAU,EAAE,KAAK,CAAC;IAClB,2EAA2E;IAC3E,KAAK,EAAE,MAAM,CAAC;IACd,2DAA2D;IAC3D,WAAW,EAAE,MAAM,CAAC;IACpB,8DAA8D;IAC9D,WAAW,EAAE,MAAM,CAAC;IACpB,yBAAyB;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,OAAO,EAAE,OAAO,CAAC;IACjB,8DAA8D;IAC9D,OAAO,EAAE,OAAO,CAAC;IACjB,qDAAqD;IACrD,OAAO,EAAE,MAAM,CAAC;IAChB,qDAAqD;IACrD,QAAQ,EAAE,MAAM,CAAC;IACjB,kFAAkF;IAClF,WAAW,EAAE,MAAM,CAAC;IACpB,oEAAoE;IACpE,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,wCAAwC;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,2CAA2C;IAC3C,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,8DAA8D;IAC9D,SAAS,EAAE,MAAM,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AgB,eAAe,CAC7B,IAAI,EAAE,QAAQ,EACd,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,IAAI,CAAC,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GAC9B,KAAK,EAAE,CA2BT"}
|
package/dist/index.js
CHANGED
|
@@ -4535,6 +4535,20 @@ function ccwrotatepf(p, ccwrot) {
|
|
|
4535
4535
|
return p;
|
|
4536
4536
|
}
|
|
4537
4537
|
}
|
|
4538
|
+
function cwrotatepf(p, cwrot) {
|
|
4539
|
+
switch (cwrot) {
|
|
4540
|
+
case 0:
|
|
4541
|
+
return p;
|
|
4542
|
+
case 90:
|
|
4543
|
+
return { x: p.y, y: -p.x };
|
|
4544
|
+
case 180:
|
|
4545
|
+
return { x: p.x, y: -p.y };
|
|
4546
|
+
case 270:
|
|
4547
|
+
return { x: p.y, y: p.x };
|
|
4548
|
+
default:
|
|
4549
|
+
return p;
|
|
4550
|
+
}
|
|
4551
|
+
}
|
|
4538
4552
|
function boxOverlap(b0, b1) {
|
|
4539
4553
|
return b0.ur.x >= b1.ll.x && b1.ur.x >= b0.ll.x && b0.ur.y >= b1.ll.y && b1.ur.y >= b0.ll.y;
|
|
4540
4554
|
}
|
|
@@ -16442,11 +16456,22 @@ function generalPolyVertices(poly, w, h) {
|
|
|
16442
16456
|
const sy = ymax !== 0 ? h / (2 * ymax) : 1;
|
|
16443
16457
|
return verts.map((v) => ({ x: v.x * sx, y: v.y * sy }));
|
|
16444
16458
|
}
|
|
16445
|
-
function ellipseRings(w, h, peripheries) {
|
|
16459
|
+
function ellipseRings(w, h, peripheries, base) {
|
|
16460
|
+
if (base === void 0) {
|
|
16461
|
+
const out2 = [];
|
|
16462
|
+
for (let j = 0; j < peripheries; j++) {
|
|
16463
|
+
const inset = (peripheries - 1 - j) * GAP;
|
|
16464
|
+
out2.push(...ellipseVertices(w - 2 * inset, h - 2 * inset));
|
|
16465
|
+
}
|
|
16466
|
+
return out2;
|
|
16467
|
+
}
|
|
16446
16468
|
const out = [];
|
|
16469
|
+
let px = base.w / 2;
|
|
16470
|
+
let py = base.h / 2;
|
|
16447
16471
|
for (let j = 0; j < peripheries; j++) {
|
|
16448
|
-
|
|
16449
|
-
|
|
16472
|
+
out.push({ x: -px, y: -py }, { x: px, y: py });
|
|
16473
|
+
px += GAP;
|
|
16474
|
+
py += GAP;
|
|
16450
16475
|
}
|
|
16451
16476
|
return out;
|
|
16452
16477
|
}
|
|
@@ -16510,10 +16535,16 @@ function starRings(box, peripheries) {
|
|
|
16510
16535
|
}
|
|
16511
16536
|
function computeVertices(poly, w, h, base) {
|
|
16512
16537
|
const sides = poly.sides;
|
|
16538
|
+
if (poly.option.fixedshape && base !== void 0) {
|
|
16539
|
+
w = base.w;
|
|
16540
|
+
h = base.h;
|
|
16541
|
+
}
|
|
16513
16542
|
if (poly.option.shape === CYLINDER) return cylinderVertices(w, h);
|
|
16514
16543
|
const peripheries = Math.max(poly.peripheries, 1);
|
|
16515
16544
|
if (poly.option.shape === STAR) return starRings({ w, h, base }, peripheries);
|
|
16516
|
-
if (sides <= 2)
|
|
16545
|
+
if (sides <= 2) {
|
|
16546
|
+
return ellipseRings(w, h, peripheries, poly.option.fixedshape ? base : void 0);
|
|
16547
|
+
}
|
|
16517
16548
|
if (sides === 4 && Math.abs(poly.orientation % 90) < 0.5 && poly.distortion === 0 && poly.skew === 0) {
|
|
16518
16549
|
return boxRings(w, h, peripheries, poly.orientation, base);
|
|
16519
16550
|
}
|
|
@@ -16835,7 +16866,8 @@ function assembleResult(p, dimen, grown, fixedshape) {
|
|
|
16835
16866
|
outlineW: Math.max(dimen.x, grown.outline.x),
|
|
16836
16867
|
outlineH: Math.max(dimen.y, grown.outline.y),
|
|
16837
16868
|
baseW: grown.base.x,
|
|
16838
|
-
baseH: grown.base.y
|
|
16869
|
+
baseH: grown.base.y,
|
|
16870
|
+
fixedshape
|
|
16839
16871
|
};
|
|
16840
16872
|
}
|
|
16841
16873
|
return {
|
|
@@ -16843,7 +16875,8 @@ function assembleResult(p, dimen, grown, fixedshape) {
|
|
|
16843
16875
|
outlineW: grown.outline.x,
|
|
16844
16876
|
outlineH: grown.outline.y,
|
|
16845
16877
|
baseW: grown.base.x,
|
|
16846
|
-
baseH: grown.base.y
|
|
16878
|
+
baseH: grown.base.y,
|
|
16879
|
+
fixedshape
|
|
16847
16880
|
};
|
|
16848
16881
|
}
|
|
16849
16882
|
|
|
@@ -17816,21 +17849,28 @@ function fixedShapeSize(poly) {
|
|
|
17816
17849
|
}
|
|
17817
17850
|
return { w: 2 * xmax, h: 2 * ymax };
|
|
17818
17851
|
}
|
|
17819
|
-
function insideDims(n,
|
|
17820
|
-
if (poly.option.fixedshape) {
|
|
17821
|
-
const { w: w2, h: h2 } = fixedShapeSize(poly);
|
|
17822
|
-
return { w: w2, h: h2, ow: w2, oh: h2 };
|
|
17823
|
-
}
|
|
17852
|
+
function insideDims(n, xsize, ysize) {
|
|
17824
17853
|
const w = 72 * (n.info.width || xsize / 72);
|
|
17825
17854
|
const h = 72 * (n.info.height || ysize / 72);
|
|
17826
17855
|
return { w, h, ow: 72 * n.info.outline_width || w, oh: 72 * n.info.outline_height || h };
|
|
17827
17856
|
}
|
|
17828
17857
|
function insideScale(n, poly) {
|
|
17829
17858
|
const flip = n.root.info.flip === true;
|
|
17859
|
+
if (poly.option.fixedshape) {
|
|
17860
|
+
const { w: w2, h: h2 } = fixedShapeSize(poly);
|
|
17861
|
+
const xsize2 = flip ? h2 : w2;
|
|
17862
|
+
const ysize2 = flip ? w2 : h2;
|
|
17863
|
+
return {
|
|
17864
|
+
scalex: xsize2 !== 0 ? w2 / xsize2 : w2,
|
|
17865
|
+
scaley: ysize2 !== 0 ? h2 / ysize2 : h2,
|
|
17866
|
+
boxURx: w2 / 2,
|
|
17867
|
+
boxURy: h2 / 2
|
|
17868
|
+
};
|
|
17869
|
+
}
|
|
17830
17870
|
const lwrw = n.info.lw + n.info.rw;
|
|
17831
17871
|
const xsize = flip ? n.info.ht : lwrw;
|
|
17832
17872
|
const ysize = flip ? lwrw : n.info.ht;
|
|
17833
|
-
const { w, h, ow, oh } = insideDims(n,
|
|
17873
|
+
const { w, h, ow, oh } = insideDims(n, xsize, ysize);
|
|
17834
17874
|
return {
|
|
17835
17875
|
scalex: xsize !== 0 ? w / xsize : w,
|
|
17836
17876
|
scaley: ysize !== 0 ? h / ysize : h,
|
|
@@ -18789,7 +18829,15 @@ function curveControlPoints(p, v, w, flag) {
|
|
|
18789
18829
|
const AF2 = { x: p.x - 0.95 * v.x + w.x + s * w.x * (4 / 3), y: AF3.y + s * w.y * (4 / 3) };
|
|
18790
18830
|
return [AF0, AF1, AF2, AF3];
|
|
18791
18831
|
}
|
|
18792
|
-
function genCurve(p0, u, _arrowsize, penwidth, flag) {
|
|
18832
|
+
function genCurve(p0, u, _arrowsize, penwidth, flag, rankdir = 0) {
|
|
18833
|
+
if (rankdir !== 0) {
|
|
18834
|
+
const rot = rankdir * 90;
|
|
18835
|
+
const fin = genCurve(ccwrotatepf(p0, rot), ccwrotatepf(u, rot), _arrowsize, penwidth, flag);
|
|
18836
|
+
return {
|
|
18837
|
+
ops: fin.ops.map((op) => "points" in op ? { ...op, points: op.points.map((pt) => cwrotatepf(pt, rot)) } : op),
|
|
18838
|
+
q: cwrotatepf(fin.q, rot)
|
|
18839
|
+
};
|
|
18840
|
+
}
|
|
18793
18841
|
const arrowwidth = penwidth > 4 ? 0.5 * penwidth / 4 : 0.5;
|
|
18794
18842
|
const noShift = flag & ARR_MOD_INV || u.x === 0 && u.y === 0;
|
|
18795
18843
|
const p = noShift ? p0 : vsub2(p0, backwardDelta(u, penwidth));
|
|
@@ -19004,7 +19052,7 @@ function arrowLength(comps, arrowsize, penwidth) {
|
|
|
19004
19052
|
for (let i = 0; i < n; i++) length += arrowLengthOne(comps[i], arrowsize, penwidth);
|
|
19005
19053
|
return length;
|
|
19006
19054
|
}
|
|
19007
|
-
function dispatchSimple(r, tip2, dir, arrowsize, penwidth) {
|
|
19055
|
+
function dispatchSimple(r, tip2, dir, arrowsize, penwidth, rankdir = 0) {
|
|
19008
19056
|
const flag = arrowFlag(r);
|
|
19009
19057
|
const u = componentU(dir, r.lenfact, arrowsize);
|
|
19010
19058
|
switch (r.type & ARR_TYPE_MASK) {
|
|
@@ -19018,8 +19066,10 @@ function dispatchSimple(r, tip2, dir, arrowsize, penwidth) {
|
|
|
19018
19066
|
return genDiamond(tip2, u, arrowsize, penwidth, flag);
|
|
19019
19067
|
case ARR_TYPE_DOT:
|
|
19020
19068
|
return genDot(tip2, u, arrowsize, penwidth, flag);
|
|
19069
|
+
// curve is the one generator that is not rotation-equivariant; it needs
|
|
19070
|
+
// the rankdir to reproduce C's render-time (final-frame) generation.
|
|
19021
19071
|
case ARR_TYPE_CURVE:
|
|
19022
|
-
return genCurve(tip2, u, arrowsize, penwidth, flag);
|
|
19072
|
+
return genCurve(tip2, u, arrowsize, penwidth, flag, rankdir);
|
|
19023
19073
|
case ARR_TYPE_GAP:
|
|
19024
19074
|
return genGap(tip2, u, arrowsize, penwidth, flag);
|
|
19025
19075
|
case ARR_TYPE_NORM:
|
|
@@ -19027,14 +19077,14 @@ function dispatchSimple(r, tip2, dir, arrowsize, penwidth) {
|
|
|
19027
19077
|
return genNormal(tip2, u, arrowsize, penwidth, flag);
|
|
19028
19078
|
}
|
|
19029
19079
|
}
|
|
19030
|
-
function arrowDrawOps(comps, tip2, dir, arrowsize, penwidth) {
|
|
19080
|
+
function arrowDrawOps(comps, tip2, dir, arrowsize, penwidth, rankdir = 0) {
|
|
19031
19081
|
const ops = [];
|
|
19032
19082
|
let p = tip2;
|
|
19033
19083
|
const n = Math.min(comps.length, 4);
|
|
19034
19084
|
for (let i = 0; i < n; i++) {
|
|
19035
19085
|
const r = comps[i];
|
|
19036
19086
|
if ((r.type & ARR_TYPE_MASK) === ARR_TYPE_NONE) break;
|
|
19037
|
-
const res = dispatchSimple(r, p, dir, arrowsize, penwidth);
|
|
19087
|
+
const res = dispatchSimple(r, p, dir, arrowsize, penwidth, rankdir);
|
|
19038
19088
|
ops.push(...res.ops);
|
|
19039
19089
|
p = res.q;
|
|
19040
19090
|
}
|
|
@@ -19178,7 +19228,8 @@ function edgeArrowsize(e) {
|
|
|
19178
19228
|
}
|
|
19179
19229
|
function arrowDrawOpsForEnd(e, end, tip2, dir, penwidth) {
|
|
19180
19230
|
const comps = parseArrow(edgeArrowName(e, end)).map(resolveArrowType);
|
|
19181
|
-
|
|
19231
|
+
const rankdir = (e.tail?.root?.info?.rankdir ?? 0) & 3;
|
|
19232
|
+
return arrowDrawOps(comps, tip2, dir, edgeArrowsize(e), penwidth, rankdir);
|
|
19182
19233
|
}
|
|
19183
19234
|
|
|
19184
19235
|
// src/common/splines-clip.ts
|
|
@@ -23913,7 +23964,7 @@ function gdRankdir(n) {
|
|
|
23913
23964
|
function gdFlip(n) {
|
|
23914
23965
|
return (gdRankdir(n) & 1) !== 0;
|
|
23915
23966
|
}
|
|
23916
|
-
function
|
|
23967
|
+
function cwrotatepf2(p, cwrot) {
|
|
23917
23968
|
switch (cwrot) {
|
|
23918
23969
|
case 90:
|
|
23919
23970
|
return { x: p.y, y: -p.x };
|
|
@@ -24060,7 +24111,7 @@ function setOrder(pp, q) {
|
|
|
24060
24111
|
pp.order = MC_SCALE * a / (2 * Math.PI) | 0;
|
|
24061
24112
|
}
|
|
24062
24113
|
function applyDir(pp, bp, dir, rd, definedFinal) {
|
|
24063
|
-
const q =
|
|
24114
|
+
const q = cwrotatepf2(dir.p, 90 * rd);
|
|
24064
24115
|
pp.p = q;
|
|
24065
24116
|
pp.bp = bp;
|
|
24066
24117
|
pp.side = dir.dyna ? dir.side : invflipSide(dir.side, rd);
|
|
@@ -24076,7 +24127,7 @@ function nodeInsideFn(n) {
|
|
|
24076
24127
|
}
|
|
24077
24128
|
function compassPoint(n, insideFn, yArg, xArg, rd) {
|
|
24078
24129
|
let p = { x: xArg, y: yArg };
|
|
24079
|
-
if (rd) p =
|
|
24130
|
+
if (rd) p = cwrotatepf2(p, 90 * rd);
|
|
24080
24131
|
const curve = [{ x: 0, y: 0 }, { x: 0, y: 0 }, { x: p.x, y: p.y }, { x: p.x, y: p.y }];
|
|
24081
24132
|
const ctx = { nodeCoord: n.info.coord, rw: n.info.rw, bp: null, node: n };
|
|
24082
24133
|
bezierClip(ctx, insideFn, curve, true);
|
|
@@ -24444,7 +24495,9 @@ function pointSizeResult(sz0, peripheries, penwidth) {
|
|
|
24444
24495
|
outlineW: szOutline,
|
|
24445
24496
|
outlineH: szOutline,
|
|
24446
24497
|
baseW: sz0,
|
|
24447
|
-
baseH: sz0
|
|
24498
|
+
baseH: sz0,
|
|
24499
|
+
fixedshape: false
|
|
24500
|
+
// C point_init never sets option.fixedshape
|
|
24448
24501
|
};
|
|
24449
24502
|
}
|
|
24450
24503
|
function initPointSize(n, g, shape) {
|
|
@@ -24479,14 +24532,17 @@ function initNodeFromLabel(n, g, measurer) {
|
|
|
24479
24532
|
label.space = sz.space;
|
|
24480
24533
|
label.valign = sz.valign.charCodeAt(0);
|
|
24481
24534
|
storeNodeSize(n, sz, flip);
|
|
24482
|
-
assignShapeInfo(n, effectivePolygon(poly, params));
|
|
24535
|
+
assignShapeInfo(n, effectivePolygon(poly, params, sz.fixedshape));
|
|
24483
24536
|
return true;
|
|
24484
24537
|
}
|
|
24485
|
-
function effectivePolygon(poly, p) {
|
|
24538
|
+
function effectivePolygon(poly, p, fixedshape) {
|
|
24486
24539
|
let sides = p.sides;
|
|
24487
24540
|
if (sides <= 2 && (p.distortion !== 0 || p.skew !== 0)) sides = 120;
|
|
24488
24541
|
return {
|
|
24489
24542
|
...poly,
|
|
24543
|
+
// C: poly->option.fixedshape = true inside the fixedsize="shape" branch;
|
|
24544
|
+
// poly-inside and computeVertices key the shape-box/width split on it.
|
|
24545
|
+
option: { ...poly.option, fixedshape },
|
|
24490
24546
|
regular: p.regular,
|
|
24491
24547
|
peripheries: p.peripheries,
|
|
24492
24548
|
sides,
|
|
@@ -29294,6 +29350,21 @@ function nodeBoxOf(n, g) {
|
|
|
29294
29350
|
const rb = recordClipBox(n);
|
|
29295
29351
|
if (rb) return { center: n.info.coord, ...rb, isEllipse: false, penwidth };
|
|
29296
29352
|
}
|
|
29353
|
+
const si = n.info.shape_info;
|
|
29354
|
+
if (si?.option?.fixedshape === true && si.vertices) {
|
|
29355
|
+
const ext = fixedShapeSize(si);
|
|
29356
|
+
const flip = g.root.info.flip === true;
|
|
29357
|
+
const w = flip ? ext.h : ext.w;
|
|
29358
|
+
const h = flip ? ext.w : ext.h;
|
|
29359
|
+
return {
|
|
29360
|
+
center: n.info.coord,
|
|
29361
|
+
lw: w / 2,
|
|
29362
|
+
rw: w / 2,
|
|
29363
|
+
ht: h,
|
|
29364
|
+
isEllipse: ELLIPSE_SHAPES.has(shapeName),
|
|
29365
|
+
penwidth: 0
|
|
29366
|
+
};
|
|
29367
|
+
}
|
|
29297
29368
|
return {
|
|
29298
29369
|
center: n.info.coord,
|
|
29299
29370
|
lw: n.info.lw > 0 ? n.info.lw : 27,
|