mermaid icon indicating copy to clipboard operation
mermaid copied to clipboard

Would a 'stack diagram' be of interest?

Open cmorganBE opened this issue 2 years ago • 15 comments

I often have a need to create stack diagrams, example below.

Would there be any interest in accepting a pull request that creates these kinds of diagrams? I think it wouldn't be too bad to capture the technique I use to create them and implement it in code, but wanted to confirm interest before starting on the effort.

image

cmorganBE avatar Aug 09 '22 12:08 cmorganBE

Yes it would! 👍

knsv avatar Aug 14 '22 14:08 knsv

Definitely :+1:

ileixe avatar Nov 11 '22 02:11 ileixe

I'll have some time off around the holidays and will dig in then, so if someone has the work planned before then please reach out ([email protected]), or give me until end of year :-)

cmorganBE avatar Nov 11 '22 14:11 cmorganBE

I would find this useful.

brian-methodical avatar Nov 20 '22 21:11 brian-methodical

Is this implemented and merged? It is very useful for my needs.

eliaskanelis avatar Sep 09 '23 11:09 eliaskanelis

@eliaskanelis wow, august 2022, time flies... I'd like to take a crack at this during the next break I have, likely during a holiday but I'd also gladly use it if someone else puts it together earlier :-)

cmorganBE avatar Sep 10 '23 00:09 cmorganBE

My expertise is C and C++ as I am an embedded engineer. I know some JavaScript, but at a hobby level. I have some spare time to help, but I am limited to my lack of expertise on web development. Could I help somehow?

eliaskanelis avatar Sep 10 '23 08:09 eliaskanelis

The first step would be to decide on a syntax that we can use. @knsv is this similar to the block diagram that you are working on?

sidharthv96 avatar Sep 16 '23 10:09 sidharthv96

I have done some brainstorming with a few people from work, and we came to this draft:

stack:
  style: {fill: black,4pt,...}
  layer:
    block:
      style: {fill: black,4pt,...} # Inherited if not assigned from parent
      [App1]->[RTOS]
    block:
      [App2]->[RTOS]
    block:
      ["Bare metal app"]->[RTOS, Microcontroller]
  layer:
    block:
      [RTOS]->[HAL]
  layer:
    block:
      [HAL]->[SPI, I2C, UART, Microcontroller]
  layer:
    block:
      [SPI]->[Microcontroller]
    block:
      [I2C]->[Microcontroller]
    block:
      [UART]->[Microcontroller]
  layer:
    block:
      [Microcontroller]

The mermaid syntax draft tries to describe the following.

stack drawio

I hope this helps. I might not know JS to aid in coding, but I can help in other areas.

As a first draft, I see layers and blocks. After that, we could introduce stackable stacks... Or it might become too complicated? I have no experience with the mermaid code.

eliaskanelis avatar Sep 21 '23 13:09 eliaskanelis

@cmorganBE the shared sample looks very similar to the packet-diagram that I've been building here image


@eliaskanelis, your example looks interesting. Are the vertical stacks taken from some reference images? Can you share some sources to get some more examples?

sidharthv96 avatar Sep 21 '23 17:09 sidharthv96

@sidharthv96 yes sure! It is called layered architecture. I found some more pictures from the web.

In the automotive domain, there is something called AutoSar.

image image It would be cool if mermaid could be used to draw these diagrams.

Other random photos

Photo 1 Photo 2 Photo 3

eliaskanelis avatar Sep 21 '23 18:09 eliaskanelis

Strong :+1:

I seriously need this kind of diagrams.

pandres95 avatar Dec 11 '23 03:12 pandres95

Seems interesting ... any news ?

PHHENS avatar Jan 27 '24 19:01 PHHENS