You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can now center and fit your graph into the container with the new FitPlugin.
The method is inspired by the former example provided in the JSDoc of Graph.fit() but improved to:
handle margins better,
reduce visual shifts when called multiple times.
The storybook and TypeScript example have been updated to showcase how it works in various contexts.
Thanks to the new i18n configuration, tree-shaking now works better.
Depending on your setup, you could reduce the size of your app by 5-10kB - and probably more with tuned bundler configs!
Tip
Examples use default bundler configs and still show measurable gains.
π¬ Examples in the maxGraph repo
Example
0.16.0
0.17.0
js-example
484.1 kB
475.71 kB
js-example-without-defaults
462.4 kB
452.13 kB
ts-example
444.4 kB
439.15 kB
ts-example-without-defaults
440.4 kB
435.12 kB
π See documentation for what each example includes.
π¬ Examples in maxgraph-integration-examples
All integration projects reuse a shared core similar to ts-example. Here's the app size:
Example
0.16.0
0.17.0
farm
461.0 kB
453.9 kB
lit with vite
471.7 kB
466.5 kB
parcel[1]
521.2 KB
528.1 kB
rollup
443.7 kB
438.3 kB
rsbuild
429.4 kB
417.3 kB
vite
447.5 kB
442.2 kB
[1] parcel is the sole bundler that increases the size of the application. Parcel was bump from 2.13.3 to 2.14.4 which may have introduced changes.
β° New story: curved edges
We've added a story to show the difference between:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
β‘ This new version improves graph fitting, makes i18n fully configurable, and reduces bundle size significantly. β‘
Resources
Breaking changes
Important
These changes may impact existing usages. Please review them carefully and check the related pull requests for migration guidance.
π Eval usage is now disabled by default
To prevent potential security issues,
StylesheetCodec.allowEvalis nowfalseby default.Note
See #736 for details.
π Configurable i18n
The built-in
Translationsclass is no longer used by default. If you want to keep using it, you must now explicitly enable it:Note
See #737
π§° Utility functions access changes
Several utils have been reorganized for better clarity and maintainability:
get,getAll,load,post,submitβrequestUtilserror,popupβguiUtilsutilsnamespace has been removed.guiUtils.Note
See #740
π₯ Removed internal functions
Some functions that were mistakenly exposed as public have been removed:
Utils.copyTextToClipboardis no longer available.cellArrayUtils.filterCellswas removed - just use the nativeArray.filter()instead!Highlights
π― New: Fit Center
You can now center and fit your graph into the container with the new
FitPlugin.The method is inspired by the former example provided in the JSDoc of
Graph.fit()but improved to:The storybook and TypeScript example have been updated to showcase how it works in various contexts.
PR_733_story_fit_center.mp4
Note
See #733
π Configurable i18n support
Until now, the
Translationsclass was always used internally. Now you can:This makes maxGraph more flexible and lighter by default.
Note
See #737
π¦ Smaller bundle size
Thanks to the new i18n configuration, tree-shaking now works better.
Depending on your setup, you could reduce the size of your app by 5-10kB - and probably more with tuned bundler configs!
Tip
Examples use default bundler configs and still show measurable gains.
π¬ Examples in the
maxGraphrepoπ See documentation for what each example includes.
π¬ Examples in
maxgraph-integration-examplesAll integration projects reuse a shared core similar to
ts-example. Here's the app size:[1] parcel is the sole bundler that increases the size of the application. Parcel was bump from 2.13.3 to 2.14.4 which may have introduced changes.
β° New story: curved edges
We've added a story to show the difference between:
PR_731_story_edges_curved_and_rounded.mp4
Note
See #731
What's Changed
π New Features
CellStateStyle.elbowby @tbouffard in feat: refine the type ofCellStateStyle.elbowΒ #701FitPluginby @tbouffard in feat: let "fit center" with the newFitPluginΒ #733evalfunction by @tbouffard in feat!: limit usage of theevalfunctionΒ #736π Bug Fixes
ManhattanConnectoras orthogonal by @tbouffard in fix: considerManhattanConnectoras orthogonalΒ #707Graph.optionstruly per-instance by @tbouffard in fix: makeGraph.optionstruly per-instanceΒ #751π Documentation
styleUtilsby @tbouffard in docs: improve JSDoc ofstyleUtilsΒ #727allowEvalproperties by @tbouffard in docs: improve JSDoc ofallowEvalpropertiesΒ #729βοΈ Refactor
CellStateStyle.curvedby @tbouffard in refactor: improve the management ofCellStateStyle.curvedΒ #731isNotNullishinternal function by @tbouffard in refactor: removeisNotNullishinternal functionΒ #732utilstoguiUtilsby @tbouffard in refactor!: move properties ofutilstoguiUtilsΒ #741Graphtypes by @tbouffard in refactor(types): simplify imports of theGraphtypesΒ #743cellArrayUtils.filterCellsby @tbouffard in refactor!: removecellArrayUtils.filterCellsΒ #752π Chore
ts-supportby @tbouffard in chore: add more checks ints-supportΒ #728Full Changelog: v0.16.0...v0.17.0
This discussion was created from the release 0.17.0.
Beta Was this translation helpful? Give feedback.
All reactions