Powered by AppSignal & Oban Pro

Double Click Delay

16_double_click_delay.livemd

Double Click Delay

Mix.install([
  {:plotly_ex, "~> 0.3"},
  {:kino, "~> 0.18"}
])

Section

config.doubleClickDelay sets the maximum milliseconds between two clicks for them to be recognised as a double-click (default: 300 ms). Plotly uses double-click to reset zoom. Increase this value if users on touch screens or slow devices struggle to trigger double-click resets.

alias Plotly.{Figure, Scatter}

Figure.new(
  data: [Scatter.new(x: [1, 2, 3, 4, 5], y: [2, 4, 1, 5, 3], mode: "lines+markers")],
  layout: %{title: "Double-click delay: 1000 ms — zoom then try double-click to reset"},
  config: %{doubleClickDelay: 1000}
)
|> Plotly.show()