<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Christopher Knox on Medium]]></title>
        <description><![CDATA[Stories by Christopher Knox on Medium]]></description>
        <link>https://medium.com/@vizowl?source=rss-caccae9a8641------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*SJdxBjzMCqQ_p9H1Z-IXhQ.png</url>
            <title>Stories by Christopher Knox on Medium</title>
            <link>https://medium.com/@vizowl?source=rss-caccae9a8641------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 05:33:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vizowl/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Use an Observable Notebook in a News Story]]></title>
            <link>https://medium.com/chris-knox/use-an-observable-notebook-in-a-news-story-7d9719885d2b?source=rss-caccae9a8641------2</link>
            <guid isPermaLink="false">https://medium.com/p/7d9719885d2b</guid>
            <category><![CDATA[data-journalism]]></category>
            <category><![CDATA[observables]]></category>
            <category><![CDATA[interactive-journalism]]></category>
            <dc:creator><![CDATA[Christopher Knox]]></dc:creator>
            <pubDate>Sat, 04 May 2019 23:14:50 GMT</pubDate>
            <atom:updated>2019-05-04T23:20:18.316Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>I adapted a bar-chart race in an Observable Notebook and deployed it within a New Zealand Herald article — and the whole process is surprisingly easy.</blockquote><p><a href="https://observablehq.com/">Observable Notebooks</a> are great for getting started with visualisation, collaborating and sharing, and for prototyping ideas. Observable’s extensive collection of other people’s notebooks are an excellent source of inspiration — both for ideas and techniques.</p><p>When I saw <a href="https://medium.com/u/751b6306bd5d">John Burn-Murdoch</a>’s observable implementation of a bar-chart race, <a href="https://observablehq.com/@johnburnmurdoch/bar-chart-race-the-most-populous-cities-in-the-world">https://observablehq.com/@johnburnmurdoch/bar-chart-race-the-most-populous-cities-in-the-world</a>, I decided it was time for me join the bar-chart race band-wagon.</p><p>I grabbed the data for the most capped international rugby players each year from 1900 until now and adapted John’s code — resulting in <a href="https://observablehq.com/@vizowl/international-rugby-caps">https://observablehq.com/@vizowl/international-rugby-caps</a></p><p>I showed this to the sports team at the New Zealand Herald and they wanted to use it.</p><p>Observable notebooks can be <a href="https://observablehq.com/@observablehq/downloading-and-embedding-notebooks">downloaded and embedded</a> so I decided to see whether I could use this approach within an article. But I didn’t want to rely on any of Observable’s infrastructure — Everything to be on either CDNs or Herald infrastructure.</p><p>There is quite a bit of detail in the <a href="https://observablehq.com/@observablehq/downloading-and-embedding-notebooks">downloading and embedding notebook</a> — so here I’ll just note down what was needed to roll an observable notebook into the Herald’s workflow.</p><p><em>These instructions are targeted at people that are already building and deploying javascript based apps.</em></p><p>My rugby players bar-chart race notebook is <a href="https://observablehq.com/@vizowl/international-rugby-caps">here</a>. At the Herald we use a <a href="https://webpack.js.org/">webpack</a> based <a href="http://github.com/nzherald/template">workflow</a> for deploying interactive articles. So the steps needed to use an Observable notebook are basically just:</p><ul><li>Install the notebook into the article’s javascript app</li><li>Import the notebook</li><li>Display only the relevant parts of the notebook with the article</li></ul><h4>Downloading and installing a notebook</h4><p>This was just a matter of using npm to download and include the notebook as part of our package.json</p><ul><li>First install the Observable runtime</li></ul><pre>npm i --save-dev <a href="http://twitter.com/observablehq/runtime">@observablehq/runtime</a></pre><ul><li>Then install the notebook</li></ul><pre>npm i --save-dev <a href="https://api.observablehq.com/@vizowl/international-rugby-caps.tgz">https://api.observablehq.com/@vizowl/international-rugby-caps.tgz</a></pre><p>It is also possible to pin specific versions of the notebook — but I just re-ran the install whenever I had changed the notebook.</p><h4>Importing the notebook</h4><p>We use ES6 style imports</p><ul><li>Load the Observable runtime and inspector.</li></ul><pre>import {Runtime, Inspector} from &quot;<a href="http://twitter.com/observablehq/runtime">@observablehq/runtime</a>&quot;</pre><ul><li>and then load the notebook</li></ul><pre>import notebook from &quot;international-rugby-caps&quot;</pre><h4>Using the notebook</h4><p>The Herald template relies on being provided with a div with the id nzh-datavis-root — and that is where we attach the notebook element we are using.</p><pre>const root = document.getElementById(&#39;nzh-datavis-root&#39;)<br>Runtime.load(notebook, (cell) =&gt; {<br>  if (cell.name === &quot;chart&quot;) {<br>    return {<br>      fulfilled: (value) =&gt; { root.appendChild(value); }<br>    }<br>  }<br>});</pre><p>And that’s <a href="https://insights.nzherald.co.nz/apps/2019/most-capped-players/">it</a> — it would have been nice to add a pause button to control the bar-chart animation — but deadlines. The (paywalled) article is <a href="https://www.nzherald.co.nz/sport/news/article.cfm?c_id=4&amp;objectid=12227484">here</a>.</p><h4>Extras</h4><ul><li>It is possible to include more than one element — just modify the if condition.</li><li>A little more work is required to embed notebooks that render to canvas — see the <a href="http://ashkenas.com/breakout/">breakout demo</a>.</li><li>The full Herald datavis workflow uses webpack to build and bundle all the assets. Then these are uploaded to an S3 bucket and served via Amazon’s CloudFront cdn.</li><li>I created a <a href="https://github.com/nzherald/template/tree/observable">template</a> the is already setup to use an observable notebook using <a href="https://medium.com/u/c918c478bb49">Mike Bostock</a>’s <a href="https://observablehq.com/@mbostock/2019-h-1b-employers">H1B notebook</a> as a starting point.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7d9719885d2b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/chris-knox/use-an-observable-notebook-in-a-news-story-7d9719885d2b">Use an Observable Notebook in a News Story</a> was originally published in <a href="https://medium.com/chris-knox">Chris Knox</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating an underwater data collection app]]></title>
            <link>https://medium.com/ocean-app-challenge/creating-an-underwater-data-collection-app-96513dda1c33?source=rss-caccae9a8641------2</link>
            <guid isPermaLink="false">https://medium.com/p/96513dda1c33</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[ux]]></category>
            <dc:creator><![CDATA[Christopher Knox]]></dc:creator>
            <pubDate>Sat, 24 Oct 2015 09:57:55 GMT</pubDate>
            <atom:updated>2015-10-24T09:57:55.223Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ULCQX5wW46BLDlep9-HByQ.jpeg" /><figcaption>Image credit NOAA <a href="http://oceanservice.noaa.gov/gallery/image.php?siteName=nosimages&amp;cat=Bigeye%20at%20Rapture%20Reef">http://oceanservice.noaa.gov/gallery/</a></figcaption></figure><p>For scientific divers to perform robust and efficient data collection underwater they need well designed apps that can be tailored to the specific needs and tasks of their individual institutions, organizations and users. Below, I outline some concepts to consider if you are creating an app for underwater data collection.</p><h4>Identify and focus on the key underwater tasks</h4><p>Scientific data collection often involves repeating the same tasks many times, so the best approach is to first identify those tasks and then try to make them as simple and efficient as possible. For example, in a fish counting application a designer should aim to make it possible to count a fish with a single button tap. There are always additional tasks that may require a more complex interface, but if those tasks are rare then don’t let them crowd the user’s interface or workflow.</p><h4>Consider underwater touch-screen performance</h4><p>Take some time to get a feel for how underwater user interface needs differ from normal operating conditions. Touch-screens perform remarkably well underwater — but they are not quite as sensitive as above water. In general, try to restrict your key tasks to taps and swipes. Complicated multi-touch gestures are harder to perform underwater; ‘tap and hold’ is easier underwater than double-tap.</p><p>Underwater, the performance of the touch screen is not quite as high near the edge of the screen. Try not to put regularly used buttons there. It’s also important not rely on the ‘screen edge swipe’ gesture as the housing frame can make this gesture impossible.</p><h4>Consider diving conditions</h4><p>Diving conditions can change underwater touchscreen usability. Always consider the range of diving conditions under which your app is going to be used. The dexterity of someone diving in a swimsuit in Palau is going to be quite different to that of someone wearing a drysuit and diving under the ice in the Antarctic. You may need to provide a ‘big buttons’ mode for use with bulky gloves. However, you don’t want to only provide big buttons as scientists will often want to squeeze as many data entry points as possible onto the screen, and the app may be used above water as well as below.</p><h4>Identify what the app being used for</h4><p>Broadly speaking, scientific data collection activities can be grouped into two classes — <strong>predefined protocols </strong>and <strong>open observations</strong>. These two different classes of data collection place quite different requirements on apps.</p><p>The purpose of a <strong>predefined protocol</strong> is to repeat the same observations and data recording in a similar way, many times. Generally, the ultimate goal is the production of a dataset within which meaningful spatial and temporal comparisons can be made.</p><p>Predefined protocols should not be customizable by the user. Furthermore, they should be very carefully reviewed and tested prior to deployment — in many cases a change to the app interface (on paper, this is the form layout) will create a different dataset which cannot necessarily be directly compared with previous datasets.</p><p>When carrying out <strong>open observations</strong> a scientist essentially wants to record as much relevant information about an area as possible. Many observations will still follow a protocol, but in a much more flexible way. For example, during a survey dive in a new area a user may notice that there are a large number of butterfly fish and decide to carry out a butterfly fish observation.</p><p>An app that supports open observations is necessarily more complicated than one designed for predefined protocols and needs to enable scientists to adapt their data collection requirements and goals while still in the field. It generally makes sense to provide a desktop app that supports this process, however it is important not to assume that internet connectivity will be available.</p><h4>Make the underwater workflow very clear</h4><p>There are a lot of distractions and complications when working underwater which make the workflow different to above water. For example, you can’t search online for help, or even talk to the people you are working with. Therefore, it’s extra important to ensure a clear workflow for users. Your application workflow should not simply rely on divers doing the ‘right thing’ in the right order to get the correct results. Make the workflow as clear as you can and minimise the possibility of error.</p><p>For example, scientific observations are often split up into what are called transects — there are usually a predefined distance over which observations are made. Generally, divers will carry out a series of transects during a dive and usually it makes sense to treat a transect as the fundamental block of work within an app. In a transect-based workflow there are a number of key pieces of information that should always be available to users:</p><ul><li>Has the data collection process been started?</li><li>Which transect is data currently being collected for?</li><li>How many transects have been completed?</li><li>How will the user mark a set of entries as actually part of a different transect?</li></ul><h4>Leave room for error</h4><p>As with all application design, there should be an underlying assumption that someone, somewhere will make mistakes when using the app. When it comes to data collection, errors need to be handled differently than with most app design.</p><p>For example, scientists out in the field may accidentally go into the water logged in as someone other than themselves (by picking up the wrong iPad, for example) and a whole day’s data might be collected by a ‘false’ user. What is different here is it’s important to correct this error for data collection but to <strong>also</strong> record that the error was made, rather than simply overwriting it. All parts of the data collection process are relevant to the experiment or investigation, including errors made.</p><h4>Never prevent data collection</h4><p>Tablets and other smart devices have access to lots of information and functionality that can be helpful to scientists, but ultimately the purpose of a data collection app is to collect data; users in the field should never be prohibited from doing this due to a non-critical failure.</p><p>For example, the ability to get position information is generally extremely useful and adding the functionality to grab location information before divers enter the water is a good feature. But do not make acquiring position information a requirement before starting data collection. Divers may forget to start the app before getting into the water — you don’t want to force divers to surface and get a satellite lock before they can collect data. The position information can always be added after the dive is completed. Similarly, you don’t want divers sitting on deck waiting for a satellite lock before they can get into the water.</p><p>An excellent feature of electronic data entry is the ability to validate data as it is entered. This can either be done by checking that the entered data conforms to a certain format (i.e. is it a number?) or that the values are part of a known dataset. However, in a data collection app you should never prevent ‘invalid’ from being entered. It is not at all uncommon to be told that ‘site IDs’ are only numeric characters and then to get into the field and discover that letters have been added to the IDs. You do not want your users to be unable to perform their fieldwork because the app requires them to enter a number. It obviously makes sense to warn users that the data they are entering contains a value that does not conform with previous expectations — but don’t ever stop them entering that value.</p><h4>Data integrity</h4><p>Field work is often very expensive and the data collected can be irreplaceable. Despite all its advantages, electronic data collection can pose a greater risk of data loss than paper-based approaches. In general, data should be replicated as soon as possible after it has been collected in order to minimize the risk of data loss. You should also consider all the possible states the data can be in, from collection on a device all the way to the final form in which it will be analyzed. When designing the data-flow it’s important to ensure that:</p><ul><li>replicated observations are not replicated in the final dataset, even if they are uploaded or imported multiple times</li><li>partial uploads or imports can be detected and resolved</li><li>the incomplete observations are handled correctly</li><li>the original data recorder is identified — possibly anonymously — throughout the data lifetime</li></ul><h4>Consider how to track and audit data collection</h4><p>Fieldwork underwater is often carried out in teams, with several people diving and gathering data which is then collated above water. When using paper, a coordinator or leader will usually gather all the forms from individuals and collate the data. When data is gathered through an app, rather than forms, it would be useful to replicate this natural funneling point for the data. The team leader needs an easy way to check that data is being collected correctly as well as an overview of the state of the experiment or investigation. Therefore, whatever system you use for data replication should ideally provide administrative views and summaries.</p><p>Underwater app design is an exciting and very new field with the potential to revolutionise the way we study, understand and monitor the world’s oceans — or at least the first two hundred feet — once we build the right tools and systems. This is pioneer territory, which can be very challenging, but also incredibly rewarding as we design creative and robust apps that make working with technolgy underwater possible. Hopefully, the above thoughts can help us get started.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=96513dda1c33" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ocean-app-challenge/creating-an-underwater-data-collection-app-96513dda1c33">Creating an underwater data collection app</a> was originally published in <a href="https://medium.com/ocean-app-challenge">Ocean App Challenge</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Better than paper]]></title>
            <link>https://medium.com/ocean-app-challenge/better-than-paper-41a579c24df?source=rss-caccae9a8641------2</link>
            <guid isPermaLink="false">https://medium.com/p/41a579c24df</guid>
            <category><![CDATA[user-experience]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Christopher Knox]]></dc:creator>
            <pubDate>Sat, 24 Oct 2015 09:57:28 GMT</pubDate>
            <atom:updated>2015-10-24T09:57:28.368Z</atom:updated>
            <content:encoded><![CDATA[<p>A key goal for iDive and the Ocean App Challenge is to enable data collection underwater using everyday electronic devices. While the benefits of this might seem obvious to a developer, many people within the marine science and diving communities have good reason to prefer their traditional medium of paper. We’re aiming to be so much better than paper that the obvious choice is to replace paper-based data collection protocols with electronic ones. So, before starting the process of designing and building an electronic application, and to make sure we really understand the competition, I think it is worthwhile considering the strengths and weaknesses of paper as a data-collection medium.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BiTsiIMJ-kCtiWqXj-q38w.jpeg" /></figure><p>Paper is a remarkably good medium for recording data. It has a very flexible and adaptable user interface, which is particularly important for long field campaigns where assumptions made prior to going into the field are often quickly proven wrong. Survey design on paper is also intuitive and something that all scientists can do — even in the field. Paper always provides clear feedback to users about what has been recorded and users have a clear idea where their data is and what state it is in. Finally, paper does not crash, run out of batteries, or get destroyed by sand.</p><p>However, paper does have some clear deficiencies, the most significant being that paper does not integrate well with other technology. Converting data recorded on paper into a format suitable for storage and analysis is error prone and very time consuming. Combining observation with any kind of sensor, e.g. depth, is essentially impossible to do with the precision and efficiency that is possible (and even expected) with non-paper based technology. An app will clearly out-do paper as a medium in this area.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*JV-6LAQbEmvW03I294U4IA.png" /><figcaption>Reef Check ‘Fish Data Sheet’ — see <a href="http://reefcheck.org/">http://reefcheck.org/</a></figcaption></figure><p>Paper based data collection also has an often steep learning curve. Although we can all write, many forms are difficult to fill in correctly. Sometimes this is due to poor form design, but more often than not it is due to the level of expertise required by the form. Consider the Reef Check ‘Fish Data Sheet’ — a user needs to be trained before being able to fill out the data sheet and if a user struggles with the difference between say a ‘kelp rockfish’ and ‘black rockfish’ there is no easy way to provide assistance from within ‘the paper’. An app, on the other hand, can be designed to include photos or a list of the features used to distinguish different species; information in an app can be many levels deep ‘behind’ the surface of what paper can provide.</p><p>The pros and cons of paper versus apps is a serious and useful discussion when considering app design for scientists performing data collection in the field, and one that I will continue to write about.</p><p>As I continue to discuss underwater app design in future blogs you will see that, with careful thought and good design, we can create apps that out-do paper in many ways — but consideration does need to be given to why paper works and how to better it. Once data can be entered as efficiently and easily in an app as on paper, at least there’ll be no need to worry about bad handwriting!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41a579c24df" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ocean-app-challenge/better-than-paper-41a579c24df">Better than paper</a> was originally published in <a href="https://medium.com/ocean-app-challenge">Ocean App Challenge</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mirror your GitHub world to somewhere local]]></title>
            <link>https://medium.com/dragonfly-data-science/mirror-your-github-world-to-somewhere-local-23002a10aefc?source=rss-caccae9a8641------2</link>
            <guid isPermaLink="false">https://medium.com/p/23002a10aefc</guid>
            <dc:creator><![CDATA[Christopher Knox]]></dc:creator>
            <pubDate>Thu, 03 Jul 2014 04:06:30 GMT</pubDate>
            <atom:updated>2014-07-03T04:33:22.413Z</atom:updated>
            <content:encoded><![CDATA[<h4>Backup all your GitHub code, so you can rest more easily</h4><p>We use <a href="http://www.github.com/">GitHub</a> for nearly all of our projects. All day people here are typing, and that content goes to live in the GitHub cloud. GitHub is a great service, but we feel more comfortable also having all our work backed up somewhere local.</p><p>For a while, we have run a local <a href="http://gitolite.com/gitolite/index.html">Gitolite </a>server, that we have tended to use for projects that don’t need all the GitHub features (and for clients who don’t want their projects living in the cloud). Recently, we started mirroring all our GitHub repositories to our own Gitolite server. We are now protected against the rogue account owner who inadvertently deletes all our things, against the sudden disappearance of github.com, or other unhappy accidents. As a bonus, we can now straightforwardly weed out inactive projects from our GitHub account when we like, knowing that they are archived. This means that we can start new projects without needing to upgrade our plan.</p><p>We automated this using an open-source BSD licensed python script (<a href="https://github.com/dragonfly-science/github-mirroring">available on GitHub of course</a>). The script has the following main options:</p><ul><li>mirror repositories from a user or an organization</li><li>mirror repositories to a Gitolite server (or to a local filesystem)</li><li>create a webhook on GitHub repositories to enable the script to be triggered automatically whenever repositories are updated</li></ul><p>The script could be run on occasion from the command line, or set up to run regularly. This might suit someone who wants to make sure all their code is copied across to their own computer. We make use of webhooks, so our continuous integration server is notified of any changes to the repositories. This ensures our mirror is always up to date. The process is strictly from GitHub to Gitolite and not in the other direction.</p><p>Please feel welcome to <a href="https://github.com/dragonfly-science/github-mirroring">check the project out </a>and make use of it. Issues and pull requests welcome.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=23002a10aefc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dragonfly-data-science/mirror-your-github-world-to-somewhere-local-23002a10aefc">Mirror your GitHub world to somewhere local</a> was originally published in <a href="https://medium.com/dragonfly-data-science">Dragonfly Data Science</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Don’t (re)draw with D3]]></title>
            <link>https://medium.com/dragonfly-data-science/dont-re-draw-with-d3-e396aa7de252?source=rss-caccae9a8641------2</link>
            <guid isPermaLink="false">https://medium.com/p/e396aa7de252</guid>
            <dc:creator><![CDATA[Christopher Knox]]></dc:creator>
            <pubDate>Tue, 17 Jun 2014 01:39:02 GMT</pubDate>
            <atom:updated>2014-06-17T01:39:02.580Z</atom:updated>
            <content:encoded><![CDATA[<h4>Producing web-targeted graphics offline with minimal duplication of effort</h4><p>Producing a visualisation in R or Python for on-line interactive viewing commonly requires duplication of all rendering code and doesn&#39;t leverage web standards that simplify the problem. Here I will outline an alternative approach — which we used in the creation of <a href="http://www.mbie.govt.nz/what-we-do/business-growth-agenda/regions/interactive-web-tool">New Zealand’s 2014 Regional Economic Activity Report</a>.</p><p>The current approach to exporting graphics visualisation from an offline analysis and visualisation environment (<a href="http://ggplot2.org/">ggplot2</a>, <a href="http://matplotlib.org/">matplotlib</a>) generally consists of exporting a JSON representation of the image and its associated data to be loaded by a browser and drawn using <a href="http://d3js.org/">d3.js</a>. This requires both the implicit creation of a JSON schema for the representation of interactive graphics and the re-implementation all the rendering code. ‘All’ the rendering codes means not just the plotting, but also the axis, title, legend, and label layout — arguably a much larger component of good quality graphic production than the actual graphics. My experience is that this approach transforms an exciting interactive visualisation project into slavishly struggling to re-create the exact look of images as they are produced by an analyst. Fundamentally, the issue is that the code for creating good visualisations already exists; any web-based re-implementation is always going to be playing catchup.</p><p>The solution is to stop using D3 to draw. The first line of the D3 website&#39;s description of D3 states, “<strong>D3.js </strong>is a JavaScript library for manipulating documents based on data”. While D3 is often regarded as a visualisation or rendering library, on the homepage there is very little about graphics — the section headings are: ‘Selections’, ‘Dynamic properties’, ‘Enter and exit’, ‘Transformation not representation’, and ‘Transitions’. I believe these five headings provide a solid starting point for an interactive visualisations ‘grammar’ — unsurprisingly given the excellence of D3&#39;s design.</p><p>The plots below are time series created in ggplot2 with a custom theme, they are two of 2565 facets of dataset of employment across industries and regions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/430/1*n-qWirqkaW5ZO5q5hxUKDw.png" /><figcaption>Percentage employment in construction</figcaption></figure><p>The first plot shows the percentage employment in the construction sector at three different (related) regional levels.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/430/1*qVLT_UunV5-HSR4LzFmg8g.png" /><figcaption>Percentage employment in education and training</figcaption></figure><p>The second plot shows the same information for the education and training sector. The graphical differences between these plots are typical of the transitions required for an interactive graphic, but all that actually changes as you change sector are the values on the y-axis and the geometry of the lines themselves. Therefore, to support the ‘change-of-sector’ interaction in the browser a template image is required along with the y-axis labels and the line geometry for each sector.</p><p>Our workflow for the production of on-line interactive graphics has become:</p><ul><li>Save an image representing one facet of the image as an SVG file</li><li>Export the data needed to render the changes between facets</li><li>The browser renders the SVG file and we use D3 to manage the data binding and rendering associated with the facet-to-facet transitions and bind dynamic tool-tips and highlighting to the visualisation.</li></ul><p>Subsequent posts will address the technical details. In particular, I will demonstrate how to work around the current limitations surrounding SVG output, demonstrate how straightforward the required D3 code is, and show how to wire everything up into an <a href="http://emberjs.com/">ember.js</a> application.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e396aa7de252" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dragonfly-data-science/dont-re-draw-with-d3-e396aa7de252">Don’t (re)draw with D3</a> was originally published in <a href="https://medium.com/dragonfly-data-science">Dragonfly Data Science</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>