smurp/huviz

put a white cartouche behind the colored labels for focused nodes and edges

Closed this issue · 1 comments

smurp commented

To increase legibility when the graph is dense and the focused node or edge labels are hard to read because of the visual complexity behind them -- let's paint a semi-transparent cartouche (a rounded rect) just behind the label. As a first pass, let's make the cartouche the color of the graph background (ie white or black) but with some transparency so the nodes and edges it covers are still faintly visible. If that is insufficient then perhaps making the cartouche grey would help. It might also help to put a drop shadow behind the label letters. Considering that some of the label colors might offer contrast challenges against a grey perhaps a mathematically selected contrasting color might be the right choice for the cartouche fill, failing all else.

  • put cartouche behind the focused edge label
  • put cartouche behind node labels when the nodes are focused (either alone as part of a focused edge)
  • make the the cartouches into rounded rectangles, see draw_bubble() for a rounded rectangle routine to adapt
  • make a setting for toggling the display of cartouches
smurp commented

Note that the HSL (Hue Saturation Lightness) colorspace is being used to generate label colors mathematically and that they are then converted into the native RGB values. Working from the HSL representation should make the generation of contrasting colors relatively easy.

https://en.wikipedia.org/wiki/HSL_and_HSV#From_HSL