Code Monkey home page Code Monkey logo

d3_lab_exercise's Introduction

D3 Lab Exercise

The following lab exercise is designed to introduce you to making interactive data visualizations in D3.

Introduction

For both of these exercises you will need to run a python local server. You will then be able to view the progress you make in the exercise, in your browser.

  1. Download the code from this repository.
  2. In the command line, navigate to the folder that contains this repository.
  3. Depending on which exercise you are working on, navigate to either the Basic or the Advanced Exercise folder.
    cd D3BasicExercise
    
  4. Type the command below for whichever version of Python you are running to start a local server:
    python -m SimpleHTTPServer (for Python 2)
    python -m http.server (for Python 3)
    
  5. Once you have the server up and running, in your browser, go to the link 0.0.0.0:8000/ to view your code in action.
  6. By default the server serves the index.html in your folder to the browser. You can open other files from the same folder in the browser by appending the file name to the default address. For e.g. 0.0.0.0:8000/solutions.html to open the solutions.html file from the same folder.

Once your server is up, start with the exercises in app.js. Don't forget to use your browser developer tools for debugging!

Note : After making changes to your file, if they do not reflect on your browser: do a hard refresh with Shift+click on the refresh button.

D3 Basic Exercise (start with this)

  1. Open the index.html and app.js files and follow along with the comments in app.js to add the missing code and get the visualization working.
  2. As you go through, try to figure out what is going on with the code. Ask the TAs if you need help.
  3. When you are done (or if you are really stuck!) look at the app_solution.js file.
  4. If you get the basic visualization working, you can make your own modifications (add animations and interactivity, change colors, etc.) or move on to the advanced exercise below.

D3 Advanced Exercise

If you already have some experience in D3 or have completed the beginner exercise. Try your hand at this more advanced exercise. The original idea is from a Spring 2015 assignment by David Eicke. However, it has not been updated to use D3 v4, so... anyone who contributes that update will be appreciated.

  1. Read through David's code (original.html) and look at the visualization in your browser to get a sense of what is going on in the code.
  2. Implement this code using the billboardtop5.csv data.
  3. Make any necessary changes to the size of the rectangles.
  4. Make any other modifications you like to the animation, colors, etc.

d3_lab_exercise's People

Contributors

kpotluri avatar samueldmeyer avatar

Stargazers

Roman 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.