alphagov/spotlight — pull request #490 by lennym (2014-05-13 15:41:38+00:00)
Title: Refactor/graph configs

The combination of `getConfigNames` and `applyConfig` was being used to basically break inheritance by arbitrarily overwriting functions at render-time.

Getting rid of this, and having default methods on the `Graph` view, with child classes overwriting as applicable makes inheritance a lot more predictable.

## Old way:

```
return Graph.extend({
getConfigNames: function () {
return ['stack']
},
...
});
```

## New way:

```
return StackedGraph.extend({...})
```

This has been done in a lot of places.

The other use case was for period-based things in graph.js, which was easily defaulted out, because the only change needed was to read `_timestamp` for hourly data instead of `_start_at` for others.