-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add four missing diagrams, provide contributor instructions, and upda…
…te mermaid. (#53) * Adds mindmap to supported diagrams. Adds example techdocs. Adds contributor notes. * Adds more examples to sample. * Bump upstream mermaid version. Expand sample docs to provide more context around each example. * Katex Example. * Updates package version. Update yarn.lock. * Revert manual version bump and instructions related to submitting a new PR. --------- Co-authored-by: Justin Treher <jtreher@webstaurantstore.com>
- Loading branch information
1 parent
bed9ef3
commit b6dd21e
Showing
7 changed files
with
339 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: backstage.io/v1alpha1 | ||
kind: Component | ||
metadata: | ||
name: sampledocs | ||
annotations: | ||
backstage.io/techdocs-ref: dir:. | ||
spec: | ||
type: documentation | ||
lifecycle: production | ||
owner: you |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,238 @@ | ||
# Example Supported Mermaid Diagrams | ||
|
||
## Supported by the Add On | ||
|
||
## Graph/Flowchart | ||
|
||
```mermaid | ||
graph TD | ||
A[Start] --> B{Is it working?} | ||
B -- Yes --> C[Continue] | ||
B -- No --> D[Fix it] | ||
D --> B | ||
C --> E[Finish] | ||
``` | ||
|
||
### Sequence Diagram | ||
|
||
```mermaid | ||
sequenceDiagram | ||
participant Alice | ||
participant Bob | ||
Alice->>Bob: Hello Bob, how are you? | ||
Bob-->>Alice: I'm good thanks! | ||
Alice->>Bob: Great to hear | ||
``` | ||
|
||
### Gantt | ||
|
||
```mermaid | ||
gantt | ||
title A Gantt Diagram | ||
dateFormat YYYY-MM-DD | ||
section Section | ||
Task 1 :a1, 2023-01-01, 30d | ||
Task 2 :after a1 , 20d | ||
Task 3 : 2023-02-11 , 20d | ||
Task 4 : 2023-02-21 , 20d | ||
``` | ||
|
||
### Class Diagram | ||
|
||
```mermaid | ||
classDiagram | ||
class Animal { | ||
+String species | ||
+void eat() | ||
} | ||
class Dog { | ||
+String breed | ||
+void bark() | ||
} | ||
Animal <|-- Dog | ||
``` | ||
|
||
### State Diagram | ||
|
||
```mermaid | ||
stateDiagram-v2 | ||
[*] --> Idle | ||
Idle --> Working : start | ||
Working --> Idle : stop | ||
Working --> Failed : error | ||
``` | ||
|
||
### Pie | ||
|
||
```mermaid | ||
pie | ||
title Language Popularity | ||
"JavaScript" : 50 | ||
"Python" : 25 | ||
"Java" : 15 | ||
"C++" : 10 | ||
``` | ||
|
||
### erDiagram | ||
|
||
```mermaid | ||
erDiagram | ||
CUSTOMER ||--o{ ORDER : places | ||
ORDER ||--|{ LINE-ITEM : contains | ||
CUSTOMER }|..|{ DELIVERY-ADDRESS : uses | ||
``` | ||
|
||
### Journey | ||
|
||
```mermaid | ||
journey | ||
title My working day | ||
section Go to work | ||
Make tea: 5: Me | ||
Go upstairs: 3: Me | ||
Do work: 1: Me, Cat | ||
section Go home | ||
Go downstairs: 5: Me | ||
Sit down: 5: Me | ||
``` | ||
|
||
### Quadrant Chart | ||
|
||
```mermaid | ||
quadrantChart | ||
title Reach and engagement of campaigns | ||
x-axis Low Reach --> High Reach | ||
y-axis Low Engagement --> High Engagement | ||
quadrant-1 We should expand | ||
quadrant-2 Need to promote | ||
quadrant-3 Re-evaluate | ||
quadrant-4 May be improved | ||
Campaign A: [0.3, 0.6] | ||
Campaign B: [0.45, 0.23] | ||
Campaign C: [0.57, 0.69] | ||
Campaign D: [0.78, 0.34] | ||
Campaign E: [0.40, 0.34] | ||
Campaign F: [0.35, 0.78] | ||
``` | ||
|
||
### Requirement Diagram | ||
|
||
```mermaid | ||
requirementDiagram | ||
requirement test_req { | ||
id: 1 | ||
text: the test text. | ||
risk: high | ||
verifymethod: test | ||
} | ||
element test_entity { | ||
type: simulation | ||
} | ||
test_entity - satisfies -> test_req | ||
``` | ||
|
||
### GitGraph | ||
|
||
```mermaid | ||
gitGraph | ||
commit | ||
commit | ||
branch develop | ||
checkout develop | ||
commit | ||
commit | ||
checkout main | ||
merge develop | ||
commit | ||
commit | ||
``` | ||
|
||
### MindMap | ||
|
||
```mermaid | ||
mindmap | ||
root((mindmap)) | ||
Origins | ||
Long history | ||
::icon(fa fa-book) | ||
Popularisation | ||
British popular psychology author Tony Buzan | ||
Research | ||
On effectiveness<br/>and features | ||
On Automatic creation | ||
Uses | ||
Creative techniques | ||
Strategic planning | ||
Argument mapping | ||
Tools | ||
Pen and paper | ||
Mermaid | ||
``` | ||
|
||
### Timeline | ||
|
||
```mermaid | ||
timeline | ||
title History of Social Media Platform | ||
2002 : LinkedIn | ||
2004 : Facebook | ||
2005 : Youtube | ||
2006 : Twitter | ||
``` | ||
|
||
### XYChart-Beta | ||
|
||
```mermaid | ||
xychart-beta | ||
title "Sales Revenue" | ||
x-axis [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec] | ||
y-axis "Revenue (in $)" 4000 --> 11000 | ||
bar [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000] | ||
line [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000] | ||
``` | ||
|
||
### Block Beta | ||
|
||
```mermaid | ||
block-beta | ||
columns 1 | ||
db(("DB")) | ||
blockArrowId6<[" "]>(down) | ||
block:ID | ||
A | ||
B["A wide one in the middle"] | ||
C | ||
end | ||
space | ||
D | ||
ID --> D | ||
C --> D | ||
style B fill:#969,stroke:#333,stroke-width:4px | ||
``` | ||
|
||
### Katex | ||
|
||
```mermaid | ||
graph LR | ||
A["$$f(\relax{x}) = \int_{-\infty}^\infty \hat{f}(\xi)\,e^{2 \pi i \xi x}\,d\xi$$"] -->|"$$\Bigg(\bigg(\Big(\big((\frac{-b\pm\sqrt{b^2-4ac}}{2a})\big)\Big)\bigg)\Bigg)$$"| B("$$1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}} {1+\frac{e^{-8\pi}} {1+\cdots}}}}$$") | ||
A -->|"$$\overbrace{a+b+c}^{\text{note}}$$"| C("$$\phase{-78^\circ}$$") | ||
B --> D("$$x = \begin{cases} a &\text{if } b \\ c &\text{if } d \end{cases}$$") | ||
C --> E("$$x(t)=c_1\begin{bmatrix}-\cos{t}+\sin{t}\\ 2\cos{t} \end{bmatrix}e^{2t}$$") | ||
``` | ||
|
||
## Not yet supported | ||
|
||
### ZenUml | ||
|
||
```mermaid | ||
zenuml | ||
title Demo | ||
Alice->John: Hello John, how are you? | ||
John->Alice: Great! | ||
Alice->John: See you later! | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.