toyplot icon indicating copy to clipboard operation
toyplot copied to clipboard

Reduce duplicated style information.

Open tshead2 opened this issue 7 years ago • 0 comments

Currently, every text element in a drawing duplicates its CSS state, now that we have taken over all text layout, but this is wasteful. We need to cut down on redundant CSS, without affecting users' ability to customize individual text elements.

Derived requirements:

  • We need to keep running track of a current CSS state while creating the DOM, much like a browser would do it.
  • toyplot.html._draw_text() should only write-out CSS properties that differ from the current state.
  • To get any benefit from this, code that renders a mark would need to insert "default" text styles into a parent element.

Ideally, this could cut-down on style overhead throughout a drawing, not just for text.

tshead2 avatar Jun 15 '17 21:06 tshead2