jerosoler / Drawflow

Simple flow library 🖥️🖱️
https://jerosoler.github.io/Drawflow/
MIT License
4.65k stars 722 forks source link

About node shapes #310

Closed mcesaro closed 2 years ago

mcesaro commented 2 years ago

Hi Jero, I'd like to include different node shapes in my flows. The ideal would be able to use a limited flow chart-like range (like circles or rhombus) but rectangular would be good, maybe using internally a row or grid layout. Can you please give us a quick rundown on the CSS hierarchy to use to achieve, if possible, this result?

Thank you, Massimo

jerosoler commented 2 years ago

Hi

View example of romb: https://github.com/jerosoler/Drawflow/issues/20#issuecomment-679976512

Jero

mcesaro commented 2 years ago

I see, actually I had something like this in mind: dfrect where the elements A and B and their input elements (text or select) are in the same row. I thought that changing the display: flex and flex-direction in the internal box class would be enough (I'm referring to the beautiful.css style;sheet in the demo), but they inherit from upper classes that makes the result quite messy. That's why I was wondering if there is a CSS way to customize the shape, at least in the content layout. Thank you for your support.

jerosoler commented 2 years ago

In the demo with beautiful.css

image

Modify in css

.drawflow-node .box {
display: flex;
}

And the result

image

You can also directly modify the source css, which is just this: https://github.com/jerosoler/Drawflow/blob/master/src/drawflow.css

mcesaro commented 2 years ago

Thank you!