Skip to content

Conversation

@tbouffard
Copy link
Member

@tbouffard tbouffard commented Nov 20, 2025

Remove IconPainterProvider singleton. Users must now pass custom IconPainter through renderer options in BpmnVisualization constructor.

BREAKING CHANGE: IconPainterProvider removed. Use the renderer.iconPainter option instead.

Notes

Before:
It used of a global configuration, shared by all BpmnVisualization instances.

IconPainterProvider.set(new CustomIconPainter());
new BpmnVisualization({ container: 'bpmn-container' });

After:
It uses a local configuration, specific to the specific BpmnVisualization instance.

new BpmnVisualization({
  container: 'bpmn-container',
  renderer: { iconPainter: new CustomIconPainter() }
});

Changes:

  • Add iconPainter property to RendererOptions with JSDoc
  • Thread iconPainter: BpmnVisualization → GraphConfigurator → BpmnGraph → BpmnCellRenderer
  • Remove IconPainterProvider class and exports
  • Add integration test verifying custom IconPainter usage
  • Add test fixture: simple-start-userTask-end.bpmn
  • Use module-level pendingIconPainter variable to work around mxGraph factory method pattern

Screenshots

Accessible by running the dev server locally http://localhost:10001/dev/public/index.html?url=/test/fixtures/bpmn/bpmn-rendering/tasks.bpmn&renderer.iconPainter.use.custom=true

original icon custom icon custom icon with the brown theme
01_original_icon 02_custom_icon 03_custom_icon_theme_brown

Remaining tasks

  • icon colors follow the theme
  • review the implementation

Remove IconPainterProvider singleton. Users must now pass custom
IconPainter through renderer options in BpmnVisualization constructor.

BREAKING CHANGE: IconPainterProvider removed. Use renderer.iconPainter option instead.

Before:
  IconPainterProvider.set(new CustomIconPainter());
  new BpmnVisualization({ container: 'bpmn-container' });

After:
  new BpmnVisualization({
    container: 'bpmn-container',
    renderer: { iconPainter: new CustomIconPainter() }
  });

Changes:
- Add iconPainter property to RendererOptions with JSDoc
- Thread iconPainter: BpmnVisualization → GraphConfigurator → BpmnGraph → BpmnCellRenderer
- Remove IconPainterProvider class and exports
- Add integration test verifying custom IconPainter usage
- Add test fixture: simple-start-userTask-end.bpmn
- Use module-level pendingIconPainter variable to work around mxGraph factory method pattern
@tbouffard tbouffard added enhancement New feature or request lib integration Something about how an app can integrate the library labels Nov 20, 2025
@github-actions
Copy link

github-actions bot commented Nov 20, 2025

♻️ PR Preview 9fcee53 has been successfully destroyed since this PR has been closed.

🤖 By surge-preview

@github-actions
Copy link

github-actions bot commented Nov 20, 2025

♻️ PR Preview 9fcee53 has been successfully destroyed since this PR has been closed.

🤖 By surge-preview

@tbouffard tbouffard marked this pull request as draft November 20, 2025 09:46
@sonarqubecloud
Copy link

@tbouffard tbouffard marked this pull request as ready for review November 27, 2025 10:16
@tbouffard tbouffard merged commit 4d7525d into master Nov 27, 2025
27 checks passed
@tbouffard tbouffard deleted the feat/pass_iconPainter_to_constructor branch November 27, 2025 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lib integration Something about how an app can integrate the library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants