Package detail

@salman65/diagram-js

salman658MIT6.7.2

A modeling framework for the web

modeler, modeling, canvas, diagram-js

readme

As of version 1.0.0 this library exposes ES modules. Use an ES module aware bundler such as Webpack or Rollup to bundle it for the browser.

diagram-js

Build Status

A toolbox for displaying and modifying diagrams on the web.

Built with diagram-js

Some libraries / applications built on top of diagram-js:

Part of bpmn.io

External

Resources

Hacking the Project

To get the development setup make sure to have NodeJS installed. If your set up, clone the project and execute

npm install

Testing

Execute npm run dev to run the test suite in watch mode.

Expose an environment variable TEST_BROWSERS=(Chrome|Firefox|IE) to execute the tests in a non-headless browser.

Package

Execute npm run all to lint and test the project.

Note: We do not generate any build artifacts. Required parts of the library should be bundled by modelers / viewers as needed instead.

License

MIT

changelog

Changelog

All notable changes to diagram-js are documented here. We use semantic versioning for releases.

Unreleased

_Note: Yet to be released changes appear here._

6.7.0

  • FEAT: align colors with Camunda Modeler (#477)

6.6.1

  • FIX: get connected distance based on weight in auto-place (#464)

6.6.0

  • FEAT: allow connecting with appended shape as source (d1b1fb8)
  • FEAT: add auto-place feature (#443)
  • FEAT: allow to specify connection start and end for preview (7dfa896)
  • FEAT: accept hints for bendpoint move preview (e2c9409)
  • FEAT: accept layout hints on reconnect (2c30e10)
  • FEAT: enable top-down modeling (#453)
  • FEAT: use keyCode as fallback for keyboard key resolution (#456, #460)

6.5.0

  • FEAT: on resize, keep attachments and connection docking intact if possible (e73bc8b, ec80894)
  • FIX: correctly handle waypoints if space tool affects only one of connected shapes (393ac63)
  • FIX: select connect interaction target on connect (#445)
  • CHORE: provide context when getting minimum dimensions for space-tool (#444)
  • CHORE: bump dev dependencies (2eb50e5)

6.4.1

  • FIX: do not interpret 0 as falsy value
  • CHORE: bump min-dom version

6.4.0

  • FEAT: do not execute additional modeling behaviors when making space
  • FIX: copy hidden and collapsed properties (#441)
  • FIX: do not select hidden elements after create
  • FIX: do not add preview for hidden elements
  • CHORE: rewrite space tool

6.3.0

  • FEAT: improve connection cropping
  • FEAT: update incoming and outgoing connections on replace (ba5a5fb0)
  • FIX: prevent double layout on replace (c0db3b4da)

6.2.2

  • FIX: show line during make space again

6.2.1

Republish of v6.2.0.

6.2.0

6.1.0

  • FEAT: add horizontal / vertical resize handles (#117)
  • FIX: correctly mark elements as changed on {shape|connection}.create undo

6.0.2

  • FIX: revert a change that would disallow re-attaching a connection to the same source / target (fd6f76f6)

6.0.1

Republish of v6.0.0.

6.0.0

  • FEAT: allow to remove and update palette, context pad and popup menu entries from extensions (#431)
  • FEAT: allow multiple popup menu providers (#431)
  • FEAT: support element connections in reverse order (#427)
  • FIX: correctly unsubscribe popup menu close handler (46f78ea0e)
  • FIX: allow event bus event to be passed as single argument to EventBus#fire (9633af767)
  • FIX: pass hints when moving children on replace (cda3686c)

Breaking Changes

Connecting and re-connecting shapes got reworked via #427:

  • The rules connection.reconnectStart and connection.reconnectEnd got replaced with connection.reconnect rule
  • The data passed to and propagated via Connect changed from { source, sourcePosition } to { start, connectionStart }
  • Modeling#reconnect API is introduced for reconnecting both source and target
  • Layouter#layoutConnection receives a waypoints hint that needs to be taken into account to preview reverse connections
  • The commands connection.reconnectStart and connection.reconnectEnd got removed in favor of a connection.reconnect command

5.1.1

  • FIX: re-select only existing elements when dragging is finished (401412d)
  • FIX: correctly hide nested children of a collapsed shape (9cb6e9b)

5.1.0

  • FEAT: hide preview without hover (c52518d1)
  • FEAT: be able to specify hints when copy pasting (09d13e9b)
  • FEAT: allow attachment of shapes with labels on creation (a4ea3872)
  • FEAT: allow detaching multiple shapes (e8b34195)
  • FIX: integrate rules for keyboard move selection (3a25679d)
  • FIX: return latest changed elements in <elements.changed> command (fd245921)
  • FIX: cancel create on <elements.changed> command (6ebd3a57)

5.0.2

Republish of v5.0.1.

5.0.1

  • FIX: do no allow create if no hover available (679ef351)
  • FIX: relayout loops if necessary (3a63db0d)
  • FIX: set create target on hover events (d31bd00b)
  • CHORE: make it easier to override palette container (f765c81a)

5.0.0

  • FEAT: add ability to create multiple elements (8d7d1d9c)
  • FEAT: add createElementsBehavior hint to prevent behavior on creating elements (1ef5b3499)
  • FEAT: add ability to provide custom hit boxes (#371)

Breaking Changes

Copy and paste as well as create got completely reworked:

  • Create#start: third argument is context, if you want to specify source do { source: source }
  • CopyPaste: elements.copied, element.copy, elements.copy, element.paste, elements.paste removed in favor of copyPaste.canCopyElements, copyPaste.copyElement, copyPaste.elementsCopied, copyPaste.pasteElement, copyPaste.pasteElements
  • To prevent additional behavior on create after paste you should check for the createElementsBehavior=false hint
  • Modeling#pasteElements removed in favor of Modeling#createElements
  • MouseTracking removed in favor of Mouse

4.0.3

  • FIX: compensate for missing element.out event (#391)

4.0.2

  • FIX: do not show connect feedback on bendpoint moving (#382)
  • FIX: correct graphics update regression (#385

4.0.1

  • FIX: prevent unnecessary graphics updates (ff52b052)
  • FIX: correct inverse space tool preview (94644d72)

4.0.0

  • FEAT: add grid snapping (#319)
  • FEAT: add support for frame elements (#321)
  • FEAT: show connection markers in drag preview (#328)
  • FEAT: support connection previews (#326)
  • FEAT: do not move if no delta (c0c2b4f3)
  • FEAT: do not resize if bounds have not changed (e5cdb15a)
  • FEAT: snap during resize (#344)
  • FEAT: activate hand tool on SPACE (e7217b95)
  • FEAT: allow parallel move on larger connection areas (#350)
  • FEAT: make hosts sticky for valid attachers (#368)
  • FEAT: improve dragger text styles (#374)
  • FEAT: allow custom snap implementations to snap an element top, right, bottom and left
  • CHORE: add reusable escape util (0e520343)
  • FIX: prevent HTML injection in search component (#362)

Breaking Changes

  • When displaying a connection preview, Layouter will receive connection without waypoints, source, target and with only { source, target } hints. Make sure it handles such case (#326).

3.3.1

  • FIX: prevent HTML injection in search component (#362)

2.6.2

  • FIX: prevent HTML injection in search component (#362)

3.3.0

  • FEAT: add basic grid snapping (f987bafe)
  • FEAT: layout connections on start/end reconnection (f7cc7a8f)
  • FIX: use reference point when resizing (95bef2f6)

3.2.0

  • FEAT: trigger layout after connection reconnect (#317)

3.1.3

  • FIX: bump tiny-svg dependency to workaround MS Edge translate bug (657da2c3)

3.1.2

Reverts changes in v3.1.1, as they were unnecessary.

3.1.1

  • FIX: use correct reference argument for DOM related insert operations (47ca05ca)

3.1.0

  • FIX: don't swallow event listeners on EventBus#only (#293)
  • CHORE: rework EventBus internals, fixing various issues (#308)

3.0.2

  • FIX: make main export an ES module

3.0.1

  • FIX: correct IE11 delete key binding (d529a676)

3.0.0

  • FEAT: make ContextPad accessible and scaling configurable (#282)
  • FEAT: make PopupMenu accessible and scaling configurable (#284)
  • FEAT: allow Keyboard listener overrides using priorities (#226)
  • FEAT: add ability to move selected elements with keyboard arrows (9e62bdd)
  • FEAT: require Ctrl/Cmd modififer to move canvas via keyboard arrows (571efb9)
  • FEAT: make KeyboardMove and KeyboardMoveSelection speed configurable
  • FEAT: speed up moving elements / canvas using keyboard errors if SHIFT modifier is pressed
  • FEAT: add editorAction.init event to register editor actions (a9089ad)
  • FEAT: only bind Keyboard shortcuts for existing editor actions (aa308fd)
  • FEAT: rely on rules during GlobalConnect start (1efb277)
  • FEAT: expose KeyboardEvent to keyboard listeners instead of (keyCode, event) (94b5e26)
  • FEAT: automatically resize parent elements when children are expanded or replaced (#287)
  • CHORE: drop implicit feature dependencies in EditorActions (a9089ad)

Breaking Changes

  • GlobalConnect#registerProvider got removed without replacement. Implement a connection.start rule to control whether it is allowed to start connection with GlobalConnect (1efb277)
  • The Keyboard now passes the KeyboardEvent to listeners as the only argument rather than (keyCode, event) (94b5e26)
  • Removed the listeners property from Keyboard lifecycle events (4d72e38)
  • Moving the canvas via arrow keys now requires Ctrl/Cmd modifiers to be pressed; without the modifiers selected elements will be moved, if the KeyboardMoveSelection feature is provided (571efb9)
  • EditorActions does not implicitly pull in feature dependencies anymore, ensure you include all desired features with your editor (a9089ad)

2.6.1

  • FIX: ignore vertical padding when layouting text with middle alignment

2.6.0

  • CHORE: normalize drag coordinates to full pixel coordinates (#271)

2.5.1

  • FIX: circumvent IE 9 viewer bug (e1f3c65c)

2.5.0

  • FEAT: extend manhattan layout helper to support explicit trbl direction and layout U-turns, if needed (fd4c6028)

2.4.1

  • FIX: ensure all labels / attachers are moved before triggering connection layout
  • CHORE: move attachers / labels along with move closure (16882649)

2.4.0

  • FEAT: add ability to remove multiple events via EventBus#off

2.3.0

  • FEAT: hide palette toggle in expanded state (a none-feature, technically) (#257)
  • FIX: take top/bottom padding into account when rendering text (#259)
  • FIX: don't throw error on out-of-canvas lasso tool release

2.2.0

  • FEAT: support lineHeight in text render util (#256)

2.1.1

  • FIX: correct code snippet to ES5

2.1.0

  • FEAT: add support for multiple labels (#202)
  • FEAT: allow multiple classes to be passed to popup menu entries

2.0.0

  • FEAT: refactor popup menu to allow multiple providers and simplify API (b1852e1d)

Breaking Changes

  • The PopupMenu API got rewritten, cf. b1852e1d

1.5.0

This release accidently introduced backwards incompatible changes. Unpublished; Use v2.0.0 instead.

1.4.0

  • CHORE: bump object-refs version

1.3.1

  • FIX: correct side-effects config to not include *.css files

1.3.0

  • FEAT: emit popup menu life-cycle events
  • FIX: prevent default click action on dragend, if trapClick: true is specified

1.2.1

  • FIX: escape ids in CSS selectors

1.2.0

  • DOCS: migrate example to ES modules

1.1.0

  • CHORE: update utility toolbelt

1.0.0

  • CHORE: convert code base to ES modules (e26b034)

Breaking Changes

  • You must now configure a module transpiler such as Babel or Webpack to handle ES module imports and exports.

0.31.0

  • FEAT: remove EventBus.Event in favor of EventBus#createEvent API (91899cf6)

Breaking Changes

  • Use EventBus#createEvent to instantiate events

0.30.0

...

Check git log for earlier history.