Replies: 8 comments 4 replies
-
Hi @udras. Great to hear about your in Zarr, and I look forward to hearing more about your use case. If I understand correctly, what you are referring to is already possible. All of the files you see on https://idr.github.io/ome-ngff-samples, for example, are being accessed via HTTP directly by from the browser. that looks like this: where each of the individual chunks is a URL of the form: |
Beta Was this translation helpful? Give feedback.
-
@joshmoore those examples require accessing data via http, but I think @udras wants to use the browser to access user's local data, i.e. no http required. I think it's a great idea! |
Beta Was this translation helpful? Give feedback.
-
Sounds great! So, you're proposing to add a new type of File System store to zarrita.js? |
Beta Was this translation helpful? Give feedback.
-
Thanks for pinging me @joshmoore. Yes, I've been considering implementing a web version of the One of the main design considerations in the zarrita rewrite was to make it very simple to write custom stores. You just need to implement Here is an example of a
|
Beta Was this translation helpful? Give feedback.
-
We have discussed using this functionality for Vitessce as well so would be interested! vitessce/vitessce#1278 (comment) |
Beta Was this translation helpful? Give feedback.
-
Thank you for the feedback, everyone! I will discuss this with our group leader - it certainly seems to be a worthwhile endeavor. |
Beta Was this translation helpful? Give feedback.
-
This issue should be considered "resolved" as it is achievable in user-land with https://github.com/manzt/zarrita.js and https://github.com/placemark/flat-drop-files and about 10 lines of code. class MyWebFileSystemStore {
constructor(files) {
this.files = files;
}
async get(key) {
// The list of files does not prefix its paths with slashes.
const file = this.files.find(f => `/${f.path}` === key);
if (!file) return undefined;
return file.arrayBuffer();
}
} The tricky part is hooking it up to your application or UI, but this will differ based on your use case and thus I don't think it makes much sense for this logic to be part of zarrita.js, as @manzt discusses above.
import { getFilesFromDataTransferItems } from "@placemarkio/flat-drop-files"
const onDrop = async (e) => {
e.preventDefault();
const files = await getFilesFromDataTransferItems(e.dataTransfer.items);
const store = new MyWebFileSystemStore(files);
} Similarly, the choice to use a dependency such as |
Beta Was this translation helpful? Give feedback.
-
Thanks for responding. I've been trying to implement this all day and really struggling to understand the logic of the stores. I can't use I decided to just use an input but with directories using webkitdirectory which seems intuitive. Basically the user selects and uploads a folder <input type="file"
// @ts-expect-error `webkitdirectory` is non-standard attribute. TS doesn't know about it. It's used for cross-browser compatibility.
directory=''
webkitdirectory='true'
onChange={handleChange}
> I then use the class MyWebFileSystemStore {
private files: FileList
constructor(files: FileList) {
this.files = files;
}
async get(key: string) {
// The list of files does not prefix its paths with slashes.
const file = Array.from(this.files).find(f => `/${(f as any).path}` === key);
if (!file) return undefined;
return file.arrayBuffer();
}
} I then set that to my store const newStore = new MyWebFileSystemStore(files)
let store = zarr.root(newStore); That gives me this. Which I'm unsure if it's what I want to be seeing or not. ![]() Every other way I try to manipulate and work with the store variable I can't figure out how to get zarrita to recognize it. Would you be able to help me and potential future mes? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I recently joined a research group at a Swiss hospital that maintains and continuously develops a data warehouse. Recently, we have been exploring the use of zarr-python for efficiently accessing time-series data on a server backend and displaying it on a client's web browser. Our experience with Zarr has been very positive and we are cofident we will eventually use this in production.
As we further test the viability of using Zarr for our purposes, we have come across a use case that we believe would greatly benefit from a specific feature. We are interested in a scenario where Zarr data stored on the local disk of a client can be accessed and displayed in the browser without the need to communicate with the server. In other words, we are looking for a purely clientside solution. It is my understanding that this would require a special kind of store - similar to the Zarrita File System Store, but that gains access to the file system using the File System Access API [1] [2].
I would like to gauge the general interest of the community in such a feature. We believe that it would unlock a powerful and much requested capability for our users. We would greatly appreciate any insights or feedback you may have, and will influence our management's decision to continue developing the feature internally or open-source.
Beta Was this translation helpful? Give feedback.
All reactions