You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* How precise the bar date column has to be, chosen from the LONGEST period in
601
+
* the set.
602
+
*
603
+
* A Mahadasha spans years, so a bare year reads cleanly and keeps the column
604
+
* narrow. A Sookshma spans days: printed as a year, every one of the nine rows
605
+
* reads "1990 - 1990" and the column carries no information at exactly the level
606
+
* a reader opened the drill-down to see.
607
+
*/
608
+
typeDateGrain='year'|'month'|'day';
609
+
610
+
constDAYS_PER_YEAR=365.25;
611
+
612
+
functiongrainFor(maxYears: number): DateGrain{
613
+
if(maxYears>=2)return'year';
614
+
if(maxYears>=60/DAYS_PER_YEAR)return'month';
615
+
return'day';
616
+
}
617
+
618
+
/** One end of a bar, at the chosen granularity. Day grain drops the year: these rows sit under a parent line that already states it, and the column is only 8rem wide. */
0 commit comments