wavedrom / zoom

🔍 Zoomable Waveform viewer for the Web

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Composition

drom opened this issue · comments

Way to compose zoom with a custom components (plugins)

  • visual components
  • custom behaviors

from : @wifasoi #1

  • plugins: support plugins that can create/annotate metadata based on the waveform (big word for having a way to create decoder/checkers that can, for example, color the trace that trigger a condition), or generate new traces (user-case: pwm to analog, and why stopping there.. analog/digital to Fourier transform)

from : @DrSensor #1

Big +1 for extensibility via plugins. Maybe there is a need to separate Github issue for discussing plugins idea. From there we can conclude the core features that need to be implemented. I think we need to address 3 things: architecture, core features, and the common use-cases (for plugins).

As for custom behaviors, how about starting from basic left/right/middle click and hovering on specific areas. The question is what the context/data/payload that should be pass on 🤔

Examples
zoom.on('rightclick', context => { // inspired from koajs
  const { i2c, a1 } = context
  console.log(i2c[2].time, a1.value)
})

Or 🤔

zoom.on('hover:i2c_3', (time,value, ...something_else)  => {
  console.log(time, value)
})