<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>James Laird-Smith on James Laird-Smith</title>
    <link>https://jameslairdsmith.com/</link>
    <description>Recent content in James Laird-Smith on James Laird-Smith</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <copyright>&amp;copy; 2018</copyright>
    <lastBuildDate>Wed, 20 Apr 2016 00:00:00 +0000</lastBuildDate>
    <atom:link href="/" rel="self" type="application/rss+xml" />
    
    <item>
      <title>Charts</title>
      <link>https://jameslairdsmith.com/charts/projects/</link>
      <pubDate>Wed, 20 Apr 2016 00:00:00 +0000</pubDate>
      
      <guid>https://jameslairdsmith.com/charts/projects/</guid>
      <description></description>
    </item>
    
    <item>
      <title>Software</title>
      <link>https://jameslairdsmith.com/projectspage/projects/</link>
      <pubDate>Wed, 20 Apr 2016 00:00:00 +0000</pubDate>
      
      <guid>https://jameslairdsmith.com/projectspage/projects/</guid>
      <description></description>
    </item>
    
    <item>
      <title>Customising your R experience</title>
      <link>https://jameslairdsmith.com/talk/customising-r/</link>
      <pubDate>Wed, 29 Nov 2023 00:00:00 +0000</pubDate>
      
      <guid>https://jameslairdsmith.com/talk/customising-r/</guid>
      <description></description>
    </item>
    
    <item>
      <title>Automating tasks with R</title>
      <link>https://jameslairdsmith.com/talk/earl-2022/</link>
      <pubDate>Wed, 07 Sep 2022 00:00:00 +0000</pubDate>
      
      <guid>https://jameslairdsmith.com/talk/earl-2022/</guid>
      <description></description>
    </item>
    
    <item>
      <title>Advanced data exploration with corrr</title>
      <link>https://jameslairdsmith.com/talk/r-oxford/</link>
      <pubDate>Mon, 09 May 2022 00:00:00 +0000</pubDate>
      
      <guid>https://jameslairdsmith.com/talk/r-oxford/</guid>
      <description></description>
    </item>
    
    <item>
      <title>corrr 0.4.3</title>
      <link>https://jameslairdsmith.com/post/2021-12-09-corrr-0-4-3/</link>
      <pubDate>Wed, 09 Dec 2020 00:00:00 +0000</pubDate>
      
      <guid>https://jameslairdsmith.com/post/2021-12-09-corrr-0-4-3/</guid>
      <description></description>
    </item>
    
    <item>
      <title>Folkestone, July 2020</title>
      <link>https://jameslairdsmith.com/photography/folkestone-july-2020/</link>
      <pubDate>Fri, 31 Jul 2020 00:00:00 +0000</pubDate>
      
      <guid>https://jameslairdsmith.com/photography/folkestone-july-2020/</guid>
      <description>

&lt;div class=&#34;gallery&#34;&gt;
  
  
  
  
    
  
  &lt;a data-fancybox=&#34;gallery-images&#34; data-caption=&#34;Stairway&#34; href=&#34;https://lh3.googleusercontent.com/pw/ACtC-3cg3JGI8t3CSQ0ldT7YfNV2QokQBwftzaonwuS6Y8PmGS1uzn2yqXTVBOY2TthAmPBGm7OhTNW5VWxdm30QLXELrvGlIT8aIGpqq7UragwzdBkpCEV4qbmyWZVd1UH6vJqNETemovd_E2bepyTUL2tC5w=w2106-h1578-no?authuser=0&#34;&gt;
    &lt;img alt=&#34;&#34; src=&#34;https://lh3.googleusercontent.com/pw/ACtC-3cg3JGI8t3CSQ0ldT7YfNV2QokQBwftzaonwuS6Y8PmGS1uzn2yqXTVBOY2TthAmPBGm7OhTNW5VWxdm30QLXELrvGlIT8aIGpqq7UragwzdBkpCEV4qbmyWZVd1UH6vJqNETemovd_E2bepyTUL2tC5w=w2106-h1578-no?authuser=0&#34;&gt;
  &lt;/a&gt;
  
  
  
  
    
  
  &lt;a data-fancybox=&#34;gallery-images&#34; data-caption=&#34;Stairway 2&#34; href=&#34;https://lh3.googleusercontent.com/Exbe5PO5tOBuvfSsjdw0wKwJfKfnhli2nQS3ui4ZupOtiPmV-q3eFARpZl8bwq4mWo2N_VbPLZJz0j0rNnNNweK5d0A1NatwvdFOINkUe5x1CtNmQ3mPg4r_c_DuzpKyMTOiUebUl5k=w2400&#34;&gt;
    &lt;img alt=&#34;&#34; src=&#34;https://lh3.googleusercontent.com/Exbe5PO5tOBuvfSsjdw0wKwJfKfnhli2nQS3ui4ZupOtiPmV-q3eFARpZl8bwq4mWo2N_VbPLZJz0j0rNnNNweK5d0A1NatwvdFOINkUe5x1CtNmQ3mPg4r_c_DuzpKyMTOiUebUl5k=w2400&#34;&gt;
  &lt;/a&gt;
  
&lt;/div&gt;
</description>
    </item>
    
    <item>
      <title>Mayfair, summer 2020</title>
      <link>https://jameslairdsmith.com/photography/mayfair-summer-2020/</link>
      <pubDate>Fri, 17 Jul 2020 00:00:00 +0000</pubDate>
      
      <guid>https://jameslairdsmith.com/photography/mayfair-summer-2020/</guid>
      <description>

&lt;div class=&#34;gallery&#34;&gt;
  
  
  
  
    
  
  &lt;a data-fancybox=&#34;gallery-images&#34; data-caption=&#34;Grosvenor Square&#34; href=&#34;https://lh3.googleusercontent.com/oil4CSsf4vrWvkixeJ_AEQhqEuQnhKxt4hbmCx49aYpd2yuydGCs2GHqmTalpjE96FXQgUME8rHK-hNNsrSM_kZAx-0ybvd3YscaTXOhKP215TyGmrxouvzfMuGwJ9IoKwJullK4IQhI9juI1UaNTlI6wLtQJSh4-ewauuwu_sA01y1xshPLBVH_UUJfdflV-rRSfgpFoqWwCn3P6zFi9cdGfh_8dQ44YOSZoOI1DHiPfcD5rUyUB1tIfVmJnJPPC7rBMQ93KEtX6e74LNHcZIDW2nPWJJwEGsDyKl0SCUO61eGLzGnxkDvq7smiO7hNZvXutCgQhWyYvFNcvIcieHHK1wqny-wqbyN8QsQEzd8qQoTvx8mpPT66k1GO2IKc_MZtMzdLZDM52oCYMvPR6tcldVRyMX3ytYQ-heY4H-Svz7zH35A2hoLtoC-Zn4Xaw9nRi0xluoWFIJ0ohqv_EUxHITISwx3LpeLojefm1bBZNOXUu53qqyqVu6Gc3n0fj3B8fD3jS2SzBv1pZ9ekKfCyj56fqzuL-QfpEB5Jy5Z11vuKn1evzP3RFJVLl8Sljstia2T2BxcLZrX_PmHMR8--K7AbisA8Wekfm8aDsHcg3zjhUtuO-arA0y4iB3-x7ze_ZfGy4N4WVuani9WoYAthoiI7sKeVMMjYQ0Oohuc4_rACD1ExQDgpPO62E6o=w2160-h1440-no?authuser=0&#34;&gt;
    &lt;img alt=&#34;&#34; src=&#34;https://lh3.googleusercontent.com/oil4CSsf4vrWvkixeJ_AEQhqEuQnhKxt4hbmCx49aYpd2yuydGCs2GHqmTalpjE96FXQgUME8rHK-hNNsrSM_kZAx-0ybvd3YscaTXOhKP215TyGmrxouvzfMuGwJ9IoKwJullK4IQhI9juI1UaNTlI6wLtQJSh4-ewauuwu_sA01y1xshPLBVH_UUJfdflV-rRSfgpFoqWwCn3P6zFi9cdGfh_8dQ44YOSZoOI1DHiPfcD5rUyUB1tIfVmJnJPPC7rBMQ93KEtX6e74LNHcZIDW2nPWJJwEGsDyKl0SCUO61eGLzGnxkDvq7smiO7hNZvXutCgQhWyYvFNcvIcieHHK1wqny-wqbyN8QsQEzd8qQoTvx8mpPT66k1GO2IKc_MZtMzdLZDM52oCYMvPR6tcldVRyMX3ytYQ-heY4H-Svz7zH35A2hoLtoC-Zn4Xaw9nRi0xluoWFIJ0ohqv_EUxHITISwx3LpeLojefm1bBZNOXUu53qqyqVu6Gc3n0fj3B8fD3jS2SzBv1pZ9ekKfCyj56fqzuL-QfpEB5Jy5Z11vuKn1evzP3RFJVLl8Sljstia2T2BxcLZrX_PmHMR8--K7AbisA8Wekfm8aDsHcg3zjhUtuO-arA0y4iB3-x7ze_ZfGy4N4WVuani9WoYAthoiI7sKeVMMjYQ0Oohuc4_rACD1ExQDgpPO62E6o=w2160-h1440-no?authuser=0&#34;&gt;
  &lt;/a&gt;
  
  
  
  
    
  
  &lt;a data-fancybox=&#34;gallery-images&#34;  href=&#34;https://lh3.googleusercontent.com/YsfPHHRkw0iRpPSe65NNk8PE0aKdid9D5y3Elz908sY-8W68VBdxfzwmgKncvW2As1ak-rzWQXeGKrqk6AYY_kkb1EeerdsMOAx5wPomPJmTTIzbP_qTz5E40dbAM7_N1xVwKrd6g4mCPBMHuOvp46kvVpBNfAxs2qmfVbDeSvJs2sEXNhVDdR-dm48z9sxKMEokKN4IkC2EYNzX-RDI2yX92Z0dKM0lTWEpHc53dA3Cg7Qjwu7wD5BhMbL971_qyVzxHMCGg1iuvRYcBvquirTpEPwHgGuaZTn7qVL8-YRBuOCThjePIGXoQ7H6VtxBxItVOlL5fkaMmFgRhYEed__wjY5o1a24IGAeh0mk6OSCnCArCU03LD6gcEyxdLFgoEPAQYen8nw33GFB99PZL-HhP-3SCg_ur5vKhgWW2uVrT1w0hIQmVyMLbRDO0X8g8rD3yHN1taivCLzCBX0BtL8tWMylU1YS_uFmPL5UY9ApoeQCQO4SapraCzin6wGl-LwUTbxOqvmDTQTKYN1PGsopNfYUVOwUZirq8orkKIxyIJbrFjlFNSdEwv-TaknZHTW_GgqRYHkQEZQoDJkpKCrfYJWz_D_jGsJkG3CTn0NjqrIZrYshOQ8ARNR9QeuXp1GyI2ZksoxJcbx9DJho5_aBQBCGgDvt0OT8VHWlYRuWRCPbuDNRICcIUtMwB_8=w2368-h1578-no?authuser=0&#34;&gt;
    &lt;img alt=&#34;&#34; src=&#34;https://lh3.googleusercontent.com/YsfPHHRkw0iRpPSe65NNk8PE0aKdid9D5y3Elz908sY-8W68VBdxfzwmgKncvW2As1ak-rzWQXeGKrqk6AYY_kkb1EeerdsMOAx5wPomPJmTTIzbP_qTz5E40dbAM7_N1xVwKrd6g4mCPBMHuOvp46kvVpBNfAxs2qmfVbDeSvJs2sEXNhVDdR-dm48z9sxKMEokKN4IkC2EYNzX-RDI2yX92Z0dKM0lTWEpHc53dA3Cg7Qjwu7wD5BhMbL971_qyVzxHMCGg1iuvRYcBvquirTpEPwHgGuaZTn7qVL8-YRBuOCThjePIGXoQ7H6VtxBxItVOlL5fkaMmFgRhYEed__wjY5o1a24IGAeh0mk6OSCnCArCU03LD6gcEyxdLFgoEPAQYen8nw33GFB99PZL-HhP-3SCg_ur5vKhgWW2uVrT1w0hIQmVyMLbRDO0X8g8rD3yHN1taivCLzCBX0BtL8tWMylU1YS_uFmPL5UY9ApoeQCQO4SapraCzin6wGl-LwUTbxOqvmDTQTKYN1PGsopNfYUVOwUZirq8orkKIxyIJbrFjlFNSdEwv-TaknZHTW_GgqRYHkQEZQoDJkpKCrfYJWz_D_jGsJkG3CTn0NjqrIZrYshOQ8ARNR9QeuXp1GyI2ZksoxJcbx9DJho5_aBQBCGgDvt0OT8VHWlYRuWRCPbuDNRICcIUtMwB_8=w2368-h1578-no?authuser=0&#34;&gt;
  &lt;/a&gt;
  
&lt;/div&gt;
</description>
    </item>
    
    <item>
      <title></title>
      <link>https://jameslairdsmith.com/chart/favourite-colours/</link>
      <pubDate>Fri, 05 Jun 2020 00:00:00 +0000</pubDate>
      
      <guid>https://jameslairdsmith.com/chart/favourite-colours/</guid>
      <description>&lt;p&gt;&lt;html&gt;
&lt;head&gt;
  &lt;title&gt;Embedding Vega-Lite&lt;/title&gt;
  &lt;script src=&#34;https://cdn.jsdelivr.net/npm/vega@5&#34;&gt;&lt;/script&gt;
  &lt;script src=&#34;https://cdn.jsdelivr.net/npm/vega-lite@4&#34;&gt;&lt;/script&gt;
  &lt;script src=&#34;https://cdn.jsdelivr.net/npm/vega-embed@6&#34;&gt;&lt;/script&gt;
  &lt;script src=&#34;https://cdn.jsdelivr.net/npm/vega-lite-api@0.11.0&#34;&gt;&lt;/script&gt;&lt;/p&gt;

&lt;style&gt;
#visContainer {
  width: min(720px, 100%);
  line-height:0;
  margin: auto;
}

#vis {
  width: 100%;
  margin: auto;
}

#visCaption{
  font-size: 50%;
  line-height: 1;
  font-size: 0.5rem;
  color: #696969;
}

#visSubHeading{
  font-style: italic;
  padding-bottom: 100;
  margin-bottom: 2%;
  line-height: 1;
}

#visHeading{
  padding-bottom: &#34;100%&#34;;
  margin-top: 0;
  line-height: 1;
}

article .article-metadata {
    margin-bottom: 0;
}

&lt;/style&gt;

&lt;p&gt;&lt;/head&gt;
&lt;body&gt;&lt;/p&gt;

&lt;div id=&#34;visContainer&#34;&gt;

&lt;div id=&#34;headingblock&#34; align=&#34;center&#34;&gt;
    &lt;h3 align=&#34;left&#34; id=&#34;visHeading&#34;&gt;Everyone&#39;s favorite colours&lt;/h3&gt;
    &lt;p align=&#34;left&#34; id=&#34;visSubHeading&#34;&gt;Saturation&lt;/p&gt;
&lt;/div&gt;

&lt;div id=&#34;vis&#34;&gt;&lt;/div&gt;

&lt;p align=&#34;left&#34; id=&#34;visCaption&#34;&gt;Source: Survey of Reddit users, 2017&lt;/p&gt; 

&lt;p&gt;&lt;/div&gt;&lt;/p&gt;

&lt;script type=&#34;text/javascript&#34;&gt;

url_string = &#34;https://gist.githubusercontent.com/jameslairdsmith/0d846a5eb3bc81076e497d522629c2b4/raw/ed154a51b07ab9d8329fb47d7eda862d9199b6a2/fav_colour_data.csv&#34;;

el = document.getElementById(&#39;visSubHeading&#39;);

style = window.getComputedStyle(el, null).getPropertyValue(&#39;font-size&#39;);

fontFamily = window.getComputedStyle(el, null).getPropertyValue(&#39;font-family&#39;);

subFontSize = parseFloat(style); 

yAxisSpec = {title: null,
             //tickCount: 5,
             ticks: false,
             domain: false,
             orient: &#34;left&#34;,
             labelFontSize: subFontSize - 2,
             labelFont: fontFamily,
             labelFlush: false,
             //labelPadding: -20,
             values: [0, 0.2, 0.4, 0.6, 0.8, 1],
             grid: true};
             
xAxisSpec = {title: &#34;Hue&#34;,
             grid: false,
             //tickCount: 5,
             maxExtent: 40,
             orient: &#34;bottom&#34;,
             minExtent: 40,
             labelPadding: 20,
             titleFontSize: subFontSize - 1,
             titleFont: fontFamily,
             titlePadding: 5,
             labelFontSize: subFontSize - 1,
             labelFont: fontFamily,
             domain:false,
             values: [0, 0.2, 0.4, 0.6, 0.8, 1],
             ticks: false}
             
width = document.getElementById(&#34;vis&#34;).offsetWidth;
             
if (width &gt; 450) {
  sizeLegendOrient = &#34;right&#34;
  sizeLegendDirection = &#34;vertical&#34;
  sizeLegendTitle = [&#34;Share of&#34;, &#34; responses&#34;]
} else {
  sizeLegendOrient = &#34;top&#34;
  sizeLegendDirection = &#34;horizontal&#34;
  sizeLegendTitle = &#34;Share of responses&#34;
}
    
             
sizeLegend =  {title: sizeLegendTitle,
               titleFontSize: subFontSize - 3,
               titleFont: fontFamily,
               labelFontSize: subFontSize - 3,
               labelFont: fontFamily,
               direction: sizeLegendDirection,
               padding: 0,
               //orient: &#34;none&#34;,
               orient: sizeLegendOrient,
               //legendX: 325,
               //legendY: -5.5,
               values: [0.01, 0.05, 0.1, 0.15],
               //offset: 0,
               format: &#34;%&#34;}
               
minPointSize = 20
maxPointSize =  1200
               
sizeScale = {range: [minPointSize, maxPointSize], 
             nice: false,
             clamp: false}
               
autosizeSpec = {type: &#34;fit&#34;, 
                resize: true, 
                contains: &#34;padding&#34;}
                
myToolTip = [&#34;colour&#34;,
                      &#34;colour_hex&#34;, 
                      &#34;prop_total&#34;,
                      &#34;color_hue&#34;]
                      
myBetterToolTip = [
      {&#34;field&#34;: &#34;colour&#34;,
       title: &#34;Colour name&#34;,
       &#34;type&#34;: &#34;nominal&#34;},
      {&#34;field&#34;: &#34;prop_total&#34;, 
       &#34;type&#34;: &#34;quantitative&#34;, 
       format: &#34;.2%&#34;, 
       title: &#34;Share of reponses&#34;}
    ]

const plot = vl
        .markPoint({filled: true})
        .data(vl.csv(url_string))
        .encode(
          vl.x()
            .fieldQ(&#34;color_hue&#34;)
            .scale({domain: [-0.05, 1]})
            .axis(xAxisSpec),
          vl.y()
            .fieldQ(&#34;color_saturation&#34;)
            .scale({domain: [-0, 1]})
            .axis(yAxisSpec),
          vl.size()
            .fieldQ(&#34;prop_total&#34;)
            .scale(sizeScale)
            .legend(sizeLegend),
          vl.color()
            .fieldN(&#34;colour_hex&#34;)
            .scale(null),
          vl.fillOpacity().value(100),
          vl.tooltip(myBetterToolTip)
        )
        .width(&#34;container&#34;)
        .height(500)
        .autosize(&#34;fit&#34;)
        .config({style: {cell: {stroke: &#34;transparent&#34;}},
                 background: null})
        .toJSON();



opt = ({
      &#34;actions&#34;: false,
      &#34;tooltip&#34;: true
    });
    
vegaEmbed(&#34;#vis&#34;, plot, opt);

//vis.style.transform = &#34;translateY(-20px)&#34;;

&lt;/script&gt;

&lt;p&gt;&lt;/body&gt;&lt;/p&gt;

&lt;p&gt;&lt;/html&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title></title>
      <link>https://jameslairdsmith.com/chart/when-i-read/</link>
      <pubDate>Fri, 22 May 2020 00:00:00 +0000</pubDate>
      
      <guid>https://jameslairdsmith.com/chart/when-i-read/</guid>
      <description>&lt;p&gt;&lt;html&gt;
&lt;head&gt;
  &lt;title&gt;Embedding Vega-Lite&lt;/title&gt;
  &lt;script src=&#34;https://d3js.org/d3.v5.js&#34;&gt;&lt;/script&gt;
  &lt;script src=&#34;https://cdn.jsdelivr.net/npm/vega@5&#34;&gt;&lt;/script&gt;
  &lt;script src=&#34;https://cdn.jsdelivr.net/npm/vega-lite@4&#34;&gt;&lt;/script&gt;
  &lt;script src=&#34;https://cdn.jsdelivr.net/npm/vega-embed@6&#34;&gt;&lt;/script&gt;&lt;/p&gt;

&lt;p&gt;&lt;/head&gt;&lt;/p&gt;

&lt;p&gt;&lt;body&gt;&lt;/p&gt;

&lt;div id=&#34;test&#34;&gt;&lt;/div&gt;

&lt;div id=&#34;headingblock&#34; align=&#34;center&#34;&gt;
    &lt;h3 align=&#34;left&#34; id=&#34;readhead&#34;&gt;When I read&lt;/h3&gt;
    &lt;p align=&#34;left&#34; id=&#34;readsubhead&#34;&gt;Proportion of my Kindle annotations&amp;#8224;&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;&lt;div id=&#34;readvis&#34; align=&#34;center&#34;&gt;&lt;/div&gt;
&lt;p align=&#34;left&#34; id=&#34;readsource&#34;&gt;&amp;#8224;Includes highlights, bookmarks and comments.&lt;/p&gt;&lt;/p&gt;

&lt;script type=&#34;text/javascript&#34;&gt;

width = document.getElementById(&#34;test&#34;).offsetWidth;

maxWidth = 630;

getWorkingWidth = function(width,maxWidth){if(width &lt; maxWidth)
                                          {return width}
                                          else {return maxWidth}};
                                          
plotWidth = getWorkingWidth(width, maxWidth);

aspectRatio = 0.75;

plotMaxHeight = 350;

plotHight =  Math.max(aspectRatio * plotWidth, plotMaxHeight);

leftMargin = (width - plotWidth)/2;

rightMargin = leftMargin;

document.getElementById(&#34;readhead&#34;)
    .setAttribute(
      &#34;style&#34;,`
      margin-top: 0;
      margin-left: ${leftMargin}px;
      margin-right: ${rightMargin}px`);
      
document.getElementById(&#34;readsubhead&#34;)
    .setAttribute(
      &#34;style&#34;,`
      margin-left: ${leftMargin}px;
      margin-right: ${rightMargin}px;
      font-style: italic;
      //margin-bottom: 0;
      text-align:left;`);
      
document.getElementById(&#34;readsource&#34;)
    .setAttribute(
      &#34;style&#34;, `
      margin-left: ${leftMargin}px; 
      margin-right: ${rightMargin}px;
      font-size: 0.5rem;
      color: #696969;
      //margin-bottom: 0; 
      text-align:left;`);
      
document.getElementById(&#34;readvis&#34;)
    .setAttribute(
      &#34;style&#34;, `
      margin-left: ${leftMargin}px; 
      margin-right: ${rightMargin}px;
      margin-top: 0;
      // font-size: 0.7rem;
      // color: #696969;
      // margin-bottom: 0; 
      //text-align:right;`
);

el = document.getElementById(&#39;readsubhead&#39;);

style = window.getComputedStyle(el, null).getPropertyValue(&#39;font-size&#39;);

fontFamily = window.getComputedStyle(el, null).getPropertyValue(&#39;font-family&#39;);

subFontSize = parseFloat(style); 

yAxis = {title: null,
         //tickCount: 4,
         ticks: false,
         domain:false,
         labelFontSize: subFontSize - 3,
         labelFont: fontFamily,
         labelPadding: 5,
         orient: &#34;left&#34;,
         grid: true,
         format: &#34;%&#34;};
         
xAxis = {title: null,
         grid: false,
         format: &#34;%-I %p&#34;,
         labelFontSize: subFontSize - 3,
         labelFont: fontFamily,
         maxExtent: 40,
         orient: &#34;bottom&#34;,
         minExtent: 40,
         labelPadding: 12,
         titleFontSize: subFontSize - 3,
         titleFont: fontFamily,
         titlePadding: -4,
         domain:false,
         ticks: false};
         
colorLegend = {orient: &#34;none&#34;, 
               title: null,
               direction: &#34;vertical&#34;,
               padding: 0,
               labelOffset: -20,
               labelAlign: &#34;right&#34;,
               titlePadding: 0,
               labelFont: fontFamily,
               //legendX : -25,
               //legendY: -15,
               legendX : plotWidth-40,
               legendY: -30,
               titleFontSize: subFontSize - 3,
               labelFontSize: subFontSize - 3};

plot = {
  &#34;$schema&#34;: &#34;https://vega.github.io/schema/vega-lite/v4.json&#34;,
  &#34;data&#34;: { &#34;url&#34;: &#34;https://gist.githubusercontent.com/jameslairdsmith/2681e69a86b96beb73d46f1f69a12b72/raw/7543131d5304c5ccbb349949f675219307bcc84c/my_hourly_reading_counts.csv&#34;,
  &#34;format&#34;: {
      &#34;parse&#34;: {&#34;added_hour&#34;: &#34;utc:&#39;%H:%M:%S&#39;&#34;}
    }
    },
  padding: {&#34;left&#34;: 0, &#34;top&#34;: 0, &#34;right&#34;: 0, &#34;bottom&#34;: 0},
  width: plotWidth*0.9,
  height: plotHight/2.5,
  //autosize: {
  //      type: &#34;fit&#34;,
  //      contains: &#34;padding&#34;
  //    },
  &#34;config&#34;: {&#34;view&#34;: {&#34;stroke&#34;: &#34;transparent&#34;}},
  &#34;transform&#34;: [
    {&#34;calculate&#34;: &#34;datum.is_weekend == &#39;TRUE&#39; ? &#39;Weekends&#39; : &#39;Weekdays&#39;&#34;,
     &#34;as&#34;: &#34;is_weekend&#34;},
    {&#34;calculate&#34;: &#34;toNumber(datum.n)&#34;, &#34;as&#34;: &#34;n&#34;},
    {&#34;joinaggregate&#34;: [{
          &#34;op&#34;: &#34;sum&#34;,
          &#34;field&#34;: &#34;n&#34;,
          &#34;as&#34;: &#34;totalN&#34;
        }],
        &#34;groupby&#34;: [&#34;is_weekend&#34;]
      },
    {&#34;calculate&#34;: &#34;(datum.n/datum.totalN)&#34;, &#34;as&#34;: &#34;my_density&#34;}
  ],
  &#34;mark&#34;: &#34;bar&#34;,
  &#34;encoding&#34;: {
    &#34;row&#34;: {&#34;field&#34;: &#34;is_weekend&#34;, 
            &#34;sort&#34;: &#34;descending&#34;,
            spacing:  30,
            &#34;header&#34;: {&#34;title&#34;: null,
                       &#34;labelOrient&#34;: &#34;top&#34;,
                       &#34;labelAnchor&#34;:&#34;middle&#34;,
                       labelFont: fontFamily,
                       labelFontSize: subFontSize - 3,
                       &#34;labelAngle&#34;: 0,
                       labelFontWeight: &#34;bold&#34;,
                       &#34;labelAlign&#34;:&#34;right&#34;,
                       &#34;labelPadding&#34;: 0},
            &#34;type&#34;: &#34;nominal&#34;},
    &#34;y&#34;: {
      &#34;field&#34;: &#34;my_density&#34;, &#34;type&#34;: &#34;quantitative&#34;,
      &#34;aggregate&#34;: &#34;sum&#34;,
      &#34;axis&#34;: yAxis
    },
    &#34;x&#34;: {&#34;field&#34;: &#34;added_hour&#34;,
          &#34;axis&#34;: xAxis,
          &#34;timeUnit&#34;: {&#34;unit&#34; :&#34;utchoursminutes&#34;,
                       &#34;step&#34;: 30},
          &#34;type&#34;: &#34;temporal&#34;},
    &#34;color&#34;: {
      &#34;legend&#34;: colorLegend,
      &#34;field&#34;: &#34;reading_type&#34;, &#34;type&#34;: &#34;nominal&#34;,
      &#34;scale&#34;: {&#34;range&#34;: [&#34;#4d4d4d&#34;, &#34;#b1b1b1&#34;]}
    }
  }
}

opt = ({
      &#34;actions&#34;: false,
      &#34;tooltip&#34;: false
    });
    
vegaEmbed(&#34;#readvis&#34;, plot, opt);


&lt;/script&gt;

&lt;p&gt;&lt;/body&gt;&lt;/p&gt;

&lt;p&gt;&lt;/html&gt;&lt;/p&gt;

&lt;p&gt;The ancient Greek maxium to &amp;lsquo;know thyself&amp;rsquo; becomes much easier with data.
But data on one&amp;rsquo;s self is suprisingly hard to come by. To make one small inroad
into fixing this, I&amp;rsquo;ve gone about extracting all the annotations from my
Kindle e-reader. This lets me see not just my highlights, bookmarks and
comments but also when they were made. Plotting these by the time of day they
were created (see chart) gives a retrospective of my reading life.&lt;/p&gt;

&lt;p&gt;My weekdays look to be quite regimented, at least during the daytime. The
noticeable peaks are for commuting and lunch breaks, filled almost exclusively
by news reading. My evenings are more leisurely: with more spread-out reading
of both news and books.&lt;/p&gt;

&lt;p&gt;By contrast, weekends are dominated by books rather than news, with reading
spead over more hours and with more gentle starts to the day. The practice
resumes in the evening after a day of activity. Rarely does my reading strech
past eleven, regardless of the day. All the better to rest and return afresh
tomorrow.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Competitive debate record</title>
      <link>https://jameslairdsmith.com/debate/</link>
      <pubDate>Sun, 12 Jan 2020 00:00:00 +0000</pubDate>
      
      <guid>https://jameslairdsmith.com/debate/</guid>
      <description>&lt;script src=&#34;https://jameslairdsmith.com/rmarkdown-libs/core-js/shim.min.js&#34;&gt;&lt;/script&gt;
&lt;script src=&#34;https://jameslairdsmith.com/rmarkdown-libs/react/react.min.js&#34;&gt;&lt;/script&gt;
&lt;script src=&#34;https://jameslairdsmith.com/rmarkdown-libs/react/react-dom.min.js&#34;&gt;&lt;/script&gt;
&lt;script src=&#34;https://jameslairdsmith.com/rmarkdown-libs/reactwidget/react-tools.js&#34;&gt;&lt;/script&gt;
&lt;script src=&#34;https://jameslairdsmith.com/rmarkdown-libs/htmlwidgets/htmlwidgets.js&#34;&gt;&lt;/script&gt;
&lt;script src=&#34;https://jameslairdsmith.com/rmarkdown-libs/reactable-binding/reactable.js&#34;&gt;&lt;/script&gt;


&lt;style&gt;
.article-container {
  max-width: 1200px;
}

.article-date {
  display:none;
}
&lt;/style&gt;
&lt;p&gt;For a big part of my life, I have involved myself in competitive debating.
This is different from ordinary debate in that participants rarely
know the topics in advance and cannot choose the position from which they argue.
The winners and losers of a competitive debate are not chosen by an audience,
but rather by a panel of other competitive debaters.&lt;/p&gt;
&lt;p&gt;Much of competitive debating is centered around competitions. These take place
all over the world and involve many rounds of debate happening over a number of
days. Because competitive debate is still a student-centered
activity, most of these competitions are hosted by university debate societies.&lt;/p&gt;
&lt;p&gt;The following table is a summary of some of my performances, both as a speaker
and a judge, at various debate competitions.&lt;/p&gt;
&lt;p&gt;Each of the rows represents a different competition. To “break” at a debate
competition is a good thing: it means to progress through to the elimination
rounds. In these later stages teams compete to knock each another out and
so fewer panels of judges are required. As such, the quality of a speaker or
judge is indicated by how far into a competition they progress.&lt;br&gt;
&lt;br&gt;&lt;/p&gt;
&lt;div id=&#34;htmlwidget-1&#34; class=&#34;reactable html-widget&#34; style=&#34;width:auto;height:auto;&#34;&gt;&lt;/div&gt;
&lt;script type=&#34;application/json&#34; data-for=&#34;htmlwidget-1&#34;&gt;{&#34;x&#34;:{&#34;tag&#34;:{&#34;name&#34;:&#34;Reactable&#34;,&#34;attribs&#34;:{&#34;data&#34;:{&#34;rn&#34;:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],&#34;competition&#34;:[&#34;WUDC&#34;,&#34;SANUDC&#34;,&#34;PAUDC&#34;,&#34;LSE Open&#34;,&#34;Oxford IV&#34;,&#34;Inner Temple Open&#34;,&#34;Imperial Open&#34;,&#34;UCL IV&#34;,&#34;LSE Asians&#34;,&#34;KCL Open&#34;,&#34;KCL IV&#34;,&#34;SANUDC&#34;,&#34;Cape Town Open&#34;,&#34;UCT 150th Year Open&#34;,&#34;The Science Open&#34;,&#34;Sci-Fi Open&#34;,&#34;UCL President&#39;s Cup&#34;,&#34;SOAS and Friends Mini-Open&#34;,&#34;SANUDC&#34;,&#34;KCL Pro-Am&#34;,&#34;KCL Pro-Am&#34;,&#34;LSE Pro-Am&#34;,&#34;KCL Schools&#34;,&#34;UCL Schools&#34;,&#34;Imperial Schools&#34;,&#34;Imperial Novices&#34;,&#34;UCL Schools&#34;,&#34;WUDC&#34;,&#34;WUDC&#34;,&#34;Imperial IV&#34;,&#34;Imperial Open&#34;,&#34;Cambridge IV&#34;,&#34;LSE Open&#34;,&#34;Oxford IV&#34;],&#34;year&#34;:[2019,2013,2012,2018,2018,2019,2019,2018,2018,2018,2018,2011,2017,2015,2018,2018,2018,2019,2014,2018,2018,2019,2018,2018,2018,2018,2019,2014,2016,2018,2018,2018,2019,2019],&#34;role&#34;:[&#34;Judge&#34;,&#34;Speaker&#34;,&#34;Speaker&#34;,&#34;Judge&#34;,&#34;Judge&#34;,&#34;Judge&#34;,&#34;Judge&#34;,&#34;Judge&#34;,&#34;Judge&#34;,&#34;Judge&#34;,&#34;Judge&#34;,&#34;Judge&#34;,&#34;Judge&#34;,&#34;Judge&#34;,&#34;Judge&#34;,&#34;Judge&#34;,&#34;Judge&#34;,&#34;Judge&#34;,&#34;Speaker&#34;,&#34;Judge&#34;,&#34;Judge&#34;,&#34;Judge&#34;,&#34;Judge&#34;,&#34;Judge&#34;,&#34;Judge&#34;,&#34;Judge&#34;,&#34;Judge&#34;,&#34;Judge&#34;,&#34;Judge&#34;,&#34;Judge&#34;,&#34;Judge&#34;,&#34;Judge&#34;,&#34;Judge&#34;,&#34;Judge&#34;],&#34;broke&#34;:[&#34;✅&#34;,&#34;✅&#34;,&#34;✅&#34;,&#34;✅&#34;,&#34;✅&#34;,&#34;✅&#34;,&#34;✅&#34;,&#34;✅&#34;,&#34;✅&#34;,&#34;✅&#34;,&#34;✅&#34;,&#34;✅&#34;,&#34;✅&#34;,&#34;✅&#34;,&#34;✅&#34;,&#34;✅&#34;,&#34;✅&#34;,&#34;✅&#34;,&#34;✅&#34;,&#34;✅&#34;,&#34;✅&#34;,&#34;✅&#34;,&#34;✅&#34;,&#34;✅&#34;,&#34;✅&#34;,&#34;✅&#34;,&#34;✅&#34;,&#34;❌&#34;,&#34;❌&#34;,&#34;❌&#34;,&#34;❌&#34;,&#34;❌&#34;,&#34;❌&#34;,&#34;❌&#34;],&#34;competition_type&#34;:[&#34;World Championship&#34;,&#34;National Championship&#34;,&#34;Continental Championship&#34;,&#34;Open&#34;,&#34;Universities&#34;,&#34;Open&#34;,&#34;Open&#34;,&#34;Universities&#34;,&#34;Open&#34;,&#34;Open&#34;,&#34;Universities&#34;,&#34;National Championship&#34;,&#34;Open&#34;,&#34;Open&#34;,&#34;Open&#34;,&#34;Open&#34;,&#34;Novices&#34;,&#34;Open&#34;,&#34;National Championship&#34;,&#34;Pro-Am&#34;,&#34;Pro-Am&#34;,&#34;Pro-Am&#34;,&#34;Schools&#34;,&#34;Schools&#34;,&#34;Schools&#34;,&#34;Novices&#34;,&#34;Schools&#34;,&#34;World Championship&#34;,&#34;World Championship&#34;,&#34;Universities&#34;,&#34;Open&#34;,&#34;Universities&#34;,&#34;Open&#34;,&#34;Universities&#34;],&#34;reached&#34;:[&#34;Semi-Final&#34;,&#34;Finals&#34;,&#34;Semi-Finals&#34;,&#34;Quarter Final&#34;,&#34;Quarter Final&#34;,&#34;Chaired Semi-Final&#34;,&#34;Final&#34;,&#34;Final&#34;,&#34;Final&#34;,&#34;Final&#34;,&#34;Semi-Final&#34;,&#34;Semi-Final&#34;,&#34;Final&#34;,&#34;Chaired Semi-Final&#34;,&#34;Final&#34;,&#34;Final&#34;,&#34;Semi-Final&#34;,&#34;Chaired Novice Final&#34;,&#34;Semi-Finals&#34;,&#34;Final&#34;,&#34;Final&#34;,&#34;Final&#34;,&#34;Final&#34;,&#34;Final&#34;,&#34;Final&#34;,&#34;Final&#34;,&#34;Was the CA&#34;,null,null,null,null,null,null,null],&#34;date_first_day&#34;:[&#34;2018-12-27&#34;,&#34;2013-06-29&#34;,&#34;2012-12-09&#34;,&#34;2018-02-10&#34;,&#34;2018-11-09&#34;,&#34;2019-01-18&#34;,&#34;2019-10-12&#34;,&#34;2018-03-10&#34;,&#34;2018-06-09&#34;,&#34;2018-06-30&#34;,&#34;2018-10-27&#34;,&#34;2011-07-09&#34;,&#34;2017-04-29&#34;,&#34;2015-07-24&#34;,&#34;2018-03-18&#34;,&#34;2018-03-25&#34;,&#34;2018-10-06&#34;,&#34;2019-02-24&#34;,&#34;2014-07-06&#34;,&#34;2018-03-24&#34;,&#34;2018-10-20&#34;,&#34;2019-01-13&#34;,&#34;2018-02-03&#34;,&#34;2018-02-24&#34;,&#34;2018-03-17&#34;,&#34;2018-10-14&#34;,&#34;2019-01-26&#34;,&#34;2013-12-27&#34;,&#34;2015-12-27&#34;,&#34;2018-07-07&#34;,&#34;2018-10-13&#34;,&#34;2018-11-16&#34;,&#34;2019-02-09&#34;,&#34;2019-11-08&#34;]},&#34;columns&#34;:[{&#34;accessor&#34;:&#34;rn&#34;,&#34;name&#34;:&#34;#&#34;,&#34;type&#34;:&#34;numeric&#34;,&#34;maxWidth&#34;:45,&#34;align&#34;:&#34;left&#34;},{&#34;accessor&#34;:&#34;competition&#34;,&#34;name&#34;:&#34;Competition name&#34;,&#34;type&#34;:&#34;character&#34;},{&#34;accessor&#34;:&#34;year&#34;,&#34;name&#34;:&#34;Year&#34;,&#34;type&#34;:&#34;numeric&#34;,&#34;maxWidth&#34;:70,&#34;align&#34;:&#34;left&#34;},{&#34;accessor&#34;:&#34;role&#34;,&#34;name&#34;:&#34;Role&#34;,&#34;type&#34;:&#34;character&#34;,&#34;maxWidth&#34;:95,&#34;align&#34;:&#34;left&#34;},{&#34;accessor&#34;:&#34;broke&#34;,&#34;name&#34;:&#34;Broke&#34;,&#34;type&#34;:&#34;character&#34;,&#34;maxWidth&#34;:70},{&#34;accessor&#34;:&#34;competition_type&#34;,&#34;name&#34;:&#34;Competition type&#34;,&#34;type&#34;:&#34;character&#34;,&#34;minWidth&#34;:120},{&#34;accessor&#34;:&#34;reached&#34;,&#34;name&#34;:&#34;Furthest stage reached&#34;,&#34;type&#34;:&#34;character&#34;,&#34;na&#34;:&#34;-&#34;,&#34;minWidth&#34;:120},{&#34;accessor&#34;:&#34;date_first_day&#34;,&#34;name&#34;:&#34;Start date&#34;,&#34;type&#34;:&#34;Date&#34;}],&#34;defaultPageSize&#34;:34,&#34;paginationType&#34;:&#34;numbers&#34;,&#34;showPageInfo&#34;:true,&#34;minRows&#34;:1,&#34;dataKey&#34;:&#34;5dd7cbb6a7ffb53d66845b5ad37e7b45&#34;},&#34;children&#34;:[]},&#34;class&#34;:&#34;reactR_markup&#34;},&#34;evals&#34;:[],&#34;jsHooks&#34;:[]}&lt;/script&gt;
</description>
    </item>
    
    <item>
      <title></title>
      <link>https://jameslairdsmith.com/chart/language-efficiency/</link>
      <pubDate>Fri, 03 Jan 2020 00:00:00 +0000</pubDate>
      
      <guid>https://jameslairdsmith.com/chart/language-efficiency/</guid>
      <description>&lt;p&gt;&lt;html&gt;
&lt;head&gt;
  &lt;title&gt;Embedding Vega-Lite&lt;/title&gt;
  &lt;script src=&#34;https://d3js.org/d3.v5.js&#34;&gt;&lt;/script&gt;
  &lt;script src=&#34;https://cdn.jsdelivr.net/npm/vega@5.7.3&#34;&gt;&lt;/script&gt;
  &lt;script src=&#34;https://cdn.jsdelivr.net/npm/vega-lite@4.0.0-beta.11&#34;&gt;&lt;/script&gt;
  &lt;script src=&#34;https://cdn.jsdelivr.net/npm/vega-embed@6.0.0&#34;&gt;&lt;/script&gt;&lt;/p&gt;

&lt;p&gt;&lt;/head&gt;&lt;/p&gt;

&lt;p&gt;&lt;body&gt;&lt;/p&gt;

&lt;div id=&#34;headingblock&#34; align=&#34;center&#34;&gt;
    &lt;h3 align=&#34;left&#34; id=&#34;irangdphead&#34;&gt;Talking, fast and slow&lt;/h3&gt;
    &lt;p align=&#34;left&#34; id=&#34;irangdpsubhead&#34;&gt;Speech rate, syllables per second*&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;&lt;div id=&#34;irangdpvis&#34; align=&#34;center&#34;&gt;&lt;/div&gt;
&lt;p align=&#34;left&#34; id=&#34;irangdpnote&#34;&gt;*Median value of observations&lt;/p&gt;
&lt;p align=&#34;left&#34; id=&#34;irangdpsource&#34;&gt;Source: &amp;ldquo;Different languages, similar encoding efficiency: Comparable information rates across the human communicative niche&amp;rdquo; by Christophe Coupé, Yoon Mi Oh, Dan Dediu, and François Pellegrino, Science Advances (2019)&lt;/p&gt;&lt;/p&gt;

&lt;script type=&#34;text/javascript&#34;&gt;

width = document.getElementById(&#34;irangdpvis&#34;).offsetWidth;

maxWidth = 630;

getWorkingWidth = function(width,maxWidth){if(width &lt; maxWidth)
                                          {return 1 * width}
                                          else {return maxWidth}};
                                          
plotWidth = getWorkingWidth(width, maxWidth);

aspectRatio = 0.75;

plotMaxHeight = 350;

plotHight =  Math.max(aspectRatio * plotWidth, plotMaxHeight);

leftMargin = (width - plotWidth)/2;

rightMargin = leftMargin;

document.getElementById(&#34;irangdphead&#34;)
    .setAttribute(
      &#34;style&#34;,`
      margin-left: ${leftMargin}px;
      margin-right: ${rightMargin}px`);
      
document.getElementById(&#34;irangdpsubhead&#34;)
    .setAttribute(
      &#34;style&#34;,`
      margin-left: ${leftMargin}px;
      margin-right: ${rightMargin}px;
      font-style: italic;
      //margin-bottom: 0;
      text-align:left;`);
      
document.getElementById(&#34;irangdpnote&#34;)
    .setAttribute(
      &#34;style&#34;, `
      margin-left: ${leftMargin}px; 
      margin-right: ${rightMargin}px;
      font-size: 0.5rem;
      color: #696969;
      margin-bottom: 0; 
      text-align:left;`);
      
document.getElementById(&#34;irangdpsource&#34;)
    .setAttribute(
      &#34;style&#34;, `
      margin-left: ${leftMargin}px; 
      margin-right: ${rightMargin}px;
      font-size: 0.5rem;
      color: #696969;
      //margin-bottom: 0; 
      text-align:left;`);
      
document.getElementById(&#34;irangdpvis&#34;)
    .setAttribute(
      &#34;style&#34;, `
      margin-left: ${leftMargin}px; 
      margin-right: ${rightMargin}px;
      // font-size: 0.7rem;
      // color: #696969;
      // margin-bottom: 0; 
      //text-align:right;`
);

el = document.getElementById(&#39;irangdpsubhead&#39;);

style = window.getComputedStyle(el, null).getPropertyValue(&#39;font-size&#39;);

fontFamily = window.getComputedStyle(el, null).getPropertyValue(&#39;font-family&#39;);

subFontSize = parseFloat(style); 

url_string = &#34;https://gist.githubusercontent.com/jameslairdsmith/93a37c9670ec09d0da2282f3be6b3b05/raw/528736704c2a9dc8c677136a2896c2883e419189/language-complexity-summary.csv&#34;;

myData = {&#34;url&#34;: url_string};

lineMark = {
      &#34;mark&#34;: {
        &#34;type&#34;: &#34;line&#34;,
        &#34;color&#34;: &#34;firebrick&#34;
      },
      &#34;transform&#34;: [
        {
          &#34;regression&#34;: &#34;SR&#34;,
          &#34;on&#34;: &#34;ID&#34;
        }
      ],
      &#34;encoding&#34;: {
        &#34;x&#34;: {
          &#34;field&#34;: &#34;ID&#34;,
          &#34;type&#34;: &#34;quantitative&#34;
        },
        &#34;size&#34;: {&#34;value&#34;: 2},
        &#34;color&#34;: {&#34;value&#34;: &#34;black&#34;},
        &#34;y&#34;: {
          &#34;field&#34;: &#34;SR&#34;,
          &#34;type&#34;: &#34;quantitative&#34;
        }
      }
    };
    
plot = {
  &#34;$schema&#34;: &#34;https://vega.github.io/schema/vega-lite/v4.json&#34;,
  &#34;width&#34;: plotWidth,
  &#34;height&#34;: plotHight,
  autosize: {
        type: &#34;fit&#34;,
        contains: &#34;padding&#34;
      },
  &#34;config&#34;: {&#34;view&#34;: {&#34;stroke&#34;: &#34;transparent&#34;}},
  &#34;data&#34;: myData,
  &#34;layer&#34;:[lineMark,
    {&#34;mark&#34;: &#34;circle&#34;},
          {
    &#34;mark&#34;: {
      &#34;type&#34;: &#34;text&#34;,
      &#34;align&#34;: &#34;left&#34;,
      &#34;font&#34;: fontFamily,
      &#34;fontSize&#34;: subFontSize - 3,
      &#34;baseline&#34;: &#34;middle&#34;,
      &#34;dx&#34;: 0
    },
    &#34;encoding&#34;: {
      &#34;x&#34;: {&#34;field&#34;: &#34;x-lab&#34;},
      &#34;y&#34;: {&#34;field&#34;: &#34;y-lab&#34;},
      &#34;color&#34;: {&#34;value&#34;: &#34;black&#34;},
      &#34;size&#34;:{&#34;value&#34;: subFontSize - 3},
      &#34;text&#34;: {&#34;field&#34;: &#34;language-name&#34;, &#34;type&#34;: &#34;nominal&#34;}
    }
  }],
  &#34;encoding&#34;: {
    &#34;size&#34;:{&#34;value&#34;: 200},
    &#34;x&#34;: {&#34;field&#34;: &#34;ID&#34;, 
          &#34;type&#34;: &#34;quantitative&#34;,
          &#34;axis&#34;: {&#34;grid&#34;: false,
                   &#34;labelFontSize&#34;: subFontSize - 3,
                   &#34;labelFont&#34;: fontFamily,
                   labelPadding: 6,
                   tickCount: 6,
                   titleFontSize: subFontSize - 3,
                   titleFont: fontFamily,
                   titlePadding: 12,
                  &#34;title&#34;: &#34;Information density*&#34;},
          &#34;scale&#34;: {&#34;zero&#34;: false}
         },
    &#34;y&#34;: {&#34;field&#34;: &#34;SR&#34;,
          &#34;type&#34;: &#34;quantitative&#34;,
          &#34;axis&#34;: {&#34;grid&#34;: false,
                   &#34;labelFontSize&#34;: subFontSize - 3,
                   &#34;labelFont&#34;: fontFamily,
                   &#34;title&#34;: null},
         &#34;scale&#34;: {&#34;zero&#34;: false}
         },
    &#34;color&#34;: {&#34;field&#34;: &#34;simple-family-name&#34;,
              &#34;sort&#34;: [&#34;Indo-European&#34;, 
                       &#34;Sino-Tibetan&#34;, 
                       &#34;Uralic&#34;,
                       &#34;Language isolate&#34;,
                       &#34;Other&#34;],
              &#34;type&#34;: &#34;nominal&#34;,
             &#34;legend&#34;:{&#34;orient&#34;:&#34;none&#34;,
                      &#34;legendX&#34;: plotWidth-rightMargin-140,
                      &#34;legendY&#34;: -10,
                      //&#34;direction&#34;: &#34;vertical&#34;,
                      &#34;gridAlign&#34;: &#34;none&#34;,
                      &#34;labelFontSize&#34;: subFontSize - 5,
                      &#34;labelFont&#34;: fontFamily,
                      &#34;titleFontSize&#34;: subFontSize - 3,
                      &#34;titleFont&#34;: fontFamily,
                      &#34;titlePadding&#34;: 10,
                      &#34;titleFontWeight&#34;: 900,
                      &#34;title&#34;: &#34;Language family&#34;}}
  }
  //&#34;signals&#34;: [tooltipSignal],
  //&#34;scales&#34;: [xScale, yScale],
  //&#34;axes&#34;: [xAxis, yAxis],
  //&#34;marks&#34;: [rectMark, textMark]
}


opt = ({
      &#34;actions&#34;: false,
      &#34;tooltip&#34;: false
    });
    
vegaEmbed(&#34;#irangdpvis&#34;, plot, opt);


&lt;/script&gt;

&lt;p&gt;&lt;/body&gt;&lt;/p&gt;

&lt;p&gt;&lt;/html&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title></title>
      <link>https://jameslairdsmith.com/chart/iran-economy/</link>
      <pubDate>Sat, 16 Nov 2019 00:00:00 +0000</pubDate>
      
      <guid>https://jameslairdsmith.com/chart/iran-economy/</guid>
      <description>&lt;p&gt;&lt;html&gt;
&lt;head&gt;
  &lt;title&gt;Embedding Vega-Lite&lt;/title&gt;
  &lt;script src=&#34;https://d3js.org/d3.v5.js&#34;&gt;&lt;/script&gt;
  &lt;script src=&#34;https://cdn.jsdelivr.net/npm/vega@5.7.3&#34;&gt;&lt;/script&gt;
  &lt;script src=&#34;https://cdn.jsdelivr.net/npm/vega-lite@4.0.0-beta.11&#34;&gt;&lt;/script&gt;
  &lt;script src=&#34;https://cdn.jsdelivr.net/npm/vega-embed@6.0.0&#34;&gt;&lt;/script&gt;&lt;/p&gt;

&lt;p&gt;&lt;/head&gt;&lt;/p&gt;

&lt;p&gt;&lt;body&gt;&lt;/p&gt;

&lt;div id=&#34;headingblock&#34; align=&#34;center&#34;&gt;
    &lt;h3 align=&#34;left&#34; id=&#34;irangdphead&#34;&gt;Iran&#39;s economy: battered by sanctions&lt;/h3&gt;
    &lt;p align=&#34;left&#34; id=&#34;irangdpsubhead&#34;&gt;Change in real GDP, annual %&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;&lt;div id=&#34;irangdpvis&#34; align=&#34;center&#34;&gt;&lt;/div&gt;
&lt;p align=&#34;left&#34; id=&#34;irangdpsource&#34;&gt;Source for data, estimates and forecast: World Bank&lt;/p&gt;&lt;/p&gt;

&lt;script type=&#34;text/javascript&#34;&gt;

width = document.getElementById(&#34;irangdpvis&#34;).offsetWidth;

maxWidth = 630;

getWorkingWidth = function(width,maxWidth){if(width &lt; maxWidth)
                                          {return 1 * width}
                                          else {return maxWidth}};
                                          
plotWidth = getWorkingWidth(width, maxWidth);

aspectRatio = 0.75;

plotMaxHeight = 350;

plotHight =  Math.max(aspectRatio * plotWidth, plotMaxHeight);

leftMargin = (width - plotWidth)/2;

rightMargin = leftMargin;

document.getElementById(&#34;irangdphead&#34;)
    .setAttribute(
      &#34;style&#34;,`
      margin-left: ${leftMargin}px;
      margin-right: ${rightMargin}px`);
      
document.getElementById(&#34;irangdpsubhead&#34;)
    .setAttribute(
      &#34;style&#34;,`
      margin-left: ${leftMargin}px;
      margin-right: ${rightMargin}px;
      font-style: italic;
      //margin-bottom: 0;
      text-align:left;`);
      
document.getElementById(&#34;irangdpsource&#34;)
    .setAttribute(
      &#34;style&#34;, `
      margin-left: ${leftMargin}px; 
      margin-right: ${rightMargin}px;
      font-size: 0.7rem;
      color: #696969;
      //margin-bottom: 0; 
      text-align:left;`);
      
document.getElementById(&#34;irangdpvis&#34;)
    .setAttribute(
      &#34;style&#34;, `
      margin-left: ${leftMargin}px; 
      margin-right: ${rightMargin}px;
      // font-size: 0.7rem;
      // color: #696969;
      // margin-bottom: 0; 
      //text-align:right;`
);

el = document.getElementById(&#39;irangdpsubhead&#39;);

style = window.getComputedStyle(el, null).getPropertyValue(&#39;font-size&#39;);

fontFamily = window.getComputedStyle(el, null).getPropertyValue(&#39;font-family&#39;);

subFontSize = parseFloat(style); 

url_string = &#34;https://raw.githubusercontent.com/jameslairdsmith/iran_worldbank_data/master/current_iran_indicators.csv&#34;;

rectDataRaw =  [
  {&#34;start&#34;: &#34;2018-06-30&#34;, &#34;end&#34;: &#34;2020-06-30&#34;, &#34;event&#34;: &#34;Estimate&#34;},
  {&#34;start&#34;: &#34;2020-06-30&#34;, &#34;end&#34;: &#34;2022-06-15&#34;, &#34;event&#34;: &#34;Forecast&#34;}
];

eventDates =  [
  {&#34;eventDate&#34;: &#34;2016-01-16&#34;, &#34;eventDescription&#34;: &#34;Nuclear deal implemented \u2192 &#34;, &#34;yVal&#34;: &#34;0.12&#34;},
  {&#34;eventDate&#34;: &#34;2018-01-11&#34;, &#34;eventDescription&#34;: &#34;Trump sanctions take effect \u2192 &#34;, &#34;yVal&#34;: &#34;-0.0925&#34;}
];

makeGdpPercent = {calculate: &#34;datum.annual_gdp_growth/100&#34;, &#34;as&#34;: &#34;annual_gdp_growth_perc&#34;};

getTextMidpoint = {calculate: &#34;(datum.start + datum.end)/2&#34;, &#34;as&#34;: &#34;midPoint&#34;};

makeFirstDateLong = &#34;if(datum.label == &#39;2010&#39;, datum.label, timeFormat(datum.value, &#39;%y&#39;))&#34;;

yAxis = {title: null,
         tickCount: 8,
         ticks: false,
         domain:false,
         labelFontSize: subFontSize - 3,
         labelFont: fontFamily,
         labelPadding: 5,
         orient: &#34;right&#34;,
         grid: true,
         format: &#34;%&#34;};
         
xAxis = {title: &#34;Fiscal year ending&#34;,
         grid: false,
         labelExpr: makeFirstDateLong,
         labelFontSize: subFontSize - 3,
         labelFont: fontFamily,
         maxExtent: 40,
         orient: &#34;bottom&#34;,
         minExtent: 40,
         labelPadding: 6,
         titleFontSize: subFontSize - 3,
         titleFont: fontFamily,
         titlePadding: -4,
         domain:false,
         ticks: false};
         
yEncoding = {field: &#34;annual_gdp_growth_perc&#34;,
              type: &#34;quantitative&#34;,
              scale: {domain: [-0.12, 0.15]},
              axis: yAxis};
              
xEncoding = {field: &#34;year&#34;,
              axis: xAxis,
              scale: {domain: [&#34;2010-01-01&#34;, &#34;2022-01-01&#34;]},
              type: &#34;temporal&#34;};
              
rectLegend = {orient: &#34;top&#34;, 
               title: null, 
               labelFont: fontFamily,
               labelFontSize: subFontSize - 3};
               
rectEncoding = {
  x: {field: &#34;start&#34;, type: &#34;temporal&#34;},
  x2: {field: &#34;end&#34;},
  fillOpacity: {value: 0.2},
  color: {field: &#34;event&#34;,
          type: &#34;nominal&#34;,
          scale: {&#34;range&#34;: [&#34;#969696&#34;, &#34;#c7c7c7&#34;]},
          legend: rectLegend}};
          
textEncoding = {
  x: {field: &#34;midPoint&#34;, type: &#34;temporal&#34;},
  y: {value: 60},
  text: {field: &#34;event&#34;, type: &#34;nominal&#34;}
};

vLineEncoding = {
  x: {field: &#34;eventDate&#34;, type: &#34;temporal&#34;}
};

labelEncoding = {
      x: {field: &#34;eventDate&#34;, type: &#34;temporal&#34;},
      y: {field: &#34;yVal&#34;, type: &#34;quantitative&#34;},
      text: {field: &#34;eventDescription&#34;, 
             legend: null,
             type: &#34;nominal&#34;}
};

barMark = {
      mark: {type: &#34;bar&#34;},
      data: {url: url_string},
      transform: [makeGdpPercent],
      encoding: {
        y: yEncoding,
        x: xEncoding,
        fillOpacity: {value: 1},
        color: {value: &#34;#595959&#34;}}
};

rectMark = {
    mark: {type: &#34;rect&#34;},
    data: {values: rectDataRaw},
    encoding: rectEncoding
};

vLineMark = {
  mark: {type: &#34;rule&#34;},
  data: {values: eventDates},
  encoding: vLineEncoding
};

labelMark = {
  mark: {type: &#34;text&#34;,
         font: fontFamily,
         fontSize: subFontSize - 5,
         align: &#34;right&#34;},
  data: {values: eventDates},
  encoding: labelEncoding
};

ruleConfig = {
    strokeDash: [6,4],
    color: &#34;grey&#34;
};

barWidthMutiple = 16.5;

barWidth = plotWidth/barWidthMutiple;

plotConfig = {
  bar: {continuousBandSize: barWidth},
  rule: ruleConfig,
  style: {cell: {stroke: &#34;transparent&#34;}}
};

plot = {
  $schema: &#34;https://vega.github.io/schema/vega-lite/v4.json&#34;,
  width: plotWidth,
  height: plotHight,
  autosize: {
        type: &#34;fit&#34;,
        contains: &#34;padding&#34;
      },
  layer:[barMark, rectMark, vLineMark, labelMark],
  config: plotConfig
};

opt = ({
      &#34;actions&#34;: false,
      &#34;tooltip&#34;: false
    });
    
vegaEmbed(&#34;#irangdpvis&#34;, plot, opt);


&lt;/script&gt;

&lt;p&gt;&lt;/body&gt;&lt;/p&gt;

&lt;p&gt;&lt;/html&gt;&lt;/p&gt;

&lt;p&gt;Iran&amp;rsquo;s economy will have shrunk by 4.9% over the course of this
year and by a further 8.7% during 2020&lt;sup class=&#34;footnote-ref&#34; id=&#34;fnref:0&#34;&gt;&lt;a href=&#34;#fn:0&#34;&gt;1&lt;/a&gt;&lt;/sup&gt;, according to estimates
produced by the World Bank&lt;sup class=&#34;footnote-ref&#34; id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34;&gt;2&lt;/a&gt;&lt;/sup&gt;. The country is reeling in
the fallout of the Trump administration&amp;rsquo;s decision to withdraw
from the nuclear treaty it signed in 2015 with the Obama
administration and other world powers&lt;sup class=&#34;footnote-ref&#34; id=&#34;fnref:2&#34;&gt;&lt;a href=&#34;#fn:2&#34;&gt;3&lt;/a&gt;&lt;/sup&gt;. The deal had been a boon
for the Islamic Republic where the lifting of sanctions contributed
to growth of 13.4% during 2017. Once the effects of the latest
sanctions are absorbed, World Bank forecasters predict flat growth
of 0.1% in 2021 and 1% in 2022.&lt;/p&gt;
&lt;div class=&#34;footnotes&#34;&gt;

&lt;hr /&gt;

&lt;ol&gt;
&lt;li id=&#34;fn:0&#34;&gt;All periods are fiscal year ends.
 &lt;a class=&#34;footnote-return&#34; href=&#34;#fnref:0&#34;&gt;&lt;sup&gt;^&lt;/sup&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li id=&#34;fn:1&#34;&gt;World Bank. (2019). &lt;em&gt;Iran’s Economic Update&lt;/em&gt;. Retrieved from &lt;a href=&#34;https://tinyurl.com/upwy79e&#34; target=&#34;_blank&#34;&gt;https://tinyurl.com/upwy79e&lt;/a&gt;
 &lt;a class=&#34;footnote-return&#34; href=&#34;#fnref:1&#34;&gt;&lt;sup&gt;^&lt;/sup&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li id=&#34;fn:2&#34;&gt;Formally named the Joint Comprehensive Plan of Action (JCPOA).
 &lt;a class=&#34;footnote-return&#34; href=&#34;#fnref:2&#34;&gt;&lt;sup&gt;^&lt;/sup&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
</description>
    </item>
    
    <item>
      <title>Privacy Policy</title>
      <link>https://jameslairdsmith.com/privacy/</link>
      <pubDate>Thu, 28 Jun 2018 00:00:00 +0000</pubDate>
      
      <guid>https://jameslairdsmith.com/privacy/</guid>
      <description>&lt;p&gt;&amp;hellip;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Explaining Cape Town&#39;s water crisis</title>
      <link>https://jameslairdsmith.com/post/explaining-cape-town-s-water-crisis/</link>
      <pubDate>Fri, 23 Feb 2018 00:00:00 +0000</pubDate>
      
      <guid>https://jameslairdsmith.com/post/explaining-cape-town-s-water-crisis/</guid>
      <description>&lt;p&gt;They are are calling it “Day Zero”. From this date, household taps in Cape Town, one of South Africa’s largest cities, will be turned off by officials. Residents will instead have to queue for water at central distribution points. This rationing will be an attempt to prevent Cape Town from being the first major city in the modern world to run out of fresh water.&lt;/p&gt;
&lt;p&gt;Exactly when Day Zero will occur is uncertain, but official estimates say it will be sometime in the next three to four months. At the time of writing, the projected date has been pushed out to early July 2018&lt;a href=&#34;#fn1&#34; class=&#34;footnote-ref&#34; id=&#34;fnref1&#34;&gt;&lt;sup&gt;1&lt;/sup&gt;&lt;/a&gt;, but that is likely to change. “While we must still do everything possible to prevent this ghastly eventuality, my focus has shifted to overseeing plans for the day the taps run dry” writes&lt;a href=&#34;#fn2&#34; class=&#34;footnote-ref&#34; id=&#34;fnref2&#34;&gt;&lt;sup&gt;2&lt;/sup&gt;&lt;/a&gt; Helen Zille, the province’s leader.&lt;/p&gt;
&lt;p&gt;Reaching Day Zero would be a calamity. Public health, social cohesion and economic growth are all liable to suffer if the taps are turned off. Residents will sacrifice their productive time continually queuing for water. Poor hygiene will lead to the spread of disease. Tourists are likely to skip Cape Town and choose destinations where they are free to take a shower. Moreover, because having water available from the tap is always taken for granted, some of the broader consequences may well be unforeseen.&lt;/p&gt;
&lt;p&gt;Administering the process is also likely to be a nightmare. The current plan involves a single person collecting on behalf of their household. But, at the moment, there is no register of how many people live in each home. Four will be the working assumption and households of more than four members will have to register separately. Officials will have to plan carefully to minimise abuses. Even now there is a strong incentive for residents to stockpile in anticipation of harsh times ahead.&lt;/p&gt;
&lt;p&gt;Why is this happening? Drought is the main reason. Rainfall in the province has been well below average for the past three years. Data&lt;a href=&#34;#fn3&#34; class=&#34;footnote-ref&#34; id=&#34;fnref3&#34;&gt;&lt;sup&gt;3&lt;/sup&gt;&lt;/a&gt; from Cape Town International Airport show sharp declines each year starting in 2015. 2017 was an especially bad year with a 65% drop from the ten year average (see first chart). “Such severe multi-year droughts are very infrequent, occurring perhaps as rarely as once in a millennium” reckon&lt;a href=&#34;#fn4&#34; class=&#34;footnote-ref&#34; id=&#34;fnref4&#34;&gt;&lt;sup&gt;4&lt;/sup&gt;&lt;/a&gt; Piotr Wolski, Bruce Hewitson and Chris Jack, all climate researchers at the University of Cape Town.&lt;/p&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;title&gt;Embedding Vega-Lite&lt;/title&gt;
  &lt;script src=&#34;https://d3js.org/d3.v5.js&#34;&gt;&lt;/script&gt;
  &lt;script src=&#34;https://cdn.jsdelivr.net/npm/vega@4.2.0&#34;&gt;&lt;/script&gt;
  &lt;script src=&#34;https://cdn.jsdelivr.net/npm/vega-lite@3.0.0-rc6&#34;&gt;&lt;/script&gt;
  &lt;script src=&#34;https://cdn.jsdelivr.net/npm/vega-embed@3.19.2&#34;&gt;&lt;/script&gt;
  
&lt;style&gt;

.role-axis-label {
  font-size: 0.9rem;
  fill: &#34;red&#34;;
  color: &#34;red&#34;;
}


&lt;/style&gt;

&lt;/head&gt;




&lt;body&gt;
  &lt;div id=&#34;rainblock&#34; align=&#34;center&#34;&gt;
    &lt;h3 align=&#34;left&#34; id=&#34;rainhead&#34;&gt;Rainfall at Cape Town International Airport&lt;/h3&gt;
    &lt;p align=&#34;left&#34; id=&#34;rainsubhead&#34;&gt;Percentage difference from ten-year average&lt;/p&gt;
  &lt;/div&gt;
  &lt;div id=&#34;rainvis&#34; align=&#34;center&#34; class=&#34;role-axis-label&#34;&gt;&lt;/div&gt;
  &lt;p align=&#34;right&#34; id=&#34;rainsource&#34;&gt;Source: ncdc.noaa.gov&lt;/p&gt;

  &lt;script type=&#34;text/javascript&#34;&gt;
  
    var width = document.getElementById(&#34;rainvis&#34;).offsetWidth;
  
    var maxWidth = 550; // setting the maximum width of the chart.
    //var width = 300;

    var getWorkingWidth = function(width,maxWidth){
                                                if(width &lt; maxWidth)
                                                {return 1 * width}
                                                else{return maxWidth}
                                              };

    var workingWidth = getWorkingWidth(width, maxWidth);
    
    var height = Math.max(2/3 * workingWidth, 350)
    
    //var height = 7/10 * workingWidth
    
    var leftMargin = (width - workingWidth)/2;
    
    var rightMargin = leftMargin;
    
    document.getElementById(&#34;rainhead&#34;)
    .setAttribute(
      &#34;style&#34;,`
      margin-left: ${leftMargin}px;
      margin-right: ${rightMargin}px`);
    
    document.getElementById(&#34;rainsubhead&#34;)
    .setAttribute(
      &#34;style&#34;,`
      margin-left: ${leftMargin}px;
      margin-right: ${rightMargin}px;
      font-style: italic;
      //margin-bottom: 0;
      text-align:left;`);
    
    document.getElementById(&#34;rainsource&#34;)
    .setAttribute(
      &#34;style&#34;, `
      margin-left: ${leftMargin}px; 
      margin-right: ${rightMargin}px;
      font-size: 0.7rem;
      color: #696969;
      //margin-bottom: 0; 
      text-align:right;`);
    
    var el = document.getElementById(&#39;rainsubhead&#39;);
    var style = window.getComputedStyle(el, null).getPropertyValue(&#39;font-size&#39;);
    var fontFamily = window.getComputedStyle(el, null).getPropertyValue(&#39;font-family&#39;);
    var subFontSize = parseFloat(style); 
  
    var yourVlSpec = {
      &#34;$schema&#34;: &#34;https://vega.github.io/schema/vega-lite/v2.0.json&#34;,
      &#34;width&#34;: workingWidth,
      &#34;height&#34;: height,
      &#34;autosize&#34;: {
        &#34;type&#34;: &#34;fit&#34;,
        &#34;contains&#34;: &#34;padding&#34;
      },
      &#34;description&#34;: &#34;A simple bar chart with embedded data.&#34;,
      &#34;data&#34;:  {&#34;url&#34;:&#34;https://raw.githubusercontent.com/jameslairdsmith/Home_and_dry/master/Rained_out.csv&#34;},
      &#34;transform&#34;: [
          {&#34;calculate&#34;: &#34;datum.Avr_Prcp_Pct/100&#34;, &#34;as&#34;: &#34;Avr_Prcp_Pct2&#34;}
      ],
      &#34;mark&#34;: &#34;bar&#34;,
      
      &#34;encoding&#34;: {
        &#34;x&#34;: {&#34;field&#34;: &#34;Date&#34;, &#34;type&#34;: &#34;temporal&#34;,
        &#34;axis&#34;: {
          &#34;title&#34;: null, 
          &#34;labelFontSize&#34;: subFontSize-3,
          &#34;labelFont&#34;: fontFamily,
          &#34;ticks&#34;: false,
          &#34;format&#34;:&#34;%y&#34;,
          &#34;grid&#34;:false,
          &#34;domain&#34;:false}},
        &#34;y&#34;: {&#34;field&#34;: &#34;Avr_Prcp_Pct2&#34;, &#34;type&#34;: &#34;quantitative&#34;, 
        &#34;axis&#34;: {
          &#34;title&#34;: null,
          &#34;tickCount&#34;: 6,
          &#34;labelFontSize&#34;: subFontSize-3,
          &#34;labelFont&#34;: fontFamily,
          &#34;format&#34;:&#34;%&#34;,
          &#34;grid&#34;:false,
          &#34;tickSize&#34;:-workingWidth,
          &#34;tickColor&#34;:&#34;white&#34;,
          &#34;labelPadding&#34;:workingWidth,
          &#34;domain&#34;:false}},
        &#34;color&#34;: {&#34;value&#34;: &#34;grey&#34;}
        },
      &#34;config&#34;: {
        &#34;bar&#34;: {&#34;continuousBandSize&#34;:workingWidth/16},
        &#34;style&#34;: {
          &#34;cell&#34;: {
              &#34;stroke&#34;: &#34;transparent&#34;,
            }
          },
        },
    }
    
    var opt = {
      &#34;actions&#34;: false,
      &#34;tooltip&#34;: false
    }
    vegaEmbed(&#34;#rainvis&#34;, yourVlSpec, opt);
    
    
  &lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;p&gt;Almost all Cape Town’s water is fed from reservoir dams in the surrounding areas of the province. While there are 13 of these in total, only 6 are large enough to store a significant amount. Under normal circumstances, Cape Town relies on these dams filling up during the rainy winter months so that capacity can be drawn upon during the drier months. Often this occurs with a healthy surplus, but even this has eroded with the recent stretch of low rainfall. According to data&lt;a href=&#34;#fn5&#34; class=&#34;footnote-ref&#34; id=&#34;fnref5&#34;&gt;&lt;sup&gt;5&lt;/sup&gt;&lt;/a&gt; provided by the city, the annual winter peak level has declined significantly each year for the last three years (see second chart). Most of the bottom 10% of capacity is unusable. The dams reached a peak of just over 35% during the winter of 2017; at the time of writing, they are at 25%.&lt;/p&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;title&gt;Embedding Vega-Lite&lt;/title&gt;
  &lt;script src=&#34;https://d3js.org/d3.v5.js&#34;&gt;&lt;/script&gt;
  &lt;script src=&#34;https://cdn.jsdelivr.net/npm/vega@4.2.0&#34;&gt;&lt;/script&gt;
  &lt;script src=&#34;https://cdn.jsdelivr.net/npm/vega-lite@3.0.0-rc6&#34;&gt;&lt;/script&gt;
  &lt;script src=&#34;https://cdn.jsdelivr.net/npm/vega-embed@3.19.2&#34;&gt;&lt;/script&gt;
  
&lt;style&gt;

.role-axis-label {
  font-size: 0.9rem;
  fill: &#34;red&#34;;
  color: &#34;red&#34;;
}


&lt;/style&gt;

&lt;/head&gt;




&lt;body&gt;
  &lt;div id=&#34;damlevelsblock&#34; align=&#34;center&#34;&gt;
    &lt;h3 align=&#34;left&#34; id=&#34;damlevelshead&#34;&gt;Western Cape dam levels&lt;/h3&gt;
    &lt;p align=&#34;left&#34; id=&#34;damlevelssubhead&#34;&gt;Percentage of total capacity&lt;/p&gt;
  &lt;/div&gt;
  &lt;div id=&#34;damlevelsvis&#34; align=&#34;center&#34; class=&#34;role-axis-label&#34;&gt;&lt;/div&gt;
  &lt;p align=&#34;right&#34; id=&#34;damlevlessource&#34;&gt;Source: City of Cape Town&lt;/p&gt;

  &lt;script type=&#34;text/javascript&#34;&gt;
  
    var width = document.getElementById(&#34;damlevelsvis&#34;).offsetWidth;
  
    var maxWidth = 550; // setting the maximum width of the chart.
    //var width = 300;

    var getWorkingWidth = function(width,maxWidth){
                                                if(width &lt; maxWidth)
                                                {return 1 * width}
                                                else{return maxWidth}
                                              };

    var workingWidth = getWorkingWidth(width, maxWidth);
    
    var height = Math.max(2/3 * workingWidth, 350)
    
    //var height = 7/10 * workingWidth
  
    
    var leftMargin = (width - workingWidth)/2;
    
    var rightMargin = leftMargin;
    
    document.getElementById(&#34;damlevelshead&#34;)
    .setAttribute(
      &#34;style&#34;,`
      margin-left: ${leftMargin}px;
      margin-right: ${rightMargin}px`);
    
    document.getElementById(&#34;damlevelssubhead&#34;)
    .setAttribute(
      &#34;style&#34;,`
      margin-left: ${leftMargin}px;
      margin-right: ${rightMargin}px;
      font-style: italic;
      margin-bottom: 0;
      text-align:left;`);
    
    document.getElementById(&#34;damlevlessource&#34;)
    .setAttribute(
      &#34;style&#34;, `
      margin-left: ${leftMargin}px; 
      margin-right: ${rightMargin}px;
      font-size: 0.7rem;
      color: #696969;
      //margin-bottom: 0; 
      text-align:right;`);
    
    
    var el = document.getElementById(&#39;damlevelssubhead&#39;);
    var style = window.getComputedStyle(el, null).getPropertyValue(&#39;font-size&#39;);
    var fontFamily = window.getComputedStyle(el, null).getPropertyValue(&#39;font-family&#39;);
    var subFontSize = parseFloat(style); 
  
    var yourVlSpec = {
      &#34;$schema&#34;: &#34;https://vega.github.io/schema/vega-lite/v2.0.json&#34;,
      &#34;width&#34;: workingWidth,
      &#34;height&#34;: height,
      &#34;autosize&#34;: {
        &#34;type&#34;: &#34;fit&#34;,
        &#34;contains&#34;: &#34;padding&#34;
      },
      &#34;description&#34;: &#34;A simple bar chart with embedded data.&#34;,
      &#34;data&#34;: {&#34;url&#34;:&#34;https://raw.githubusercontent.com/jameslairdsmith/Home_and_dry/master/Waving_Goodbye.csv&#34;},
      &#34;transform&#34;: [
          {&#34;filter&#34;: {&#34;field&#34;: &#34;Percent_Fill&#34;, &#34;gt&#34;: 0}},
         // {&#34;timeUnit&#34;: &#34;year&#34;, &#34;field&#34;: &#34;Date&#34;, &#34;as&#34;: &#34;year&#34;}
      ],
      &#34;mark&#34;: &#34;area&#34;,
      
      &#34;encoding&#34;: {
        &#34;x&#34;: {&#34;field&#34;: &#34;Date&#34;, &#34;type&#34;: &#34;temporal&#34;,&#34;timeUnit&#34;: &#34;yearmonth&#34;,
        &#34;axis&#34;: {
          &#34;title&#34;: null, 
          &#34;labelFontSize&#34;: subFontSize-3,
          &#34;labelFont&#34;: fontFamily,
          &#34;ticks&#34;: false,
          &#34;format&#34;:&#34;%Y&#34;,
          &#34;tickCount&#34;: 6,
          &#34;labelPadding&#34;: 15, 
          &#34;grid&#34;:false,
          &#34;domain&#34;:false}},
        &#34;y&#34;: {&#34;field&#34;: &#34;Percent_Fill&#34;, &#34;type&#34;: &#34;quantitative&#34;, 
        &#34;axis&#34;: {
          &#34;title&#34;: null,
          &#34;tickCount&#34;: 6,
          &#34;labelFontSize&#34;: subFontSize-3,
          &#34;labelFont&#34;: fontFamily,
          &#34;format&#34;:&#34;%&#34;,
          &#34;grid&#34;: true,
          &#34;ticks&#34;: false,
     //     &#34;tickSize&#34;:-workingWidth,
     //     &#34;tickColor&#34;:&#34;white&#34;,
          &#34;labelPadding&#34;: 15,
          &#34;domain&#34;:false}},
        &#34;color&#34;: {&#34;value&#34;: &#34;grey&#34;}
        },
      &#34;config&#34;: {
        &#34;bar&#34;: {&#34;continuousBandSize&#34;:workingWidth/16},
        &#34;style&#34;: {
          &#34;cell&#34;: {
              &#34;stroke&#34;: &#34;transparent&#34;,
            }
          },
        },
    }
    
    var opt = {
      &#34;actions&#34;: false,
      &#34;tooltip&#34;: false
    }
    vegaEmbed(&#34;#damlevelsvis&#34;, yourVlSpec, opt);
    
    
  &lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;p&gt;Politics and bureaucracy have made things worse. Responsibilities for water management are split between various branches of government. The ruling African National Congress (ANC) controls the national department whereas the largest opposition party, the Democratic Alliance (DA), is in power in both Cape Town and the surrounding Western Cape province. An independent survey&lt;a href=&#34;#fn6&#34; class=&#34;footnote-ref&#34; id=&#34;fnref6&#34;&gt;&lt;sup&gt;6&lt;/sup&gt;&lt;/a&gt; of government activity, conducted by David Olivier of the University of the Witwatersrand, puts the blame firmly on the ANC. Mr. Olivier notes that while programs from both the city and the province have been generally swift and efficient, the response from the national government has been pitiful. For example, requests by the city and province for the classification of “drought disaster areas” had been made since 2015; these would have provided financing for relief efforts. Almost all these requests continued to be rejected as late into the crisis as 2017. Even while approval was slow to arrive, the money was slower still.&lt;/p&gt;
&lt;p&gt;What can be done? Start with reducing water usage. The city has undertaken an information campaign to encourage residents to reduce their daily consumption. But according to statements made by officials, this hasn’t had much of an impact. In mid-January, only 39% of residents used less than their daily allowance&lt;a href=&#34;#fn7&#34; class=&#34;footnote-ref&#34; id=&#34;fnref7&#34;&gt;&lt;sup&gt;7&lt;/sup&gt;&lt;/a&gt;. But as the crisis has become more grave, this seems to have improved. February 11th marked the first week where total weekly consumption fell below the requisite level&lt;a href=&#34;#fn8&#34; class=&#34;footnote-ref&#34; id=&#34;fnref8&#34;&gt;&lt;sup&gt;8&lt;/sup&gt;&lt;/a&gt;. Other steps will also have helped. The city has increased levies and reduced the pressure at which water is discharged.&lt;/p&gt;
&lt;p&gt;Another avenue is to find alternative water sources. In partnership with the local government, private companies have committed to helping out. South African Breweries are reallocating water from their local spring and some farms have transferred their water allotment into nearby dams. Despite limited funding, various water augmentation projects, such as desalination and groundwater, are also being pursued. But officials have said, as it stands, these will not be operational before Day Zero.&lt;/p&gt;
&lt;p&gt;In a few months, the winter rains will come and this may give Cape Town a small reprieve. But this is both uncertain and a long way off. On current projections, they will not be enough to avoid Day Zero. Even if the forecasts are too pessimistic, the problem may only be slightly delayed. Dam levels are likely to remain perilously low. Either way, there is no margin for error.&lt;/p&gt;
&lt;div class=&#34;footnotes&#34;&gt;
&lt;hr /&gt;
&lt;ol&gt;
&lt;li id=&#34;fn1&#34;&gt;&lt;p&gt;Neilson, I. (2018). Defeating Day Zero is in sight if we sustain our water-saving efforts. [online] City of Cape Town. Available at: &lt;a href=&#34;https://goo.gl/iGRMiU&#34; class=&#34;uri&#34;&gt;https://goo.gl/iGRMiU&lt;/a&gt; [Accessed 21 Feb. 2018].&lt;a href=&#34;#fnref1&#34; class=&#34;footnote-back&#34;&gt;↩&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li id=&#34;fn2&#34;&gt;&lt;p&gt;Zille, H. (2018). From the Inside: The Countdown to Day Zero. [online] Daily Maverick. Available at: &lt;a href=&#34;https://goo.gl/SCjPf7&#34; class=&#34;uri&#34;&gt;https://goo.gl/SCjPf7&lt;/a&gt; [Accessed 20 Feb. 2018].&lt;a href=&#34;#fnref2&#34; class=&#34;footnote-back&#34;&gt;↩&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li id=&#34;fn3&#34;&gt;&lt;p&gt;National Climatic Data Center. (2018). Global Service Summary of Day Data. [Data file and code]. Retrieved from ncdc.noaa.gov. Code available at &lt;a href=&#34;https://goo.gl/jQUvGm&#34; class=&#34;uri&#34;&gt;https://goo.gl/jQUvGm&lt;/a&gt;.&lt;a href=&#34;#fnref3&#34; class=&#34;footnote-back&#34;&gt;↩&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li id=&#34;fn4&#34;&gt;&lt;p&gt;Wolski, P., Hewitson, B. and Jack, C. (2018). Why Cape Town’s drought was so hard to forecast. [online] The Conversation. Available at: &lt;a href=&#34;https://goo.gl/hVb4Qg&#34; class=&#34;uri&#34;&gt;https://goo.gl/hVb4Qg&lt;/a&gt; [Accessed 20 Feb. 2018].&lt;a href=&#34;#fnref4&#34; class=&#34;footnote-back&#34;&gt;↩&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li id=&#34;fn5&#34;&gt;&lt;p&gt;City of Cape Town. (2018). Dam levels. [Data file and code]. Retrieved from &lt;a href=&#34;https://goo.gl/DVHi2Q&#34; class=&#34;uri&#34;&gt;https://goo.gl/DVHi2Q&lt;/a&gt;. Code available at &lt;a href=&#34;https://goo.gl/e5Voy3&#34; class=&#34;uri&#34;&gt;https://goo.gl/e5Voy3&lt;/a&gt;.&lt;a href=&#34;#fnref5&#34; class=&#34;footnote-back&#34;&gt;↩&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li id=&#34;fn6&#34;&gt;&lt;p&gt;Olivier, D. (2017). Cape Town’s water crisis: driven by politics more than drought. [online] The Conversation. Available at: &lt;a href=&#34;https://goo.gl/N9hqs7&#34; class=&#34;uri&#34;&gt;https://goo.gl/N9hqs7&lt;/a&gt; [Accessed 21 Feb. 2018].&lt;a href=&#34;#fnref6&#34; class=&#34;footnote-back&#34;&gt;↩&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li id=&#34;fn7&#34;&gt;&lt;p&gt;De Lille, P. (2018). Cape Town residents must reduce consumption to avoid Day Zero [online] City of Cape Town. Available at: &lt;a href=&#34;https://goo.gl/2uQQco&#34; class=&#34;uri&#34;&gt;https://goo.gl/2uQQco&lt;/a&gt; [Accessed 22 Feb. 2018].&lt;a href=&#34;#fnref7&#34; class=&#34;footnote-back&#34;&gt;↩&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li id=&#34;fn8&#34;&gt;&lt;p&gt;Neilson, I. (2018). Water usage reaches record low – let’s see how low we can go. [online] City of Cape Town. Available at: &lt;a href=&#34;https://goo.gl/sKd6Gn&#34; class=&#34;uri&#34;&gt;https://goo.gl/sKd6Gn&lt;/a&gt; [Accessed 22 Feb. 2018].&lt;a href=&#34;#fnref8&#34; class=&#34;footnote-back&#34;&gt;↩&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
</description>
    </item>
    
  </channel>
</rss>
