From 040f1cf903856cf8aa78688b86ad366fc7d8b636 Mon Sep 17 00:00:00 2001 From: Tamir Bahar <1386239+tmr232@users.noreply.github.com> Date: Sat, 14 Sep 2024 19:15:38 +0300 Subject: [PATCH 1/2] Add support for the `canon` output format Support the [`canon`](https://graphviz.gitlab.io/docs/outputs/canon/) format, to allow formatting DOT files without performing any layout. --- packages/graphviz/src/graphviz.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/graphviz/src/graphviz.ts b/packages/graphviz/src/graphviz.ts index 3402cf3b..88a32d87 100644 --- a/packages/graphviz/src/graphviz.ts +++ b/packages/graphviz/src/graphviz.ts @@ -4,7 +4,7 @@ import load, { reset } from "../../../build/packages/graphviz/src-cpp/graphvizli /** * Various graphic and data formats for end user, web, documents and other applications. See [Output Formats](https://graphviz.gitlab.io/docs/outputs/) for more information. */ -export type Format = "svg" | "dot" | "json" | "dot_json" | "xdot_json" | "plain" | "plain-ext"; +export type Format = "svg" | "dot" | "json" | "dot_json" | "xdot_json" | "plain" | "plain-ext" | "canon"; /** * Various algorithms for projecting abstract graphs into a space for visualization. See [Layout Engines](https://graphviz.gitlab.io/docs/layouts/) for more details. From c382fede13b60ecba4fd5e6ad66e5920b9c363aa Mon Sep 17 00:00:00 2001 From: Tamir Bahar <1386239+tmr232@users.noreply.github.com> Date: Tue, 17 Sep 2024 14:09:04 +0300 Subject: [PATCH 2/2] Added the `canon` format to the tests --- packages/graphviz/test/graphviz.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/graphviz/test/graphviz.ts b/packages/graphviz/test/graphviz.ts index 3ddadf8d..06cadea0 100644 --- a/packages/graphviz/test/graphviz.ts +++ b/packages/graphviz/test/graphviz.ts @@ -4,7 +4,7 @@ import { badDot, dot } from "./dot001.js"; import { ortho } from "./dot002.js"; import { dotMemory } from "./dot003.js"; -export const formats: Format[] = ["svg", "dot", "json", "dot_json", "xdot_json", "plain", "plain-ext"]; +export const formats: Format[] = ["svg", "dot", "json", "dot_json", "xdot_json", "plain", "plain-ext", "canon"]; export const engines: Engine[] = ["circo", "dot", "fdp", "sfdp", "neato", "osage", "patchwork", "twopi", "nop", "nop2"]; describe("all combos", function () {