graphics-debug 0.0.55 → 0.0.56
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/{chunk-633EUBEM.js → chunk-Y2XZSHAE.js} +21 -14
- package/dist/chunk-Y2XZSHAE.js.map +1 -0
- package/dist/{chunk-XKPUGFZR.js → chunk-YERCI3ZS.js} +2 -2
- package/dist/cli/cli.js +2 -2
- package/dist/lib/getSvgFromGraphicsObject.d.ts +3 -1
- package/dist/lib/getSvgFromGraphicsObject.js +1 -1
- package/dist/lib/index.js +2 -2
- package/dist/lib/matcher.js +1 -1
- package/dist/lib/react.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-633EUBEM.js.map +0 -1
- /package/dist/{chunk-XKPUGFZR.js.map → chunk-YERCI3ZS.js.map} +0 -0
|
@@ -76,16 +76,16 @@ function getBounds(graphics) {
|
|
|
76
76
|
{ minX: Infinity, maxX: -Infinity, minY: Infinity, maxY: -Infinity }
|
|
77
77
|
);
|
|
78
78
|
}
|
|
79
|
-
function getProjectionMatrix(bounds, coordinateSystem) {
|
|
79
|
+
function getProjectionMatrix(bounds, coordinateSystem, svgWidth, svgHeight) {
|
|
80
80
|
const width = bounds.maxX - bounds.minX || 1;
|
|
81
81
|
const height = bounds.maxY - bounds.minY || 1;
|
|
82
82
|
const scale_factor = Math.min(
|
|
83
|
-
(
|
|
84
|
-
(
|
|
83
|
+
(svgWidth - 2 * PADDING) / width,
|
|
84
|
+
(svgHeight - 2 * PADDING) / height
|
|
85
85
|
);
|
|
86
86
|
const yFlip = coordinateSystem === "screen" ? 1 : -1;
|
|
87
87
|
return compose(
|
|
88
|
-
translate(
|
|
88
|
+
translate(svgWidth / 2, svgHeight / 2),
|
|
89
89
|
scale(scale_factor, yFlip * scale_factor),
|
|
90
90
|
translate(-(bounds.minX + width / 2), -(bounds.minY + height / 2))
|
|
91
91
|
);
|
|
@@ -96,10 +96,17 @@ function projectPoint(point, matrix) {
|
|
|
96
96
|
}
|
|
97
97
|
function getSvgFromGraphicsObject(graphics, {
|
|
98
98
|
includeTextLabels = true,
|
|
99
|
-
backgroundColor
|
|
99
|
+
backgroundColor,
|
|
100
|
+
svgWidth = DEFAULT_SVG_SIZE,
|
|
101
|
+
svgHeight = DEFAULT_SVG_SIZE
|
|
100
102
|
} = {}) {
|
|
101
103
|
const bounds = getBounds(graphics);
|
|
102
|
-
const matrix = getProjectionMatrix(
|
|
104
|
+
const matrix = getProjectionMatrix(
|
|
105
|
+
bounds,
|
|
106
|
+
graphics.coordinateSystem,
|
|
107
|
+
svgWidth,
|
|
108
|
+
svgHeight
|
|
109
|
+
);
|
|
103
110
|
const shouldRenderLabel = (type) => {
|
|
104
111
|
if (typeof includeTextLabels === "boolean") {
|
|
105
112
|
return includeTextLabels;
|
|
@@ -113,9 +120,9 @@ function getSvgFromGraphicsObject(graphics, {
|
|
|
113
120
|
name: "svg",
|
|
114
121
|
type: "element",
|
|
115
122
|
attributes: {
|
|
116
|
-
width:
|
|
117
|
-
height:
|
|
118
|
-
viewBox: `0 0 ${
|
|
123
|
+
width: svgWidth.toString(),
|
|
124
|
+
height: svgHeight.toString(),
|
|
125
|
+
viewBox: `0 0 ${svgWidth} ${svgHeight}`,
|
|
119
126
|
xmlns: "http://www.w3.org/2000/svg"
|
|
120
127
|
},
|
|
121
128
|
children: [
|
|
@@ -349,7 +356,7 @@ function getSvgFromGraphicsObject(graphics, {
|
|
|
349
356
|
attributes: {
|
|
350
357
|
id: "crosshair-h",
|
|
351
358
|
y1: "0",
|
|
352
|
-
y2:
|
|
359
|
+
y2: svgHeight.toString(),
|
|
353
360
|
stroke: "#666",
|
|
354
361
|
"stroke-width": "0.5"
|
|
355
362
|
}
|
|
@@ -360,7 +367,7 @@ function getSvgFromGraphicsObject(graphics, {
|
|
|
360
367
|
attributes: {
|
|
361
368
|
id: "crosshair-v",
|
|
362
369
|
x1: "0",
|
|
363
|
-
x2:
|
|
370
|
+
x2: svgWidth.toString(),
|
|
364
371
|
stroke: "#666",
|
|
365
372
|
"stroke-width": "0.5"
|
|
366
373
|
}
|
|
@@ -398,13 +405,13 @@ function getSvgFromGraphicsObject(graphics, {
|
|
|
398
405
|
|
|
399
406
|
crosshair.style.display = 'block';
|
|
400
407
|
h.setAttribute('x1', '0');
|
|
401
|
-
h.setAttribute('x2', '${
|
|
408
|
+
h.setAttribute('x2', '${svgWidth}');
|
|
402
409
|
h.setAttribute('y1', y);
|
|
403
410
|
h.setAttribute('y2', y);
|
|
404
411
|
v.setAttribute('x1', x);
|
|
405
412
|
v.setAttribute('x2', x);
|
|
406
413
|
v.setAttribute('y1', '0');
|
|
407
|
-
v.setAttribute('y2', '${
|
|
414
|
+
v.setAttribute('y2', '${svgHeight}');
|
|
408
415
|
|
|
409
416
|
// Calculate real coordinates using inverse transformation
|
|
410
417
|
const matrix = ${JSON.stringify(matrix)};
|
|
@@ -440,4 +447,4 @@ function getSvgFromGraphicsObject(graphics, {
|
|
|
440
447
|
export {
|
|
441
448
|
getSvgFromGraphicsObject
|
|
442
449
|
};
|
|
443
|
-
//# sourceMappingURL=chunk-
|
|
450
|
+
//# sourceMappingURL=chunk-Y2XZSHAE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../lib/getSvgFromGraphicsObject.ts"],"sourcesContent":["import {\n transform,\n compose,\n translate,\n scale,\n applyToPoint,\n identity,\n type Matrix,\n} from \"transformation-matrix\"\nimport type { GraphicsObject, Point } from \"./types\"\nimport { stringify } from \"svgson\"\nimport pretty from \"pretty\"\nimport { FONT_SIZE_WIDTH_RATIO, FONT_SIZE_HEIGHT_RATIO } from \"./constants\"\n\nconst DEFAULT_SVG_SIZE = 640\nconst PADDING = 40\n\ninterface Bounds {\n minX: number\n maxX: number\n minY: number\n maxY: number\n}\n\nfunction getBounds(graphics: GraphicsObject): Bounds {\n const points: Point[] = [\n ...(graphics.points || []),\n ...(graphics.lines || []).flatMap((line) => line.points),\n ...(graphics.rects || []).flatMap((rect) => {\n const halfWidth = rect.width / 2\n const halfHeight = rect.height / 2\n return [\n { x: rect.center.x - halfWidth, y: rect.center.y - halfHeight },\n { x: rect.center.x + halfWidth, y: rect.center.y - halfHeight },\n { x: rect.center.x - halfWidth, y: rect.center.y + halfHeight },\n { x: rect.center.x + halfWidth, y: rect.center.y + halfHeight },\n ]\n }),\n ...(graphics.circles || []).flatMap((circle) => [\n { x: circle.center.x - circle.radius, y: circle.center.y }, // left\n { x: circle.center.x + circle.radius, y: circle.center.y }, // right\n { x: circle.center.x, y: circle.center.y - circle.radius }, // top\n { x: circle.center.x, y: circle.center.y + circle.radius }, // bottom\n ]),\n ...(graphics.texts || []).flatMap((t) => {\n const fontSize = t.fontSize ?? 12\n const width = t.text.length * fontSize * FONT_SIZE_WIDTH_RATIO\n const height = fontSize * FONT_SIZE_HEIGHT_RATIO\n const anchor = t.anchorSide ?? \"center\"\n const offsetMap: Record<string, { dx: number; dy: number }> = {\n top_left: { dx: 0, dy: 0 },\n top_center: { dx: -width / 2, dy: 0 },\n top_right: { dx: -width, dy: 0 },\n center_left: { dx: 0, dy: -height / 2 },\n center: { dx: -width / 2, dy: -height / 2 },\n center_right: { dx: -width, dy: -height / 2 },\n bottom_left: { dx: 0, dy: -height },\n bottom_center: { dx: -width / 2, dy: -height },\n bottom_right: { dx: -width, dy: -height },\n }\n const { dx, dy } = offsetMap[anchor]\n const x0 = t.x + dx\n const y0 = t.y + dy\n return [\n { x: x0, y: y0 },\n { x: x0 + width, y: y0 + height },\n ]\n }),\n ]\n\n if (points.length === 0) {\n return { minX: -1, maxX: 1, minY: -1, maxY: 1 }\n }\n\n return points.reduce(\n (bounds, point) => ({\n minX: Math.min(bounds.minX, point.x),\n maxX: Math.max(bounds.maxX, point.x),\n minY: Math.min(bounds.minY, point.y),\n maxY: Math.max(bounds.maxY, point.y),\n }),\n { minX: Infinity, maxX: -Infinity, minY: Infinity, maxY: -Infinity },\n )\n}\n\nfunction getProjectionMatrix(\n bounds: Bounds,\n coordinateSystem: GraphicsObject[\"coordinateSystem\"],\n svgWidth: number,\n svgHeight: number,\n) {\n const width = bounds.maxX - bounds.minX || 1\n const height = bounds.maxY - bounds.minY || 1\n\n const scale_factor = Math.min(\n (svgWidth - 2 * PADDING) / width,\n (svgHeight - 2 * PADDING) / height,\n )\n\n const yFlip = coordinateSystem === \"screen\" ? 1 : -1\n\n return compose(\n translate(svgWidth / 2, svgHeight / 2),\n scale(scale_factor, yFlip * scale_factor),\n translate(-(bounds.minX + width / 2), -(bounds.minY + height / 2)),\n )\n}\n\nfunction projectPoint(point: Point, matrix: Matrix) {\n const projected = applyToPoint(matrix, { x: point.x, y: point.y })\n return { ...point, ...projected }\n}\n\nexport function getSvgFromGraphicsObject(\n graphics: GraphicsObject,\n {\n includeTextLabels = true,\n backgroundColor,\n svgWidth = DEFAULT_SVG_SIZE,\n svgHeight = DEFAULT_SVG_SIZE,\n }: {\n includeTextLabels?: boolean | Array<\"points\" | \"lines\" | \"rects\">\n backgroundColor?: string\n svgWidth?: number\n svgHeight?: number\n } = {},\n): string {\n const bounds = getBounds(graphics)\n const matrix = getProjectionMatrix(\n bounds,\n graphics.coordinateSystem,\n svgWidth,\n svgHeight,\n )\n\n const shouldRenderLabel = (type: \"points\" | \"lines\" | \"rects\"): boolean => {\n if (typeof includeTextLabels === \"boolean\") {\n return includeTextLabels\n }\n if (Array.isArray(includeTextLabels)) {\n return includeTextLabels.includes(type)\n }\n return false\n }\n\n const svgObject = {\n name: \"svg\",\n type: \"element\",\n attributes: {\n width: svgWidth.toString(),\n height: svgHeight.toString(),\n viewBox: `0 0 ${svgWidth} ${svgHeight}`,\n xmlns: \"http://www.w3.org/2000/svg\",\n },\n children: [\n // Background rectangle (optional)\n ...(backgroundColor\n ? [\n {\n name: \"rect\",\n type: \"element\",\n attributes: {\n width: \"100%\",\n height: \"100%\",\n fill: backgroundColor,\n },\n },\n ]\n : []),\n // Points\n ...(graphics.points || []).map((point) => {\n const projected = projectPoint(point, matrix)\n return {\n name: \"g\",\n type: \"element\",\n attributes: {},\n children: [\n {\n name: \"circle\",\n type: \"element\",\n attributes: {\n \"data-type\": \"point\",\n \"data-label\": point.label || \"\",\n \"data-x\": point.x.toString(),\n \"data-y\": point.y.toString(),\n cx: projected.x.toString(),\n cy: projected.y.toString(),\n r: \"3\",\n fill: point.color || \"black\",\n },\n },\n ...(shouldRenderLabel(\"points\") && point.label\n ? [\n {\n name: \"text\",\n type: \"element\",\n attributes: {\n x: (projected.x + 5).toString(),\n y: (projected.y - 5).toString(),\n \"font-family\": \"sans-serif\",\n \"font-size\": \"12\",\n },\n children: [{ type: \"text\", value: point.label }],\n },\n ]\n : []),\n ],\n }\n }),\n // Lines\n ...(graphics.lines || []).map((line) => {\n const projectedPoints = line.points.map((p) => projectPoint(p, matrix))\n return {\n name: \"g\",\n type: \"element\",\n attributes: {},\n children: [\n {\n name: \"polyline\",\n type: \"element\",\n attributes: {\n \"data-points\": line.points\n .map((p) => `${p.x},${p.y}`)\n .join(\" \"),\n \"data-type\": \"line\",\n \"data-label\": line.label || \"\",\n points: projectedPoints.map((p) => `${p.x},${p.y}`).join(\" \"),\n fill: \"none\",\n stroke: line.strokeColor || \"black\",\n \"stroke-width\": (line.strokeWidth ?? 1).toString(),\n ...(line.strokeDash && {\n \"stroke-dasharray\": Array.isArray(line.strokeDash)\n ? line.strokeDash.join(\" \")\n : line.strokeDash,\n }),\n },\n },\n ...(shouldRenderLabel(\"lines\") &&\n line.label &&\n projectedPoints.length > 0\n ? [\n {\n name: \"text\",\n type: \"element\",\n attributes: {\n x: (projectedPoints[0].x + 5).toString(),\n y: (projectedPoints[0].y - 5).toString(),\n \"font-family\": \"sans-serif\",\n \"font-size\": \"12\",\n fill: line.strokeColor || \"black\",\n },\n children: [{ type: \"text\", value: line.label }],\n },\n ]\n : []),\n ],\n }\n }),\n // Rectangles\n ...(graphics.rects || []).map((rect) => {\n const corner1 = {\n x: rect.center.x - rect.width / 2,\n y: rect.center.y - rect.height / 2,\n }\n const projectedCorner1 = projectPoint(corner1, matrix)\n const corner2 = {\n x: rect.center.x + rect.width / 2,\n y: rect.center.y + rect.height / 2,\n }\n const projectedCorner2 = projectPoint(corner2, matrix)\n const scaledWidth = Math.abs(projectedCorner2.x - projectedCorner1.x)\n const scaledHeight = Math.abs(projectedCorner2.y - projectedCorner1.y)\n const rectX = Math.min(projectedCorner1.x, projectedCorner2.x)\n const rectY = Math.min(projectedCorner1.y, projectedCorner2.y)\n\n return {\n name: \"g\",\n type: \"element\",\n attributes: {},\n children: [\n {\n name: \"rect\",\n type: \"element\",\n attributes: {\n \"data-type\": \"rect\",\n \"data-label\": rect.label || \"\",\n \"data-x\": rect.center.x.toString(),\n \"data-y\": rect.center.y.toString(),\n x: rectX.toString(),\n y: rectY.toString(),\n width: scaledWidth.toString(),\n height: scaledHeight.toString(),\n fill: rect.fill || \"none\",\n stroke: rect.stroke || \"black\",\n \"stroke-width\": Math.abs(1 / matrix.a).toString(), // Consider scaling stroke width like lines if needed\n },\n },\n ...(shouldRenderLabel(\"rects\") && rect.label\n ? [\n {\n name: \"text\",\n type: \"element\",\n attributes: {\n x: (rectX + 5).toString(),\n y: (rectY - 5).toString(), // Position above the top-left corner\n \"font-family\": \"sans-serif\",\n \"font-size\": (\n ((scaledWidth + scaledHeight) / 2) *\n 0.02\n ).toString(),\n fill: rect.stroke || \"black\", // Default to stroke color for label\n },\n children: [{ type: \"text\", value: rect.label }],\n },\n ]\n : []),\n ],\n }\n }),\n // Circles\n ...(graphics.circles || []).map((circle) => {\n const projected = projectPoint(circle.center, matrix)\n const scaledRadius = circle.radius * Math.abs(matrix.a)\n return {\n name: \"circle\",\n type: \"element\",\n attributes: {\n \"data-type\": \"circle\",\n \"data-label\": \"\",\n \"data-x\": circle.center.x.toString(),\n \"data-y\": circle.center.y.toString(),\n cx: projected.x.toString(),\n cy: projected.y.toString(),\n r: scaledRadius.toString(),\n fill: circle.fill || \"none\",\n stroke: circle.stroke || \"black\",\n \"stroke-width\": Math.abs(1 / matrix.a).toString(),\n },\n }\n }),\n // Texts\n ...(graphics.texts || []).map((txt) => {\n const projected = projectPoint({ x: txt.x, y: txt.y }, matrix)\n const anchor = txt.anchorSide ?? \"center\"\n const alignMap: Record<string, string> = {\n top_left: \"start\",\n center_left: \"start\",\n bottom_left: \"start\",\n top_center: \"middle\",\n center: \"middle\",\n bottom_center: \"middle\",\n top_right: \"end\",\n center_right: \"end\",\n bottom_right: \"end\",\n }\n const baselineMap: Record<string, string> = {\n top_left: \"text-before-edge\",\n top_center: \"text-before-edge\",\n top_right: \"text-before-edge\",\n center_left: \"central\",\n center: \"central\",\n center_right: \"central\",\n bottom_left: \"text-after-edge\",\n bottom_center: \"text-after-edge\",\n bottom_right: \"text-after-edge\",\n }\n return {\n name: \"text\",\n type: \"element\",\n attributes: {\n \"data-type\": \"text\",\n \"data-label\": txt.text,\n \"data-x\": txt.x.toString(),\n \"data-y\": txt.y.toString(),\n x: projected.x.toString(),\n y: projected.y.toString(),\n fill: txt.color || \"black\",\n \"font-size\": ((txt.fontSize ?? 12) * Math.abs(matrix.a)).toString(),\n \"font-family\": \"sans-serif\",\n \"text-anchor\": alignMap[anchor],\n \"dominant-baseline\": baselineMap[anchor],\n },\n children: [{ type: \"text\", value: txt.text }],\n }\n }),\n // Crosshair lines and coordinates (initially hidden)\n {\n name: \"g\",\n type: \"element\",\n attributes: {\n id: \"crosshair\",\n style: \"display: none\",\n },\n children: [\n {\n name: \"line\",\n type: \"element\",\n attributes: {\n id: \"crosshair-h\",\n y1: \"0\",\n y2: svgHeight.toString(),\n stroke: \"#666\",\n \"stroke-width\": \"0.5\",\n },\n },\n {\n name: \"line\",\n type: \"element\",\n attributes: {\n id: \"crosshair-v\",\n x1: \"0\",\n x2: svgWidth.toString(),\n stroke: \"#666\",\n \"stroke-width\": \"0.5\",\n },\n },\n {\n name: \"text\",\n type: \"element\",\n attributes: {\n id: \"coordinates\",\n \"font-family\": \"monospace\",\n \"font-size\": \"12\",\n fill: \"#666\",\n },\n children: [{ type: \"text\", value: \"\" }],\n },\n ],\n },\n // Mouse tracking script\n {\n name: \"script\",\n type: \"element\",\n children: [\n {\n type: \"text\",\n value: `\n document.currentScript.parentElement.addEventListener('mousemove', (e) => {\n const svg = e.currentTarget;\n const rect = svg.getBoundingClientRect();\n const x = e.clientX - rect.left;\n const y = e.clientY - rect.top;\n const crosshair = svg.getElementById('crosshair');\n const h = svg.getElementById('crosshair-h');\n const v = svg.getElementById('crosshair-v');\n const coords = svg.getElementById('coordinates');\n \n crosshair.style.display = 'block';\n h.setAttribute('x1', '0');\n h.setAttribute('x2', '${svgWidth}');\n h.setAttribute('y1', y);\n h.setAttribute('y2', y);\n v.setAttribute('x1', x);\n v.setAttribute('x2', x);\n v.setAttribute('y1', '0');\n v.setAttribute('y2', '${svgHeight}');\n\n // Calculate real coordinates using inverse transformation\n const matrix = ${JSON.stringify(matrix)};\n // Manually invert and apply the affine transform\n // Since we only use translate and scale, we can directly compute:\n // x' = (x - tx) / sx\n // y' = (y - ty) / sy\n const sx = matrix.a;\n const sy = matrix.d;\n const tx = matrix.e; \n const ty = matrix.f;\n const realPoint = {\n x: (x - tx) / sx,\n y: (y - ty) / sy // Flip y back since we used negative scale\n }\n \n coords.textContent = \\`(\\${realPoint.x.toFixed(2)}, \\${realPoint.y.toFixed(2)})\\`;\n coords.setAttribute('x', (x + 5).toString());\n coords.setAttribute('y', (y - 5).toString());\n });\n document.currentScript.parentElement.addEventListener('mouseleave', () => {\n document.currentScript.parentElement.getElementById('crosshair').style.display = 'none';\n });\n `,\n },\n ],\n },\n ],\n }\n\n // biome-ignore lint/suspicious/noExplicitAny: TODO\n return pretty(stringify(svgObject as any))\n}\n"],"mappings":";;;;;;AAAA;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAEP,SAAS,iBAAiB;AAC1B,OAAO,YAAY;AAGnB,IAAM,mBAAmB;AACzB,IAAM,UAAU;AAShB,SAAS,UAAU,UAAkC;AACn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AAAA,YACN,YAAY;AAAA,cACV,IAAI;AAAA,cACJ,IAAI;AAAA,cACJ,IAAI,SAAS,SAAS;AAAA,cACtB,QAAQ;AAAA,cACR,gBAAgB;AAAA,YAClB;AAAA,UACF;AAAA,UACA;AAAA,YACE,MAAM;AAAA,YACN,MAAM;AAAA,YACN,YAAY;AAAA,cACV,IAAI;AAAA,cACJ,eAAe;AAAA,cACf,aAAa;AAAA,cACb,MAAM;AAAA,YACR;AAAA,YACA,UAAU,CAAC,EAAE,MAAM,QAAQ,OAAO,GAAG,CAAC;AAAA,UACxC;AAAA,QACF;AAAA,MACF;AAAA;AAAA,MAEA;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,QACN,UAAU;AAAA,UACR;AAAA,YACE,MAAM;AAAA,YACN,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wCAaqB,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wCAMR,SAAS;AAAA;AAAA;AAAA,iCAGhB,KAAK,UAAU,MAAM,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAsB7C;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAGA,SAAO,OAAO,UAAU,SAAgB,CAAC;AAC3C;","names":[]}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-NG6H63SM.js";
|
|
4
4
|
import {
|
|
5
5
|
getSvgFromGraphicsObject
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-Y2XZSHAE.js";
|
|
7
7
|
|
|
8
8
|
// lib/index.ts
|
|
9
9
|
function getSvgFromLogString(logString) {
|
|
@@ -53,4 +53,4 @@ export {
|
|
|
53
53
|
getHtmlFromLogString,
|
|
54
54
|
getSvgsFromLogString
|
|
55
55
|
};
|
|
56
|
-
//# sourceMappingURL=chunk-
|
|
56
|
+
//# sourceMappingURL=chunk-YERCI3ZS.js.map
|
package/dist/cli/cli.js
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
import {
|
|
3
3
|
getHtmlFromLogString,
|
|
4
4
|
getSvgsFromLogString
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-YERCI3ZS.js";
|
|
6
6
|
import "../chunk-SKWP646L.js";
|
|
7
7
|
import "../chunk-K2IJQPPY.js";
|
|
8
8
|
import "../chunk-ARYXS3GC.js";
|
|
9
9
|
import {
|
|
10
10
|
getGraphicsObjectsFromLogString
|
|
11
11
|
} from "../chunk-NG6H63SM.js";
|
|
12
|
-
import "../chunk-
|
|
12
|
+
import "../chunk-Y2XZSHAE.js";
|
|
13
13
|
import "../chunk-ZGI74PYD.js";
|
|
14
14
|
import "../chunk-TJJMMKHI.js";
|
|
15
15
|
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { GraphicsObject } from './types.js';
|
|
2
2
|
import 'transformation-matrix';
|
|
3
3
|
|
|
4
|
-
declare function getSvgFromGraphicsObject(graphics: GraphicsObject, { includeTextLabels, backgroundColor, }?: {
|
|
4
|
+
declare function getSvgFromGraphicsObject(graphics: GraphicsObject, { includeTextLabels, backgroundColor, svgWidth, svgHeight, }?: {
|
|
5
5
|
includeTextLabels?: boolean | Array<"points" | "lines" | "rects">;
|
|
6
6
|
backgroundColor?: string;
|
|
7
|
+
svgWidth?: number;
|
|
8
|
+
svgHeight?: number;
|
|
7
9
|
}): string;
|
|
8
10
|
|
|
9
11
|
export { getSvgFromGraphicsObject };
|
package/dist/lib/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
getHtmlFromLogString,
|
|
3
3
|
getSvgFromLogString,
|
|
4
4
|
getSvgsFromLogString
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-YERCI3ZS.js";
|
|
6
6
|
import {
|
|
7
7
|
createGraphicsGrid,
|
|
8
8
|
stackGraphicsHorizontally,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
} from "../chunk-NG6H63SM.js";
|
|
22
22
|
import {
|
|
23
23
|
getSvgFromGraphicsObject
|
|
24
|
-
} from "../chunk-
|
|
24
|
+
} from "../chunk-Y2XZSHAE.js";
|
|
25
25
|
import {
|
|
26
26
|
FONT_SIZE_HEIGHT_RATIO,
|
|
27
27
|
FONT_SIZE_WIDTH_RATIO
|
package/dist/lib/matcher.js
CHANGED
package/dist/lib/react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../chunk-
|
|
1
|
+
import "../chunk-YERCI3ZS.js";
|
|
2
2
|
import "../chunk-SKWP646L.js";
|
|
3
3
|
import "../chunk-K2IJQPPY.js";
|
|
4
4
|
import {
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
getBounds
|
|
8
8
|
} from "../chunk-ARYXS3GC.js";
|
|
9
9
|
import "../chunk-NG6H63SM.js";
|
|
10
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-Y2XZSHAE.js";
|
|
11
11
|
import "../chunk-ZGI74PYD.js";
|
|
12
12
|
import "../chunk-TJJMMKHI.js";
|
|
13
13
|
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../lib/getSvgFromGraphicsObject.ts"],"sourcesContent":["import {\n transform,\n compose,\n translate,\n scale,\n applyToPoint,\n identity,\n type Matrix,\n} from \"transformation-matrix\"\nimport type { GraphicsObject, Point } from \"./types\"\nimport { stringify } from \"svgson\"\nimport pretty from \"pretty\"\nimport { FONT_SIZE_WIDTH_RATIO, FONT_SIZE_HEIGHT_RATIO } from \"./constants\"\n\nconst DEFAULT_SVG_SIZE = 640\nconst PADDING = 40\n\ninterface Bounds {\n minX: number\n maxX: number\n minY: number\n maxY: number\n}\n\nfunction getBounds(graphics: GraphicsObject): Bounds {\n const points: Point[] = [\n ...(graphics.points || []),\n ...(graphics.lines || []).flatMap((line) => line.points),\n ...(graphics.rects || []).flatMap((rect) => {\n const halfWidth = rect.width / 2\n const halfHeight = rect.height / 2\n return [\n { x: rect.center.x - halfWidth, y: rect.center.y - halfHeight },\n { x: rect.center.x + halfWidth, y: rect.center.y - halfHeight },\n { x: rect.center.x - halfWidth, y: rect.center.y + halfHeight },\n { x: rect.center.x + halfWidth, y: rect.center.y + halfHeight },\n ]\n }),\n ...(graphics.circles || []).flatMap((circle) => [\n { x: circle.center.x - circle.radius, y: circle.center.y }, // left\n { x: circle.center.x + circle.radius, y: circle.center.y }, // right\n { x: circle.center.x, y: circle.center.y - circle.radius }, // top\n { x: circle.center.x, y: circle.center.y + circle.radius }, // bottom\n ]),\n ...(graphics.texts || []).flatMap((t) => {\n const fontSize = t.fontSize ?? 12\n const width = t.text.length * fontSize * FONT_SIZE_WIDTH_RATIO\n const height = fontSize * FONT_SIZE_HEIGHT_RATIO\n const anchor = t.anchorSide ?? \"center\"\n const offsetMap: Record<string, { dx: number; dy: number }> = {\n top_left: { dx: 0, dy: 0 },\n top_center: { dx: -width / 2, dy: 0 },\n top_right: { dx: -width, dy: 0 },\n center_left: { dx: 0, dy: -height / 2 },\n center: { dx: -width / 2, dy: -height / 2 },\n center_right: { dx: -width, dy: -height / 2 },\n bottom_left: { dx: 0, dy: -height },\n bottom_center: { dx: -width / 2, dy: -height },\n bottom_right: { dx: -width, dy: -height },\n }\n const { dx, dy } = offsetMap[anchor]\n const x0 = t.x + dx\n const y0 = t.y + dy\n return [\n { x: x0, y: y0 },\n { x: x0 + width, y: y0 + height },\n ]\n }),\n ]\n\n if (points.length === 0) {\n return { minX: -1, maxX: 1, minY: -1, maxY: 1 }\n }\n\n return points.reduce(\n (bounds, point) => ({\n minX: Math.min(bounds.minX, point.x),\n maxX: Math.max(bounds.maxX, point.x),\n minY: Math.min(bounds.minY, point.y),\n maxY: Math.max(bounds.maxY, point.y),\n }),\n { minX: Infinity, maxX: -Infinity, minY: Infinity, maxY: -Infinity },\n )\n}\n\nfunction getProjectionMatrix(\n bounds: Bounds,\n coordinateSystem: GraphicsObject[\"coordinateSystem\"],\n) {\n const width = bounds.maxX - bounds.minX || 1\n const height = bounds.maxY - bounds.minY || 1\n\n const scale_factor = Math.min(\n (DEFAULT_SVG_SIZE - 2 * PADDING) / width,\n (DEFAULT_SVG_SIZE - 2 * PADDING) / height,\n )\n\n const yFlip = coordinateSystem === \"screen\" ? 1 : -1\n\n return compose(\n translate(DEFAULT_SVG_SIZE / 2, DEFAULT_SVG_SIZE / 2),\n scale(scale_factor, yFlip * scale_factor),\n translate(-(bounds.minX + width / 2), -(bounds.minY + height / 2)),\n )\n}\n\nfunction projectPoint(point: Point, matrix: Matrix) {\n const projected = applyToPoint(matrix, { x: point.x, y: point.y })\n return { ...point, ...projected }\n}\n\nexport function getSvgFromGraphicsObject(\n graphics: GraphicsObject,\n {\n includeTextLabels = true,\n backgroundColor,\n }: {\n includeTextLabels?: boolean | Array<\"points\" | \"lines\" | \"rects\">\n backgroundColor?: string\n } = {},\n): string {\n const bounds = getBounds(graphics)\n const matrix = getProjectionMatrix(bounds, graphics.coordinateSystem)\n\n const shouldRenderLabel = (type: \"points\" | \"lines\" | \"rects\"): boolean => {\n if (typeof includeTextLabels === \"boolean\") {\n return includeTextLabels\n }\n if (Array.isArray(includeTextLabels)) {\n return includeTextLabels.includes(type)\n }\n return false\n }\n\n const svgObject = {\n name: \"svg\",\n type: \"element\",\n attributes: {\n width: DEFAULT_SVG_SIZE.toString(),\n height: DEFAULT_SVG_SIZE.toString(),\n viewBox: `0 0 ${DEFAULT_SVG_SIZE} ${DEFAULT_SVG_SIZE}`,\n xmlns: \"http://www.w3.org/2000/svg\",\n },\n children: [\n // Background rectangle (optional)\n ...(backgroundColor\n ? [\n {\n name: \"rect\",\n type: \"element\",\n attributes: {\n width: \"100%\",\n height: \"100%\",\n fill: backgroundColor,\n },\n },\n ]\n : []),\n // Points\n ...(graphics.points || []).map((point) => {\n const projected = projectPoint(point, matrix)\n return {\n name: \"g\",\n type: \"element\",\n attributes: {},\n children: [\n {\n name: \"circle\",\n type: \"element\",\n attributes: {\n \"data-type\": \"point\",\n \"data-label\": point.label || \"\",\n \"data-x\": point.x.toString(),\n \"data-y\": point.y.toString(),\n cx: projected.x.toString(),\n cy: projected.y.toString(),\n r: \"3\",\n fill: point.color || \"black\",\n },\n },\n ...(shouldRenderLabel(\"points\") && point.label\n ? [\n {\n name: \"text\",\n type: \"element\",\n attributes: {\n x: (projected.x + 5).toString(),\n y: (projected.y - 5).toString(),\n \"font-family\": \"sans-serif\",\n \"font-size\": \"12\",\n },\n children: [{ type: \"text\", value: point.label }],\n },\n ]\n : []),\n ],\n }\n }),\n // Lines\n ...(graphics.lines || []).map((line) => {\n const projectedPoints = line.points.map((p) => projectPoint(p, matrix))\n return {\n name: \"g\",\n type: \"element\",\n attributes: {},\n children: [\n {\n name: \"polyline\",\n type: \"element\",\n attributes: {\n \"data-points\": line.points\n .map((p) => `${p.x},${p.y}`)\n .join(\" \"),\n \"data-type\": \"line\",\n \"data-label\": line.label || \"\",\n points: projectedPoints.map((p) => `${p.x},${p.y}`).join(\" \"),\n fill: \"none\",\n stroke: line.strokeColor || \"black\",\n \"stroke-width\": (line.strokeWidth ?? 1).toString(),\n ...(line.strokeDash && {\n \"stroke-dasharray\": Array.isArray(line.strokeDash)\n ? line.strokeDash.join(\" \")\n : line.strokeDash,\n }),\n },\n },\n ...(shouldRenderLabel(\"lines\") &&\n line.label &&\n projectedPoints.length > 0\n ? [\n {\n name: \"text\",\n type: \"element\",\n attributes: {\n x: (projectedPoints[0].x + 5).toString(),\n y: (projectedPoints[0].y - 5).toString(),\n \"font-family\": \"sans-serif\",\n \"font-size\": \"12\",\n fill: line.strokeColor || \"black\",\n },\n children: [{ type: \"text\", value: line.label }],\n },\n ]\n : []),\n ],\n }\n }),\n // Rectangles\n ...(graphics.rects || []).map((rect) => {\n const corner1 = {\n x: rect.center.x - rect.width / 2,\n y: rect.center.y - rect.height / 2,\n }\n const projectedCorner1 = projectPoint(corner1, matrix)\n const corner2 = {\n x: rect.center.x + rect.width / 2,\n y: rect.center.y + rect.height / 2,\n }\n const projectedCorner2 = projectPoint(corner2, matrix)\n const scaledWidth = Math.abs(projectedCorner2.x - projectedCorner1.x)\n const scaledHeight = Math.abs(projectedCorner2.y - projectedCorner1.y)\n const rectX = Math.min(projectedCorner1.x, projectedCorner2.x)\n const rectY = Math.min(projectedCorner1.y, projectedCorner2.y)\n\n return {\n name: \"g\",\n type: \"element\",\n attributes: {},\n children: [\n {\n name: \"rect\",\n type: \"element\",\n attributes: {\n \"data-type\": \"rect\",\n \"data-label\": rect.label || \"\",\n \"data-x\": rect.center.x.toString(),\n \"data-y\": rect.center.y.toString(),\n x: rectX.toString(),\n y: rectY.toString(),\n width: scaledWidth.toString(),\n height: scaledHeight.toString(),\n fill: rect.fill || \"none\",\n stroke: rect.stroke || \"black\",\n \"stroke-width\": Math.abs(1 / matrix.a).toString(), // Consider scaling stroke width like lines if needed\n },\n },\n ...(shouldRenderLabel(\"rects\") && rect.label\n ? [\n {\n name: \"text\",\n type: \"element\",\n attributes: {\n x: (rectX + 5).toString(),\n y: (rectY - 5).toString(), // Position above the top-left corner\n \"font-family\": \"sans-serif\",\n \"font-size\": (\n ((scaledWidth + scaledHeight) / 2) *\n 0.02\n ).toString(),\n fill: rect.stroke || \"black\", // Default to stroke color for label\n },\n children: [{ type: \"text\", value: rect.label }],\n },\n ]\n : []),\n ],\n }\n }),\n // Circles\n ...(graphics.circles || []).map((circle) => {\n const projected = projectPoint(circle.center, matrix)\n const scaledRadius = circle.radius * Math.abs(matrix.a)\n return {\n name: \"circle\",\n type: \"element\",\n attributes: {\n \"data-type\": \"circle\",\n \"data-label\": \"\",\n \"data-x\": circle.center.x.toString(),\n \"data-y\": circle.center.y.toString(),\n cx: projected.x.toString(),\n cy: projected.y.toString(),\n r: scaledRadius.toString(),\n fill: circle.fill || \"none\",\n stroke: circle.stroke || \"black\",\n \"stroke-width\": Math.abs(1 / matrix.a).toString(),\n },\n }\n }),\n // Texts\n ...(graphics.texts || []).map((txt) => {\n const projected = projectPoint({ x: txt.x, y: txt.y }, matrix)\n const anchor = txt.anchorSide ?? \"center\"\n const alignMap: Record<string, string> = {\n top_left: \"start\",\n center_left: \"start\",\n bottom_left: \"start\",\n top_center: \"middle\",\n center: \"middle\",\n bottom_center: \"middle\",\n top_right: \"end\",\n center_right: \"end\",\n bottom_right: \"end\",\n }\n const baselineMap: Record<string, string> = {\n top_left: \"text-before-edge\",\n top_center: \"text-before-edge\",\n top_right: \"text-before-edge\",\n center_left: \"central\",\n center: \"central\",\n center_right: \"central\",\n bottom_left: \"text-after-edge\",\n bottom_center: \"text-after-edge\",\n bottom_right: \"text-after-edge\",\n }\n return {\n name: \"text\",\n type: \"element\",\n attributes: {\n \"data-type\": \"text\",\n \"data-label\": txt.text,\n \"data-x\": txt.x.toString(),\n \"data-y\": txt.y.toString(),\n x: projected.x.toString(),\n y: projected.y.toString(),\n fill: txt.color || \"black\",\n \"font-size\": ((txt.fontSize ?? 12) * Math.abs(matrix.a)).toString(),\n \"font-family\": \"sans-serif\",\n \"text-anchor\": alignMap[anchor],\n \"dominant-baseline\": baselineMap[anchor],\n },\n children: [{ type: \"text\", value: txt.text }],\n }\n }),\n // Crosshair lines and coordinates (initially hidden)\n {\n name: \"g\",\n type: \"element\",\n attributes: {\n id: \"crosshair\",\n style: \"display: none\",\n },\n children: [\n {\n name: \"line\",\n type: \"element\",\n attributes: {\n id: \"crosshair-h\",\n y1: \"0\",\n y2: DEFAULT_SVG_SIZE.toString(),\n stroke: \"#666\",\n \"stroke-width\": \"0.5\",\n },\n },\n {\n name: \"line\",\n type: \"element\",\n attributes: {\n id: \"crosshair-v\",\n x1: \"0\",\n x2: DEFAULT_SVG_SIZE.toString(),\n stroke: \"#666\",\n \"stroke-width\": \"0.5\",\n },\n },\n {\n name: \"text\",\n type: \"element\",\n attributes: {\n id: \"coordinates\",\n \"font-family\": \"monospace\",\n \"font-size\": \"12\",\n fill: \"#666\",\n },\n children: [{ type: \"text\", value: \"\" }],\n },\n ],\n },\n // Mouse tracking script\n {\n name: \"script\",\n type: \"element\",\n children: [\n {\n type: \"text\",\n value: `\n document.currentScript.parentElement.addEventListener('mousemove', (e) => {\n const svg = e.currentTarget;\n const rect = svg.getBoundingClientRect();\n const x = e.clientX - rect.left;\n const y = e.clientY - rect.top;\n const crosshair = svg.getElementById('crosshair');\n const h = svg.getElementById('crosshair-h');\n const v = svg.getElementById('crosshair-v');\n const coords = svg.getElementById('coordinates');\n \n crosshair.style.display = 'block';\n h.setAttribute('x1', '0');\n h.setAttribute('x2', '${DEFAULT_SVG_SIZE}');\n h.setAttribute('y1', y);\n h.setAttribute('y2', y);\n v.setAttribute('x1', x);\n v.setAttribute('x2', x);\n v.setAttribute('y1', '0');\n v.setAttribute('y2', '${DEFAULT_SVG_SIZE}');\n\n // Calculate real coordinates using inverse transformation\n const matrix = ${JSON.stringify(matrix)};\n // Manually invert and apply the affine transform\n // Since we only use translate and scale, we can directly compute:\n // x' = (x - tx) / sx\n // y' = (y - ty) / sy\n const sx = matrix.a;\n const sy = matrix.d;\n const tx = matrix.e; \n const ty = matrix.f;\n const realPoint = {\n x: (x - tx) / sx,\n y: (y - ty) / sy // Flip y back since we used negative scale\n }\n \n coords.textContent = \\`(\\${realPoint.x.toFixed(2)}, \\${realPoint.y.toFixed(2)})\\`;\n coords.setAttribute('x', (x + 5).toString());\n coords.setAttribute('y', (y - 5).toString());\n });\n document.currentScript.parentElement.addEventListener('mouseleave', () => {\n document.currentScript.parentElement.getElementById('crosshair').style.display = 'none';\n });\n `,\n },\n ],\n },\n ],\n }\n\n // biome-ignore lint/suspicious/noExplicitAny: TODO\n return pretty(stringify(svgObject as any))\n}\n"],"mappings":";;;;;;AAAA;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAEP,SAAS,iBAAiB;A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