matterviz 0.3.1 → 0.3.3

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 (358) hide show
  1. package/dist/EmptyState.svelte +10 -2
  2. package/dist/FilePicker.svelte +154 -96
  3. package/dist/Icon.svelte +20 -14
  4. package/dist/MillerIndexInput.svelte +27 -21
  5. package/dist/api/optimade.js +6 -6
  6. package/dist/app.css +216 -178
  7. package/dist/brillouin/BrillouinZone.svelte +299 -198
  8. package/dist/brillouin/BrillouinZone.svelte.d.ts +1 -1
  9. package/dist/brillouin/BrillouinZoneControls.svelte +32 -5
  10. package/dist/brillouin/BrillouinZoneExportPane.svelte +74 -55
  11. package/dist/brillouin/BrillouinZoneExportPane.svelte.d.ts +1 -1
  12. package/dist/brillouin/BrillouinZoneInfoPane.svelte +99 -68
  13. package/dist/brillouin/BrillouinZoneScene.svelte +277 -165
  14. package/dist/brillouin/BrillouinZoneScene.svelte.d.ts +1 -1
  15. package/dist/brillouin/BrillouinZoneTooltip.svelte +17 -7
  16. package/dist/brillouin/compute.js +11 -6
  17. package/dist/chempot-diagram/ChemPotDiagram.svelte +327 -0
  18. package/dist/chempot-diagram/ChemPotDiagram.svelte.d.ts +13 -0
  19. package/dist/chempot-diagram/ChemPotDiagram2D.svelte +847 -0
  20. package/dist/chempot-diagram/ChemPotDiagram2D.svelte.d.ts +16 -0
  21. package/dist/chempot-diagram/ChemPotDiagram3D.svelte +3194 -0
  22. package/dist/chempot-diagram/ChemPotDiagram3D.svelte.d.ts +16 -0
  23. package/dist/chempot-diagram/ChemPotScene3D.svelte +11 -0
  24. package/dist/chempot-diagram/ChemPotScene3D.svelte.d.ts +7 -0
  25. package/dist/chempot-diagram/async-compute.svelte.d.ts +3 -0
  26. package/dist/chempot-diagram/async-compute.svelte.js +77 -0
  27. package/dist/chempot-diagram/chempot-worker.d.ts +1 -0
  28. package/dist/chempot-diagram/chempot-worker.js +11 -0
  29. package/dist/chempot-diagram/color.d.ts +10 -0
  30. package/dist/chempot-diagram/color.js +32 -0
  31. package/dist/chempot-diagram/compute.d.ts +48 -0
  32. package/dist/chempot-diagram/compute.js +812 -0
  33. package/dist/chempot-diagram/index.d.ts +6 -0
  34. package/dist/chempot-diagram/index.js +6 -0
  35. package/dist/chempot-diagram/pointer.d.ts +16 -0
  36. package/dist/chempot-diagram/pointer.js +40 -0
  37. package/dist/chempot-diagram/temperature.d.ts +15 -0
  38. package/dist/chempot-diagram/temperature.js +36 -0
  39. package/dist/chempot-diagram/types.d.ts +86 -0
  40. package/dist/chempot-diagram/types.js +28 -0
  41. package/dist/colors/index.d.ts +3 -1
  42. package/dist/colors/index.js +9 -3
  43. package/dist/composition/BarChart.svelte +141 -77
  44. package/dist/composition/BubbleChart.svelte +107 -52
  45. package/dist/composition/Composition.svelte +100 -79
  46. package/dist/composition/Formula.svelte +108 -62
  47. package/dist/composition/FormulaFilter.svelte +973 -353
  48. package/dist/composition/FormulaFilter.svelte.d.ts +35 -1
  49. package/dist/composition/PieChart.svelte +199 -99
  50. package/dist/composition/PieChart.svelte.d.ts +1 -1
  51. package/dist/composition/format.d.ts +5 -0
  52. package/dist/composition/format.js +20 -3
  53. package/dist/composition/parse.js +14 -9
  54. package/dist/convex-hull/ConvexHull.svelte +93 -38
  55. package/dist/convex-hull/ConvexHull2D.svelte +551 -393
  56. package/dist/convex-hull/ConvexHull3D.svelte +1303 -825
  57. package/dist/convex-hull/ConvexHull4D.svelte +1012 -686
  58. package/dist/convex-hull/ConvexHullControls.svelte +115 -28
  59. package/dist/convex-hull/ConvexHullInfoPane.svelte +29 -3
  60. package/dist/convex-hull/ConvexHullStats.svelte +821 -249
  61. package/dist/convex-hull/ConvexHullStats.svelte.d.ts +6 -1
  62. package/dist/convex-hull/ConvexHullTooltip.svelte +41 -16
  63. package/dist/convex-hull/GasPressureControls.svelte +104 -61
  64. package/dist/convex-hull/StructurePopup.svelte +25 -4
  65. package/dist/convex-hull/TemperatureSlider.svelte +45 -25
  66. package/dist/convex-hull/barycentric-coords.js +13 -7
  67. package/dist/convex-hull/demo-temperature.d.ts +6 -0
  68. package/dist/convex-hull/demo-temperature.js +40 -0
  69. package/dist/convex-hull/gas-thermodynamics.js +17 -12
  70. package/dist/convex-hull/helpers.d.ts +10 -1
  71. package/dist/convex-hull/helpers.js +79 -38
  72. package/dist/convex-hull/index.d.ts +1 -0
  73. package/dist/convex-hull/index.js +1 -0
  74. package/dist/convex-hull/thermodynamics.d.ts +8 -21
  75. package/dist/convex-hull/thermodynamics.js +163 -69
  76. package/dist/convex-hull/types.d.ts +12 -12
  77. package/dist/convex-hull/types.js +0 -12
  78. package/dist/coordination/CoordinationBarPlot.svelte +232 -176
  79. package/dist/element/BohrAtom.svelte +56 -13
  80. package/dist/element/ElementHeading.svelte +7 -2
  81. package/dist/element/ElementPhoto.svelte +15 -9
  82. package/dist/element/ElementStats.svelte +10 -4
  83. package/dist/element/ElementTile.svelte +137 -73
  84. package/dist/element/Nucleus.svelte +39 -11
  85. package/dist/element/data.js +2 -14
  86. package/dist/element/data.json.gz +0 -0
  87. package/dist/element/types.d.ts +1 -0
  88. package/dist/feedback/ClickFeedback.svelte +16 -5
  89. package/dist/feedback/DragOverlay.svelte +10 -2
  90. package/dist/feedback/Spinner.svelte +4 -2
  91. package/dist/feedback/StatusMessage.svelte +8 -2
  92. package/dist/fermi-surface/FermiSlice.svelte +118 -88
  93. package/dist/fermi-surface/FermiSurface.svelte +336 -239
  94. package/dist/fermi-surface/FermiSurface.svelte.d.ts +1 -1
  95. package/dist/fermi-surface/FermiSurfaceControls.svelte +113 -46
  96. package/dist/fermi-surface/FermiSurfaceScene.svelte +536 -343
  97. package/dist/fermi-surface/FermiSurfaceScene.svelte.d.ts +1 -1
  98. package/dist/fermi-surface/FermiSurfaceTooltip.svelte +14 -5
  99. package/dist/fermi-surface/compute.js +16 -20
  100. package/dist/fermi-surface/parse.js +37 -33
  101. package/dist/fermi-surface/symmetry.js +2 -7
  102. package/dist/fermi-surface/types.d.ts +3 -5
  103. package/dist/heatmap-matrix/HeatmapMatrix.svelte +1527 -0
  104. package/dist/heatmap-matrix/HeatmapMatrix.svelte.d.ts +110 -0
  105. package/dist/heatmap-matrix/HeatmapMatrixControls.svelte +225 -0
  106. package/dist/heatmap-matrix/HeatmapMatrixControls.svelte.d.ts +30 -0
  107. package/dist/heatmap-matrix/index.d.ts +53 -0
  108. package/dist/heatmap-matrix/index.js +100 -0
  109. package/dist/heatmap-matrix/shared.d.ts +2 -0
  110. package/dist/heatmap-matrix/shared.js +4 -0
  111. package/dist/icons.d.ts +111 -0
  112. package/dist/icons.js +158 -0
  113. package/dist/index.d.ts +5 -2
  114. package/dist/index.js +5 -2
  115. package/dist/io/decompress.js +1 -1
  116. package/dist/io/export.d.ts +3 -0
  117. package/dist/io/export.js +138 -140
  118. package/dist/io/file-drop.d.ts +7 -0
  119. package/dist/io/file-drop.js +43 -0
  120. package/dist/io/index.d.ts +2 -2
  121. package/dist/io/index.js +2 -112
  122. package/dist/io/is-binary.js +2 -3
  123. package/dist/io/types.d.ts +1 -0
  124. package/dist/io/url-drop.d.ts +2 -0
  125. package/dist/io/url-drop.js +117 -0
  126. package/dist/isosurface/Isosurface.svelte +220 -110
  127. package/dist/isosurface/IsosurfaceControls.svelte +65 -28
  128. package/dist/isosurface/parse.js +104 -56
  129. package/dist/isosurface/slice.d.ts +2 -1
  130. package/dist/isosurface/slice.js +8 -13
  131. package/dist/isosurface/types.d.ts +14 -1
  132. package/dist/isosurface/types.js +152 -5
  133. package/dist/labels.d.ts +2 -1
  134. package/dist/labels.js +12 -8
  135. package/dist/layout/FullscreenToggle.svelte +11 -2
  136. package/dist/layout/InfoCard.svelte +38 -6
  137. package/dist/layout/InfoTag.svelte +125 -94
  138. package/dist/layout/PropertyFilter.svelte +82 -37
  139. package/dist/layout/SettingsSection.svelte +85 -55
  140. package/dist/layout/SubpageGrid.svelte +82 -0
  141. package/dist/layout/SubpageGrid.svelte.d.ts +14 -0
  142. package/dist/layout/index.d.ts +1 -0
  143. package/dist/layout/index.js +1 -0
  144. package/dist/layout/json-tree/JsonNode.svelte +266 -223
  145. package/dist/layout/json-tree/JsonTree.svelte +516 -429
  146. package/dist/layout/json-tree/JsonTree.svelte.d.ts +1 -1
  147. package/dist/layout/json-tree/JsonValue.svelte +281 -173
  148. package/dist/layout/json-tree/types.d.ts +10 -2
  149. package/dist/layout/json-tree/utils.d.ts +2 -0
  150. package/dist/layout/json-tree/utils.js +37 -2
  151. package/dist/marching-cubes.js +25 -2
  152. package/dist/math.d.ts +20 -17
  153. package/dist/math.js +474 -57
  154. package/dist/overlays/ContextMenu.svelte +66 -40
  155. package/dist/overlays/DraggablePane.svelte +331 -154
  156. package/dist/overlays/DraggablePane.svelte.d.ts +2 -0
  157. package/dist/periodic-table/PeriodicTable.svelte +278 -145
  158. package/dist/periodic-table/PeriodicTableControls.svelte +178 -128
  159. package/dist/periodic-table/PropertySelect.svelte +25 -7
  160. package/dist/periodic-table/TableInset.svelte +8 -3
  161. package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte +559 -267
  162. package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte.d.ts +6 -2
  163. package/dist/phase-diagram/PhaseDiagramControls.svelte +131 -51
  164. package/dist/phase-diagram/PhaseDiagramControls.svelte.d.ts +3 -2
  165. package/dist/phase-diagram/PhaseDiagramEditorPane.svelte +126 -0
  166. package/dist/phase-diagram/PhaseDiagramEditorPane.svelte.d.ts +15 -0
  167. package/dist/phase-diagram/PhaseDiagramExportPane.svelte +160 -110
  168. package/dist/phase-diagram/PhaseDiagramExportPane.svelte.d.ts +8 -1
  169. package/dist/phase-diagram/PhaseDiagramTooltip.svelte +217 -86
  170. package/dist/phase-diagram/PhaseDiagramTooltip.svelte.d.ts +6 -3
  171. package/dist/phase-diagram/TdbInfoPanel.svelte +28 -4
  172. package/dist/phase-diagram/build-diagram.js +9 -9
  173. package/dist/phase-diagram/colors.js +1 -3
  174. package/dist/phase-diagram/index.d.ts +2 -0
  175. package/dist/phase-diagram/index.js +2 -0
  176. package/dist/phase-diagram/parse.js +10 -9
  177. package/dist/phase-diagram/svg-to-diagram.d.ts +2 -0
  178. package/dist/phase-diagram/svg-to-diagram.js +869 -0
  179. package/dist/phase-diagram/types.d.ts +10 -0
  180. package/dist/phase-diagram/utils.d.ts +8 -4
  181. package/dist/phase-diagram/utils.js +219 -74
  182. package/dist/plot/AxisLabel.svelte +51 -0
  183. package/dist/plot/AxisLabel.svelte.d.ts +16 -0
  184. package/dist/plot/BarPlot.svelte +1461 -768
  185. package/dist/plot/BarPlot.svelte.d.ts +3 -3
  186. package/dist/plot/BarPlotControls.svelte +33 -6
  187. package/dist/plot/BarPlotControls.svelte.d.ts +1 -1
  188. package/dist/plot/ColorBar.svelte +533 -383
  189. package/dist/plot/ColorBar.svelte.d.ts +1 -1
  190. package/dist/plot/ColorScaleSelect.svelte +28 -7
  191. package/dist/plot/ElementScatter.svelte +38 -16
  192. package/dist/plot/FillArea.svelte +152 -92
  193. package/dist/plot/Histogram.svelte +1162 -709
  194. package/dist/plot/Histogram.svelte.d.ts +1 -1
  195. package/dist/plot/HistogramControls.svelte +81 -18
  196. package/dist/plot/HistogramControls.svelte.d.ts +6 -2
  197. package/dist/plot/InteractiveAxisLabel.svelte +34 -11
  198. package/dist/plot/InteractiveAxisLabel.svelte.d.ts +1 -1
  199. package/dist/plot/Line.svelte +63 -28
  200. package/dist/plot/PlotControls.svelte +221 -96
  201. package/dist/plot/PlotControls.svelte.d.ts +1 -1
  202. package/dist/plot/PlotLegend.svelte +174 -91
  203. package/dist/plot/PlotTooltip.svelte +45 -6
  204. package/dist/plot/PortalSelect.svelte +175 -146
  205. package/dist/plot/ReferenceLine.svelte +77 -22
  206. package/dist/plot/ReferenceLine.svelte.d.ts +1 -0
  207. package/dist/plot/ReferenceLine3D.svelte +132 -107
  208. package/dist/plot/ReferencePlane.svelte +146 -123
  209. package/dist/plot/ScatterPlot.svelte +1880 -1156
  210. package/dist/plot/ScatterPlot.svelte.d.ts +3 -3
  211. package/dist/plot/ScatterPlot3D.svelte +256 -131
  212. package/dist/plot/ScatterPlot3D.svelte.d.ts +2 -2
  213. package/dist/plot/ScatterPlot3DControls.svelte +300 -297
  214. package/dist/plot/ScatterPlot3DControls.svelte.d.ts +2 -1
  215. package/dist/plot/ScatterPlot3DScene.svelte +608 -406
  216. package/dist/plot/ScatterPlot3DScene.svelte.d.ts +2 -2
  217. package/dist/plot/ScatterPlotControls.svelte +150 -70
  218. package/dist/plot/ScatterPlotControls.svelte.d.ts +1 -1
  219. package/dist/plot/ScatterPoint.svelte +98 -26
  220. package/dist/plot/ScatterPoint.svelte.d.ts +1 -0
  221. package/dist/plot/SpacegroupBarPlot.svelte +142 -85
  222. package/dist/plot/Surface3D.svelte +159 -108
  223. package/dist/plot/ZeroLines.svelte +96 -0
  224. package/dist/plot/ZeroLines.svelte.d.ts +32 -0
  225. package/dist/plot/ZoomRect.svelte +23 -0
  226. package/dist/plot/ZoomRect.svelte.d.ts +8 -0
  227. package/dist/plot/axis-utils.d.ts +1 -1
  228. package/dist/plot/axis-utils.js +1 -3
  229. package/dist/plot/data-cleaning.js +12 -28
  230. package/dist/plot/data-transform.js +2 -1
  231. package/dist/plot/fill-utils.js +2 -0
  232. package/dist/plot/index.d.ts +6 -2
  233. package/dist/plot/index.js +6 -2
  234. package/dist/plot/interactions.d.ts +8 -10
  235. package/dist/plot/interactions.js +2 -3
  236. package/dist/plot/layout.d.ts +11 -2
  237. package/dist/plot/layout.js +44 -17
  238. package/dist/plot/reference-line.d.ts +5 -22
  239. package/dist/plot/reference-line.js +12 -84
  240. package/dist/plot/scales.js +24 -36
  241. package/dist/plot/types.d.ts +53 -40
  242. package/dist/plot/types.js +12 -7
  243. package/dist/plot/utils/label-placement.d.ts +32 -15
  244. package/dist/plot/utils/label-placement.js +227 -63
  245. package/dist/plot/utils/series-visibility.js +2 -3
  246. package/dist/plot/utils.d.ts +1 -0
  247. package/dist/plot/utils.js +14 -0
  248. package/dist/rdf/RdfPlot.svelte +173 -132
  249. package/dist/rdf/calc-rdf.js +4 -5
  250. package/dist/sanitize.d.ts +4 -0
  251. package/dist/sanitize.js +107 -0
  252. package/dist/settings.d.ts +21 -6
  253. package/dist/settings.js +63 -19
  254. package/dist/spectral/Bands.svelte +963 -412
  255. package/dist/spectral/Bands.svelte.d.ts +22 -2
  256. package/dist/spectral/BandsAndDos.svelte +90 -49
  257. package/dist/spectral/BrillouinBandsDos.svelte +151 -93
  258. package/dist/spectral/Dos.svelte +389 -258
  259. package/dist/spectral/helpers.d.ts +23 -1
  260. package/dist/spectral/helpers.js +119 -51
  261. package/dist/spectral/types.d.ts +2 -0
  262. package/dist/state.svelte.d.ts +1 -1
  263. package/dist/state.svelte.js +3 -2
  264. package/dist/structure/Arrow.svelte +59 -20
  265. package/dist/structure/AtomLegend.svelte +231 -129
  266. package/dist/structure/AtomLegend.svelte.d.ts +1 -1
  267. package/dist/structure/Bond.svelte +73 -47
  268. package/dist/structure/CanvasTooltip.svelte +10 -2
  269. package/dist/structure/CellSelect.svelte +148 -51
  270. package/dist/structure/Cylinder.svelte +33 -17
  271. package/dist/structure/Lattice.svelte +88 -33
  272. package/dist/structure/Structure.svelte +1077 -821
  273. package/dist/structure/Structure.svelte.d.ts +1 -1
  274. package/dist/structure/StructureControls.svelte +373 -139
  275. package/dist/structure/StructureControls.svelte.d.ts +1 -1
  276. package/dist/structure/StructureExportPane.svelte +124 -89
  277. package/dist/structure/StructureExportPane.svelte.d.ts +1 -1
  278. package/dist/structure/StructureInfoPane.svelte +304 -231
  279. package/dist/structure/StructureScene.svelte +919 -445
  280. package/dist/structure/StructureScene.svelte.d.ts +16 -7
  281. package/dist/structure/atom-properties.d.ts +6 -2
  282. package/dist/structure/atom-properties.js +42 -29
  283. package/dist/structure/bonding.js +6 -7
  284. package/dist/structure/export.js +22 -34
  285. package/dist/structure/ferrox-wasm-types.d.ts +3 -2
  286. package/dist/structure/ferrox-wasm-types.js +0 -3
  287. package/dist/structure/ferrox-wasm.d.ts +3 -2
  288. package/dist/structure/ferrox-wasm.js +2 -3
  289. package/dist/structure/index.d.ts +16 -0
  290. package/dist/structure/index.js +88 -6
  291. package/dist/structure/measure.d.ts +2 -2
  292. package/dist/structure/measure.js +4 -44
  293. package/dist/structure/parse.js +130 -155
  294. package/dist/structure/partial-occupancy.d.ts +25 -0
  295. package/dist/structure/partial-occupancy.js +99 -0
  296. package/dist/structure/pbc.d.ts +1 -0
  297. package/dist/structure/pbc.js +16 -6
  298. package/dist/structure/supercell.d.ts +2 -2
  299. package/dist/structure/supercell.js +12 -22
  300. package/dist/structure/validation.js +5 -3
  301. package/dist/symmetry/SymmetryStats.svelte +94 -37
  302. package/dist/symmetry/WyckoffTable.svelte +42 -14
  303. package/dist/symmetry/cell-transform.js +5 -3
  304. package/dist/symmetry/index.d.ts +7 -4
  305. package/dist/symmetry/index.js +87 -21
  306. package/dist/symmetry/spacegroups.js +148 -148
  307. package/dist/table/HeatmapTable.svelte +1112 -516
  308. package/dist/table/HeatmapTable.svelte.d.ts +12 -1
  309. package/dist/table/ToggleMenu.svelte +125 -90
  310. package/dist/table/index.d.ts +2 -0
  311. package/dist/table/index.js +2 -4
  312. package/dist/theme/ThemeControl.svelte +21 -12
  313. package/dist/time.js +4 -1
  314. package/dist/tooltip/TooltipContent.svelte +33 -8
  315. package/dist/trajectory/Trajectory.svelte +889 -687
  316. package/dist/trajectory/TrajectoryError.svelte +14 -3
  317. package/dist/trajectory/TrajectoryExportPane.svelte +148 -90
  318. package/dist/trajectory/TrajectoryExportPane.svelte.d.ts +1 -1
  319. package/dist/trajectory/TrajectoryInfoPane.svelte +272 -143
  320. package/dist/trajectory/constants.d.ts +6 -0
  321. package/dist/trajectory/constants.js +7 -0
  322. package/dist/trajectory/extract.js +13 -31
  323. package/dist/trajectory/format-detect.d.ts +9 -0
  324. package/dist/trajectory/format-detect.js +76 -0
  325. package/dist/trajectory/frame-reader.d.ts +17 -0
  326. package/dist/trajectory/frame-reader.js +332 -0
  327. package/dist/trajectory/helpers.d.ts +14 -0
  328. package/dist/trajectory/helpers.js +172 -0
  329. package/dist/trajectory/index.d.ts +1 -0
  330. package/dist/trajectory/index.js +23 -14
  331. package/dist/trajectory/parse/ase.d.ts +2 -0
  332. package/dist/trajectory/parse/ase.js +77 -0
  333. package/dist/trajectory/parse/hdf5.d.ts +2 -0
  334. package/dist/trajectory/parse/hdf5.js +129 -0
  335. package/dist/trajectory/parse/index.d.ts +12 -0
  336. package/dist/trajectory/parse/index.js +299 -0
  337. package/dist/trajectory/parse/lammps.d.ts +5 -0
  338. package/dist/trajectory/parse/lammps.js +179 -0
  339. package/dist/trajectory/parse/vasp.d.ts +2 -0
  340. package/dist/trajectory/parse/vasp.js +68 -0
  341. package/dist/trajectory/parse/xyz.d.ts +2 -0
  342. package/dist/trajectory/parse/xyz.js +110 -0
  343. package/dist/trajectory/plotting.js +13 -8
  344. package/dist/trajectory/types.d.ts +11 -0
  345. package/dist/trajectory/types.js +1 -0
  346. package/dist/utils.d.ts +3 -0
  347. package/dist/utils.js +17 -0
  348. package/dist/xrd/XrdPlot.svelte +337 -245
  349. package/dist/xrd/broadening.js +14 -9
  350. package/dist/xrd/calc-xrd.js +12 -19
  351. package/dist/xrd/parse.d.ts +1 -1
  352. package/dist/xrd/parse.js +17 -17
  353. package/package.json +103 -101
  354. package/readme.md +4 -4
  355. package/dist/trajectory/parse.d.ts +0 -42
  356. package/dist/trajectory/parse.js +0 -1267
  357. /package/dist/element/{data.json.d.ts → data.json.gz.d.ts} +0 -0
  358. /package/dist/theme/{themes.js → themes.mjs} +0 -0
@@ -1,80 +1,172 @@
1
- <script lang="ts">import { ATOMIC_WEIGHTS } from '../composition/parse';
2
- import { format_num } from '../labels';
3
- import { TooltipContent } from '../tooltip';
4
- import { format_composition, format_temperature, get_phase_stability_range, } from './utils';
5
- let { hover_info, temperature_unit = `K`, composition_unit = `at%`, component_a = `A`, component_b = `B`, boundaries = [], tooltip, } = $props();
6
- // Convert atomic fraction to weight fraction: wt_B = (x_B * M_B) / (x_A * M_A + x_B * M_B)
7
- const wt_fraction_b = $derived.by(() => {
8
- const mass_a = ATOMIC_WEIGHTS.get(component_a);
9
- const mass_b = ATOMIC_WEIGHTS.get(component_b);
10
- if (!mass_a || !mass_b)
11
- return null;
12
- const { composition: x_b } = hover_info;
13
- const denom = (1 - x_b) * mass_a + x_b * mass_b;
14
- return denom > 0 ? (x_b * mass_b) / denom : null;
15
- });
16
- const stability = $derived(get_phase_stability_range(hover_info.region));
17
- // Format special point type for display (e.g., "peritectic" → "Peritectic")
18
- // For melting points and congruent points at composition edges, show element-specific info
19
- const special_point_info = $derived.by(() => {
20
- const point = hover_info.special_point;
21
- if (!point)
22
- return null;
23
- const type = point.type;
24
- const position = point.position;
25
- const temp = format_temperature(position[1], temperature_unit);
1
+ <script lang="ts">
2
+ import { ATOMIC_WEIGHTS } from '../composition/parse'
3
+ import type { ElementSymbol } from '../element'
4
+ import { format_num } from '../labels'
5
+ import { sanitize_formula, sanitize_html } from '../sanitize'
6
+ import { TooltipContent } from '../tooltip'
7
+ import type {
8
+ CompUnit,
9
+ LeverRuleMode,
10
+ PhaseBoundary,
11
+ PhaseDiagramTooltipProp,
12
+ PhaseHoverInfo,
13
+ TempUnit,
14
+ } from './types'
15
+ import {
16
+ convert_temp,
17
+ format_composition,
18
+ format_label_html,
19
+ format_temperature,
20
+ get_phase_stability_range,
21
+ } from './utils'
22
+
23
+ let {
24
+ hover_info,
25
+ temperature_unit = `K`,
26
+ data_temperature_unit,
27
+ composition_unit = `at%`,
28
+ component_a = `A`,
29
+ component_b = `B`,
30
+ boundaries = [],
31
+ lever_rule_mode = `horizontal`,
32
+ use_subscripts = true,
33
+ tooltip,
34
+ }: {
35
+ hover_info: PhaseHoverInfo
36
+ temperature_unit?: TempUnit
37
+ // Original unit of hover_info.temperature (defaults to temperature_unit)
38
+ data_temperature_unit?: TempUnit
39
+ composition_unit?: CompUnit
40
+ component_a?: string
41
+ component_b?: string
42
+ boundaries?: PhaseBoundary[]
43
+ lever_rule_mode?: LeverRuleMode
44
+ use_subscripts?: boolean
45
+ tooltip?: PhaseDiagramTooltipProp
46
+ } = $props()
47
+
48
+ // The unit that hover_info.temperature is actually in
49
+ const data_unit = $derived(data_temperature_unit ?? temperature_unit)
50
+
51
+ const safe_formula = (comp: string) => sanitize_formula(comp, use_subscripts)
52
+
53
+ // Convert a temperature from data unit to display unit
54
+ function to_display(temp: number): number {
55
+ return convert_temp(temp, data_unit, temperature_unit)
56
+ }
57
+
58
+ // Convert atomic fraction to weight fraction: wt_B = (x_B * M_B) / (x_A * M_A + x_B * M_B)
59
+ const wt_fraction_b = $derived.by(() => {
60
+ const mass_a = ATOMIC_WEIGHTS.get(component_a as ElementSymbol)
61
+ const mass_b = ATOMIC_WEIGHTS.get(component_b as ElementSymbol)
62
+ if (!mass_a || !mass_b) return null
63
+ const { composition: x_b } = hover_info
64
+ const denom = (1 - x_b) * mass_a + x_b * mass_b
65
+ return denom > 0 ? (x_b * mass_b) / denom : null
66
+ })
67
+
68
+ const stability = $derived(get_phase_stability_range(hover_info.region))
69
+
70
+ // Format special point type for display (e.g., "peritectic" → "Peritectic")
71
+ // For melting points and congruent points at composition edges, show element-specific info
72
+ const special_point_info = $derived.by(() => {
73
+ const point = hover_info.special_point
74
+ if (!point) return null
75
+
76
+ const type = point.type
77
+ const position = point.position
78
+ const temp = format_temperature(to_display(position[1]), temperature_unit)
79
+
26
80
  // Check if this is a melting point (at composition edge)
27
- const is_at_edge = position[0] <= 0.01 || position[0] >= 0.99;
28
- const is_melting = type === `melting_point` || type === `congruent`;
81
+ const is_at_edge = position[0] <= 0.01 || position[0] >= 0.99
82
+ const is_melting = type === `melting_point` || type === `congruent`
83
+
29
84
  if (is_melting && is_at_edge) {
30
- const element = position[0] <= 0.01 ? component_a : component_b;
31
- return {
32
- badge: `Melting Point`,
33
- description: `${element} melts at ${temp}`,
34
- };
85
+ const element = position[0] <= 0.01 ? component_a : component_b
86
+ return {
87
+ badge: `Melting Point`,
88
+ description: `${element} melts at ${temp}`,
89
+ }
35
90
  }
91
+
36
92
  // Handle other special point types with descriptive info
37
- const type_descriptions = {
38
- eutectic: `Liquid → two solid phases at ${temp}`,
39
- peritectic: `Liquid + solid → different solid at ${temp}`,
40
- eutectoid: `Solid → two solid phases at ${temp}`,
41
- peritectoid: `Two solids → different solid at ${temp}`,
42
- congruent: `Congruent phase change at ${temp}`,
43
- };
44
- const badge = type.charAt(0).toUpperCase() + type.slice(1).replace(/_/g, ` `);
93
+ const type_descriptions: Record<string, string> = {
94
+ eutectic: `Liquid → two solid phases at ${temp}`,
95
+ peritectic: `Liquid + solid → different solid at ${temp}`,
96
+ eutectoid: `Solid → two solid phases at ${temp}`,
97
+ peritectoid: `Two solids → different solid at ${temp}`,
98
+ congruent: `Congruent phase change at ${temp}`,
99
+ }
100
+
101
+ const badge = type.charAt(0).toUpperCase() + type.slice(1).replaceAll(`_`, ` `)
45
102
  return {
46
- badge,
47
- description: type_descriptions[type] ?? null,
48
- };
49
- });
50
- // Calculate distance to nearest phase boundary (liquidus/solidus)
51
- const boundary_distance = $derived.by(() => {
52
- if (!boundaries.length)
53
- return null;
54
- const { composition, temperature } = hover_info;
55
- let min_dist = null;
103
+ badge,
104
+ description: type_descriptions[type] ?? null,
105
+ }
106
+ })
107
+
108
+ // Calculate distance to nearest phase boundary (liquidus/solidus)
109
+ const boundary_distance = $derived.by(() => {
110
+ if (!boundaries.length) return null
111
+ const { composition, temperature } = hover_info
112
+ let min_dist: { type: string; delta_t: number } | null = null
113
+
56
114
  for (const boundary of boundaries) {
57
- if (![`liquidus`, `solidus`, `solvus`].includes(boundary.type))
58
- continue;
59
- // Find the boundary point closest in composition
60
- for (const [bx, bt] of boundary.points) {
61
- if (Math.abs(bx - composition) < 0.02) {
62
- // Within 2% composition
63
- const delta = temperature - bt;
64
- if (!min_dist || Math.abs(delta) < Math.abs(min_dist.delta_t)) {
65
- min_dist = { type: boundary.type, delta_t: delta };
66
- }
67
- }
115
+ if (![`liquidus`, `solidus`, `solvus`].includes(boundary.type)) continue
116
+ // Find the boundary point closest in composition
117
+ for (const [bx, bt] of boundary.points) {
118
+ if (Math.abs(bx - composition) < 0.02) {
119
+ // Within 2% composition
120
+ const delta = temperature - bt
121
+ if (!min_dist || Math.abs(delta) < Math.abs(min_dist.delta_t)) {
122
+ min_dist = { type: boundary.type, delta_t: delta }
123
+ }
68
124
  }
125
+ }
126
+ }
127
+ return min_dist
128
+ })
129
+
130
+ // Normalized lever rule display data (unifies horizontal and vertical modes)
131
+ const lever_display = $derived.by(() => {
132
+ if (lever_rule_mode === `vertical` && hover_info.vertical_lever_rule) {
133
+ const vlr = hover_info.vertical_lever_rule
134
+ return {
135
+ label: `Lever Rule (vertical)`,
136
+ phase_a: vlr.bottom_phase,
137
+ phase_b: vlr.top_phase,
138
+ fraction_a: vlr.fraction_bottom,
139
+ fraction_b: vlr.fraction_top,
140
+ detail_a: format_temperature(
141
+ to_display(vlr.bottom_temperature),
142
+ temperature_unit,
143
+ ),
144
+ detail_b: format_temperature(
145
+ to_display(vlr.top_temperature),
146
+ temperature_unit,
147
+ ),
148
+ }
149
+ }
150
+ if (lever_rule_mode === `horizontal` && hover_info.lever_rule) {
151
+ const lr = hover_info.lever_rule
152
+ return {
153
+ label: `Lever Rule`,
154
+ phase_a: lr.left_phase,
155
+ phase_b: lr.right_phase,
156
+ fraction_a: lr.fraction_left,
157
+ fraction_b: lr.fraction_right,
158
+ detail_a: format_composition(lr.left_composition, composition_unit),
159
+ detail_b: format_composition(lr.right_composition, composition_unit),
160
+ }
69
161
  }
70
- return min_dist;
71
- });
162
+ return null
163
+ })
72
164
  </script>
73
165
 
74
166
  <TooltipContent data={hover_info} snippet_arg={hover_info} {tooltip}>
75
167
  <div class="phase-diagram-tooltip">
76
168
  <header>
77
- <strong>{hover_info.region.name}</strong>
169
+ <strong>{@html sanitize_html(format_label_html(hover_info.region.name, use_subscripts))}</strong>
78
170
  {#if special_point_info}<span class="special-point-badge">{
79
171
  special_point_info.badge
80
172
  }</span>{/if}
@@ -86,49 +178,84 @@ const boundary_distance = $derived.by(() => {
86
178
 
87
179
  <dl>
88
180
  <dt>Temperature</dt>
89
- <dd>{format_temperature(hover_info.temperature, temperature_unit)}</dd>
181
+ <dd>
182
+ {
183
+ format_temperature(
184
+ to_display(hover_info.temperature),
185
+ temperature_unit,
186
+ )
187
+ }
188
+ {#if temperature_unit !== `°C`}
189
+ <small>({
190
+ format_temperature(
191
+ convert_temp(hover_info.temperature, data_unit, `°C`),
192
+ `°C`,
193
+ )
194
+ })</small>
195
+ {/if}
196
+ </dd>
90
197
  <dt>Composition</dt>
91
198
  <dd>
92
- {format_composition(hover_info.composition, composition_unit)} {component_b}
93
- <small>({format_composition(1 - hover_info.composition, composition_unit)} {
94
- component_a
95
- })</small>
199
+ {format_composition(hover_info.composition, composition_unit)}
200
+ {@html safe_formula(component_b)}
201
+ <small>({format_composition(1 - hover_info.composition, composition_unit)}
202
+ {@html safe_formula(component_a)})</small>
96
203
  </dd>
97
204
  {#if wt_fraction_b !== null}
98
205
  <dt>Weight</dt>
99
206
  <dd>
100
- {format_num(wt_fraction_b * 100, `.1f`)}% {component_b}
101
- <small>({format_num((1 - wt_fraction_b) * 100, `.1f`)}% {component_a})</small>
207
+ {format_num(wt_fraction_b * 100, `.1f`)}%
208
+ {@html safe_formula(component_b)}
209
+ <small>({format_num((1 - wt_fraction_b) * 100, `.1f`)}%
210
+ {@html safe_formula(component_a)})</small>
102
211
  </dd>
103
212
  {/if}
104
213
  {#if stability}
105
- <dt>Stable</dt><dd>{stability.t_min} – {stability.t_max} {temperature_unit}</dd>
214
+ <dt>Stable</dt><dd>
215
+ {format_num(to_display(stability.t_min), `.0f`)} – {
216
+ format_num(to_display(stability.t_max), `.0f`)
217
+ } {temperature_unit}
218
+ {#if temperature_unit !== `°C`}
219
+ <small>({
220
+ format_num(
221
+ convert_temp(stability.t_min, data_unit, `°C`),
222
+ `.0f`,
223
+ )
224
+ } – {
225
+ format_num(
226
+ convert_temp(stability.t_max, data_unit, `°C`),
227
+ `.0f`,
228
+ )
229
+ } °C)</small>
230
+ {/if}
231
+ </dd>
106
232
  {/if}
107
233
  </dl>
108
234
 
109
- {#if hover_info.lever_rule}
110
- {@const lr = hover_info.lever_rule}
235
+ {#if lever_display}
236
+ {@const ld = lever_display}
111
237
  <div class="lever">
112
- <span>Lever Rule</span>
238
+ <span>{ld.label}</span>
113
239
  <div class="bar">
114
240
  <div
115
- style:width="{lr.fraction_left * 100}%"
116
- title="{lr.left_phase}: {format_num(lr.fraction_left * 100, `.1f`)}%"
241
+ style:width="{ld.fraction_a * 100}%"
242
+ title="{ld.phase_a}: {format_num(ld.fraction_a * 100, `.1f`)}%"
117
243
  >
118
244
  </div>
119
245
  <div
120
- style:width="{lr.fraction_right * 100}%"
121
- title="{lr.right_phase}: {format_num(lr.fraction_right * 100, `.1f`)}%"
246
+ style:width="{ld.fraction_b * 100}%"
247
+ title="{ld.phase_b}: {format_num(ld.fraction_b * 100, `.1f`)}%"
122
248
  >
123
249
  </div>
124
- <i style:left="{lr.fraction_left * 100}%"></i>
250
+ <i style:left="{ld.fraction_a * 100}%"></i>
125
251
  </div>
126
252
  <div class="phase-info">
127
- <span>{lr.left_phase}: {format_num(lr.fraction_left * 100, `.0f`)}% <small>at {
128
- format_composition(lr.left_composition, composition_unit)
129
- }</small></span>
130
- <span>{lr.right_phase}: {format_num(lr.fraction_right * 100, `.0f`)}% <small>at
131
- {format_composition(lr.right_composition, composition_unit)}</small></span>
253
+ <span>{@html safe_formula(ld.phase_a)}: {
254
+ format_num(ld.fraction_a * 100, `.0f`)
255
+ }% <small>at {ld.detail_a}</small></span>
256
+ <span>{@html safe_formula(ld.phase_b)}: {
257
+ format_num(ld.fraction_b * 100, `.0f`)
258
+ }% <small>at {ld.detail_b}</small></span>
132
259
  </div>
133
260
  </div>
134
261
  {/if}
@@ -136,8 +263,12 @@ const boundary_distance = $derived.by(() => {
136
263
  {#if boundary_distance}
137
264
  {@const { type, delta_t } = boundary_distance}
138
265
  {@const label = delta_t > 0 ? `above` : `below`}
266
+ {@const display_delta = Math.abs(
267
+ to_display(hover_info.temperature) -
268
+ to_display(hover_info.temperature - delta_t),
269
+ )}
139
270
  <div class="boundary-info">
140
- {Math.round(Math.abs(delta_t))} {temperature_unit} {label} {type}
271
+ {Math.round(display_delta)} {temperature_unit} {label} {type}
141
272
  </div>
142
273
  {/if}
143
274
  </div>
@@ -1,11 +1,14 @@
1
- import type { PhaseBoundary, PhaseDiagramTooltipProp, PhaseHoverInfo } from './types';
1
+ import type { CompUnit, LeverRuleMode, PhaseBoundary, PhaseDiagramTooltipProp, PhaseHoverInfo, TempUnit } from './types';
2
2
  type $$ComponentProps = {
3
3
  hover_info: PhaseHoverInfo;
4
- temperature_unit?: string;
5
- composition_unit?: string;
4
+ temperature_unit?: TempUnit;
5
+ data_temperature_unit?: TempUnit;
6
+ composition_unit?: CompUnit;
6
7
  component_a?: string;
7
8
  component_b?: string;
8
9
  boundaries?: PhaseBoundary[];
10
+ lever_rule_mode?: LeverRuleMode;
11
+ use_subscripts?: boolean;
9
12
  tooltip?: PhaseDiagramTooltipProp;
10
13
  };
11
14
  declare const PhaseDiagramTooltip: import("svelte").Component<$$ComponentProps, {}, "">;
@@ -1,7 +1,31 @@
1
- <script lang="ts">import { extract_tdb_reference, summarize_models } from './utils';
2
- let { result, system_name = ``, has_precomputed = false, is_precomputed_loaded = false, on_load_precomputed, style = ``, } = $props();
3
- const reference = $derived(result.data ? extract_tdb_reference(result.data.comments) : null);
4
- const model_summary = $derived(result.data ? summarize_models(result.data.phases) : null);
1
+ <script lang="ts">
2
+ import type { TdbParseResult } from './parse'
3
+ import { extract_tdb_reference, summarize_models } from './utils'
4
+
5
+ interface Props {
6
+ result: TdbParseResult
7
+ system_name?: string
8
+ has_precomputed?: boolean
9
+ is_precomputed_loaded?: boolean
10
+ on_load_precomputed?: () => void
11
+ style?: string
12
+ }
13
+
14
+ let {
15
+ result,
16
+ system_name = ``,
17
+ has_precomputed = false,
18
+ is_precomputed_loaded = false,
19
+ on_load_precomputed,
20
+ style = ``,
21
+ }: Props = $props()
22
+
23
+ const reference = $derived(
24
+ result.data ? extract_tdb_reference(result.data.comments) : null,
25
+ )
26
+ const model_summary = $derived(
27
+ result.data ? summarize_models(result.data.phases) : null,
28
+ )
5
29
  </script>
6
30
 
7
31
  <div class="tdb-info-panel" {style}>
@@ -19,7 +19,7 @@ export function parse_curve_ref(ref) {
19
19
  name = name.slice(1);
20
20
  }
21
21
  // Check for slice suffix [start:end]
22
- const slice_match = name.match(/^(.+)\[(-?\d*):(-?\d*)\]$/);
22
+ const slice_match = /^(.+)\[(-?\d*):(-?\d*)\]$/.exec(name);
23
23
  if (slice_match) {
24
24
  name = slice_match[1];
25
25
  start = slice_match[2] ? parseInt(slice_match[2]) : null;
@@ -30,14 +30,14 @@ export function parse_curve_ref(ref) {
30
30
  // Apply slicing to array (Python-style negative indices supported)
31
31
  export function apply_slice(arr, start, end) {
32
32
  const len = arr.length;
33
- let s = start ?? 0;
34
- let e = end ?? len;
33
+ let start_idx = start ?? 0;
34
+ let end_idx = end ?? len;
35
35
  // Handle negative indices
36
- if (s < 0)
37
- s = Math.max(0, len + s);
38
- if (e < 0)
39
- e = Math.max(0, len + e);
40
- return arr.slice(s, e);
36
+ if (start_idx < 0)
37
+ start_idx = Math.max(0, len + start_idx);
38
+ if (end_idx < 0)
39
+ end_idx = Math.max(0, len + end_idx);
40
+ return arr.slice(start_idx, end_idx);
41
41
  }
42
42
  // Expand bounds to vertex list
43
43
  function expand_bounds(bounds, curves) {
@@ -57,7 +57,7 @@ function expand_bounds(bounds, curves) {
57
57
  }
58
58
  // Apply reverse first (to match Python's `reversed(curve)[1:]` pattern)
59
59
  if (ref.reverse) {
60
- points = [...points].reverse();
60
+ points = points.toReversed();
61
61
  }
62
62
  // Then apply slice
63
63
  points = apply_slice(points, ref.start, ref.end);
@@ -1,8 +1,6 @@
1
1
  // Phase diagram color palette
2
2
  // Keys can be referenced in diagram JSON files
3
- function rgba(r, g, b, a = 0.6) {
4
- return `rgba(${r}, ${g}, ${b}, ${a})`;
5
- }
3
+ const rgba = (r, g, b, a = 0.6) => `rgba(${r}, ${g}, ${b}, ${a})`;
6
4
  // Color palette for diagram JSON files - keyed colors that can be referenced by name
7
5
  export const DIAGRAM_COLORS = {
8
6
  // Single-phase regions (alpha=0.6)
@@ -4,8 +4,10 @@ export * from './diagram-input';
4
4
  export { default as IsobaricBinaryPhaseDiagram } from './IsobaricBinaryPhaseDiagram.svelte';
5
5
  export * from './parse';
6
6
  export { default as PhaseDiagramControls } from './PhaseDiagramControls.svelte';
7
+ export { default as PhaseDiagramEditorPane } from './PhaseDiagramEditorPane.svelte';
7
8
  export { default as PhaseDiagramExportPane } from './PhaseDiagramExportPane.svelte';
8
9
  export { default as PhaseDiagramTooltip } from './PhaseDiagramTooltip.svelte';
10
+ export { parse_phase_diagram_svg } from './svg-to-diagram';
9
11
  export { default as TdbInfoPanel } from './TdbInfoPanel.svelte';
10
12
  export * from './types';
11
13
  export * from './utils';
@@ -4,8 +4,10 @@ export * from './diagram-input';
4
4
  export { default as IsobaricBinaryPhaseDiagram } from './IsobaricBinaryPhaseDiagram.svelte';
5
5
  export * from './parse';
6
6
  export { default as PhaseDiagramControls } from './PhaseDiagramControls.svelte';
7
+ export { default as PhaseDiagramEditorPane } from './PhaseDiagramEditorPane.svelte';
7
8
  export { default as PhaseDiagramExportPane } from './PhaseDiagramExportPane.svelte';
8
9
  export { default as PhaseDiagramTooltip } from './PhaseDiagramTooltip.svelte';
10
+ export { parse_phase_diagram_svg } from './svg-to-diagram';
9
11
  export { default as TdbInfoPanel } from './TdbInfoPanel.svelte';
10
12
  export * from './types';
11
13
  export * from './utils';
@@ -44,13 +44,10 @@ export function parse_tdb(content) {
44
44
  }
45
45
  // Derive binary system from elements (excluding VA)
46
46
  const real_elements = data.elements.map((el) => el.symbol).filter(is_real_element);
47
- const binary_system = real_elements.length === 2
48
- ? [real_elements[0], real_elements[1]]
49
- : undefined;
47
+ const binary_system = real_elements.length === 2 ? [real_elements[0], real_elements[1]] : undefined;
50
48
  // Extract temperature range from functions/parameters
51
49
  // Find the actual min and max temperatures across all ranges
52
- let min_temp = Infinity;
53
- let max_temp = -Infinity;
50
+ let [min_temp, max_temp] = [Infinity, -Infinity];
54
51
  for (const func of data.functions) {
55
52
  for (const range of func.temperature_ranges) {
56
53
  if (range.min < min_temp)
@@ -152,7 +149,7 @@ const LINE_PARSERS = [
152
149
  prefix: `PARAMETER `,
153
150
  pattern: /PARAMETER\s+(\w+)\(([^)]+)\)\s+(.+?)!/i,
154
151
  handler: (match, data) => {
155
- const spec_match = match[2].match(/([^,]+),([^;]+);(\d+)/);
152
+ const spec_match = /([^,]+),([^;]+);(\d+)/.exec(match[2]);
156
153
  if (spec_match) {
157
154
  data.parameters.push({
158
155
  type: match[1],
@@ -172,7 +169,7 @@ function parse_temperature_ranges(body) {
172
169
  const trimmed = segment.trim();
173
170
  if (!trimmed)
174
171
  continue;
175
- const temp_match = trimmed.match(/^([\d.E+-]+)\s+(.+)/i);
172
+ const temp_match = /^([\d.E+-]+)\s+(.+)/i.exec(trimmed);
176
173
  if (temp_match) {
177
174
  const next_temp = parseFloat(temp_match[1]);
178
175
  const expr = temp_match[2].replace(/\s+[YN]\s*$/, ``).trim();
@@ -193,7 +190,7 @@ function parse_tdb_line(line, data) {
193
190
  parser.handler(match, data);
194
191
  else if (parser.prefix === `ELEMENT `) {
195
192
  // Fallback for simpler ELEMENT format: ELEMENT AL FCC_A1!
196
- const simple_match = line.match(/ELEMENT\s+(\S+)\s+(\S+)/i);
193
+ const simple_match = /ELEMENT\s+(\S+)\s+(\S+)/i.exec(line);
197
194
  if (simple_match) {
198
195
  data.elements.push({
199
196
  symbol: simple_match[1].toUpperCase(),
@@ -211,7 +208,11 @@ function parse_tdb_line(line, data) {
211
208
  }
212
209
  // Get a normalized system name from elements (e.g., "AL-ZN" always alphabetically sorted)
213
210
  export function get_system_name(elements) {
214
- return elements.filter(is_real_element).map((el) => el.toUpperCase()).sort().join(`-`);
211
+ return elements
212
+ .filter(is_real_element)
213
+ .map((el) => el.toUpperCase())
214
+ .sort()
215
+ .join(`-`);
215
216
  }
216
217
  // Check if a TDB file represents a binary system
217
218
  export function is_binary_system(tdb_data) {
@@ -0,0 +1,2 @@
1
+ import type { DiagramInput } from './diagram-input';
2
+ export declare function parse_phase_diagram_svg(svg_string: string): DiagramInput;