Export linespacing attribute of text.#77
Open
lucasb-eyer wants to merge 1 commit intompld3:masterfrom
Open
Conversation
lucasb-eyer
added a commit
to lucasb-eyer/mpld3
that referenced
this pull request
Jan 20, 2026
This adds or fixes support for the following matplotlib axis title (ax.set_title) features: - newlines: SVG `<text>` can't do that, need to use `<tspan>`s inside, see also [this SO q/a](https://stackoverflow.com/questions/16701522/how-to-linebreak-an-svg-text-within-javascript). - linespacing: naturally follows from wanting newlines. Needs exporter support, so PR mpld3/mplexporter#77 first. - left/right titles were completely missing; this adds support for those, which also needs exporter support, so this PR first: mpld3/mplexporter#78 - The `malign` property, which defines in the multi-line case, how the text lines should be aligned (all left, all center, all right). I made this with major help from gpt-codex-5.2, although in the end I went over all of its code and did a little simplifications here and there, needed multiple iterations overall.
708df32 to
a3b8676
Compare
lucasb-eyer
added a commit
to lucasb-eyer/mpld3
that referenced
this pull request
Feb 4, 2026
This adds or fixes support for the following matplotlib axis title (ax.set_title) features: - newlines: SVG `<text>` can't do that, need to use `<tspan>`s inside, see also [this SO q/a](https://stackoverflow.com/questions/16701522/how-to-linebreak-an-svg-text-within-javascript). - linespacing: naturally follows from wanting newlines. Needs exporter support, so PR mpld3/mplexporter#77 first. - left/right titles were completely missing; this adds support for those, which also needs exporter support, so this PR first: mpld3/mplexporter#78 - The `malign` property, which defines in the multi-line case, how the text lines should be aligned (all left, all center, all right). I made this with major help from gpt-codex-5.2, although in the end I went over all of its code and did a little simplifications here and there, needed multiple iterations overall.
lucasb-eyer
added a commit
to lucasb-eyer/mpld3
that referenced
this pull request
Feb 10, 2026
This adds or fixes support for the following matplotlib axis title (ax.set_title) features: - newlines: SVG `<text>` can't do that, need to use `<tspan>`s inside, see also [this SO q/a](https://stackoverflow.com/questions/16701522/how-to-linebreak-an-svg-text-within-javascript). - linespacing: naturally follows from wanting newlines. Needs exporter support, so PR mpld3/mplexporter#77 first. - left/right titles were completely missing; this adds support for those, which also needs exporter support, so this PR first: mpld3/mplexporter#78 - The `malign` property, which defines in the multi-line case, how the text lines should be aligned (all left, all center, all right). I made this with major help from gpt-codex-5.2, although in the end I went over all of its code and did a little simplifications here and there, needed multiple iterations overall.
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.
This is only the exporting. I'll make a PR with the rendering-side of this tomorrow, but ideally we just merge this one as it's trivial :)