Replies: 2 comments
-
Yes to mutable data: https://observablehq.com/framework/reactivity#mutables To use the Observable reactive dataflow you would need to split this code into cells directly in the notebook. You can make a cell like: ```js
const data = Mutable([]);
function setData(arr) {
data.value = [...arr];
}
``` a separate cell with the plot that depends on I think this is what you had in mind. |
Beta Was this translation helpful? Give feedback.
-
I have a simlilar scenario, where I have a large database in MongoDb. What I do is segment it by year and export only the fields I need to .parquet files, which are much smaller. I've seen a considerable performance improvement. For the current year, I append the last week to the historic data and that seems to work also. |
Beta Was this translation helpful? Give feedback.
-
Hi everyone,
I’m using Observable Framework to visualize a large dataset containing two years of 5-minute time spans and corresponding data flow amounts for "profiles" (e.g., groups of IXPs). The full dataset is around 50 GB, with ~70 million rows.
To improve performance, I pre-aggregated the data into more manageable chunks (e.g., daily aggregations across 8 regions), reducing it to ~6000 rows. This version works very well for initial visualizations since I can use Observable’s built-in data loaders and keep the data in memory.
However, I want users to be able to view 5-minute data for specific profiles. I set up a JavaScript fetch function that queries my API to load this detailed data dynamically, but I’ve encountered the following issue:
When the fetch is triggered (e.g., via a dropdown or other input), the entire plot reloads, causing flickering as the plot disappears during the request and then reappears once the data is received.
Ideally, I want the plot to stay visible and only update the marks corresponding to the new data without this full reload behavior.
Questions:
How can I structure this pipeline so that dynamic data fetching seamlessly updates only the marks inside the plot without causing the flicker?
Are there specific Observable techniques, like using mutable data or Views, that would be better suited for this scenario? I haven't really been able to find out how you're supposed to deal with large data.
Are there any examples or patterns I can follow to make this interaction smoother?
Thanks in advance for your guidance!
Here's my current code:
Beta Was this translation helpful? Give feedback.
All reactions