Commit Graph

223 Commits (development)

Author SHA1 Message Date
Thomas Bouffard 27f75a59f3
docs: set the minimum TypeScript requirement to 3.8 (#128)
We use a recent TypeScript version to build maxGraph but applications
that integrates it may be forced to use old TypeScript versions.
We never explain what is the minimum TypeScript version requires to use
`maxGraph`. The changes proposed here are a first step to make this
information available.
It is only informative for now (mentioned in the README) and the minimum
TypeScript version is tested in the `ts-support` package (part of the
'build' GitHub workflow).
2022-11-07 18:31:40 +01:00
Anatoliy Mayorov 2ad1395aab refactor: run eslint and prettier on codebase 2022-10-29 22:53:09 +03:00
Анатолий Майоров 9428ba2a4a
fix: DynamicLoading story, Codec and parseXml (#125)
Fix `DynamicLoading` story
Restored backward compatibility when using `parseXml`
Possible fix for `Codec.decode` method issue
2022-10-28 15:37:02 +02:00
Anatoliy Mayorov d53ea1ad2b chore(tsconfig): move baseUrl to base tsconfig 2022-10-23 11:56:07 +03:00
Anatoliy Mayorov 7e5360ad97 chore(tsconfig): add base tsconfig.json 2022-10-23 10:33:45 +03:00
Thomas Bouffard ef76a1db87
Merge branch 'development' into development 2022-10-22 10:41:32 +02:00
Thomas Bouffard 5b1369b019
Merge pull request #119 from mayorovad/edge-mixin-typo
Fix wrong method signature in EdgeMixin (resetEdgesOnMove).
2022-10-10 07:22:42 +02:00
Thomas Bouffard f08b041c3d
Merge pull request #121 from mayorovad/overlays-stories-fix
Fix stories with overlays usage
2022-10-10 07:14:30 +02:00
Thomas Bouffard 4622527af8
Merge pull request #124 from mayorovad/issue-96 2022-10-09 22:32:39 +02:00
Thomas Bouffard a617bb644a
Merge pull request #113 from mayorovad/visibility-story-fix
Fixed `Visibility` story
2022-10-09 20:05:57 +02:00
Thomas Bouffard 4804767baf
Merge pull request #117 from mayorovad/guides-fix
Fixed `Guides` story.
2022-10-09 20:05:29 +02:00
Thomas Bouffard 57a8d63ff3
Merge pull request #108 from maxGraph/svgcanvas
Fixes null checks in SvgCanvas2D.
2022-10-09 19:39:49 +02:00
Thomas Bouffard c4f537203b Move layout types to a dedicated types file
These types are only used in the layout classes, so keep them located closed in the folder where they are used.
2022-10-09 19:08:12 +02:00
Thomas Bouffard 7c4b1111ee Apply prettier rules on layout types 2022-10-09 19:02:24 +02:00
Thomas Bouffard b16fa54411
Merge branch 'development' into development 2022-10-09 18:31:25 +02:00
Thomas Bouffard d0a01c2d44
Merge branch 'development' into edge-mixin-typo 2022-10-09 18:30:35 +02:00
Anatoliy Mayorov 1603729a9b fix: types of Hierarchical and Swimlane Layout #96 2022-10-08 21:43:35 +03:00
Anatoliy Mayorov deda3ec03f Fix absolute import path to relative (PR #109) 2022-10-06 16:38:08 +03:00
Anatoliy Mayorov eee2fc8509 Fix stories with overlays usage 2022-10-06 10:58:33 +03:00
Anatoliy Mayorov 572af8c459 Fix edge segment handles not being rendered
Combination of side-effects when porting broke
edge segment handles rendering, fixed some of them
2022-10-05 18:43:29 +03:00
Anatoliy Mayorov 19273293a1 Fixed typo in typings of EdgeMixin 2022-10-05 16:50:46 +03:00
mayorovad 38117aefb2 Fixed Guides story 2022-10-04 11:47:03 +03:00
mayorovad 699fbc9590 Fixed Visibility story 2022-10-03 11:07:39 +03:00
mayorovad f84a4a5836 Changed the type of cells map in GraphDataModel 2022-09-26 11:54:20 +03:00
Anatoliy Mayorov b62eb538f7 deps: bump typescript to 4.8.3, fix Dictionary typings
When running `generate-types` script in core package
there is typescript error TS2345 in src/util/Dictionary.ts,
added changes to fix it.

- Moved types IdentityObject and IdentityFunction to types.ts
- Renamed const FIELD_NAME to IDENTITY_FIELD_NAME and
moved it to util/Constants.ts
- Set Cell and CellOverlay to implement IdentityObject
2022-09-24 14:20:53 +03:00
Thomas Bouffard b7cfeebd23 ts-example: restore the rounded shape in the custom rectangle 2022-09-24 11:16:26 +02:00
Thomas Bouffard 8c29223b98 Remove remaining commented method signatures including types (dated from the JS to TS migration) 2022-09-24 11:10:04 +02:00
Junsik Shim e986c8ea31 Fixes null checks in SvgCanvas2D #107 2022-09-24 10:58:41 +09:00
Junsik Shim 0a1e797bbc Remove CellArray leftovers. 2022-09-17 19:33:16 +09:00
Junsik Shim ec7a525ea0 Change CellArray to cellArrayUtils. 2022-09-17 18:58:30 +09:00
Junsik Shim 722021006d Fix CellArray related warnings. #96 2022-09-17 18:57:00 +09:00
Thomas Bouffard ea836a1fb5
chore: improve vite config in ts-example (#104)
bump vite from 2.9.12 to 3.1.0
add vite config to generate a dedicated chunk for maxgraph@core. It lets know the size the produced bundle in an
external application and if tree shaking works.
2022-09-14 13:15:04 +02:00
Thomas Bouffard f9d757548e
doc: update copyright and license in source file headers (#100)
Ensure that all source files contain the Apache-2.0 license and that the 'maxGraph Contributors' are mentioned.
2022-08-30 17:36:33 +02:00
Thomas Bouffard 311514dca3
refactor: clean the Client class (#94)
Remove unused static properties
  - mxForceIncludes: it was used to force loading the JavaScript files in development mode in mxGraph. We are not managing development mode in that way anymore.
  - mxLoadResource: not used anymore
  - mxLoadStylesheets: not used anymore
  - mxResourceExtension: it was only used in Translations, so only keep the Translations settings

Move and rename the link function. It is not a general function, so move it as `domUtils#addLinkToHead`

Fix documentation of static properties
2022-07-16 07:15:04 +02:00
Thomas Bouffard 893ad44ff2
chore: improve the configuration to build the npm package (#87)
Root and all package.json files
  - Fix license, version and authors
  - Remove the non-relevant .npmignore file at the project. It was designed for mxgraph, the whole directory structure
  changed, and we don't plan to publish the root package

`core` package
  - Generate type definition and javascript files for ESM output
    - dedicated folder for `esm` and `types` in the `dist` folder to clearly separate concerns
    - exported in the package.json
  - Add npm script for `npm pack` configuration
  - Drop the `postinstall` npm script that built the `core` bundle. It would have been run when the package is installed
  in dependent projects at dependencies install. And it would have failed as it tries to build the project from TypeScript
  sources that are not available in the npm package.

fix: ConstraintHandler now loads image as everywhere else in the code using `Client.imageBasePath`
Using import doesn't work as the image is not available in the npm package. It generated error like this in ViteJS
project:
Failed to resolve import "../../../images/point.gif" from "../core/dist/esm/view/handler/ConstraintHandler.js". Does the file exist?
This gif import had been introduced to make `Anchors.stories.js` retrieve the gif file. Configuring `imageBasePath` as
already done in other stories fixes the issue.

Don't export EditorCodec and StylesheetCodec as they generate errors.
This is a temporary solution to avoid error in dependent project (at least, with ViteJS projects).
2022-07-05 08:08:25 +02:00
Junsik Shim 3991e7ab1e
Merge pull request #82 from maxGraph/cellstyle
Changed the type of cell style from string to CellStyle.
2022-05-20 09:38:08 +09:00
Thomas Bouffard 760cbd3f05
chore: clean tsconfig.json (#86)
Remove `allowJs` (the whole code is now migrated to TypeScript) and `jsx` (we are not using it).
Don't `skipLibCheck` for stronger type checks.
2022-05-17 12:24:48 +02:00
Junsik Shim 8f80956d0e Changed baseStyleName to baseStyleNames. 2022-05-08 18:18:53 +09:00
Junsik Shim 91d9c13286 Changed baseStyleName to baseStyleNames. 2022-05-08 18:05:22 +09:00
Junsik Shim a284987daf Updated comments. 2022-04-28 20:42:12 +09:00
Junsik Shim 07565aae9b Changed the type of cell style from string to CellStyle. 2022-04-17 20:49:09 +09:00
Junsik Shim b51504d7bb Changed the type of cell style from string to CellStyle. 2022-04-17 15:58:35 +09:00
Junsik Shim 0340b72c10 Changed the type of cell style from string to CellStyle. 2022-04-14 14:23:37 +09:00
Thomas Bouffard 443ebf7a52
chore: GitHub workflow generates TypeScript declarations (#80)
This ensures we don't have type errors in the code.

Update tsconfig to only include source TS files.
Previous configuration prevented to run the type generation twice.
The generated d.ts files were considered as source files, so we got file override errors.

Add a dedicated npm script to generate scripts.
We cannot directly call the tsc or lerna commands on the macOS GH actions runner, so introduce the script.
2022-04-03 13:09:24 +02:00
CD Yang 7fa2b433c3
fix: edge handlers use style.edgeStyle (#78)
Use the `edgeStyle` property of `CellStateStyles` in `ElbowEdgeHandler` and `EdgeHandler`.
2022-02-20 17:44:37 +01:00
Junsik Shim aa22e83c15
Merge pull request #77 from maxGraph/anchors
Fixes the 'Anchors' example.
2022-01-27 19:01:10 +09:00
Thomas Bouffard a2a718b40f
feat(examples): activate the storybook source addon (#75)
This replicates what mxgraph examples previously provided: the source code directly accessible within the example.
It allows copy/paste for reuse in user applications and should improve the adoption.
The code used to manage the controls is easily identifiable and can help highlight certain parts of the example (ContextMenu, RubberBand, ...).

Also bump storybook from 6.4.0 to 6.4.13.
2022-01-25 07:19:17 +01:00
Junsik Shim b2bb10ea7e Fixed the 'Anchors' example. 2022-01-22 13:08:56 +09:00
Thomas Bouffard 14f5815149 chore(storybook): fix server start and warnings
Remove the extra NODE_OPTIONS in storybook server start script that generated an
error.
Remove cross-env devDependency which is then not used anymore.
Fix storybook deprecation warning (static dirs)
2022-01-19 21:13:05 +01:00
Dave Morrissey 73f5a5979c started refactor of currently unused stories in `stashed` folder 2022-01-18 18:46:56 +11:00
Thomas Bouffard fb7819f92a
chore: fix build error and introduce a build github workflow (#71)
Fix imports that are not respecting the case of the filenames.

The build often has errors and they are only detected after a developer pull the `development` branch on their local machine.
To early catch build failures, add a GitHub workflow that runs a build command.
2022-01-14 06:17:38 +01:00
Dave Morrissey 413796ad32
Finish converting core to ts, JSDoc conversion, consistency+convention changes, example bugfixes (#70)
* reorganised directories; removed mx prefix

* reduced directory hierarchies; removed mx prefix; type fixes

* convert remaining javascript to ts

* fix/add types

* add type defs

* type updates; moved codecs to where they're used

* reorganise constants into enums+type additions

* removed "Function:" and "Variable:" prefixes from comments, as they aren't needed in JSDoc

* removed "Function:", "Variable:" and "Class:" prefixes from comments, as they aren't needed in JSDoc

* removed "Function:" prefixes from comments, as they aren't needed in JSDoc

* minor changes

* convert code example blocks to markdown

* module casing updates

* converted parameter function documentation to JSDoc

* documentation+type updates

* removed react subdir (for now)

* reorganised various `utils` functions into different files

* type updates/bugfixes/workarounds

* rename Rubberband and CellEditor to be *Handler to match the other plugins

* move codec classes to where they're used to reduce cyclic dependencies

* move codec classes to where they're used to reduce cyclic dependencies

* type updates/reorganize layout file structure

* renamed various files for consistency

* import fixes

* renamed GraphHandler SelectionHander and various fixes

* convert EventObject parameters to objects

* add basic better-docs config

* update better-docs config

* bugfix for shared variables in Graph persisting across instances

* fixed accessing handlers in examples; renamed Model to GraphModel

* fixed accessing handlers in examples; renamed Model to GraphModel

* restored selection model

* bugfix

* renamed getModel to getDataModel

* changed to use graph.batchUpdate() to reduce lines of code

* changed to use graph.batchUpdate() to reduce lines of code

* finished annotations+added TypeDoc

* convert remaining Cell[] instances to CellArray

* convert NaturalDocs links to JSDoc
2022-01-08 12:49:35 +11:00
Thomas Bouffard 8d1c0de603
Merge pull request #58 from Seebiscuit/dev/fix-no-fo 2021-12-01 11:42:56 +01:00
Dave Morrissey 0114966be2 removed package-lock 2021-11-27 17:51:49 +11:00
Dave Morrissey bd70a74074 workarounds for node 17 2021-11-27 17:51:03 +11:00
Dave Morrissey c9753a2691 update packages and remove circular dependancies 2021-11-27 17:17:08 +11:00
Gary Kaganas 07d1b628ec fix(mxClient) Fixes NO_FO (foreignObject support is not available) test 2021-11-09 14:09:08 -05:00
Junsik Shim 74b67a60a4 Fixed some errors. 2021-10-20 10:28:27 +09:00
Junsik Shim 70f35a36ee Formatted some codes. 2021-10-18 16:58:40 +09:00
Junsik Shim 5242e3dbc3 Fixed edgestyle bug. 2021-10-18 10:40:21 +09:00
Junsik Shim 74fb23eb4e Fix Anchors story. 2021-10-18 10:22:04 +09:00
Junsik Shim 570dfaab7b Fix Anchors story. 2021-10-18 10:21:31 +09:00
Junsik Shim 88eee80173 Fixing stories... 2021-09-13 08:57:22 +09:00
Junsik Shim eda54946bb Fixing stories... 2021-09-12 23:39:02 +09:00
Junsik Shim e3562c8a08 Fixing stories... 2021-09-10 14:17:59 +09:00
Junsik Shim 4a624db9f7 Trying to run HelloWorld... 2021-09-09 14:40:34 +09:00
Junsik Shim a7429b2a54 Trying to run HelloWorld... 2021-09-09 10:14:59 +09:00
Junsik Shim 65d800d5be Trying to run HelloWorld... 2021-09-08 10:05:28 +09:00
Junsik Shim 2482ec10e9 Trying to run HelloWorld... 2021-09-07 21:21:22 +09:00
Junsik Shim bdc50a9f48 Refactored everything... 2021-09-07 18:07:27 +09:00
Junsik Shim 4316d4f5e5 - Trying to get the stories working... 2021-09-01 23:04:33 +09:00
Junsik Shim 0adb9fa1d3 - Refactored the stories for storybook to work 2021-08-30 23:20:26 +09:00
Junsik Shim 61648e43ce - Converting *Handlers into plugins.
- Keep resolving errors.
2021-08-30 18:45:01 +09:00
Junsik Shim 648e324cc0 - Converting *Handlers into plugins.
- Keep resolving errors.
2021-08-09 09:34:19 +09:00
Junsik Shim c89ce4cea4 Merge branch 'mcyph-graph-refactor' of https://github.com/jsGraph/mxgraph into mcyph-graph-refactor 2021-08-01 11:26:49 +09:00
Junsik Shim bc400a3ae3 - Converted Graph* classes into mixins.
- Created MaxGraph type to expose.
- CellStateStyles is now more concrete.
- More compiler errors are resolved.
2021-08-01 11:21:57 +09:00
mcyph 62c9dd8e34 fixed utils references 2021-07-31 19:55:25 +10:00
Junsik Shim 49b307a557 Refactored more.
- image-related classes
 - event-related classes
2021-07-24 10:33:24 +09:00
Junsik Shim 0453da274f Refactored all the shapes.
- removed nullable fields.
 - removed getValue() calls.
 - CellStateStyles is explicit.
2021-07-23 14:26:59 +09:00
mcyph 92e446acb2 conversions to typescript and type fixes 2021-07-12 22:13:45 +10:00
mcyph 0c6b765cac conversions to typescript and type fixes 2021-06-27 23:01:35 +10:00
mcyph 288ba10cf0 conversions to typescript and type fixes 2021-06-27 17:23:33 +10:00
mcyph ff309ee781 conversions to typescript and type fixes 2021-06-13 22:29:29 +10:00
mcyph 960813ca1b conversions to typescript and type fixes 2021-06-13 16:13:43 +10:00
mcyph 29fff201da cleanups, and started preferring for ... of loops over for (i=0; ... when feasible 2021-06-07 21:10:38 +10:00
mcyph 9d2e144637 started refactoring+reorganising core to not have mx prefix, and breaking up mxGraph into smaller classes for easier maintenance 2021-06-06 23:15:04 +10:00
mcyph f76a172cae started refactoring+reorganising core to not have mx prefix, and breaking up mxGraph into smaller classes for easier maintenance 2021-06-06 23:04:44 +10:00
mcyph 8d16eafd80 started refactoring+reorganising core to not have mx prefix, and breaking up mxGraph into smaller classes for easier maintenance 2021-06-06 14:23:36 +10:00
mcyph 11b3c1cf15 type fixes 2021-06-05 20:35:12 +10:00
mcyph 29725cebc1 type fixes 2021-06-05 20:14:01 +10:00
mcyph 55be71c4ef Merge remote-tracking branch 'junsik/development'
# Conflicts:
#	packages/core/src/atomic_changes/mxSelectionChange.ts
#	packages/core/src/view/cell/mxCell.ts
#	packages/core/src/view/cell/mxCellArray.ts
#	packages/core/src/view/connection/mxMultiplicity.ts
#	packages/core/src/view/graph/mxGraph.ts
#	packages/core/src/view/graph/mxGraphModel.ts
2021-06-05 17:48:31 +10:00
mcyph 40d12f9745 removed ts check comments which match and converted mxCell[] references to mxCellArray 2021-06-05 17:24:20 +10:00
Junsik Shim 7167617f04 Merge branch 'development' of https://github.com/jsGraph/mxgraph into development 2021-05-14 13:42:54 +09:00
Junsik Shim 14ce27e49e - Export each constants in mxConstants.
- Converting JS files to TS.
2021-05-14 13:42:49 +09:00
Jon Gadsden 8f4d3dec1d
fix(docs) Update docs value for mxForceIncludes variable 2021-05-12 15:50:32 +01:00
Pierre Péronnet f82cf1a83e
fix(docs) Update default value for mxForceIncludes variable
Signed-off-by: Pierre Péronnet <pierre.peronnet@corp.ovh.com>
2021-05-11 09:53:08 +02:00
Junsik Shim 92e4970cca Converting to TS. 2021-05-08 20:02:13 +09:00
Junsik Shim 846f20335c Converted js files to ts. 2021-05-04 23:29:44 +09:00
mcyph 40d5834b7c bugfixes 2021-05-03 00:06:49 +10:00
mcyph 7cac8a2a86 bugfixes 2021-05-02 23:59:43 +10:00
mcyph fe7ac7e84d bugfixes 2021-05-02 23:56:17 +10:00
mcyph 707605cedd removed all mxConstants.STYLE_* references, now referring to keys directly 2021-05-02 16:04:34 +10:00
Junsik Shim 6658ff658f - Exports everything in mxConstants separately. 2021-04-30 20:05:49 +09:00
Junsik Shim aef7586beb - Removed unused imports. 2021-04-27 21:52:02 +09:00
Junsik Shim c5899e0955 - Removed mxUtils.indexOf(). 2021-04-27 21:40:09 +09:00
Junsik Shim 654736d23d - Removed mxUtils.bind(). 2021-04-27 21:23:17 +09:00
mcyph 2bcacecc7e various bugfixes 2021-04-25 20:47:53 +10:00
mcyph b7c46c06a7 Merge remote-tracking branch 'upstream/development'
# Conflicts:
#	src/pages/connections/HelloPort.js
#	src/pages/dnd_copypaste/Clipboard.js
#	src/pages/effects/Morph.js
#	src/pages/events/Boundary.js
#	src/pages/layout/AutoLayout.js
#	src/pages/layout/SwimLanes.js
#	src/pages/layout/Tree.js
#	src/pages/printing/PageBreaks.js
#	src/pages/shapes_stencils/Shape.js
#	src/pages/shapes_stencils/Stencils.js
#	src/pages/styles/HoverStyle.js
#	src/pages/styles/Stylesheet.js
#	src/pages/windows/Windows.js
#	src/pages/xml_json/FileIO.js
#	src/pages/xml_json/JsonData.js
#	src/pages/xml_json/UserObject.js
#	src/pages/zoom_offpage/OffPage.js
#	src/public/editors/config/editor-commons.xml
#	src/public/map-background/map-background.html
2021-04-25 18:11:00 +10:00
mcyph 7409ea5ee0 changed graph.model.beginUpdate to graph.batchUpdate 2021-04-25 17:40:22 +10:00
mcyph 6f9c47802b moved calls isCellCollapsed and others from mxGraph to mxCell 2021-04-25 17:22:00 +10:00
Junsik Shim e95ab5679d - Add more images.
- Convert the rest examples.
- src/ is removed.
2021-04-25 12:39:40 +09:00
mcyph f8d762c849 started moving batch operations on arrays of mxCells to mxCells.ts from mxGraphModel.ts 2021-04-25 13:04:22 +10:00
mcyph 6191c9944d changed mxGraph.getCellGeometry(cell) calls to be cell.getGeometry() directly 2021-04-25 12:12:27 +10:00
Junsik Shim b5b12a225a - Add more images.
- Convert more examples.
2021-04-24 21:33:15 +09:00
Junsik Shim f673a59dc6 - Fix a bug. 2021-04-24 21:33:07 +09:00
Junsik Shim 9bdf0aac08 - Convert more examples. 2021-04-24 21:33:07 +09:00
Junsik Shim 59e39cb312 - Convert more examples. 2021-04-24 21:32:54 +09:00
Junsik Shim 8c3afdfc77 - Add images for the examples.
- Convert more examples to storybook.
2021-04-24 21:32:54 +09:00
Junsik Shim 1d05e161c9 - Add css support in storybook.
- Add icons to mxgraph.
- Convert some examples to storybook.
2021-04-24 21:30:30 +09:00
Dave Morrissey a3ae5d9fb6 bugfix 2021-04-19 21:30:50 +10:00
mcyph cace21a0a9 bugfix for getting cell ancestors 2021-04-18 22:21:03 +10:00
mcyph b0d978fb8e reverted to using mxCell functions directly rather than through mxGraphModel 2021-04-17 22:19:36 +10:00
Junsik Shim 1b0f3d6b9e - Restructure into a monorepo.
- Add Storybook to packages.
- Remove circular dependencies.
2021-04-15 13:12:12 +09:00