Skip to content
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

Python HTML output misbehaving (totally missing?) for folium #3069

Closed
juliasilge opened this issue May 8, 2024 · 1 comment
Closed

Python HTML output misbehaving (totally missing?) for folium #3069

juliasilge opened this issue May 8, 2024 · 1 comment
Assignees
Labels
bug Something isn't working lang: python

Comments

@juliasilge
Copy link
Contributor

juliasilge commented May 8, 2024

Positron Version:

2024.05.0 (Universal) build 1160

Steps to reproduce the issue:

  1. Run code like this in the console:
import folium
m = folium.Map(location=(40.778, -111.931))
  1. Try various ways to get this thing to show up somewhere. You can do m.show_in_browser() to get it in an external browser window, but how are we meant to have this in either the Viewer or Plots pane? I tried m.render() but saw nothing.

  2. Try to print out m in the console, which hangs the whole console and I have to quit Positron to get things functional again. There is this log in the Console output:

Positron] RECV execute_result from iopub: {"header":{"msg_id":"de33f4cd-c59fef94c09fe7a3aa335624_46067_83","msg_type":"execute_result","username":"juliasilge","session":"de33f4cd-c59fef94c09fe7a3aa335624","date":"2024-05-08T19:09:57.632053Z","version":"5.3"},"parent_header":{"msg_id":"fragment-b4826044-97f0-4b69-92ae-bb5d416eef89","msg_type":"execute_request","version":"5.0","date":"2024-05-08T19:09:57.629000Z","session":"98e8f64d9f47af1448d3ae4320452b5a","username":"juliasilge"},"metadata":{},"content":{"data":{"text/plain":"<folium.folium.Map at 0x12816b460>","text/html":"<div style="width:100%;"><div style="position:relative;width:100%;height:0;padding-bottom:60%;"><span style="color:#565656">Make this Notebook Trusted to load map: File -> Trust Notebook<iframe srcdoc="<!DOCTYPE html>\n<html>\n<head>\n \n <meta http-equiv="content-type" content="text/html; charset=UTF-8" />\n \n <script>\n L_NO_TOUCH = false;\n L_DISABLE_3D = false;\n </script>\n \n <style>html, body {width: 100%;height: 100%;margin: 0;padding: 0;}</style>\n <style>#map {position:absolute;top:0;bottom:0;right:0;left:0;}</style>\n <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/leaflet.js&quot;&gt;&lt;/script&gt;\n <script src="https://code.jquery.com/jquery-3.7.1.min.js&quot;&gt;&lt;/script&gt;\n <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js&quot;&gt;&lt;/script&gt;\n <script src="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js&quot;&gt;&lt;/script&gt;\n <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/leaflet.css&quot;/&gt;\n <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css&quot;/&gt;\n <link rel="stylesheet" href="https... (truncated)

Note "Make this Notebook Trusted to load map"; I am in the console and not a notebook.

This came up specifically for @andrie in the context of Quarto but is a more general problem, I believe. Related to #1719 in that it is about Python HTML content.

What did you expect to happen?

I expected to be able to see this HTML content either in Plots (like plotly) or in the Viewer (like Shiny).

Were there any error messages in the output or Developer Tools console?

I didn't see other interesting logs other than the one about "Make this Notebook Trusted to load map".

@juliasilge juliasilge added bug Something isn't working lang: python labels May 8, 2024
@jmcphers jmcphers self-assigned this May 9, 2024
@juliasilge
Copy link
Contributor Author

In Positron 2024.05.0 (Universal) build 1176, this is now fixed:

Image

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working lang: python
Projects
None yet
Development

No branches or pull requests

2 participants