You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a query on a mode.com report, which sometimes runs fast, and sometimes slow, depending on my {% form %} settings.
When I run a slow query, my alamode graphs are all empty. Additionally, the datasets[0].content is an empty array (and, because of this getDataFromQuery returns an empty array)
I thought I could do a clever work-around by doing something like
const addHeatMap = () => {
let data = window.datasets[0].content // Works the same with `getDataFromQuery`
if(data.length == 0){
window.setTimeout(addHeatMap, 250)
console.log("No data...")
return
}
console.log(data.length)
alamode.leafletMap(
{
title: "Heatmap",
height: 700,
lat_column: "LATITUDE",
lng_column: "LONGITUDE",
query_name: "Query 1",
center_lat: -0.02 ,
center_lng: 51.481,
starting_zoom: 12.5,
dot_size: .005,
dot_opacity: .6
}
)
}
addHeatMap();
But, weirdly, if the dataset had not yet loaded the first time the code was ran, then the result is always an empty array. If the first time this code runs the query has finished running, then then the dataset is available, and the graphs render correctly.
I am assuming that this is a race condition, because visually it seems to always work if the rendering of the alamode graphs occurs after the rendering of the usual mode components it always works. It is also possible that the slower query is running into some maximum dataset size which i've been unable to find documented anywhere?
Any fixes or work arounds would be appreciated
The text was updated successfully, but these errors were encountered:
I wonder if this is related to an issue I am seeing.
On queries that return a lot of rows (I can't pin down specifically the amount), alamode/datasets object just returns an empty set. If I reduce the number of results, it works.
This is what I see when I inspect the datasets object for the larger query:
It looks like it reports on the actual size, but then "oversized" is true and the content is empty.
Are there undocumented limits for alamode? It generally feels like this is not really actively supported, which is too bad because it really helps me soften out some of the edges on what Mode is capable of.
What is odd, is the exact same query in another dashboard does load in alamode. So I wonder if it isn't a dataset limit but rather a total data limit across all queries?
Ah, yes, I had not noticed that oversized property. I guess this is an intentional filter then... Does seem to make heatmaps a bit pointless then, because that cut off seems to be a number small enough that you'd probably be better off with pins
I have a query on a mode.com report, which sometimes runs fast, and sometimes slow, depending on my
{% form %}
settings.When I run a slow query, my
alamode
graphs are all empty. Additionally, thedatasets[0].content
is an empty array (and, because of thisgetDataFromQuery
returns an empty array)I thought I could do a clever work-around by doing something like
But, weirdly, if the dataset had not yet loaded the first time the code was ran, then the result is always an empty array. If the first time this code runs the query has finished running, then then the dataset is available, and the graphs render correctly.
I am assuming that this is a race condition, because visually it seems to always work if the rendering of the alamode graphs occurs after the rendering of the usual mode components it always works. It is also possible that the slower query is running into some maximum dataset size which i've been unable to find documented anywhere?
Any fixes or work arounds would be appreciated
The text was updated successfully, but these errors were encountered: