-
Notifications
You must be signed in to change notification settings - Fork 59
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
imageRequest
still invalid prop
#375
Comments
At the risk of asking the obvious, what version of |
Yes, @yang-ruoxi made the 0.4.38 release (which I'm using) right after the new |
@janosh One still needs to add the prop in the corresponding component in dash-mp-component by hand, which was overlooked in the latest release. |
Ah, I wasn't aware. Is that easy for you to do? If not, I'll take a look later. |
it's as simple as adding a prop in the corresponding component but it may take a bit before I can get to it. Please feel free to do it if it's time sensitive! |
Ah, yes, non-obvious! Thanks @yang-ruoxi for explaining. For additional context: I'm not sure if tooling has improved since this was set-up, but essentially the Dash component is a wrapper around the originating React component, and these are more or less equivalent except that the Dash component cannot have any non-JSON-serializable props (e.g., cannot have a JavaScript event prop). This has meant that the Dash component wrapper has to be written manually to make sure all props are supported types. Presumably this is something that could be automated, so maybe there's an easier way to do it now. For even more context, both repos (mp-react-components and dash-mp-components) used to be within the Crystal Toolkit repo, but were split off just to make it a bit more obvious what each part does, and to make setting up the releases in CI a little easier. I'm still not sure if this was the right call, in some ways having them all in the same repo was simpler. |
I think long-term it would be best to swap out the React layer entirely for something more modern like Svelte (and yes, have everything in 1 repo). |
If this option had been available when Crystal Toolkit was first made, I'd have considered just using this instead: I'm sure it has some drawbacks (it looks like it can't use JSX, and I'm not sure how caching would work), but it would have made development much more rapid. We could still explore this for developing future components.
Does Svelte play nicely with Dash? The main benefit of Dash was calling underlying Python libraries directly (e.g., pymatgen functionality) without having to reimplement in JavaScript (painful, bug prone) or without having to write custom APIs for every pymatgen function etc. (tedious and verbose). Again, however, if options like PyScript or Pyodide were available or more mature when Crystal Toolkit was written, perhaps we would have forgone Dash completely. With that said, I still really like Dash from the point of view of empowering researchers who are not web developers to rapidly create their own apps, so I'd like to see it stick around. |
@mkhorton I just installed the latest version
crystal-toolkit==2023.10.24
, hoping materialsproject/mp-react-components#699 will have fixed thewrite_structure_screenshot_to_file.py
script.crystaltoolkit/crystal_toolkit/apps/examples/write_structure_screenshot_to_file.py
Lines 10 to 18 in cf2c1a9
I just adapted it to run with the new
CrystalToolkitPlugin
but I still get the sameimageRequest
invalid prop erroris this not using the latest
dash-mp-components
?Programmatic structure screenshot script
The text was updated successfully, but these errors were encountered: