derive-dashboards 0.7.1 → 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 (591) 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 +86 -44
  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 -32
  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 +51 -9
  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 +12 -6
  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/marks/x-axis.mjs +3 -2
  109. package/dist/charts/scale/calendar.mjs +41 -26
  110. package/dist/charts/scale/linear.mjs +58 -0
  111. package/dist/charts/scale/value.d.mts +21 -0
  112. package/dist/charts/scale/value.mjs +67 -9
  113. package/dist/charts/scene/lazy.mjs +27 -0
  114. package/dist/charts/scene/markup.mjs +2 -1
  115. package/dist/charts/scene/svg.mjs +20 -8
  116. package/dist/charts/scene/types.d.mts +34 -0
  117. package/dist/charts/text/measure.mjs +33 -3
  118. package/dist/charts/theme.d.mts +25 -25
  119. package/dist/charts/theme.mjs +47 -30
  120. package/dist/charts-react/Chart.d.mts +20 -0
  121. package/dist/charts-react/Chart.mjs +9 -67
  122. package/dist/charts-react/Reader.mjs +50 -96
  123. package/dist/charts-react/box.mjs +106 -0
  124. package/dist/charts-react/bucket-names.mjs +9 -24
  125. package/dist/charts-react/columns-picture.mjs +12 -0
  126. package/dist/charts-react/exact-sum.mjs +4 -7
  127. package/dist/charts-react/from-answer.mjs +9 -4
  128. package/dist/charts-react/index.d.mts +9 -2
  129. package/dist/charts-react/index.mjs +9 -2
  130. package/dist/charts-react/kinds/area.d.mts +4 -0
  131. package/dist/charts-react/kinds/area.mjs +38 -0
  132. package/dist/charts-react/kinds/bar.d.mts +4 -0
  133. package/dist/charts-react/kinds/bar.mjs +15 -0
  134. package/dist/charts-react/kinds/funnel.d.mts +4 -0
  135. package/dist/charts-react/kinds/funnel.mjs +13 -0
  136. package/dist/charts-react/kinds/heatmap.d.mts +4 -0
  137. package/dist/charts-react/kinds/heatmap.mjs +13 -0
  138. package/dist/charts-react/kinds/line.d.mts +4 -0
  139. package/dist/charts-react/kinds/line.mjs +20 -0
  140. package/dist/charts-react/kinds/multiples.d.mts +4 -0
  141. package/dist/charts-react/kinds/multiples.mjs +33 -0
  142. package/dist/charts-react/kinds/number.d.mts +5 -0
  143. package/dist/charts-react/kinds/number.mjs +86 -0
  144. package/dist/charts-react/plan-bars.mjs +15 -8
  145. package/dist/charts-react/plan-funnel.mjs +3 -1
  146. package/dist/charts-react/plan-grid.mjs +14 -5
  147. package/dist/charts-react/plan-of.mjs +17 -0
  148. package/dist/charts-react/plan-parts.mjs +16 -5
  149. package/dist/charts-react/plan-time.mjs +4 -53
  150. package/dist/charts-react/reader-page.d.mts +1 -1
  151. package/dist/charts-react/reader-page.mjs +19 -9
  152. package/dist/charts-react/renderers.d.mts +14 -0
  153. package/dist/charts-react/renderers.mjs +22 -0
  154. package/dist/charts-react/table.d.mts +1 -0
  155. package/dist/charts-react/table.mjs +108 -0
  156. package/dist/charts-react/tiles.mjs +21 -49
  157. package/dist/charts-react/useScene.mjs +45 -17
  158. package/dist/charts-react/words.mjs +19 -0
  159. package/dist/checks.mjs +97 -19
  160. package/dist/cli/add.mjs +4 -3
  161. package/dist/cli/doctor.mjs +2 -2
  162. package/dist/core/conformance/index.d.mts +5 -2
  163. package/dist/core/conformance/index.mjs +5 -2
  164. package/dist/core/conformance/memory/aggregate.mjs +11 -6
  165. package/dist/core/conformance/memory/rows.d.mts +7 -3
  166. package/dist/core/conformance/memory/rows.mjs +19 -13
  167. package/dist/core/conformance/memory/source.mjs +4 -4
  168. package/dist/core/document/control-fields.d.mts +20 -0
  169. package/dist/core/document/control-fields.mjs +117 -0
  170. package/dist/core/document/display-comparisons.d.mts +17 -0
  171. package/dist/core/document/display-comparisons.mjs +15 -4
  172. package/dist/core/document/display-entries.d.mts +14 -0
  173. package/dist/core/document/display-entries.mjs +25 -9
  174. package/dist/core/document/display-validation.d.mts +5 -1
  175. package/dist/core/document/display-validation.mjs +14 -7
  176. package/dist/core/document/display.d.mts +11 -8
  177. package/dist/core/document/display.mjs +26 -3
  178. package/dist/core/document/layout.d.mts +8 -9
  179. package/dist/core/document/layout.mjs +23 -6
  180. package/dist/core/document/stacked.d.mts +0 -7
  181. package/dist/core/document/types.mjs +8 -6
  182. package/dist/core/document/upgrade.d.mts +1 -0
  183. package/dist/core/document/upgrade.mjs +4 -2
  184. package/dist/core/engine/access.mjs +3 -3
  185. package/dist/core/engine/assert.mjs +4 -2
  186. package/dist/core/engine/bucket.mjs +2 -2
  187. package/dist/core/engine/checks.mjs +6 -7
  188. package/dist/core/engine/custom/ask.mjs +22 -2
  189. package/dist/core/engine/custom/cells.mjs +22 -22
  190. package/dist/core/engine/custom/level.mjs +12 -13
  191. package/dist/core/engine/custom/measures.mjs +12 -9
  192. package/dist/core/engine/custom/reader.mjs +3 -1
  193. package/dist/core/engine/custom/records.mjs +8 -7
  194. package/dist/core/engine/custom/unread.mjs +78 -0
  195. package/dist/core/engine/custom/where.mjs +15 -10
  196. package/dist/core/engine/index.d.mts +2 -13
  197. package/dist/core/engine/index.mjs +2 -12
  198. package/dist/core/engine/measure.mjs +1 -0
  199. package/dist/core/engine/members.mjs +7 -3
  200. package/dist/core/engine/nan.mjs +10 -1
  201. package/dist/core/engine/native.mjs +2 -20
  202. package/dist/core/engine/numbers.mjs +26 -14
  203. package/dist/core/engine/postgres.mjs +9 -5
  204. package/dist/core/engine/prepare.mjs +4 -4
  205. package/dist/core/engine/rank-sets.mjs +1 -1
  206. package/dist/core/engine/read.mjs +5 -4
  207. package/dist/core/engine/reader.d.mts +6 -0
  208. package/dist/core/engine/record-layout.mjs +3 -3
  209. package/dist/core/engine/run.mjs +77 -20
  210. package/dist/core/engine/segmented.d.mts +2 -1
  211. package/dist/core/engine/segmented.mjs +19 -12
  212. package/dist/core/engine/series.mjs +1 -1
  213. package/dist/core/engine/shape.mjs +8 -8
  214. package/dist/core/engine/sql-partition.mjs +2 -2
  215. package/dist/core/engine/sql-pass.mjs +3 -2
  216. package/dist/core/engine/sql-reader.mjs +13 -5
  217. package/dist/core/engine/sql-reads.mjs +2 -1
  218. package/dist/core/engine/sql-records.mjs +2 -2
  219. package/dist/core/engine/sql-split.mjs +1 -1
  220. package/dist/core/engine/sql-unread.mjs +70 -0
  221. package/dist/core/engine/time.mjs +2 -1
  222. package/dist/core/engine/types.d.mts +17 -0
  223. package/dist/core/engine/version.d.mts +1 -1
  224. package/dist/core/engine/version.mjs +1 -1
  225. package/dist/core/error/codes.d.mts +24 -1
  226. package/dist/core/error/codes.mjs +23 -3
  227. package/dist/core/error/refusal.d.mts +8 -3
  228. package/dist/core/error/refusal.mjs +6 -1
  229. package/dist/core/exact/decimal.d.mts +1 -14
  230. package/dist/core/exact/decimal.mjs +9 -19
  231. package/dist/core/exact/stored.d.mts +9 -0
  232. package/dist/core/exact/stored.mjs +38 -0
  233. package/dist/core/exact/text.d.mts +16 -1
  234. package/dist/core/exact/text.mjs +50 -1
  235. package/dist/core/format/digits.mjs +55 -0
  236. package/dist/core/format/index.d.mts +16 -0
  237. package/dist/core/format/index.mjs +27 -0
  238. package/dist/core/format/number.d.mts +27 -0
  239. package/dist/core/format/number.mjs +158 -0
  240. package/dist/core/format/write.d.mts +6 -0
  241. package/dist/core/format/write.mjs +57 -0
  242. package/dist/core/index.d.mts +43 -33
  243. package/dist/core/index.mjs +31 -28
  244. package/dist/core/model/defaults.d.mts +18 -1
  245. package/dist/core/model/defaults.mjs +19 -1
  246. package/dist/core/model/define.d.mts +17 -8
  247. package/dist/core/model/define.mjs +2 -0
  248. package/dist/core/model/member.d.mts +5 -3
  249. package/dist/core/model/member.mjs +33 -6
  250. package/dist/core/model/storage.mjs +40 -12
  251. package/dist/core/model/types.d.mts +17 -1
  252. package/dist/core/model/types.mjs +5 -0
  253. package/dist/core/model/validate/expr.d.mts +1 -7
  254. package/dist/core/model/validate/fields.d.mts +2 -0
  255. package/dist/core/model/validate/fields.mjs +14 -7
  256. package/dist/core/model/validate/issues.mjs +5 -1
  257. package/dist/core/model/validate/known-members.mjs +6 -5
  258. package/dist/core/model/validate/shape.mjs +36 -3
  259. package/dist/core/model/validate/source.mjs +2 -2
  260. package/dist/core/oracle/data.d.mts +4 -2
  261. package/dist/core/oracle/evaluate.d.mts +19 -1
  262. package/dist/core/oracle/evaluate.mjs +56 -10
  263. package/dist/core/oracle/expr.mjs +1 -1
  264. package/dist/core/oracle/facts.mjs +12 -5
  265. package/dist/core/oracle/measure.mjs +1 -1
  266. package/dist/core/oracle/request.mjs +39 -4
  267. package/dist/core/oracle/segmented.d.mts +3 -1
  268. package/dist/core/oracle/segmented.mjs +19 -13
  269. package/dist/core/oracle/unread.mjs +32 -0
  270. package/dist/core/oracle/visibility.mjs +4 -3
  271. package/dist/core/policy/bind.d.mts +2 -11
  272. package/dist/core/policy/bind.mjs +1 -1
  273. package/dist/core/policy/match.mjs +1 -1
  274. package/dist/core/query/closure.d.mts +7 -2
  275. package/dist/core/query/closure.mjs +29 -12
  276. package/dist/core/query/compose-tile.d.mts +3 -2
  277. package/dist/core/query/compose-tile.mjs +32 -13
  278. package/dist/core/query/compose.d.mts +0 -5
  279. package/dist/core/query/drill/internal.d.mts +5 -5
  280. package/dist/core/query/drill/internal.mjs +11 -0
  281. package/dist/core/query/drill/links.d.mts +2 -3
  282. package/dist/core/query/drill/links.mjs +18 -4
  283. package/dist/core/query/drill/selection.d.mts +8 -2
  284. package/dist/core/query/drill/selection.mjs +14 -3
  285. package/dist/core/query/drill/synthetic.mjs +1 -1
  286. package/dist/core/query/drill/time.mjs +11 -10
  287. package/dist/core/query/filter.d.mts +1 -6
  288. package/dist/core/query/filter.mjs +1 -4
  289. package/dist/core/query/fold.mjs +23 -0
  290. package/dist/core/query/segments.mjs +42 -3
  291. package/dist/core/query/to-wire.d.mts +7 -0
  292. package/dist/core/query/to-wire.mjs +14 -2
  293. package/dist/core/query/types.d.mts +30 -13
  294. package/dist/core/result/columns.mjs +23 -13
  295. package/dist/core/result/number.mjs +3 -3
  296. package/dist/core/result/status.d.mts +13 -0
  297. package/dist/core/result/status.mjs +18 -0
  298. package/dist/core/result/time-axis.d.mts +14 -13
  299. package/dist/core/result/time-axis.mjs +20 -2
  300. package/dist/core/result/types.d.mts +33 -3
  301. package/dist/core/result/whole.d.mts +23 -0
  302. package/dist/core/result/whole.mjs +27 -0
  303. package/dist/core/schema/agent-query.d.mts +89 -0
  304. package/dist/core/schema/agent-query.mjs +115 -0
  305. package/dist/core/schema/aliases.mjs +1 -52
  306. package/dist/core/schema/answer-parts.mjs +17 -13
  307. package/dist/core/schema/answers.d.mts +787 -319
  308. package/dist/core/schema/commands.d.mts +33 -23
  309. package/dist/core/schema/commands.mjs +26 -18
  310. package/dist/core/schema/custom.mjs +46 -45
  311. package/dist/core/schema/document.d.mts +32 -27
  312. package/dist/core/schema/document.mjs +61 -81
  313. package/dist/core/schema/drill-answers.mjs +4 -1
  314. package/dist/core/schema/drill.d.mts +14 -9
  315. package/dist/core/schema/drill.mjs +23 -22
  316. package/dist/core/schema/index.d.mts +5 -3
  317. package/dist/core/schema/index.mjs +5 -3
  318. package/dist/core/schema/options.d.mts +92 -0
  319. package/dist/core/schema/options.mjs +104 -0
  320. package/dist/core/schema/picks.d.mts +2 -2
  321. package/dist/core/schema/picks.mjs +7 -6
  322. package/dist/core/schema/query.d.mts +9 -83
  323. package/dist/core/schema/query.mjs +49 -73
  324. package/dist/core/schema/strict.d.mts +3 -0
  325. package/dist/core/schema/strict.mjs +91 -0
  326. package/dist/core/schema/union-error.mjs +30 -7
  327. package/dist/core/schema/view.d.mts +4 -3
  328. package/dist/core/schema/view.mjs +16 -11
  329. package/dist/core/store/ddl.d.mts +0 -2
  330. package/dist/core/store/ddl.mjs +1 -5
  331. package/dist/core/time/bucket.d.mts +1 -18
  332. package/dist/core/time/bucket.mjs +12 -8
  333. package/dist/core/time/compare.mjs +3 -2
  334. package/dist/core/time/index.d.mts +7 -8
  335. package/dist/core/time/instant.d.mts +15 -9
  336. package/dist/core/time/instant.mjs +23 -9
  337. package/dist/core/time/range.d.mts +3 -15
  338. package/dist/core/time/range.mjs +17 -7
  339. package/dist/core/time/stored.d.mts +8 -5
  340. package/dist/core/time/stored.mjs +51 -15
  341. package/dist/core/time/temporal.d.mts +1 -5
  342. package/dist/core/time/temporal.mjs +9 -4
  343. package/dist/core/time/text-time.d.mts +31 -2
  344. package/dist/core/time/text-time.mjs +139 -22
  345. package/dist/core/time/zone.d.mts +6 -1
  346. package/dist/core/time/zone.mjs +13 -4
  347. package/dist/core/types/api.d.mts +1 -1
  348. package/dist/core/types/api.mjs +1 -1
  349. package/dist/core/types/dashboard.d.mts +185 -0
  350. package/dist/core/types/dashboard.mjs +26 -0
  351. package/dist/core/types/drill-api.d.mts +14 -2
  352. package/dist/core/types/infer.d.mts +0 -4
  353. package/dist/core/types/options-check.d.mts +42 -0
  354. package/dist/core/types/options-check.mjs +90 -0
  355. package/dist/core/types/options.d.mts +14 -8
  356. package/dist/core/value/casefold.d.mts +1 -3
  357. package/dist/core/value/stored.d.mts +26 -0
  358. package/dist/core/value/stored.mjs +28 -0
  359. package/dist/cursor-seal.mjs +37 -9
  360. package/dist/dashboard-documents.d.mts +14 -6
  361. package/dist/dashboard-documents.mjs +32 -12
  362. package/dist/dashboards.mjs +10 -9
  363. package/dist/drill-access.mjs +6 -6
  364. package/dist/drill-change.mjs +18 -20
  365. package/dist/drill-comparison.mjs +2 -1
  366. package/dist/drill-crumbs.mjs +63 -28
  367. package/dist/drill-distinct.mjs +2 -1
  368. package/dist/drill-explain.mjs +1 -1
  369. package/dist/drill-items.mjs +1 -1
  370. package/dist/drill-open.mjs +39 -23
  371. package/dist/drill-seal.mjs +41 -13
  372. package/dist/drill-share.mjs +1 -1
  373. package/dist/drill-summary.mjs +2 -1
  374. package/dist/drill-targets.mjs +4 -4
  375. package/dist/drill-views.mjs +4 -3
  376. package/dist/drill.mjs +1 -1
  377. package/dist/editing.mjs +5 -3
  378. package/dist/endpoints/index.d.mts +29 -8
  379. package/dist/endpoints/index.mjs +4 -1
  380. package/dist/endpoints/meta.mjs +4 -3
  381. package/dist/endpoints/query.mjs +5 -2
  382. package/dist/endpoints/read.mjs +7 -6
  383. package/dist/endpoints/versions.mjs +2 -1
  384. package/dist/execute.d.mts +3 -0
  385. package/dist/execute.mjs +23 -12
  386. package/dist/grant.d.mts +9 -0
  387. package/dist/grant.mjs +43 -0
  388. package/dist/handler.mjs +8 -13
  389. package/dist/http.d.mts +6 -2
  390. package/dist/http.mjs +6 -2
  391. package/dist/index.d.mts +25 -4
  392. package/dist/index.mjs +91 -40
  393. package/dist/llms.txt +3 -3
  394. package/dist/mcp/api.mjs +2 -1
  395. package/dist/mcp/query.mjs +3 -8
  396. package/dist/mcp/resolve.mjs +9 -2
  397. package/dist/node/index.d.mts +36 -0
  398. package/dist/node/index.mjs +89 -0
  399. package/dist/node/request.d.mts +12 -0
  400. package/dist/node/request.mjs +119 -0
  401. package/dist/node/response.mjs +58 -0
  402. package/dist/principal.mjs +15 -7
  403. package/dist/react/Canvas.mjs +90 -69
  404. package/dist/react/Cell.mjs +2 -1
  405. package/dist/react/Dashboard.d.mts +15 -1
  406. package/dist/react/Dashboard.mjs +43 -42
  407. package/dist/react/DashboardList.mjs +9 -4
  408. package/dist/react/Editing.d.mts +9 -0
  409. package/dist/react/Editing.mjs +8 -3
  410. package/dist/react/Grid.mjs +1 -1
  411. package/dist/react/Header.mjs +25 -52
  412. package/dist/react/History.mjs +3 -2
  413. package/dist/react/LoadFailed.mjs +59 -0
  414. package/dist/react/Panel.d.mts +1 -1
  415. package/dist/react/Panel.mjs +1 -1
  416. package/dist/react/Parts.d.mts +34 -0
  417. package/dist/react/Parts.mjs +9 -6
  418. package/dist/react/ReviewPanel.mjs +1 -1
  419. package/dist/react/RowBody.d.mts +2 -0
  420. package/dist/react/RowBody.mjs +5 -1
  421. package/dist/react/Share.mjs +153 -0
  422. package/dist/react/TabStrip.mjs +37 -0
  423. package/dist/react/Tile.d.mts +3 -1
  424. package/dist/react/Tile.mjs +89 -92
  425. package/dist/react/TileState.mjs +117 -0
  426. package/dist/react/ago.mjs +45 -0
  427. package/dist/react/arrange.mjs +1 -1
  428. package/dist/react/board.mjs +2 -2
  429. package/dist/react/bucket-name.d.mts +8 -0
  430. package/dist/react/bucket-name.mjs +13 -0
  431. package/dist/react/builder/DisplayOptions.mjs +219 -0
  432. package/dist/react/builder/Preview.mjs +13 -13
  433. package/dist/react/builder/RangeEditor.mjs +4 -3
  434. package/dist/react/builder/WidgetBuilder.d.mts +1 -7
  435. package/dist/react/builder/WidgetBuilder.mjs +12 -3
  436. package/dist/react/builder/base.d.mts +13 -2
  437. package/dist/react/builder/base.mjs +70 -12
  438. package/dist/react/builder/display.d.mts +3 -0
  439. package/dist/react/builder/display.mjs +256 -0
  440. package/dist/react/builder/labels.mjs +19 -5
  441. package/dist/react/builder/options.mjs +11 -6
  442. package/dist/react/builder/state.mjs +25 -3
  443. package/dist/react/builder/useBuilder.d.mts +7 -1
  444. package/dist/react/builder/useBuilder.mjs +6 -9
  445. package/dist/react/builder/usePreview.mjs +3 -2
  446. package/dist/react/builder/words.d.mts +16 -1
  447. package/dist/react/builder/words.mjs +41 -1
  448. package/dist/react/change-text.mjs +149 -0
  449. package/dist/react/client.d.mts +9 -0
  450. package/dist/react/client.mjs +105 -14
  451. package/dist/react/columns.mjs +9 -1
  452. package/dist/react/context.d.mts +24 -3
  453. package/dist/react/context.mjs +23 -7
  454. package/dist/react/dates-shown.mjs +76 -0
  455. package/dist/react/draft.mjs +3 -2
  456. package/dist/react/drill/Bars.mjs +12 -16
  457. package/dist/react/drill/Comparison.mjs +1 -1
  458. package/dist/react/drill/DrillPanel.d.mts +1 -1
  459. package/dist/react/drill/DrillPanel.mjs +2 -1
  460. package/dist/react/drill/Header.mjs +65 -12
  461. package/dist/react/drill/Items.d.mts +1 -1
  462. package/dist/react/drill/Notes.mjs +10 -7
  463. package/dist/react/drill/PanelStates.mjs +8 -1
  464. package/dist/react/drill/Trend.mjs +10 -5
  465. package/dist/react/drill/board.d.mts +1 -1
  466. package/dist/react/drill/board.mjs +1 -0
  467. package/dist/react/drill/host.mjs +4 -1
  468. package/dist/react/drill/lazy.mjs +2 -27
  469. package/dist/react/drill/props.d.mts +19 -8
  470. package/dist/react/drill/props.mjs +62 -18
  471. package/dist/react/drill/state.d.mts +15 -5
  472. package/dist/react/drill/state.mjs +12 -3
  473. package/dist/react/drill/words.d.mts +46 -3
  474. package/dist/react/drill/words.mjs +30 -5
  475. package/dist/react/english.mjs +33 -8
  476. package/dist/react/export/ExportButton.mjs +4 -1
  477. package/dist/react/export/csv.d.mts +7 -2
  478. package/dist/react/export/csv.mjs +24 -7
  479. package/dist/react/failure-words.mjs +60 -0
  480. package/dist/react/filters/bar.d.mts +1 -1
  481. package/dist/react/filters/bar.mjs +4 -1
  482. package/dist/react/filters/calendar.mjs +23 -8
  483. package/dist/react/filters/chip.mjs +7 -3
  484. package/dist/react/filters/context.d.mts +13 -1
  485. package/dist/react/filters/context.mjs +1 -1
  486. package/dist/react/filters/dates-said.mjs +57 -0
  487. package/dist/react/filters/days.d.mts +3 -4
  488. package/dist/react/filters/days.mjs +10 -17
  489. package/dist/react/filters/hooks.d.mts +11 -0
  490. package/dist/react/filters/hooks.mjs +10 -6
  491. package/dist/react/filters/menu-search.mjs +17 -9
  492. package/dist/react/filters/menu.mjs +10 -8
  493. package/dist/react/filters/phone.mjs +41 -16
  494. package/dist/react/filters/place.mjs +40 -0
  495. package/dist/react/filters/popover.mjs +18 -13
  496. package/dist/react/filters/rules.d.mts +4 -3
  497. package/dist/react/filters/rules.mjs +3 -3
  498. package/dist/react/filters/sheet.mjs +7 -3
  499. package/dist/react/filters/state.mjs +6 -1
  500. package/dist/react/filters/values.mjs +24 -7
  501. package/dist/react/filters/words.d.mts +13 -0
  502. package/dist/react/filters/words.mjs +5 -0
  503. package/dist/react/format-time.d.mts +17 -6
  504. package/dist/react/format-time.mjs +152 -33
  505. package/dist/react/format.d.mts +3 -3
  506. package/dist/react/format.mjs +35 -122
  507. package/dist/react/headline.d.mts +12 -0
  508. package/dist/react/headline.mjs +107 -0
  509. package/dist/react/index.d.mts +20 -17
  510. package/dist/react/index.mjs +13 -10
  511. package/dist/react/lazy.mjs +38 -0
  512. package/dist/react/messages.d.mts +78 -2
  513. package/dist/react/now.mjs +38 -0
  514. package/dist/react/place.mjs +4 -2
  515. package/dist/react/read.d.mts +1 -0
  516. package/dist/react/read.mjs +140 -9
  517. package/dist/react/renderers/exact.mjs +31 -59
  518. package/dist/react/renderers/index.d.mts +27 -6
  519. package/dist/react/renderers/index.mjs +154 -92
  520. package/dist/react/renderers/list-parts.mjs +24 -0
  521. package/dist/react/renderers/list.d.mts +1 -0
  522. package/dist/react/renderers/list.mjs +99 -43
  523. package/dist/react/renderers/more-rows.mjs +75 -0
  524. package/dist/react/renderers/number-before.mjs +320 -0
  525. package/dist/react/renderers/number-period.mjs +54 -0
  526. package/dist/react/renderers/number-whole.mjs +29 -0
  527. package/dist/react/renderers/props.d.mts +24 -1
  528. package/dist/react/renderers/props.mjs +8 -0
  529. package/dist/react/renderers/table-cells.mjs +137 -31
  530. package/dist/react/renderers/table-fit.mjs +55 -10
  531. package/dist/react/renderers/table-measure.mjs +29 -9
  532. package/dist/react/renderers/table-row.mjs +14 -9
  533. package/dist/react/renderers/table-scale.mjs +2 -3
  534. package/dist/react/renderers/table-sort.mjs +3 -2
  535. package/dist/react/renderers/table-whole.mjs +37 -0
  536. package/dist/react/renderers/table.mjs +73 -53
  537. package/dist/react/review.d.mts +7 -0
  538. package/dist/react/review.mjs +35 -8
  539. package/dist/react/roving.d.mts +6 -0
  540. package/dist/react/roving.mjs +123 -0
  541. package/dist/react/says-dates.d.mts +7 -0
  542. package/dist/react/says-dates.mjs +51 -0
  543. package/dist/react/series.mjs +5 -6
  544. package/dist/react/stable.mjs +1 -1
  545. package/dist/react/tabs/EditTabs.mjs +125 -0
  546. package/dist/react/tabs/NameField.mjs +72 -0
  547. package/dist/react/tabs/TabMenu.mjs +175 -0
  548. package/dist/react/tabs/actions.mjs +37 -0
  549. package/dist/react/tabs/commands.mjs +76 -0
  550. package/dist/react/tabs/focus.mjs +22 -0
  551. package/dist/react/tabs/keys.mjs +28 -0
  552. package/dist/react/theme-unlayered.css +1 -1
  553. package/dist/react/theme.css +1 -1
  554. package/dist/react/tile-store.d.mts +4 -0
  555. package/dist/react/tile-store.mjs +93 -13
  556. package/dist/react/touch.d.mts +16 -0
  557. package/dist/react/touch.mjs +39 -0
  558. package/dist/react/useBoard.d.mts +6 -0
  559. package/dist/react/useBoard.mjs +1 -0
  560. package/dist/react/useDashboard.d.mts +2 -0
  561. package/dist/react/useDashboard.mjs +5 -2
  562. package/dist/react/useTiles.d.mts +3 -0
  563. package/dist/react/useTiles.mjs +73 -17
  564. package/dist/react/view-grid.mjs +2 -2
  565. package/dist/react/view.mjs +1 -1
  566. package/dist/recharts/axes.mjs +1 -1
  567. package/dist/recharts/axis.mjs +23 -73
  568. package/dist/recharts/bar.d.mts +2 -1
  569. package/dist/recharts/bar.mjs +140 -64
  570. package/dist/recharts/fit.mjs +33 -0
  571. package/dist/recharts/line.mjs +23 -17
  572. package/dist/recharts/marks.mjs +2 -1
  573. package/dist/recharts/parts.mjs +19 -14
  574. package/dist/recharts/table.mjs +8 -3
  575. package/dist/refusal.mjs +46 -0
  576. package/dist/registry/filter-bar.json +1 -1
  577. package/dist/skills/derive-dashboards/SKILL.md +25 -9
  578. package/dist/tile-doc.mjs +1 -1
  579. package/package.json +21 -6
  580. package/dist/charts-react/plan.d.mts +0 -3
  581. package/dist/charts-react/plan.mjs +0 -37
  582. package/dist/charts-react/tiles.d.mts +0 -24
  583. package/dist/core/policy/match.d.mts +0 -16
  584. package/dist/core/schema/aliases.d.mts +0 -7
  585. package/dist/core/time/compare.d.mts +0 -30
  586. package/dist/react/EditBar.d.mts +0 -16
  587. package/dist/react/History.d.mts +0 -30
  588. package/dist/react/ReviewPanel.d.mts +0 -15
  589. package/dist/react/digits.mjs +0 -46
  590. package/dist/react/drill/trend-touch.mjs +0 -33
  591. package/dist/react/renderers/exact.d.mts +0 -6
@@ -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 };
@@ -0,0 +1,86 @@
1
+ import { Chart } from "../Chart.mjs";
2
+ import { timeTableOf } from "../from-answer.mjs";
3
+ import { byKey, noValue, oneOf } from "../plan-parts.mjs";
4
+ import { chartWords, selectOf } from "../tiles.mjs";
5
+ import { useMemo } from "react";
6
+ import { courseChart } from "derive-dashboards/charts";
7
+ import { jsx } from "react/jsx-runtime";
8
+ import { displayOf } from "derive-dashboards/core";
9
+ import { NumberTile, headlineColumn, toSeries } from "derive-dashboards/react";
10
+ // src/kinds/number.tsx
11
+ /**
12
+ * What the course draws: the column the number shows large, by bucket, as a table over time
13
+ * (`timeTableOf`, the bucket still running marked as the answer marks it). Nothing when the
14
+ * answer has no whole, no buckets, or no value to show large.
15
+ */
16
+ function coursePlan(props) {
17
+ const headline = headlineColumn(props);
18
+ if (headline === void 0) return void 0;
19
+ const drawn = toSeries(props.answer, props, props.slots);
20
+ const series = drawn.series.filter((s) => s.column.id === headline.column.id);
21
+ const timed = timeTableOf(drawn, {
22
+ answer: props.answer,
23
+ format: props,
24
+ series,
25
+ zone: props.answer.receipt.calendar.timezone,
26
+ colors: displayOf("number", props.widget.display).colors
27
+ });
28
+ const [first] = timed?.data.series ?? [];
29
+ if (timed === void 0 || first === void 0) return void 0;
30
+ const { data } = timed;
31
+ const options = first.slot === void 0 ? {} : { slot: first.slot };
32
+ return {
33
+ drawn,
34
+ drew: first.measure.additive === false ? "line" : "bar",
35
+ draw: (env) => courseChart(data, options, env),
36
+ pointOf: byKey(timed.pointOf),
37
+ ...oneOf(series),
38
+ notDrawn: [],
39
+ points: data.x.buckets.length,
40
+ empty: first.values.every((value) => noValue(value))
41
+ };
42
+ }
43
+ /** The course beside the number: a chart in the dashboards' course box, filling it. */
44
+ function Course({ props, plan }) {
45
+ const { messages, locale, widget } = props;
46
+ const words = useMemo(() => chartWords(messages), [messages]);
47
+ return /* @__PURE__ */ jsx(Chart, {
48
+ draw: plan.draw,
49
+ markKeys: false,
50
+ words,
51
+ caption: messages.chartTable({
52
+ title: widget.title,
53
+ kind: plan.drew,
54
+ points: plan.points
55
+ }),
56
+ noValue: messages.noValue,
57
+ ...locale === void 0 ? {} : { locale },
58
+ ...selectOf(props, plan)
59
+ });
60
+ }
61
+ /** A number, and beside it the course of the value it shows large, when it has one. */
62
+ function NumberTile$1(props) {
63
+ const { answer, slots, locale, messages, widget } = props;
64
+ const plan = useMemo(() => coursePlan({
65
+ answer,
66
+ messages,
67
+ widget,
68
+ ...slots === void 0 ? {} : { slots },
69
+ ...locale === void 0 ? {} : { locale }
70
+ }), [
71
+ answer,
72
+ slots,
73
+ locale,
74
+ messages,
75
+ widget
76
+ ]);
77
+ if (plan === void 0 || plan.empty) return /* @__PURE__ */ jsx(NumberTile, { ...props });
78
+ return /* @__PURE__ */ jsx(NumberTile, {
79
+ ...props,
80
+ course: /* @__PURE__ */ jsx(Course, {
81
+ props,
82
+ plan
83
+ })
84
+ });
85
+ }
86
+ export { NumberTile$1 as NumberTile, coursePlan };
@@ -5,15 +5,21 @@ import { displayOf } from "derive-dashboards/core";
5
5
  import { answerIds } from "derive-dashboards/react";
6
6
  // src/plan-bars.ts
7
7
  /**
8
- * What the bars leave to the table: a summed split's parts, or the series not drawn (the rest of
9
- * a split, or the measures after the first), the first few named and the rest counted.
8
+ * What the bars hold and what they leave to the table. A summed split's parts are each inside
9
+ * every bar: they are what it adds up, never left out. Otherwise the series after the first (the
10
+ * rest of a split, or the measures after the first) are not drawn, the first few named and the
11
+ * rest counted, as is every value the answer itself does not draw.
10
12
  */
11
- function barsLeftOut(props, at) {
13
+ function barsTold(props, at) {
12
14
  const labels = at.series.map((s) => s.label);
13
- return leftOut(at.split === "summed" ? labels : labels.slice(1), {
14
- drawn: at.drawn,
15
- props
16
- });
15
+ const summed = at.split === "summed";
16
+ return {
17
+ ...summed ? { summed: labels } : {},
18
+ notDrawn: leftOut(summed ? [] : labels.slice(1), {
19
+ drawn: at.drawn,
20
+ props
21
+ })
22
+ };
17
23
  }
18
24
  /**
19
25
  * The order of bars by category: by value for a bar tile, unless its x column is a time
@@ -75,6 +81,7 @@ function byCategory(props, drawn, kind, from) {
75
81
  return {
76
82
  drawn,
77
83
  drew: "bar",
84
+ lying: true,
78
85
  draw: (env) => barChart(rows, {
79
86
  measure,
80
87
  sort: sortOf(props, kind),
@@ -83,7 +90,7 @@ function byCategory(props, drawn, kind, from) {
83
90
  }, env),
84
91
  pointOf: byKey(bars.pointOf),
85
92
  ...oneOf(series),
86
- notDrawn: barsLeftOut(props, {
93
+ ...barsTold(props, {
87
94
  drawn,
88
95
  series: rest,
89
96
  split
@@ -1,3 +1,4 @@
1
+ import { COLUMNS } from "./columns-picture.mjs";
1
2
  import { measureOf } from "./from-answer.mjs";
2
3
  import { leftOut, noValue } from "./plan-parts.mjs";
3
4
  import { overTime } from "./plan-time.mjs";
@@ -79,7 +80,7 @@ const ungrouped = (props, drawn) => drawn.points.length === 1 && props.answer.co
79
80
  function funnelPlan(props, drawn, from) {
80
81
  const [first] = drawn.series;
81
82
  if (first === void 0) return void 0;
82
- const timed = overTime(props, drawn, "bar", from);
83
+ const timed = overTime(props, drawn, COLUMNS, from);
83
84
  if (timed !== void 0) return timed;
84
85
  const steps = ungrouped(props, drawn) ? byMeasure(first, {
85
86
  drawn,
@@ -99,6 +100,7 @@ function funnelPlan(props, drawn, from) {
99
100
  return {
100
101
  drawn,
101
102
  drew: bars ? "bar" : "funnel",
103
+ lying: true,
102
104
  draw: (env) => bars ? barChart(steps.steps, {
103
105
  measure,
104
106
  sort: "given",
@@ -82,9 +82,17 @@ function byRows(drawn, from) {
82
82
  cells
83
83
  };
84
84
  }
85
- /** The word over the row names: the label of the field whose values run down. */
86
- function rowTitleOf(props, timed) {
87
- return props.answer.columns.filter((c) => roleOf(c) === "time" || roleOf(c) === "dimension")[timed ? 1 : 0]?.label;
85
+ /**
86
+ * The words over the row names and the column names: the labels of the fields whose values run
87
+ * down and across. Over time the columns are dates, which need no word over them.
88
+ */
89
+ function titlesOf(props, timed) {
90
+ const [first, second] = props.answer.columns.filter((c) => roleOf(c) === "time" || roleOf(c) === "dimension").map((c) => c.label);
91
+ const [rowTitle, columnTitle] = timed ? [second] : [first, second];
92
+ return {
93
+ ...rowTitle === void 0 ? {} : { rowTitle },
94
+ ...columnTitle === void 0 ? {} : { columnTitle }
95
+ };
88
96
  }
89
97
  /** A heatmap of the answer's first value by its two fields. None for an answer with no value. */
90
98
  function gridPlan(props, drawn, from) {
@@ -93,18 +101,19 @@ function gridPlan(props, drawn, from) {
93
101
  const timed = overTime(props, drawn, from);
94
102
  const grid = timed ?? byRows(drawn, from);
95
103
  const measure = measureOf(first.column, props);
96
- const rowTitle = rowTitleOf(props, timed !== void 0);
104
+ const titles = titlesOf(props, timed !== void 0);
97
105
  const others = drawn.series.filter((s) => s.column.id !== first.column.id).map((s) => s.label);
98
106
  const slot = drawn.split || first.slot === void 0 ? {} : { slot: first.slot };
99
107
  const cellOf = (stop) => grid.cells.get(stop.key);
100
108
  return {
101
109
  drawn,
102
110
  drew: "heatmap",
111
+ lying: true,
103
112
  draw: (env) => gridChart(grid.data, {
104
113
  measure,
105
114
  diverging: true,
106
115
  ...grid.time === void 0 ? {} : { time: grid.time },
107
- ...rowTitle === void 0 ? {} : { rowTitle },
116
+ ...titles,
108
117
  ...slot
109
118
  }, env),
110
119
  pointOf: (stop) => cellOf(stop)?.point,
@@ -0,0 +1,17 @@
1
+ import { displayOf } from "derive-dashboards/core";
2
+ import { toSeries } from "derive-dashboards/react";
3
+ // src/plan-of.ts
4
+ /**
5
+ * A kind's planner, from how it plans the answer's series. A widget's own colours are read once,
6
+ * by series label, as the dashboards' other tiles read them; a heatmap and a funnel have none.
7
+ */
8
+ const planner = (kind, plan) => (props) => {
9
+ const drawn = toSeries(props.answer, props, props.slots);
10
+ const colors = kind === "heatmap" || kind === "funnel" ? void 0 : displayOf(kind, props.widget.display).colors;
11
+ return plan(props, drawn, {
12
+ answer: props.answer,
13
+ format: props,
14
+ colors
15
+ });
16
+ };
17
+ export { planner };
@@ -1,6 +1,5 @@
1
+ import { namedFew } from "./words.mjs";
1
2
  // src/plan-parts.ts
2
- /** How many of the things left out the note names; the rest it counts. */
3
- const NAMED = 3;
4
3
  /**
5
4
  * The note's labels: the series left out, then the values the answer itself does not draw, then
6
5
  * whatever else has no place (`more`). The first few are named and the rest counted, the count
@@ -12,8 +11,7 @@ function leftOut(labels, at) {
12
11
  ...at.drawn.notDrawn.map((c) => c.label),
13
12
  ...at.more ?? []
14
13
  ];
15
- if (all.length <= NAMED) return all;
16
- return [...all.slice(0, NAMED), at.props.messages.moreRows(all.length - NAMED)];
14
+ return namedFew(all, at.props.messages);
17
15
  }
18
16
  /** The one series a plan draws, as every item's series, when it draws one. */
19
17
  const oneOf = (series) => {
@@ -27,4 +25,17 @@ const byKey = (points) => (stop) => points.get(stop.key);
27
25
  * (not a number, or not finite). A tile with none to draw says so, as one with none at all does.
28
26
  */
29
27
  const noValue = (value) => value === null || value === void 0 || !Number.isFinite(value);
30
- export { byKey, leftOut, noValue, oneOf };
28
+ /**
29
+ * The row an item of a stop opens, with the series it is a value of: that series' row at the
30
+ * stop's point; none for an item no one row stands behind.
31
+ */
32
+ function rowOf(plan, stop, item) {
33
+ const point = plan.pointOf(stop);
34
+ const series = plan.seriesOf?.(item, stop);
35
+ const row = point === void 0 || series === void 0 ? void 0 : plan.drawn.rowAt(point, series.key);
36
+ return row === void 0 || series === void 0 ? void 0 : {
37
+ row,
38
+ series
39
+ };
40
+ }
41
+ export { byKey, leftOut, noValue, oneOf, rowOf };
@@ -1,58 +1,12 @@
1
1
  import { timeTableOf } from "./from-answer.mjs";
2
2
  import { byKey, leftOut, noValue } from "./plan-parts.mjs";
3
- import { areaChart, areaDraws, columnChart, lineChart, multiplesChart, pairKey } from "derive-dashboards/charts";
4
- import { displayOf } from "derive-dashboards/core";
3
+ import { pairKey } from "derive-dashboards/charts";
5
4
  // src/plan-time.ts
6
- /** Whether some value is below zero: such a table has no shares of a whole to read. */
7
- const anyLoss = (data) => data.series.some((s) => s.values.some((value) => value !== null && value < 0));
8
- /**
9
- * What an area tile draws. Bands are the parts of one split, or one series alone: separate
10
- * measures (Tasks and Hours) are lines, for a band of one on the other would reach a height,
11
- * and a share of both, that means nothing. The chart itself draws lines of values that do not
12
- * add up, and columns of one period or of a series that changes sign (`areaDraws`), so the
13
- * tile names the picture that is drawn, not the one asked for. Shares are read only of parts
14
- * none of which is a loss: a share of a whole with a loss in it is no share.
15
- */
16
- function areaPicture(props, drawn, data) {
17
- if (!drawn.split && data.series.length > 1) return {
18
- drew: "line",
19
- draw: (table, env) => lineChart(table, {}, env)
20
- };
21
- const share = displayOf("area", props.widget.display).share === true && !anyLoss(data) && data.series.some((s) => s.values.some((v) => v !== null && v > 0));
22
- const form = areaDraws(data);
23
- return {
24
- drew: form === "area" ? "area" : form === "lines" ? "line" : "bar",
25
- draw: (table, env) => areaChart(table, share ? { arrange: "share" } : {}, env)
26
- };
27
- }
28
- /**
29
- * How each kind draws a table over time. Columns stack only the parts of a split, as the
30
- * Recharts tile does: separate measures stand side by side, for a column of Tasks on Hours
31
- * would reach a total that means nothing.
32
- */
33
- function pictureOf(props, drawn, at) {
34
- const { kind, data } = at;
35
- const own = displayOf("multiples", props.widget.display).ownScales === true;
36
- return {
37
- bar: {
38
- drew: "bar",
39
- draw: (table, env) => columnChart(table, drawn.split ? {} : { arrange: "grouped" }, env)
40
- },
41
- area: areaPicture(props, drawn, data),
42
- multiples: {
43
- drew: "multiples",
44
- draw: (table, env) => multiplesChart(table, { shared: !own }, env)
45
- }
46
- }[kind] ?? {
47
- drew: "line",
48
- draw: (table, env) => lineChart(table, {}, env)
49
- };
50
- }
51
5
  /**
52
6
  * A chart over time, when the answer has a time axis with a bucket for some point. A point with
53
7
  * no bucket is named under the chart, never silently dropped.
54
8
  */
55
- function overTime(props, drawn, kind, from) {
9
+ function overTime(props, drawn, how, from) {
56
10
  const series = drawn.series.filter((s) => s.axis === "left");
57
11
  const timed = timeTableOf(drawn, {
58
12
  ...from,
@@ -60,12 +14,9 @@ function overTime(props, drawn, kind, from) {
60
14
  series
61
15
  });
62
16
  if (timed === void 0) return void 0;
63
- const picture = pictureOf(props, drawn, {
64
- kind,
65
- data: timed.data
66
- });
17
+ const picture = how.picture(props, drawn, timed.data);
67
18
  const right = drawn.series.filter((s) => !series.includes(s)).map((s) => s.label);
68
- const points = kind === "multiples" ? new Map(series.flatMap((s) => [...timed.pointOf].map(([label, point]) => [pairKey(s.key, label), point]))) : timed.pointOf;
19
+ const points = how.panels === true ? new Map(series.flatMap((s) => [...timed.pointOf].map(([label, point]) => [pairKey(s.key, label), point]))) : timed.pointOf;
69
20
  return {
70
21
  drawn,
71
22
  drew: picture.drew,
@@ -1,5 +1,5 @@
1
+ import "./table.mjs";
1
2
  import "react";
2
- import "derive-dashboards/charts";
3
3
  /** Words for navigating a chart table that needs more than one page. */
4
4
  export type ReaderPages = {
5
5
  previous: string;
@@ -6,7 +6,10 @@ const ENGLISH = {
6
6
  next: "Next page",
7
7
  range: (first, last, total, axis) => `${axis === "rows" ? "Rows" : "Columns"} ${String(first)}–${String(last)} of ${String(total)}`
8
8
  };
9
- /** Bound the mounted cells in both directions. Each page is a rectangle of the original table. */
9
+ /**
10
+ * Bound the mounted cells in both directions. Each page is a rectangle of the original table,
11
+ * and only its rows are made: a table of 10,000 rows writes the values of one page.
12
+ */
10
13
  const CELLS = 512;
11
14
  const WIDE = 32;
12
15
  const TALL = 100;
@@ -14,7 +17,7 @@ function windowOf(data, chosen) {
14
17
  const width = Math.max(1, Math.min(WIDE, data.columns.length));
15
18
  const height = Math.min(TALL, Math.floor(CELLS / width));
16
19
  const across = Math.max(1, Math.ceil(data.columns.length / width));
17
- const pages = across * Math.ceil(data.rows.length / height);
20
+ const pages = across * Math.ceil(data.size / height);
18
21
  const page = Math.max(0, Math.min(chosen, pages - 1));
19
22
  const left = page % across * width;
20
23
  const top = Math.floor(page / across) * height;
@@ -24,19 +27,26 @@ function windowOf(data, chosen) {
24
27
  left,
25
28
  top,
26
29
  across,
27
- rows: data.rows.slice(top, top + height),
30
+ rows: Array.from({ length: Math.max(0, Math.min(height, data.size - top)) }, (_r, i) => data.row(top + i)).filter((row) => row !== void 0),
28
31
  columns: data.columns.slice(left, left + width)
29
32
  };
30
33
  }
31
- function Grid({ view, caption, noValue, id, heading }) {
34
+ function Grid({ view, caption, noValue, id, heads }) {
32
35
  return /* @__PURE__ */ jsxs("table", {
33
36
  id,
34
37
  children: [
35
38
  caption === void 0 ? null : /* @__PURE__ */ jsx("caption", { children: caption }),
36
- /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [/* @__PURE__ */ jsx("td", { children: heading }), view.columns.map((column) => /* @__PURE__ */ jsx("th", {
39
+ /* @__PURE__ */ jsxs("thead", { children: [heads.across === void 0 ? null : /* @__PURE__ */ jsxs("tr", { children: [/* @__PURE__ */ jsx("td", {}), /* @__PURE__ */ jsx("th", {
40
+ scope: "colgroup",
41
+ colSpan: view.columns.length,
42
+ children: heads.across
43
+ })] }), /* @__PURE__ */ jsxs("tr", { children: [heads.down === void 0 ? /* @__PURE__ */ jsx("td", { children: heads.heading }) : /* @__PURE__ */ jsx("th", {
44
+ scope: "col",
45
+ children: heads.down
46
+ }), view.columns.map((column) => /* @__PURE__ */ jsx("th", {
37
47
  scope: "col",
38
48
  children: column.label
39
- }, column.key))] }) }),
49
+ }, column.key))] })] }),
40
50
  /* @__PURE__ */ jsx("tbody", { children: view.rows.map((row) => /* @__PURE__ */ jsxs("tr", { children: [/* @__PURE__ */ jsx("th", {
41
51
  scope: "row",
42
52
  children: row.label
@@ -45,7 +55,7 @@ function Grid({ view, caption, noValue, id, heading }) {
45
55
  });
46
56
  }
47
57
  function pageLabel(view, data, words) {
48
- return [words.range(view.top + 1, view.top + view.rows.length, data.rows.length, "rows"), ...view.across === 1 ? [] : [words.range(view.left + 1, view.left + view.columns.length, data.columns.length, "columns")]].join(". ");
58
+ return [words.range(view.top + 1, view.top + view.rows.length, data.size, "rows"), ...view.across === 1 ? [] : [words.range(view.left + 1, view.left + view.columns.length, data.columns.length, "columns")]].join(". ");
49
59
  }
50
60
  function PageControls({ view, data, words, choose, focus, id }) {
51
61
  if (view.pages <= 1) return null;
@@ -79,7 +89,7 @@ function PageControls({ view, data, words, choose, focus, id }) {
79
89
  })
80
90
  ] });
81
91
  }
82
- function ReaderPage({ data, caption, noValue, words = ENGLISH, hidden }) {
92
+ function ReaderPage({ table: data, caption, noValue, words = ENGLISH, hidden }) {
83
93
  const [chosen, choose] = useState(0);
84
94
  const [focused, focus] = useState(false);
85
95
  const id = useId();
@@ -98,7 +108,7 @@ function ReaderPage({ data, caption, noValue, words = ENGLISH, hidden }) {
98
108
  view,
99
109
  caption,
100
110
  noValue,
101
- heading: data.heading,
111
+ heads: data,
102
112
  id
103
113
  })]
104
114
  });
@@ -0,0 +1,14 @@
1
+ import { NumberTile } from "./kinds/number.mjs";
2
+ /**
3
+ * The tiles drawn by the charts package: `<DashboardsProvider renderers={CHARTS_RENDERERS}>`.
4
+ * A host that draws only some kinds imports those tiles by name instead, and bundles only them.
5
+ */
6
+ export declare const CHARTS_RENDERERS: {
7
+ line: (props: import("derive-dashboards/react").TileRendererProps) => import("react").JSX.Element;
8
+ bar: (props: import("derive-dashboards/react").TileRendererProps) => import("react").JSX.Element;
9
+ area: (props: import("derive-dashboards/react").TileRendererProps) => import("react").JSX.Element;
10
+ multiples: (props: import("derive-dashboards/react").TileRendererProps) => import("react").JSX.Element;
11
+ heatmap: (props: import("derive-dashboards/react").TileRendererProps) => import("react").JSX.Element;
12
+ funnel: (props: import("derive-dashboards/react").TileRendererProps) => import("react").JSX.Element;
13
+ number: typeof NumberTile;
14
+ };
@@ -0,0 +1,22 @@
1
+ import { AreaTile } from "./kinds/area.mjs";
2
+ import { BarTile } from "./kinds/bar.mjs";
3
+ import { FunnelTile } from "./kinds/funnel.mjs";
4
+ import { HeatmapTile } from "./kinds/heatmap.mjs";
5
+ import { LineTile } from "./kinds/line.mjs";
6
+ import { MultiplesTile } from "./kinds/multiples.mjs";
7
+ import { NumberTile } from "./kinds/number.mjs";
8
+ // src/renderers.ts
9
+ /**
10
+ * The tiles drawn by the charts package: `<DashboardsProvider renderers={CHARTS_RENDERERS}>`.
11
+ * A host that draws only some kinds imports those tiles by name instead, and bundles only them.
12
+ */
13
+ const CHARTS_RENDERERS = {
14
+ line: LineTile,
15
+ bar: BarTile,
16
+ area: AreaTile,
17
+ multiples: MultiplesTile,
18
+ heatmap: HeatmapTile,
19
+ funnel: FunnelTile,
20
+ number: NumberTile
21
+ };
22
+ export { CHARTS_RENDERERS };
@@ -0,0 +1 @@
1
+ import { Scene } from "derive-dashboards/charts";
@@ -0,0 +1,108 @@
1
+ // src/table.ts
2
+ /** An item's value and what it is read against. */
3
+ const cellText = (item) => item.aside === void 0 ? item.value : `${item.value} (${item.aside})`;
4
+ /** A stop's title as a row's heading, with what is said beside it. */
5
+ const rowTitle = (stop) => stop.note === void 0 ? stop.title : `${stop.title} (${stop.note})`;
6
+ /**
7
+ * The table's columns: the scene's own when it says them (every series of a chart over time,
8
+ * one with no value too), else the items', in the order they first appear. An item's key says
9
+ * what its value is of and is the same at every stop, so it is the item's column; the column
10
+ * is headed by the label of its first item. No two items of a stop share a key, so a cell
11
+ * holds one value.
12
+ */
13
+ function columnsOf(hover) {
14
+ if (hover.columns !== void 0) return hover.columns;
15
+ const columns = /* @__PURE__ */ new Map();
16
+ for (const item of hover.stops.flatMap((stop) => stop.items)) if (!columns.has(item.key)) columns.set(item.key, {
17
+ key: item.key,
18
+ label: item.label
19
+ });
20
+ return [...columns.values()];
21
+ }
22
+ /** Rows made once each, the first time each is read. */
23
+ function rowsOnce(size, make) {
24
+ const made = [];
25
+ return (index) => {
26
+ if (index >= 0 && index < size) made[index] ??= make(index);
27
+ return made[index];
28
+ };
29
+ }
30
+ /** A grid's table: its rows and columns are the matrix's, each cell one stop's one value. */
31
+ function matrixTable(hover, matrix) {
32
+ if (matrix === void 0) return;
33
+ const byRow = /* @__PURE__ */ new Map();
34
+ for (const stop of hover.stops) {
35
+ if (stop.cell === void 0) continue;
36
+ const list = byRow.get(stop.cell[0]);
37
+ if (list === void 0) byRow.set(stop.cell[0], [stop]);
38
+ else list.push(stop);
39
+ }
40
+ const row = (r) => {
41
+ const head = matrix.rows[r];
42
+ if (head === void 0) return void 0;
43
+ const cells = [];
44
+ for (const stop of byRow.get(r) ?? []) {
45
+ const [item] = stop.items;
46
+ if (stop.cell !== void 0 && item !== void 0) cells[stop.cell[1]] = cellText(item);
47
+ }
48
+ for (const c of matrix.columns.keys()) cells[c] ??= matrix.cell?.(r, c);
49
+ return {
50
+ ...head,
51
+ cells
52
+ };
53
+ };
54
+ return {
55
+ columns: matrix.columns,
56
+ heading: matrix.heading,
57
+ down: matrix.down,
58
+ across: matrix.across,
59
+ size: matrix.rows.length,
60
+ row: rowsOnce(matrix.rows.length, row)
61
+ };
62
+ }
63
+ /** The table of a scene: a grid's by its matrix, any other chart's a row per stop. */
64
+ function tableOf(scene) {
65
+ const hover = scene.hover;
66
+ if (hover === void 0) return {
67
+ columns: [],
68
+ size: 0,
69
+ row: rowsOnce(0, () => ({
70
+ key: "",
71
+ label: "",
72
+ cells: []
73
+ }))
74
+ };
75
+ const matrix = matrixTable(hover, hover.matrix);
76
+ if (matrix !== void 0) return matrix;
77
+ const columns = columnsOf(hover);
78
+ const slots = new Map(columns.map((c, i) => [c.key, i]));
79
+ const row = (index) => {
80
+ const stop = hover.stops[index];
81
+ if (stop === void 0) return void 0;
82
+ const cells = [];
83
+ for (const item of stop.items) {
84
+ const i = slots.get(item.key);
85
+ if (i !== void 0) cells[i] = cellText(item);
86
+ }
87
+ return {
88
+ key: stop.key,
89
+ label: rowTitle(stop),
90
+ cells
91
+ };
92
+ };
93
+ return {
94
+ columns,
95
+ size: hover.stops.length,
96
+ row: rowsOnce(hover.stops.length, row)
97
+ };
98
+ }
99
+ const TABLES = /* @__PURE__ */ new WeakMap();
100
+ /** A scene's table, made once for the scene. */
101
+ function readTable(scene) {
102
+ const known = TABLES.get(scene);
103
+ if (known !== void 0) return known;
104
+ const table = tableOf(scene);
105
+ TABLES.set(scene, table);
106
+ return table;
107
+ }
108
+ export { readTable };