Refine tooltips and map interactions#4
Conversation
…teractive-map Add Streamlit map for Alaska community energy installations
There was a problem hiding this comment.
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".
| 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", |
There was a problem hiding this comment.
[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 👍 / 👎.
No description provided.