figure(webgl = TRUE) %>%
ly_points(x, y, data = dat)
figure() %>%
ly_hexbin(x, y, data = dat)
range_callback <- custom_callback("
var rdiff = range.get('end') - range.get('start')
var zoomed_in = hexbin_glyph.get('_zoomed_in')
if(rdiff < 1.5) {
hexbin_glyph.get('_zoomed_in', true)
points_glyph.set('visible', true)
points_hov_glyph.set('visible', true)
grid_plot(lapply(split(dat, dat$f1), function(d) {
figure(width = 300, height = 350) %>%
ly_hexbin(x, y, data = d, xbnds = bounds, ybnds = bounds)
}), nrow = 1, same_axes = TRUE)
grid_plot(lapply(split(dat, dat$f2), function(d) {
figure(width = 300, height = 350) %>%
ly_hexbin(x, y, data = d, xbnds = bounds, ybnds = bounds)
}), nrow = 2, same_axes = TRUE)
range_callback <- custom_callback("
var rdiff = range.get('end') - range.get('start')
var zoomed_in = hexbin_glyph.get('_zoomed_in')
if(rdiff < 1.5) {
hexbin_glyph.get('_zoomed_in', true)
points_glyph.set('visible', true)
points_hov_glyph.set('visible', true)
grid_plot(lapply(split(dat, dat$f2), function(d) {
figure(width = 320, height = 350, tools = NULL) %>%
ly_hexbin(x, y, data = d, xbnds = bounds, ybnds = bounds)
}), nrow = 2, same_axes = TRUE)
grid_plot(lapply(split(dat, dat$f2), function(d) {
figure(width = 300, height = 350, tools = NULL) %>%
ly_hexbin(x, y, data = d, xbnds = bounds, ybnds = bounds)
}), nrow = 2, same_axes = TRUE)
grid_plot(lapply(split(dat, dat$f1), function(d) {
figure(width = 300, height = 350, tools = NULL) %>%
ly_hexbin(x, y, data = d, xbnds = bounds, ybnds = bounds)
}), nrow = 1, same_axes = TRUE)
dat <- data.frame(x = runif(500), y = runif(500))
p <- figure(title = "select points to adjust mean line",
tools = "lasso_select") %>%
ly_points(x, y, data = dat, lname = "points") %>%
ly_lines(x = c(0, 1), y = rep(mean(dat$y), 2), line_width = 6,
color = "orange", alpha = 0.75, lname = "mean")