• I’m doing some form of data visualization learning for 180 days because I need to #JFDI.

    See post explaining how and why I’m doing this.

    *Doing a bit of catch-up here after a few breaks.

    Reading and Learning Data Visualization Theoretically/Critically:

    The Functional Art: An Introduction to Information Graphics and Visualization by Alberto Cairo

    p 54-61 Forms and Functions: Visualization as Technology

    Three Takeaways

    • Originality-Familiarity: Refers to familiar graphical forms such as bar charts to new graphical forms. such as steam graphs p 57
    • Novelty-Redundancy: “Striking a balance between novelty (explaining many different things at once) and redundancy (explain the same things several times by different means) is critical.  Novelty is important to avoid boring your readers, but a certain level of redundancy is necessary if you want to be understood. eg. realistic illustrations accompanied by redundant copy p 57
    • “Too many communicators dumb down the data, simplifying it rather than clarifying it, and they add cutesy illustrations and icons that, to their way of thinking, will make the graphic presentations less dry. ” p 61
  • I’m doing some form of data visualization learning for 180 days because I need to #JFDI.

    See post explaining how and why I’m doing this.

    Code Learning:

    Finding Strings using RegEx

    var str = "how much wood would a woodchuck chuck"
    
    var regex = "/wood/";
    
    if (regex.test(str)) {
    
                    console.log("We found 'wood' in the string!");
    
    }
    
    => "We found 'wood' in the string!"

    To see actual matches

    var matches = str.match(regex);
    
    console.log(matches)
    
    => ["wood"]

    Find all instances of wood

    regex = /wood/g;
    
    console.log(str.match(regex));
    
    => ["wood", "wood", "wood", "wood"]

    Extend regular expression match expression that matches everything that starts with wood followed by – or more characters

    regex = /wood.*?\b/g;
    
    console.log(str.match(regex));
    
    => ["wood"]
    
    
    
  • I’m doing some form of data visualization learning for 180 days because I need to #JFDI.

    See post explaining how and why I’m doing this.

    Code Learning:

    Dimple JS in Data Viz and D3.js Course on Udacity

    Three Takeaways:

    • Example of adding x-axis DimpleJs
    var x = myChart.addTimeAxis("x", "year");
    • Example of adding y-axis with helper function in DimpleJS
    myChart.addMeasureAxis("y", "attendance");
    • Don’t forget to use Chrome Developer autocomplete to help you with method options

    Reading and Learning Data Visualization Theoretically/Critically:

    The Functional Art: An Introduction to Information Graphics and Visualization by Alberto Cairo

    p 53-54 Forms and Functions: Visualization as Technology

    Three Takeaways

    • Functionality-Decoration describes tension of adding in visual elements that are not directly used to “enhance comprehension of material” eg. added art of barbed wire in a graphic about prison stats p 53
    • Density-Lightness: “Position an infographic occupies on this axis related to amount of data it displays in relation to space it uses.” p 53
    • Multidimensionality-Unidimensionality: “This axis is a measure of two related variables: the number of layers of depth a graphic lets readers navigate, and the different forms it uses to encode the data” p 54
  • I’m doing some form of data visualization learning for 180 days because I need to #JFDI.

    See post explaining how and why I’m doing this.

    Code Learning:

    D3 nesting examples

    • Went through – wrote out by hand with comments and made a cheat sheet for work.

    Learn JS Data Strings (using lodash)

    • How to Strip Whitespace Example
    d3.csv("example.csv", function(data) {
    
                    var cleaned = data.map(function(d) {
    
                    d3.keys(d).forEach(function(k) {
    
                                    cleanD[_.trim(k)] = _.trim(d[k]);
    
                                    });
    
                    return cleanD;
    
                    });
    
    });
    • Find and Replace example using indexOfconsole.log(“A man, a plan, a canal”.indexOf(“man”) !== -1);
    => true
    
    console.log("A man, a plan, a canal".indexOf("panama") !== -1;
    
    => false
    
    indexOf is used to perform search with passed substring.  -1 is returned if sub-string can't be found.  use this to build a string finder
    
    console.log("A man, a plan, a canal".place("cancel", ""));
    
    => "A man, a plan, a"
    • Templating Example
      • To avoid using two many string escapes
    var templateString = "div class='person'" +
    
                    "  <span class='name'><$=name $></span" +
    
                    "  <spsan class='occupation'><%=occupation %></span>" +
    
                    "</div>";
    Reading and Learning Data Visualization Theoretically/Critically:

    The Functional Art: An Introduction to Information Graphics and Visualization by Alberto Cairo

    p36-52 Forms and Functions: Visualization as Technology

    Three Takeaways

    • Anticipate how readers will try to re-organize numbers in their head and take that sorting out for them p 38
    • People are not good at comparing service areas eg bubbles p 41
    • Abstraction-Figuration -> an infographic is more figurative when the relationship between the referent and its representation are more mimetic.  The more unlike its referent, the more abstract it is.  eg infographic with a realistic illustration of a person is less abstracted than a stick figure p 52
  • I’m doing some form of data visualization learning for 180 days because I need to #JFDI.

    See post explaining how and why I’m doing this.

    Code Learning:

    Udacity Data Visualization and D3.js – Continuing lecture on Dimple.jsThree Takeaways

    • Dimple.js simplifies D3 functions such as axis and certain charts
    • in myChart.addSeries(null, dimple.bar.plot); the null is telling Dimplejs not to facet or group the bars in anyway
    • Remember to use debugger and developer tools to taste piece by piece if necessary – it’s your friend

    LearnJS Grouping Data

    • Map Output
      • Have d3.nest return an object (or d3.map) of the results for direct access
    var expensesTotal = d3.nest()
    
                    .key(function(d) { return d.name; })
    
                    .rollup(function(v) { return d3.sum(v, function(d) { return d.amount; }); })
    
                    .map(expenses)
    
    console.log(JSON.stringify(expensesTotal));
    
    => {"jim":79,"carl":120.11,"stacy":90.9}
    • Multi-Level Nesting
      • Subdividing further.  Rollup callback is called for each of our smaller groupings.  Order of nest.key determines order of the grouping.
    var expensesTotalByDate = d3.nest()                
    
    .key(function(d) { return d.name; }).key(function(d) { return d.date; })         
    
    .rollup(function(v) { return d3.sum(v, function(d) { return d.amount; }); })             
    
    .map(expenses)
    
    console.log(JSON.stringify(expensesTotalByDay));
    
    => {"jim":{"11/12/2015":34,"12/01/2015":45},
    
    "carl":{"11/12/2015":120.11},
    
    "stacy":{"01/04/2016":46.1,"01/05/2016":44.8}}
    
    
    

    Order matters here:

    var expensesTotalByDate = d3.nest()             .key(function(d) { return d.date; }).key(function(d) { return d.name; })             .rollup(function(v) { return d3.sum(v, function(d) { return d.amount; }); }                .map(expenses)
    
    => {"11/12/2015":{"jim":34,"carl":120.11},
    
    "12/01/2015":{"jim":45},
    
    "01/04/2016":{"stacy":46.1},
    
    "01/05/2016":{"stacy":44.8}}
    • Derived Key Values
      • Specifying key value using a function. eg. some basic string manipulation
    var expensesByYear = d3.nest()
                    .key(function (d) { return d.date.split("/")[2]; })
                    .rollup(function(v) { return d3.sum(v, function(d) { return d.amount; }); })
                    .map(expenses);
    
    console.log(JSON.stringify(expensesByYear));
    
    => {"2015":199.11,"2016":90.9}

    Jerome Cukier D3 Selections – Putting the data in data visualization section

    Three Takeaways:

    •             var fs=[“10px”, “20px”, “30px”]; // match an array of values to selection of elements in a page
    •             d3.selectAll(“p”).data(fs).style(“font-size”, function(d) {return d;})
    •             d3.selectAll(“p”).data(fs).style(“font-size”, String) // also works as a shorter example by converting any element into a string versus having the whole function

    Reading and Learning Data Visualization Theoretically/Critically:

    The Functional Art: An Introduction to Information Graphics and Visualization by Alberto Cairo

    p25-36 Intro and Why Visualize: From Information to Wisdom

    Three Takeaways

    • What should an infographic help me with?
      • Must present several variables, allow for comparisons, help me organize comparisons, and make correlations or relationships evident.
    • “The form of a thing is a clue to its nature.”  “Form ever follows function” – however, don’t so strictly apply this – it’s not always the case in nature or with design p32
    • For designs: “The form should be constrained by the functions of your presentation… In general, the better defined the goals of an artifact, the narrow the variety of forms it can adopt.” p 36
  • I’m doing some form of data visualization learning for 180 days because I need to #JFDI.

    See post explaining how and why I’m doing this.

    Reading and Learning Data Visualization Theoretically/Critically:

    The Functional Art: An Introduction to Information Graphics and Visualization by Alberto Cairo

    11-23 Intro and Why Visualize: From Information to Wisdom

    Three Takeaways

    • You’re only drowning in data if you don’t know how to swim – in reference to information overload and the importance of understanding data structures p 14
    • Unstructured Information (meaning reality0 -> Data (encoded) -> Structured Information (eg. a communicator has turned it into a report or visual) – > Knowledge -> Wisdom p 17
      • “The role of the information architect is to anticipate this process and generate order before people’s brains try to do it on their own.” p 17
    • Remember that information visualization is a technology meant to help an audience complete tasks p. 23
  • I’m doing some form of data visualization learning for 180 days because I need to #JFDI.

    See post explaining how and why I’m doing this.

    Decomposition of a Visualization:

    Counting the Hours This is How You and America Spend Time Each Day

    • What are the:
      • Variables (Data points, where they are, and how they’re represented):
        • Hours spent on x-axis
        • Percentage of people y-axis
        • Color hue for selector
        • Histogram
      • Data Types (Quantitative, Qualitative, Categorical, Continuous, etc.):
        • Continuous
        • Categorical
      • Encodings (Shape, Color, Position, etc.):
        • Color Hue
        • Histogram bars
    • What works well here?
      • The narrative accompanying the bars is what is making things interesting.
    • What does not work well and what would I improve?
      • Only nitpick is wondering why he selected the activities to focus on that he did – where there more categories?
    • What is the data source?  Do I see any problems with how it’s cited/used?
      • BLS statistics data using a system from Minnesota Population Center
    • Any other comments about what I learned?
      • Admiration here for the simple and consistent branding of Nathan Yau’s blog.
  • See post explaining how and why I’m doing this.

    Code Learning:

    Selections in d3 – the long story

    Three Takeaways:

    • D3 looks not cryptic but is
    • Take extra care that ‘inheritance’ in D3 is not the same for every layout either
    • In D3 like in real life “children behave like their parents, unless they are given specific instructions.”

    Learn Js Iterate Data End + Grouping Data

    • Remember you can chain different functions togther for data wrangling.  Sort here is working on returned filtered array from value.
      • var bigCities = data.filter(function(d) { return d.population > 500000; })
        • .sort(function(a,b) { return a.population – b.population; })
        •  .map(function(d) { return d.city; });
    •  D3.nest functionality produces groups of data with minimal amounts of code from flat data structures eg
      •  d3.csv(“expenses.csv”, function(data) {
      • });
      • var expensesByName = d3.nest()
      •   .key(function(d) { return d.name; })
      •   .entries(expenses);
      •   expensesByName = [
      •   {“key”:”jim”,”values”:[
      •     {“name”:”jim”,”amount”:34,”date”:”11/12/2015″},
      •     {“name”:”jim”,”amount”:45,”date”:”12/01/2015″}
      •   ]},
      •   {“key”:”carl”,”values”:[
      •     {“name”:”carl”,”amount”:120.11,”date”:”11/12/2015″}
      •   ]},
      •   {“key”:”stacy”,”values”:[
      •     {“name”:”stacy”,”amount”:12.00,”date”:”01/04/2016″},
      •     {“name”:”stacy”,”amount”:34.10,”date”:”01/04/2016″},
      •     {“name”:”stacy”,”amount”:44.80,”date”:”01/05/2016″}
      •   ]}
      • ];
    • With roll-up, you can provide a function that takes in an array and can produce a value based on the array.
      • var expensesCount = d3.nest()
        •   .key(function(d) { return d.name; })
        •   .rollup(function(v) { return v.length; })
        •   .entries(expenses);
      • => [{“key”:“jim”,“values”:2},{“key”:“carl”,“values”:1},{“key”:“stacy”,“values”:3}]

  • I’m doing some form of data visualization learning for 180 days because I need to #JFDI.

    See post explaining how and why I’m doing this.

    Code Learning:

    Udacity Data Visualization and D3.js – Continuing lecture on Dimple.js

    Three Takeaways

    • Use debugger; to stop page loading at that line of code when using the Chrome developer console
    • A cool feature of chrome debugger is the console.log(data) – the table function that outputs with a tabular format like a spreadsheet.  Caution on use with large data sets
    • “use strict” lets the browser know you want to enforce a restricted subset of JS in the function.  It also forces the browser to throw explicit erros when Javascript might silently fail

    Reading and Learning Data Visualization Theoretically/Critically:

    The Functional Art: An Introduction to Information Graphics and Visualization by Alberto Cairo

    xv-11 Intro and Why Visualize: From Information to Wisdom

    Three Takeaways

    • “The life of a visual communicator should be one of systematic and exciting intellectual chaos” p 5
    • “The first and main goal of any graphic and visualization is to be a tool for your eyes and brain to perceive what lies beyond their natural reach” p 10
    • “In information graphics, what you show can be as important as what you can hide” eg greyed out lines in time series in the background while important values are called out in colors p 11
  • I’m doing some form of data visualization learning for 180 days because I need to #JFDI.

    See post explaining how and why I’m doing this.

    Reading and Learning Data Visualization Theoretically/Critically:

    Visual Storytelling with Data Meetup with Kaiser Fung and Ray Vella

    Three Takeaways:

    • People don’t think about the assumptions made enough, both by others and themselves, in viz when data is excluded.
      • Eg. political reporting only showing options on two candidates and leaving out the undecideds so numbers don’t add up to a whole
    • Sometimes you have to do something with units to make them more comprehensive and even emotionally resonating, eg. 9 lbs of eggs wasted by average american per year means 6 cartons of eggs – the 6 cartons of eggs is much more meaningful
    • Don’t forget about the human aspect of data over trying to produce flash with stats and imagery – giving the example of using people and biophilia in viz