ckanext-plotly
CKAN Chart viewer / builder built around plotly.js and the Plotly react-chart-editor.
Requirements
Compatibility with core CKAN versions:
| CKAN version |
Compatible? |
| 2.7 and earlier |
no |
| 2.8 |
not tested |
| 2.9 |
yes |
Installation
To install ckanext-plotly:
Activate your CKAN virtual environment:
. /usr/lib/ckan/default/bin/activate
Clone the source and install:
git clone https://github.com/USEPA/ckanext-plotly.git
cd ckanext-plotly
pip install -e .
pip install -r requirements.txt
Add plotly and/or plotly_explorer to the ckan.plugins setting in your CKAN config file.
Restart CKAN.
Config settings
None at present.
Rebuilding the editor/explorer
The editor/explorer is built off of react-chart-editor. At present this being react based application necessitates some effort to export for use as a CKAN javascript asset.
- Build the editor interface via npm:
cd ckanext-plotly/editor_app/src && npm run build
- Copy the built js and css bundles.
- Edit the source map in the final line.
Tests
pytest --ckan-ini=test.ini ckanext
Disclaimer
The United States Environmental Protection Agency (EPA) GitHub project code is provided on an “as is” basis and the user assumes responsibility for its use.
License
AGPL-3.0