Skip to content
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

explore using bands (and cached paths) as a stroke and/or fill style for another series #889

Open
leeoniya opened this issue Nov 3, 2023 · 2 comments
Labels
feature New feature or request

Comments

@leeoniya
Copy link
Owner

leeoniya commented Nov 3, 2023

since we already do the work of constructing and caching the band paths, we could figure out a way/api to reuse them as a form of threshold fill/stroke of a different series.

related demo: https://leeoniya.github.io/uPlot/demos/gradients.html

image

@leeoniya
Copy link
Owner Author

leeoniya commented Nov 3, 2023

may require allowing bands to be boundless to one side, (and/or just using the existing fillTo() to the edges of the canvas)

ctx.createPattern() may be useful, but would require an additional canvas element or complexity about re-using the existing one.

@leeoniya
Copy link
Owner Author

maybe something like this which uses existing global band defs and defines coloring

series.bands = [
  {
      band: 1,
      stroke: '#f00',
      fill: ''#ff08',
  }
]

or we can allow fill and stroke defs to be defined in terms of bands:

series.stroke = [
  [1, '#f00']
]

this may be interesting since it feels similar to gradient color stops, and can be used for a similar purpose

@leeoniya leeoniya added the feature New feature or request label Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant