mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-25 10:20:06 +02:00
Update docs
This commit is contained in:
@@ -145,7 +145,7 @@ class BankAccount{
|
|||||||
|
|
||||||
Members can be defined using generic types, such as `List<int>`, for fields, parameters, and return types by enclosing the type within `~` (**tilde**). **Nested** type declarations such as `List<List<int>>` are supported.
|
Members can be defined using generic types, such as `List<int>`, for fields, parameters, and return types by enclosing the type within `~` (**tilde**). **Nested** type declarations such as `List<List<int>>` are supported.
|
||||||
|
|
||||||
Generics can be represented as part of a class definition and also in the parameters or the return value of a method/function:
|
Generics can be represented as part of a class definition and also in the parameters or the return value of a method/function (note that any references to the class later in diagram code is used without the type )
|
||||||
|
|
||||||
```mermaid-example
|
```mermaid-example
|
||||||
classDiagram
|
classDiagram
|
||||||
@@ -520,7 +520,28 @@ Beginner's tip—a full example using interactive links in an HTML page:
|
|||||||
|
|
||||||
### Styling a node
|
### Styling a node
|
||||||
|
|
||||||
It is possible to apply specific styles such as a thicker border or a different background color to individual nodes. This is done by predefining classes in css styles that can be applied from the graph definition using the `cssClass` statement or the `:::` short hand.
|
It is possible to apply specific styles such as a thicker border or a different background color to a node.
|
||||||
|
|
||||||
|
```mermaid-example
|
||||||
|
classDiagram
|
||||||
|
class Animal
|
||||||
|
class Mineral
|
||||||
|
style Animal fill:#f9f,stroke:#333,stroke-width:4px
|
||||||
|
style Mineral fill:#bbf,stroke:#f66,stroke-width:2px,color:#fff,stroke-dasharray: 5 5
|
||||||
|
```
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
classDiagram
|
||||||
|
class Animal
|
||||||
|
class Mineral
|
||||||
|
style Animal fill:#f9f,stroke:#333,stroke-width:4px
|
||||||
|
style Mineral fill:#bbf,stroke:#f66,stroke-width:2px,color:#fff,stroke-dasharray: 5 5
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Classes
|
||||||
|
|
||||||
|
More convenient than defining the style every time is to define a class of styles and attach this class to the nodes that
|
||||||
|
should have a different look. This is done by predefining classes in css styles that can be applied from the graph definition using the `cssClass` statement or the `:::` short hand.
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<style>
|
<style>
|
||||||
|
Reference in New Issue
Block a user