Told myself I would stop developing #rayrender for a while and actually work on some examples and tutorials showing y'all how to use it for dataviz, which then lead to me developing new features to support the examples I'm working on

oh well, I tried🤷‍♂️

#rstats (WIP)
2/n I'm going to turn this into a thread where I develop a 3D #dataviz w/ #rayrender/ #rstats. A problem with the above viz is it's unclear it's 3D—it could be a 2D bean-shaped path. I can rotate around the data, but that introduces new problems: it's now hard to read the labels.
3/n The data is worldwide sea ice extent (daily) from the mid-80s until now. Eventually we're going to add a title and some axis labels (along with date information) but I'm not going to worry about adding that information until the end.
4/n So how do I fix the month orientation? Rotate them so they're always facing the camera! If you're rotating the camera an angle θ, this is done by rotating the label -θ.

Next, we'll try and tackle a 3D data viz problem: how to connect the data to the axis? #rstats #rayrender
5/n It's difficult to read 3D graphs as you lose depth information when projecting 3D space to a 2D screen. You need something to link your data back to the axis. Here I try using a line back to the axis, but it's distracting and noisy—lets try something else.

#rstats #rayrender
6/n There's no reason we need to physically link the axis to the data. Let's just place a dot on the axis that moves along with our data—now the reader can see what value the current point represents.

Next: tackling the "spinning dancer" illusion!

#rstats #rayrender
7/n Our brain uses binocular vision on nearby objects to determine depth. That doesn't work w/ a 2D screen, leading to the "opposite spin" illusion. Luckily, our brain also uses object occlusion as a depth cue—which we can use to disambiguate the direction.

#rstats #rayrender
8/n Now, that being said: having a giant white pillar in the middle of your data isn't ideal. What else can we do? Well, what we're really trying to do is "ground" the data in the space—we can also try doing that by drawing a line from the data to the axis.

#rstats #rayrender
9/n Although this helps with the spinning illusion, it doesn't completely remove it. Now that we have a way to ground the line in 3D space, we don't actually need to rotate it to show that it's 3D—so what happens if we turn off the rotation entirely?
10/n Removing the data rotation solves the illusion issue, and our vertical line grounds the data in 3D space... but it has lost a bit of that panache that comes with spinning in 3D 😋.

#rstats #rayrender
11/n Up to this point, I have been using a highly downsampled (daily -> every other month) dataset to speed-up rendering. It's good to check in with a more representative dataset: Here's our viz animated with weekly data.

Next: Adding year information.

#rstats #rayrender
12/n Now to add more context: year information! I first considered adding the year in the title, but it's an integral part of this visualization's story—putting it in the title creates too much separation from the data. Instead, I place it right in the base.

#rstats #rayrender
13/n Because this is a 3D plot, you also have to decide on the orientation of the text. I originally tried text aligned with the plane of the circle (below), but decided that it was a bit too hard to read—I changed it to the vertically oriented text above.

#rstats #rayrender
14/n And here's two years rendered with daily data. With the slower and smoother motion, it's a lot easier to track the value. I also set the months upright so they're easier to read.

Next: data annotations!

#rstats #rayrender
15/n Annotations can help drive the narrative of your dataviz by highlighting important values: here, I annotate the lowest sea ice extent of each year. Keeping the horizontal ticks shows how this value evolves over time.

Next: final adjustments!

#rstats #rayrender #dataviz
You can follow @tylermorganwall.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled: