Skip to content

Commit

Permalink
fix: update arrow types for class diagrams (#44)
Browse files Browse the repository at this point in the history
* fix: update arrow types for class diagrams

* update cl
  • Loading branch information
ad1992 authored Dec 6, 2023
1 parent 0149654 commit e00d475
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 10 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## Unreleased

### Features

- Support Mermaid Class Diagrams 🥳 [#42](https://github.com/excalidraw/mermaid-to-excalidraw/pull/42) by [@ad1992](https://github.com/ad1992).

### Fixes

- Update arrow types for class diagrams [#44](https://github.com/excalidraw/mermaid-to-excalidraw/pull/44) by [@ad1992](https://github.com/ad1992).

## 0.1.2 (2023-11-03)

## Library
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"devDependencies": {
"@babel/core": "7.12.0",
"@excalidraw/eslint-config": "1.0.3",
"@excalidraw/excalidraw": "0.17.1-7391-e65bf53",
"@excalidraw/excalidraw": "0.17.1-7381-cdf6d3e",
"@parcel/transformer-sass": "2.9.1",
"@types/mermaid": "9.2.0",
"@types/react": "18.2.14",
Expand Down
2 changes: 1 addition & 1 deletion playground/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ <h2 style="margin-top: 50px">Unsupported diagrams</h2>
></script>
<script
crossorigin
src="https://unpkg.com/@excalidraw/excalidraw@0.17.1-7391-e65bf53/dist/excalidraw.development.js"
src="https://unpkg.com/@excalidraw/excalidraw@0.17.1-7381-cdf6d3e/dist/excalidraw.development.js"
></script>
<script type="module" src="index.ts"></script>
</body>
Expand Down
8 changes: 4 additions & 4 deletions src/parser/class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,22 +68,22 @@ const getArrowhead = (type: RELATION_TYPE_VALUES) => {
let arrowhead: ExcalidrawLinearElement["startArrowhead"];
switch (type) {
case RELATION_TYPE.AGGREGATION:
arrowhead = "d_diamond";
arrowhead = "diamond_outline";
break;

case RELATION_TYPE.COMPOSITION:
arrowhead = "d_diamond_filled";
arrowhead = "diamond";
break;
case RELATION_TYPE.EXTENSION:
arrowhead = "d_triangle";
arrowhead = "triangle_outline";
break;
case "none":
arrowhead = null;
break;

case RELATION_TYPE.DEPENDENCY:
default:
arrowhead = "d_arrow";
arrowhead = "arrow";
break;
}
return arrowhead;
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -883,10 +883,10 @@
resolved "https://registry.yarnpkg.com/@excalidraw/eslint-config/-/eslint-config-1.0.3.tgz#2122ef7413ae77874ae9848ce0f1c6b3f0d8bbbd"
integrity sha512-GemHNF5Z6ga0BWBSX7GJaNBUchLu6RwTcAB84eX1MeckRNhNasAsPCdelDlFalz27iS4RuYEQh0bPE8SRxJgbQ==

"@excalidraw/excalidraw@0.17.1-7391-e65bf53":
version "0.17.1-7391-e65bf53"
resolved "https://registry.yarnpkg.com/@excalidraw/excalidraw/-/excalidraw-0.17.1-7391-e65bf53.tgz#d19e6b0f1e49b41e1c62da09e77a5dc27ca6e3f4"
integrity sha512-FJW7D2I/KyXthA3MbwGwX0K9NIqY5L4Za2R+9TqlFjnBqLWIdnxRXqyKGYkT3LPBWubv2tOmrymzuAXfKRQbCQ==
"@excalidraw/excalidraw@0.17.1-7381-cdf6d3e":
version "0.17.1-7381-cdf6d3e"
resolved "https://registry.yarnpkg.com/@excalidraw/excalidraw/-/excalidraw-0.17.1-7381-cdf6d3e.tgz#ab01bc27639a7828edf5ebaba288969713477177"
integrity sha512-gRjaw9HQ5qzlhqvtnUK1ujakZnp5l4zgLmnskxG3WzmVXwEd+lK8etDEdXjAKmw7cmG+3e0jO0wFHKNqBxoKNA==

"@excalidraw/markdown-to-text@0.1.2":
version "0.1.2"
Expand Down

1 comment on commit e00d475

@vercel
Copy link

@vercel vercel bot commented on e00d475 Dec 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.