Code Monkey home page Code Monkey logo

Comments (16)

Mercurius3 avatar Mercurius3 commented on May 4, 2024 2

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.

mermaiddottedline

from mermaid.

knsv avatar knsv commented on May 4, 2024

I like the idea and I like the syntax!

from mermaid.

your-a-git avatar your-a-git commented on May 4, 2024

What is the intent for this content? sounds like fun :)

from mermaid.

Anachron avatar Anachron commented on May 4, 2024

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.

cerdman avatar cerdman commented on May 4, 2024

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.

knsv avatar knsv commented on May 4, 2024

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.

peacemaker1995 avatar peacemaker1995 commented on May 4, 2024

Hey I'm new here

from mermaid.

knsv avatar knsv commented on May 4, 2024

Hello @peacemaker1995 welcome.

from mermaid.

cerdman avatar cerdman commented on May 4, 2024

@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.

knsv avatar knsv commented on May 4, 2024

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.

knsv avatar knsv commented on May 4, 2024

@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.

knsv avatar knsv commented on May 4, 2024

Will look at this now

from mermaid.

knsv avatar knsv commented on May 4, 2024

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.

cerdman avatar cerdman commented on May 4, 2024

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.

knsv avatar knsv commented on May 4, 2024

Fixed with release 0.3.2

from mermaid.

Anachron avatar Anachron commented on May 4, 2024

Awesome, thanks! @knsv

from mermaid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.