Page MenuHomePhabricator

Add chart functions "x()" and "constant(3)"
ClosedPublic

Authored by epriestley on Apr 17 2019, 2:04 PM.
Tags
None
Referenced Files
F18100446: D20443.id.diff
Sat, Aug 9, 11:54 AM
F18086699: D20443.id48750.diff
Tue, Aug 5, 11:30 PM
F18081761: D20443.id48801.diff
Tue, Aug 5, 2:05 AM
F18081400: D20443.diff
Tue, Aug 5, 12:00 AM
F18078651: D20443.id48801.diff
Mon, Aug 4, 8:18 PM
F18078650: D20443.id.diff
Mon, Aug 4, 8:18 PM
F17867807: D20443.id.diff
Mon, Jul 28, 6:44 AM
F17808222: D20443.diff
Fri, Jul 25, 3:46 PM
Subscribers

Details

Summary

Depends on D20442. Ref T13279. Add basic support for drawing chart functions that are not based on Facts first-party ETL datasets. Some general goals:

  • This might be useful to draw a line like "goal" or "profitability".
  • This might be useful to pull data from an external source.
  • For composable functions like "add" or "subtract", which are useful in manipulating ETL datasets, these value functions will make testing easier.
Test Plan

Added a constant(256) function:

Screen Shot 2019-04-17 at 7.00.27 AM.png (1×1 px, 189 KB)

Diff Detail

Repository
rP Phabricator
Branch
chart7
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 22620
Build 31003: Run Core Tests
Build 31002: arc lint + arc unit

Event Timeline

amckinley added inline comments.
src/applications/fact/chart/PhabricatorConstantChartFunction.php
30

Not sure how I feel about passing $limit here. Won't every chart function basically copy/paste the rest of the code in this function?

32–33

Also it's not obvious to me why $limit gets passed as an argument but the axis is an instance variable on this object.

src/applications/fact/controller/PhabricatorFactChartController.php
24

This is setting the default argument to 256, right? I was looking for some reason why this to be a power of 2, maybe pick a different constant like 42?

This revision is now accepted and ready to land.Apr 17 2019, 11:16 PM
src/applications/fact/chart/PhabricatorConstantChartFunction.php
32–33

Yeah, this changes in the ~next diff.

src/applications/fact/controller/PhabricatorFactChartController.php
24

This is just drawing a visible line on the "demo" chart. 256 just happened to produce a reasonable line in the middle of the data on my local instance.

This revision was automatically updated to reflect the committed changes.