Closed simonw closed 3 years ago
For the first version I'm going to use Vega-Lite loaded from a CDN with a SRI. I'll support basic bar charts:
select value as bar_quantity, name as bar_label from sometable;
From the example on https://vega.github.io/vega-lite/tutorials/getting_started.html
<script src="https://cdn.jsdelivr.net/npm/vega@5.19.1"></script>
<script src="https://cdn.jsdelivr.net/npm/vega-lite@5.0.0"></script>
<script src="https://cdn.jsdelivr.net/npm/vega-embed@6.15.1"></script>
Using https://www.srihash.org/
<script src="https://cdn.jsdelivr.net/npm/vega@5.19.1" integrity="sha384-dhyUMwHr1RzDslJIbzN+8UMRMobmqrmABSU3vFSBBnARl6XwbW37TVDCTQs+yEc5" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/vega-lite@5.0.0" integrity="sha384-nAwfbn/eKhGkpj7MbyqVuoGEyL/iSeZq4XJ1NNOxA9nT7eXfJuUQgpxYd27m1tAO" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/vega-embed@6.15.1" integrity="sha384-RvXMbul/5q2mGE4PXcky3u5+A/K3lk/jv+oizUX/InRPD9wELInOy6YwUxdk/tEu" crossorigin="anonymous"></script>
I could use that trick where if a query returns columns with specific names a charting mechanism kicks in. Could use Vega-Lite for this. Will be a little like datasette-vega but less flexible, at least for the first version. Probably implemented entirely in JavaScript.