• 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

    2b Dimple.js lecture:

    • Dimple.js is framework that allows us to work at abstraction level charts rather than lower level visual codings such as shape and visual encoding.
    • Built on top D3 and designed for analysts to easily create charts and exposes native D3 objects as well.
    • D3 should be loaded before Dimple.js library in <head>

    Back to Basics Front-End Web Dev on D3 (not doing takeaways since I just need to review and run through this – anything I need to memorize I do with pen and paper so it’ll REALLY sink in)

    Reading and Learning Data Visualization Theoretically/Critically:

    Reading Nathan Yau’s book Visualize This

    311-341 Designing with a Purpose

    Three Takeaways:

    • “So the next time you have a dataset in front of you, try not to jump right into design.  That’s the lazy person’s way out, and it always shows in the end.  Take time to get to know your data and learn the context of the numbers” p 328
    • “Your job as a data designer is to communicate what you know to your audience.  They most likely didn’t look at the data, os they might not se the same thing that you see if there’s no explanation of setup.” – giving primers and simple explanations will make a world of difference p 330
    • Don’t neglect use of colors to help give context (somber versus light and evoke emotion.  “choose colors that represent an accurate message” p 337
  • 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

    2b Dimple.js lecture:

    • Dimple.js is framework that allows us to work at abstraction level charts rather than lower level visual codings such as shape and visual encoding.
    • Built on top D3 and designed for analysts to easily create charts and exposes native D3 objects as well.
    • D3 should be loaded before Dimple.js library in <head>

    Back to Basics Front-End Web Dev on D3 (not doing takeaways since I just need to review and run through this – anything I need to memorize I do with pen and paper so it’ll REALLY sink in)

    Reading and Learning Data Visualization Theoretically/Critically:

    Reading Nathan Yau’s book Visualize This

    301-310 Visualizing Spatial Relationships

    Three Takeaways:

    • Putting together multiple smaller maps (omg maps small multiples!) can be a great way to see patterns in spatial data p. 303
    • To show differences – focus on changes in one map instead of slices of time.  Eg. show choropleth for metric of change in each country (Example given urbanization from 2005 to 2009 with darkest colors as change) p. 307
    • Map animations, eg walmart spreading like a virus, help make the data immediately more understandable, eg bubbles moving through time p 310
  • 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.

    It’s pretty cool to just see how much information I’ve consumed in the last 112 days I’ve been doing this.  Honestly, it’s brought a lot of self-awareness about the learning process that I didn’t have before; I’ve never been quite the stellar student, but rather an enthusiastic piecemeal learner of things.  This process is teaching me how to be a better student to actually master something I really want to master.  A lot of my normal habits in information consumption, doing things piecemeal or reading a lot of material hasn’t necessary been the best at helping me master D3 or Data Viz in general.  Namely, I just gotta make more stuff.

    Today while I was trying to make more stuff to complete my Knight Journalism Intermediate D3 for Data Visualization  I realized that my data manipulation skills in Javascript in particular are really holding me back from what I want to do.  Originally, my skills in displaying data, like actually designing what viz to use and how to customize it, were more immediately in question.  Now it’s a coming to jesus that I need to get way better at data munging using Python beforehand and better at Javascript in pulling in data.  Just don’t understand those functions and methodologies as well as I should.

    The shifting gears piecemeal way I’ve also been going about this with different learning sources of learning D3 simultaneously with D3 (out of necessity) has made this process difficult and stressful because I’m not sure where I’m at really.  Just in general, my coding skills aren’t that strong because I haven’t had to work consistently in one project – was in grad school prior to this one so it was quite haphazard – and now I gotta clamp down.  It’s a very different approach to become more specialized.  I think I need to really focus on fundamentals in coding while simultaneously upping my game in D3 and still be reading about design as much as possible.

    All things I love, but I gotta stay more focused.

    One drawback of doing the 180 days, especially because when I started I wasn’t working full-time, is the impetus to have something to show for it at end of everyday, whether it’s takeaways from coding or reading.  It’s much harder doing an actual project, where you can’t see the results day-to-day, even though you’ve been solving serious problems to move forward the on the project.  I need to start letting that go a bit – maybe do the three takeaways approach for what doesn’t work.

    Code Learning:

    Backing to working through basics of Web Development (including Javascript) on Treehouse – just some basic exercise to kick off my study session or even day.

    Will go back and finishing what I should have stuck with- which is the Udacity Data Visualization and D3.js course that I learned the most from starting tomorrow.

    Reading and Learning Data Visualization Theoretically/Critically:

    Reading Nathan Yau’s book Visualize This

    287-300 Visualizing Spatial Relationships

    Three Takeaways:

    • SVG is actually an XML file -> text with tags editable in text editor -> when you want to fill in a choropleth you are modifying style attributes of path p 292
    • Wikipedia is a good source of base mags in svg p 298
    • Use code to iterate through data values and assign color values and use if else statements to help you p 300

     

  • 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:

    The Vicious Cycle Emerging Between War and Severe Weather Will Be Hard To Stop

    • What are the:
      • Variables (Data points, where they are, and how they’re represented):
        • Map locations – represented as choropleth and points on map
        • Numerical values and time series
      • Data Types (Quantitative, Qualitative, Categorical, Continuous, etc.):
        • Continuous trends
        • Categorical locations and characteristics
      • Encodings (Shape, Color, Position, etc.):
        • Color hue on both choropleth and points on map – good use of color hue and red and green scale
        • Line time series position and color
    • What works well here?
      • This is one of the better maps I’ve seen to prove a point without clutter or distortion
    • What does not work well and what would I improve?
      • Gain index and trendline not as clearly explained
    • What is the data source?  Do I see any problems with how it’s cited/used?
      • Global Adaptation Index
    • Any other comments about what I learned?
      • Good use to simple clean red to green color hue
  • 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:

    Reading Nathan Yau’s book Visualize This

    272-286 Spotting Differences

    Three Takeaways:

    • Google and many other services provide APIs for geocoding p 273
    • Drawing lines (and then adding layers of encoding on them) with map regions can be an interesting way to draw connections p 282
    • Sized circles and coloring regions by data are among most common ways data is plotted over maps p 286
  • 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:

     Knight Journalism Intermediate D3 for Data Visualization 

    Week Four Discussion Question

    Geographic maps are undoubtedly useful tools for communicating data visually, yet they inevitably introduce distortions and mistruths. What are some of the compromises

    that must be made when producing a geographic map? (Consider sharing an example to illustrate your point.)


    The biggest example I can think of that pops off my head are maps that map data characters of populations over the map of the United States… when you just end up getting a map of the population distribution of the United States rather than being able to denote a trend.  Also, regional-level maps also distort complexity.

    For example, an electoral map by state doesn’t reveal the story of urban voting trends.  On the flipside, the newly sectioned map does not account for population clusters.

    Week Four Quiz

    Three Takeaways:

    • D3 projections take a two-value array: longitude and latitude and return x and y as output
    • You should value maps to area of each circle rather than radius to avoid distortion
    • To make a choropleth, use Javascript to match datasets (CSV and GeoJSON) and bind the merged array to the paths
    Reading and Learning Data Visualization Theoretically/Critically:

    Reading Nathan Yau’s book Visualize This

    258-272 Spotting Differences

    Three Takeaways:

    • Multidimensional Scaling can help you find clusters – there are various models you can use to do this p 261
    • Ways to find outliers: bar charts, histograms, boxplots p 269
    • When working with Maps data, think of x and y coordinates as longs and lats p 272
  • 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:

    Learn JS Data: Iterating Over and Reducing Data

    Three Takeaways:

    •  Sorting, unlike filter, map, and other functions modifies the array you are sorting in place, instead of returning a new array with objects sorted.
      • You need a comparator function that takes two pieces of data and indicates which one you want higher on the list.
      •  Example of sorting population in a desecending order:
      • data.sort(function a, b) {
      •                 return b.population – a.population;
      • });
    • D3 also has a few helper functions to implement ascending and descending comparator functions but they appear to only accept arrays of raw numbers instead of objects. In odrer to use d3.ascending or d3.descending you may need to do something like this:
      • var populations = data.map(function(d) { return d.population; });
      • console.log(populations);
        • => [652405, 8405837, 645966, 467007]
      • populations.sort(d3.descending);
    • Reduce() applies a function against an accumulator and each value of array to reduce to a single value.
      • First is a call back function that will return the reduction.  The function is passed in the previous value from the last time the callback was called.  Reduce can also take an initial value, which is the second parameter to the reduce call.
      • var landSum = data.reduce(function(sum, d) {
      •   return sum + d.land_area;
      • }, 0);
        • => 749.8
      • var weirdString = data.reduce(function(str, d, i) {
      •   var ending = (i % 2 === 0) ? ” is cool.” : ” sucks.” ;
      •   return str + ” ” + d.city + ending;
      • }, “”);
        • => seattle is cool. new york sucks. boston is cool. kansas city sucks.

     Knight Journalism Intermediate D3 for Data Visualization 

    Week Four Lecture: Adding Data Points to the Map

    • Data load involves loading long and lat values in function by setting attributes in property as an array in projection
      • .attr(cx, function(d) { return projection([d.longitude, d.latitude])[0]; })
      • .attr(“cy”, function(d) { return projection([d.longigtude, d.latitude])[1]; })
    • Order matters to make sure circles or other elements are after paths so that they’re overload
    • Use Math.sqrt to scale circles by area and not radius to be proportional
      • Math.sqrt(+d.population * .001)
  • 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:

    Knight Journalism Intermediate D3 for Data Visualization 

    Week Four Lecture: Encoding Data on the Map
    Three Takeaways:
    ·         Choropleth map – coloring map for meaning – D3.scale.quantize() function allows you to put in numeric values and gets back colors (essentially a scale)
    ·         Colorbrewer color palettes are validated spectrums/palettes for skews and colorblindness
    ·         You bind new data to each country to show data
     
    • Create Parameter and use a calculated field
    • Drag that into Filters
      – Use Sets to create a custom grouping to filter on if none exists (eg. a non-default sales region)
    • Combine sets and dimensions for stronger filtering capabilities

    Iterate Data

    • Immutability: “forEach provides for a basic way to loop through our data set. We can use this to modify the data in place, generate counts, or perform other manipulations that deal with each piece of data individually. This works, but can get clunky and confusing fast. Keeping straight what form the data is in at any given time can be confusing, as can side effects of modifying your data that you might not be aware of. To combat this confusion, it can be useful to think of the data as immutable. Immutable data cannot be modified once created. Immutability seems a bit counterintuitive for a task where we want to coerce our data into the form we want – but it comes together with the concept of transformations. The idea is simple: each immutable dataset can be transformed into another immutable dataset through the use of a transformation function that works on each component of the data. This process helps simplify the data flow, but if you have to make a copy of your data object each time, it can make code a bit brittle as you have to keep track of every attribute of your dataset.”
    • Map takes an array and produces another array which is the result of the callback function being executed on each element in the array.
      var smallData = data.map(function(d,i) {return {
      name: d.city.toUpperCase(),
      index: i + 1,
      rounded_area: Math.round(d.land_area)
      };
      });
      console.log(data[0]);
      console.log(smallData[0]);
      => {city: “seattle”, state: “WA”, population: 652405, land_area: 83.9}
      {name: “SEATTLE”, index: 1, rounded_area: 84}
    • Filtering: Select a subset of the data using the built in filter method. This creates a new array of data (again see transformation talk above) with only the values that the callback function returns true for.
      var large_land = data.filter(function(d) { return d.land_area > 200; });
      console.log(JSON.stringify(large_land));
      => [{“city”:”new york”,”state”:”NY”,”population”:8405837,”land_area”:302.6},
      {“city”:”kansas city”,”state”:”MO”,”population”:467007,”land_area”:315}]
  • 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:

    Knight Journalism Intermediate D3 for Data Visualization 

    Lecture Week Three Quiz

    Three Takeaways:

    • Geographic data will likely start with an ESRI Shapefile
    • Northern hemisphere geography is overrepresented; severe distortion near poles in Mercator projection
    • Cardinal directions (NSEW) are preserved (as up/down/right/left) in Mercator projection

    Discussion Question Answer:

    • With web-based mapping tools becoming common and ever-more accessible, the field of cartography is undergoing massive changes and an influx of amateur mapmakers.

      What considerations should non-cartographers (or anyone) keep in mind to create responsible, honest maps? (Consider sharing an example to illustrate your point.)

      Remembering that many maps are not without biases is always important to consider.  Eg. what is a country, how are continents sized, famously demonstrated in the Mercator versus Peter example in the West Wing.

      In a less political sense as well, overlaying data on maps can pose it’s own challenges to amateur cartographers, such as choosing the right visual encodings to not mislead on the data or respect privacy.

    Learn JS Summarizing Data and Iterating

    Three Takeaways:

    • To use d3.min and d3.max at same time, use d3.extent()
      • eg. var landExtent – d3.extent(data, function(d) { return d.land_area;});
    • Summary stats include d3.mean, d3.mean, and d3.deviation
      • eg var landSD = d3.deviation(data, function(d){ return d.land_area;});
    • Iterating.  You can process data using forEach() that performs a specified action for each element in array in ascending order, without using a loop function.
      • data.forEach(function(d) { count += 1; });
  • 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:

    Knight Journalism Intermediate D3 for Data Visualization 

    Lecture Week Three: Paths and Projections

    Three Takeaways:

    • Use various projections for mapping paths, eg mercator, etc. in D3
    • eg. d3.geo.mercator() with various options and then call .path().projection(projection_var)
    • Load data as JSON as normal, but  specify features in array .data(json.features)