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 labels around border #616

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

Conversation

Rdornier
Copy link
Contributor

@Rdornier Rdornier commented Feb 3, 2025

Resolves #614, resolves #615

@@ -1294,6 +1294,7 @@ def draw_labels(self, panel, page):
y = panel['y']
width = panel['width']
height = panel['height']
border = panel['border']
Copy link
Member

Choose a reason for hiding this comment

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

better to use border = panel.get('border') which won't cause an error if border is missing

@will-moore
Copy link
Member

will-moore commented Feb 17, 2025

The app JS fix looks good.

The PDF labels are shifted OK for single labels in some positions, but where we have multiple labels (e.g top right panel) or labels on the inside corners then it's not looking right.
Also left-vertical labels (bottom-left panel) is too far left.

Screenshot shows app (top-left), PDF with this PR (top-right) and PDF without this PR (bottom). All borders are 15 px:

Screenshot 2025-02-17 at 15 31 23

@Rdornier
Copy link
Contributor Author

Hello Will,

Thanks for you careful review. I've made a fix to correct that.

There is only one remaining thing. When you re-open the figure, with vertical labels on panel with borders, the vertical labels are very far away from the panel. If you move the panel, then the position of the labels are correctly updated.

I found out that this behavior is coming from those two lines

            // need to force update of vertical labels layout
            $('.left_vlabels', self.$el).css('width', 3 * self.$el.height() + 'px');
            $('.right_vlabels', self.$el).css('width', 3 * self.$el.height() + 'px');

If I remove them, this behavior disappear. But I don't know if I'm allowed to remove them, as they should be needed for something, right ?

Rémy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Label spacing not updated when hiding border No border spacing added on labels when exporting as PDF
2 participants