Skip to main content

Python package to create interactive network based on d3js.

Project description

Interactive force-directed network creator (d3graph)

Python PyPI Version License Github Forks GitHub Open Issues Project Status DOI Downloads Downloads Sphinx Medium

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 ⭐️

Blogs

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.

Installation

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

Examples

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


Contribute

  • All kinds of contributions are welcome!

Citation

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

Maintainer

  • 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.2.1.tar.gz (95.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

d3graph-2.2.1-py3-none-any.whl (95.9 kB view details)

Uploaded Python 3

File details

Details for the file d3graph-2.2.1.tar.gz.

File metadata

  • Download URL: d3graph-2.2.1.tar.gz
  • Upload date:
  • Size: 95.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.8.12

File hashes

Hashes for d3graph-2.2.1.tar.gz
Algorithm Hash digest
SHA256 ad0f92a0d1fcbc0a3d9448a024dd61b9a533ea84a1433cfab5084de16f396c1a
MD5 1f06597e34339dd5bd3a90a64344f3c0
BLAKE2b-256 c55c74f62844f5fa1127c4ff08eb692d8690982d3b2fefc45f5fca2b7cce9088

See more details on using hashes here.

File details

Details for the file d3graph-2.2.1-py3-none-any.whl.

File metadata

  • Download URL: d3graph-2.2.1-py3-none-any.whl
  • Upload date:
  • Size: 95.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.8.12

File hashes

Hashes for d3graph-2.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6d46a40d57647fd50f18feeee151e1e90173bf70cef670e978f887a0e1f46e16
MD5 70c30a72adee231ee68b1b823045f956
BLAKE2b-256 75dfbaec9dfc4ddc4d7258c08ea874096885dd1443bb4210d9a38377e5c3ed13

See more details on using hashes here.

Supported by

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