Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] Add a plugin that provides an API to translate/scroll a BPMN element #169

Open
Tracked by #171
tbouffard opened this issue Nov 14, 2023 · 0 comments
Open
Tracked by #171
Labels
enhancement New feature or request

Comments

@tbouffard
Copy link
Member

tbouffard commented Nov 14, 2023

Is your feature request related to a problem? Please describe.

A BPMN element may require special attention, so it may be required to position/scroll it at a specific location in the BPMN container.

Describe the solution you'd like

Implement a ScrollElementsApiPlugin plugin that provides an API to scroll an BPMN element given its id.
This will be a generalization of #165.
This should work when the BPMN container has scrollbars.

API proposal

type ScrollElementOptions = {
  // same as bpmn-visualization OverlayShapePosition + 'center' and 'visible'
  position?: 'top-left' | 'top-right' | 'top-center' | 'bottom-left' | 'bottom-right' | 'bottom-center' | 'middle-left' | 'middle-right' | 'center' |  'visible' , // default 'top-left'
  margin-bottom?: number, // default 0
  margin-left?: number, // default 0
  margin-right?: number, // default 0
  margin-top?: number, // default 0
}

scrollElement(bpmnId: string, options?: {}): void

The margin properties don't always apply. For example:

  • for the top-left position, only the margin-left and margin-top apply
  • for the center position, no margin applies
  • for the visible position, some margin may apply depending on the chosen implementation

Negative values for margins could be accepted.

Disclaimer: this will probably only work with a BPMN container that have a "fixed computed size" (as for the fit feature).

Name of the plugin. Be consistent with:

Future implementation: we may provide another plugin that takes the name of the BPMN element instead of its id, as we do in #75 or #76.

Screenshots

Positions and margins
Positions and margins

Scrolling an hidden elements to make it visible
Scrolling an hidden elements to make it visible

Additional context

A POC has been done for the top-left and center position in process-analytics/bpmn-visualization-js#2885

Implementation of visible/center

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant