Skip to content

Let the dashboard use uploaded CSV data - #6

Closed
macromeer wants to merge 1 commit into
mainfrom
data-upload
Closed

macromeer wants to merge 1 commit into
mainfrom
data-upload

Conversation

@macromeer

Copy link
Copy Markdown
Owner

Adds a Data tab to the dashboard (#5): replace the data of panels B–F with your own CSV files.

The Data tab

  • Pick a data set (B, C, the two D series, E, F). The tab lists its columns, explains them, and shows the fixed axis range. The current data are shown in a table (DT).
  • Replace with a CSV file: the upload is checked first. If something is wrong, the message names the column and row (for example Column trachea_length, data row 5: 'n/a' is not a number.), and the previous data stay.
  • Example CSV downloads the repository's data in the expected format, to start from. Use example data switches back.
  • Uploaded data stay in the session (in the Shinylive version they never leave the browser).
  • If rows fall outside the fixed axis ranges, a note under the figure says how many and gives the range.

Checks (check_figure_data()): required columns and their types, missing values, positive values on the log axes (D widths and shear stress, F's K), at most two groups in C (two colours), at most three genes in E (three point shapes). In E the horizontal error columns are optional, but if given they must come in pairs.

Changes in R/figure.R

  • axis_limits() holds the fixed axis ranges. The panel scales now read them from there; the values are the same, and the snapshots are unchanged.
  • check_figure_data() and count_outside_axes() are new.

Tested

  • 127 tests pass locally: the new checks (accepts the repository's data and a CSV round trip, rejects each kind of problem with the expected message), and in testServer() a valid upload, an invalid upload that keeps the old data, the out-of-range note, the example CSV round trip, and resetting to the example data.
  • Uploads also work in the browser, both with shiny::runApp("app") and in a Shinylive export (headless Chromium, real file uploads): the invalid file is rejected with its message, the valid one replaces panel C, and the note reports the rows above the axis.
  • DT is added to Suggests. In the Shinylive export it also bundles rmarkdown/knitr; the export grows from 115 to 119 MB.

🤖 Generated with Claude Code

A new Data tab in the app shows each data set (B, C, D1, D2, E, F) as a
table, takes a CSV file to replace it, offers the example data as CSV,
and switches back to the example data. Uploads are checked before they
are used; a file with a problem is rejected with a message naming the
column and row, and the previous data stay. Rows outside the fixed axis
ranges are counted and reported under the figure. The data live in the
session only.

R/figure.R gets the shared pieces:
- axis_limits(): the fixed axis ranges, now used by the panels' scales
  (same values, no snapshot changes)
- check_figure_data(): column names and types from data_schemas(),
  missing values, positive values on log axes, at most two groups in C
  and three genes in E, horizontal error bars in E optional but paired
- count_outside_axes()

The panel cache key now includes the panel's data sets. DT is added to
Suggests for the table.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@macromeer

Copy link
Copy Markdown
Owner Author

Closing without merging: the dashboard won't accept user-uploaded data, for security reasons. The branch stays for reference.

@macromeer macromeer closed this Oct 6, 2026
@macromeer
macromeer deleted the data-upload branch October 6, 2026 14:11
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.

1 participant