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] Provide a way to configure the defaults of the BPMN renderer #1993

Open
1 of 5 tasks
Tracked by #2471
tbouffard opened this issue May 25, 2022 · 0 comments
Open
1 of 5 tasks
Tracked by #2471

[FEAT] Provide a way to configure the defaults of the BPMN renderer #1993

tbouffard opened this issue May 25, 2022 · 0 comments
Labels
BPMN diagram styling Change the standard rendering: stroke color, thickness enhancement New feature or request
Milestone

Comments

@tbouffard
Copy link
Member

tbouffard commented May 25, 2022

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

I would like to be able to change the defaults at bpmn-visualization initialization. At least for settings shared by all elements:

  • fill color
  • stroke color
  • font: family, color, size

Describe the solution you'd like

Currently, examples show hacks to modify the defaults. They involve changing internal values or extending the library.
I would like to be able to do it without changing the lib internals.

[UPDATE 2023-07-13]
For more details, see #2659 (comment)

  • we will propose to update the style defaults using mxGraph global styles. A dedicated API will be introduced with something similar to what is describe in [FEAT] General improvements for default styles management #2471 (dedicated styles related methods)
  • the overlay defaults will be configurable at the lib initialization by using options.
  • some rendering options can no longer be updated after this change. They are covering rare use cases. We will support them back if users request it

Meta tasks

Additional context

Available examples in v0.23.3:

These examples use an hack that update the values defined in StyleDefault. The changes are global so they have side effects. It is also not very friendly to use this hack.

Initial proposal for a way to pass defaults

This could be done with something like (non exhaustive, just for illustration)

new BpmnVisualization({
  renderer: {
    defaults: {
      fillColor: 'pink';
      font: {
        color: 'orange';
        family: 'Georgia, serif';
        size: 13;
      };
      strokeColor: 'red';
    }
  }
})

⚠️ Important ⚠️:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BPMN diagram styling Change the standard rendering: stroke color, thickness enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant