Commit Graph

5 Commits (41a3fbfd55119d04c79dbb714ee16d3de0db4abd)

Author SHA1 Message Date
Thomas Bouffard 20c31f9bc6
fix: define CellStyle.portConstraintRotation as boolean (#299)
It was incorrectly defined as DIRECTION after the migration from
mxGraph.

Also improve the type signature and JSDoc of
mathUtils.getPortConstraints which is the only function that uses the
`portConstraintRotation` property in maxGraph.
2024-01-10 07:56:55 +01:00
Thomas Bouffard 99ffdfa29b
feat: add `ModelXmlSerializer` to import/export the model (#290)
This class was previously only available in test. It simplifies maxGraph
model import/export as:
  - it hides `Codec` and `HTMLElement` management
  - it registers codecs automagically
2023-12-18 15:53:43 +01:00
Thomas Bouffard f9b2d7d19a
refactor!: move codecs to dedicated files and reduce side effects (#289)
Previously, codec classes were defined and registered in the same file
as the class they targeted. This prevented efficient tree-shaking: as
soon as the target class was imported (e.g. `StyleSheet`), the
corresponding codec was also imported (`StyleSheetCodec`). As a result,
a large amount of codec code (and dependent code) was present in
applications incorporating maxGraph, even if they didn't use the codec
function. As there are currently many problems with the codec function
that make it almost unusable, this was a great waste.

Codecs are no longer registered by default, which reduces side effects
and coupling.
It also greatly improves tree-shaking.
For example, in the `ts-example` application included in this repository
which doesn't use the "codec" feature, the size of the minified
`maxGraph` chunk goes from `568.58 kB` to `467.90 kB`, which corresponds
to a size reduction of `17.7%`!


BREAKING CHANGE: Codecs supplied by `maxGraph` are no longer registered
by default. They MUST be registered before performing an `encode` or
`decode`. You can use one of the following functions to register codecs:
  - `registerAllCodecs`
  - `registerCoreCodecs`
  - `registerEditorCodecs`
2023-12-13 17:39:40 +01:00
Thomas Bouffard d46e99a114
docs: improve the migration guide from mxGraph (#271)
Provide various improvements
  - fix `InternalEvent`
  - improve `Client`
  - improve explanations about plugins
  - removed `mxUtils` methods
  - removed `isVisible` methods

Also use more admonitions.
2023-12-04 00:57:50 +01:00
Thomas Bouffard 6e6009aebd
docs: build the user documentation with Docusaurus (#264)
Initiate the website with Docusaurus v3.
Setup the site and includes the content that was already available in
the `docs` package.
The currently implementation mainly uses the default theme available
when using the Docusaurus scaffolding. It was initiated with:
`npx create-docusaurus@3.0.0 my-website classic`
2023-11-27 18:53:52 +01:00