From bc31125bc6de3eb310f32b72769dba712f07587c Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist Date: Thu, 26 Aug 2021 17:27:34 +0200 Subject: [PATCH] Updating the docs with direction statements --- docs/classDiagram.md | 40 ++++++++++++++++++++++++++++++++++++++++ docs/index.html | 2 +- docs/stateDiagram.md | 31 +++++++++++++++++++++++++++++++ 3 files changed, 72 insertions(+), 1 deletion(-) diff --git a/docs/classDiagram.md b/docs/classDiagram.md index 2d7427739..21ea40856 100644 --- a/docs/classDiagram.md +++ b/docs/classDiagram.md @@ -443,6 +443,46 @@ class Shape{ ``` +## Setting the direction of the diagram + +With class diagrams you can use the direction statement to set the direction which the diagram will render like in this example. + +``` +classDiagram + direction RL + class Student { + -idCard : IdCard + } + class IdCard{ + -id : int + -name : string + } + class Bike{ + -id : int + -name : string + } + Student "1" --o "1" IdCard : carries + Student "1" --o "1" Bike : rides + ``` + This is how this renders +```mermaid +classDiagram + direction RL + class Student { + -idCard : IdCard + } + class IdCard{ + -id : int + -name : string + } + class Bike{ + -id : int + -name : string + } + Student "1" --o "1" IdCard : carries + Student "1" --o "1" Bike : rides + ``` + ## Interaction It is possible to bind a click event to a node, the click can lead to either a javascript callback or to a link which will be opened in a new browser tab. **Note**: This functionality is disabled when using `securityLevel='strict'` and enabled when using `securityLevel='loose'`. diff --git a/docs/index.html b/docs/index.html index 49cd3c1c8..ab425fca4 100644 --- a/docs/index.html +++ b/docs/index.html @@ -7,7 +7,7 @@ - +