Skip to main content

Python package to create interactive network based on d3js.

Project description

Interactive force-directed network creator (d3graph)

Python Pypi Docs LOC Downloads Downloads License Forks Issues Project Status DOI Medium Donate

d3graph is a python package that simplifies the task of creating interactive and stand-alone networks in d3 javascript using python. For this package I was inspired by d3 javascript examples but there was no python package that could create such interactive networks. Here it is; a library that automatically creates D3 javascript and HTML code based on an input adjacency matrix in python! This library does not require you any additional installation, downloads or setting paths to your systems environments. You just need python and this library. All other is taken care off. Huray!

This library will create an interactive and stand-alone network that is build on d3 javascript. d3graph only requirs an adjacency matrix in the form of an pandas dataframe. Each column and index name represents a node whereas values >0 in the matrix represents an edge. Node links are build from rows to columns. Building the edges from row to columns only matters in directed cases. The network nodes and edges can be adjusted in weight, color etc, based on user defined paramters.

⭐️ Star this repo if you like it ⭐️


Read the blog Creating beautiful stand-alone interactive D3 charts with Python to get a structured overview and usage of d3graph.

Documentation pages

On the documentation pages you can find detailed information about the working of the d3graph with many examples.


Install from PyPI
pip install d3graph
Import package
from d3graph import d3graph


Click on the following image to load the interactive Titanic network that is created with d3graph. Note that the relations are determined using HNet. Click here to go to the page with code to make the network.

Example: Changing node properties

Example: Convert source-target list to adjacency matrix

Example: Breaking of networks using slider


  • All kinds of contributions are welcome!


Please cite d3graph in your publications if this is useful for your research. See column right for citation information.


  • Erdogan Taskesen, github: erdogant
  • Contributions are welcome.
  • If you wish to buy me a Coffee for this work, it is very appreciated :)

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

d3graph-2.4.6.tar.gz (102.7 kB view hashes)

Uploaded source

Built Distribution

d3graph-2.4.6-py3-none-any.whl (103.2 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page