JohnCoene / echarts4r

🐳 ECharts 5 for R
http://echarts4r.john-coene.com/
Other
599 stars 81 forks source link

Unintended highlight with e_map timeline #272

Open psimm opened 3 years ago

psimm commented 3 years ago

When a chart has a choropleth map and a timeline, clicking on the timeline dots highlights countries. This is a new behavior that does not occur on the last CRAN release.

Example:

library(dplyr)
library(echarts4r)

choropleth <- data.frame(
  countries = rep(c("United States", "Russia", "Brazil"), 2),
  date = rep(c(as.Date("2021-01-01"), as.Date("2021-01-02")), each = 3),
  values = runif(6)
)

choropleth %>%
  group_by(date) %>%
  e_charts(countries, timeline = TRUE) %>%
  e_map(values) %>%
  e_visual_map(min = 0, max = 1)

On initial load:

Screen Shot 2021-02-10 at 11 53 40

After clicking the second timeline dot (and not clicking on Russia):

Screen Shot 2021-02-10 at 11 50 08

Clicking on the arrows does not trigger the highlight. It seems that the timeline dot has an unintentional connection to the other plot data.

This behavior can also be seen on the website: https://echarts4r.john-coene.com/articles/timeline.html#general-options

JohnCoene commented 3 years ago

Interesting. That seems to be from echarts.js itself as far as I can tell but I will have to dig in a little more.

JohnCoene commented 3 years ago

Funny, I received an email notification from Github about a comment from @jordancampbell23 on e_timeline_opts( axis_type = "time") fixing the issue but I don't see the comment on here.

jordancampbell23 commented 3 years ago

Yes, my bad. I got rid of a similar issue on another timeline--but it didn't resolve this issue.

JohnCoene commented 3 years ago

No problem @jordancampbell23 :)

helgasoft commented 3 years ago

recognized as bug in ECharts v.5+

jordancampbell23 commented 2 years ago

@JohnCoene one way around the distraction of this bug is to disable select in e_map by adding the following:

select = list(disabled = T)

I don't find the select feature adds much to the maps, so personally it has minimal downside.

JohnCoene commented 2 years ago

Thank you for sharing!