ReactiveDag.Node.Slice (reactive_dag v0.17.0-rc.25)

Copy Markdown View Source

A dimension a human may select this node by: slice :fiscal_year.

recompute_by declares the unit a CHANGE invalidates. This declares the unit a PERSON picks — "reprocess just FY25", "re-run last year's documents" — and they are rarely the same. A node recomputing per :category is still sliced by :fiscal_year, because that is the question an operator asks.

Without it the library can offer no such control. A cell key is one column or a "|"-joined identity, so nothing generic can find the year in a row — fiscal_year on one node and published_on on another are equally invisible until the node says which it is.

values: makes the control renderable rather than a text box. Only the host knows which fiscal years exist, and it usually already has the function:

slice :fiscal_year, values: {MyApp.Osc, :available_years, []}

Deliberately NOT time-specific. The obvious first guess is a date range, and it fits almost nothing: the real dimension here is a "FY22" string, and a version is not temporal at all. Time is one instance of slicing, not its shape.