Git Product home page Git Product logo

interactive-network-v4's Introduction

Interactive Network Visualization

This is the code for the Interactive Network Visualization using D3 tutorial.

Changes

The code here has been updated from the original tutorial in the following ways:

  • Converted everything from Coffeescript to plain old Javascript.
  • Uses D3 version 4 - which includes significant changes to the force layout.
  • Removed jQuery and other unnecessary libraries
  • Moved the code around a bit to make things a bit clearer.

Otherwise, most of the functionality should be about the same.

Code

Most of the interesting code is in:

src/network.js

So you should start there.

There are a few other javascript files:

  • src/radial_layout.js includes a layout function for positioning things around a circle.
  • src/tooltip.js implements a simple tooltip that is used on hover.

I've attempted to add the keyword @v4 in the comments to highlight significant changes in the implementation needed when working with D3v4.

Enjoy!

Running

To view the demo on your computer, you need to be running a local web server.

If you have python installed, you can easily run a web-server from the command line.

First check which version of python you have installed:

python --version

If it is python 2.xx, then run the following command:

cd /path/to/interactive-network-v4

python -m SimpleHTTPServer 3000

If it is python 3.xx, you can use:

cd /path/to/interactive-network-v4

python3 -m http.server 3000

If node is more your style and you have npm installed, try out http-server:

# install the package globally, if you don't have it already.
# NOTE: you only need to do this once.
npm install http-server -g

cd /path/to/interactive-network-v4

http-server -p 3000

Data

The data comes from Last FM. A script used to create the json files in data can be found in:

tools/lastfm_network.rb

This is a ruby script, and may require additional packages to run.

interactive-network-v4's People

Contributors

vlandham avatar

Stargazers

Savvas Petridis avatar Yasin ATEŞ avatar DongGu avatar Jared Wilber avatar mkobar avatar Jürgen Hackl avatar Adem ilter avatar timelyportfolio avatar Wanda Wang avatar brandon flowers avatar

Watchers

 avatar timelyportfolio avatar James Cloos 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.