|
Version 0.25.2 released on 2026-11-20.
โก This new version fixes several edge style behaviors that diverged from mxGraph, improving the rendering of diagrams imported from mxGraph and draw.io. โก
This release contains no breaking change, but it fixes 4 behaviors that diverged from mxGraph or from the documented one. Code relying on the previous behavior may need to be adapted: each change is described below, with the way to keep the previous behavior when there is one.
Highlights
Behavior change: entryPerimeter and exitPerimeter default to true again
The entryPerimeter and exitPerimeter style properties now default to true instead of false. This restores the mxGraph default, which the JSDoc of CellStateStyle already documented: the default had been lost during the TypeScript conversion.
The default only applies when a fixed connection point is set, that is when both entryX and entryY (respectively exitX and exitY) are defined. In that case, the connection point is now projected onto the perimeter of the terminal, as in mxGraph, instead of being placed at the exact relative position inside the shape. Edges created interactively are not affected, since setConnectionConstraint always writes an explicit value.
Diagrams imported from mxGraph or draw.io are the main beneficiaries. These tools only write entryPerimeter=0 or exitPerimeter=0 when the perimeter is disabled and rely on the default otherwise, so their edges using fixed connection points were rendered differently by maxGraph.
To keep the previous maxGraph behavior, set the properties to false explicitly in the edge style:
graph.insertEdge({
source,
target,
style: { entryX: 0, entryY: 0.5, entryPerimeter: false, exitX: 1, exitY: 0.5, exitPerimeter: false },
});
For more details, see #1160.
Behavior change: setCellStyles removes the keys set to null
setCellStyles (from styleUtils), and the AbstractGraph.setCellStyles method relying on it, now remove the key from the cell style when the value is null or undefined, as documented and as mxGraph did. Previously, the key was kept in the style with a null value.
This fixes the route of an edge after reconnecting one of its terminals: reconnecting clears the previous connection constraint by setting entryX/entryY or exitX/exitY to null, and the null values were read as the relative point (0, 0). So the edge ended at the top-left corner of the terminal, and its orthogonal route differed from the one shown during the preview (see #1087).
As a consequence, setting a style property to null with this method now makes the cell fall back to the value of the stylesheet, as in mxGraph, whereas the null value previously overrode it. Code inspecting cell.style directly also sees the difference. For instance, an edge inserted with insertEdge no longer carries sourcePort: null and targetPort: null in its style.
graph.setCellStyles('fillColor', null, [vertex]);
// before: vertex.style.fillColor === null, overriding the stylesheet
// now: 'fillColor' is no longer a key of vertex.style, the stylesheet value applies
For more details, see #1310.
Behavior change: GraphLayout stores booleans in the edge styles
GraphLayout.setEdgeStyleEnabled and GraphLayout.setOrthogonalEdge now store a boolean in the noEdgeStyle and orthogonal styles, and their value parameter is typed as boolean instead of any.
They previously stored the strings '0' and '1', as mxGraph did. But mxGraph parsed them back into numbers, while maxGraph reads them as they are, and both strings are truthy. So setEdgeStyleEnabled(edge, true) disabled the edge style, and setOrthogonalEdge(edge, false) made the edge orthogonal. The layouts of maxGraph only call these methods with the values that happened to work. Code calling them directly with the other values, or reading these styles in cell.style, sees the difference.
For more details, see #1311.
Behavior change for TypeScript users: type-safe value in setCellStyles
The value parameter of setCellStyles (from styleUtils) and of AbstractGraph.setCellStyles must now match the type of the given key in CellStateStyle, or be null or undefined. It was previously typed as any (respectively as the union of every style value), so any value could be passed for any key.
A call passing another type no longer compiles. Such calls were already wrong at runtime, since maxGraph reads these properties with their declared type, so fix the value rather than casting it. The stricter type revealed the GraphLayout bug described above.
// before: compiled, but the string '1' was not read as the expected boolean
graph.setCellStyles('orthogonal', '1', [edge]);
// now: the value must be a boolean, as declared in CellStateStyle
graph.setCellStyles('orthogonal', true, [edge]);
For more details, see #1028.
Bundle size: stable
The sizes of the examples are stable in both repositories: no example changes by more than 0.05 kB.
In the maxGraph repository, the only toolchain change is the upgrade of webpack from 5.111.1 to 5.112.2, which only builds the js-example* examples. Its pull request measured no size change (#1290).
In the maxgraph-integration-examples repository, the tooling did not change since the previous release.
Note
- What each example contains: see the examples of the maxGraph repository and the projects of the maxgraph-integration-examples repository.
- In the
maxGraph repository, the js-example* examples are built with webpack and the size is the one of the whole application. The ts-example* examples are built with Vite and the size is the one of the maxGraph chunk only, which doesn't include the rest of the application.
- In the
maxgraph-integration-examples repository, the size is the one of the whole application, whatever the bundler.
- The bundlers used in these examples are not tuned, they are mainly using the default configuration. So, it is probably possible to improve the tree-shaking efficiency in these examples.
Examples in the maxGraph repository
| Example |
0.25.1 |
0.25.2 |
| js-example |
464.01 kB |
464.04 kB |
| js-example-selected-features |
382.39 kB |
382.37 kB |
| js-example-without-defaults |
237.84 kB |
237.83 kB |
| ts-example |
426.19 kB |
426.19 kB |
| ts-example-selected-features |
359.16 kB |
359.17 kB |
| ts-example-without-defaults |
219.80 kB |
219.77 kB |
Projects in the maxgraph-integration-examples repository
| Example |
0.25.1 |
0.25.2 |
| farm-ts |
399.38 kB |
399.39 kB |
| lit-ts |
376.81 kB |
376.83 kB |
| parcel-ts |
502.48 kB |
502.53 kB |
| rollup-ts |
364.81 kB |
364.83 kB |
| rsbuild-ts |
344.86 kB |
344.84 kB |
| vitejs-ts |
361.03 kB |
361.04 kB |
Resources
What's Changed
๐ Bug Fixes
๐ Documentation
โ๏ธ Refactor
๐ Chore
Full Changelog: v0.25.1...v0.25.2
This discussion was created from the release 0.25.2.
|