Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Really basic charting support #10

Closed
simonw opened this issue Mar 13, 2021 · 3 comments
Closed

Really basic charting support #10

simonw opened this issue Mar 13, 2021 · 3 comments
Labels
dashboard-widgets enhancement New feature or request

Comments

@simonw
Copy link
Owner

simonw commented Mar 13, 2021

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.

@simonw
Copy link
Owner Author

simonw commented Mar 15, 2021

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;

@simonw
Copy link
Owner Author

simonw commented Mar 15, 2021

From the example on https://vega.github.io/vega-lite/tutorials/getting_started.html

    <script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
    <script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
    <script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>

@simonw
Copy link
Owner Author

simonw commented Mar 15, 2021

Using https://www.srihash.org/

<script src="https://cdn.jsdelivr.net/npm/[email protected]" integrity="sha384-dhyUMwHr1RzDslJIbzN+8UMRMobmqrmABSU3vFSBBnARl6XwbW37TVDCTQs+yEc5" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]" integrity="sha384-nAwfbn/eKhGkpj7MbyqVuoGEyL/iSeZq4XJ1NNOxA9nT7eXfJuUQgpxYd27m1tAO" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]" integrity="sha384-RvXMbul/5q2mGE4PXcky3u5+A/K3lk/jv+oizUX/InRPD9wELInOy6YwUxdk/tEu" crossorigin="anonymous"></script>

@simonw simonw closed this as completed in 0a614e1 Mar 15, 2021
simonw added a commit that referenced this issue Mar 15, 2021
simonw added a commit that referenced this issue Mar 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dashboard-widgets enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant