Skip to main content
100%

timeline - trend

✓ Published0🌍 Public
KKcnarf
Last edited Dec 3, 2018
Created on Jan 7, 2016

The visualization demonstrates how a single outlier or a user-dragged point dramatically alters a least-squares trend line. It shows a scatter plot of a 20-point time series, where each blue dot can be moved with the mouse to immediately recalculate and redraw the steel-blue regression line. A timeline path connects the points, and buttons allow inverting the trend or creating an outlier. Built with D3.v3, it uses `d3.behavior.drag`, `d3.svg.axis`, and `transition` functions to animate updates, with data loaded from a CSV via `d3.csv`.

AI-generated description

An example of how to draw a trend line.

Usages :

  • Drag & Drop each point to see the impact on the trend line

Notes:

  • trend line computetd using least square method
  • experiment how outliers (aberant values) have a huge impact on the trend line (cf. <a href='http://bl.ocks.org/kcnarf/57f8446c1e940e3f47a5'>Timeline - trend, confidence interval, outliers</a> for outlier detection)

Acknowledgments:

  • done with D3 v3.5.5
  • <a href='http://blockbuilder.org'>blockbuilder.org</a>
  • drag behavior from <a href='http://bl.ocks.org/mbostock/'>mbostock</a>'s block: <a href='http://bl.ocks.org/mbostock/6123708'>Drag + Zoom</a>
mit Licensed

Similar vizzes