Replies: 1 comment 4 replies
-
Hi Avindhya - the way you're doing it makes sense. Route params should be an exception to the static string literal rule, as documented here. Curious if it makes any difference with just a single parameter in the string. Also, do the params show up properly if you log them to the console outside of the file attachment code? If the params are correct, we should probably file a bug. Is there a minimal example you could share so I could reproduce the issue? Instead of outputting to csv, you may want to look into parquet data loaders to handle larger datasets in fewer files. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
I'm working with Observable Framework and trying to build dynamic visualizations that respond to user input. The user inputs are fairly simple—typically filtering data by geographic location (e.g., country) and year.
However, the underlying dataset is quite large (5 million+ rows), so performance is a concern. I'm looking for an efficient way to handle this, especially given that I'm new to Observable Framework.
I came across parameterized routes and thought they might help. I tried to use them to dynamically load a CSV file based on the route params. Here's what I attempted:
But this gives the error:
SyntaxError: FileAttachment requires a single literal string argument (3:23)
From what I understand, FileAttachment() doesn’t support dynamic paths via template strings, which throws off my initial idea.
My questions:
What’s the best practice for dynamically loading data based on route parameters in Observable Framework?
Should I be using a several data loaders to query the various filtered versions of the dataset on-demand? What's the solution there?
Are there any recommended patterns or examples for handling large datasets efficiently in the Observable Framework context?
Any help or advice would be greatly appreciated!
Thanks 🙏
Beta Was this translation helpful? Give feedback.
All reactions