@knowvah/dot-engine 2.8.0 → 2.8.1
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/htmltable-emit.d.ts +6 -11
- package/dist/common/htmltable-emit.d.ts.map +1 -1
- package/dist/common/nodeinit.d.ts.map +1 -1
- package/dist/common/poly-gencode.d.ts.map +1 -1
- package/dist/common/poly-init.d.ts +10 -0
- package/dist/common/poly-init.d.ts.map +1 -1
- package/dist/gvc/device.d.ts.map +1 -1
- package/dist/gvc/render-usershape.d.ts +60 -0
- package/dist/gvc/render-usershape.d.ts.map +1 -0
- package/dist/index.js +12073 -11919
- package/dist/index.js.map +4 -4
- package/dist/render/dot.d.ts +8 -1
- package/dist/render/dot.d.ts.map +1 -1
- package/dist/render.js +211 -57
- package/dist/render.js.map +4 -4
- package/package.json +1 -1
- package/src/common/htmltable-emit.ts +11 -46
- package/src/common/nodeinit.ts +3 -1
- package/src/common/poly-gencode.ts +51 -2
- package/src/common/poly-init.ts +16 -12
- package/src/gvc/device-cluster.ts +3 -2
- package/src/gvc/device.ts +1 -0
- package/src/gvc/render-usershape.ts +209 -0
- package/src/render/dot.ts +14 -1
|
@@ -29,19 +29,14 @@ export declare function emitHtmlBox(box: Box, pos: Point, renderer: RendererPlug
|
|
|
29
29
|
/** Emit one text run. @see lib/common/htmltable.c:emit_htextspans */
|
|
30
30
|
export declare function emitHtmlLine(line: PlacedLine, pos: Point, renderer: RendererPlugin, job: RenderJob): void;
|
|
31
31
|
/**
|
|
32
|
-
* Emit a placed HTML IMG through the
|
|
32
|
+
* Emit a placed HTML IMG through the shared gvrender_usershape: the cell's
|
|
33
|
+
* content box is the polygon, imagepos is the fixed "mc", and the scale is the
|
|
34
|
+
* IMG's own SCALE, else the object's imagescale (C env->imgscale).
|
|
33
35
|
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* the result (imagepos "mc" — hardcoded by emit_html_img).
|
|
37
|
-
*
|
|
38
|
-
* SCALE falls back to the object's imagescale attribute (C
|
|
39
|
-
* env->imgscale, default "false") when the IMG has no SCALE attr.
|
|
40
|
-
*
|
|
41
|
-
* @see lib/common/htmltable.c:emit_html_img (line 597)
|
|
42
|
-
* @see lib/gvc/gvrender.c:gvrender_usershape (line 670)
|
|
36
|
+
* @see lib/common/htmltable.c:emit_html_img
|
|
37
|
+
* @see lib/gvc/gvrender.c:gvrender_usershape
|
|
43
38
|
*/
|
|
44
|
-
export declare function emitHtmlImg(img: PlacedImage, pos: Point,
|
|
39
|
+
export declare function emitHtmlImg(img: PlacedImage, pos: Point, _renderer: RendererPlugin, job: RenderJob): void;
|
|
45
40
|
/**
|
|
46
41
|
* Emit one positioned HTML cell.
|
|
47
42
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"htmltable-emit.d.ts","sourceRoot":"","sources":["../../src/common/htmltable-emit.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"htmltable-emit.d.ts","sourceRoot":"","sources":["../../src/common/htmltable-emit.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,KAAK,EAAE,UAAU,EAAE,U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G;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,GAAG,OAAO,CAyB9E;AAsFD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CA6BnE"}
|
|
@@ -37,6 +37,16 @@ export declare function assignShapeInfo(n: Node, polyDesc: PolygonT): void;
|
|
|
37
37
|
*/
|
|
38
38
|
/** Build the node's label via the unified C make_label boundary. */
|
|
39
39
|
export declare function buildNodeLabel(n: Node, g: Graph, measurer: TextMeasurer): void;
|
|
40
|
+
/**
|
|
41
|
+
* poly_init's shapefile and `image` warnings, emitted once per layout from
|
|
42
|
+
* common_init_node after the label is made. For a custom shape gvusershape_size
|
|
43
|
+
* fails (the port never sizes shapefiles), so gvusershape_open's "while
|
|
44
|
+
* opening" line precedes the "No or improper shapefile" line. For a non-custom
|
|
45
|
+
* shape's `image=`, the caller-supplied sizer/resolver decides; when it
|
|
46
|
+
* supplies nothing the same pair is emitted.
|
|
47
|
+
* @see lib/common/shapes.c:2027-2046
|
|
48
|
+
*/
|
|
49
|
+
export declare function warnPolyInitImages(n: Node, g: Graph): void;
|
|
40
50
|
/**
|
|
41
51
|
* poly_init's imagesize for a non-custom shape's `image=`: gvusershape_size in
|
|
42
52
|
* points plus the fixed 2pt padding, and GD_has_images. Null (C's imagesize 0)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"poly-init.d.ts","sourceRoot":"","sources":["../../src/common/poly-init.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,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0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `gvrender_usershape`: fit an image (node `image=`, HTML `<IMG>`) into the
|
|
3
|
+
* bounding box of a polygon according to `imagescale` / `imagepos`, then hand
|
|
4
|
+
* the resulting box to the renderer's loadimage hook (`usershape`).
|
|
5
|
+
*
|
|
6
|
+
* @see lib/gvc/gvrender.c:gvrender_usershape (670-790)
|
|
7
|
+
*/
|
|
8
|
+
import type { Point } from '../model/geom.js';
|
|
9
|
+
import type { RenderJob } from './job.js';
|
|
10
|
+
import { type ImageSizer } from './usershape.js';
|
|
11
|
+
/** @see lib/gvc/gvcjob.h:imagescale_t */
|
|
12
|
+
export declare const ImageScale: {
|
|
13
|
+
readonly False: "false";
|
|
14
|
+
readonly True: "true";
|
|
15
|
+
readonly Width: "width";
|
|
16
|
+
readonly Height: "height";
|
|
17
|
+
readonly Both: "both";
|
|
18
|
+
};
|
|
19
|
+
export type ImageScale = (typeof ImageScale)[keyof typeof ImageScale];
|
|
20
|
+
/** @see lib/gvc/gvcjob.h:imagepos_t */
|
|
21
|
+
export declare const ImagePos: {
|
|
22
|
+
readonly TopLeft: "tl";
|
|
23
|
+
readonly TopCenter: "tc";
|
|
24
|
+
readonly TopRight: "tr";
|
|
25
|
+
readonly MiddleLeft: "ml";
|
|
26
|
+
readonly MiddleCenter: "mc";
|
|
27
|
+
readonly MiddleRight: "mr";
|
|
28
|
+
readonly BottomLeft: "bl";
|
|
29
|
+
readonly BottomCenter: "bc";
|
|
30
|
+
readonly BottomRight: "br";
|
|
31
|
+
};
|
|
32
|
+
export type ImagePos = (typeof ImagePos)[keyof typeof ImagePos];
|
|
33
|
+
/** @see lib/gvc/gvrender.c:get_imagescale */
|
|
34
|
+
export declare function getImagescale(s: string): ImageScale;
|
|
35
|
+
/** @see lib/gvc/gvrender.c:get_imagepos */
|
|
36
|
+
export declare function getImagepos(s: string): ImagePos;
|
|
37
|
+
/**
|
|
38
|
+
* The rendering context's image sizer (the port's gvusershape dictionary),
|
|
39
|
+
* set on the job by `render` beside `imageResolver`; undefined means the
|
|
40
|
+
* global `setImageSizer`.
|
|
41
|
+
*/
|
|
42
|
+
declare module './job.js' {
|
|
43
|
+
interface RenderJob {
|
|
44
|
+
imageSizer?: ImageSizer | undefined;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Scale the image `name` to the bounding box of polygon `a` per `imagescale`,
|
|
49
|
+
* place it per `imagepos`, convert to device coordinates unless the renderer
|
|
50
|
+
* transforms, and pass the box to the renderer's `usershape` (gvloadimage).
|
|
51
|
+
*
|
|
52
|
+
* `gvusershape_find` is "the caller supplies `name`" (sizer or resolver); the
|
|
53
|
+
* `find_user_shape` / `library_shape` branch is a no-op because no renderer
|
|
54
|
+
* has `library_shape`. `filled` is only read by loadimage plugins that paint a
|
|
55
|
+
* background (none of svg/xdot), so it is not forwarded.
|
|
56
|
+
*
|
|
57
|
+
* @see lib/gvc/gvrender.c:gvrender_usershape
|
|
58
|
+
*/
|
|
59
|
+
export declare function gvrenderUsershape(job: RenderJob, name: string, a: readonly Point[], _filled: boolean, imagescale: string, imagepos: string): void;
|
|
60
|
+
//# sourceMappingURL=render-usershape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-usershape.d.ts","sourceRoot":"","sources":["../../src/gvc/render-usershape.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAqC,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGpF,yCAAyC;AACzC,eAAO,MAAM,UAAU;;;;;;CAMb,CAAC;AACX,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC;AAEtE,uCAAuC;AACvC,eAAO,MAAM,QAAQ;;;;;;;;;;CAUX,CAAC;AACX,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,OAAO,QAAQ,CAAC,CAAC;AAIhE,6CAA6C;AAC7C,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG,UAAU,CAQnD;AAED,2CAA2C;AAC3C,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,QAAQ,CAI/C;AAiGD;;;;GAIG;AACH,OAAO,QAAQ,UAAU,CAAC;IACxB,UAAU,SAAS;QACjB,UAAU,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;KACrC;CACF;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,EACnE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GACnC,IAAI,CA4BN"}
|