Code Monkey home page Code Monkey logo

polyviz's Introduction

polyviz: An interface between brightway2 and D3.js

This is a Python package that provides an interface between the brightway2 LCA framework and the D3.js JavaScript library. It is designed to be used in Jupyter notebooks, and provides interactive visualizations of LCA results.

This interface extends the capabilities of d3blocks, and make it compatible with results generated by brightway2.

polyviz allows the following visualizations to be created from LCA results:

Limitations

Tested only with brightway2 version 2.4.5.

Probably works with version 2.5 too, but not tested.

Installation

Install polyviz from PyPI:

pip install polyviz

and you will need to install a forked version of d3blocks:

pip install git+https://github.com/romainsacchi/d3blocks.git

Usage

Sankey diagrams

from polyviz import sankey
import bw2data

act = bw2data.get_activity(("some db", "some activity"))
method = ("some method", "some method")
sankey(activity=act, method=method)

sankey() returns a filepath to an HTML file that can be opened in a browser.

Alternatively, you can track a specific flow:

from polyviz import sankey
import bw2data

act = bw2data.get_activity(("some db", "some activity"))
flow_type = "kilowatt hour"
sankey(activity=act, flow_type=flow_type)

Other examples are available in the examples notebook.

Support

Do not hesitate to report issues in the Github repository.

Maintainers

Contributing

See contributing.

License

BSD-3-Clause.

polyviz's People

Contributors

romainsacchi avatar timodiepers 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.