Code Monkey home page Code Monkey logo

assignment-3-b's Introduction

Assignment-3-B

In this assignment, you will revisit the World Bank dataset we worked with in class to further familiarize yourself with the visualization pipeline as it is implemented in d3. You will practice parsing datasets with incomplete and potentially invalid data; setting scales; drawing axes; and experimenting with different representation strategies for the same data.

An important d3 usage pattern you will practice with is the .selectAll() -> .data() -> .enter() -> .append() pattern. Even if you don't fully understand how it works yet, the important thing to understand is that this pattern takes an array of data points, and "joins" each data point to a DOM element (that is to say, an SVG shape), so that each shape--whether a circle, a rectangle, a line, or some other shape--both "contains" and "represents" a data object.

In class, the shape we've chosen has been the <circle> element. This doesn't always have to be the case. In this assignment, you will re-interpret the in-class example as a bar graph, drawn with <line> elements. Something like this:

[https://cloud.githubusercontent.com/assets/13698981/10542743/6f744da4-73e8-11e5-9f97-f89ac4d63fd5.jpg]

A few things to pay attention to:

parse function

Per inline instructions, completely eliminate data records where gdp per capita is unavailable. For the other data columns, replace unavailable data points with undefined.

draw function

Use the .selectAll() -> .data() -> .enter() -> .append() pattern to append new DOM elements

To achieve the bar graph, the DOM element for each country should be roughly organized like so

<g class="country">
  <line class="primaryCompletion" ... > //red line
  <line class="urbanPopulation" ... > //blue line
</g>

assignment-3-b's People

Contributors

viztech avatar siqister avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.