Open phwt opened 3 years ago
Found this explaining model and widget still not sure about the factory (does this related to factory design pattern?)
(I used method names from v6, may differ from v5, but the general idea is the same basically)
As far as I understand, the factory is registered on react-diagrams
, so that the library knows how to instantiate the corresponding model and widget when deserializing based on its type
. This happens when you call model.deserializeModel
, for example. Something along those lines:
react-diagrams
is required to deserialize (load) a diagram containing one entity whose type is set to 'diamond'
(this happens .react-diagrams
searches for a factory registered for type 'diamond'
react-diagrams
finds one, it will use it to instantiate the corresponding model (via factory.generateModel
method) and the corresponding React component (via factory.generateReactWidget
method).
Hi, I'm using Storm React Diagrams V5 but can't find any documentation of it. The (SOME) DOCS in
v5.3.2
branch also leads to docs for V6Does to V5 have the documentation? Especially for create a custom elements I have a hard time understanding what is the model, widget and factory used for.