aboutsummaryrefslogtreecommitdiff
path: root/src/App.vue
diff options
context:
space:
mode:
authorTerry Truong <terry06890@gmail.com>2023-01-18 20:35:47 +1100
committerTerry Truong <terry06890@gmail.com>2023-01-18 20:35:47 +1100
commit90df26d97d829d4b78fb1934ff8d362601b4bd82 (patch)
tree5b85c8791c5f2e5b6051645131ee620887c834dc /src/App.vue
parent4cb5ec14bcfb2db4574c0b0b0d4d4aff59e24c8a (diff)
Adjust heuristic for limit on events requested
Diffstat (limited to 'src/App.vue')
-rw-r--r--src/App.vue6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/App.vue b/src/App.vue
index 4c6590a..4149a66 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -193,8 +193,10 @@ function reduceEvents(){
}
// For getting events from server
const eventReqLimit = computed(() => {
- const eventSz = store.eventImgSz * (store.eventImgSz + store.eventLabelHeight);
- return Math.max(20, Math.ceil(contentWidth.value * contentHeight.value / eventSz));
+ return Math.ceil(Math.max(contentWidth.value, contentHeight.value) / store.eventImgSz * 32);
+ // As a rough heuristic, the number of events that could fit along the major axis,
+ // multiplied by a rough number of time points per event-occupied region,
+ // multiplied by the max number of events per time point (four).
});
const MAX_EVENTS_PER_UNIT = 4; // Should equal MAX_DISPLAYED_PER_UNIT in backend gen_disp_data.py
let queriedRanges: DateRangeTree[] = SCALES.map(() => new DateRangeTree());