derive-dashboards 0.8.0 → 0.9.0

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.
Files changed (585) hide show
  1. package/CHANGELOG.md +513 -0
  2. package/README.md +8 -2
  3. package/dist/adapter/statement.mjs +9 -7
  4. package/dist/authorize.mjs +27 -6
  5. package/dist/body.mjs +28 -25
  6. package/dist/cache.d.mts +2 -2
  7. package/dist/charts/data/buckets.d.mts +25 -7
  8. package/dist/charts/data/buckets.mjs +92 -15
  9. package/dist/charts/data/clean.mjs +254 -12
  10. package/dist/charts/data/format.d.mts +7 -2
  11. package/dist/charts/data/format.mjs +68 -70
  12. package/dist/charts/data/input-error.d.mts +2 -0
  13. package/dist/charts/data/input-error.mjs +2 -0
  14. package/dist/charts/data/rows.d.mts +3 -1
  15. package/dist/charts/data/rows.mjs +4 -2
  16. package/dist/charts/data/types.d.mts +50 -7
  17. package/dist/charts/data/words.d.mts +13 -0
  18. package/dist/charts/data/words.mjs +8 -1
  19. package/dist/charts/describe.mjs +6 -6
  20. package/dist/charts/index.d.mts +14 -14
  21. package/dist/charts/index.mjs +4 -1
  22. package/dist/charts/kinds/area-marks.mjs +67 -26
  23. package/dist/charts/kinds/area.d.mts +3 -3
  24. package/dist/charts/kinds/area.mjs +32 -11
  25. package/dist/charts/kinds/bars-data.d.mts +3 -3
  26. package/dist/charts/kinds/bars-data.mjs +12 -6
  27. package/dist/charts/kinds/bars-layout.mjs +60 -6
  28. package/dist/charts/kinds/bars-marks.mjs +6 -6
  29. package/dist/charts/kinds/bars.d.mts +5 -3
  30. package/dist/charts/kinds/bars.mjs +39 -6
  31. package/dist/charts/kinds/columns-data.mjs +14 -5
  32. package/dist/charts/kinds/columns-marks.mjs +52 -23
  33. package/dist/charts/kinds/columns.d.mts +2 -2
  34. package/dist/charts/kinds/columns.mjs +36 -10
  35. package/dist/charts/kinds/course-data.mjs +44 -0
  36. package/dist/charts/kinds/course-layout.mjs +77 -0
  37. package/dist/charts/kinds/course-marks.mjs +52 -0
  38. package/dist/charts/kinds/course-words.mjs +64 -0
  39. package/dist/charts/kinds/course.d.mts +10 -0
  40. package/dist/charts/kinds/course.mjs +55 -0
  41. package/dist/charts/kinds/dumbbell-data.d.mts +4 -4
  42. package/dist/charts/kinds/dumbbell-data.mjs +3 -3
  43. package/dist/charts/kinds/dumbbell-layout.mjs +17 -8
  44. package/dist/charts/kinds/dumbbell.d.mts +5 -3
  45. package/dist/charts/kinds/dumbbell.mjs +35 -4
  46. package/dist/charts/kinds/funnel-data.d.mts +3 -3
  47. package/dist/charts/kinds/funnel-data.mjs +11 -16
  48. package/dist/charts/kinds/funnel-layout.mjs +7 -6
  49. package/dist/charts/kinds/funnel.d.mts +5 -4
  50. package/dist/charts/kinds/funnel.mjs +33 -6
  51. package/dist/charts/kinds/grid-data.d.mts +3 -3
  52. package/dist/charts/kinds/grid-data.mjs +55 -13
  53. package/dist/charts/kinds/grid-layout.mjs +88 -13
  54. package/dist/charts/kinds/grid-legend.mjs +60 -0
  55. package/dist/charts/kinds/grid-marks.mjs +81 -30
  56. package/dist/charts/kinds/grid-time.mjs +19 -5
  57. package/dist/charts/kinds/grid-words.mjs +57 -35
  58. package/dist/charts/kinds/grid.d.mts +7 -4
  59. package/dist/charts/kinds/grid.mjs +49 -8
  60. package/dist/charts/kinds/histogram-data.mjs +68 -26
  61. package/dist/charts/kinds/histogram-layout.mjs +4 -3
  62. package/dist/charts/kinds/histogram-words.mjs +2 -3
  63. package/dist/charts/kinds/histogram.d.mts +2 -2
  64. package/dist/charts/kinds/histogram.mjs +17 -1
  65. package/dist/charts/kinds/line-marks.mjs +19 -11
  66. package/dist/charts/kinds/line.d.mts +2 -2
  67. package/dist/charts/kinds/line.mjs +21 -3
  68. package/dist/charts/kinds/multiples-grid.mjs +57 -27
  69. package/dist/charts/kinds/multiples-head.mjs +52 -22
  70. package/dist/charts/kinds/multiples-layout.mjs +106 -52
  71. package/dist/charts/kinds/multiples-marks.mjs +6 -5
  72. package/dist/charts/kinds/multiples-words.mjs +53 -38
  73. package/dist/charts/kinds/multiples.d.mts +2 -2
  74. package/dist/charts/kinds/multiples.mjs +35 -7
  75. package/dist/charts/kinds/row-chart.d.mts +7 -0
  76. package/dist/charts/kinds/row-chart.mjs +47 -10
  77. package/dist/charts/kinds/row-marks.mjs +5 -5
  78. package/dist/charts/kinds/scatter-data.d.mts +5 -5
  79. package/dist/charts/kinds/scatter-data.mjs +6 -6
  80. package/dist/charts/kinds/scatter-marks.mjs +46 -19
  81. package/dist/charts/kinds/scatter-words.mjs +8 -8
  82. package/dist/charts/kinds/scatter.d.mts +5 -3
  83. package/dist/charts/kinds/scatter.mjs +18 -0
  84. package/dist/charts/kinds/stat-data.mjs +7 -7
  85. package/dist/charts/kinds/stat-marks.mjs +2 -2
  86. package/dist/charts/kinds/stat.d.mts +4 -4
  87. package/dist/charts/kinds/stat.mjs +19 -0
  88. package/dist/charts/kinds/time-chart.mjs +13 -4
  89. package/dist/charts/kinds/time-frame.mjs +50 -19
  90. package/dist/charts/kinds/time-plan.mjs +29 -2
  91. package/dist/charts/kinds/time-plot.mjs +1 -1
  92. package/dist/charts/kinds/time-stops.mjs +58 -29
  93. package/dist/charts/kinds/waterfall-data.d.mts +3 -3
  94. package/dist/charts/kinds/waterfall-data.mjs +2 -2
  95. package/dist/charts/kinds/waterfall.d.mts +5 -4
  96. package/dist/charts/kinds/waterfall.mjs +29 -2
  97. package/dist/charts/layout/frame.mjs +5 -3
  98. package/dist/charts/layout/stack.mjs +43 -22
  99. package/dist/charts/marks/axes.mjs +10 -5
  100. package/dist/charts/marks/budget.mjs +14 -0
  101. package/dist/charts/marks/end-labels.mjs +24 -10
  102. package/dist/charts/marks/legend.mjs +19 -8
  103. package/dist/charts/marks/lines.mjs +3 -3
  104. package/dist/charts/marks/more.mjs +79 -13
  105. package/dist/charts/marks/notes.mjs +12 -6
  106. package/dist/charts/marks/series-line.mjs +14 -10
  107. package/dist/charts/marks/thin.mjs +16 -33
  108. package/dist/charts/scale/calendar.mjs +41 -26
  109. package/dist/charts/scale/linear.mjs +58 -0
  110. package/dist/charts/scale/value.d.mts +21 -0
  111. package/dist/charts/scale/value.mjs +67 -9
  112. package/dist/charts/scene/lazy.mjs +27 -0
  113. package/dist/charts/scene/markup.mjs +2 -1
  114. package/dist/charts/scene/svg.mjs +20 -8
  115. package/dist/charts/scene/types.d.mts +34 -0
  116. package/dist/charts/text/measure.mjs +33 -3
  117. package/dist/charts/theme.mjs +13 -4
  118. package/dist/charts-react/Chart.d.mts +20 -0
  119. package/dist/charts-react/Chart.mjs +9 -67
  120. package/dist/charts-react/Reader.mjs +50 -96
  121. package/dist/charts-react/box.mjs +106 -0
  122. package/dist/charts-react/bucket-names.mjs +9 -24
  123. package/dist/charts-react/columns-picture.mjs +12 -0
  124. package/dist/charts-react/exact-sum.mjs +4 -7
  125. package/dist/charts-react/from-answer.mjs +9 -4
  126. package/dist/charts-react/index.d.mts +9 -2
  127. package/dist/charts-react/index.mjs +9 -2
  128. package/dist/charts-react/kinds/area.d.mts +4 -0
  129. package/dist/charts-react/kinds/area.mjs +38 -0
  130. package/dist/charts-react/kinds/bar.d.mts +4 -0
  131. package/dist/charts-react/kinds/bar.mjs +15 -0
  132. package/dist/charts-react/kinds/funnel.d.mts +4 -0
  133. package/dist/charts-react/kinds/funnel.mjs +13 -0
  134. package/dist/charts-react/kinds/heatmap.d.mts +4 -0
  135. package/dist/charts-react/kinds/heatmap.mjs +13 -0
  136. package/dist/charts-react/kinds/line.d.mts +4 -0
  137. package/dist/charts-react/kinds/line.mjs +20 -0
  138. package/dist/charts-react/kinds/multiples.d.mts +4 -0
  139. package/dist/charts-react/kinds/multiples.mjs +33 -0
  140. package/dist/charts-react/kinds/number.d.mts +5 -0
  141. package/dist/charts-react/kinds/number.mjs +86 -0
  142. package/dist/charts-react/plan-bars.mjs +15 -8
  143. package/dist/charts-react/plan-funnel.mjs +3 -1
  144. package/dist/charts-react/plan-grid.mjs +14 -5
  145. package/dist/charts-react/plan-of.mjs +17 -0
  146. package/dist/charts-react/plan-parts.mjs +16 -5
  147. package/dist/charts-react/plan-time.mjs +4 -53
  148. package/dist/charts-react/reader-page.d.mts +1 -1
  149. package/dist/charts-react/reader-page.mjs +19 -9
  150. package/dist/charts-react/renderers.d.mts +14 -0
  151. package/dist/charts-react/renderers.mjs +22 -0
  152. package/dist/charts-react/table.d.mts +1 -0
  153. package/dist/charts-react/table.mjs +108 -0
  154. package/dist/charts-react/tiles.mjs +21 -49
  155. package/dist/charts-react/useScene.mjs +45 -17
  156. package/dist/charts-react/words.mjs +19 -0
  157. package/dist/checks.mjs +97 -19
  158. package/dist/cli/add.mjs +4 -3
  159. package/dist/cli/doctor.mjs +2 -2
  160. package/dist/core/conformance/index.d.mts +5 -2
  161. package/dist/core/conformance/index.mjs +5 -2
  162. package/dist/core/conformance/memory/aggregate.mjs +11 -6
  163. package/dist/core/conformance/memory/rows.d.mts +7 -3
  164. package/dist/core/conformance/memory/rows.mjs +19 -13
  165. package/dist/core/conformance/memory/source.mjs +4 -4
  166. package/dist/core/document/control-fields.d.mts +20 -0
  167. package/dist/core/document/control-fields.mjs +117 -0
  168. package/dist/core/document/display-comparisons.d.mts +17 -0
  169. package/dist/core/document/display-comparisons.mjs +15 -4
  170. package/dist/core/document/display-entries.d.mts +14 -0
  171. package/dist/core/document/display-entries.mjs +25 -9
  172. package/dist/core/document/display-validation.d.mts +5 -1
  173. package/dist/core/document/display-validation.mjs +14 -7
  174. package/dist/core/document/display.d.mts +10 -8
  175. package/dist/core/document/display.mjs +25 -4
  176. package/dist/core/document/layout.d.mts +8 -9
  177. package/dist/core/document/layout.mjs +23 -6
  178. package/dist/core/document/stacked.d.mts +0 -7
  179. package/dist/core/document/types.mjs +8 -6
  180. package/dist/core/document/upgrade.d.mts +1 -0
  181. package/dist/core/document/upgrade.mjs +4 -2
  182. package/dist/core/engine/access.mjs +3 -3
  183. package/dist/core/engine/assert.mjs +4 -2
  184. package/dist/core/engine/bucket.mjs +2 -2
  185. package/dist/core/engine/checks.mjs +6 -7
  186. package/dist/core/engine/custom/ask.mjs +22 -2
  187. package/dist/core/engine/custom/cells.mjs +22 -22
  188. package/dist/core/engine/custom/level.mjs +12 -13
  189. package/dist/core/engine/custom/measures.mjs +12 -9
  190. package/dist/core/engine/custom/reader.mjs +3 -1
  191. package/dist/core/engine/custom/records.mjs +8 -7
  192. package/dist/core/engine/custom/unread.mjs +78 -0
  193. package/dist/core/engine/custom/where.mjs +15 -10
  194. package/dist/core/engine/index.d.mts +2 -13
  195. package/dist/core/engine/index.mjs +2 -12
  196. package/dist/core/engine/measure.mjs +1 -0
  197. package/dist/core/engine/members.mjs +7 -3
  198. package/dist/core/engine/nan.mjs +10 -1
  199. package/dist/core/engine/native.mjs +2 -20
  200. package/dist/core/engine/numbers.mjs +26 -14
  201. package/dist/core/engine/postgres.mjs +9 -5
  202. package/dist/core/engine/prepare.mjs +4 -4
  203. package/dist/core/engine/rank-sets.mjs +1 -1
  204. package/dist/core/engine/read.mjs +5 -4
  205. package/dist/core/engine/reader.d.mts +6 -0
  206. package/dist/core/engine/record-layout.mjs +3 -3
  207. package/dist/core/engine/run.mjs +77 -20
  208. package/dist/core/engine/segmented.d.mts +2 -1
  209. package/dist/core/engine/segmented.mjs +19 -12
  210. package/dist/core/engine/series.mjs +1 -1
  211. package/dist/core/engine/shape.mjs +8 -8
  212. package/dist/core/engine/sql-partition.mjs +2 -2
  213. package/dist/core/engine/sql-pass.mjs +3 -2
  214. package/dist/core/engine/sql-reader.mjs +13 -5
  215. package/dist/core/engine/sql-reads.mjs +2 -1
  216. package/dist/core/engine/sql-records.mjs +2 -2
  217. package/dist/core/engine/sql-split.mjs +1 -1
  218. package/dist/core/engine/sql-unread.mjs +70 -0
  219. package/dist/core/engine/time.mjs +2 -1
  220. package/dist/core/engine/types.d.mts +17 -0
  221. package/dist/core/engine/version.d.mts +1 -1
  222. package/dist/core/engine/version.mjs +1 -1
  223. package/dist/core/error/codes.d.mts +24 -1
  224. package/dist/core/error/codes.mjs +23 -3
  225. package/dist/core/error/refusal.d.mts +8 -3
  226. package/dist/core/error/refusal.mjs +6 -1
  227. package/dist/core/exact/decimal.d.mts +1 -14
  228. package/dist/core/exact/decimal.mjs +9 -19
  229. package/dist/core/exact/stored.d.mts +9 -0
  230. package/dist/core/exact/stored.mjs +38 -0
  231. package/dist/core/exact/text.d.mts +16 -1
  232. package/dist/core/exact/text.mjs +50 -1
  233. package/dist/core/format/digits.mjs +55 -0
  234. package/dist/core/format/index.d.mts +16 -0
  235. package/dist/core/format/index.mjs +27 -0
  236. package/dist/core/format/number.d.mts +27 -0
  237. package/dist/core/format/number.mjs +158 -0
  238. package/dist/core/format/write.d.mts +6 -0
  239. package/dist/core/format/write.mjs +57 -0
  240. package/dist/core/index.d.mts +43 -33
  241. package/dist/core/index.mjs +31 -28
  242. package/dist/core/model/defaults.d.mts +18 -1
  243. package/dist/core/model/defaults.mjs +19 -1
  244. package/dist/core/model/define.d.mts +17 -8
  245. package/dist/core/model/define.mjs +2 -0
  246. package/dist/core/model/member.d.mts +5 -3
  247. package/dist/core/model/member.mjs +33 -6
  248. package/dist/core/model/storage.mjs +40 -12
  249. package/dist/core/model/types.d.mts +17 -1
  250. package/dist/core/model/types.mjs +5 -0
  251. package/dist/core/model/validate/expr.d.mts +1 -7
  252. package/dist/core/model/validate/fields.d.mts +2 -0
  253. package/dist/core/model/validate/fields.mjs +14 -7
  254. package/dist/core/model/validate/issues.mjs +5 -1
  255. package/dist/core/model/validate/known-members.mjs +6 -5
  256. package/dist/core/model/validate/shape.mjs +36 -3
  257. package/dist/core/model/validate/source.mjs +2 -2
  258. package/dist/core/oracle/data.d.mts +4 -2
  259. package/dist/core/oracle/evaluate.d.mts +19 -1
  260. package/dist/core/oracle/evaluate.mjs +56 -10
  261. package/dist/core/oracle/expr.mjs +1 -1
  262. package/dist/core/oracle/facts.mjs +12 -5
  263. package/dist/core/oracle/measure.mjs +1 -1
  264. package/dist/core/oracle/request.mjs +39 -4
  265. package/dist/core/oracle/segmented.d.mts +3 -1
  266. package/dist/core/oracle/segmented.mjs +19 -13
  267. package/dist/core/oracle/unread.mjs +32 -0
  268. package/dist/core/oracle/visibility.mjs +4 -3
  269. package/dist/core/policy/bind.d.mts +2 -11
  270. package/dist/core/policy/bind.mjs +1 -1
  271. package/dist/core/policy/match.mjs +1 -1
  272. package/dist/core/query/closure.d.mts +7 -2
  273. package/dist/core/query/closure.mjs +29 -12
  274. package/dist/core/query/compose-tile.d.mts +3 -2
  275. package/dist/core/query/compose-tile.mjs +32 -13
  276. package/dist/core/query/compose.d.mts +0 -5
  277. package/dist/core/query/drill/internal.d.mts +5 -5
  278. package/dist/core/query/drill/internal.mjs +11 -0
  279. package/dist/core/query/drill/links.d.mts +2 -3
  280. package/dist/core/query/drill/links.mjs +18 -4
  281. package/dist/core/query/drill/selection.d.mts +8 -2
  282. package/dist/core/query/drill/selection.mjs +14 -3
  283. package/dist/core/query/drill/synthetic.mjs +1 -1
  284. package/dist/core/query/drill/time.mjs +11 -10
  285. package/dist/core/query/filter.d.mts +1 -6
  286. package/dist/core/query/filter.mjs +1 -4
  287. package/dist/core/query/fold.mjs +23 -0
  288. package/dist/core/query/segments.mjs +42 -3
  289. package/dist/core/query/to-wire.d.mts +7 -0
  290. package/dist/core/query/to-wire.mjs +14 -2
  291. package/dist/core/query/types.d.mts +30 -13
  292. package/dist/core/result/columns.mjs +23 -13
  293. package/dist/core/result/number.mjs +3 -3
  294. package/dist/core/result/status.d.mts +13 -0
  295. package/dist/core/result/status.mjs +18 -0
  296. package/dist/core/result/time-axis.d.mts +14 -13
  297. package/dist/core/result/time-axis.mjs +20 -2
  298. package/dist/core/result/types.d.mts +33 -3
  299. package/dist/core/result/whole.d.mts +23 -0
  300. package/dist/core/result/whole.mjs +27 -0
  301. package/dist/core/schema/agent-query.d.mts +89 -0
  302. package/dist/core/schema/agent-query.mjs +115 -0
  303. package/dist/core/schema/aliases.mjs +1 -52
  304. package/dist/core/schema/answer-parts.mjs +17 -13
  305. package/dist/core/schema/answers.d.mts +787 -319
  306. package/dist/core/schema/commands.d.mts +33 -23
  307. package/dist/core/schema/commands.mjs +26 -18
  308. package/dist/core/schema/custom.mjs +46 -45
  309. package/dist/core/schema/document.d.mts +32 -27
  310. package/dist/core/schema/document.mjs +61 -81
  311. package/dist/core/schema/drill-answers.mjs +4 -1
  312. package/dist/core/schema/drill.d.mts +14 -9
  313. package/dist/core/schema/drill.mjs +23 -22
  314. package/dist/core/schema/index.d.mts +5 -3
  315. package/dist/core/schema/index.mjs +5 -3
  316. package/dist/core/schema/options.d.mts +92 -0
  317. package/dist/core/schema/options.mjs +104 -0
  318. package/dist/core/schema/picks.d.mts +2 -2
  319. package/dist/core/schema/picks.mjs +7 -6
  320. package/dist/core/schema/query.d.mts +9 -83
  321. package/dist/core/schema/query.mjs +49 -73
  322. package/dist/core/schema/strict.d.mts +3 -0
  323. package/dist/core/schema/strict.mjs +91 -0
  324. package/dist/core/schema/union-error.mjs +30 -7
  325. package/dist/core/schema/view.d.mts +4 -3
  326. package/dist/core/schema/view.mjs +16 -11
  327. package/dist/core/store/ddl.d.mts +0 -2
  328. package/dist/core/store/ddl.mjs +1 -5
  329. package/dist/core/time/bucket.d.mts +1 -19
  330. package/dist/core/time/bucket.mjs +6 -6
  331. package/dist/core/time/compare.mjs +3 -2
  332. package/dist/core/time/index.d.mts +7 -8
  333. package/dist/core/time/instant.d.mts +15 -9
  334. package/dist/core/time/instant.mjs +23 -9
  335. package/dist/core/time/range.d.mts +3 -15
  336. package/dist/core/time/range.mjs +17 -7
  337. package/dist/core/time/stored.d.mts +8 -5
  338. package/dist/core/time/stored.mjs +51 -15
  339. package/dist/core/time/temporal.d.mts +1 -5
  340. package/dist/core/time/temporal.mjs +9 -4
  341. package/dist/core/time/text-time.d.mts +31 -2
  342. package/dist/core/time/text-time.mjs +139 -22
  343. package/dist/core/time/zone.mjs +2 -2
  344. package/dist/core/types/api.d.mts +1 -1
  345. package/dist/core/types/api.mjs +1 -1
  346. package/dist/core/types/dashboard.d.mts +185 -0
  347. package/dist/core/types/dashboard.mjs +26 -0
  348. package/dist/core/types/drill-api.d.mts +14 -2
  349. package/dist/core/types/infer.d.mts +0 -4
  350. package/dist/core/types/options-check.d.mts +42 -0
  351. package/dist/core/types/options-check.mjs +90 -0
  352. package/dist/core/types/options.d.mts +14 -8
  353. package/dist/core/value/casefold.d.mts +1 -3
  354. package/dist/core/value/stored.d.mts +26 -0
  355. package/dist/core/value/stored.mjs +28 -0
  356. package/dist/cursor-seal.mjs +37 -9
  357. package/dist/dashboard-documents.d.mts +14 -6
  358. package/dist/dashboard-documents.mjs +32 -12
  359. package/dist/dashboards.mjs +10 -9
  360. package/dist/drill-access.mjs +6 -6
  361. package/dist/drill-change.mjs +18 -20
  362. package/dist/drill-comparison.mjs +2 -1
  363. package/dist/drill-crumbs.mjs +63 -28
  364. package/dist/drill-distinct.mjs +2 -1
  365. package/dist/drill-explain.mjs +1 -1
  366. package/dist/drill-items.mjs +1 -1
  367. package/dist/drill-open.mjs +39 -23
  368. package/dist/drill-seal.mjs +41 -13
  369. package/dist/drill-share.mjs +1 -1
  370. package/dist/drill-summary.mjs +2 -1
  371. package/dist/drill-targets.mjs +4 -4
  372. package/dist/drill-views.mjs +4 -3
  373. package/dist/drill.mjs +1 -1
  374. package/dist/editing.mjs +5 -3
  375. package/dist/endpoints/index.d.mts +29 -8
  376. package/dist/endpoints/index.mjs +4 -1
  377. package/dist/endpoints/meta.mjs +4 -3
  378. package/dist/endpoints/query.mjs +5 -2
  379. package/dist/endpoints/read.mjs +7 -6
  380. package/dist/endpoints/versions.mjs +2 -1
  381. package/dist/execute.d.mts +3 -0
  382. package/dist/execute.mjs +23 -12
  383. package/dist/grant.d.mts +9 -0
  384. package/dist/grant.mjs +43 -0
  385. package/dist/handler.mjs +8 -13
  386. package/dist/http.d.mts +6 -2
  387. package/dist/http.mjs +6 -2
  388. package/dist/index.d.mts +25 -4
  389. package/dist/index.mjs +91 -40
  390. package/dist/llms.txt +3 -3
  391. package/dist/mcp/api.mjs +2 -1
  392. package/dist/mcp/query.mjs +3 -8
  393. package/dist/mcp/resolve.mjs +9 -2
  394. package/dist/node/index.d.mts +36 -0
  395. package/dist/node/index.mjs +89 -0
  396. package/dist/node/request.d.mts +12 -0
  397. package/dist/node/request.mjs +119 -0
  398. package/dist/node/response.mjs +58 -0
  399. package/dist/principal.mjs +15 -7
  400. package/dist/react/Canvas.mjs +88 -67
  401. package/dist/react/Cell.mjs +2 -1
  402. package/dist/react/Dashboard.d.mts +9 -1
  403. package/dist/react/Dashboard.mjs +42 -42
  404. package/dist/react/DashboardList.mjs +9 -4
  405. package/dist/react/Editing.d.mts +9 -0
  406. package/dist/react/Editing.mjs +8 -3
  407. package/dist/react/Grid.mjs +1 -1
  408. package/dist/react/Header.mjs +4 -35
  409. package/dist/react/History.mjs +3 -2
  410. package/dist/react/LoadFailed.mjs +59 -0
  411. package/dist/react/Panel.d.mts +1 -1
  412. package/dist/react/Panel.mjs +1 -1
  413. package/dist/react/Parts.d.mts +34 -0
  414. package/dist/react/Parts.mjs +9 -6
  415. package/dist/react/ReviewPanel.mjs +1 -1
  416. package/dist/react/RowBody.d.mts +2 -0
  417. package/dist/react/RowBody.mjs +5 -1
  418. package/dist/react/Share.mjs +153 -0
  419. package/dist/react/TabStrip.mjs +37 -0
  420. package/dist/react/Tile.d.mts +3 -1
  421. package/dist/react/Tile.mjs +89 -92
  422. package/dist/react/TileState.mjs +117 -0
  423. package/dist/react/ago.mjs +45 -0
  424. package/dist/react/arrange.mjs +1 -1
  425. package/dist/react/board.mjs +2 -2
  426. package/dist/react/bucket-name.d.mts +8 -0
  427. package/dist/react/bucket-name.mjs +13 -0
  428. package/dist/react/builder/DisplayOptions.mjs +219 -0
  429. package/dist/react/builder/Preview.mjs +13 -13
  430. package/dist/react/builder/RangeEditor.mjs +4 -3
  431. package/dist/react/builder/WidgetBuilder.d.mts +1 -7
  432. package/dist/react/builder/WidgetBuilder.mjs +12 -3
  433. package/dist/react/builder/base.d.mts +13 -2
  434. package/dist/react/builder/base.mjs +70 -12
  435. package/dist/react/builder/display.d.mts +3 -0
  436. package/dist/react/builder/display.mjs +256 -0
  437. package/dist/react/builder/labels.mjs +19 -5
  438. package/dist/react/builder/options.mjs +11 -6
  439. package/dist/react/builder/state.mjs +25 -3
  440. package/dist/react/builder/useBuilder.d.mts +7 -1
  441. package/dist/react/builder/useBuilder.mjs +6 -9
  442. package/dist/react/builder/usePreview.mjs +3 -2
  443. package/dist/react/builder/words.d.mts +16 -1
  444. package/dist/react/builder/words.mjs +41 -1
  445. package/dist/react/change-text.mjs +149 -0
  446. package/dist/react/client.d.mts +9 -0
  447. package/dist/react/client.mjs +105 -14
  448. package/dist/react/context.d.mts +24 -3
  449. package/dist/react/context.mjs +23 -7
  450. package/dist/react/dates-shown.mjs +76 -0
  451. package/dist/react/draft.mjs +3 -2
  452. package/dist/react/drill/Bars.mjs +12 -16
  453. package/dist/react/drill/Comparison.mjs +1 -1
  454. package/dist/react/drill/DrillPanel.d.mts +1 -1
  455. package/dist/react/drill/DrillPanel.mjs +2 -1
  456. package/dist/react/drill/Header.mjs +65 -12
  457. package/dist/react/drill/Items.d.mts +1 -1
  458. package/dist/react/drill/Notes.mjs +10 -7
  459. package/dist/react/drill/PanelStates.mjs +8 -1
  460. package/dist/react/drill/Trend.mjs +10 -5
  461. package/dist/react/drill/board.d.mts +1 -1
  462. package/dist/react/drill/host.mjs +4 -1
  463. package/dist/react/drill/lazy.mjs +2 -27
  464. package/dist/react/drill/props.d.mts +17 -7
  465. package/dist/react/drill/props.mjs +55 -14
  466. package/dist/react/drill/state.d.mts +15 -5
  467. package/dist/react/drill/state.mjs +12 -3
  468. package/dist/react/drill/words.d.mts +46 -3
  469. package/dist/react/drill/words.mjs +30 -5
  470. package/dist/react/english.mjs +33 -8
  471. package/dist/react/export/ExportButton.mjs +4 -1
  472. package/dist/react/export/csv.d.mts +7 -2
  473. package/dist/react/export/csv.mjs +24 -7
  474. package/dist/react/failure-words.mjs +60 -0
  475. package/dist/react/filters/bar.d.mts +1 -1
  476. package/dist/react/filters/bar.mjs +4 -1
  477. package/dist/react/filters/calendar.mjs +23 -8
  478. package/dist/react/filters/chip.mjs +7 -3
  479. package/dist/react/filters/context.d.mts +13 -1
  480. package/dist/react/filters/context.mjs +1 -1
  481. package/dist/react/filters/dates-said.mjs +57 -0
  482. package/dist/react/filters/days.d.mts +3 -4
  483. package/dist/react/filters/days.mjs +10 -17
  484. package/dist/react/filters/hooks.d.mts +11 -0
  485. package/dist/react/filters/hooks.mjs +10 -6
  486. package/dist/react/filters/menu-search.mjs +17 -9
  487. package/dist/react/filters/menu.mjs +10 -8
  488. package/dist/react/filters/phone.mjs +41 -16
  489. package/dist/react/filters/place.mjs +40 -0
  490. package/dist/react/filters/popover.mjs +18 -13
  491. package/dist/react/filters/rules.d.mts +4 -3
  492. package/dist/react/filters/rules.mjs +3 -3
  493. package/dist/react/filters/sheet.mjs +7 -3
  494. package/dist/react/filters/state.mjs +6 -1
  495. package/dist/react/filters/values.mjs +24 -7
  496. package/dist/react/filters/words.d.mts +13 -0
  497. package/dist/react/filters/words.mjs +5 -0
  498. package/dist/react/format-time.d.mts +17 -6
  499. package/dist/react/format-time.mjs +152 -33
  500. package/dist/react/format.d.mts +3 -3
  501. package/dist/react/format.mjs +27 -133
  502. package/dist/react/headline.d.mts +6 -3
  503. package/dist/react/headline.mjs +81 -25
  504. package/dist/react/index.d.mts +19 -17
  505. package/dist/react/index.mjs +12 -10
  506. package/dist/react/lazy.mjs +38 -0
  507. package/dist/react/messages.d.mts +78 -2
  508. package/dist/react/now.mjs +38 -0
  509. package/dist/react/read.d.mts +1 -0
  510. package/dist/react/read.mjs +140 -9
  511. package/dist/react/renderers/exact.mjs +31 -59
  512. package/dist/react/renderers/index.d.mts +27 -6
  513. package/dist/react/renderers/index.mjs +141 -102
  514. package/dist/react/renderers/list-parts.mjs +24 -0
  515. package/dist/react/renderers/list.d.mts +1 -0
  516. package/dist/react/renderers/list.mjs +99 -43
  517. package/dist/react/renderers/more-rows.mjs +75 -0
  518. package/dist/react/renderers/number-before.mjs +320 -0
  519. package/dist/react/renderers/number-period.mjs +54 -0
  520. package/dist/react/renderers/number-whole.mjs +29 -0
  521. package/dist/react/renderers/props.d.mts +24 -1
  522. package/dist/react/renderers/props.mjs +8 -0
  523. package/dist/react/renderers/table-cells.mjs +137 -31
  524. package/dist/react/renderers/table-fit.mjs +55 -10
  525. package/dist/react/renderers/table-measure.mjs +29 -9
  526. package/dist/react/renderers/table-row.mjs +14 -9
  527. package/dist/react/renderers/table-scale.mjs +2 -3
  528. package/dist/react/renderers/table-sort.mjs +3 -2
  529. package/dist/react/renderers/table-whole.mjs +37 -0
  530. package/dist/react/renderers/table.mjs +73 -53
  531. package/dist/react/review.d.mts +7 -0
  532. package/dist/react/review.mjs +35 -8
  533. package/dist/react/roving.d.mts +6 -0
  534. package/dist/react/roving.mjs +123 -0
  535. package/dist/react/says-dates.d.mts +7 -0
  536. package/dist/react/says-dates.mjs +51 -0
  537. package/dist/react/series.mjs +5 -6
  538. package/dist/react/stable.mjs +1 -1
  539. package/dist/react/tabs/EditTabs.mjs +125 -0
  540. package/dist/react/tabs/NameField.mjs +72 -0
  541. package/dist/react/tabs/TabMenu.mjs +175 -0
  542. package/dist/react/tabs/actions.mjs +37 -0
  543. package/dist/react/tabs/commands.mjs +76 -0
  544. package/dist/react/tabs/focus.mjs +22 -0
  545. package/dist/react/tabs/keys.mjs +28 -0
  546. package/dist/react/theme-unlayered.css +1 -1
  547. package/dist/react/theme.css +1 -1
  548. package/dist/react/tile-store.d.mts +4 -0
  549. package/dist/react/tile-store.mjs +93 -13
  550. package/dist/react/touch.d.mts +16 -0
  551. package/dist/react/touch.mjs +39 -0
  552. package/dist/react/useBoard.d.mts +6 -0
  553. package/dist/react/useBoard.mjs +1 -0
  554. package/dist/react/useDashboard.d.mts +2 -0
  555. package/dist/react/useDashboard.mjs +5 -2
  556. package/dist/react/useTiles.d.mts +3 -0
  557. package/dist/react/useTiles.mjs +73 -17
  558. package/dist/react/view-grid.mjs +2 -2
  559. package/dist/react/view.mjs +1 -1
  560. package/dist/recharts/axes.mjs +1 -1
  561. package/dist/recharts/axis.mjs +23 -73
  562. package/dist/recharts/bar.d.mts +2 -1
  563. package/dist/recharts/bar.mjs +140 -64
  564. package/dist/recharts/fit.mjs +33 -0
  565. package/dist/recharts/line.mjs +21 -15
  566. package/dist/recharts/marks.mjs +2 -1
  567. package/dist/recharts/parts.mjs +16 -13
  568. package/dist/recharts/table.mjs +8 -3
  569. package/dist/refusal.mjs +46 -0
  570. package/dist/registry/filter-bar.json +1 -1
  571. package/dist/skills/derive-dashboards/SKILL.md +23 -8
  572. package/dist/tile-doc.mjs +1 -1
  573. package/package.json +21 -6
  574. package/dist/charts-react/plan.d.mts +0 -3
  575. package/dist/charts-react/plan.mjs +0 -37
  576. package/dist/charts-react/tiles.d.mts +0 -24
  577. package/dist/core/policy/match.d.mts +0 -16
  578. package/dist/core/schema/aliases.d.mts +0 -7
  579. package/dist/core/time/compare.d.mts +0 -30
  580. package/dist/react/EditBar.d.mts +0 -16
  581. package/dist/react/History.d.mts +0 -30
  582. package/dist/react/ReviewPanel.d.mts +0 -15
  583. package/dist/react/digits.mjs +0 -46
  584. package/dist/react/drill/trend-touch.mjs +0 -33
  585. package/dist/react/renderers/exact.d.mts +0 -6
@@ -1,27 +1,8 @@
1
1
  import { ReaderPage } from "./reader-page.mjs";
2
+ import { readTable } from "./table.mjs";
2
3
  import { memo } from "react";
3
4
  import { jsx } from "react/jsx-runtime";
4
5
  // src/Reader.tsx
5
- /**
6
- * The table's columns: the scene's own when it says them (every series of a chart over time,
7
- * one with no value too), else the items', in the order they first appear. An item's key says
8
- * what its value is of and is the same at every stop, so it is the item's column; the column
9
- * is headed by the label of its first item. No two items of a stop share a key, so a cell
10
- * holds one value.
11
- */
12
- function columnsOf(hover) {
13
- if (hover.columns !== void 0) return hover.columns;
14
- const columns = /* @__PURE__ */ new Map();
15
- for (const item of hover.stops.flatMap((stop) => stop.items)) if (!columns.has(item.key)) columns.set(item.key, {
16
- key: item.key,
17
- label: item.label
18
- });
19
- return [...columns.values()];
20
- }
21
- /** An item's value and what it is read against. */
22
- const cellText = (item) => item.aside === void 0 ? item.value : `${item.value} (${item.aside})`;
23
- /** A stop's title as a row's heading, with what is said beside it. */
24
- const rowTitle = (stop) => stop.note === void 0 ? stop.title : `${stop.title} (${stop.note})`;
25
6
  /** These elements must stay outside the measured stage's flex layout, even without a theme. */
26
7
  const readerStyle = {
27
8
  position: "absolute",
@@ -35,83 +16,25 @@ const readerStyle = {
35
16
  whiteSpace: "nowrap",
36
17
  border: 0
37
18
  };
38
- /** The same axes the chart uses. A panel's stop is one cell, while a line stop holds a whole row. */
39
- function tableOf(scene) {
40
- const hover = scene.hover;
41
- if (hover === void 0) return {
42
- columns: [],
43
- rows: []
44
- };
45
- const { matrix, stops } = hover;
46
- if (matrix !== void 0) {
47
- const rows = matrix.rows.map((row) => ({
48
- ...row,
49
- cells: []
50
- }));
51
- for (const { cell, items } of stops) {
52
- const row = cell === void 0 ? void 0 : rows[cell[0]];
53
- const item = items[0];
54
- if (row !== void 0 && cell !== void 0 && item !== void 0) row.cells[cell[1]] = cellText(item);
55
- }
56
- return {
57
- columns: matrix.columns,
58
- rows,
59
- heading: matrix.heading
60
- };
61
- }
62
- const columns = columnsOf(hover);
63
- const slots = new Map(columns.map((c, i) => [c.key, i]));
64
- return {
65
- columns,
66
- rows: stops.map((stop) => {
67
- const cells = [];
68
- for (const item of stop.items) {
69
- const i = slots.get(item.key);
70
- if (i !== void 0) cells[i] = cellText(item);
71
- }
72
- return {
73
- key: stop.key,
74
- label: rowTitle(stop),
75
- cells
76
- };
77
- })
78
- };
79
- }
80
- const TABLES = /* @__PURE__ */ new WeakMap();
81
- function readTable(scene) {
82
- const known = TABLES.get(scene);
83
- if (known !== void 0) return known;
84
- const table = tableOf(scene);
85
- TABLES.set(scene, table);
86
- return table;
87
- }
88
19
  function TableOfScene({ scene, caption, noValue = "", pages }) {
89
- const data = readTable(scene);
90
- if (data.rows.length === 0) return null;
20
+ const table = readTable(scene);
21
+ if (table.size === 0) return null;
91
22
  return /* @__PURE__ */ jsx(ReaderPage, {
92
- data,
23
+ table,
93
24
  caption,
94
25
  noValue,
95
26
  words: pages,
96
27
  hidden: readerStyle
97
28
  });
98
29
  }
99
- const sameHeading = (a, b) => a.key === b?.key && a.label === b.label;
100
- function sameWords(a, b) {
101
- if (a.heading !== b.heading || a.rows.length !== b.rows.length || a.columns.length !== b.columns.length) return false;
102
- if (!a.columns.every((c, i) => sameHeading(c, b.columns[i]))) return false;
103
- return a.rows.every((row, i) => {
104
- const other = b.rows[i];
105
- return sameHeading(row, other) && a.columns.every((_c, j) => row.cells[j] === other?.cells[j]);
106
- });
107
- }
108
- const sameTable = (a, b) => a.pages === b.pages && a.caption === b.caption && a.noValue === b.noValue && (a.scene === b.scene || sameWords(readTable(a.scene), readTable(b.scene)));
109
30
  /**
110
- * The hidden table, made again only when it would read differently. A pointer moving over the
111
- * chart lights a new stop many times a second, and a box that changes size is drawn again at
112
- * each step with the same words in it: the table is most of a chart's elements, and neither
113
- * makes it again.
31
+ * Whether the hidden table would be drawn from the same things. A pointer moving over the chart
32
+ * lights a new stop many times a second, and the table is not drawn again for it. A scene drawn
33
+ * again at a new size is a new table, but only its page is drawn: a page is at most 512 cells,
34
+ * whatever the size of the chart, so no settled resize compares or rebuilds the whole table.
114
35
  */
36
+ const sameTable = (a, b) => a.scene === b.scene && a.pages === b.pages && a.caption === b.caption && a.noValue === b.noValue;
37
+ /** The hidden table, drawn again only when its scene or its words change. */
115
38
  const SceneTable = memo(TableOfScene, sameTable);
116
39
  /** An item as a phrase: its name, its value, and what it is read against. */
117
40
  const itemText = (item) => [`${item.label} ${item.value}`, item.aside].filter((part) => part !== void 0).join(", ");
@@ -119,21 +42,52 @@ const itemText = (item) => [`${item.label} ${item.value}`, item.aside].filter((p
119
42
  const headOf = (stop) => stop.note === void 0 ? stop.title : `${stop.title}, ${stop.note}`;
120
43
  /** Phrases as sentences, each closed by a full stop unless it already ends one. */
121
44
  const sentences = (phrases) => phrases.reduce((text, phrase) => text === "" ? phrase : `${text}${/[.!?]$/u.test(text) ? "" : "."} ${phrase}`, "");
45
+ /** A phrase per column of a stop's row: its value, or the column's name and `noValue`. */
46
+ function rowPhrases(stop, table, noValue) {
47
+ return table.columns.map((column) => {
48
+ const item = stop.items.find((one) => one.key === column.key);
49
+ return {
50
+ key: column.key,
51
+ phrase: item === void 0 ? `${column.label} ${noValue}` : itemText(item)
52
+ };
53
+ });
54
+ }
55
+ /**
56
+ * A stop's values as its row of the table has them: every column, a missing value said as
57
+ * `noValue`; a grid's stop is one cell, said as its one value; a stop with none says `noValue`.
58
+ */
59
+ function valuesAt(stop, saying) {
60
+ const noValue = saying.noValue ?? "";
61
+ const table = saying.scene === void 0 ? void 0 : readTable(saying.scene);
62
+ if (table !== void 0 && stop.cell === void 0 && table.columns.length > 0) return rowPhrases(stop, table, noValue);
63
+ if (stop.items.length > 0) return stop.items.map((item) => ({
64
+ key: item.key,
65
+ phrase: itemText(item)
66
+ }));
67
+ return noValue === "" ? [] : [{
68
+ key: "",
69
+ phrase: noValue
70
+ }];
71
+ }
122
72
  /**
123
73
  * What the live region says: nothing for a stop the pointer lit, so a mouse is silent; the stop
124
- * a key moved to, value by value, or `noValue` at a stop with none (a gap), as the table writes
125
- * it; or, when a key across the way the stops run chose another value in it, that value. The
126
- * value chosen is said in its spoken form when it has one (`said`: what a screen reader hears
127
- * for a value that opens, which names it and says it opens), else as it reads.
74
+ * a key moved to, then every value of its row in the table, in the table's order, the legend's
75
+ * (`noValue` where a series has none, as the table writes it); or, when a key across the way
76
+ * the stops run chose another value in it, that value. The value chosen is said in its spoken
77
+ * form when it has one (`said`: what a screen reader hears for a value that opens, which names
78
+ * it and says it opens), and last, so what it says to do comes after every value, not between
79
+ * two: in its place when it is the row's last value, else after the row, which keeps its order.
128
80
  */
129
81
  function liveText(lit, stop, saying = {}) {
130
82
  if (lit?.via !== "key" || stop === void 0) return "";
131
- const { said, noValue = "" } = saying;
132
83
  const chosen = stop.items[lit.item];
133
- const phrase = (item) => item === chosen ? said ?? itemText(item) : itemText(item);
134
- if (lit.moved === "item" && chosen !== void 0) return phrase(chosen);
135
- const values = stop.items.length === 0 ? [noValue] : stop.items.map((item) => phrase(item));
136
- return sentences([headOf(stop), ...values.filter((value) => value !== "")]);
84
+ if (lit.moved === "item" && chosen !== void 0) return saying.said ?? itemText(chosen);
85
+ return sentences([headOf(stop), ...rowSaid(valuesAt(stop, saying), chosen, saying.said)]);
86
+ }
87
+ /** A row's phrases, the chosen value's spoken form last: in its place when it ends the row, else after it. */
88
+ function rowSaid(values, chosen, said) {
89
+ if (said === void 0 || chosen === void 0) return values.map((value) => value.phrase);
90
+ return [...(values.at(-1)?.key === chosen.key ? values.slice(0, -1) : values).map((value) => value.phrase), said];
137
91
  }
138
92
  /** The polite live region a chart says its keyboard moves in. */
139
93
  function Live({ said }) {
@@ -0,0 +1,106 @@
1
+ // src/box.ts
2
+ /**
3
+ * The stage holds the picture and the layer over it, and takes the room the box has left over
4
+ * what is under it. No line box under the picture: an inline SVG would sit on a text baseline,
5
+ * a few pixels up.
6
+ */
7
+ const STAGE = {
8
+ position: "relative",
9
+ lineHeight: 0,
10
+ flex: "1 1 0",
11
+ minHeight: 0,
12
+ overflow: "clip"
13
+ };
14
+ /**
15
+ * A stage with stops to move through keeps a finger's sideways drag for itself, to move the
16
+ * tooltip along, and leaves the page its scroll up and down and its pinch.
17
+ */
18
+ const SCRUBBED = {
19
+ ...STAGE,
20
+ touchAction: "pan-y pinch-zoom"
21
+ };
22
+ /** The most a chart that fits its picture grows, where no theme says: about sixteen rows. */
23
+ const FIT_MOST = "var(--dd-fit-most, 560px)";
24
+ /**
25
+ * The height the picture asks for (`asked`), when the chart is told to fit and its kind says
26
+ * one; a height the chart is given is kept instead. A `draw` of the host's own may say a
27
+ * height that is none (not a number, not finite, nothing or less): the chart then fills its
28
+ * box, as one that asks for no height does.
29
+ */
30
+ function fittedOf(props, asked) {
31
+ if (props.fit !== true || props.height !== void 0 || asked === void 0) return void 0;
32
+ return Number.isFinite(asked) && asked > 0 ? asked : void 0;
33
+ }
34
+ /**
35
+ * The least height of a chart of rows' stage: the height that draws every row where a stylesheet
36
+ * lets the chart grow (`--dd-chart-grow: 1`, as the theme sets on a dashboard's tile on a phone),
37
+ * else none.
38
+ */
39
+ const grownOf = (scene) => scene?.wants === void 0 ? {} : { minHeight: `calc(var(--dd-chart-grow, 0) * ${String(scene.wants)}px)` };
40
+ /**
41
+ * The stage, of a fixed height when one is given or asked for: the picture's own, not shared
42
+ * with what is under it. A height the picture asks for stops at the most a tile grows.
43
+ */
44
+ function stageOf(props, at) {
45
+ const stage = {
46
+ ...(at.scene?.hover?.stops.length ?? 0) > 0 ? SCRUBBED : STAGE,
47
+ ...grownOf(at.scene)
48
+ };
49
+ if (props.height !== void 0) return {
50
+ ...stage,
51
+ flex: "none",
52
+ height: props.height
53
+ };
54
+ const fitted = fittedOf(props, at.asked);
55
+ if (fitted === void 0) return stage;
56
+ return {
57
+ ...stage,
58
+ flex: "none",
59
+ height: Math.ceil(fitted),
60
+ maxHeight: FIT_MOST
61
+ };
62
+ }
63
+ /**
64
+ * How the box says what sizes it: `data-fit` when it is as tall as its picture asks, and
65
+ * `data-rows` when it is a chart of rows with a height of its own (`Scene.wants`), which a
66
+ * stylesheet sizes its box to.
67
+ */
68
+ const sizedBy = (fitted, said) => ({
69
+ "data-fit": fitted === void 0 ? void 0 : "content",
70
+ "data-rows": said?.wants === void 0 ? void 0 : true
71
+ });
72
+ /**
73
+ * The chart's box, named as the theme names a chart (`dd-chart`): named by the summary,
74
+ * described by how to move through its values that open when some do, one tab stop when it has
75
+ * stops to move through. Its stage has its height before anything is drawn in it, so the page
76
+ * does not jump. It is marked drillable as the theme marks a chart (`data-drillable`: some value of it
77
+ * opens), and `data-opens` while the value the lit stop means opens; `data-rows` when it is a
78
+ * chart of rows, with a height of its own to be sized to. It is a column: the stage, then what
79
+ * is shown under it (a tile's note), and in a column of its own it takes the room left.
80
+ */
81
+ function boxOf(at) {
82
+ const { props, described } = at;
83
+ const stops = at.said?.hover?.stops.length ?? 0;
84
+ const fitted = fittedOf(props, at.asked);
85
+ const own = props.height !== void 0 || fitted !== void 0;
86
+ return {
87
+ className: props.className === void 0 ? "dd-chart" : `dd-chart ${props.className}`,
88
+ "aria-label": at.said?.summary,
89
+ "aria-describedby": described,
90
+ tabIndex: stops > 0 ? 0 : void 0,
91
+ "data-drillable": at.drillable,
92
+ "data-opens": at.open,
93
+ ...sizedBy(fitted, at.said),
94
+ style: {
95
+ position: "relative",
96
+ display: "flex",
97
+ flexDirection: "column",
98
+ flex: "1 1 auto",
99
+ minHeight: 0,
100
+ minWidth: 0,
101
+ height: own ? "auto" : "100%",
102
+ width: props.width
103
+ }
104
+ };
105
+ }
106
+ export { boxOf, stageOf };
@@ -1,29 +1,14 @@
1
- import { formatBucket, formatInstantAt } from "derive-dashboards/react";
1
+ import { formatBucket } from "derive-dashboards/react";
2
2
  // src/bucket-names.ts
3
- /** The zone's short name at an instant ("PDT"), in the locale; none when Intl gives none. */
4
- function zoneNamer(at) {
5
- const format = new Intl.DateTimeFormat(at.locale, {
6
- timeZoneName: "short",
7
- ...at.zone === void 0 ? {} : { timeZone: at.zone }
8
- });
9
- return (from) => format.formatToParts(new Date(from)).find((part) => part.type === "timeZoneName")?.value;
10
- }
11
- /** Each hour's name, with its zone's short name where another hour of the list reads alike. */
12
- function hoursApart(placed, at) {
13
- const titles = placed.map((p) => formatInstantAt(p.given.from, "hour", at.locale, at.zone));
14
- const counts = /* @__PURE__ */ new Map();
15
- for (const title of titles) counts.set(title, (counts.get(title) ?? 0) + 1);
16
- const zoneAt = zoneNamer(at);
17
- return titles.map((title, i) => {
18
- const from = placed[i]?.bucket.from;
19
- const zone = from === void 0 || (counts.get(title) ?? 0) < 2 ? void 0 : zoneAt(from);
20
- return zone === void 0 ? title : `${title} ${zone}`;
21
- });
22
- }
23
3
  /** Every bucket's whole name, in the order given. */
24
4
  function titlesOf(placed, at) {
25
- if (at.grain === "hour") return hoursApart(placed, at);
26
- if (placed[0]?.given.label.slice(0, 4) !== placed.at(-1)?.given.label.slice(0, 4) && (at.grain === "day" || at.grain === "week")) return placed.map((p) => formatBucket(p.given.label, at.grain, at.locale, true));
27
- return placed.map((p) => p.name);
5
+ const years = placed[0]?.given.label.slice(0, 4) !== placed.at(-1)?.given.label.slice(0, 4);
6
+ const dated = years && (at.grain === "day" || at.grain === "week");
7
+ if (at.grain !== "hour" && !dated) return placed.map((p) => p.name);
8
+ const bucketAt = {
9
+ timeZone: at.zone,
10
+ withYear: years
11
+ };
12
+ return placed.map((p) => formatBucket(p.given.label, at.grain, at.locale, bucketAt));
28
13
  }
29
14
  export { titlesOf };
@@ -0,0 +1,12 @@
1
+ import { columnChart } from "derive-dashboards/charts";
2
+ // src/columns-picture.ts
3
+ /**
4
+ * Columns over time, as a bar tile and a funnel over time draw them. They stack only the parts
5
+ * of a split, as the Recharts tile does: separate measures stand side by side, for a column of
6
+ * Tasks on Hours would reach a total that means nothing.
7
+ */
8
+ const COLUMNS = { picture: (_props, drawn) => ({
9
+ drew: "bar",
10
+ draw: (table, env) => columnChart(table, drawn.split ? {} : { arrange: "grouped" }, env)
11
+ }) };
12
+ export { COLUMNS };
@@ -1,15 +1,12 @@
1
- import { formatExact, parseExact, sumLinear } from "derive-dashboards/core";
2
- import { exactDigits } from "derive-dashboards/react";
1
+ import { cellDigits, decimalPlaces, formatExact, parseExact, sumLinear } from "derive-dashboards/core";
3
2
  // src/exact-sum.ts
4
- /** How many places after the point a decimal text has. */
5
- const placesOf = (text) => text.split(".")[1]?.length ?? 0;
6
3
  /**
7
4
  * The exact sum of some cells, as a decimal cell at the longest scale among them; undefined when
8
- * there are none, or one has no exact digits (a float that is not whole).
5
+ * there are none, or one has no number (a mark, a text that is no number).
9
6
  */
10
7
  function exactSum(cells) {
11
- const texts = cells.map((cell) => exactDigits(cell));
12
- const scale = Math.max(0, ...texts.map((text) => text === void 0 ? 0 : placesOf(text)));
8
+ const texts = cells.map((cell) => cellDigits(cell));
9
+ const scale = Math.max(0, ...texts.map((text) => text === void 0 ? 0 : decimalPlaces(text)));
13
10
  const parts = texts.flatMap((text) => {
14
11
  const part = text === void 0 ? void 0 : parseExact(text, scale);
15
12
  return part === void 0 ? [] : [[part]];
@@ -1,7 +1,7 @@
1
1
  import { titlesOf } from "./bucket-names.mjs";
2
2
  import { exactSum } from "./exact-sum.mjs";
3
3
  import { keyedPoints } from "./point-keys.mjs";
4
- import { addsUp, parseTextTime } from "derive-dashboards/core";
4
+ import { addsUp, durationUnits, parseTextTime } from "derive-dashboards/core";
5
5
  import { OTHER_KEY, formatCell, formatTick, pointCell, pointText } from "derive-dashboards/react";
6
6
  // src/from-answer.ts
7
7
  /**
@@ -13,9 +13,14 @@ import { OTHER_KEY, formatCell, formatTick, pointCell, pointText } from "derive-
13
13
  * split are summed or stacked only where it says so, never for an answer that does not say.
14
14
  */
15
15
  function measureOf(column, format) {
16
+ const units = durationUnits(column);
16
17
  return {
17
18
  label: column.label,
18
- tick: (value) => formatTick(value, column, format.locale),
19
+ tick: (value, beside) => formatTick(value, beside === void 0 ? column : {
20
+ ...column,
21
+ beside
22
+ }, format.locale),
23
+ ...units === void 0 ? {} : { units },
19
24
  text: (value) => formatCell(value, column, format),
20
25
  ...column.type === "int" ? { whole: true } : {},
21
26
  additive: addsUp(column),
@@ -28,7 +33,7 @@ function measureOf(column, format) {
28
33
  */
29
34
  function millisOf(text) {
30
35
  const micros = parseTextTime(text);
31
- return micros === void 0 ? void 0 : micros / 1e3;
36
+ return micros === void 0 ? void 0 : Number(micros) / 1e3;
32
37
  }
33
38
  /**
34
39
  * A point's time bucket as the charts read it, or undefined when it is missing or unreadable.
@@ -59,7 +64,7 @@ function chartSeries(drawn, s, at) {
59
64
  measure: measureOf(s.column, at.format),
60
65
  values: at.points.map((i) => {
61
66
  const value = drawn.points[i]?.[s.key];
62
- return typeof value === "number" ? value : null;
67
+ return typeof value === "number" && Number.isFinite(value) ? value : null;
63
68
  }),
64
69
  texts: at.points.map((point) => pointText(at.answer, drawn, {
65
70
  point,
@@ -1,3 +1,10 @@
1
1
  import { Chart, ChartProps } from "./Chart.mjs";
2
- import { AreaTile, BarTile, CHARTS_RENDERERS, FunnelTile, HeatmapTile, LineTile, MultiplesTile } from "./tiles.mjs";
3
- export { AreaTile, BarTile, CHARTS_RENDERERS, Chart, type ChartProps, FunnelTile, HeatmapTile, LineTile, MultiplesTile };
2
+ import { AreaTile } from "./kinds/area.mjs";
3
+ import { BarTile } from "./kinds/bar.mjs";
4
+ import { FunnelTile } from "./kinds/funnel.mjs";
5
+ import { HeatmapTile } from "./kinds/heatmap.mjs";
6
+ import { LineTile } from "./kinds/line.mjs";
7
+ import { MultiplesTile } from "./kinds/multiples.mjs";
8
+ import { NumberTile } from "./kinds/number.mjs";
9
+ import { CHARTS_RENDERERS } from "./renderers.mjs";
10
+ export { AreaTile, BarTile, CHARTS_RENDERERS, Chart, type ChartProps, FunnelTile, HeatmapTile, LineTile, MultiplesTile, NumberTile };
@@ -1,4 +1,11 @@
1
1
  "use client";
2
2
  import { Chart } from "./Chart.mjs";
3
- import { AreaTile, BarTile, CHARTS_RENDERERS, FunnelTile, HeatmapTile, LineTile, MultiplesTile } from "./tiles.mjs";
4
- export { AreaTile, BarTile, CHARTS_RENDERERS, Chart, FunnelTile, HeatmapTile, LineTile, MultiplesTile };
3
+ import { AreaTile } from "./kinds/area.mjs";
4
+ import { BarTile } from "./kinds/bar.mjs";
5
+ import { FunnelTile } from "./kinds/funnel.mjs";
6
+ import { HeatmapTile } from "./kinds/heatmap.mjs";
7
+ import { LineTile } from "./kinds/line.mjs";
8
+ import { MultiplesTile } from "./kinds/multiples.mjs";
9
+ import { NumberTile } from "./kinds/number.mjs";
10
+ import { CHARTS_RENDERERS } from "./renderers.mjs";
11
+ export { AreaTile, BarTile, CHARTS_RENDERERS, Chart, FunnelTile, HeatmapTile, LineTile, MultiplesTile, NumberTile };
@@ -0,0 +1,4 @@
1
+ import "../plan-parts.mjs";
2
+ import { TileRendererProps } from "derive-dashboards/react";
3
+ /** Values over time as a stacked area where they add up, lines where they do not; by category, bars. */
4
+ export declare const AreaTile: (props: TileRendererProps) => import("react").JSX.Element;
@@ -0,0 +1,38 @@
1
+ import { byCategory } from "../plan-bars.mjs";
2
+ import { planner } from "../plan-of.mjs";
3
+ import { overTime } from "../plan-time.mjs";
4
+ import { Tile } from "../tiles.mjs";
5
+ import { areaChart, areaDraws, lineChart } from "derive-dashboards/charts";
6
+ import { jsx } from "react/jsx-runtime";
7
+ import { displayOf } from "derive-dashboards/core";
8
+ // src/kinds/area.tsx
9
+ /** Whether some value is below zero: such a table has no shares of a whole to read. */
10
+ const anyLoss = (data) => data.series.some((s) => s.values.some((value) => value !== null && value < 0));
11
+ /**
12
+ * What an area tile draws. Bands are the parts of one split, or one series alone: separate
13
+ * measures (Tasks and Hours) are lines, for a band of one on the other would reach a height,
14
+ * and a share of both, that means nothing. The chart itself draws lines of values that do not
15
+ * add up, and columns of one period or of a series that changes sign (`areaDraws`), so the
16
+ * tile names the picture that is drawn, not the one asked for. Shares are read only of parts
17
+ * none of which is a loss: a share of a whole with a loss in it is no share.
18
+ */
19
+ const AREA = { picture: (props, drawn, data) => {
20
+ if (!drawn.split && data.series.length > 1) return {
21
+ drew: "line",
22
+ draw: (table, env) => lineChart(table, {}, env)
23
+ };
24
+ const share = displayOf("area", props.widget.display).share === true && !anyLoss(data) && data.series.some((s) => s.values.some((v) => v !== null && v > 0));
25
+ const form = areaDraws(data);
26
+ return {
27
+ drew: form === "area" ? "area" : form === "lines" ? "line" : "bar",
28
+ draw: (table, env) => areaChart(table, share ? { arrange: "share" } : {}, env)
29
+ };
30
+ } };
31
+ /** What an area tile draws of its answer. */
32
+ const areaPlan = planner("area", (props, drawn, from) => overTime(props, drawn, AREA, from) ?? byCategory(props, drawn, "area", from));
33
+ /** Values over time as a stacked area where they add up, lines where they do not; by category, bars. */
34
+ const AreaTile = (props) => /* @__PURE__ */ jsx(Tile, {
35
+ props,
36
+ plan: areaPlan
37
+ });
38
+ export { AreaTile, areaPlan };
@@ -0,0 +1,4 @@
1
+ import "../plan-parts.mjs";
2
+ import { TileRendererProps } from "derive-dashboards/react";
3
+ /** Values over time as columns; by category, ranked bars, each with a tick where the widget names what it is read against. */
4
+ export declare const BarTile: (props: TileRendererProps) => import("react").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { COLUMNS } from "../columns-picture.mjs";
2
+ import { byCategory } from "../plan-bars.mjs";
3
+ import { planner } from "../plan-of.mjs";
4
+ import { overTime } from "../plan-time.mjs";
5
+ import { Tile } from "../tiles.mjs";
6
+ import { jsx } from "react/jsx-runtime";
7
+ // src/kinds/bar.tsx
8
+ /** What a bar tile draws of its answer. */
9
+ const barPlan = planner("bar", (props, drawn, from) => overTime(props, drawn, COLUMNS, from) ?? byCategory(props, drawn, "bar", from));
10
+ /** Values over time as columns; by category, ranked bars, each with a tick where the widget names what it is read against. */
11
+ const BarTile = (props) => /* @__PURE__ */ jsx(Tile, {
12
+ props,
13
+ plan: barPlan
14
+ });
15
+ export { BarTile, barPlan };
@@ -0,0 +1,4 @@
1
+ import "../plan-parts.mjs";
2
+ import { TileRendererProps } from "derive-dashboards/react";
3
+ /** Steps in order, each read against the first and the one before it. */
4
+ export declare const FunnelTile: (props: TileRendererProps) => import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { funnelPlan as funnelPlan$1 } from "../plan-funnel.mjs";
2
+ import { planner } from "../plan-of.mjs";
3
+ import { Tile } from "../tiles.mjs";
4
+ import { jsx } from "react/jsx-runtime";
5
+ // src/kinds/funnel.tsx
6
+ /** What a funnel tile draws of its answer. */
7
+ const funnelPlan = planner("funnel", funnelPlan$1);
8
+ /** Steps in order, each read against the first and the one before it. */
9
+ const FunnelTile = (props) => /* @__PURE__ */ jsx(Tile, {
10
+ props,
11
+ plan: funnelPlan
12
+ });
13
+ export { FunnelTile, funnelPlan };
@@ -0,0 +1,4 @@
1
+ import "../plan-parts.mjs";
2
+ import { TileRendererProps } from "derive-dashboards/react";
3
+ /** One value by two fields, each cell shaded by its value. */
4
+ export declare const HeatmapTile: (props: TileRendererProps) => import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { gridPlan } from "../plan-grid.mjs";
2
+ import { planner } from "../plan-of.mjs";
3
+ import { Tile } from "../tiles.mjs";
4
+ import { jsx } from "react/jsx-runtime";
5
+ // src/kinds/heatmap.tsx
6
+ /** What a heatmap tile draws of its answer. */
7
+ const heatmapPlan = planner("heatmap", gridPlan);
8
+ /** One value by two fields, each cell shaded by its value. */
9
+ const HeatmapTile = (props) => /* @__PURE__ */ jsx(Tile, {
10
+ props,
11
+ plan: heatmapPlan
12
+ });
13
+ export { HeatmapTile, heatmapPlan };
@@ -0,0 +1,4 @@
1
+ import "../plan-parts.mjs";
2
+ import { TileRendererProps } from "derive-dashboards/react";
3
+ /** Values over time as lines; by category, bars in the answer's order. */
4
+ export declare const LineTile: (props: TileRendererProps) => import("react").JSX.Element;
@@ -0,0 +1,20 @@
1
+ import { byCategory } from "../plan-bars.mjs";
2
+ import { planner } from "../plan-of.mjs";
3
+ import { overTime } from "../plan-time.mjs";
4
+ import { Tile } from "../tiles.mjs";
5
+ import { lineChart } from "derive-dashboards/charts";
6
+ import { jsx } from "react/jsx-runtime";
7
+ // src/kinds/line.tsx
8
+ /** Lines over time, each series on the first unit's axis. */
9
+ const LINES = { picture: () => ({
10
+ drew: "line",
11
+ draw: (table, env) => lineChart(table, {}, env)
12
+ }) };
13
+ /** What a line tile draws of its answer. */
14
+ const linePlan = planner("line", (props, drawn, from) => overTime(props, drawn, LINES, from) ?? byCategory(props, drawn, "line", from));
15
+ /** Values over time as lines; by category, bars in the answer's order. */
16
+ const LineTile = (props) => /* @__PURE__ */ jsx(Tile, {
17
+ props,
18
+ plan: linePlan
19
+ });
20
+ export { LineTile, linePlan };
@@ -0,0 +1,4 @@
1
+ import "../plan-parts.mjs";
2
+ import { TileRendererProps } from "derive-dashboards/react";
3
+ /** A small chart for each series over time, on one scale; by category, bars. */
4
+ export declare const MultiplesTile: (props: TileRendererProps) => import("react").JSX.Element;
@@ -0,0 +1,33 @@
1
+ import { byCategory } from "../plan-bars.mjs";
2
+ import { planner } from "../plan-of.mjs";
3
+ import { overTime } from "../plan-time.mjs";
4
+ import { Tile } from "../tiles.mjs";
5
+ import { multiplesChart } from "derive-dashboards/charts";
6
+ import { jsx } from "react/jsx-runtime";
7
+ import { displayOf } from "derive-dashboards/core";
8
+ // src/kinds/multiples.tsx
9
+ /** A small chart per series; a stop is keyed by its series and its bucket. */
10
+ const PANELS = {
11
+ panels: true,
12
+ picture: (props) => {
13
+ const own = displayOf("multiples", props.widget.display).ownScales === true;
14
+ return {
15
+ drew: "multiples",
16
+ draw: (table, env) => multiplesChart(table, { shared: !own }, env)
17
+ };
18
+ }
19
+ };
20
+ /** What a multiples tile draws of its answer. */
21
+ const multiplesPlan = planner("multiples", (props, drawn, from) => {
22
+ const plan = overTime(props, drawn, PANELS, from);
23
+ return plan === void 0 ? byCategory(props, drawn, "multiples", from) : {
24
+ ...plan,
25
+ panels: true
26
+ };
27
+ });
28
+ /** A small chart for each series over time, on one scale; by category, bars. */
29
+ const MultiplesTile = (props) => /* @__PURE__ */ jsx(Tile, {
30
+ props,
31
+ plan: multiplesPlan
32
+ });
33
+ export { MultiplesTile, multiplesPlan };
@@ -0,0 +1,5 @@
1
+ import "../plan-parts.mjs";
2
+ import { TileRendererProps } from "derive-dashboards/react";
3
+ /** A number, and beside it the course of the value it shows large, when it has one. */
4
+ declare function NumberTile$1(props: TileRendererProps): import("react").JSX.Element;
5
+ export { NumberTile$1 as NumberTile };