Skip to content

Refine tooltips and map interactions#4

Open
Henry-Toal wants to merge 5 commits into
codex/create-streamlit-app-for-interactive-mapfrom
codex/create-streamlit-app-for-interactive-map-ppvg21
Open

Refine tooltips and map interactions#4
Henry-Toal wants to merge 5 commits into
codex/create-streamlit-app-for-interactive-mapfrom
codex/create-streamlit-app-for-interactive-map-ppvg21

Conversation

@Henry-Toal

Copy link
Copy Markdown
Collaborator

No description provided.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex Review: Here are some suggestions.

Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

Comment thread streamlit_app.py
Comment on lines +245 to +259
def render_map(deck: pdk.Deck, tooltip_css: Dict[str, str], height: int = 640) -> None:
"""Render a deck.gl map with hover tooltips and toggleable pinned tooltips."""

deck_config = json.loads(deck.to_json())
tooltip_style = {
"backgroundColor": "rgba(245, 248, 252, 0.95)",
"color": "#1f2933",
"fontFamily": "Roboto, Arial, sans-serif",
"fontSize": "12px",
"border": "1px solid #d5d7dc",
"borderRadius": "10px",
"padding": "10px",
"boxShadow": "0 10px 26px rgba(15, 23, 42, 0.18)",
"pointerEvents": "auto",
"maxWidth": "640px",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Avoid enabling pointer events on hover tooltips

The tooltip style passed to deck.gl sets pointerEvents: "auto", which applies to every hover tooltip returned by getTooltip. Because the hover tooltip element now intercepts the mouse cursor, the underlying deck canvas no longer receives mousemove or click events while a tooltip is visible, making it difficult or impossible to pan the map or hover/select nearby communities whenever the cursor overlaps the tooltip. Persistent (pinned) tooltips already set their own pointer handling, so the shared style should leave pointer-events at none to preserve normal map interaction.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant