-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
react json schema #415
react json schema #415
Conversation
It will be of course super cool, if it works. I have been trying different UI libraries for this type of forms, including react-jsonschema-form. It will nicely with standard UI elements, but once you try more complex ones, it becomes limited easily. For example, the idea is to load a schema, e.g. from the spec repo and render the form directly. But then if we want to load the list of tags and options for the links, you will end up modifying the json schema you fetched from the spec repo to add the options -- which can make the website break if the json schema get updated and defeat the purpose of hosting the UI schema in the spec repo. We will then be in a wired situation that the UI code are depend both the bioimage.io repo and the spec repo, which is worse than having it in a single repo. Currently, a similar schema form UI library is used for the website: https://github.com/14nrv/vue-form-json . The same as react-jsonschema-form, you can also generate a json UI schema for vue-form-json. However, it doesn't solve the issue I mentioned above. There is another practical issue too, the react-jsonschema-form is reactjs-based, which is a different web framework than then one we use (which is vuejs), we cannot easily blend the two framework together. Nevertheless, we might be able to rewrite the uploader entirely in a separate ImJoy plugin using React and interface it with bioimage.io. This will be cool because it means we can easily call the uploader from, e.g. python in a jupyter notebook. The only issue is time, it will be a huge effort to rewrite it, since it's not only the form, we also need to do authentication with Zenodo, upload files, publish it, etc. |
This is true, but in practice we already access resources from bioimage.io and collection-bioimage-io in the spec spec-bioimage-io/bioimageio/spec/shared/common.py Lines 40 to 41 in 409d936
We do this for optional validation (if we cannot fetch the resource we skip it) of bioimageio ids and optional warnings about the tag categories.
so we actually don't have to modify it, because the ui schema will already have this information. (we just have to keep it up to date... so we probably should move its generation to the collection repo to always be up to date with the bioimageio ids)
This is a nice goal! We sort of need to spin up an imjoy plugin for the validator anyway. Maybe we can get there in two steps:
|
for completeness: draft for latest model (even less complete): What gets me excited about this approach in particular:
|
# Conflicts: # bioimageio/spec/rdf/v0_2/schema.py
closing in favor of #521 |
I explored the idea of using the json schema in the uploader for bioimage.io to generate the form directly from the spec.
So far this is an incomplete, but functional implementation to generate an improved react json schema (+ui schema).
cc @oeway