Old school D3 from simpler times

An example of how to compare trends of several time series.

*Question*: a trend of +10 over 100 things is higher or lower than a trend of +5 over 10 things ?

*Response*: it depends ... if you are interested in the raw trend, then the first trend is higher (+10 > +5); but if you are interested in the relative trend, then the second trend is higher (+10/100 < +5/10)

In the above viz, the left graph concerns raw data, and the right graph deals with relative data. If you want to compare raw trends, look at the left graph; and if you want to compare relative trends, look at the right one.

Relative values (dots on the rigth graph) are the raw values divided by the mean of their respective serie. The *mean* is used because it has interesting mathematical/computationnal properties over other possible ways to divide values (such as min, max, median, ...). In the statistical world, data divided by their respective mean are called **reduced** (reduced value, reduced trend, ..., but the reduced standard deviation is called *coefficient of variation*).

- in the left graph, Drag & Drop a point to see the overall impact (on its trend, its related reduced values, and its related reduced trend)
- in the left graph, Drag & Drop a timeline (to change each vaue of the related time serie), and see the impact on the related reduced trend;

- trend line computed using
**least square method**

- done with D3 v3.5.5
- blockbuilder.org

forked from Kcnarf's block: timeline - comparing trends

forked from clonardo's block: timeline - comparing trends

https://d3js.org/d3.v3.min.js