Axis tick-label anchoring, figure-background theming, and rule-label styling#75
Open
FarhanAliRaza wants to merge 3 commits into
Open
Axis tick-label anchoring, figure-background theming, and rule-label styling#75FarhanAliRaza wants to merge 3 commits into
FarhanAliRaza wants to merge 3 commits into
Conversation
Engine features, honored by the live client and static SVG/PNG exports alike: - tick_label_anchor on x_axis/y_axis and as a slot style (mpl ha aliases normalize): which label edge pins to the tick; rotated tick labels pivot about the pinned edge. - theme(background=) is the figure background (mpl figure.facecolor), painting the whole card (margins, title, tick labels); --chart-bg / plot_background now scopes to the plot rect only. - Rule/annotation label styling: dash strings, vertical_align, padding offsets. Showcased by the new examples/demo-advance.ipynb (benchmark-style bar chart + ExploitBench line/scatter recreation) and its Chromium-engine PNG build at examples/exploitbench.png.
FarhanAliRaza
force-pushed
the
advanced-demo-styling
branch
from
July 17, 2026 17:34
5a39071 to
69ec1f9
Compare
Merging this PR will not alter performance
Comparing Footnotes
|
Contributor
Author
# Conflicts: # js/src/20_theme.js # js/src/50_chartview.js # python/xy/_raster.py # python/xy/_svg.py # python/xy/static/index.js # python/xy/static/standalone.js # tests/test_components.py
Arrow labels no longer sit exactly on the shaft midpoint: the client lifts them along the shaft's upward normal so the line doesn't strike through the text (#63). The alignment probe still asserted the old center-x-equals-midpoint contract and failed once a Chromium is available (CI skips these probes). Assert the new geometry instead: no tangential drift along the shaft, and a normal offset large enough that the label box clears the line.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Engine features
Honored by the live client and the static SVG/PNG exports alike:
tick_label_anchoronx_axis/y_axisand as a slot style (mplhaaliasesleft/right/middlenormalize) — selects which label edge pins to the tick; rotated tick labels pivot about the pinned edge. This is the mplha=semantic the pyplot shim emits for slanted categorical labels.theme(background=)is the figure background (mplfigure.facecolor): it paints the whole card — margins, title, tick labels — and shows through the plot rect.--chart-bg/plot_backgroundnow scopes to the plot rect only (mplaxes.facecolor). Static exports reproduce both fills.vertical_align, and padding offsets on annotation labels.Docs updated in
docs/engineering/styling.md; parity tests across components, CSS mark styles, SVG/PNG export, and pyplot layout no-ops.