TODO: 
- Docs

QA: 
  - Select function as data source for a graph
  - Select function as data source for a lua graph
  - Removing a function should remove it from any graphs that use it as a data source
  - Removing a data source should remove it from any functions that use it as a data source
  - Adding a function that creates a cycle should be prevented
  - Create nested complex dependent functions and use them in lots of graphs in the same screen and scroll
  - Publish the functions and make sure they work in prod
  - Disable internet and make sure cache hits anyway for functions
  - Double check url navigation is still working because i changed some stuff there
  - Check what happens on signature and network failure when downloading functions
  - Graph using function as data source refreshes with new data point


FUNCTIONS PLANNING

- Snap to month day
  - target day of month (uint)
  - direction (enum: last, nearest, next)

- Correlation co-efficient

- Filter greater than other tracker
- Filter less than other tracker


Use cases: 

- weight where you have kg and lbs entries in the tracker
- total alcohol consumption per week by merging multiple trackers/labels
- the ratio of one tracker to another over time, e.g. gym to personal best ratio
- the time between events, e.g. time between workouts
- moving averages of weight over time
- filter outliers from weight data
- count of events per week
- combine multiple trackers into one graph
