Skip to content

A small utility to visualize networkX graphs as Datawrapper scatterplots.

Notifications You must be signed in to change notification settings

jfreyberg/nx2dw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nx2dw

A small utility to visualize NetworkX graphs as Datawrapper scatterplots. This tool helps transform your graph data into interactive, visually appealing scatterplots using Datawrapper.

Setup

  1. Clone this repository:

    git clone https://github.com/jfreyberg/nx2dw.git
    cd nx2dw
    
  2. Import the nx2dw class:

    from nx2dw import nx2dw
  3. Initialize the client with your Datawrapper API token (chart write rights required):

    client = nx2dw(ACCESS_TOKEN, TEAM_ID, FOLDER_ID)
    • Replace ACCESS_TOKEN with your API token.
    • TEAM_ID and FOLDER_ID are optional parameters for organizing your output.
  4. Create a visualization from a NetworkX graph:

    chart_id = client.create_datawrapper_graph(networkx_graph_object)

Customization

You can customize the network by passing additional arguments to create_datawrapper_graph. For details, see the source code. Refer to the example usage script for more insights. After generating the network you can further customize and edit it in the Datawrapper editor.

Example Output

Here's an example of what you can create with this tool:

Example output of nx2dw

Data is from Kaggle: Star Wars Social Network

About

This tool was originally created to generate a network for my blog post Social (and other) networks in Datawrapper.

About

A small utility to visualize networkX graphs as Datawrapper scatterplots.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages