dyc3/opentogethertube

vis: add `useColorProvider` hook to manage what colors are being assigned to which nodes

Closed this issue · 3 comments

dyc3 commented

Is your feature request related to a problem? Please describe.

We need to globally manage color assignments in visualizations so that we can render a legend (#1427)

Describe the solution you'd like

add a useColorProvider hook that provides a color function to assign colors to things (for use in views), and a Map that contains all the colors that have been assigned and to what (for use in the legend)

Additional context

No response

I would like to work on this

Also giving an update here. Definitely a bit stumped. Wrapping my head around the idea of hooks is weird. Reading through the react docs though and I'll hopefully have made some progress for Tuesday.

dyc3 commented

You just need to implement the functions in the ColorProvider class, scaffolded in #1609. The hook is already set up.