mermaid-js / mermaid

Generation of diagrams like flowcharts or sequence diagrams from text in a similar manner as markdown
https://mermaid.js.org
MIT License
70.56k stars 6.31k forks source link

Proposal : SFC - Sequential Function Charts #4520

Open calumk opened 1 year ago

calumk commented 1 year ago

Proposal

Add diagram for SFC

Similar to fowchart, but with transition steps, and actions to the right of each node.

https://en.wikipedia.org/wiki/Sequential_function_chart

https://realpars.com/sequential-function-chart/

Use Cases

Describing state / process information for machines or software packages

Mainly used in industrial applications for PLC programming or similar

Screenshots

idea_SFC drawio

Syntax

SFC
    0:Start [S Ouptut 1, R Output 2]
    0 -- | Input1 == true && Input 2 == true | --> 10
    10 [ SET StartLight, SET RedLight ]
    10 --> 20
    20 [S YellowLight, N PinkLight, S OrangeLight 2hz]
    20 -- | Delay 1s | --> 30
    30 [R YellowLight]
    30 -- | keySwitch == true | --> 100
    30 -- | keySwitch != true | --> 200
    100 [ S RedLight]
    200 [ S GreenLight]
    100 --> 300
    200 --> 300
    300:End --> 0

Implementation

This is a proposal which I'd love to see built into mermaid by the wonderful community.

nirname commented 1 year ago

Should not it be an extension for one of current diagrams?

calumk commented 1 year ago

I am afraid i dont know enough about the mermaid system to know how this would best be implemented.