Skip to content

Points fill and cursor marker issues in dark mode #780

@tve

Description

@tve

With a white background the std points fill and cursor markers work fine. However, on a dark background they don't.
Repro: https://codepen.io/codesurfr/pen/vYaNwwR

  • this is a copy of https://leeoniya.github.io/uPlot/demos/grid-over-series.html with the body background changed to #1e1e1e
  • the points size is enlarged to 10pts so one can see stuff better
  • the red series has no other change, notice how the points are filled with white instead of the background color
  • the blue and green series fix that by setting the points fill to the same as the background color, however now the cursor marker no longer works properly because it uses the points fill color
  • it is possible to completely fix the issue by defining the cursor points fill explicitly, see commented out code in the codepen

Is this a desired/intended state of the built-in cursor? Dark backgrounds are pretty popular for plots...

Maybe there should be an opts.dark or opts.background_color type of option passed to uPlot so it can do something more sensible by default?

Quick screen grab showing the points (no cursor here):
image

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions