The list below describes recent changes and additions to JsDiagram:
Event emitter objects are now exposed as properties of Diagram and DiagramView, and you can register handlers by calling their addEventListener method:
JavaScript Copy Code |
---|
diagram.nodeCreated.addEventListener( (sender, args) => { if (sender.defaultShape.id == "Rectangle") args.node.anchorPattern = pattern1; else args.node.anchorPattern = pattern2; }); |
Legacy event handling syntax will remain supported for compatibility with old code.
Table rows can be assigned to distinct sections of the table. Each section can be collapsed or expanded, hiding or showing all rows in the section except the header one. To define a section, set the header property of a row. A section consists of all rows after a header row and spans to the next header. Each header row displays a [±] button that allows expanding or collapsing the section interactively. Clicking that button raises the tableSectionCollapsed and tableSectionExpanded events. Sections can be collapsed or expanded programmatically by setting the expanded property of their header rows.
To allow for stricter Content Security Policy rules, the library no longer loads CSS scripts automatically. If you use components from the Diagramming.Controls package, you must now explicitly link the common-ui.css file from distribution's themes folder.