Repository navigation
Replies: 1 comment
|
Not from a URL, no - the gadget's CSP blocks external scripts on purpose. The Workshop doesn't bundle gadget code either, What does work is bundling Plot into // chart.js
import * as Plot from "@observablehq/plot";
let rows = await gadget.getRows(); // whatever your server.js returns from BigQuery
document.body.append(Plot.barY(rows, {x: "day", y: "count"}).plot());npm install @observablehq/plot esbuild
npx esbuild chart.js --bundle --format=esm --minify --outfile=client.jsThen paste the output over |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I tried to load a lib from a gadget, but found no practical way to do that, the CSP doesn't allow it. I wanted to allow https://observablehq.github.io/plot/ in order to build dashboard using Google BQ guardkeeper.
I'm not sure if that's the best way to do that ? Any recommandations ?
All reactions