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

Fix state diagrams export #227

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

ewuerger
Copy link
Member

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 added bug Something isn't working enhancement New feature or request labels Jan 16, 2023
@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
capellambse/aird/_edge_factories.py Outdated Show resolved Hide resolved
capellambse/svg/decorations.py Outdated Show resolved Hide resolved
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
Member 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

State Diagram Export Problem
2 participants