@knowvah/dot-engine 1.5.0 → 1.6.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/api/geometry.d.ts +16 -1
- package/dist/api/geometry.d.ts.map +1 -1
- package/dist/api.js +2 -0
- package/dist/api.js.map +2 -2
- package/dist/index.js +2 -0
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
- package/src/api/geometry.ts +17 -3
package/dist/api/geometry.d.ts
CHANGED
|
@@ -92,6 +92,12 @@ export interface NodeGeometry {
|
|
|
92
92
|
* type) still holds calloc-zero coordinates, so it is reported as absent
|
|
93
93
|
* rather than as a label at the origin.
|
|
94
94
|
*
|
|
95
|
+
* `xlabel` is the `xlabel` external label, positioned by the force-placement
|
|
96
|
+
* search rather than by spline midpoint arithmetic, so it is not derivable
|
|
97
|
+
* from `label` or `points`. It carries the same `lp->set` gate: a declared
|
|
98
|
+
* xlabel the search could not fit is reported as absent, exactly as
|
|
99
|
+
* `render()` declines to draw it.
|
|
100
|
+
*
|
|
95
101
|
* `sp`/`ep` are the arrow attachment points. When an end carries an arrow the
|
|
96
102
|
* spline is shortened to leave room for it, and the arrow spans from the
|
|
97
103
|
* terminal control point out to this point — so a consumer drawing its own
|
|
@@ -105,7 +111,8 @@ export interface NodeGeometry {
|
|
|
105
111
|
* (measured: ~1.5pt at `penwidth=1`, ~6.2pt at `penwidth=5`), so `ep` is the
|
|
106
112
|
* point to draw an arrow *to*, not a copy of the rendered polygon's tip.
|
|
107
113
|
*
|
|
108
|
-
* @see lib/common/types.h:ED_spl, ED_label, ED_tail_label, ED_head_label
|
|
114
|
+
* @see lib/common/types.h:ED_spl, ED_label, ED_tail_label, ED_head_label,
|
|
115
|
+
* ED_xlabel
|
|
109
116
|
* @see lib/common/types.h:bezier (sflag/eflag, sp/ep)
|
|
110
117
|
*/
|
|
111
118
|
export interface EdgeGeometry {
|
|
@@ -153,6 +160,14 @@ export interface EdgeGeometry {
|
|
|
153
160
|
x: number;
|
|
154
161
|
y: number;
|
|
155
162
|
};
|
|
163
|
+
/**
|
|
164
|
+
* `xlabel` (external label) position, if placed.
|
|
165
|
+
* @see lib/common/types.h:ED_xlabel
|
|
166
|
+
*/
|
|
167
|
+
xlabel?: {
|
|
168
|
+
x: number;
|
|
169
|
+
y: number;
|
|
170
|
+
};
|
|
156
171
|
}
|
|
157
172
|
/**
|
|
158
173
|
* Per-cluster geometry extracted after layout, in points.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geometry.d.ts","sourceRoot":"","sources":["../../src/api/geometry.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAU/C,+CAA+C;AAC/C,MAAM,MAAM,KAAK,GAAG,IAAI,GAAG,MAAM,CAAC;AAElC;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG;IAAE,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAEhD;;;;;;;GAOG;AACH,MAAM,WAAW,cAAc;IAC7B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED
|
|
1
|
+
{"version":3,"file":"geometry.d.ts","sourceRoot":"","sources":["../../src/api/geometry.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;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;KAAE,CAAC;IACrC;;;OAGG;IACH,SAAS,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACrC;;;OAGG;IACH,MAAM,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACnC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,eAAe;IAC9B,gEAAgE;IAChE,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,KAAK,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CACjE;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,cAAc,CAAC;IACvB,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,QAAQ,EAAE,eAAe,EAAE,CAAC;CAC7B;AAsLD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,eAAe,GAAG,cAAc,CAuB1E"}
|
package/dist/api.js
CHANGED
|
@@ -714,6 +714,8 @@ function snapshotEdge(edge, flipY) {
|
|
|
714
714
|
if (tailLabel !== void 0) geom.tailLabel = tailLabel;
|
|
715
715
|
const headLabel = placedLabelPos(edge.info.head_label, flipY);
|
|
716
716
|
if (headLabel !== void 0) geom.headLabel = headLabel;
|
|
717
|
+
const xlabel = placedLabelPos(edge.info.xlabel, flipY);
|
|
718
|
+
if (xlabel !== void 0) geom.xlabel = xlabel;
|
|
717
719
|
const { sp, ep } = arrowAttachPoints(edge, flipY);
|
|
718
720
|
if (sp !== void 0) geom.sp = sp;
|
|
719
721
|
if (ep !== void 0) geom.ep = ep;
|