パッケージの詳細

@bpmn-io/align-to-origin

bpmn-io13.8kMIT0.7.0

Align diagrams to the diagram origin

BPMN, CMMN, DMN, plugin

readme

@bpmn-io/align-to-origin

CI

Aligns your diagrams to the coordinate origin (0,0), manually triggered or on diagram save.

Plugs into your favorite BPMN, DMN and CMMN editor.

Automatic Origin Adjustment

Alignment in action. Diagram origin marker, alignment corridor, and element boxes shown for demonstration purposes only.

Usage

import BpmnModeler from 'bpmn-js/lib/Modeler';

import AlignToOrigin from '@bpmn-io/align-to-origin';


// extend the BPMN editor with the exporter module
const modeler = new BpmnModeler({
  alignToOrigin: {
    alignOnSave: true,
    offset: 150,
    tolerance: 50
  },
  additionalModules: [
    AlignToOrigin
  ]
});


// hooks into #saveXML to align the diagram elements
modeler.saveXML(function(err, xml) {
  ...
});

// may be used standalone, too
const alignToOrigin = modeler.get('alignToOrigin');

alignToOrigin.align();

License

MIT

更新履歴

Changelog

All notable changes to @bpmn-io/align-to-origin are documented here. We use semantic versioning for releases.

Unreleased

_Note: Yet to be released changes appear here._

0.7.0

  • CHORE: migrate CI to GitHub Actions (a3c349de)
  • CHORE: add autosaving integration test (#5)
  • CHORE: early abort alignment if no elements (d6c5580d)

0.6.0

  • FEAT: make grid aware

0.5.0

  • CHORE: update y offset to more sane default

0.4.2

0.4.1

  • FIX: correct documentation

0.4.0

  • FEAT: always compensate for element movement by scrolling canvas, drop scrollCanvas option
  • FEAT: implement canvas scrolling in an undoable manner

0.3.0

  • FEAT: add ability to specify { x, y } offset
  • FEAT: adjust x and y independent from each other
  • FEAT: apply sane default for offset and tolerance
  • CHORE: rename padding to offset
  • CHORE: rename thresold to tolerance

0.2.0

  • FEAT: make alignOnSave=true the default behavior

0.1.0

Initial version.