@mstone6969/graph 0.1.0 → 0.2.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 (238) hide show
  1. package/README.md +111 -14
  2. package/dist/ExcelWriter-3ZSYUH4T.cjs +154 -0
  3. package/dist/GraphType.js +24 -38
  4. package/dist/PdfWriter-6HJFYMCO.cjs +205 -0
  5. package/dist/catalog-YWX6FHRM.cjs +8 -0
  6. package/dist/catalog.js +5 -1
  7. package/dist/charts/bars/index.js +2 -12
  8. package/dist/charts/comparison/EffectForestPlot.js +1 -1
  9. package/dist/charts/comparison/index.js +1 -8
  10. package/dist/charts/demography/Nomogram.js +3 -3
  11. package/dist/charts/density/HexbinChart.js +6 -4
  12. package/dist/charts/diagrams/ArchitectureCanvas.js +68 -0
  13. package/dist/charts/diagrams/ArchitectureDiagram.js +331 -0
  14. package/dist/charts/diagrams/ArchitectureLayout.js +106 -0
  15. package/dist/charts/diagrams/ArchitectureLinkLabels.js +78 -0
  16. package/dist/charts/diagrams/ArchitectureModel.js +108 -0
  17. package/dist/charts/diagrams/ArchitectureRouter.js +348 -0
  18. package/dist/charts/diagrams/ArchitectureSamples.js +312 -0
  19. package/dist/charts/diagrams/ArchitectureShapes.js +130 -0
  20. package/dist/charts/diagrams/ArchitectureText.js +25 -0
  21. package/dist/charts/diagrams/DiagramText.js +38 -0
  22. package/dist/charts/diagrams/EntityRelationshipDiagram.js +465 -0
  23. package/dist/charts/diagrams/ErCrowsFoot.js +33 -0
  24. package/dist/charts/diagrams/ErSamples.js +205 -0
  25. package/dist/charts/diagrams/ErSchema.js +122 -0
  26. package/dist/charts/diagrams/LogicCircuit.js +154 -0
  27. package/dist/charts/diagrams/LogicCircuitLayout.js +600 -0
  28. package/dist/charts/diagrams/LogicCircuitSamples.js +66 -0
  29. package/dist/charts/diagrams/LogicGateDiagram.js +216 -0
  30. package/dist/charts/diagrams/LogicGateSymbol.js +113 -0
  31. package/dist/charts/diagrams/NetworkTopologyDiagram.js +247 -0
  32. package/dist/charts/diagrams/SequenceDiagram.js +351 -0
  33. package/dist/charts/diagrams/SequenceLayout.js +422 -0
  34. package/dist/charts/diagrams/SequenceModel.js +221 -0
  35. package/dist/charts/diagrams/TopologyLayout.js +143 -0
  36. package/dist/charts/diagrams/architectureEnums.js +50 -0
  37. package/dist/charts/diagrams/index.js +26 -0
  38. package/dist/charts/diagrams/logicEnums.js +42 -0
  39. package/dist/charts/diagrams/sequenceEnums.js +40 -0
  40. package/dist/charts/distribution/HistogramChart.js +25 -3
  41. package/dist/charts/distribution/index.js +1 -3
  42. package/dist/charts/earthscience/HovmollerDiagram.js +477 -0
  43. package/dist/charts/earthscience/HovmollerEnums.js +42 -0
  44. package/dist/charts/earthscience/HovmollerField.js +180 -0
  45. package/dist/charts/earthscience/HovmollerSample.js +40 -0
  46. package/dist/charts/earthscience/HovmollerSpeed.js +71 -0
  47. package/dist/charts/earthscience/index.js +10 -2
  48. package/dist/charts/engineering/ConstellationDiagram.js +26 -6
  49. package/dist/charts/engineering/EyeDiagram.js +2 -1
  50. package/dist/charts/engineering/PoleZeroPlot.js +32 -8
  51. package/dist/charts/financial/RelativeStrengthRotation.js +434 -0
  52. package/dist/charts/financial/RelativeStrengthRotationMath.js +71 -0
  53. package/dist/charts/financial/RelativeStrengthRotationSamples.js +27 -0
  54. package/dist/charts/financial/index.js +5 -3
  55. package/dist/charts/flow/index.js +1 -5
  56. package/dist/charts/frameworks/AnsoffMatrix.js +523 -0
  57. package/dist/charts/frameworks/FrameworkText.js +98 -0
  58. package/dist/charts/frameworks/NpsGauge.js +279 -0
  59. package/dist/charts/frameworks/NpsSurvey.js +58 -0
  60. package/dist/charts/frameworks/PerceptualMap.js +419 -0
  61. package/dist/charts/frameworks/PerceptualProjection.js +142 -0
  62. package/dist/charts/frameworks/PositioningSamples.js +191 -0
  63. package/dist/charts/frameworks/RaciMatrix.js +458 -0
  64. package/dist/charts/frameworks/RaciPlan.js +81 -0
  65. package/dist/charts/frameworks/RaciSamples.js +76 -0
  66. package/dist/charts/frameworks/SwotMatrix.js +358 -0
  67. package/dist/charts/frameworks/SwotSamples.js +85 -0
  68. package/dist/charts/frameworks/VanWestendorpChart.js +187 -0
  69. package/dist/charts/frameworks/VanWestendorpSurvey.js +197 -0
  70. package/dist/charts/frameworks/index.js +26 -0
  71. package/dist/charts/frameworks/raciEnums.js +30 -0
  72. package/dist/charts/frameworks/swotEnums.js +34 -0
  73. package/dist/charts/genomics/CircosPlot.js +1 -1
  74. package/dist/charts/geoflows/GeoFlowChart.js +2 -2
  75. package/dist/charts/geoflows/GeoFlowSample.js +2 -1
  76. package/dist/charts/geomaps/FloorPlanMap.js +324 -0
  77. package/dist/charts/geomaps/FloorPlanModel.js +179 -0
  78. package/dist/charts/geomaps/FloorPlanSamples.js +416 -0
  79. package/dist/charts/geomaps/GeoLand.js +2 -2
  80. package/dist/charts/geomaps/GeoSamples.js +2 -1
  81. package/dist/charts/geomaps/GraticuleMap.js +2 -2
  82. package/dist/charts/geomaps/RoomLabelFit.js +200 -0
  83. package/dist/charts/geomaps/TissotMap.js +2 -2
  84. package/dist/charts/geomaps/index.js +8 -4
  85. package/dist/charts/hierarchy/SunburstChart.js +17 -10
  86. package/dist/charts/hierarchy/index.js +2 -11
  87. package/dist/charts/indicators/BulletChart.js +8 -2
  88. package/dist/charts/indicators/SpeedometerChart.js +1 -1
  89. package/dist/charts/indicators/ThermometerChart.js +1 -1
  90. package/dist/charts/lifescience/LoessFit.js +113 -0
  91. package/dist/charts/lifescience/MaPlot.js +337 -0
  92. package/dist/charts/lifescience/MaPlotSamples.js +35 -0
  93. package/dist/charts/lifescience/OncoGlyph.js +137 -0
  94. package/dist/charts/lifescience/OncoPrint.js +373 -0
  95. package/dist/charts/lifescience/OncoPrintMatrix.js +107 -0
  96. package/dist/charts/lifescience/OncoPrintSamples.js +142 -0
  97. package/dist/charts/lifescience/PedigreeChart.js +306 -0
  98. package/dist/charts/lifescience/PedigreeLayout.js +261 -0
  99. package/dist/charts/lifescience/PedigreeRows.js +70 -0
  100. package/dist/charts/lifescience/PedigreeSamples.js +161 -0
  101. package/dist/charts/lifescience/PedigreeSymbol.js +47 -0
  102. package/dist/charts/lifescience/RamachandranPlot.js +364 -0
  103. package/dist/charts/lifescience/RamachandranRegions.js +2712 -0
  104. package/dist/charts/lifescience/RamachandranSamples.js +235 -0
  105. package/dist/charts/lifescience/index.js +25 -0
  106. package/dist/charts/lifescience/pedigreeEnums.js +21 -0
  107. package/dist/charts/lifescience/ramachandranEnums.js +34 -0
  108. package/dist/charts/linesareas/DualAxisChart.js +1 -1
  109. package/dist/charts/linesareas/LineEnums.js +1 -15
  110. package/dist/charts/linesareas/MultiLineChart.js +1 -1
  111. package/dist/charts/linesareas/TrendChart.js +15 -5
  112. package/dist/charts/linesareas/index.js +2 -6
  113. package/dist/charts/massive/MassiveChart.js +3 -2
  114. package/dist/charts/mathematical/FourierSeriesChart.js +7 -1
  115. package/dist/charts/mathematical/index.js +2 -6
  116. package/dist/charts/matrix/GridPlot.js +27 -2
  117. package/dist/charts/matrix/TilegramChart.js +2 -2
  118. package/dist/charts/mlcharts/AttentionGrid.js +79 -0
  119. package/dist/charts/mlcharts/AttentionHeatmap.js +329 -0
  120. package/dist/charts/mlcharts/AttentionModel.js +132 -0
  121. package/dist/charts/mlcharts/AttentionSamples.js +82 -0
  122. package/dist/charts/mlcharts/CellNumber.js +8 -0
  123. package/dist/charts/mlcharts/CurveDiagnosticSamples.js +95 -0
  124. package/dist/charts/mlcharts/CurvePickMark.js +31 -0
  125. package/dist/charts/mlcharts/DecisionBoundaryChart.js +316 -0
  126. package/dist/charts/mlcharts/DecisionSamples.js +60 -0
  127. package/dist/charts/mlcharts/DecisionSurface.js +130 -0
  128. package/dist/charts/mlcharts/DistinctTicks.js +13 -0
  129. package/dist/charts/mlcharts/ElbowMath.js +153 -0
  130. package/dist/charts/mlcharts/ElbowPlot.js +273 -0
  131. package/dist/charts/mlcharts/ExplainabilitySamples.js +70 -0
  132. package/dist/charts/mlcharts/FeatureImportanceChart.js +150 -0
  133. package/dist/charts/mlcharts/ImportanceRanking.js +98 -0
  134. package/dist/charts/mlcharts/LearningCurveChart.js +276 -0
  135. package/dist/charts/mlcharts/LearningCurveMath.js +92 -0
  136. package/dist/charts/mlcharts/PartialDependence.js +92 -0
  137. package/dist/charts/mlcharts/PartialDependencePlot.js +225 -0
  138. package/dist/charts/mlcharts/WideLabel.js +28 -0
  139. package/dist/charts/mlcharts/curveDiagnosticEnums.js +37 -0
  140. package/dist/charts/mlcharts/index.js +32 -0
  141. package/dist/charts/proportion/index.js +5 -9
  142. package/dist/charts/scatter/CategoryScatterBase.js +1 -4
  143. package/dist/charts/scatter/ConnectedScatter.js +7 -4
  144. package/dist/charts/scatter/MarginalScatter.js +13 -8
  145. package/dist/charts/scatter/index.js +4 -17
  146. package/dist/charts/scientific/SpectrogramChart.js +9 -3
  147. package/dist/charts/scientific/index.js +2 -2
  148. package/dist/charts/signals/index.js +3 -13
  149. package/dist/charts/statistics/LorenzCurve.js +7 -4
  150. package/dist/charts/threebars/Candlestick3DChart.js +18 -2
  151. package/dist/charts/threeglobe/GlobeChart.js +2 -2
  152. package/dist/charts/threeglobe/GlobeSamples.js +2 -1
  153. package/dist/charts/threeglobe/RingGlobe.js +1 -1
  154. package/dist/charts/threenetwork/ConeTreeChart.js +2 -1
  155. package/dist/charts/threenetwork/Gantt3DChart.js +3 -2
  156. package/dist/charts/threesurfaces/Ridgeline3DChart.js +22 -4
  157. package/dist/charts/threevolume/LorenzAttractor.js +19 -0
  158. package/dist/charts/threevolume/VolumeRaycastChart.js +4 -3
  159. package/dist/charts/threevolume/volumeEnums.js +1 -0
  160. package/dist/charts/timeline/index.js +2 -10
  161. package/dist/chunk-753UBLV2.cjs +33 -0
  162. package/dist/chunk-VX54A7KA.cjs +17 -0
  163. package/dist/{chunk-W5GAAAZY.cjs → chunk-WAODDPYX.cjs} +24874 -17620
  164. package/dist/chunk-Z3JPIJSC.cjs +338 -0
  165. package/dist/core/CartesianChart.js +87 -11
  166. package/dist/core/Chart.js +63 -15
  167. package/dist/core/Chart2D.js +54 -17
  168. package/dist/core/Chart3D.js +56 -20
  169. package/dist/core/ChartExportError.js +2 -0
  170. package/dist/core/ChartExporter.js +50 -8
  171. package/dist/core/ColumnCheck.js +53 -0
  172. package/dist/core/Context2D.js +29 -15
  173. package/dist/core/Context3D.js +7 -2
  174. package/dist/core/ExcelWriter.js +152 -0
  175. package/dist/core/ExportText.js +28 -0
  176. package/dist/core/MarkOrigin.js +88 -0
  177. package/dist/core/MarkStyle.js +294 -0
  178. package/dist/core/Palette.js +27 -7
  179. package/dist/core/PdfPage.js +13 -0
  180. package/dist/core/PdfWriter.js +245 -0
  181. package/dist/core/Scales.js +52 -2
  182. package/dist/core/SceneOverlay.js +4 -4
  183. package/dist/core/TextFit.js +37 -0
  184. package/dist/core/Theme.js +28 -1
  185. package/dist/core/enums.js +33 -1
  186. package/dist/core/pathMorph.js +15 -0
  187. package/dist/data/SampleData.js +1 -17
  188. package/dist/data/WorldSample.js +23 -0
  189. package/dist/index.cjs +810 -691
  190. package/dist/index.d.cts +8390 -2925
  191. package/dist/index.d.ts +8392 -2927
  192. package/dist/index.js +106 -56
  193. package/dist/react/ChartView.js +18 -8
  194. package/dist/react/GraphHandle.js +2 -0
  195. package/dist/react/components.js +74 -116
  196. package/package.json +13 -3
  197. package/dist/catalog-4UP2YFNR.cjs +0 -7
  198. package/dist/charts/bars/BulletBar.js +0 -184
  199. package/dist/charts/bars/ErrorBarColumn.js +0 -147
  200. package/dist/charts/bars/HistogramBar.js +0 -217
  201. package/dist/charts/bars/MarimekkoBar.js +0 -191
  202. package/dist/charts/bars/ParetoBar.js +0 -143
  203. package/dist/charts/comparison/PanelChart.js +0 -70
  204. package/dist/charts/comparison/SmallMultipleBars.js +0 -134
  205. package/dist/charts/comparison/SpanChart.js +0 -118
  206. package/dist/charts/comparison/TrellisChart.js +0 -158
  207. package/dist/charts/distribution/RidgeSlabs3DChart.js +0 -169
  208. package/dist/charts/financial/Candlestick3D.js +0 -157
  209. package/dist/charts/flow/BumpFlow.js +0 -212
  210. package/dist/charts/flow/StreamFlow.js +0 -174
  211. package/dist/charts/geomaps/ThiessenMap.js +0 -106
  212. package/dist/charts/hierarchy/ConeTree3D.js +0 -135
  213. package/dist/charts/hierarchy/Hierarchy3DChart.js +0 -27
  214. package/dist/charts/hierarchy/SpherePack3D.js +0 -81
  215. package/dist/charts/hierarchy/SunburstTower3D.js +0 -93
  216. package/dist/charts/hierarchy/TreemapSkyline3D.js +0 -98
  217. package/dist/charts/linesareas/ConnectedScatterTime.js +0 -206
  218. package/dist/charts/linesareas/SmallMultipleLines.js +0 -153
  219. package/dist/charts/mathematical/ParametricSurface3D.js +0 -234
  220. package/dist/charts/mathematical/StrangeAttractor3D.js +0 -251
  221. package/dist/charts/proportion/ConeFunnel.js +0 -126
  222. package/dist/charts/proportion/ExtrudedPieChart.js +0 -123
  223. package/dist/charts/scatter/BeeswarmScatter.js +0 -151
  224. package/dist/charts/scatter/BinnedScatterBase.js +0 -51
  225. package/dist/charts/scatter/ContourScatter.js +0 -116
  226. package/dist/charts/scatter/GridBinScatter.js +0 -98
  227. package/dist/charts/scatter/HexbinScatter.js +0 -74
  228. package/dist/charts/scatter/StripScatter.js +0 -107
  229. package/dist/charts/scatter/SunflowerScatter.js +0 -109
  230. package/dist/charts/signals/ConstellationChart.js +0 -153
  231. package/dist/charts/signals/CorrelogramChart.js +0 -171
  232. package/dist/charts/signals/EyeDiagramChart.js +0 -155
  233. package/dist/charts/signals/PoleZeroChart.js +0 -164
  234. package/dist/charts/signals/SpectrogramChart.js +0 -79
  235. package/dist/charts/timeline/CalendarSkylineChart.js +0 -128
  236. package/dist/charts/timeline/ScheduleBlocksChart.js +0 -119
  237. package/dist/charts/timeline/SpiralTimeline.js +0 -154
  238. package/dist/charts/timeline/StreamTimeline.js +0 -141
@@ -0,0 +1,416 @@
1
+ import { SampleData } from "../../data/SampleData.js";
2
+ import { FloorDoorSwing } from "./FloorPlanModel.js";
3
+ // src/charts/geomaps/FloorPlanSamples.ts
4
+ var box = (x0, y0, x1, y1) => [
5
+ [x0, y0],
6
+ [x1, y0],
7
+ [x1, y1],
8
+ [x0, y1]
9
+ ];
10
+ var { Left, Right, None } = FloorDoorSwing;
11
+ var CORRIDOR = box(0, 8, 40, 12);
12
+ var STAIR = box(26, 12, 30, 20);
13
+ /** Floor, name and polygon, in metres. A null floor would mean every floor; these plans name theirs. */
14
+ var ROOMS = [
15
+ [
16
+ 1,
17
+ "Lobby",
18
+ box(0, 0, 14, 8)
19
+ ],
20
+ [
21
+ 1,
22
+ "Reception",
23
+ box(14, 0, 22, 8)
24
+ ],
25
+ [
26
+ 1,
27
+ "Cafe",
28
+ [
29
+ [22, 0],
30
+ [40, 0],
31
+ [40, 20],
32
+ [30, 20],
33
+ [30, 8],
34
+ [22, 8]
35
+ ]
36
+ ],
37
+ [
38
+ 1,
39
+ "Corridor",
40
+ box(0, 8, 30, 12),
41
+ false
42
+ ],
43
+ [
44
+ 1,
45
+ "Meeting A",
46
+ box(0, 12, 9, 20)
47
+ ],
48
+ [
49
+ 1,
50
+ "Meeting B",
51
+ box(9, 12, 18, 20)
52
+ ],
53
+ [
54
+ 1,
55
+ "WC",
56
+ box(18, 12, 22, 20)
57
+ ],
58
+ [
59
+ 1,
60
+ "Store",
61
+ box(22, 12, 26, 20)
62
+ ],
63
+ [
64
+ 1,
65
+ "Stair",
66
+ STAIR,
67
+ false
68
+ ],
69
+ [
70
+ 2,
71
+ "Director",
72
+ box(0, 0, 10, 8)
73
+ ],
74
+ [
75
+ 2,
76
+ "Open office",
77
+ [box(10, 0, 40, 8), box(22, 3, 28, 5)]
78
+ ],
79
+ [
80
+ 2,
81
+ "Corridor",
82
+ CORRIDOR,
83
+ false
84
+ ],
85
+ [
86
+ 2,
87
+ "Focus room one",
88
+ box(0, 12, 5, 20)
89
+ ],
90
+ [
91
+ 2,
92
+ "Focus room two",
93
+ box(5, 12, 10, 20)
94
+ ],
95
+ [
96
+ 2,
97
+ "Conference room",
98
+ box(10, 12, 22, 20)
99
+ ],
100
+ [
101
+ 2,
102
+ "Phone",
103
+ box(22, 12, 26, 20)
104
+ ],
105
+ [
106
+ 2,
107
+ "Stair",
108
+ STAIR,
109
+ false
110
+ ],
111
+ [
112
+ 2,
113
+ "Server room",
114
+ box(30, 12, 40, 20)
115
+ ],
116
+ [
117
+ 3,
118
+ "Wet lab",
119
+ box(0, 0, 18, 8)
120
+ ],
121
+ [
122
+ 3,
123
+ "Dry lab",
124
+ box(18, 0, 32, 8)
125
+ ],
126
+ [
127
+ 3,
128
+ "Cold room",
129
+ box(32, 0, 40, 8)
130
+ ],
131
+ [
132
+ 3,
133
+ "Corridor",
134
+ CORRIDOR,
135
+ false
136
+ ],
137
+ [
138
+ 3,
139
+ "Preparation",
140
+ box(0, 12, 12, 20)
141
+ ],
142
+ [
143
+ 3,
144
+ "Instrument bay",
145
+ box(12, 12, 26, 20)
146
+ ],
147
+ [
148
+ 3,
149
+ "Stair",
150
+ STAIR,
151
+ false
152
+ ],
153
+ [
154
+ 3,
155
+ "Plant room",
156
+ box(30, 12, 40, 20)
157
+ ]
158
+ ];
159
+ /** Floor, hinge, latch, swing. */
160
+ var DOORS = [
161
+ [
162
+ 1,
163
+ [6, 8],
164
+ [8, 8],
165
+ None
166
+ ],
167
+ [
168
+ 1,
169
+ [17, 8],
170
+ [18, 8],
171
+ Right
172
+ ],
173
+ [
174
+ 1,
175
+ [30, 9.5],
176
+ [30, 11],
177
+ None
178
+ ],
179
+ [
180
+ 1,
181
+ [4, 12],
182
+ [5, 12],
183
+ Left
184
+ ],
185
+ [
186
+ 1,
187
+ [13, 12],
188
+ [14, 12],
189
+ Left
190
+ ],
191
+ [
192
+ 1,
193
+ [19.5, 12],
194
+ [20.5, 12],
195
+ Left
196
+ ],
197
+ [
198
+ 1,
199
+ [23.5, 12],
200
+ [24.5, 12],
201
+ Left
202
+ ],
203
+ [
204
+ 1,
205
+ [27.5, 12],
206
+ [28.5, 12],
207
+ None
208
+ ],
209
+ [
210
+ 2,
211
+ [4.5, 8],
212
+ [5.5, 8],
213
+ Right
214
+ ],
215
+ [
216
+ 2,
217
+ [24, 8],
218
+ [26, 8],
219
+ None
220
+ ],
221
+ [
222
+ 2,
223
+ [2, 12],
224
+ [3, 12],
225
+ Left
226
+ ],
227
+ [
228
+ 2,
229
+ [7, 12],
230
+ [8, 12],
231
+ Left
232
+ ],
233
+ [
234
+ 2,
235
+ [15, 12],
236
+ [16, 12],
237
+ Left
238
+ ],
239
+ [
240
+ 2,
241
+ [23.5, 12],
242
+ [24.5, 12],
243
+ Left
244
+ ],
245
+ [
246
+ 2,
247
+ [27.5, 12],
248
+ [28.5, 12],
249
+ None
250
+ ],
251
+ [
252
+ 2,
253
+ [34, 12],
254
+ [35, 12],
255
+ Left
256
+ ],
257
+ [
258
+ 3,
259
+ [8, 8],
260
+ [9, 8],
261
+ Right
262
+ ],
263
+ [
264
+ 3,
265
+ [25, 8],
266
+ [26, 8],
267
+ Right
268
+ ],
269
+ [
270
+ 3,
271
+ [35.5, 8],
272
+ [36.5, 8],
273
+ Right
274
+ ],
275
+ [
276
+ 3,
277
+ [5, 12],
278
+ [6, 12],
279
+ Left
280
+ ],
281
+ [
282
+ 3,
283
+ [18, 12],
284
+ [20, 12],
285
+ None
286
+ ],
287
+ [
288
+ 3,
289
+ [27.5, 12],
290
+ [28.5, 12],
291
+ None
292
+ ],
293
+ [
294
+ 3,
295
+ [34.5, 12],
296
+ [35.5, 12],
297
+ Left
298
+ ]
299
+ ];
300
+ /** Floor, kind, position. */
301
+ var ASSETS = [
302
+ [
303
+ 1,
304
+ "Extinguisher",
305
+ 1,
306
+ 9
307
+ ],
308
+ [
309
+ 1,
310
+ "Extinguisher",
311
+ 21,
312
+ 11
313
+ ],
314
+ [
315
+ 1,
316
+ "Defibrillator",
317
+ 13,
318
+ 1.5
319
+ ],
320
+ [
321
+ 1,
322
+ "Access point",
323
+ 34,
324
+ 14
325
+ ],
326
+ [
327
+ 1,
328
+ "Printer",
329
+ 15.5,
330
+ 1.5
331
+ ],
332
+ [
333
+ 2,
334
+ "Extinguisher",
335
+ 1,
336
+ 9
337
+ ],
338
+ [
339
+ 2,
340
+ "Extinguisher",
341
+ 38,
342
+ 11
343
+ ],
344
+ [
345
+ 2,
346
+ "Printer",
347
+ 12,
348
+ 6.5
349
+ ],
350
+ [
351
+ 2,
352
+ "Access point",
353
+ 34,
354
+ 2
355
+ ],
356
+ [
357
+ 2,
358
+ "Access point",
359
+ 16,
360
+ 2
361
+ ],
362
+ [
363
+ 3,
364
+ "Extinguisher",
365
+ 1,
366
+ 9
367
+ ],
368
+ [
369
+ 3,
370
+ "Extinguisher",
371
+ 38,
372
+ 11
373
+ ],
374
+ [
375
+ 3,
376
+ "Defibrillator",
377
+ 16,
378
+ 1.5
379
+ ],
380
+ [
381
+ 3,
382
+ "Access point",
383
+ 24,
384
+ 2
385
+ ]
386
+ ];
387
+ /** A synthetic three-storey building. The layout is invented and every value is simulated, not a measurement. */
388
+ var FloorPlanSamples = class {
389
+ /** Simulated occupancy per cent, drawn from `SampleData`. Corridors and stairs have no sensor, so no value. */
390
+ static building(seed) {
391
+ const draws = SampleData.distribution(seed, ROOMS.length, 1);
392
+ return {
393
+ rooms: ROOMS.map(([level, name, points, metered = true], i) => ({
394
+ level,
395
+ name,
396
+ points,
397
+ value: metered ? Math.round(Math.max(2, Math.min(98, 52 + (draws[i].value - 40) / 8 * 20))) : null
398
+ })),
399
+ doors: DOORS.map(([level, from, to, swing]) => ({
400
+ level,
401
+ from,
402
+ to,
403
+ swing,
404
+ name: swing === None ? "Opening" : "Door"
405
+ })),
406
+ assets: ASSETS.map(([level, type, x, y], i) => ({
407
+ id: `tag-${i}`,
408
+ level,
409
+ type,
410
+ x,
411
+ y
412
+ }))
413
+ };
414
+ }
415
+ };
416
+ export { FloorPlanSamples };
@@ -1,4 +1,4 @@
1
- import { SampleData } from "../../data/SampleData.js";
1
+ import { WorldSample } from "../../data/WorldSample.js";
2
2
  import { geoBounds, geoContains } from "d3";
3
3
  // src/charts/geomaps/GeoLand.ts
4
4
  var hits = /* @__PURE__ */ new WeakMap();
@@ -7,7 +7,7 @@ var GeoLand = class {
7
7
  static bundled = null;
8
8
  /** Natural Earth 110m countries, shared by every map that needs a backdrop. */
9
9
  static get world() {
10
- return this.bundled ??= SampleData.world();
10
+ return this.bundled ??= WorldSample.countries();
11
11
  }
12
12
  static boxes(collection) {
13
13
  let boxes = hits.get(collection);
@@ -1,5 +1,6 @@
1
1
  import { GeoAtlas } from "../../data/GeoAtlas.js";
2
2
  import { SampleData } from "../../data/SampleData.js";
3
+ import { WorldSample } from "../../data/WorldSample.js";
3
4
  import { GeoLand } from "./GeoLand.js";
4
5
  import { geoArea, geoCentroid } from "d3";
5
6
  // src/charts/geomaps/GeoSamples.ts
@@ -47,7 +48,7 @@ var GeoSamples = class GeoSamples {
47
48
  }
48
49
  /** World regions with `value`, `other` and `group`; Antarctica has no data, as real datasets rarely do. */
49
50
  static regions(seed) {
50
- const world = SampleData.world(seed), noise = SampleData.world(seed + 7);
51
+ const world = WorldSample.countries(seed), noise = WorldSample.countries(seed + 7);
51
52
  return {
52
53
  ...world,
53
54
  features: world.features.map((feature, i) => {
@@ -1,5 +1,5 @@
1
1
  import { ChartFamily, DataShape, Dimension } from "../../core/enums.js";
2
- import { SampleData } from "../../data/SampleData.js";
2
+ import { WorldSample } from "../../data/WorldSample.js";
3
3
  import { GeoProjections } from "./GeoProjection.js";
4
4
  import { RegionMap } from "./RegionMap.js";
5
5
  // src/charts/geomaps/GraticuleMap.ts
@@ -19,7 +19,7 @@ var GraticuleMap = class extends RegionMap {
19
19
  "grid",
20
20
  "reference"
21
21
  ],
22
- sample: (seed) => SampleData.world(seed),
22
+ sample: (seed) => WorldSample.countries(seed),
23
23
  variants: {
24
24
  projection: GeoProjections.world,
25
25
  graticuleStep: [
@@ -0,0 +1,200 @@
1
+ import { FrameworkText } from "../frameworks/FrameworkText.js";
2
+ import { polygonCentroid } from "d3";
3
+ // src/charts/geomaps/RoomLabelFit.ts
4
+ var RoomLabelMode = /* @__PURE__ */ function(RoomLabelMode) {
5
+ RoomLabelMode["Name"] = "name";
6
+ RoomLabelMode["NameValue"] = "name-value";
7
+ RoomLabelMode["None"] = "none";
8
+ return RoomLabelMode;
9
+ }({});
10
+ var CHAR = 6.2;
11
+ var LINE = 13;
12
+ var PAD = 3;
13
+ var NUDGE = 14;
14
+ var SHORTEST = 3;
15
+ var MAX_CELLS = 4096;
16
+ /** Where to look when something sits on the anchor: outward along each axis, nearest first. */
17
+ var OFFSETS = [[0, 0], ...[
18
+ 1,
19
+ 2,
20
+ 3
21
+ ].flatMap((step) => [
22
+ [0, -step * NUDGE],
23
+ [0, step * NUDGE],
24
+ [-step * NUDGE, 0],
25
+ [step * NUDGE, 0]
26
+ ])];
27
+ var overlaps = (a, b) => a.x < b.x + b.w && a.x + a.w > b.x && a.y < b.y + b.h && a.y + a.h > b.y;
28
+ /** Even-odd test across a polygon's rings, so holes count as outside. */
29
+ var inside = (x, y, rings) => {
30
+ let hit = false;
31
+ for (const ring of rings) for (let i = 0, j = ring.length - 1; i < ring.length; j = i++) {
32
+ const [ax, ay] = ring[i], [bx, by] = ring[j];
33
+ if (ay > y !== by > y && x < (bx - ax) * (y - ay) / (by - ay) + ax) hit = !hit;
34
+ }
35
+ return hit;
36
+ };
37
+ var segmentDistance2 = (x, y, [ax, ay], [bx, by]) => {
38
+ const dx = bx - ax, dy = by - ay, length = dx * dx + dy * dy;
39
+ const t = length ? Math.max(0, Math.min(1, ((x - ax) * dx + (y - ay) * dy) / length)) : 0;
40
+ return (x - ax - t * dx) ** 2 + (y - ay - t * dy) ** 2;
41
+ };
42
+ /** Distance to the nearest edge: positive inside the polygon, negative outside. */
43
+ var signedDistance = (x, y, rings) => {
44
+ let nearest = Infinity;
45
+ for (const ring of rings) for (let i = 1; i < ring.length; i++) nearest = Math.min(nearest, segmentDistance2(x, y, ring[i - 1], ring[i]));
46
+ return (inside(x, y, rings) ? 1 : -1) * Math.sqrt(nearest);
47
+ };
48
+ /** Liang–Barsky: whether any of a segment lies in the box. */
49
+ var crosses = ([ax, ay], [bx, by], { x, y, w, h }) => {
50
+ const dx = bx - ax, dy = by - ay;
51
+ let low = 0, high = 1;
52
+ for (const [p, q] of [
53
+ [-dx, ax - x],
54
+ [dx, x + w - ax],
55
+ [-dy, ay - y],
56
+ [dy, y + h - ay]
57
+ ]) {
58
+ if (p === 0) {
59
+ if (q < 0) return false;
60
+ continue;
61
+ }
62
+ const t = q / p;
63
+ if (p < 0) low = Math.max(low, t);
64
+ else high = Math.min(high, t);
65
+ if (low > high) return false;
66
+ }
67
+ return true;
68
+ };
69
+ var encloses = (rings, box) => inside(box.x + box.w / 2, box.y + box.h / 2, rings) && !rings.some((ring) => ring.some((corner, i) => i > 0 && crosses(ring[i - 1], corner, box)));
70
+ /** Breaks a name at the space nearest its middle. */
71
+ var wrapped = (name) => {
72
+ const spaces = [...name.matchAll(/ /g)].map((match) => match.index);
73
+ if (!spaces.length) return null;
74
+ const middle = name.length / 2;
75
+ const at = spaces.reduce((best, space) => Math.abs(space - middle) < Math.abs(best - middle) ? space : best);
76
+ return [name.slice(0, at), name.slice(at + 1)];
77
+ };
78
+ /**
79
+ * Fits a label inside a room polygon at its pole of inaccessibility, found by the quadtree search of
80
+ * Agafonkin's polylabel (2016) after Garcia-Castellanos and Lombardo (2007). Text is wider than it is
81
+ * tall, so the search runs with y stretched by the text's aspect ratio and finds the widest ellipse of
82
+ * that shape, which suits a wide label in an L-shaped room better than the largest circle does.
83
+ */
84
+ var RoomLabelFit = class {
85
+ static #cell(x, y, half, rings) {
86
+ const distance = signedDistance(x, y, rings);
87
+ return {
88
+ x,
89
+ y,
90
+ half,
91
+ distance,
92
+ reach: distance + half * Math.SQRT2
93
+ };
94
+ }
95
+ static #search(rings) {
96
+ const outer = rings[0], xs = outer.map(([x]) => x), ys = outer.map(([, y]) => y);
97
+ const x0 = Math.min(...xs), y0 = Math.min(...ys), x1 = Math.max(...xs), y1 = Math.max(...ys);
98
+ const size = Math.min(x1 - x0, y1 - y0), half = size / 2;
99
+ const middle = this.#cell((x0 + x1) / 2, (y0 + y1) / 2, 0, rings);
100
+ if (!size) return middle;
101
+ const queue = [];
102
+ for (let x = x0; x < x1; x += size) for (let y = y0; y < y1; y += size) queue.push(this.#cell(x + half, y + half, half, rings));
103
+ const [cx, cy] = polygonCentroid(outer);
104
+ const centroid = Number.isFinite(cx + cy) ? this.#cell(cx, cy, 0, rings) : middle;
105
+ let best = centroid.distance > middle.distance ? centroid : middle;
106
+ const precision = size / 64;
107
+ for (let spent = 0; queue.length && spent < MAX_CELLS; spent++) {
108
+ const top = queue.reduce((most, cell, i) => cell.reach > queue[most].reach ? i : most, 0);
109
+ const cell = queue.splice(top, 1)[0];
110
+ if (cell.distance > best.distance) best = cell;
111
+ if (cell.reach - best.distance <= precision) continue;
112
+ const next = cell.half / 2;
113
+ for (const [dx, dy] of [
114
+ [-1, -1],
115
+ [1, -1],
116
+ [-1, 1],
117
+ [1, 1]
118
+ ]) queue.push(this.#cell(cell.x + dx * next, cell.y + dy * next, next, rings));
119
+ }
120
+ return best;
121
+ }
122
+ /** The point deepest inside the room, for text `aspect` times as wide as it is tall. */
123
+ static pole(parts, aspect = 1) {
124
+ const best = parts.map((rings) => this.#search(rings.map((ring) => ring.map(([x, y]) => [x, y * aspect])))).reduce((most, cell) => cell.distance > most.distance ? cell : most);
125
+ return [best.x, best.y / aspect];
126
+ }
127
+ static #cached(room, aspect) {
128
+ const key = aspect.toFixed(2);
129
+ let pole = room.poles.get(key);
130
+ if (!pole) room.poles.set(key, pole = this.pole(room.parts, aspect));
131
+ return pole;
132
+ }
133
+ /** What to try, best first: everything on one line, then wrapped, then turned, then shortened. */
134
+ static #tries(name, detail) {
135
+ const broken = wrapped(name);
136
+ const tries = [{
137
+ lines: detail ? [name, detail] : [name],
138
+ rotated: false
139
+ }];
140
+ if (broken) tries.push({
141
+ lines: detail ? [...broken, detail] : broken,
142
+ rotated: false
143
+ });
144
+ if (detail) tries.push({
145
+ lines: [name],
146
+ rotated: false
147
+ });
148
+ if (detail && broken) tries.push({
149
+ lines: broken,
150
+ rotated: false
151
+ });
152
+ tries.push({
153
+ lines: [name],
154
+ rotated: true
155
+ });
156
+ for (let length = name.length - 1; length >= SHORTEST; length--) tries.push({
157
+ lines: [`${name.slice(0, length).trimEnd()}…`],
158
+ rotated: false
159
+ });
160
+ return tries;
161
+ }
162
+ /** The label's lines in pixels, slid into view for a room the viewport cuts, or nothing when no form of the text fits. */
163
+ static place({ room, detail, place, width, height, blocked }) {
164
+ const parts = room.parts.map((rings) => rings.map((ring) => ring.map(place)));
165
+ const corners = parts.flat(2);
166
+ const roomWidth = Math.min(width, Math.max(...corners.map(([x]) => x)) - Math.min(...corners.map(([x]) => x)));
167
+ const roomHeight = Math.min(height, Math.max(...corners.map(([, y]) => y)) - Math.min(...corners.map(([, y]) => y)));
168
+ for (const { lines, rotated } of this.#tries(room.name, detail)) {
169
+ const long = Math.max(...lines.map((line) => Math.max(line.length * CHAR, FrameworkText.width(line, 11)))) + 6, deep = lines.length * LINE + PAD;
170
+ const w = rotated ? deep : long, h = rotated ? long : deep;
171
+ if (w > roomWidth || h > roomHeight) continue;
172
+ const pole = place(this.#cached(room, w / h));
173
+ const cx = Math.max(w / 2, Math.min(width - w / 2, pole[0])), cy = Math.max(h / 2, Math.min(height - h / 2, pole[1]));
174
+ for (const [dx, dy] of OFFSETS) {
175
+ const box = {
176
+ x: cx + dx - w / 2,
177
+ y: cy + dy - h / 2,
178
+ w,
179
+ h
180
+ };
181
+ if (box.x < 0 || box.y < 0 || box.x + w > width || box.y + h > height) continue;
182
+ if (blocked.some((other) => overlaps(box, other)) || !parts.some((rings) => encloses(rings, box))) continue;
183
+ blocked.push(box);
184
+ return lines.map((text, i) => {
185
+ const shift = (i - (lines.length - 1) / 2) * LINE;
186
+ return {
187
+ key: `${room.key}/${i}`,
188
+ text,
189
+ rotated,
190
+ strong: i === 0,
191
+ x: rotated ? cx + dx + shift + 4 : cx + dx,
192
+ y: rotated ? cy + dy : cy + dy + shift + 4
193
+ };
194
+ });
195
+ }
196
+ }
197
+ return [];
198
+ }
199
+ };
200
+ export { RoomLabelFit, RoomLabelMode };
@@ -1,5 +1,5 @@
1
1
  import { ChartFamily, DataShape, Dimension } from "../../core/enums.js";
2
- import { SampleData } from "../../data/SampleData.js";
2
+ import { WorldSample } from "../../data/WorldSample.js";
3
3
  import { GeoClasses } from "./GeoClasses.js";
4
4
  import { GeoLegend } from "./GeoLegend.js";
5
5
  import { GeoProjectionKind } from "./GeoProjection.js";
@@ -23,7 +23,7 @@ var TissotMap = class extends RegionMap {
23
23
  "indicatrix",
24
24
  "cartography"
25
25
  ],
26
- sample: (seed) => SampleData.world(seed),
26
+ sample: (seed) => WorldSample.countries(seed),
27
27
  variants: {
28
28
  projection: [
29
29
  GeoProjectionKind.Mercator,
@@ -17,6 +17,10 @@ import { ContourMap, GeoContourStyle } from "./ContourMap.js";
17
17
  import { DotDensityMap, GeoDotPattern } from "./DotDensityMap.js";
18
18
  import { DrillDownMap } from "./DrillDownMap.js";
19
19
  import { DotMap } from "./DotMap.js";
20
+ import { FloorDoorSwing, FloorPlanModel } from "./FloorPlanModel.js";
21
+ import { FloorPlanSamples } from "./FloorPlanSamples.js";
22
+ import { RoomLabelFit, RoomLabelMode } from "./RoomLabelFit.js";
23
+ import { FloorDoorStyle, FloorPlanMap, FloorPlanOrigin, FloorWallStyle } from "./FloorPlanMap.js";
20
24
  import { GraticuleMap } from "./GraticuleMap.js";
21
25
  import { GeoHatch, HatchedChoropleth } from "./HatchedChoropleth.js";
22
26
  import { HeatMapGeo } from "./HeatMapGeo.js";
@@ -34,9 +38,9 @@ import { OPEN_STREET_MAP, SlippyView } from "./SlippyView.js";
34
38
  import { SlippyMarker, SlippyPointMap } from "./SlippyPointMap.js";
35
39
  import { SlippyRegionMap } from "./SlippyRegionMap.js";
36
40
  import { GeoSpikeLean, GeoSpikeShape, SpikeMap } from "./SpikeMap.js";
37
- import { GeoTessellation, ThiessenMap } from "./ThiessenMap.js";
38
41
  import { GeoTileEncoding, GeoTileShape, TileGridMap } from "./TileGridMap.js";
39
42
  import { TissotMap } from "./TissotMap.js";
43
+ import { UsCoverage } from "./UsMapBase.js";
40
44
  import { UsCountyMap } from "./UsCountyMap.js";
41
45
  import { UsStateMap } from "./UsStateMap.js";
42
46
  // src/charts/geomaps/index.ts
@@ -54,7 +58,6 @@ var geomapsCatalog = [
54
58
  HeatMapGeo,
55
59
  ContourMap,
56
60
  RidgelineMap,
57
- ThiessenMap,
58
61
  CartogramDorling,
59
62
  NonContiguousCartogram,
60
63
  HexTileMap,
@@ -69,6 +72,7 @@ var geomapsCatalog = [
69
72
  UsCountyMap,
70
73
  DrillDownMap,
71
74
  SlippyPointMap,
72
- SlippyRegionMap
75
+ SlippyRegionMap,
76
+ FloorPlanMap
73
77
  ];
74
- export { BivariateChoropleth, BubbleMap, CartogramDorling, ChoroplethBase, ChoroplethMap, ClippedGlobeMap, ContourMap, DotDensityMap, DotMap, DrillDownMap, GeoBinEncoding, GeoBinning, GeoBivariateKey, GeoBubblePlacement, GeoCartogramMark, GeoChart, GeoClasses, GeoClassification, GeoContourStyle, GeoCorner, GeoDotPattern, GeoField, GeoFocus, GeoFraming, GeoGlyph, GeoGlyphSize, GeoGround, GeoHatch, GeoHexOrientation, GeoInterpolation, GeoKernel, GeoLabelPlacement, GeoLabelSubject, GeoLand, GeoLegend, GeoLocator, GeoPrismView, GeoProjectionKind, GeoProjections, GeoSizing, GeoSpikeLean, GeoSpikeShape, GeoTessellation, GeoTileEncoding, GeoTileShape, GeoView, GeoViewport, GraticuleMap, HatchedChoropleth, HeatMapGeo, HexTileMap, InsetMap, LabelledMap, NonContiguousCartogram, OPEN_STREET_MAP, PieChartMap, PointDensityMap, PointMap, PrismLikeShadedMap, ProportionalSymbolMap, RegionMap, RidgelineMap, SlippyMarker, SlippyPointMap, SlippyRegionMap, SlippyView, SpikeMap, ThiessenMap, TileGridMap, TileMap, TissotMap, UsCountyMap, UsStateMap, geomapsCatalog };
78
+ export { BivariateChoropleth, BubbleMap, CartogramDorling, ChoroplethBase, ChoroplethMap, ClippedGlobeMap, ContourMap, DotDensityMap, DotMap, DrillDownMap, FloorDoorStyle, FloorDoorSwing, FloorPlanMap, FloorPlanModel, FloorPlanOrigin, FloorPlanSamples, FloorWallStyle, GeoBinEncoding, GeoBinning, GeoBivariateKey, GeoBubblePlacement, GeoCartogramMark, GeoChart, GeoClasses, GeoClassification, GeoContourStyle, GeoCorner, GeoDotPattern, GeoField, GeoFocus, GeoFraming, GeoGlyph, GeoGlyphSize, GeoGround, GeoHatch, GeoHexOrientation, GeoInterpolation, GeoKernel, GeoLabelPlacement, GeoLabelSubject, GeoLand, GeoLegend, GeoLocator, GeoPrismView, GeoProjectionKind, GeoProjections, GeoSizing, GeoSpikeLean, GeoSpikeShape, GeoTileEncoding, GeoTileShape, GeoView, GeoViewport, GraticuleMap, HatchedChoropleth, HeatMapGeo, HexTileMap, InsetMap, LabelledMap, NonContiguousCartogram, OPEN_STREET_MAP, PieChartMap, PointDensityMap, PointMap, PrismLikeShadedMap, ProportionalSymbolMap, RegionMap, RidgelineMap, RoomLabelFit, RoomLabelMode, SlippyMarker, SlippyPointMap, SlippyRegionMap, SlippyView, SpikeMap, TileGridMap, TileMap, TissotMap, UsCountyMap, UsCoverage, UsStateMap, geomapsCatalog };