Merge pull request #27 from mermaid-js/develop

sync
This commit is contained in:
Justin Greywolf 2020-08-12 13:46:12 -07:00 committed by GitHub
commit 595e03c584
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 99420 additions and 15 deletions

View File

@ -74,14 +74,21 @@ stateDiagram-v2
A --> D: asd123 A --> D: asd123
</div> </div>
</div> </div>
%%{init: {'theme': 'base', 'themeVariables':{ 'primaryColor': '#ff0000'}}}%%
<div class="mermaid" style="width: 50%; height: 20%;"> <div class="mermaid" style="width: 50%; height: 20%;">
%%{init: {'theme': 'dark'}}%% %%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#ff0000'}}}%%
graph TD
flowchart TB A[Christmas] -->|Get money| B(Go shopping)
subgraph apa B --> C{Let me think}
a --> A %% comment B --> G[/Another/]
a --> a{apa} %% comment C ==>|One| D[Laptop]
C -->|Two| E[iPhone]
C -->|Three| F[fa:fa-car Car]
subgraph section
C
D
E
F
G
end end
</div> </div>
<div class="mermaid2" style="width: 50%; height: 20%;"> <div class="mermaid2" style="width: 50%; height: 20%;">
@ -106,7 +113,7 @@ Note over Bob,Alice: Looks back
// console.error('Mermaid error: ', err); // console.error('Mermaid error: ', err);
}; };
mermaid.initialize({ mermaid.initialize({
theme: 'forest', // theme: 'forest',
// themeVariables:{primaryColor: '#ff0000'}, // themeVariables:{primaryColor: '#ff0000'},
// arrowMarkerAbsolute: true, // arrowMarkerAbsolute: true,
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}', // themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',

25540
dist/mermaid.core.js vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/mermaid.core.js.map vendored Normal file

File diff suppressed because one or more lines are too long

73782
dist/mermaid.js vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/mermaid.js.map vendored Normal file

File diff suppressed because one or more lines are too long

32
dist/mermaid.min.js vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/mermaid.min.js.map vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -8,8 +8,8 @@
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<!-- <link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/vue.css"> --> <!-- <link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/vue.css"> -->
<link rel="stylesheet" href="theme.css"> <link rel="stylesheet" href="theme.css">
<!-- <script src="//cdn.jsdelivr.net/npm/mermaid@8.6.4/dist/mermaid.min.js"></script> --> <script src="//cdn.jsdelivr.net/npm/mermaid@8.6.4/dist/mermaid.min.js"></script>
<script src="http://localhost:9000/mermaid.js"></script> <!-- <script src="http://localhost:9000/mermaid.js"></script> -->
<script> <script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),

View File

@ -152,10 +152,9 @@ Variables derived from the ones above:
| name | Default value | Description | | name | Default value | Description |
**Here is an example of overriding `primaryColor` and giving everything a ifferent look, using `%%init%%`. **Here is an example of overriding `primaryColor` and giving everything a different look, using `%%init%%`.
``` ```
mermaid %%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#ff0000'}}}%%
%%{init: {'theme':'base', 'themeVariables': {primaryColor: '#ff0000'}}%%
graph TD graph TD
A[Christmas] -->|Get money| B(Go shopping) A[Christmas] -->|Get money| B(Go shopping)
B --> C{Let me think} B --> C{Let me think}
@ -171,6 +170,48 @@ mermaid
G G
end end
``` ```
Thsi got a bit to dark and bit to colorful. With some easy steps this can be fixed:
* Make the primary color a little lighter
* set the teriary color to a redish shade as well
* make the edge label background differ from the subgraph by setting the edgeLabelBackground
```
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#ffcccc', 'edgeLabelBackground':'#ffffee', 'tertiaryColor': '#fff0f0'}}}%%
graph TD
A[Christmas] -->|Get money| B(Go shopping)
B --> C{Let me think}
B --> G[/Another/]
C ==>|One| D[Laptop]
C -->|Two| E[iPhone]
C -->|Three| F[fa:fa-car Car]
subgraph section
C
D
E
F
G
end
```
```mermaid
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#ffcccc', 'edgeLabelBackground':'#ffffee', 'tertiaryColor': '#fff0f0'}}}%%
graph TD
A[Christmas] -->|Get money| B(Go shopping)
B --> C{Let me think}
B --> G[/Another/]
C ==>|One| D[Laptop]
C -->|Two| E[iPhone]
C -->|Three| F[fa:fa-car Car]
subgraph section
C
D
E
F
G
end
```
The Theming Engine does not admit color codes and will only accept proper color values. Color Names is not supported so for instance, the color value 'red' will not work, but '#ff0000' will work. The Theming Engine does not admit color codes and will only accept proper color values. Color Names is not supported so for instance, the color value 'red' will not work, but '#ff0000' will work.
# Common theming activities # Common theming activities

View File

@ -154,7 +154,7 @@ export const addDirective = directive => {
* *
**Notes : **Notes :
(default: current siteConfig ) (optional, default `getSiteConfig()`) (default: current siteConfig ) (optional, default `getSiteConfig()`)
* @param conf - the base currentConfig to reset to (default: current siteConfig ) * @param conf the base currentConfig to reset to (default: current siteConfig ) (optional, default `getSiteConfig()`)
*/ */
export const reset = () => { export const reset = () => {
// Replace current config with siteConfig // Replace current config with siteConfig