@snaptrude/plugin-core 0.0.0-dev-20260708130115 → 0.0.0-dev-20260827135706

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 (261) hide show
  1. package/CHANGELOG.md +152 -1
  2. package/api-manifest.json +3620 -276
  3. package/dist/api/analysis/daylight.d.ts +603 -0
  4. package/dist/api/analysis/daylight.d.ts.map +1 -0
  5. package/dist/api/analysis/heatmaps.d.ts +658 -0
  6. package/dist/api/analysis/heatmaps.d.ts.map +1 -0
  7. package/dist/api/analysis/illuminance.d.ts +145 -0
  8. package/dist/api/analysis/illuminance.d.ts.map +1 -0
  9. package/dist/api/analysis/index.d.ts +59 -0
  10. package/dist/api/analysis/index.d.ts.map +1 -0
  11. package/dist/api/analysis/shadows.d.ts +165 -0
  12. package/dist/api/analysis/shadows.d.ts.map +1 -0
  13. package/dist/api/analysis/solar.d.ts +249 -0
  14. package/dist/api/analysis/solar.d.ts.map +1 -0
  15. package/dist/api/analysis/sunlightHours.d.ts +208 -0
  16. package/dist/api/analysis/sunlightHours.d.ts.map +1 -0
  17. package/dist/api/analysis/sunpath.d.ts +80 -0
  18. package/dist/api/analysis/sunpath.d.ts.map +1 -0
  19. package/dist/api/analysis/weather.d.ts +193 -0
  20. package/dist/api/analysis/weather.d.ts.map +1 -0
  21. package/dist/api/core/camera/index.d.ts +261 -0
  22. package/dist/api/core/camera/index.d.ts.map +1 -0
  23. package/dist/api/core/comment/index.d.ts +105 -2
  24. package/dist/api/core/comment/index.d.ts.map +1 -1
  25. package/dist/api/core/geom/create/index.d.ts +840 -14
  26. package/dist/api/core/geom/create/index.d.ts.map +1 -1
  27. package/dist/api/core/geom/delete/index.d.ts +8 -2
  28. package/dist/api/core/geom/delete/index.d.ts.map +1 -1
  29. package/dist/api/core/geom/query/arc.d.ts +5 -5
  30. package/dist/api/core/geom/query/brep.d.ts +130 -18
  31. package/dist/api/core/geom/query/brep.d.ts.map +1 -1
  32. package/dist/api/core/geom/query/circle.d.ts +18 -18
  33. package/dist/api/core/geom/query/contour.d.ts +20 -20
  34. package/dist/api/core/geom/query/curve.d.ts +49 -49
  35. package/dist/api/core/geom/query/edge.d.ts +5 -5
  36. package/dist/api/core/geom/query/face.d.ts +16 -16
  37. package/dist/api/core/geom/query/halfedge.d.ts +8 -8
  38. package/dist/api/core/geom/query/profile.d.ts +19 -19
  39. package/dist/api/core/geom/query/vertex.d.ts +8 -8
  40. package/dist/api/core/geom/update/contour.d.ts +14 -14
  41. package/dist/api/core/geom/update/curve.d.ts +7 -7
  42. package/dist/api/core/geom/update/profile.d.ts +16 -16
  43. package/dist/api/core/handles/index.d.ts +210 -0
  44. package/dist/api/core/handles/index.d.ts.map +1 -0
  45. package/dist/api/core/index.d.ts +34 -0
  46. package/dist/api/core/index.d.ts.map +1 -1
  47. package/dist/api/core/io/export/index.d.ts +134 -0
  48. package/dist/api/core/io/export/index.d.ts.map +1 -0
  49. package/dist/api/core/io/import/index.d.ts +453 -0
  50. package/dist/api/core/io/import/index.d.ts.map +1 -0
  51. package/dist/api/core/io/index.d.ts +40 -0
  52. package/dist/api/core/io/index.d.ts.map +1 -0
  53. package/dist/api/core/io/job/index.d.ts +139 -0
  54. package/dist/api/core/io/job/index.d.ts.map +1 -0
  55. package/dist/api/core/io/query/index.d.ts +74 -0
  56. package/dist/api/core/io/query/index.d.ts.map +1 -0
  57. package/dist/api/core/io/terrain/index.d.ts +341 -0
  58. package/dist/api/core/io/terrain/index.d.ts.map +1 -0
  59. package/dist/api/core/io/underlay/index.d.ts +805 -0
  60. package/dist/api/core/io/underlay/index.d.ts.map +1 -0
  61. package/dist/api/core/layers.d.ts +7 -7
  62. package/dist/api/core/mode/index.d.ts +99 -0
  63. package/dist/api/core/mode/index.d.ts.map +1 -0
  64. package/dist/api/core/project/index.d.ts +68 -1
  65. package/dist/api/core/project/index.d.ts.map +1 -1
  66. package/dist/api/core/proposals/index.d.ts +531 -0
  67. package/dist/api/core/proposals/index.d.ts.map +1 -0
  68. package/dist/api/core/storeys/index.d.ts +265 -0
  69. package/dist/api/core/storeys/index.d.ts.map +1 -0
  70. package/dist/api/core/tags.d.ts +24 -0
  71. package/dist/api/core/tags.d.ts.map +1 -1
  72. package/dist/api/core/user.d.ts +44 -0
  73. package/dist/api/core/user.d.ts.map +1 -0
  74. package/dist/api/core/zoom/index.d.ts +4 -0
  75. package/dist/api/core/zoom/index.d.ts.map +1 -1
  76. package/dist/api/design/boolean/index.d.ts +4 -4
  77. package/dist/api/design/create/index.d.ts +568 -45
  78. package/dist/api/design/create/index.d.ts.map +1 -1
  79. package/dist/api/design/delete/index.d.ts +3 -0
  80. package/dist/api/design/delete/index.d.ts.map +1 -1
  81. package/dist/api/design/doors/index.d.ts +195 -0
  82. package/dist/api/design/doors/index.d.ts.map +1 -1
  83. package/dist/api/design/edit/index.d.ts +1 -1
  84. package/dist/api/design/erase/index.d.ts +2 -2
  85. package/dist/api/design/family.d.ts +349 -0
  86. package/dist/api/design/family.d.ts.map +1 -0
  87. package/dist/api/design/furniture/index.d.ts +181 -8
  88. package/dist/api/design/furniture/index.d.ts.map +1 -1
  89. package/dist/api/design/index.d.ts +98 -0
  90. package/dist/api/design/index.d.ts.map +1 -1
  91. package/dist/api/design/lock.d.ts +26 -0
  92. package/dist/api/design/lock.d.ts.map +1 -1
  93. package/dist/api/design/materials/index.d.ts +270 -16
  94. package/dist/api/design/materials/index.d.ts.map +1 -1
  95. package/dist/api/design/query/geometry/index.d.ts +112 -0
  96. package/dist/api/design/query/geometry/index.d.ts.map +1 -1
  97. package/dist/api/design/query/index.d.ts +282 -11
  98. package/dist/api/design/query/index.d.ts.map +1 -1
  99. package/dist/api/design/query/referenceLines.d.ts +45 -0
  100. package/dist/api/design/query/referenceLines.d.ts.map +1 -0
  101. package/dist/api/design/query/spaces.d.ts +181 -8
  102. package/dist/api/design/query/spaces.d.ts.map +1 -1
  103. package/dist/api/design/selection/index.d.ts +144 -0
  104. package/dist/api/design/selection/index.d.ts.map +1 -1
  105. package/dist/api/design/transform/index.d.ts +172 -10
  106. package/dist/api/design/transform/index.d.ts.map +1 -1
  107. package/dist/api/design/types/index.d.ts +181 -0
  108. package/dist/api/design/types/index.d.ts.map +1 -0
  109. package/dist/api/design/update/index.d.ts +553 -2
  110. package/dist/api/design/update/index.d.ts.map +1 -1
  111. package/dist/api/design/visibility.d.ts +126 -0
  112. package/dist/api/design/visibility.d.ts.map +1 -0
  113. package/dist/api/design/windows/index.d.ts +113 -2
  114. package/dist/api/design/windows/index.d.ts.map +1 -1
  115. package/dist/api/entity/buildableEnvelope.d.ts +4 -0
  116. package/dist/api/entity/buildableEnvelope.d.ts.map +1 -1
  117. package/dist/api/entity/referenceLine.d.ts +10 -2
  118. package/dist/api/entity/referenceLine.d.ts.map +1 -1
  119. package/dist/api/entity/space.d.ts +21 -21
  120. package/dist/api/entity/story.d.ts +242 -15
  121. package/dist/api/entity/story.d.ts.map +1 -1
  122. package/dist/api/index.d.ts +10 -0
  123. package/dist/api/index.d.ts.map +1 -1
  124. package/dist/api/presentation/aiInspiration.d.ts +25 -25
  125. package/dist/api/presentation/annotate.d.ts +467 -0
  126. package/dist/api/presentation/annotate.d.ts.map +1 -0
  127. package/dist/api/presentation/diagrams.d.ts +111 -8
  128. package/dist/api/presentation/diagrams.d.ts.map +1 -1
  129. package/dist/api/presentation/export.d.ts +108 -0
  130. package/dist/api/presentation/export.d.ts.map +1 -0
  131. package/dist/api/presentation/import.d.ts +55 -4
  132. package/dist/api/presentation/import.d.ts.map +1 -1
  133. package/dist/api/presentation/index.d.ts +58 -1
  134. package/dist/api/presentation/index.d.ts.map +1 -1
  135. package/dist/api/presentation/placedViews.d.ts +1139 -0
  136. package/dist/api/presentation/placedViews.d.ts.map +1 -0
  137. package/dist/api/presentation/shapes.d.ts +481 -0
  138. package/dist/api/presentation/shapes.d.ts.map +1 -0
  139. package/dist/api/presentation/sheets.d.ts +452 -13
  140. package/dist/api/presentation/sheets.d.ts.map +1 -1
  141. package/dist/api/presentation/slideshow.d.ts +125 -0
  142. package/dist/api/presentation/slideshow.d.ts.map +1 -0
  143. package/dist/api/presentation/tables.d.ts +81 -0
  144. package/dist/api/presentation/tables.d.ts.map +1 -0
  145. package/dist/api/presentation/views.d.ts +367 -7
  146. package/dist/api/presentation/views.d.ts.map +1 -1
  147. package/dist/api/program/areas.d.ts +102 -12
  148. package/dist/api/program/areas.d.ts.map +1 -1
  149. package/dist/api/program/cores.d.ts +3 -99
  150. package/dist/api/program/cores.d.ts.map +1 -1
  151. package/dist/api/program/index.d.ts +7 -15
  152. package/dist/api/program/index.d.ts.map +1 -1
  153. package/dist/api/program/layout.d.ts +346 -11
  154. package/dist/api/program/layout.d.ts.map +1 -1
  155. package/dist/api/program/site.d.ts +469 -13
  156. package/dist/api/program/site.d.ts.map +1 -1
  157. package/dist/api/program/spreadsheet.d.ts +365 -41
  158. package/dist/api/program/spreadsheet.d.ts.map +1 -1
  159. package/dist/api/workspace/index.d.ts +505 -0
  160. package/dist/api/workspace/index.d.ts.map +1 -0
  161. package/dist/errors/codes.d.ts +34 -0
  162. package/dist/errors/codes.d.ts.map +1 -0
  163. package/dist/errors/envelope.d.ts +56 -0
  164. package/dist/errors/envelope.d.ts.map +1 -0
  165. package/dist/errors/index.d.ts +6 -0
  166. package/dist/errors/index.d.ts.map +1 -0
  167. package/dist/errors/plugin-error.d.ts +69 -0
  168. package/dist/errors/plugin-error.d.ts.map +1 -0
  169. package/dist/handles.d.ts +97 -25
  170. package/dist/handles.d.ts.map +1 -1
  171. package/dist/host-utils.d.ts +4 -0
  172. package/dist/host-utils.d.ts.map +1 -1
  173. package/dist/index.cjs +4582 -1422
  174. package/dist/index.cjs.map +1 -1
  175. package/dist/index.d.ts +1 -0
  176. package/dist/index.d.ts.map +1 -1
  177. package/dist/index.js +4171 -1411
  178. package/dist/index.js.map +1 -1
  179. package/package.json +4 -2
  180. package/scripts/generate-manifest.mjs +45 -0
  181. package/scripts/generate-manifest.test.mjs +103 -4
  182. package/src/api/analysis/daylight.ts +470 -0
  183. package/src/api/analysis/heatmaps.ts +683 -0
  184. package/src/api/analysis/illuminance.ts +155 -0
  185. package/src/api/analysis/index.ts +61 -0
  186. package/src/api/analysis/shadows.ts +183 -0
  187. package/src/api/analysis/solar.ts +237 -0
  188. package/src/api/analysis/sunlightHours.ts +211 -0
  189. package/src/api/analysis/sunpath.ts +83 -0
  190. package/src/api/analysis/weather.ts +179 -0
  191. package/src/api/core/camera/index.ts +268 -0
  192. package/src/api/core/comment/index.ts +120 -2
  193. package/src/api/core/geom/create/index.ts +912 -1
  194. package/src/api/core/geom/delete/index.ts +6 -0
  195. package/src/api/core/geom/query/brep.ts +119 -0
  196. package/src/api/core/handles/index.ts +233 -0
  197. package/src/api/core/index.ts +34 -0
  198. package/src/api/core/io/export/index.ts +126 -0
  199. package/src/api/core/io/import/index.ts +496 -0
  200. package/src/api/core/io/index.ts +42 -0
  201. package/src/api/core/io/job/index.ts +140 -0
  202. package/src/api/core/io/query/index.ts +71 -0
  203. package/src/api/core/io/terrain/index.ts +360 -0
  204. package/src/api/core/io/underlay/index.ts +705 -0
  205. package/src/api/core/mode/index.ts +96 -0
  206. package/src/api/core/project/index.ts +62 -1
  207. package/src/api/core/proposals/index.ts +569 -0
  208. package/src/api/core/storeys/index.ts +294 -0
  209. package/src/api/core/tags.ts +27 -0
  210. package/src/api/core/user.ts +46 -0
  211. package/src/api/core/zoom/index.ts +4 -0
  212. package/src/api/design/create/index.ts +670 -30
  213. package/src/api/design/delete/index.ts +3 -0
  214. package/src/api/design/doors/index.ts +208 -0
  215. package/src/api/design/erase/index.ts +1 -1
  216. package/src/api/design/family.ts +388 -0
  217. package/src/api/design/furniture/index.ts +197 -8
  218. package/src/api/design/index.ts +102 -0
  219. package/src/api/design/lock.ts +27 -0
  220. package/src/api/design/materials/index.ts +334 -27
  221. package/src/api/design/query/geometry/index.ts +125 -3
  222. package/src/api/design/query/index.ts +217 -7
  223. package/src/api/design/query/referenceLines.ts +52 -0
  224. package/src/api/design/query/spaces.ts +143 -0
  225. package/src/api/design/selection/index.ts +129 -0
  226. package/src/api/design/transform/index.ts +170 -9
  227. package/src/api/design/types/index.ts +156 -0
  228. package/src/api/design/update/index.ts +631 -3
  229. package/src/api/design/visibility.ts +143 -0
  230. package/src/api/design/windows/index.ts +128 -2
  231. package/src/api/entity/buildableEnvelope.ts +4 -0
  232. package/src/api/entity/referenceLine.ts +8 -0
  233. package/src/api/entity/story.ts +259 -15
  234. package/src/api/index.ts +10 -0
  235. package/src/api/presentation/annotate.ts +385 -0
  236. package/src/api/presentation/diagrams.ts +118 -8
  237. package/src/api/presentation/export.ts +108 -0
  238. package/src/api/presentation/import.ts +51 -4
  239. package/src/api/presentation/index.ts +66 -1
  240. package/src/api/presentation/placedViews.ts +1120 -0
  241. package/src/api/presentation/shapes.ts +274 -0
  242. package/src/api/presentation/sheets.ts +400 -13
  243. package/src/api/presentation/slideshow.ts +134 -0
  244. package/src/api/presentation/tables.ts +84 -0
  245. package/src/api/presentation/views.ts +376 -8
  246. package/src/api/program/areas.ts +88 -15
  247. package/src/api/program/cores.ts +3 -91
  248. package/src/api/program/index.ts +7 -15
  249. package/src/api/program/layout.ts +365 -11
  250. package/src/api/program/site.ts +435 -13
  251. package/src/api/program/spreadsheet.ts +376 -35
  252. package/src/api/workspace/index.ts +563 -0
  253. package/src/errors/codes.ts +136 -0
  254. package/src/errors/envelope.ts +75 -0
  255. package/src/errors/index.ts +21 -0
  256. package/src/errors/plugin-error.ts +134 -0
  257. package/src/handles.ts +123 -13
  258. package/src/host-utils.ts +4 -0
  259. package/src/index.ts +1 -0
  260. package/test/errors.test.mjs +184 -0
  261. package/tsconfig.json +7 -2
@@ -0,0 +1,658 @@
1
+ import * as z from "zod";
2
+ import { PluginApiReturn } from "../../types";
3
+ import { ComponentHandle, Vec3Components } from "../../handles";
4
+ /**
5
+ * Analysis heatmaps — render plugin-computed scalar data as a heatmap.
6
+ *
7
+ * Unlike the built-in studies ({@linkcode PluginAnalysisSunlightHoursApi},
8
+ * {@linkcode PluginAnalysisIlluminanceApi}) where the host computes the
9
+ * values, here the **plugin brings its own numbers** and the host renders
10
+ * them. Two render modes:
11
+ *
12
+ * - {@linkcode PluginAnalysisHeatmapsApi.renderSpaces} — one flat colour per
13
+ * space, painted on the space's top face (occupancy, energy use, any
14
+ * per-room metric).
15
+ * - {@linkcode PluginAnalysisHeatmapsApi.renderGrid} — a coloured grid mesh
16
+ * from point samples in world coordinates (wind, noise, microclimate — any
17
+ * field sampled over an area).
18
+ * - {@linkcode PluginAnalysisHeatmapsApi.renderField} — arbitrary planar
19
+ * polygon cells (or pre-tessellated meshes), one scalar value each — for
20
+ * non-square analysis meshes straight from a solver.
21
+ *
22
+ * Shared semantics:
23
+ *
24
+ * - **Named overlays** — every render call targets a named overlay
25
+ * (`options.name`; a shared default overlay when omitted). Rendering an
26
+ * existing name replaces that overlay only; the newly rendered overlay
27
+ * becomes the visible one — **exactly one overlay is visible at a time**.
28
+ * Up to 16 overlays can be registered; manage them (list / show / hide /
29
+ * remove) via {@linkcode PluginAnalysisHeatmapsApi.overlays}.
30
+ * - **Legend** — the host renders a legend card from
31
+ * {@linkcode PluginAnalysisHeatmapOptions} (title, unit, min/max, colour
32
+ * segments). Values outside `[min, max]` **clamp to the end colours** and
33
+ * the legend shows `<` / `>` markers at the clamped ends.
34
+ * - **Hover tooltip** — pass `options.hover: true` to any render call and,
35
+ * while that overlay is visible, hovering a cell shows a tooltip with the
36
+ * cell's `value` (and its `meta` payload, when the cell carries one).
37
+ * - **Ephemeral** — the heatmap is a transient overlay: never persisted,
38
+ * never saved with views, and auto-cleared when a scene-mutating edit
39
+ * invalidates it. Re-render after changing the model.
40
+ *
41
+ * Accessed via `snaptrude.analysis.heatmaps`.
42
+ */
43
+ export declare abstract class PluginAnalysisHeatmapsApi {
44
+ /**
45
+ * Manage the named heatmap overlays created by the render calls —
46
+ * list / show / hide / remove. See
47
+ * {@linkcode PluginAnalysisHeatmapOverlaysApi}.
48
+ */
49
+ abstract overlays: PluginAnalysisHeatmapOverlaysApi;
50
+ constructor();
51
+ /**
52
+ * Render a per-space heatmap — one flat colour per space's top face.
53
+ *
54
+ * Each entry maps a space to a scalar value; the value is mapped through
55
+ * the colour ramp (see {@linkcode PluginAnalysisHeatmapOptions}) and the
56
+ * space's top face is painted that single flat colour. Renders into the
57
+ * overlay named `options.name` (the default overlay when omitted),
58
+ * replacing that overlay only and making it the visible one. Spaces whose top
59
+ * face is not flat (pitched/sloped tops) are **skipped with a console
60
+ * warning** — the rest of the heatmap still renders.
61
+ *
62
+ * The heatmap is ephemeral: it is auto-cleared by scene-mutating edits
63
+ * and is never persisted or saved with views.
64
+ *
65
+ * @param entries - One {@linkcode PluginAnalysisHeatmapSpaceEntry} per
66
+ * space: the space's handle and its scalar value.
67
+ * @param options - {@linkcode PluginAnalysisHeatmapOptions} — legend
68
+ * title/unit, explicit min/max range (auto-derived from the data when
69
+ * omitted), and the colour ramp.
70
+ * @returns A {@linkcode PluginAnalysisHeatmapsRenderResult} —
71
+ * `{ success: true }` once the heatmap is rendered.
72
+ * @throws When `entries` is empty or a handle does not resolve to a space.
73
+ * @throws When no space had a flat top face to paint (every entry was
74
+ * skipped).
75
+ * @throws When `options.min` is greater than `options.max`.
76
+ * @throws When a colour in `options.colors` is not a 6-digit hex colour.
77
+ * @throws When `options.name` is a new overlay name and the 16-overlay
78
+ * cap is reached.
79
+ * @throws When plugin writes are disabled.
80
+ *
81
+ * @examplePrompt Color each room by its occupancy count
82
+ * @examplePrompt Show my energy simulation results as a heatmap per space
83
+ * @examplePrompt Paint the rooms red to blue by temperature
84
+ *
85
+ * # Example
86
+ * ```ts
87
+ * const spaces = await snaptrude.design.query.listSpaces()
88
+ * await snaptrude.analysis.heatmaps.renderSpaces(
89
+ * spaces.map((space) => ({ space, value: occupancy[space] ?? 0 })),
90
+ * { title: "Occupancy", unit: "people", min: 0, max: 50 },
91
+ * )
92
+ * ```
93
+ */
94
+ abstract renderSpaces(entries: PluginAnalysisHeatmapSpaceEntry[], options?: PluginAnalysisHeatmapOptions): PluginApiReturn<PluginAnalysisHeatmapsRenderResult>;
95
+ /**
96
+ * Render a grid heatmap — a coloured mesh from point samples.
97
+ *
98
+ * Each cell is a scalar sample at a **world-coordinate** position
99
+ * (**y is up** — a ground-level field sits at `y = 0`); the host builds
100
+ * one square cell of edge `cellSize` per sample — in the same Snaptrude
101
+ * internal units as `position` (convert real-world lengths via
102
+ * {@linkcode PluginUnitsApi.convert}) — coloured by mapping the value
103
+ * through the colour ramp
104
+ * (see {@linkcode PluginAnalysisHeatmapOptions}). This is the mode for
105
+ * field data — wind, noise, microclimate — sampled over an area. Renders
106
+ * into the overlay named `options.name` (the default overlay when
107
+ * omitted), replacing that overlay only and making it the visible one.
108
+ *
109
+ * The heatmap is ephemeral: it is auto-cleared by scene-mutating edits
110
+ * and is never persisted or saved with views.
111
+ *
112
+ * @param cells - One {@linkcode PluginAnalysisHeatmapGridCell} per
113
+ * sample: a world-coordinate `position` (y up) and its scalar `value`.
114
+ * @param cellSize - Edge length of each (square) cell, in the same
115
+ * Snaptrude internal units as `position` (see
116
+ * {@linkcode PluginUnitsApi.convert}). Must be a positive, finite number.
117
+ * @param options - {@linkcode PluginAnalysisHeatmapOptions} — legend
118
+ * title/unit, explicit min/max range (auto-derived from the data when
119
+ * omitted), and the colour ramp.
120
+ * @returns A {@linkcode PluginAnalysisHeatmapsRenderResult} —
121
+ * `{ success: true }` once the heatmap is rendered.
122
+ * @throws When `cells` is empty or `cellSize` is not a positive, finite number.
123
+ * @throws When `options.min` is greater than `options.max`.
124
+ * @throws When a colour in `options.colors` is not a 6-digit hex colour.
125
+ * @throws When `options.name` is a new overlay name and the 16-overlay
126
+ * cap is reached.
127
+ * @throws When plugin writes are disabled.
128
+ *
129
+ * @examplePrompt Overlay my CFD wind simulation results on the site
130
+ * @examplePrompt Render a noise-level grid around the building
131
+ * @examplePrompt Show these sampled microclimate values as a colored grid
132
+ *
133
+ * # Example
134
+ * ```ts
135
+ * // World coordinates are y-up: a ground-level field varies in x/z at y = 0.
136
+ * await snaptrude.analysis.heatmaps.renderGrid(
137
+ * samples.map((s) => ({ position: { x: s.x, y: 0, z: s.z }, value: s.windSpeed })),
138
+ * 2, // 2-unit square cells
139
+ * { title: "Wind speed", unit: "m/s", colors: ["#0000ff", "#00ff00", "#ff0000"] },
140
+ * )
141
+ * ```
142
+ */
143
+ abstract renderGrid(cells: PluginAnalysisHeatmapGridCell[], cellSize: number, options?: PluginAnalysisHeatmapOptions): PluginApiReturn<PluginAnalysisHeatmapsRenderResult>;
144
+ /**
145
+ * Render a grid heatmap on an **arbitrarily oriented plane** — a façade,
146
+ * a section cut, any flat surface.
147
+ *
148
+ * The same point-sample model as
149
+ * {@linkcode PluginAnalysisHeatmapsApi.renderGrid}, generalised: cells lie
150
+ * on the plane whose direction is given by `normal` (for a façade, the
151
+ * outward wall normal). Each cell is a square of edge `cellSize` centred
152
+ * on its **world-coordinate** `position` and oriented in that plane; the
153
+ * host derives the in-plane axes from the normal and offsets each cell a
154
+ * hair along it so the heatmap never z-fights the surface it annotates.
155
+ * Cell positions should lie on (or very near) the surface being
156
+ * annotated — the host does not project them. Renders into the overlay
157
+ * named `options.name` (the default overlay when omitted), replacing
158
+ * that overlay only and making it the visible one.
159
+ *
160
+ * This is the mode for per-façade data — solar irradiance, glare, panel
161
+ * yield, wind pressure — sampled over a vertical or sloped face. For
162
+ * horizontal ground fields prefer
163
+ * {@linkcode PluginAnalysisHeatmapsApi.renderGrid}, which is this call
164
+ * with `normal = { x: 0, y: 1, z: 0 }`.
165
+ *
166
+ * The heatmap is ephemeral: it is auto-cleared by scene-mutating edits
167
+ * and is never persisted or saved with views.
168
+ *
169
+ * @param cells - One {@linkcode PluginAnalysisHeatmapGridCell} per
170
+ * sample: a world-coordinate `position` on the surface plane (y up)
171
+ * and its scalar `value`.
172
+ * @param cellSize - Edge length of each (square) cell, in the same
173
+ * Snaptrude internal units as `position` (see
174
+ * {@linkcode PluginUnitsApi.convert}). Must be a positive, finite number.
175
+ * @param normal - The plane's normal direction as `{ x, y, z }` (for a
176
+ * façade, the outward wall normal — read it via
177
+ * `core.geom.query.face.getNormal` on the wall's face). Any non-zero
178
+ * length; the host normalises it.
179
+ * @param options - {@linkcode PluginAnalysisHeatmapOptions} — legend
180
+ * title/unit, explicit min/max range (auto-derived from the data when
181
+ * omitted), and the colour ramp.
182
+ * @returns A {@linkcode PluginAnalysisHeatmapsRenderResult} —
183
+ * `{ success: true }` once the heatmap is rendered.
184
+ * @throws When `cells` is empty, `cellSize` is not a positive finite
185
+ * number, or `normal` has zero length.
186
+ * @throws When `options.min` is greater than `options.max`.
187
+ * @throws When a colour in `options.colors` is not a 6-digit hex colour.
188
+ * @throws When `options.name` is a new overlay name and the 16-overlay
189
+ * cap is reached.
190
+ * @throws When plugin writes are disabled.
191
+ *
192
+ * @examplePrompt Paint the solar irradiance results on the south façade
193
+ * @examplePrompt Show my daylight values as a heatmap on this wall
194
+ * @examplePrompt Render panel-level PV yield on the building face
195
+ * @examplePrompt Overlay wind pressure on the tower's west elevation
196
+ *
197
+ * # Example
198
+ * ```ts
199
+ * // Samples lie on a wall plane facing +X; colour each 1-unit cell by irradiance.
200
+ * await snaptrude.analysis.heatmaps.renderSurfaceGrid(
201
+ * samples.map((s) => ({ position: { x: wallX, y: s.y, z: s.z }, value: s.irradiance })),
202
+ * 1,
203
+ * { x: 1, y: 0, z: 0 }, // façade normal
204
+ * { title: "Irradiance", unit: "kWh/m²", colors: ["#0000ff", "#ffff00", "#ff0000"] },
205
+ * )
206
+ * ```
207
+ */
208
+ abstract renderSurfaceGrid(cells: PluginAnalysisHeatmapGridCell[], cellSize: number, normal: Vec3Components, options?: PluginAnalysisHeatmapOptions): PluginApiReturn<PluginAnalysisHeatmapsRenderResult>;
209
+ /**
210
+ * Render a heatmap from **arbitrary cell geometry** — planar polygons or
211
+ * pre-tessellated meshes, one scalar value each.
212
+ *
213
+ * The free-form sibling of the grid calls: instead of square cells, each
214
+ * {@linkcode PluginAnalysisHeatmapFieldCell} brings its own footprint in
215
+ * **world coordinates** (y up) — either a planar `polygon` ring (3+
216
+ * points, any orientation; the host triangulates it) or a pre-tessellated
217
+ * `vertices` + `indices` mesh (triangle list). This is the mode for
218
+ * analysis meshes straight from a solver: FEA/CFD cells, Voronoi regions,
219
+ * per-panel façade patches — anything not on a square grid. Each cell's
220
+ * `value` is mapped through the colour scale
221
+ * (see {@linkcode PluginAnalysisHeatmapOptions}, including
222
+ * `options.scale`); an optional `meta` payload is stored with the overlay
223
+ * for later features. Renders into the overlay named `options.name` (the
224
+ * default overlay when omitted), replacing that overlay only and making
225
+ * it the visible one.
226
+ *
227
+ * Degenerate polygon cells (collinear points, zero area) are **skipped
228
+ * with a console warning** — the rest of the heatmap still renders.
229
+ *
230
+ * The heatmap is ephemeral: it is auto-cleared by scene-mutating edits
231
+ * and is never persisted or saved with views.
232
+ *
233
+ * @param cells - One {@linkcode PluginAnalysisHeatmapFieldCell} per cell:
234
+ * a planar `polygon` ring OR a `vertices`/`indices` triangle mesh, plus
235
+ * its scalar `value` and optional `meta`.
236
+ * @param options - {@linkcode PluginAnalysisHeatmapOptions} — legend
237
+ * title/unit, min/max range, colour ramp, and the colour `scale`
238
+ * (bands / threshold / categorical).
239
+ * @returns A {@linkcode PluginAnalysisHeatmapsRenderResult} —
240
+ * `{ success: true }` once the heatmap is rendered.
241
+ * @throws When `cells` is empty, a polygon has fewer than 3 points, a
242
+ * pre-tessellated cell's `indices` length is not a multiple of 3, or an
243
+ * index is out of range of its `vertices`.
244
+ * @throws When every polygon cell was degenerate (nothing renderable).
245
+ * @throws When a `categorical` scale has no class for a cell's value.
246
+ * @throws When `options.min` is greater than `options.max`, or a colour
247
+ * is not a 6-digit hex colour.
248
+ * @throws When `options.name` is a new overlay name and the 16-overlay
249
+ * cap is reached.
250
+ * @throws When plugin writes are disabled.
251
+ *
252
+ * @examplePrompt Overlay my FEA stress results on their solver mesh
253
+ * @examplePrompt Color these Voronoi regions by footfall
254
+ * @examplePrompt Paint each façade panel polygon by its PV yield
255
+ * @examplePrompt Render pass/fail daylight compliance per zone polygon
256
+ *
257
+ * # Example
258
+ * ```ts
259
+ * // Two triangular cells at ground level, coloured pass/fail at 300 lux.
260
+ * await snaptrude.analysis.heatmaps.renderField(
261
+ * [
262
+ * { polygon: [{ x: 0, y: 0, z: 0 }, { x: 4, y: 0, z: 0 }, { x: 0, y: 0, z: 4 }], value: 420 },
263
+ * { polygon: [{ x: 4, y: 0, z: 4 }, { x: 0, y: 0, z: 4 }, { x: 4, y: 0, z: 0 }], value: 180 },
264
+ * ],
265
+ * { title: "Daylight", unit: "lux", scale: { type: "threshold", threshold: 300 } },
266
+ * )
267
+ * ```
268
+ */
269
+ abstract renderField(cells: PluginAnalysisHeatmapFieldCell[], options?: PluginAnalysisHeatmapOptions): PluginApiReturn<PluginAnalysisHeatmapsRenderResult>;
270
+ /**
271
+ * Clear every plugin heatmap overlay from the scene.
272
+ *
273
+ * Removes **all** registered overlays (equivalent to
274
+ * {@linkcode PluginAnalysisHeatmapOverlaysApi.removeAll}) and closes the
275
+ * legend. A no-op (returns `false`) when no plugin heatmap exists. Does
276
+ * not touch the built-in study heatmaps (`sunlightHours` /
277
+ * `illuminance`) — they have their own `reset`.
278
+ *
279
+ * @returns `true` when at least one overlay was cleared, `false` when
280
+ * none existed.
281
+ * @throws When plugin writes are disabled.
282
+ *
283
+ * @examplePrompt Clear my custom heatmap
284
+ * @examplePrompt Remove the wind overlay from the model
285
+ * @examplePrompt Reset the plugin heatmap view
286
+ *
287
+ * # Example
288
+ * ```ts
289
+ * await snaptrude.analysis.heatmaps.reset()
290
+ * ```
291
+ */
292
+ abstract reset(): PluginApiReturn<boolean>;
293
+ /**
294
+ * Is a plugin heatmap currently showing?
295
+ *
296
+ * `true` between a successful render and the next
297
+ * {@linkcode PluginAnalysisHeatmapsApi.reset} — or the scene-mutating
298
+ * edit that auto-clears it (heatmaps are ephemeral).
299
+ *
300
+ * @returns `true` when a plugin heatmap is rendered on the scene.
301
+ *
302
+ * @examplePrompt Is my heatmap still showing?
303
+ * @examplePrompt Check whether the custom heatmap is active
304
+ * @examplePrompt Do I need to re-render the wind overlay?
305
+ *
306
+ * # Example
307
+ * ```ts
308
+ * if (!(await snaptrude.analysis.heatmaps.isActive())) {
309
+ * await snaptrude.analysis.heatmaps.renderGrid(cells, 2)
310
+ * }
311
+ * ```
312
+ */
313
+ abstract isActive(): PluginApiReturn<boolean>;
314
+ }
315
+ /**
316
+ * Heatmap overlay management — the named overlays created by the
317
+ * `analysis.heatmaps` render calls.
318
+ *
319
+ * Every render call registers (or replaces) an overlay under
320
+ * `options.name` — a shared default overlay when omitted. Overlays are
321
+ * in-session only: never persisted, never saved with views, and **all**
322
+ * of them are cleared together when a scene-mutating edit invalidates
323
+ * them. At most 16 overlays can be registered at once, and **exactly one
324
+ * overlay is visible at a time** — showing one hides the others, and the
325
+ * legend always describes the visible overlay.
326
+ *
327
+ * Accessed via `snaptrude.analysis.heatmaps.overlays`.
328
+ */
329
+ export declare abstract class PluginAnalysisHeatmapOverlaysApi {
330
+ constructor();
331
+ /**
332
+ * List the registered heatmap overlays.
333
+ *
334
+ * Returns every overlay's `name`, `kind` (which render call produced
335
+ * it: `"spaces"`, `"grid"`, `"surfaceGrid"` or `"field"`) and whether it is the
336
+ * currently visible one. At most one overlay has `visible: true`.
337
+ *
338
+ * @returns A {@linkcode PluginAnalysisHeatmapOverlaysListResult} —
339
+ * `{ overlays: [{ name, visible, kind }] }`, empty when nothing is
340
+ * registered.
341
+ *
342
+ * @examplePrompt Which heatmap overlays do I have?
343
+ * @examplePrompt List my rendered analysis overlays
344
+ * @examplePrompt Check which heatmap is currently visible
345
+ *
346
+ * # Example
347
+ * ```ts
348
+ * const { overlays } = await snaptrude.analysis.heatmaps.overlays.list()
349
+ * const visible = overlays.find((o) => o.visible)
350
+ * ```
351
+ */
352
+ abstract list(): PluginApiReturn<PluginAnalysisHeatmapOverlaysListResult>;
353
+ /**
354
+ * Make a registered overlay the visible one.
355
+ *
356
+ * Enables the named overlay's meshes, hides whichever overlay was
357
+ * visible before, and swaps the legend to the shown overlay's. A no-op
358
+ * returning `false` when no overlay of that name exists.
359
+ *
360
+ * @param name - The overlay's name (`options.name` at render time).
361
+ * @returns `true` when the overlay is now visible, `false` when no
362
+ * overlay of that name exists.
363
+ * @throws When plugin writes are disabled.
364
+ *
365
+ * @examplePrompt Switch back to my wind heatmap
366
+ * @examplePrompt Show the occupancy overlay
367
+ * @examplePrompt Flip between my two analysis overlays
368
+ *
369
+ * # Example
370
+ * ```ts
371
+ * await snaptrude.analysis.heatmaps.overlays.show("wind")
372
+ * ```
373
+ */
374
+ abstract show(name: string): PluginApiReturn<boolean>;
375
+ /**
376
+ * Hide an overlay without removing it.
377
+ *
378
+ * Disables the named overlay's meshes; when it was the visible one its
379
+ * legend closes too (nothing visible → no legend). The overlay stays
380
+ * registered and can be brought back with
381
+ * {@linkcode PluginAnalysisHeatmapOverlaysApi.show}. A no-op returning
382
+ * `false` when no overlay of that name exists.
383
+ *
384
+ * @param name - The overlay's name (`options.name` at render time).
385
+ * @returns `true` when the overlay exists (and is now hidden), `false`
386
+ * when no overlay of that name exists.
387
+ * @throws When plugin writes are disabled.
388
+ *
389
+ * @examplePrompt Hide the wind overlay but keep it around
390
+ * @examplePrompt Temporarily hide my heatmap
391
+ * @examplePrompt Turn off the occupancy colours without deleting them
392
+ *
393
+ * # Example
394
+ * ```ts
395
+ * await snaptrude.analysis.heatmaps.overlays.hide("wind")
396
+ * ```
397
+ */
398
+ abstract hide(name: string): PluginApiReturn<boolean>;
399
+ /**
400
+ * Remove an overlay — dispose its meshes and forget it.
401
+ *
402
+ * Frees the overlay's slot toward the 16-overlay cap; when it was the
403
+ * visible one its legend closes. A no-op returning `false` when no
404
+ * overlay of that name exists.
405
+ *
406
+ * @param name - The overlay's name (`options.name` at render time).
407
+ * @returns `true` when the overlay was removed, `false` when no overlay
408
+ * of that name exists.
409
+ * @throws When plugin writes are disabled.
410
+ *
411
+ * @examplePrompt Delete the wind overlay
412
+ * @examplePrompt Remove my occupancy heatmap for good
413
+ * @examplePrompt Free up an overlay slot
414
+ *
415
+ * # Example
416
+ * ```ts
417
+ * await snaptrude.analysis.heatmaps.overlays.remove("wind")
418
+ * ```
419
+ */
420
+ abstract remove(name: string): PluginApiReturn<boolean>;
421
+ /**
422
+ * Remove every registered overlay and close the legend.
423
+ *
424
+ * The bulk form of {@linkcode PluginAnalysisHeatmapOverlaysApi.remove};
425
+ * `analysis.heatmaps.reset()` is this call under its historical name.
426
+ *
427
+ * @returns The number of overlays removed (`0` when none existed).
428
+ * @throws When plugin writes are disabled.
429
+ *
430
+ * @examplePrompt Clear all my heatmap overlays
431
+ * @examplePrompt Remove every analysis overlay from the scene
432
+ * @examplePrompt Start over with a clean set of overlays
433
+ *
434
+ * # Example
435
+ * ```ts
436
+ * const removed = await snaptrude.analysis.heatmaps.overlays.removeAll()
437
+ * ```
438
+ */
439
+ abstract removeAll(): PluginApiReturn<number>;
440
+ }
441
+ /**
442
+ * One space's entry in {@linkcode PluginAnalysisHeatmapsApi.renderSpaces}.
443
+ *
444
+ * | Property | Type | Description |
445
+ * |---|---|---|
446
+ * | `space` | {@linkcode ComponentHandle} | Handle of the space to colour |
447
+ * | `value` | `number` | The scalar value mapped to a colour |
448
+ */
449
+ export declare const PluginAnalysisHeatmapSpaceEntry: z.ZodObject<{
450
+ space: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
451
+ value: z.ZodNumber;
452
+ }, z.core.$strip>;
453
+ export type PluginAnalysisHeatmapSpaceEntry = z.infer<typeof PluginAnalysisHeatmapSpaceEntry>;
454
+ /**
455
+ * One grid sample in {@linkcode PluginAnalysisHeatmapsApi.renderGrid}.
456
+ *
457
+ * | Property | Type | Description |
458
+ * |---|---|---|
459
+ * | `position` | `{ x, y, z }` | Cell centre in **world coordinates** (y is up) |
460
+ * | `value` | `number` | The scalar value mapped to a colour |
461
+ * | `meta` | `unknown \| undefined` | Optional payload stored with the overlay — shown in the hover tooltip when `options.hover` is on |
462
+ */
463
+ export declare const PluginAnalysisHeatmapGridCell: z.ZodObject<{
464
+ position: z.ZodObject<{
465
+ x: z.ZodNumber;
466
+ y: z.ZodNumber;
467
+ z: z.ZodNumber;
468
+ }, z.core.$strip>;
469
+ value: z.ZodNumber;
470
+ meta: z.ZodOptional<z.ZodUnknown>;
471
+ }, z.core.$strip>;
472
+ export type PluginAnalysisHeatmapGridCell = z.infer<typeof PluginAnalysisHeatmapGridCell>;
473
+ /**
474
+ * One cell in {@linkcode PluginAnalysisHeatmapsApi.renderField} — either a
475
+ * planar polygon ring the host triangulates, or a pre-tessellated triangle
476
+ * mesh. All coordinates are **world coordinates** (y up).
477
+ *
478
+ * Polygon form:
479
+ *
480
+ * | Property | Type | Description |
481
+ * |---|---|---|
482
+ * | `polygon` | `{ x, y, z }[]` | Planar ring of 3+ points (any orientation; no self-intersections) |
483
+ * | `value` | `number` | The scalar value mapped to a colour |
484
+ * | `meta` | `unknown \| undefined` | Optional payload stored with the overlay |
485
+ *
486
+ * Pre-tessellated form:
487
+ *
488
+ * | Property | Type | Description |
489
+ * |---|---|---|
490
+ * | `vertices` | `{ x, y, z }[]` | Mesh vertices (3+) |
491
+ * | `indices` | `number[]` | Triangle list into `vertices` — length a multiple of 3, every index in range |
492
+ * | `value` | `number` | The scalar value mapped to a colour |
493
+ * | `meta` | `unknown \| undefined` | Optional payload stored with the overlay |
494
+ */
495
+ export declare const PluginAnalysisHeatmapFieldCell: z.ZodUnion<readonly [z.ZodObject<{
496
+ polygon: z.ZodArray<z.ZodObject<{
497
+ x: z.ZodNumber;
498
+ y: z.ZodNumber;
499
+ z: z.ZodNumber;
500
+ }, z.core.$strip>>;
501
+ value: z.ZodNumber;
502
+ meta: z.ZodOptional<z.ZodUnknown>;
503
+ }, z.core.$strip>, z.ZodObject<{
504
+ vertices: z.ZodArray<z.ZodObject<{
505
+ x: z.ZodNumber;
506
+ y: z.ZodNumber;
507
+ z: z.ZodNumber;
508
+ }, z.core.$strip>>;
509
+ indices: z.ZodArray<z.ZodNumber>;
510
+ value: z.ZodNumber;
511
+ meta: z.ZodOptional<z.ZodUnknown>;
512
+ }, z.core.$strip>]>;
513
+ export type PluginAnalysisHeatmapFieldCell = z.infer<typeof PluginAnalysisHeatmapFieldCell>;
514
+ /**
515
+ * The colour scale for a heatmap render — how values become colours and how
516
+ * the legend reads. Three kinds (discriminated by `type`):
517
+ *
518
+ * - **`bands`** — the default: the colour ramp quantised into `count`
519
+ * discrete bands (2–64, default 11). The rendered mesh and legend always
520
+ * use discrete bands; "continuous" is simply a high `count`.
521
+ * - **`threshold`** — binary pass/fail at a cut-off `threshold`: values
522
+ * `>= threshold` get `passColor`, the rest `failColor`; the legend shows
523
+ * the two labelled swatches.
524
+ * - **`categorical`** — exact-match classes: every cell value must equal
525
+ * one class's `value` (anything else is a validation error); the legend
526
+ * shows one labelled swatch per class.
527
+ *
528
+ * | Kind | Property | Type | Description |
529
+ * |---|---|---|---|
530
+ * | `bands` | `count` | `number \| undefined` | Number of discrete bands, 2–64 (default 11) |
531
+ * | `threshold` | `threshold` | `number` | Values `>= threshold` pass |
532
+ * | `threshold` | `passColor` | `string \| undefined` | Hex colour for passing values (host default green) |
533
+ * | `threshold` | `failColor` | `string \| undefined` | Hex colour for failing values (host default red) |
534
+ * | `threshold` | `passLabel` | `string \| undefined` | Legend label for the pass swatch (default `≥ threshold`) |
535
+ * | `threshold` | `failLabel` | `string \| undefined` | Legend label for the fail swatch (default `< threshold`) |
536
+ * | `categorical` | `classes` | `{ value, label, color }[]` | Exact-match classes: scalar `value`, legend `label`, hex `color` |
537
+ */
538
+ export declare const PluginAnalysisHeatmapScale: z.ZodDiscriminatedUnion<[z.ZodObject<{
539
+ type: z.ZodLiteral<"bands">;
540
+ count: z.ZodOptional<z.ZodNumber>;
541
+ }, z.core.$strip>, z.ZodObject<{
542
+ type: z.ZodLiteral<"threshold">;
543
+ threshold: z.ZodNumber;
544
+ passColor: z.ZodOptional<z.ZodString>;
545
+ failColor: z.ZodOptional<z.ZodString>;
546
+ passLabel: z.ZodOptional<z.ZodString>;
547
+ failLabel: z.ZodOptional<z.ZodString>;
548
+ }, z.core.$strip>, z.ZodObject<{
549
+ type: z.ZodLiteral<"categorical">;
550
+ classes: z.ZodArray<z.ZodObject<{
551
+ value: z.ZodNumber;
552
+ label: z.ZodString;
553
+ color: z.ZodString;
554
+ }, z.core.$strip>>;
555
+ }, z.core.$strip>], "type">;
556
+ export type PluginAnalysisHeatmapScale = z.infer<typeof PluginAnalysisHeatmapScale>;
557
+ /**
558
+ * Display options shared by both heatmap render modes.
559
+ *
560
+ * The colour ramp maps values to colours: `colors` is an **ordered list of
561
+ * hex colour stops, low → high** (e.g. `["#0000ff", "#ff0000"]`). When
562
+ * omitted, the host's default blue → cyan → green → yellow → red ramp is used. Values outside
563
+ * `[min, max]` clamp to the end colours; the legend marks the clamped ends
564
+ * with `<` / `>`. `min`/`max` are auto-derived from the data when omitted.
565
+ *
566
+ * | Property | Type | Description |
567
+ * |---|---|---|
568
+ * | `name` | `string \| undefined` | Overlay name to render into (see {@linkcode PluginAnalysisHeatmapOverlaysApi}); a shared default overlay when omitted |
569
+ * | `title` | `string \| undefined` | Legend title |
570
+ * | `unit` | `string \| undefined` | Unit label shown on the legend (e.g. `"m/s"`) |
571
+ * | `min` | `number \| undefined` | Value mapped to the first colour stop; data minimum when omitted |
572
+ * | `max` | `number \| undefined` | Value mapped to the last colour stop; data maximum when omitted |
573
+ * | `colors` | `string[] \| undefined` | Ordered 6-digit hex colour stops (e.g. `"#0000ff"`), low → high; host blue → cyan → green → yellow → red default |
574
+ * | `scale` | {@linkcode PluginAnalysisHeatmapScale}` \| undefined` | Colour scale: discrete `bands` (count 2–64, default 11), binary `threshold`, or exact-match `categorical` |
575
+ * | `hover` | `boolean \| undefined` | Show a tooltip with the hovered cell's `value` (+ its `meta`, when given) while this overlay is visible. Default `false` |
576
+ */
577
+ export declare const PluginAnalysisHeatmapOptions: z.ZodObject<{
578
+ name: z.ZodOptional<z.ZodString>;
579
+ title: z.ZodOptional<z.ZodString>;
580
+ unit: z.ZodOptional<z.ZodString>;
581
+ min: z.ZodOptional<z.ZodNumber>;
582
+ max: z.ZodOptional<z.ZodNumber>;
583
+ colors: z.ZodOptional<z.ZodArray<z.ZodString>>;
584
+ scale: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
585
+ type: z.ZodLiteral<"bands">;
586
+ count: z.ZodOptional<z.ZodNumber>;
587
+ }, z.core.$strip>, z.ZodObject<{
588
+ type: z.ZodLiteral<"threshold">;
589
+ threshold: z.ZodNumber;
590
+ passColor: z.ZodOptional<z.ZodString>;
591
+ failColor: z.ZodOptional<z.ZodString>;
592
+ passLabel: z.ZodOptional<z.ZodString>;
593
+ failLabel: z.ZodOptional<z.ZodString>;
594
+ }, z.core.$strip>, z.ZodObject<{
595
+ type: z.ZodLiteral<"categorical">;
596
+ classes: z.ZodArray<z.ZodObject<{
597
+ value: z.ZodNumber;
598
+ label: z.ZodString;
599
+ color: z.ZodString;
600
+ }, z.core.$strip>>;
601
+ }, z.core.$strip>], "type">>;
602
+ hover: z.ZodOptional<z.ZodBoolean>;
603
+ }, z.core.$strip>;
604
+ export type PluginAnalysisHeatmapOptions = z.infer<typeof PluginAnalysisHeatmapOptions>;
605
+ /**
606
+ * Result of {@linkcode PluginAnalysisHeatmapsApi.renderSpaces} /
607
+ * {@linkcode PluginAnalysisHeatmapsApi.renderGrid} — render failures throw,
608
+ * so a returned value always carries `success: true`.
609
+ *
610
+ * | Property | Type | Description |
611
+ * |---|---|---|
612
+ * | `success` | `true` | The heatmap is rendered on the scene |
613
+ */
614
+ export declare const PluginAnalysisHeatmapsRenderResult: z.ZodObject<{
615
+ success: z.ZodLiteral<true>;
616
+ }, z.core.$strip>;
617
+ export type PluginAnalysisHeatmapsRenderResult = z.infer<typeof PluginAnalysisHeatmapsRenderResult>;
618
+ /**
619
+ * One overlay row in {@linkcode PluginAnalysisHeatmapOverlaysApi.list}.
620
+ *
621
+ * | Property | Type | Description |
622
+ * |---|---|---|
623
+ * | `name` | `string` | The overlay's name (`options.name` at render time) |
624
+ * | `visible` | `boolean` | Whether this is the (single) visible overlay |
625
+ * | `kind` | `"spaces" \| "grid" \| "surfaceGrid" \| "field"` | Which render call produced it |
626
+ */
627
+ export declare const PluginAnalysisHeatmapOverlayInfo: z.ZodObject<{
628
+ name: z.ZodString;
629
+ visible: z.ZodBoolean;
630
+ kind: z.ZodEnum<{
631
+ spaces: "spaces";
632
+ grid: "grid";
633
+ surfaceGrid: "surfaceGrid";
634
+ field: "field";
635
+ }>;
636
+ }, z.core.$strip>;
637
+ export type PluginAnalysisHeatmapOverlayInfo = z.infer<typeof PluginAnalysisHeatmapOverlayInfo>;
638
+ /**
639
+ * Result of {@linkcode PluginAnalysisHeatmapOverlaysApi.list}.
640
+ *
641
+ * | Property | Type | Description |
642
+ * |---|---|---|
643
+ * | `overlays` | {@linkcode PluginAnalysisHeatmapOverlayInfo}`[]` | Every registered overlay; at most one has `visible: true` |
644
+ */
645
+ export declare const PluginAnalysisHeatmapOverlaysListResult: z.ZodObject<{
646
+ overlays: z.ZodArray<z.ZodObject<{
647
+ name: z.ZodString;
648
+ visible: z.ZodBoolean;
649
+ kind: z.ZodEnum<{
650
+ spaces: "spaces";
651
+ grid: "grid";
652
+ surfaceGrid: "surfaceGrid";
653
+ field: "field";
654
+ }>;
655
+ }, z.core.$strip>>;
656
+ }, z.core.$strip>;
657
+ export type PluginAnalysisHeatmapOverlaysListResult = z.infer<typeof PluginAnalysisHeatmapOverlaysListResult>;
658
+ //# sourceMappingURL=heatmaps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"heatmaps.d.ts","sourceRoot":"","sources":["../../../src/api/analysis/heatmaps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,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