React-diagrams: Recommanded way of styling nodes and links in version 6?

Created on 21 Nov 2019  路  5Comments  路  Source: projectstorm/react-diagrams

For our project we updated the library to version 6 and currently we can see css classes seem to be generated, as I think styled components are used under the hood.

Previously we could directly target nodes, links, ports, and apply styles using SCSS.

answered question

Most helpful comment

@alexandrudanpop

I understand, I'll try to open a PR for it as soon as I have some time, thank you :)

All 5 comments

@alexandrudanpop
you can create your own components having basically any style you want.
Check the custom node demo:

http://projectstorm.cloud/react-diagrams/?path=/story/custom-models--custom-diamond-node

Ok, that's cool, but I would like to know how I can customize the existig ones as for my current scenario they are enough they just need some simple style tweeks: padding, margin, border, shadow, etc.

Would like something like: new DefaultNodeModel({ className: "myCustomNode" }).

Or have default class names for the out of the box library components so I can style them. Think having to write custom code for this would be overkill.

My suggestions could also lower the barrier to entry for other people that could potentially use this library.

Ok, that's cool, but I would like to know how I can customize the existig ones as for my current scenario they are enough they just need some simple style tweeks: padding, margin, border, shadow, etc.

Would like something like: new DefaultNodeModel({ className: "myCustomNode" }).

Or have default class names for the out of the box library components so I can style them. Think having to write custom code for this would be overkill.

My suggestions could also lower the barrier to entry for other people that could potentially use this library.

the demo gallery contains everything you need including the basic CSS used to display the nodes

Thanks for your answer @antonioru. I will definitely check the demos in more detail.
Still we could have some docs for this library specifically for how styling should be done.

If anyone with more knowledge can address this and add a PR it would be great.

@alexandrudanpop

I understand, I'll try to open a PR for it as soon as I have some time, thank you :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Naveenraj006 picture Naveenraj006  路  3Comments

ganesh-sankey picture ganesh-sankey  路  4Comments

M2Costa picture M2Costa  路  3Comments

msaglietto picture msaglietto  路  3Comments

shortwavedave picture shortwavedave  路  3Comments