Skip to content

Conversation

@ANAMASGARD
Copy link
Contributor

Fixes #249

Summary

Adds file size information (total_MB, mean_MB, and rows) to the download status table, helping users understand disk usage for each geom.

Problem

Currently, the download status table shows how many TSV files need to be downloaded, but doesn't show file sizes. Users can't see if they're downloading 1MB or 100MB.

Test output:
Screenshot From 2025-10-29 10-50-36

Only added the test case in this first commit in the next commit will try to fix the issue !

Test verifies animint.js generates total_MB and mean_MB columns
in download status table. Currently fails, demonstrating these
size columns are not present in the table.

Addresses #249
@ANAMASGARD
Copy link
Contributor Author

Add download size info to status table (#249)

Adds total_MB, mean_MB, and rows columns to the download status table.
Calculates total data size and row count for each geom by iterating
through all downloaded chunks. Handles both array and object data
structures. Values update as data is downloaded and displayed.

Browser screenshot verification included showing new columns working.
Screenshot From 2025-10-30 21-04-08

@codecov
Copy link

codecov bot commented Oct 30, 2025

Codecov Report

❌ Patch coverage is 90.90909% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 69.57%. Comparing base (edfa93f) to head (d5e661d).

Files with missing lines Patch % Lines
R/z_animintHelpers.R 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #272      +/-   ##
==========================================
- Coverage   72.73%   69.57%   -3.17%     
==========================================
  Files         164      163       -1     
  Lines        8792     6014    -2778     
==========================================
- Hits         6395     4184    -2211     
+ Misses       2397     1830     -567     
Flag Coverage Δ
javascript ?
r 69.57% <90.90%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ANAMASGARD ANAMASGARD requested a review from tdhock October 30, 2025 16:06
ANAMASGARD and others added 3 commits October 31, 2025 13:22
- Calculate file sizes using file.size() in saveChunks()
- Store chunk_info (bytes, rows) in plot.json
- Update table cells after download (not in draw_geom)
- Remove 36-line JavaScript calculation loop
@tdhock
Copy link
Collaborator

tdhock commented Oct 31, 2025

No obvious timing issues in HEAD=add-download-size-info
Comparison Plot

Generated via commit db9139b

Download link for the artifact containing the test results: ↓ atime-results.zip

Task Duration
R setup and installing dependencies 2 minutes and 29 seconds
Installing different package versions 14 seconds
Running and plotting the test cases 3 minutes and 23 seconds

@tdhock
Copy link
Collaborator

tdhock commented Oct 31, 2025

Thanks! This is a good start. I see the result below using https://github.com/animint/animint2/blob/master/inst/examples/WorldBank-paper.R
image

Can you please make the following changes?

  • remove selected chunk and status columns
  • right justify numeric columns
  • remove mean MB column
  • combine downloaded and total columns into one column named "files" value "4/52"
  • same for MB and rows, value should be " # downloaded / # possible "
  • This data viz, for geom3 and geom4, makes 52 numbered chunk files (chunk1 to chunk52.tsv) plus a chunk_common.tsv file. Currently the common file is counted for the numbr downloaded "4" but not for the total number "52" but we should change so that the common file is counted for both. (and for each attribute, files/MB/rows)

ANAMASGARD and others added 2 commits October 31, 2025 21:47
- Remove 'selected chunk', 'status', and 'mean MB' columns
- Add combined 'files', 'MB', and 'rows' columns (downloaded/total format)
- Right-justify all numeric columns
- Fix common chunk tracking: count in both downloaded and total counts
- Track size (bytes/rows) for common chunks in R code
- Filter chunk_info to only include each geom's own chunks
- Count only .tsv files for accurate totals in JavaScript
- Update tests to verify new column structure
@ANAMASGARD ANAMASGARD requested a review from tdhock November 9, 2025 16:06
Use 1048576 (1024*1024) consistently for MB conversion instead of
mixing 1e6 (1000000) and 1048576.

This ensures consistent size reporting for both common chunks and
regular chunks in the download status table.
Switch test-download-status-table.R to validate rendered HTML instead of
the JS source. Verify headers and right-justified numeric columns via XPath.

Update test-renderer1-variable-value.R to read the combined
column ("downloaded / total") so the chunk count checks work again.

Remove the extra blank line in NEWS.md.
@ANAMASGARD ANAMASGARD requested a review from tdhock November 11, 2025 16:28
@tdhock
Copy link
Collaborator

tdhock commented Nov 11, 2025

please click Resolve so I can see which previous comments you have already addressed

@tdhock
Copy link
Collaborator

tdhock commented Nov 11, 2025

can you please post a screenshot like this one #272 (comment) but created with the new code?

@ANAMASGARD
Copy link
Contributor Author

Sir @tdhock Here's the updated screenshot with the new download status table format:

Screenshot From 2025-11-16 21-28-41

Changes implemented:

  • ✅ Removed "selected chunk" and "status" columns
  • ✅ Removed "mean MB" column
  • ✅ Combined columns into "files", "MB", and "rows" format (downloaded/total)
  • ✅ Right-justified all numeric columns
  • ✅ Common chunk now counted in BOTH downloaded and total for all metrics

All values update correctly as data downloads, and common chunk is properly counted in both downloaded and total counts.

Please give your feedback and suggest what changes I need to make so that the failing test can be passed on the GitHub , Thank You !

@tdhock
Copy link
Collaborator

tdhock commented Nov 17, 2025

#272 (comment) seems to have the wrong old screenshot, please revise

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

download status table could show sizes

3 participants