Skip to content

Unification of text rendering and wrapping #2053

Closed
@monfera

Description

@monfera

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions