Comments (16)
In order to create dotted lines, you can try this:
linkStyle 0 stroke:#000,fill:none,stroke-width:2px,stroke-dasharray:3;
This turns the first link into a dotted line (it targets links using linkStyle: counting starts from 0): I have not been able to attach a class to a linkStyle yet.
from mermaid.
I like the idea and I like the syntax!
from mermaid.
What is the intent for this content? sounds like fun :)
from mermaid.
For example a class hirarchy which shows abstract classes which inherit from their "real" parents.
Or a Workflow where one path is temporary unused. (Business logic could be changing or defect)
How about a organisation diagram which shows temporary workers as weak links?
There are so many use cases.
from mermaid.
I've got a proposed solution for this. Funny thing is I figured out how to add the requisite lexer/linkStatement definitions, get passing tests for A-.->B
, A-.-B
, A-.-xB
etc.
For the life of me, I cannot figure out how to add the stroke-dasharray
property to the <path>
in <edgePath
... It has to be a property, can't do it using style alone (according to w3 schools svg stroke).
If you can let me know where to put that in main.js
or in sequenceRenderer.js
functions like setClass
etc. I will submit a PR for review.
from mermaid.
look in main.js in the addEdges function (row 110+). There some styles are applied. Perhaps you could apply the styles for the dotted line there.
Good luck.
from mermaid.
Hey I'm new here
from mermaid.
Hello @peacemaker1995 welcome.
from mermaid.
@knsv - I tried that one actually - the issue is that it needs to have the the property stroke-dasharray
- added (not modify the property style
or class
) so I think this requires something with the d3dagre
methods - I just am not sure how or where to implement.
from mermaid.
Thats a good point. You can create dotted lines today by using code like the one provided by @Mercurius3. The dot notation would be a shortcut. simpler notation for a similar rendering.
@Anachron, you could apply styling as the one above when rendering the dotted links found during parsing.
from mermaid.
@cerdman How are things progressing? Still stuck? If you want I could fix the style if you commit the grammar update. If you want to continue that is fine too!
from mermaid.
Will look at this now
from mermaid.
An implementation for this is in place and will be included in next release. The solution uses the following syntax:
dotted link:
-.->
dotted link with text:
-. text .->
thick link:
==>
think link with text:
== text ==>
from mermaid.
hey @knsv - yep sorry just saw this - that is as far as I got (grammar/syntax) and was pretty much the same - how did you get the style figured out?
from mermaid.
Fixed with release 0.3.2
from mermaid.
Awesome, thanks! @knsv
from mermaid.
Related Issues (20)
- Add positioning for elk layout renderer. This can enable Horizontal Order and Vertical Order
- Add `switch` as alias of `checkout` to gitGraph Syntax
- Block diagram group title should be rendered above of inner blocks HOT 1
- vdots hline array{c|c} (vertical lines) do not render HOT 2
- Add support for mermaidOptions in mermaid.render HOT 1
- click action for subgraphs
- Tooltips for emoji in Diagram Syntax doc tree
- Math is occasionally rendered incorrectly (e.g., fraction inside sqrt)
- log scale for `xychart-beta`
- Unable to Style Sequence Diagram Title
- SVG rendering formatting issues with markdown input
- [BUG] Using `constructor` as node ID results in errors HOT 1
- Vite build error with mermaid version 10.9.0
- Syntax error in text mermaid version 10.9.0
- Support a dialogue diagram HOT 1
- Class diagram: static abstract method does not work HOT 1
- adding Markdown to SequenceDiagram Notes
- sankey with showValues enabled results in unnecessary crossing of lines
- Please modify the mindmap style. HOT 2
- Allow user to disable setting of certain CSS styles
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mermaid.