Skip to content

chore: Cleanup & reorganization of Examples in Vis Docs#209

Merged
Jarbuckle merged 3 commits intomainfrom
joel/example-pages-cleanup
Oct 16, 2025
Merged

chore: Cleanup & reorganization of Examples in Vis Docs#209
Jarbuckle merged 3 commits intomainfrom
joel/example-pages-cleanup

Conversation

@Jarbuckle
Copy link
Contributor

chore: Cleanup & reorganization of Examples in Vis Docs

What

The example pages, particular those for OME-Zarrs, have had their various source files living in the same folder for a while, and represent 4 different ways of setting up OME-Zarr rendering and displaying. Consequently, it was sometimes confusing figuring out which files were related to which.

This PR aims to disentangle them from each other, as well as factor out some common features and clean them up a bit.

How

  • Created four new subfolders of examples/omezarr: minimal-example, selectable-image-demo, priority-cache-demo, and gallery-demo -- each populated only with the files relevant to that specific demo.
  • Moved the fetch.worker.ts to a common subfolder
  • Factored out all OME-Zarr fileset "demo options" into a single file that all demo files reference.
  • Renamed and reordered the mdx files so that the Examples menu flowed a little more logically from top to bottom

PR Checklist

  • Is your PR title following our conventional commit naming recommendations?
  • Have you filled in the PR Description Template?
  • Is your branch up to date with the latest in main?
  • Do the CI checks pass successfully?
  • Have you smoke tested the example applications?
  • Did you check that the changes meet accessibility standards?
  • Have you tested the application on these browsers?
    • Chrome (Fully supported)
    • Firefox (Major bug fixes supported)
    • Safari (Major bug fixes supported)

@Jarbuckle Jarbuckle requested a review from a team as a code owner October 16, 2025 19:58
@Jarbuckle Jarbuckle requested review from froyo-np and suyli7 October 16, 2025 19:58
<OmeZarrView res={OMEZARR_DEMO_FILESETS[3].res} screenSize={screenSize} />
</SharedCacheProvider>
);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not actually a "new" file, just changed so much and moved that Git apparently couldn't sort it out. 🤷🏽

Comment on lines -291 to -314
/**
* HEY!!!
* this is an example React Component for rendering A single slice of an OMEZARR image in a react component
* This example is as bare-bones as possible! It is NOT the recommended way to do anything, its just trying to show
* one way of:
* 1. using our rendering utilities for OmeZarr data, specifically in a react component. Your needs for state-management,
* slicing logic, etc might all be different!
*
*/
function DataPlease() {
// load our canned data for now:
const [omezarr, setfile] = useState<OmeZarrMetadata | undefined>(undefined);
useEffect(() => {
loadMetadata(demoOptions[0].res).then((dataset) => {
setfile(dataset);
logger.info('loaded!');
});
}, []);
return (
<RenderServerProvider>
<SliceView omezarr={omezarr} />
</RenderServerProvider>
);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This got moved into its own example folder: minimal-example

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It thought this was the renamed version of omezarr-via-priority-cache, but it's actually a whole new file that contains the factored-out "demo options" from all of the different demos.

Copy link
Collaborator

@froyo-np froyo-np left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, thanks for doing this!

@Jarbuckle Jarbuckle merged commit 09bb73a into main Oct 16, 2025
5 checks passed
@Jarbuckle Jarbuckle deleted the joel/example-pages-cleanup branch October 16, 2025 21:02
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.

2 participants