-
All the examples on the Mosaic site load data from URLs or a local file (presumably for use in a Framework project). However, there are no working examples for loading a FileAttachment as data, and I can't seem to get it to work either Exemplar notebook here: https://observablehq.com/@josesho/mosaic-troubleshoot-loading-data Any help here is appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @josesho! We include examples of using Mosaic in Observable Framework here: https://idl.uw.edu/mosaic-framework-example/mosaic-duckdb-wasm Framework provides a You can use a file attachment, however. You must first instantiate the FileAttachment and then use it to get a URL to the file (as opposed to loading it directly). You can then use that URL as input to a load query generator such Finally, here is an example using Mosaic in an Observable notebook (not Framework): https://observablehq.com/@uwdata/mosaic-cross-filter-flights-10m. Here the file URL is hard-coded, but one could use a FileAttachment to get a file URL instead. |
Beta Was this translation helpful? Give feedback.
Hi @josesho! We include examples of using Mosaic in Observable Framework here: https://idl.uw.edu/mosaic-framework-example/mosaic-duckdb-wasm
Framework provides a
sql
property in the YAML front matter that is easier to use than FileAttachment.You can use a file attachment, however. You must first instantiate the FileAttachment and then use it to get a URL to the file (as opposed to loading it directly). You can then use that URL as input to a load query generator such
loadCSV()
, and then you have to execute the query. (And, you have to do all of this in a way that "plays nice" with the Observable Reactive runtime, ensuring that the load queries complete prior to making other API calls...…