mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +08:00
#989 Added font styling classes to diagrams lacking then
This commit is contained in:
parent
53bdfee057
commit
047ce2949a
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
@ -4,5 +4,5 @@
|
|||||||
"typescript.validate.enable": false,
|
"typescript.validate.enable": false,
|
||||||
"javascript.validate.enable": false,
|
"javascript.validate.enable": false,
|
||||||
"editor.formatOnSave": false,
|
"editor.formatOnSave": false,
|
||||||
"standard.enable": true
|
"editor.snippetSuggestions": "top"
|
||||||
}
|
}
|
||||||
|
@ -6,12 +6,6 @@ describe('Sequencediagram', () => {
|
|||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
`
|
`
|
||||||
gitGraph:
|
gitGraph:
|
||||||
options
|
|
||||||
{
|
|
||||||
"nodeSpacing": 150,
|
|
||||||
"nodeRadius": 10
|
|
||||||
}
|
|
||||||
end
|
|
||||||
commit
|
commit
|
||||||
branch newbranch
|
branch newbranch
|
||||||
checkout newbranch
|
checkout newbranch
|
||||||
@ -20,9 +14,8 @@ describe('Sequencediagram', () => {
|
|||||||
checkout master
|
checkout master
|
||||||
commit
|
commit
|
||||||
commit
|
commit
|
||||||
merge newbranch
|
merge newbranch`,
|
||||||
`,
|
{ logLevel: 0 }
|
||||||
{}
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
<script src="/e2e.js"></script>
|
<script src="/e2e.js"></script>
|
||||||
<link href="https://fonts.googleapis.com/css?family=Mansalva&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css?family=Mansalva&display=swap" rel="stylesheet">
|
||||||
<style>
|
<style>
|
||||||
.mermaid {
|
body {
|
||||||
/* font-family: 'Mansalva', cursive;
|
/* font-family: 'Mansalva', cursive;
|
||||||
font-family: 'Mansalva', cursive; */
|
font-family: 'Mansalva', cursive; */
|
||||||
/* font-family: 'trebuchet ms', verdana, arial; */
|
font-family: 'times';
|
||||||
}
|
}
|
||||||
/* .mermaid-main-font {
|
/* .mermaid-main-font {
|
||||||
font-family: "trebuchet ms", verdana, arial;
|
font-family: "trebuchet ms", verdana, arial;
|
||||||
|
@ -63,6 +63,10 @@ theme , the CSS style sheet
|
|||||||
"themeCSS": ".node rect { fill: red; }"
|
"themeCSS": ".node rect { fill: red; }"
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
## fontFamily
|
||||||
|
|
||||||
|
**fontFamily** The font to be used for the rendered diagrams. Default value is \\"trebuchet ms\\", verdana, arial;
|
||||||
|
|
||||||
## logLevel
|
## logLevel
|
||||||
|
|
||||||
This option decides the amount of logging to be used.
|
This option decides the amount of logging to be used.
|
||||||
|
@ -189,7 +189,7 @@ It is possible to specify a fork in the diagram using <<fork>> <&
|
|||||||
|
|
||||||
Sometimes nothing says it better then a postit note. That is also the case in state diagrams.
|
Sometimes nothing says it better then a postit note. That is also the case in state diagrams.
|
||||||
|
|
||||||
Here you canb choose to put the onte to the right or to the left of a node.
|
Here you can't choose to put the onte to the right or to the left of a node.
|
||||||
|
|
||||||
```
|
```
|
||||||
stateDiagram
|
stateDiagram
|
||||||
@ -216,6 +216,25 @@ Here you canb choose to put the onte to the right or to the left of a node.
|
|||||||
## Concurrency
|
## Concurrency
|
||||||
|
|
||||||
As in plantUml you can specify concurrency using the -- symbol.
|
As in plantUml you can specify concurrency using the -- symbol.
|
||||||
|
```
|
||||||
|
stateDiagram
|
||||||
|
[*] --> Active
|
||||||
|
|
||||||
|
state Active {
|
||||||
|
[*] --> NumLockOff
|
||||||
|
NumLockOff --> NumLockOn : EvNumLockPressed
|
||||||
|
NumLockOn --> NumLockOff : EvNumLockPressed
|
||||||
|
--
|
||||||
|
[*] --> CapsLockOff
|
||||||
|
CapsLockOff --> CapsLockOn : EvCapsLockPressed
|
||||||
|
CapsLockOn --> CapsLockOff : EvCapsLockPressed
|
||||||
|
--
|
||||||
|
[*] --> ScrollLockOff
|
||||||
|
ScrollLockOff --> ScrollLockOn : EvCapsLockPressed
|
||||||
|
ScrollLockOn --> ScrollLockOff : EvCapsLockPressed
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
```mermaid
|
```mermaid
|
||||||
stateDiagram
|
stateDiagram
|
||||||
|
@ -303,7 +303,7 @@ export const draw = function(txt, id, ver) {
|
|||||||
const parser = gitGraphParser.parser;
|
const parser = gitGraphParser.parser;
|
||||||
parser.yy = db;
|
parser.yy = db;
|
||||||
|
|
||||||
logger.debug('in gitgraph renderer', txt, id, ver);
|
logger.debug('in gitgraph renderer', txt + '\n', 'id:', id, ver);
|
||||||
// Parse the graph definition
|
// Parse the graph definition
|
||||||
parser.parse(txt + '\n');
|
parser.parse(txt + '\n');
|
||||||
|
|
||||||
|
@ -110,6 +110,7 @@ export const draw = (txt, id, ver) => {
|
|||||||
return 'translate(' + arcGenerator.centroid(d) + ')';
|
return 'translate(' + arcGenerator.centroid(d) + ')';
|
||||||
})
|
})
|
||||||
.style('text-anchor', 'middle')
|
.style('text-anchor', 'middle')
|
||||||
|
.attr('class', 'slice')
|
||||||
.style('font-size', 17);
|
.style('font-size', 17);
|
||||||
|
|
||||||
svg
|
svg
|
||||||
|
@ -95,6 +95,7 @@ const config = {
|
|||||||
*/
|
*/
|
||||||
theme: 'default',
|
theme: 'default',
|
||||||
themeCSS: undefined,
|
themeCSS: undefined,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* **fontFamily** The font to be used for the rendered diagrams. Default value is \"trebuchet ms\", verdana, arial;
|
* **fontFamily** The font to be used for the rendered diagrams. Default value is \"trebuchet ms\", verdana, arial;
|
||||||
*/
|
*/
|
||||||
|
@ -56,6 +56,10 @@
|
|||||||
stroke: $gridColor;
|
stroke: $gridColor;
|
||||||
opacity: 0.3;
|
opacity: 0.3;
|
||||||
shape-rendering: crispEdges;
|
shape-rendering: crispEdges;
|
||||||
|
text {
|
||||||
|
font-family: 'trebuchet ms', verdana, arial;
|
||||||
|
font-family: var(--mermaid-font-family);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.grid path {
|
.grid path {
|
||||||
|
@ -3,4 +3,6 @@
|
|||||||
.branch-label {
|
.branch-label {
|
||||||
fill: lightgrey;
|
fill: lightgrey;
|
||||||
color: lightgrey;
|
color: lightgrey;
|
||||||
|
font-family: 'trebuchet ms', verdana, arial;
|
||||||
|
font-family: var(--mermaid-font-family);
|
||||||
}
|
}
|
||||||
|
@ -2,4 +2,10 @@
|
|||||||
text-anchor: middle;
|
text-anchor: middle;
|
||||||
font-size: 25px;
|
font-size: 25px;
|
||||||
fill: $taskTextDarkColor;
|
fill: $taskTextDarkColor;
|
||||||
|
font-family: 'trebuchet ms', verdana, arial;
|
||||||
|
font-family: var(--mermaid-font-family);
|
||||||
|
}
|
||||||
|
.slice {
|
||||||
|
font-family: 'trebuchet ms', verdana, arial;
|
||||||
|
font-family: var(--mermaid-font-family);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user