We have released version 4.2.2 of MindFusion JavaScript Diagram library. It contains the following new features and improvements:
React functional componentsThe @mindfusion/diagramming-react package now contains functional-component wrappers for the DiagramView and auxiliary controls, and has been upgraded to React 18. Old class-component wrappers have been moved to the @mindfusion/diagramming-react-cc package.
Using the functional components looks like this:
JSX Copy Code
const [diagram] = useState(new Diagramming.Diagram());
...
<DiagramView diagram={diagram} {...props}
onDiagramChanged={(diagram, args) => onDiagramChanged(diagram, args)}
onNodeCreated={(diagram, args) => onDiagramNodeCreated(diagram, args)} />
The DiagramView control exposes a forwardRef, that can be passed on to other controls, such as the Overview and ZoomControl. To obtain a reference to the underlying core controls, use the respective find method of the ref.
Bug fixes- Fix for NodeListView not working correctly when hosted nodes contain NodeLabel objects.
- Fixed exception in dispose method of Overview control if called before the overview is attached to the diagram.
Distribution for the latest version can be downloaded here, or from the
clients area on our site:
https://mindfusion.eu/JsDiagramTrial.zipUpdated scripts are also available as
@mindfusion/diagramming NPM package.
Enjoy!