MultiView — Methodological guide
1. General purpose#
MultiView gathers figures already saved by BarCodeR scientific modules. It searches, filters, tags and favorites them, opens several PNGs in a movable GridStack layout, exports a composite PNG and saves layout recipes. It performs no scientific recomputation and does not restore Plotly interactivity, change analysis parameters, synchronize axes or edit figure colors.
2. Figure sources#
The current project is scanned recursively under save/projects/<project>/; MultiView's own folder is excluded. Any folder containing PNG files can become a type. Only the 100 most recently modified PNGs per folder are loaded, with no pagination; date filtering cannot recover files excluded by this cap.
3. PNG/RDS pairing#
A PNG is paired only with an RDS sharing the exact basename. PNG+RDS provides dataset, description, parameters and badges. PNG alone remains visible with limited metadata; RDS alone is invisible. The reader looks for datasets, transformation, distance, taxonomic rank, group, permutations and seed, but non-standard snapshots may remain incomplete.
4. Loading and refresh#
Scanning starts only when MultiView is opened. Refresh rescans manually; auto-refresh does so every 10 seconds while active and may be expensive on network storage or large RDS files. Displayed dates come from PNG modification time, not necessarily analysis time.
5. Search, filters and sorting#
Filter by type, exact dataset label, date range, favorites and tags. Multiple tags use OR. Literal case-insensitive search covers key, dataset, description and serialized parameters. Multi-dataset runs may appear as one combined label. KPI counts can include orphan favorites.
6. Gallery and table#
Gallery cards show preview, type, filename, date, dataset, badges, tags and favorite. “Comparable” means only same type and same dataset label; it does not validate transformation, distance, filtering, rank, groups, axes or method. Table selection is not connected to the open/replace actions, so use Gallery for multi-selection.
7. Selecting figures#
Checkbox/Space selects, click/Enter opens details, double-click or drag-and-drop adds to grid, star toggles favorite and Escape closes details. Select All affects visible cards only, but hidden selections can persist after filtering. Clear the selection before a new comparison. Very large selections can overload the browser.
8. Details panel#
Shows enlarged image, type, date, dataset, key, main/technical parameters, tags, favorite, PNG download and grid opening. It cannot download the scientific RDS, reopen the source module, regenerate R code, relaunch the analysis or compare parameter sets automatically.
9. Favorites and tags#
Stored immediately in save/projects/<project>/multiview/tags.rds; the older save/multiview/tags.rds message is obsolete. Tags accept commas or semicolons. Deleted figures leave orphan entries. State is shared by every session of the same project and is not user-specific; concurrent writes may overwrite each other.
10. Open-analysis grid#
Figures can be added from selection, double-click, drag-and-drop or details; duplicates are prevented. The 12-column default uses two cards per row (width 6, height 6). object-fit: contain preserves the full image but may add blank space. Resizing cannot create detail beyond source PNG resolution. Edit mode controls movement/resizing; closing a card does not delete files.
11. Pinning, replacing and closing#
Pinned cards survive Replace in grid and Close all, but remain movable, resizable and individually closable. Replace keeps pins, removes other cards and adds the current selection.
12. Layout presets#
Presets are 1×2, 2×2, 1×3, 3×1 and Hero+2. Extra figures beyond preset slots reuse the last position and may overlap. Move them manually, choose another preset or reduce the set. Reset restores the default layout without closing cards.
13. Composite PNG export#
html-to-image captures the complete grid DOM with white background and pixel ratio 2. Titles, metadata and UI buttons may be included; it is not a clean merge of scientific PNGs only. Output is browser-side raster PNG, not added to history and contains no structured data. No PDF/SVG/TIFF/PowerPoint/interactive HTML export exists. Large grids, huge images, missing CDN or empty grids may fail or produce poor output.
14. Saving a composition#
A composition RDS under multiview/compositions/ stores name, description, date, figure keys, layout, dimensions, pins and filter values. It does not copy PNGs, scientific RDS, phyloseq objects, tables, tags or favorites. Loading restores only still-existing figures, layout and pins; saved filters are not reapplied. Missing/renamed/moved figures are silently omitted. Deleting a composition does not delete figures.
15. Import/export of compositions#
Export downloads the recipe RDS. Import checks mainly for a list containing tabs, copies it into the current project and does not load it automatically. A recipe is not portable by itself: the target project needs identical internal type+filename keys. Share the composite PNG or original PNG/RDS files when portability matters. External PNG import is not provided.
16. Comparing figures correctly#
Check dataset, samples, filtering, transformation, normalization, rank, method, distance, groups, axes, limits, units, colors, categories, display thresholds and data version. Different Top N/Other rules can alter barplots; independent ordinations may be rotated/inverted and should use Procrustes for quantitative comparison; volcano plots may use different references and effect units. MultiView organizes and presents evidence but does not perform statistical comparison.
17. Projects, sessions and multi-user use#
Library, tags, favorites and compositions follow the current project. The live grid is session-only unless saved. Some UI settings restore, but dataset/tag/date filters, selection and unsaved layout do not. Static Shiny resource prefixes are process-wide; concurrent projects in one R process may briefly point to the wrong resource. State is not isolated per user, so MultiView is not fully safe for concurrent multi-user deployment.
18. External dependencies and offline use#
GridStack, SortableJS and html-to-image load from jsDelivr. Offline, browsing may partly work while movement, resizing, drag-and-drop, presets or composite export fail. GridStack initialization waits roughly six seconds before giving up. Full offline operation requires bundling these libraries under www/.
19. Troubleshooting#
| Symptom | Cause | Action |
|---|---|---|
| No figures | No saved PNG in current project | Save a scientific figure |
| New figure missing | Library not rescanned | Refresh |
| Old figure missing | 100-file cap | Inspect/archive the folder |
| Missing parameters | RDS absent/mismatched | Fix PNG/RDS basename |
| Table selection ignored | Not wired to selection state | Select in Gallery |
| Hidden cards remain selected | Filters changed | Clear selection |
| Grid/drag/export unavailable | CDN unavailable | Check network or use buttons |
| Overlapping cards | More figures than preset slots | Rearrange manually |
| Incomplete composition | Source figures missing | Restore history files |
| Filters not restored | Current loader behavior | Reconfigure manually |
20. Checklists#
Before composing: verify project, refresh, confirm PNG/RDS pairs, inspect parameters, clear old selection and limit card count. Before scientific comparison: harmonize data, filters, methods, ranks, axes, units, colors and thresholds. Before export: remove unnecessary cards, check overlap/resolution and inspect the downloaded file. Before saving: verify layout/pins, name and describe it, remember images are not copied, test reload and also export a portable PNG.
21. Main limitations#
PNG-only library, lost interactivity, no recomputation or axis harmonization, 100-file cap, mtime dates, metadata dependent on RDS, table-selection bug, weak comparable badge, orphan/shared tags, overlapping presets, raster export with controls, non-self-contained recipes, filters not restored, limited portability, CDN dependence, concurrent-user fragility and loss of unsaved grid state.
22. Recommended workflow#
Save source figures; open and refresh MultiView; filter and inspect parameters; tag/favorite; select in Gallery; open grid; verify comparability; apply and adjust a preset; pin key panels; export and inspect PNG; save and reload the composition; retain original histories and use statistical tables for conclusions.
23. Verified internal sources#
app.R; modules/multiview/mod_multiview_ui.R; modules/multiview/mod_multiview_server.R; modules/multiview/_shared/mod_multiview_helpers.R; modules/_shared/_project_store.R; .claude/architecture/16-multiview.md.