JohnCoene / echarts4r

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

Lines and scatter points on a map with timeline don't produce anything #289

Open etiennebacher opened 3 years ago

etiennebacher commented 3 years ago

Hello John, take the example in the docs for instance.

library(echarts4r)
flights <- read.csv(
  paste0("https://raw.githubusercontent.com/plotly/datasets/",
         "master/2011_february_aa_flight_paths.csv")
)

With timeline, lines alone are well displayed:

head(flights) %>% 
  group_by(airport1) %>% 
  e_charts(timeline = T) %>% 
  e_geo(roam = TRUE) %>% 
  e_lines(
    start_lon, 
    start_lat, 
    end_lon, 
    end_lat,
    name = "flights",
    lineStyle = list(normal = list(curveness = 0.3))
  ) 

image

With timeline, points alone are well displayed:

head(flights) %>% 
  group_by(airport1) %>% 
  e_charts(start_lon, timeline = T) %>% 
  e_geo(roam = TRUE) %>% 
  e_scatter(start_lat, coord_system = "geo", symbol_size = 8)

image

However, mixing lines and points with timeline doesn't produce any output, and no error:

head(flights) %>% 
  group_by(airport1) %>% 
  e_charts(start_lon, timeline = T) %>% 
  e_geo(roam = TRUE) %>% 
  e_lines(
    start_lon, 
    start_lat, 
    end_lon, 
    end_lat,
    name = "flights",
    lineStyle = list(normal = list(curveness = 0.3))
  ) %>% 
  e_scatter(start_lat, coord_system = "geo", symbol_size = 8)

This problem must come from the timeline because mixing points and lines without timeline works:

head(flights) %>% 
  e_charts(start_lon) %>% 
  e_geo(roam = TRUE) %>% 
  e_lines(
    start_lon, 
    start_lat, 
    end_lon, 
    end_lat,
    name = "flights",
    lineStyle = list(normal = list(curveness = 0.3))
  ) %>% 
  e_scatter(start_lat, coord_system = "geo", symbol_size = 8)

image

Is there a way to fix this?

(Tested with CRAN version (0.4.0), and with last dev version)

JohnCoene commented 3 years ago

Thank you for the very detailed bug report. I don't have a solution right now, I sincerely apologise but work is leaving very little time for open-source.

etiennebacher commented 3 years ago

No problem, I understand it is not the priority ;)