Interface between Brightway2 and D3.js
Project description
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:
- Sankey diagrams (example 1, example 2)
- Chord diagrams (example 1, example 2)
- Force-directed graphs (example 1, example 2)
- Tree maps (example 1, example 2)
- Choropleth maps (example 1, example 2)
- Violin plots (example 1, example 2)
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
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
Built Distribution
File details
Details for the file polyviz-1.0.3.tar.gz
.
File metadata
- Download URL: polyviz-1.0.3.tar.gz
- Upload date:
- Size: 16.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c7247748cf7f449508bf5c9cb9373dcab8af25280a60d6c541449e66965a24b |
|
MD5 | a4463cf89fc97e52872851705fc9487b |
|
BLAKE2b-256 | bf129bfd59033a96d33863d19e2aac218f19fb1d0c239a69155a73bc2298bb56 |
File details
Details for the file polyviz-1.0.3-py3-none-any.whl
.
File metadata
- Download URL: polyviz-1.0.3-py3-none-any.whl
- Upload date:
- Size: 19.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35deeb839a2059a02def9a5c1c763d96ec4b02b52e1660f072610506d807396d |
|
MD5 | 5bcbe711c1f1a294042beb35561d0879 |
|
BLAKE2b-256 | 40d51435eb1c7d10789c26b4e930a63ca72b7ba88a4b8a7f750287e0db5f36f1 |