Thanks for the shout out Patrick.
Yes, this could definitely be done, in a few ways at least. You could pad the **** out of your data and brute force it with polygons very much the way I did with my maps. In your case you'd need to either build a dynamic model of the position of the earth relative to the sun that included the spin, tilt if you're ambitious, the wobble a way that matches up with the calendar. I guess we have a few reference points to line this up with, i.e. solstices and equinoxes, but still I think it might be tricky to get this right on. Then you could figure out the half of the earth that was on the sunny side, or more importantly the great circle which is the boundary between day and night (assuming the equatorial bulge is negligible for this). Unwinding that circle onto Tableau's map would be one of the simpler pieces. I'd probably create polygons in thin vertical slices so I didn't run into trouble when they jump from one side of the planet to the other. If you've got it right then these slices should match up and change shape seasonally in the right way I don't think it would be very accurate if you only did 24 hours.
I can't think of an easy way if that is what you're asking, but I think it would be a sort of cool feature, so if you submit it as an idea let me know so I can vote for it.
Yes, it can be done, but it will require a LOT of complex math. There is no simple one-click solution. It will require a formula to calculate the latitude for the terminator at each longitude point (at intervals such as 1 second, 1 minute, 10 minutes, or whatever resolution seems appropriate) for the particular date-time. Then, it is just a matter of using that set of coordinates to plot a polygon using the methods I describe at Mapping polygons and points together dual axis.
I like a challenge, so I am willing to tackle the math if you are sure you are willing to use the results using the described method. It will likely take a few days, since I do this in my "spare" time.
FYI - I almost have this finished. I just need to clean it up and document it, and expect to publish it later this morning.
Success! Check out the attached workbook. It uses formulas from Solar Time | PVEducation to calculate the coordinates of the terminator (sunrise or sunset) based on day and time. You can test it with manually entered dates and times, or set it to automatic (be sure to set your [Time Zone Offset] appropriately).
This was a fun challenge!
EDIT 6/11/2015 3:33PM PDT - Attachment replaced which fixes a bug on the day of an Equinox, and includes a nicer dashboard.
Daylight map 2.twbx 91.1 KB
I have no words to describe the awesome that this is.
This is absolutely amazing!
I did actually see this question a few weeks back, and have been having a play (20 mins here and there) trying to play with various solutions (purely for fun!)...and failing miserably!! I started messing about with sin curves, in an attempt to get the general idea, but hadn't even got to the stage of thinking how I'd get the sin curve to reflect the part of the earth in shadow, let alone making it dynamic!...As someone who has tried, and failed, I appreciate what a great piece of work this is...and the extra bit on the paramterisation of live/set time are lovely touches
...this goes straight into my, 'What you can do with Tableau' deck (which I use when I'm loosing the room!! )
Sir my cap it tipped!!
Thanks so much! That is very high praise from a fellow Ambassador!