ckanext-plotly
Interactive charts of a tabular resource, right on its CKAN page, built with plotly.js and Plotly's react-chart-editor: pick columns and a chart type, style it, zoom and hover - no code, no export.
Two resource views, for any resource loaded into the DataStore (by xloader or datapusher):
| View | Plugin | What it does |
|---|---|---|
| Chart Explorer | plotly_explorer |
Visitors build their own chart from the data, on the fly |
| Chart | plotly |
An editor saves a chart with the view; visitors see that chart |
Fork of USEPA/ckanext-plotly, maintained by Phen-ICS (CNRS/IGBMC) for the FAIR3R catalogue. Published on PyPI as
ckanext-fair3r-plotly; the plugins keep their names.
What this fork changes
- CKAN 2.11 and 2.12: assets declared with WebAssets
(
webassets.yml, shipped in the package). - Packaged for PyPI, with CI that tests, builds and publishes on every merge.
Requirements
- CKAN 2.12 with the DataStore and a loader for it (xloader or datapusher): the views only offer themselves for resources whose data is in the DataStore.
Installation
-
Install the package in CKAN's virtualenv (it has no dependencies of its own):
pip install ckanext-fair3r-plotly
-
Enable one or both views in
ckan.ini; optionally add them to the views created automatically for new resources:ckan.plugins = ... datastore xloader plotly_explorer ckan.views.default_views = ... plotly_explorer
-
Restart CKAN. On a resource loaded in the DataStore, Manage -> Views -> New view now offers "Chart Explorer" and/or "Chart".
No setting to configure.
Rebuilding the chart editor
The editor is a React app (editor_app/) built once and shipped as
static files. To change it:
-
Build it:
cd editor_app/src npm run build
-
Copy the bundles into the plugin:
cp ../build/static/css/main*.css ../../ckanext/plotly/public/plotly_edit_app.css cp ../build/static/css/main*.css.map ../../ckanext/plotly/public/plotly_edit_app.css.map cp ../build/static/js/main*.js ../../ckanext/plotly/public/plotly_edit_app.js cp ../build/static/js/main*.js.map ../../ckanext/plotly/public/plotly_edit_app.js.map
-
Point the last line of
plotly_edit_app.cssandplotly_edit_app.js(their source map reference) at the copied.mapfiles.
Tests
docker exec -u ckan -it ckan-app pytest --ckan-ini=/plugins/ckanext-plotly/test.ini /plugins/ckanext-plotly/ckanext
Always pass --ckan-ini: the fixtures empty the database they run
against, and refuse to run unless its name contains test.
Credits and license
Originally written by the United States Environmental Protection Agency
(USEPA/ckanext-plotly).
Released under the GNU Affero General Public License v3.0 - see
LICENSE.
Disclaimer (from the original project)
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. EPA has relinquished control of the information and no longer has responsibility to protect the integrity, confidentiality, or availability of the information. Any reference to specific commercial products, processes, or services by service mark, trademark, manufacturer, or otherwise, does not constitute or imply their endorsement, recommendation or favoring by EPA. The EPA seal and logo shall not be used in any manner to imply endorsement of any commercial product or activity by EPA or the United States Government.
Metadata
Release files for ckanext-fair3r-plotly 0.0.2.14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ckanext_fair3r_plotly-0.0.2.14.tar.gz | 3.4 MB | Without provenance | Details for ckanext_fair3r_plotly-0.0.2.14.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ckanext_fair3r_plotly-0.0.2.14-py3-none-any.whl | Python 3 | none | any | Details for ckanext_fair3r_plotly-0.0.2.14-py3-none-any.whl |
Total release size: 6.8 MB
Release files / ckanext_fair3r_plotly-0.0.2.14.tar.gz
| Download URL | ckanext_fair3r_plotly-0.0.2.14.tar.gz |
|---|---|
| Size | 3.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
494af5d49109a830e213766c456f3d253f750d497eeb51b51c7683cdc0519b9e
|
|
BLAKE2b-256 checksum How to use checksums |
b5ae3f9767369abad6d4ee114e0edbdf9e74d78001f462c1dd2d2ff632aaa259
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.22
|
Release files / ckanext_fair3r_plotly-0.0.2.14-py3-none-any.whl
| Download URL | ckanext_fair3r_plotly-0.0.2.14-py3-none-any.whl |
|---|---|
| Size | 3.4 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bbdc8621b9a5c609ad8dbc0f74e9e84e078c029f1eead9c2412c9e5f2796b92b
|
|
BLAKE2b-256 checksum How to use checksums |
7f917ca116922f8807fe732eb1f2008ab5cbc3e5f3743307eb833f1c854cc2ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.22
|
Security for ckanext-fair3r-plotly 0.0.2.14
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.