-
Notifications
You must be signed in to change notification settings - Fork 76
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
File Upload Widget #136
Comments
I am happy to work on this issue if someone could help me out and let me know a bit more about what would be involved and in general how this package works. For example, I know ipywidgets is needed, presumably as I can't see any drawing or js code for the widgets defined in src/widgets.jl, ipywidgets contains js and other code that draws them. |
I made a quick start on this:
Requires you to have followed the install instructions here: https://github.com/peteut/ipython-file-upload If use use P.S. Better to base your changes off that branch rather than master because it is built on top of a fair few new changes that are likely to get merged. |
Wow that looks pretty great, thank you! I will try and read this and understand, but I think a guide on how to create new widgets for Interact.jl would be ideal, if you give me a heads up on the things you needed to define and why I could start to make such a guide as I struggle through this. I guess lots of the behaviour and so on is handled by julia code, but the drawing the widget in the front end is handled by the ipython-file-upload that is required. That's just my guess though: My reasoning being ipywidgets have a python model and then a js model, and if ipython-file-upload has the js model already, then only the julia model needs to be implemented. |
I am just in the middle of writing a guide, the start of which is here, and may not be currently 100% accurate, but it's here: https://github.com/JobJob/Interact.jl/blob/88e3be64f3d83a4e63753cc4d34902de3866721b/doc/dev%20guide.md I'll actually just clean it up in the next half-hour so it's accurate for the state of my latest jbj/widget-sig-init branch (the file-upload branch is ahead of that but no major changes there). A good place to start for how to add new widgets would be to look at the changes I made in the last (only) commit of that file-upload branch. |
Yes, re your specific q, that's basically correct. We aren't writing any widgets js or html, just sending messages that create and update the widget, and receiving some with updates to widget's state as a result of user actions. |
OK sorry, the links were giving me some pain, but finally cleaned it up, it's a bit raw, but hopefully somewhat useful. I merged it with the file-upload branch to make things easier: https://github.com/JuliaLang/Interact.jl/blob/jbj/file-upload/doc/dev%20guide.md |
Latest (unreleased) Interact has a |
Says here it uses the FileReader api to get the contents of the file in base64 in the browser. Then I think it can sync that to the server. Code to read the file is here: https://github.com/peteut/ipython-file-upload/blob/master/fileupload/static/widget.js#L46 python code: https://github.com/peteut/ipython-file-upload/blob/master/fileupload/widget.py |
Thanks for the info, I'll give it a shot in the next few days. |
Hi, sometimes I want a user to be able to upload data to a jupyter session in order to use code on the notebook on their own data files, I've found:
https://pypi.python.org/pypi/fileupload/
But it's python, I wondered if a similar widget could be added to Interact.jl for julia?
The text was updated successfully, but these errors were encountered: