NMRium component props
Currently we have only one prop in NMRium: data and it allows only to change the data part of the state.
The state contains in reality 3 props (that can be reloaded from a .nmrium file):
- data
- settings
- view
I would like to be able to change those props from outside the component. I see 3 possibilities:
-
Keep the
dataNMRium props but send an object {data: {}, view: {}, settings: {}} -
Rename this property to
state(or something else) and send as object {data: {}, view: {}, settings: {}} -
Have 3 properties:
data,viewandsettings
For information there is only one callback onChange.
@targos What would you suggest ?
I suggest 3.
I think the options number 1 or 2, I can not see the advantage of separating them into three properties
I recommend the solution 2.
nmr-load-save (discontinued), and nmrium-core / nmrium-core-plugins manage NmriumState.
It would be more simple to put the state as is, instead having to spread it, or forgot props.