I am trying to create a MotionChart with the googleVis package. When I click on the bubble (so that the trail is drawn when it moves) it runs for a few cycles but then becomes slower and slower and finally grinds to a halt. Sometimes even the plugin crashes.
Here is the code:
library(googleVis)
time <- c("1970-12-31","1971-12-31","1972-12-31","1973-12-31","1974-12-31","1975-12-31","1976-12-31","1977-12-31","1978-12-31","1979-12-31","1980-12-31","1981-12-31","1982-12-31","1983-12-31","1984-12-31","1985-12-31","1986-12-31","1987-12-31","1988-12-31","1989-12-31","1990-12-31","1991-12-31","1992-12-31","1993-12-31","1994-12-31","1995-12-31","1996-12-31","1997-12-31","1998-12-31","1999-12-31","2000-12-31","2001-12-31","2002-12-31","2003-12-31","2004-12-31","2005-12-31","2006-12-31","2007-12-31","2008-12-31","2009-12-31","2010-12-31","2011-12-31","2012-12-31","2013-12-31","2014-12-31","2015-12-31")
gspc <- c(92.15,102.09,118.05,97.55,68.56,90.19,107.46,95.10,96.11,107.94,135.76,122.55,140.64,164.93,167.24,211.28,242.17,247.08,277.72,353.40,330.22,417.09,435.71,466.45,459.27,615.93,740.74,970.43,1229.23,1469.25,1320.28,1148.08,879.82,1111.92,1211.92,1248.29,1418.30,1468.36,903.25,1115.10,1257.64,1257.60,1426.19,1848.36,2058.90,2086.59)
gold <- c(36.20,42.00,65.50,103.00,151.80,143.50,116.00,155.50,226.00,512.00,589.75,397.50,456.90,382.40,308.30,326.80,388.75,484.10,410.25,398.60,386.20,353.15,332.90,391.75,383.25,387.00,369.25,290.20,287.80,290.25,274.45,276.50,347.20,416.25,435.60,513.00,632.00,833.80,869.75,1087.50,1405.50,1531.00,1657.50,1204.50,1206.00,1070.50)
data <- data.frame(name="index",time=as.Date(time),GSPC=gspc,GOLD=gold)
Motion <- gvisMotionChart(data, idvar="name", timevar="time")
plot(Motion)
My question
What is wrong here?
I would think that this is an issue of the Google Chart Tools API, rather than the R interface googleVis. Have you checked the Google Chart Tools issue list: https://github.com/google/google-visualization-issues/issues?