Skip to content

Conversation

@ewuerger
Copy link
Collaborator

This PR solves #221 by aligning region text correctly and gathering the whole StateTransition label text from the name attribute on the diagram element in the factory in the aird.parser module. The changes to the svg submodule allow for adding class names when we encounter any other elements that need left-alignment of text instead of the default centric placement.

@ewuerger ewuerger self-assigned this Jan 16, 2023
@ewuerger ewuerger force-pushed the fix-state-diagrams-export branch 2 times, most recently from 685edd2 to 9000155 Compare January 16, 2023 11:45
@ewuerger ewuerger marked this pull request as ready for review January 16, 2023 11:50
Comment on lines 28 to 35
start_anchored = {
"LogicalComponent",
"LogicalActor",
"LogicalHumanActor",
"LogicalHumanComponent",
"ModeRegion",
}
left_aligned = {"ModeRegion"}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we change the text alignment setting to be a property in capstyle.STYLES?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We moved all text based decoration rules into diagram.capstyle.STYLES. Please have a look again. And tell me if you like this or not.

@Wuestengecko Wuestengecko linked an issue Jan 19, 2023 that may be closed by this pull request
@ewuerger ewuerger force-pushed the fix-state-diagrams-export branch 2 times, most recently from 9fd4266 to 08856d8 Compare January 19, 2023 12:52
Before text placement was always centric. Now based on a new
`text_style` keyed `text_align` in `diagram.capstyle.STYLES` it is
decided when text is placed with a default margin (5) or bigger for
centric position.

- Additionally all text stylings were moved from `decorations` into
`diagram.capstyle.STYLES`.
- Additionally `helpers.check_for_horizontal_overflow` was changed to do
only what its name suggests. Margin calculation were moved outside into
`render_hbounded_lines`.
@ewuerger ewuerger force-pushed the fix-state-diagrams-export branch from 08856d8 to 25b9cd0 Compare January 19, 2023 13:56
@ewuerger ewuerger requested a review from Wuestengecko January 19, 2023 13:57
@Wuestengecko Wuestengecko removed the bug label May 26, 2025
@Wuestengecko Wuestengecko marked this pull request as draft May 26, 2025 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

State Diagram Export Problem

3 participants