Skip to contents

Options for the Boost module. The Boost module allows certain series types to be rendered by WebGL instead of the default SVG. This allows hundreds of thousands of data points to be rendered in milliseconds. In addition to the WebGL rendering it saves time by skipping processing and inspection of the data wherever possible. This introduces some limitations to what features are available in boost mode. See the docs for details.

Usage

hc_boost(hc, ...)

Arguments

hc

A highchart htmlwidget object.

...

Options defined in https://api.highcharts.com/highcharts/boost.

Details

In addition to the global boost option, each series has a boostThreshold that defines when the boost should kick in.

Requires the modules/boost.js module.

Examples

# One point per unit cell. A jitter of at most 0.3 leaves a gap of at least 0.4.
cells <- expand.grid(x = seq_len(800) - 0.5, y = seq_len(625) - 0.5)
set.seed(42)
xy <- round(
  cbind(
    cells$x + runif(nrow(cells), -0.3, 0.3),
    cells$y + runif(nrow(cells), -0.3, 0.3)
  ),
  3
)

highchart() |>
  hc_title(text = "A cloud of 500,000 points") |>
  hc_subtitle(text = "Drag to zoom in and see the spacing between samples.") |>
  hc_chart(zooming = list(type = "xy")) |>
  hc_xAxis(min = 0, max = 800, title = list(text = "x")) |>
  hc_yAxis(min = 0, max = 625, endOnTick = FALSE, title = list(text = "y")) |>
  hc_add_series(
    data = xy,
    type = "scatter",
    name = "Samples",
    marker = list(symbol = "circle", radius = 0.5),
    color = "rgba(48, 103, 162, 0.22)",
    boostThreshold = 1000,
    showInLegend = FALSE
  ) |>
  hc_tooltip(pointFormat = "x = {point.x:.3f}<br/>y = {point.y:.3f}") |>
  hc_boost(enabled = TRUE)