Skip to content

feat!: configure IconPainter via constructor options#3419

Merged
tbouffard merged 10 commits into
masterfrom
feat/pass_iconPainter_to_constructor
Nov 27, 2025
Merged

feat!: configure IconPainter via constructor options#3419
tbouffard merged 10 commits into
masterfrom
feat/pass_iconPainter_to_constructor

Conversation

@tbouffard

@tbouffard tbouffard commented Nov 20, 2025

Copy link
Copy Markdown
Member

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

github-actions Bot commented Nov 20, 2025

Copy link
Copy Markdown

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

🤖 By surge-preview

@github-actions

github-actions Bot commented Nov 20, 2025

Copy link
Copy Markdown

♻️ 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
Comment thread dev/ts/component/CustomIconPainter.ts Outdated
Comment thread README.md Outdated
@sonarqubecloud

Copy link
Copy Markdown

@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.

1 participant