-
Notifications
You must be signed in to change notification settings - Fork 469
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
st.graphviz_chart examples not rendering #90
Comments
Hmm it works for me locally
And on my Windows VM
|
It is working fine also for me:
|
@andfanilo Can you run the following in your terminal and share the output? It should return If not, can you try the instructions here? But create the mime type for javascript not for pdf |
Works like a charm, thanks @jrhone ! Guess one of my IDEs wanted to have fun with file extensions... |
Well, seems like Firefox added some new security features and your OS didn't have Mime Types configured correctly. I wonder if we should add this to the documentation somewhere or automate this check if possible and provide a warning to the user. Going to re-open for now so we can address the scenario fully. Thanks for confirming the fix! |
This may explain things, so for other readers I was on Firefox 75 here and |
Going to close this, since it hasn't come up again since I've been at the company. Obviously, if people start mentioning this again, we can add a note to the docs |
Graphviz not showing in Chrome (Version 80.0.3987.132 (Official Build) (64-bit) ). Code built from Visual Studio Code on Windows 10 machine. Code used was from https://docs.streamlit.io/en/stable/api.html#streamlit.graphviz_chart Registry changes Re-tested with no effect. Opened a new command prompt and re-ran python -c "import mimetypes; print (mimetypes.guess_type('lunr.js'))" which returned "text/plain" .js node was present in "HKEY_CURRENT_USER" at Checked Computer\HKEY_CURRENT_USER\SOFTWARE\Classes.js Re-set the registry back to the initial position addendum... Please note in the change in the registry to set .js files to "application/javascript" will allow .js files to run on a machine on a double-click and this has security issues (which is why the mime type for .js files is to "plain text" on my machine). My home laptop has no mimetype set for .js and the graph displays as expected in Chrome (unsure if its version however). If that helps. Update |
This failed for me with the above symptoms as well. Windows 10 PC The HKEY_LOCAL_MACHINE/Software/Classes/.js key was correct, but a HKEY_CURRENT_USER/Software/Classes/.js key was "text/plain". I changed this in the registry. Now the python script reports "('application/javascript', None)". Chrome and Firefox display the chart. But this still fails in the same way in Microsoft Edge (which is what I use by default). Javascript console errors in Edge are: 4fc2c1f8-4a0c-487a-8f3f-1c1cc2f7ae8c:4 Refused to execute script from 'http://localhost:8501/vendor/viz/viz-1.8.0.min.js' because its MIME type ('text/plain') is not executable. |
Closing this issue as one already exists in the Streamlit library repo: streamlit/streamlit#3887 |
Summary
Was working on providing a small example of using graphviz to render Decision Tree in streamlit/streamlit#1330 but code did not work. Then tried the 2 examples from API reference and none worked on my machine. Then tried this one. All got the same errors about viz not being defined 🤔 is it only me ?
Steps to reproduce
Expected behavior:
Displays graph
Actual behavior:
Frontend logs for me
Is this a regression?
Probably
Debug info
The text was updated successfully, but these errors were encountered: