plotly / plotly/plotly.R

Color markers upon hover linked leaflet map highlight()

Open
#1,902 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
2.7k
Forks
641
PR merge metrics
No merged PRs in 30d

Description

I am wondering if there is a way to make the highlighted (from hover) dot change color, on both the linked leaflet map as well as the scatter plot? In other words, can the blue dot turn to a red dot, on both map and chart, upon hover?

Thanks!

library(leaflet)

eqs <- highlight_key(quakes)


p <- plot_ly(eqs, x = ~depth, y = ~mag) %>% 
  add_markers(alpha = 0.5) %>% 
  highlight("plotly_hover", opacityDim = .1)

map <- leaflet(eqs) %>% 
  addTiles() %>% 
  addCircles(opacity = 1)

bscols(
  widths = c(6, 6), 
  p, map
)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the provided R example using highlight(), add_markers(), leaflet(), addCircles(), and bscols(). Read the existing linked plotly and leaflet highlight behavior, then define whether hover state can synchronize marker colors in both views; done means the hovered point changes color on the scatter plot and map.

Written by the indexing model from the issue text.

Assessment

Tech stack
plotly, r
Domain
data-visualization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.