Building Accessibility and Pasta

This was originally posted on my first blog, Data vs Food, in December 2017

The data set for week 50 of MakeoverMonday looked at building accessibility in Singapore. Whenever I get some data that includes location information, one of the first things I do is throw it into a map and see how it looks. The vast majority of the time I don’t end up using a map as usually I can’t see how including it improves the visualisation. I find that with widely differing sizes of regions/states/areas, smaller ones get lost while the larger ones get too much prominence – hex and tile maps alleviate this to a certain degree but can introduce their own problems with relative position.

So when it came to this week’s data I went through my usual process of creating a map first. Seeing the hierarchy of region/area/subzone, I thought this was something I could work with.

I wanted the ability to be able to drill down through the hierarchy. Doing this when you’re creating the viz is easy, put the top level on detail within the marks card and click the plus or the minus to drill down or up respectively.

But as far as my research took me, I couldn’t figure out a way to utilise this feature within a dashboard without doing some work. Thankfully it’s nice and straight forward, just one parameter:

and one calculated field:

IF [Choose a Map Level] = "Region" THEN [Region]
ELSEIF [Choose a Map Level] = "↳ Planning Area (State)" THEN [Planning Area (State)]
ELSEIF [Choose a Map Level] = "↳ Subzone (County)" THEN [Subzone (County)]
END

Put the calculated field on detail and add the parameter control to the viz and you can freely move between the different levels of the hierarchy. Though you do have to change the data type of the calculated field to a geographic role, do this by clicking on the icon to the right of the calculated field name and selecting the data type as below. Under Create from you can choose to duplicate the data type from a pre-existing field, choose the lowest level of the hierarchy otherwise the parameter won’t work correctly.

Within the parameter control, I wanted to make it clear that the user was interacting with a hierarchy that they could drill down through.

I tried to show this by using a unicode arrow, Wikipedia is great source for any sort of unicode shape, though by far the most useful section I’ve found is the Geometric Shapes. To use them in Tableau, you can either copy them from Wikipedia, copy from the symbol section in Word or enter their character code, though this doesn’t work for codes that require pressing ALT + X after typing it.
Because of the layout of the viz I wanted a vertical colour legend and currently this isn’t an option within Tableau so I had to create my own. I did this by putting the measure I wanted in the legend onto the rows shelf and then converting it to discrete. I then chose square as the mark type. This will give you squares in a single column, however if you change the size they will overlap. To get around this put the same measure onto colour, but this time leaving it as continuous and the squares will magically fit together with no gaps and the size button will no longer work.

To finish things off I used the following colour settings to give a nice discrete palette. If you’ve had a look at the data you may have noticed my error at this point.

I only spotted my error when I had another look at my viz after I’d published it. Sarah Bartlett suggested I could de-clutter my viz a little by removing the decimal places from the bar chart at the bottom. I definitely think it made an improvement.

bar-charts-decimal-places-before-after.png

As for my mistake, on the original viz I used the average level of happiness to colour the map. This didn’t match with the key I created as the key was essentially discrete values, whereas using an average on the map showed the values as continuous. To fix this I created the following calculated field to round the values down to the closest integer to zero. This fixed the problem and made the key match the map.


INT(AVG(number))
Tableau has various ways of rounding numbers, the following gives a rough idea of what they each do.

INT(number)

changes the type of number being stored to an integer and truncates it to the closest integer towards zero

ROUND(number, [decimal places])

rounds to the specified number of decimal places

CEILING(number)

rounds to the nearest integer of equal or greater value

FLOOR(number)

rounds to the nearest integer of equal or lesser value

 

And here’s what the final viz looked like, click on it for the interactive version.


Home Made Pasta & Basil Pesto

That’s what it looks like, it tasted great, and it wasn’t too much of a faff to make.

Ingredients

Basil Pesto

  • Bunch of Fresh Basil

  • 1x Garlic clove

  • Olive Oil

  • Parmesan

  • Freshly ground black pepper

  • Sea salt

  • Pine nuts

Pasta

  • 200g of ‘00’ Grade Flour

  • 2x Eggs

Method

Pesto

  1. First, dry fry the pine nuts in frying pan until they’re lightly toasted. Be careful, it’s very easy to burn them. Put them to one side and allow to cool.

  2. Put the garlic clove and some salt into a pestle and mortar and crush until they’re combined into a paste. The salt will help break down the garlic and create the paste faster.

  3. Next add the cooled pine nuts and combine as before into a paste.

  4. Add the basil, keep crushing.

  5. Finally add some grated Parmesan, black pepper, and olive oil until you get a consistency that you like.

  6. Taste it, you might want to add some more garlic, salt, pepper, Parmesan.

Pasta

  1. On a clean work surface, put the flour in a pile and make a well in the centre.

  2. Crack the eggs into the well and gently start to whisk the eggs with a fork, slowly bring more of the flour into the egg mixture.

  3. Once a rough dough starts to form, knead by hand for about ten minutes. You want a smooth elastic dough once you’re done.

  4. Wrap in cling film and let it sit at room temperature for at least 30 minutes. Make sure there is no air within the cling film otherwise the outside of the pasta will become hard.

  5. If you’ve got a pasta machine, use that to roll it out. If you don’t (like me) you’re going to have to use a rolling pin.

  6. Divide the dough into manageable amounts, if you used 200g of flour dividing into two works well.

  7. Start to roll out the pasta on a well floured work surface, it will be slow to start but you will start to see progress.Keep rolling until you can almost see your hand through it.

  8. Once you’ve got it to the desired thickness, cut it into strips using either a sharp knife or a pizza cutter. Dust the pasta with a little flour so it doesn’t stick to itself. Keep the pasta under some cling film until you’re ready to cook it.

  9. Bring a large pan of salted water to the boil and place the pasta into the pan. Fresh pasta cooks very fast, possibly in as little as 90 seconds. But you’re going to need to try it to see if it’s ready.

  10. Once it’s ready drain the pasta and mix through the basil pesto, plate up and enjoy!