-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 Open Dialog #6096
Comments
Just FYI. This might be a reasonable addition, but I can't speculate about when it might make it into the core library. In the mean time your option is to create custom extension: http://bokeh.pydata.org/en/latest/docs/user_guide/extensions.html |
For anyone searching for help: in the meantime before this is added to bokeh, here's how I implemented sending a file from the user's computer to a Bokeh server:
It's a bit complicated, but the upcoming |
Hello @kevinsa5 , could you provide code samples. Thank you import pandas as pd source = ColumnDataSource(dict()) print(source.data.keys) def callback1(attr,old,new): button = Button(label="Upload", button_type="success")
source.on_change('data',callback1) curdoc().add_root(row(button)) |
Hi @divyamounika, here is an example script that you can work from. Try uploading a simple excel file to see if it works for you. I also added the filename, as you can see. This code is largely untested -- you may want to add filesize limits, only allow certain file types, etc.
|
Hello @kevinsa5 , Thank you for the code. I was able to upload .csv files data with a minor modification on my system. modification --> |
There is some content here that may be useful to this issue: https://stackoverflow.com/questions/40794180/upload-a-csv-file-and-read-it-in-bokeh-web-app |
@kevinsa5 and @divyamounika - could you throw some light on what ‘file_io’ contents would be? Because this works for csv file but for .xlsx throws TypeError. Could you guide me here? |
@joel-wilson |
For those you would infuture reference this thread : Here is a solution to have a upload button to handle
|
I am creating a pie chart but the problem is that I want to load a tsv file from the file open dialog box when the link is clicked.how it can be possible to get the data file from dialog box and as the user opens it a pie chart is displayed. |
Help please! |
@joaochenriques that snippet of code does not store the file -- it only brings the file contents into memory. If you want to store the file somewhere on disk, you can try something like
|
Thank you @kevinsa5. I am a new user of Bokeh, and I forgot that it is a client/server architecture! |
Noting the SO example to create a custom extension it far out of date: https://stackoverflow.com/a/42613897/3406693 Should either add a file dialog directly or create an updated example (and update that SO answer accordingly either way) |
It's not my birthday but I wouldn't turn down this present |
@philippjfr I am going to see about doing this now, so it can be in the next release. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hello,
I would like to have a "File Open Dialog" to interactively specify local data files.
This was previously discussed in the Bokeh Google Groups.
Best regards
The text was updated successfully, but these errors were encountered: