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

Posibility to add custom font style to each element individually #2266

Open
DevAutomationInf opened this issue Dec 2, 2024 · 4 comments
Open
Labels
backlog Queued in backlog enhancement New feature or request

Comments

@DevAutomationInf
Copy link

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

It is not possible to add a custom font size to an individual element in the diagram for embedded labels ( such as tasks, lanes, and subprocesses).

Describe the solution you'd like

It should be possible to apply a custom font style inside the custom renderer to embedded labels, as it is possible for external labels.

Describe alternatives you've considered

I considered overriding the renderEmbeddedLabel function inside the BPMNRenderer, but that is not allowed when using typescript.

Additional context

In this stackblitz example, I demonstrate how the external label font size can be changed for each element individually. However, if this property is added to the embed label, only the stroke takes effect. {labelStyle: {fontSize: '40', stroke: 'blue'}}. The cause is that the renderEmbeddedLabel doesn't take other style into consideration. I tried overriding this method but it was not possible when using typescript.

@DevAutomationInf DevAutomationInf added the enhancement New feature or request label Dec 2, 2024
@barmac
Copy link
Member

barmac commented Dec 2, 2024

I tried overriding this method but it was not possible when using typescript.

What do you mean by that?

@DevAutomationInf
Copy link
Author

I updated the stackblitz project with what I tried. My intention was to change the logic of the method so that the labelStyle is also taken into consideration. I get this error message: 'This member cannot have an 'override' modifier because it is not declared in the base class 'BpmnRenderer'. I tried to add 'ts-ignore' just to see if it works, but the code takes no effect. I think it was not meant to be overridden.

@barmac
Copy link
Member

barmac commented Dec 4, 2024

I understand, so you'd like us to refactor the BpmnRenderer in a way to allow overriding of the embedded label rendering. I think this can be useful for broader BPMNLabel properties support. I will move the issue to the backlog, but if you have a proposal how we can solve this in a reasonable way, we are happy to review the PR.

@barmac barmac added the backlog Queued in backlog label Dec 4, 2024
@DevAutomationInf
Copy link
Author

Thank you, barmac! Then I will make a PR.

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

No branches or pull requests

2 participants