Repeating attributes when specifying global data
hafen opened this issue · 0 comments
hafen commented
When specifying a global data source (e.g. figure(..., data = x)
) and then adding a singleton layer that does not use that data source, the attributes are repeated as if the global data source was expected to be the source for the singleton layer. A good example of this ly_text()
.
The first example below is correct. The second example draws the text nrow(cars) = 50
times. The culprit is here: https://github.com/hafen/rbokeh/blob/master/R/layer__utils.R#L353. @schloerke, would you mind taking a quick look to see if you have a quick idea of how to resolve this?
figure() %>%
ly_points(speed, dist, data = cars) %>%
ly_text(10, 10, "hi")
figure(data = cars) %>%
ly_points(speed, dist) %>%
ly_text(10, 10, text = "hi")