kaijagahm / ygdpDashboard

Interactive dashboard for YGDP survey data
3 stars 0 forks source link

(INT) RGB view #25

Closed kaijagahm closed 3 years ago

kaijagahm commented 3 years ago

Jim would like to have an RGB view for the hexes in interpolation mode. This option would show up in the righthand menu only when three sentences are selected, not for any other number.

As of today, I already have the RGB option commented out in the code to generate the display settings menu. Haven't hooked it up to anything.

What I haven't figured out how to do is generate a color palette from this, because of how colors are generated in leaflet. We have a data frame in wide format, like:

df <- data.frame(sentence1.pred = c(4.324, 1.265, 2.540), sentence2.pred = c(1.003, 2.451, 2.034), sentence3.pred = c(4.376, 3.871, 4.998))

Typically, in leaflet, you generate colors by creating a palette where you specify a range of colors (or several discrete colors, depending on the type of palette), and then specify a domain of values over which to map those colors. More info about color palettes in leaflet here.

I posted on RStudio community about this issue, so we'll see if someone there can help me resolve it.

kaijagahm commented 3 years ago

Added a pretty primitive version of this in https://github.com/kaijagahm/ygdpDashboard/commit/94d9ec13802d164af150bf195b53689a46c8e6a3.

I don't love this, though--I don't think it's a good way to display data. Problems:

Going to bring these suggestions for tweaks into a different issue.