Datasette plugin providing data dashboards from metadata
Project description
datasette-dashboards
Datasette plugin providing data dashboards from metadata
Try out a live demo at https://datasette-dashboards-demo.vercel.app
WARNING: this is a highly experimental work serving as exploration and proof-of-concept. This could become a plugin in the long run if something interesting comes up!
Installation
Install this plugin in the same environment as Datasette:
$ datasette install datasette-dashboards
Usage
Define dashboards within metadata.yml
/ metadata.json
:
plugins:
datasette-dashboards:
my_dashboard:
title: My Dashboard
description: Showing some nice metrics
charts:
- title: Number of events by day
db: jobs
query: SELECT date(date) as day, count(*) as count FROM events GROUP BY day ORDER BY day
library: vega
display:
mark: { type: line, tooltip: true }
encoding:
x: { field: day, type: temporal }
y: { field: count, type: quantitative }
- title: Number of events by source
db: jobs
query: SELECT source, count(*) as count FROM events GROUP BY source ORDER BY count DESC
library: vega
display:
mark: { type: bar, tooltip: true }
encoding:
color: { field: source, type: nominal }
theta: { field: count, type: quantitative }
To display Vega charts:
library
must be set tovega
display
is a valid Vega specification object:- Some fields are pre-defined:
$schema
,title
,width
,view
,config
,data
- All fields are passed along as-is (overriding pre-defined fields if any)
- Only
mark
andencoding
fields are required as the bare-minimum
- Some fields are pre-defined:
A new menu entry is now available, pointing at /-/dashboards
to access all defined dashboards.
Development
To set up this plugin locally, first checkout the code. Then create a new virtual environment and the required dependencies:
pipenv install -d
pipenv shell
To run the tests:
pytest
Demo
With the developmnent environment setup, you can run the demo locally:
datasette --metadata demo/metadata.yml demo/jobs.db
License
Licensed under Apache License, Version 2.0
Copyright (c) 2021 - present Romain Clement
Project details
Release history Release notifications | RSS feed
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
Hashes for datasette-dashboards-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59f32b9a3c01518801d5999de134ec2b384174a2fa4a35b1063e5859e228032d |
|
MD5 | 7ab70df9cb31294e41895127822dc8fd |
|
BLAKE2b-256 | 964bd7b940d931576d8364553366962a95f3804d48398dd52808bbb6c561a7df |
Hashes for datasette_dashboards-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d98c44ef5e87482cc156f2e6012969b3ad365faab5da57a8108069e1432f3423 |
|
MD5 | 18854a78f689ae13dda3216348791d43 |
|
BLAKE2b-256 | 129d4ea9a46a3f0b0b4bfebf9e8fd8dee00a3b4ab3e9ee007ff10f787a7eae62 |