From a08e4f373649c024b8d01f938d25ad5ef86f1b26 Mon Sep 17 00:00:00 2001 From: CodyCBakerPhD Date: Thu, 10 Jul 2025 13:25:47 -0400 Subject: [PATCH 1/4] fix: fix gaps during cumulative mode and always use bargap --- plots.js | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/plots.js b/plots.js index 73bf695..5bc23c3 100644 --- a/plots.js +++ b/plots.js @@ -268,8 +268,6 @@ function load_over_time_plot(dandiset_id) { const plot_info = [ { - //type: "scatter", - //mode: "lines+markers", type: "bar", x: dates, // Use raw dates for proper alignment y: plot_data, @@ -280,8 +278,9 @@ function load_over_time_plot(dandiset_id) { ]; const layout = { + bargap: 0, title: { - text: `Bytes sent per day`, + text: `Bytes sent per day` ? USE_CUMULATIVE : "Total bytes sent to date", font: { size: 24 } }, xaxis: { @@ -304,6 +303,23 @@ function load_over_time_plot(dandiset_id) { }, }; + if (USE_CUMULATIVE) { + const date_set = new Set(dates); + const min_date = new Date(Math.min(...dates.map(d => new Date(d)))); + const max_date = new Date(Math.max(...dates.map(d => new Date(d)))); + let all_dates = []; + for (let date = new Date(min_date); date <= max_date; date.setDate(date.getDate() + 1)) { + all_dates.push(date.toISOString().slice(0, 10)); + } + const missing_dates = all_dates.filter(date => !date_set.has(date)); + + layout.xaxis.rangebreaks = [ + { + values: missing_dates + } + ]; + } + Plotly.newPlot(plot_element_id, plot_info, layout); }) .catch((error) => { From 33530ca3c6993a81c51b6f974818f0a54d727248 Mon Sep 17 00:00:00 2001 From: CodyCBakerPhD Date: Thu, 10 Jul 2025 13:26:23 -0400 Subject: [PATCH 2/4] fix: fix gaps during cumulative mode and always use bargap --- plots.js | 1 + 1 file changed, 1 insertion(+) diff --git a/plots.js b/plots.js index 5bc23c3..77fb4c5 100644 --- a/plots.js +++ b/plots.js @@ -395,6 +395,7 @@ function load_per_asset_histogram(dandiset_id) { ]; const layout = { + bargap: 0, title: { text: `Bytes sent per asset`, font: { size: 24 } From 1a8188a1c51c63c807b9d2797873a21c6b792c9a Mon Sep 17 00:00:00 2001 From: CodyCBakerPhD Date: Thu, 10 Jul 2025 14:01:24 -0400 Subject: [PATCH 3/4] fix: title ternary --- plots.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plots.js b/plots.js index 77fb4c5..aed8995 100644 --- a/plots.js +++ b/plots.js @@ -280,7 +280,7 @@ function load_over_time_plot(dandiset_id) { const layout = { bargap: 0, title: { - text: `Bytes sent per day` ? USE_CUMULATIVE : "Total bytes sent to date", + text: USE_CUMULATIVE ? `Total bytes sent to date` : `Bytes sent per day` , font: { size: 24 } }, xaxis: { From 3e133bcdb7a967b51b1879c603184b1e096292d7 Mon Sep 17 00:00:00 2001 From: CodyCBakerPhD Date: Thu, 10 Jul 2025 14:05:10 -0400 Subject: [PATCH 4/4] fix: standardize capitalization --- plots.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plots.js b/plots.js index aed8995..284b4b3 100644 --- a/plots.js +++ b/plots.js @@ -510,7 +510,7 @@ function load_geographic_heatmap(dandiset_id) { const layout = { title: { - text: "Bytes Sent by Region", + text: "Bytes sent by region", font: { size: 24 }, }, geo: {