D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
domoritz
Full window
Github gist
Line bias
Estimate average
<!DOCTYPE html> <head> <meta charset="utf-8"> <script src="https://cdn.jsdelivr.net/npm/vega@5"></script> <script src="https://cdn.jsdelivr.net/npm/vega-embed@4"></script> </head> <body> <p> Click and drag anywhere in the chart to set the average. </p> <div id="vis"></div> <script> const spec = "line.json"; vegaEmbed('#vis', spec, {actions: false}) // result.view provides access to the Vega View API .then(result => { result.view.addSignalListener("average", console.log); }) .catch(console.warn); </script> </body>
https://cdn.jsdelivr.net/npm/vega@5
https://cdn.jsdelivr.net/npm/vega-embed@4