Skip to content

Commit

Permalink
Merge pull request #44 from tone-row/add-right-rhomboid
Browse files Browse the repository at this point in the history
Add Right Rhomboid
  • Loading branch information
rob-gordon committed May 17, 2023
2 parents e733bd2 + 60fb8ab commit 899e2e9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions graph-selector/src/toMermaid.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,12 @@ describe("toMermaid", () => {
});
expect(mermaid).toEqual(`flowchart`);
});

test("Creates right rhomboid", () => {
const mermaid = toMermaid({
nodes: [{ data: { label: "a", classes: "right-rhomboid", id: "a" } }],
edges: [],
});
expect(mermaid).toEqual(`flowchart\n\ta[\\"a"\\]`);
});
});
3 changes: 3 additions & 0 deletions graph-selector/src/toMermaid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ export function toMermaid({ nodes, edges }: Graph) {
} else if (classes.includes("hexagon")) {
before = "{{";
after = "}}";
} else if (classes.includes("right-rhomboid")) {
before = "[\\";
after = "\\]";
} else if (classes.includes("rhomboid")) {
before = "[/";
after = "/]";
Expand Down

0 comments on commit 899e2e9

Please sign in to comment.