echarts4r icon indicating copy to clipboard operation
echarts4r copied to clipboard

Unintended highlight with e_map timeline

Open psimm opened this issue 4 years ago • 7 comments

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

psimm avatar Feb 10 '21 10:02 psimm

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 avatar Feb 12 '21 19:02 JohnCoene

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.

JohnCoene avatar Feb 18 '21 19:02 JohnCoene

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

jordancampbell23 avatar Feb 19 '21 03:02 jordancampbell23

No problem @jordancampbell23 :)

JohnCoene avatar Feb 19 '21 20:02 JohnCoene

recognized as bug in ECharts v.5+

helgasoft avatar May 26 '21 18:05 helgasoft

@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.

jordancampbell23 avatar Jun 20 '22 23:06 jordancampbell23

Thank you for sharing!

JohnCoene avatar Jun 21 '22 06:06 JohnCoene