gifthosting.blogg.se

Dont hug me im scared clock
Dont hug me im scared clock




  1. #DONT HUG ME IM SCARED CLOCK UPDATE#
  2. #DONT HUG ME IM SCARED CLOCK FREE#

The first thing to bear in mind is that I’ve changed the trigonometric functions to reflect how Tableau will actually plot the angles, rather than using the standard ones in maths textbooks. Now that we’ve got the right angles, we can calculate where the coördinates go.

dont hug me im scared clock

#DONT HUG ME IM SCARED CLOCK FREE#

If it bothers you that they’re not technically the same, feel free to add an IF clause to identify the afternoon and then subtract 12 hours from the Exact Hour field. Plotting 540° on this clock face will look identical to plotting 180°. Sure, 540 is bigger than the 360° that are in a circle… but the wonderful thing about circles is that they’re, well, circular. 18/12 is 1.5, and multiplying that fraction by 360 gives us 540°.

dont hug me im scared clock

You’re completely right, I haven’t accounted for that. Dividing the hour by 12 might work for the morning, but what about when it’s the afternoon, when Tableau’s DATEPART() function will return the number 18 for 6pm, as it works on a 24 hour format? “But wait!”, I hear you shout at the screen. For minutes, the same thing holds, but there are 60 points instead of 12. There are 12 hour points that go round the clock face, so if we want to find out the hour hand’s angle, we divide the hour value by 12 to find out how far around 360° it is, then multiply that fraction by 360. There are 360° in a circle, and rather conveniently, a clock face is just a big old circle, starting with 0° from the centre at the 12 o’clock position. In simple terms, the scatterplot works like this:įinding the angle is fairly simple. To be able to plot the X and Y coördinates of where the hands end, we first need to know the angle of the line from (0,0). We know that we want the clock hands to begin at (0,0) on the scatterplot what we need to work out is where the clock hands need to end. Now that we have our field to plot, we’re ready to do some trigonometry! This is why the underlying data has the Time Unit field, with separate rows for each hand. quarter of the way from 6 to 7.Īfter that, we need to create a single field to plot. 15/60 = 0.25, so the point where the hour hand will point to is 6.25, i.e. For example, if it’s 6.15pm, the number of minutes is 15, and we’re quarter of the way through the hour. 6 for 6pm), and then adding the amount of the hour that we’ve got through. So, let’s create another field called Exact Hour for the exact point between hour marks to plot: If it’s half past ten, the hour hand doesn’t point at ten exactly, it points about halfway between the ten and the eleven. There’s an extra step we need to take, though… the hour hand on a clock doesn’t point at the exact hour number for the whole of the hour, it moves around depending on the minutes that have passed. This will give the current hour and the current minute as a number. So, let’s create an Hours field and a Minutes field as follows: Let’s just go with hours and minutes plotting seconds is possible, but it’ll look like it’s not working if the dashboard isn’t updating every half second or so.

dont hug me im scared clock

The next step is to take Right Now and parse out the time parts that we want to plot. So, let’s create our Right Now field, and add eight hours to it with the DATEADD() function so that it’ll give us the UK time when published: But when it’s published on Tableau Server, it returns the time of the Tableau Server Data Engine, which seems to be eight hours behind UK time (as of 19th September 2017, when I’m writing this I’ve no idea how daylight saving changes will affect it). It returns the exact time, down to the second, of the time on your computer (assuming that you’re working in Tableau Desktop with an Excel sheet you’ve created just for this). Tableau has the NOW() function, which is really useful. That’s all we’ll need! Read that into Tableau, and the rest can be done with calculated fields.įirstly, we need to find out what the time is. All you need to get a DateTime is a single cell in a single column… but for plotting purposes, we’re going to need the following dataset: This time, we’re going to change up the trigonometry a bit, and calculate the angle while keeping how far the line goes constant.įirstly, though, we need some data to work with.

dont hug me im scared clock

I’ve written before about using radial calculations to plot distance from the centre and change the lengths while keeping the angles constant. I made the background image in Powerpoint, based on the clock in the Time episode of Don’t Hug Me I’m Scared.

#DONT HUG ME IM SCARED CLOCK UPDATE#

It always shows the current time for the UK, but it shouldn’t be hard to parameterise to update to whatever time zone you’re in.Įssentially, all it is is two points on a scatterplot, connected by lines to the coördinates (0,0), and superimposed on a background image. I made a clock in Tableau this week, and you can find it on Tableau Public here.






Dont hug me im scared clock