Skip to content

Unification of text rendering and wrapping #2053

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

Closed
monfera opened this issue Oct 3, 2017 · 5 comments
Closed

Unification of text rendering and wrapping #2053

monfera opened this issue Oct 3, 2017 · 5 comments
Labels
feature something new

Comments

@monfera
Copy link
Contributor

monfera commented Oct 3, 2017

This issue is a spinoff of the table PR

Currently, text rendering logic is not centralized - most of it is in svgUtils.convertToTspans but the new table plot type has wrapper logic, which does a few things, for example:

  • wraps text to a specific width
  • bypasses expensive logic (in this case, the entire svgUtils.convertToTspans) if there's no need

and table would do other things if it could, such as

  • caching of resulting DOM fragments
  • canceling pending asynchronous requests

This issue is the basis for a follow-up PR in which

  • core: code unification is covered
  • core: wrapping is made available centrally (individual plots will still need to specify constraints so it doesn't on its own turn all plots wrap-aware)
  • core: avoid bypass of the heavy logic if there's no styling, markup or LaTeX
  • core: take a look at KaTeX (perhaps it'd be a separate ticket on its own)
  • core: optimize the number of getBoundingClientRect calls; convert to Drawing.bBox
  • desirable: separation of code to logic (calculation) and rendering
  • desirable: facilitating caching
  • desirable: facilitating request cancelation
@monfera
Copy link
Contributor Author

monfera commented Oct 3, 2017

Self-assigning for now to keep tabs during PR review; feel free to reassign

@monfera monfera self-assigned this Oct 3, 2017
@etpinard
Copy link
Contributor

etpinard commented Oct 3, 2017

cc #382 and #1964

@luisrudge
Copy link

not sure this is the right place to ask, but would the implementation of this issue fix this glitch?

image

I'm already using automargin:true but the axis gets cropped anyway.

@jensb
Copy link

jensb commented Oct 13, 2019

Is this still a relevant issue, and if so, is anything done to fix this?
I'd like to have scatter plot annotations with a fixed (set) width which autowrap text if it is too wide.
Ideally, the width should be settable by dragging the right margin of the annotation box.

@gvwilson
Copy link
Contributor

Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson

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

No branches or pull requests

5 participants