plotly / plotly/plotly.py

[BUG]: Points don't appear on scatter map when viewed on a mobile device as a standalone HTML file

Offen
#5,474 2 Kommentare 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

@emilykl arbeitet bereits daran.

Seit 28.1.2026.

bug
Vorherrschende Sprache
Python
Sterne
18.8k
Forks
2.8k
Ø Merge
16 Std. 26 Min.
Gemergte PRs (30 T.)
21

Beschreibung

Description

I would like to be able to view a standalone .html copy of a Plotly scatter map on my phone. However, when I attempt to do so, I don't see any of the scatter points on the map (though the legend and layers load OK). Fortunately, the map loads fine when I first upload it to GitHub pages and view it from there; however, for debugging and sharing purposes, it would be very helpful to be able to view the points directly from a standalone HTML file.

Screenshots/Video

The HTML copy of the map (created as 'index.html' by the code shown below) loads fine on my laptop:

Image

However, when viewed on a mobile device, none of the points are visible:

Image
Steps to reproduce

The 'index.html' file shown in the previous two screenshots was created by the following code:

# (Almost all of this code comes from the first scatter map example
# found at https://plotly.com/python/tile-map-layers/ .)

import pandas as pd
us_cities = pd.read_csv("https://raw.githubusercontent.com/plotly/datasets/master/us-cities-top-1k.csv")

import plotly.express as px

fig = px.scatter_map(us_cities, lat="lat", lon="lon", hover_name="City", hover_data=["State", "Population"],
                        color_discrete_sequence=["fuchsia"], zoom=3, height=300)
fig.update_layout(map_style="open-street-map")
fig.update_layout(margin={"r":0,"t":0,"l":0,"b":0})
fig.write_html('index.html', include_plotlyjs='cdn')

I then copied the 'index.html' file created by this code onto my phone, then loaded it within my mobile Chrome app.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.