GithubHelp home page GithubHelp logo

fagan2888 / ipysankeywidget Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ricklupton/ipysankeywidget

0.0 1.0 0.0 1.73 MB

IPython / Jupyter Sankey diagram widget

License: MIT License

Python 53.97% JavaScript 45.46% Shell 0.57%

ipysankeywidget's Introduction

IPython Sankey diagram widget Binder Conda Version

Display Sankey diagrams in IPython / Jupyter notebook using d3-sankey-diagram.

Installation

To install using pip:

$ pip install ipysankeywidget
$ jupyter nbextension enable --py --sys-prefix ipysankeywidget
$ jupyter nbextension enable --py --sys-prefix widgetsnbextension   # <-- you might have already done this,
                                                                    #     but it's safe to do again

To install using conda:

$ conda install -c conda-forge ipysankeywidget                # (that's it, nbextensions enabled automatically)

For a development installation (requires npm),

$ git clone https://github.com/ricklupton/ipysankeywidget.git
$ cd ipysankeywidget
$ pip install -e .
$ jupyter nbextension install --py --symlink --user ipysankeywidget
$ jupyter nbextension enable --py --user ipysankeywidget

Browser support

Tested in Firefox and Chrome. There have been reports that it's not working in Safari.

Documentation

See the d3-sankey-diagram API docs: the value of the SankeyWidget is exactly the same as the sankey object described there.

To change the figure size, use the ipywidgets Layout object:

layout = Layout(width="1000", height="1200")
SankeyWidget(links=data, layout=layout)

Examples

See notebooks in examples folder for usage examples. You can try these online using Binder, or follow the links to static versions on nbviewer:

Changelog

Unreleased

v0.2.5

  • You can now show link values as SVG text elements. Set linkLabelFormat to a d3-format string; links whose value is more than linkLabelMinWidth will have a label using that format.
  • Upgrade to d3-sankey-diagram version 0.7.3
  • ipysankeywidget can now be installed using conda (thanks to Ali Alsabbah #33)
  • Add a check for duplicate links (thanks to Remi Bois #23)

v0.2.4

  • Add events for clicking on nodes and links: on_node_clicked and on_link_clicked. These replace the on_selected event.

Contributors

  • Nicholas Bollweg
  • Ali Alsabbah
  • Remi Bois
  • Miguel Mendez

ipysankeywidget's People

Contributors

ricklupton avatar chimeworld avatar sildar avatar mmeendez8 avatar npmcdn-to-unpkg-bot avatar

Watchers

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.