MrBlenny / react-flow-chart

🌊 A flexible, stateless, declarative flow chart library for react.
https://mrblenny.github.io/react-flow-chart/index.html
MIT License
1.46k stars 307 forks source link

Read only for a single node #120

Closed ghost closed 4 years ago

ghost commented 4 years ago

I've searched on the Storybook demos but couldn't find an example for this: there's some way to disable a single node?

The reason: I'm creating a chart with a node that shouldn't be dragged or deleted, so I need it to behave like it's on read only mode.

MrBlenny commented 4 years ago

Not currently, you could try add some custom actions to achieve this (in a hacky way) but I agree it would be a nice feature. The Node.wrapper.tsx would need to be updated wherever it reads config.readonly. Unfortunately I don't currently have time to add this but would gladly accept a PR.

ielijose commented 4 years ago

Hi @guilhermeoholz,

I'm currently working on this feature.

ielijose commented 4 years ago

Hi @guilhermeoholz,

You can test it on: https://react-flow-chart.now.sh/?path=/story/other-config--node-read-only

ghost commented 4 years ago

Thank you @ielijose, that's pretty much what we've been looking for 😄