@pond-ts/charts 0.43.0 → 0.44.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -83,6 +83,12 @@ type TickGranularity = 'session' | 'week' | 'month' | 'quarter' | 'year';
83
83
  * `count` buckets and returns the first open in each; beyond yearly it decimates
84
84
  * every-nth so the axis never crowds. Exported so the container can draw session
85
85
  * dividers at the same instants the axis labels.
86
+ *
87
+ * `count` is a **cap**, not a target: grains jump by 4–12× up the ladder, so a
88
+ * small fixed count over-coarsens long spans (a mid-year-anchored 12-month daily
89
+ * run spans 6 quarter buckets — capped at 5 it collapses to year grain, 2
90
+ * ticks). Callers size the cap to the room the labels have — the container
91
+ * derives it from plot width — rather than passing a small constant.
86
92
  */
87
93
  export declare function coarsenCalendar(opens: readonly number[], count: number): {
88
94
  ticks: number[];
@@ -52,6 +52,12 @@ const COARSENING_LADDER = [
52
52
  * `count` buckets and returns the first open in each; beyond yearly it decimates
53
53
  * every-nth so the axis never crowds. Exported so the container can draw session
54
54
  * dividers at the same instants the axis labels.
55
+ *
56
+ * `count` is a **cap**, not a target: grains jump by 4–12× up the ladder, so a
57
+ * small fixed count over-coarsens long spans (a mid-year-anchored 12-month daily
58
+ * run spans 6 quarter buckets — capped at 5 it collapses to year grain, 2
59
+ * ticks). Callers size the cap to the room the labels have — the container
60
+ * derives it from plot width — rather than passing a small constant.
55
61
  */
56
62
  export function coarsenCalendar(opens, count) {
57
63
  if (opens.length <= count)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pond-ts/charts",
3
- "version": "0.43.0",
3
+ "version": "0.44.1",
4
4
  "private": false,
5
5
  "description": "Canvas-rendered, streaming-first time-series charts for pond-ts",
6
6
  "license": "MIT",
@@ -38,8 +38,8 @@
38
38
  "perf": "PERF_BENCH=1 playwright test perf.spec.ts --workers=1"
39
39
  },
40
40
  "peerDependencies": {
41
- "@pond-ts/react": "^0.43.0",
42
- "pond-ts": "^0.43.0",
41
+ "@pond-ts/react": "^0.44.0",
42
+ "pond-ts": "^0.44.0",
43
43
  "react": "^18.0.0 || ^19.0.0"
44
44
  },
45
45
  "devDependencies": {