react-cheminfo 0.131.0 → 0.133.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.
- package/README.md +29 -0
- package/lib/core.d.ts +1 -0
- package/lib/core.d.ts.map +1 -1
- package/lib/core.js +1 -0
- package/lib/core.js.map +1 -1
- package/lib/drawing/captionEditor/CaptionEditor.d.ts +3 -3
- package/lib/drawing/captionEditor/CaptionEditor.d.ts.map +1 -1
- package/lib/drawing/captionEditor/CaptionEditor.js +8 -4
- package/lib/drawing/captionEditor/CaptionEditor.js.map +1 -1
- package/lib/drawing/captionEditor/CaptionToolbar.d.ts +4 -2
- package/lib/drawing/captionEditor/CaptionToolbar.d.ts.map +1 -1
- package/lib/drawing/captionEditor/CaptionToolbar.js +6 -4
- package/lib/drawing/captionEditor/CaptionToolbar.js.map +1 -1
- package/lib/drawing/captionEditor/index.d.ts +2 -0
- package/lib/drawing/captionEditor/index.d.ts.map +1 -1
- package/lib/drawing/captionEditor/index.js +1 -0
- package/lib/drawing/captionEditor/index.js.map +1 -1
- package/lib/drawing/captionEditor/toolbarInView.d.ts +40 -0
- package/lib/drawing/captionEditor/toolbarInView.d.ts.map +1 -0
- package/lib/drawing/captionEditor/toolbarInView.js +53 -0
- package/lib/drawing/captionEditor/toolbarInView.js.map +1 -0
- package/lib/drawing/core/camera.d.ts +2 -0
- package/lib/drawing/core/camera.d.ts.map +1 -1
- package/lib/drawing/core/camera.js +2 -0
- package/lib/drawing/core/camera.js.map +1 -1
- package/lib/drawing/core/index.d.ts +1 -1
- package/lib/drawing/core/index.d.ts.map +1 -1
- package/lib/drawing/core/index.js +1 -1
- package/lib/drawing/core/index.js.map +1 -1
- package/lib/drawing/render/index.d.ts +1 -1
- package/lib/drawing/render/index.d.ts.map +1 -1
- package/lib/drawing/render/index.js +1 -1
- package/lib/drawing/render/index.js.map +1 -1
- package/lib/drawing/render/pageGrid.d.ts +16 -0
- package/lib/drawing/render/pageGrid.d.ts.map +1 -1
- package/lib/drawing/render/pageGrid.js +28 -10
- package/lib/drawing/render/pageGrid.js.map +1 -1
- package/lib/drawing/ui/PageField.d.ts +29 -0
- package/lib/drawing/ui/PageField.d.ts.map +1 -0
- package/lib/drawing/ui/PageField.js +38 -0
- package/lib/drawing/ui/PageField.js.map +1 -0
- package/lib/drawing/ui/PageGrid.d.ts +20 -0
- package/lib/drawing/ui/PageGrid.d.ts.map +1 -0
- package/lib/drawing/ui/PageGrid.js +26 -0
- package/lib/drawing/ui/PageGrid.js.map +1 -0
- package/lib/drawing/ui/PageSideInput.d.ts +28 -0
- package/lib/drawing/ui/PageSideInput.d.ts.map +1 -0
- package/lib/drawing/ui/PageSideInput.js +47 -0
- package/lib/drawing/ui/PageSideInput.js.map +1 -0
- package/lib/drawing/ui/PageToolbar.d.ts +16 -0
- package/lib/drawing/ui/PageToolbar.d.ts.map +1 -0
- package/lib/drawing/ui/PageToolbar.js +16 -0
- package/lib/drawing/ui/PageToolbar.js.map +1 -0
- package/lib/drawing/ui/PrintSheets.d.ts +32 -0
- package/lib/drawing/ui/PrintSheets.d.ts.map +1 -0
- package/lib/drawing/ui/PrintSheets.js +17 -0
- package/lib/drawing/ui/PrintSheets.js.map +1 -0
- package/lib/drawing/ui/TextToolIcon.d.ts +19 -0
- package/lib/drawing/ui/TextToolIcon.d.ts.map +1 -0
- package/lib/drawing/ui/TextToolIcon.js +21 -0
- package/lib/drawing/ui/TextToolIcon.js.map +1 -0
- package/lib/drawing/ui/ZoomControl.d.ts +25 -0
- package/lib/drawing/ui/ZoomControl.d.ts.map +1 -0
- package/lib/drawing/ui/ZoomControl.js +27 -0
- package/lib/drawing/ui/ZoomControl.js.map +1 -0
- package/lib/drawing/ui/index.d.ts +10 -0
- package/lib/drawing/ui/index.d.ts.map +1 -1
- package/lib/drawing/ui/index.js +7 -0
- package/lib/drawing/ui/index.js.map +1 -1
- package/lib/guide/ui/EmptyGuide.d.ts +5 -2
- package/lib/guide/ui/EmptyGuide.d.ts.map +1 -1
- package/lib/guide/ui/EmptyGuide.js +8 -3
- package/lib/guide/ui/EmptyGuide.js.map +1 -1
- package/lib/guide/ui/GuideFigures.d.ts +6 -0
- package/lib/guide/ui/GuideFigures.d.ts.map +1 -1
- package/lib/guide/ui/GuideFigures.js +5 -5
- package/lib/guide/ui/GuideFigures.js.map +1 -1
- package/lib/i18n/core/chromeCatalog.d.ts +1 -1
- package/lib/i18n/core/chromeCatalog.d.ts.map +1 -1
- package/lib/locales/de.json +4 -0
- package/lib/locales/en.json +4 -0
- package/lib/locales/es.json +4 -0
- package/lib/locales/fr.json +4 -0
- package/lib/locales/it.json +4 -0
- package/lib/log/core/index.d.ts +4 -0
- package/lib/log/core/index.d.ts.map +1 -0
- package/lib/log/core/index.js +3 -0
- package/lib/log/core/index.js.map +1 -0
- package/lib/log/core/logGroups.d.ts +87 -0
- package/lib/log/core/logGroups.d.ts.map +1 -0
- package/lib/log/core/logGroups.js +85 -0
- package/lib/log/core/logGroups.js.map +1 -0
- package/lib/log/core/logLines.d.ts +19 -0
- package/lib/log/core/logLines.d.ts.map +1 -0
- package/lib/log/core/logLines.js +36 -0
- package/lib/log/core/logLines.js.map +1 -0
- package/lib/log/ui/LogBadge.d.ts +39 -0
- package/lib/log/ui/LogBadge.d.ts.map +1 -0
- package/lib/log/ui/LogBadge.js +28 -0
- package/lib/log/ui/LogBadge.js.map +1 -0
- package/lib/log/ui/LogCallouts.d.ts +55 -0
- package/lib/log/ui/LogCallouts.d.ts.map +1 -0
- package/lib/log/ui/LogCallouts.js +38 -0
- package/lib/log/ui/LogCallouts.js.map +1 -0
- package/lib/log/ui/index.d.ts +7 -0
- package/lib/log/ui/index.d.ts.map +1 -0
- package/lib/log/ui/index.js +5 -0
- package/lib/log/ui/index.js.map +1 -0
- package/lib/log/ui/logIcon.d.ts +9 -0
- package/lib/log/ui/logIcon.d.ts.map +1 -0
- package/lib/log/ui/logIcon.js +17 -0
- package/lib/log/ui/logIcon.js.map +1 -0
- package/lib/log/ui/useLogEntries.d.ts +15 -0
- package/lib/log/ui/useLogEntries.d.ts.map +1 -0
- package/lib/log/ui/useLogEntries.js +47 -0
- package/lib/log/ui/useLogEntries.js.map +1 -0
- package/lib/mass/core/index.d.ts +1 -0
- package/lib/mass/core/index.d.ts.map +1 -1
- package/lib/mass/core/index.js +1 -0
- package/lib/mass/core/index.js.map +1 -1
- package/lib/mass/core/massDomain.d.ts.map +1 -1
- package/lib/mass/core/massDomain.js +9 -5
- package/lib/mass/core/massDomain.js.map +1 -1
- package/lib/mass/core/massSpectrum.d.ts +9 -0
- package/lib/mass/core/massSpectrum.d.ts.map +1 -1
- package/lib/mass/core/massSpectrum.js.map +1 -1
- package/lib/mass/core/verticalScale.d.ts +30 -0
- package/lib/mass/core/verticalScale.d.ts.map +1 -0
- package/lib/mass/core/verticalScale.js +40 -0
- package/lib/mass/core/verticalScale.js.map +1 -0
- package/lib/mass/ui/MassChart.d.ts.map +1 -1
- package/lib/mass/ui/MassChart.js +4 -38
- package/lib/mass/ui/MassChart.js.map +1 -1
- package/lib/mass/ui/massChartLayers.d.ts +31 -0
- package/lib/mass/ui/massChartLayers.d.ts.map +1 -0
- package/lib/mass/ui/massChartLayers.js +57 -0
- package/lib/mass/ui/massChartLayers.js.map +1 -0
- package/lib/structure/core/conformerMinimise.d.ts +13 -4
- package/lib/structure/core/conformerMinimise.d.ts.map +1 -1
- package/lib/structure/core/conformerMinimise.js +23 -6
- package/lib/structure/core/conformerMinimise.js.map +1 -1
- package/lib/structure/core/conformerRefine.d.ts +2 -2
- package/lib/structure/core/conformerRefine.d.ts.map +1 -1
- package/lib/structure/core/conformerRefine.js +23 -7
- package/lib/structure/core/conformerRefine.js.map +1 -1
- package/lib/structure/core/conformers.d.ts +8 -3
- package/lib/structure/core/conformers.d.ts.map +1 -1
- package/lib/structure/core/conformers.js +10 -7
- package/lib/structure/core/conformers.js.map +1 -1
- package/lib/structure/core/geometryRelaxer.d.ts +10 -3
- package/lib/structure/core/geometryRelaxer.d.ts.map +1 -1
- package/lib/structure/core/index.d.ts +1 -1
- package/lib/structure/core/index.d.ts.map +1 -1
- package/lib/structure/core/index.js.map +1 -1
- package/lib/structure/core/relaxerLogLines.d.ts +16 -0
- package/lib/structure/core/relaxerLogLines.d.ts.map +1 -0
- package/lib/structure/core/relaxerLogLines.js +33 -0
- package/lib/structure/core/relaxerLogLines.js.map +1 -0
- package/lib/structure/core/structurePicture.d.ts +32 -1
- package/lib/structure/core/structurePicture.d.ts.map +1 -1
- package/lib/structure/core/structurePicture.js +29 -2
- package/lib/structure/core/structurePicture.js.map +1 -1
- package/lib/structure/ui/StructureEditor.d.ts +2 -1
- package/lib/structure/ui/StructureEditor.d.ts.map +1 -1
- package/lib/structure/ui/StructureEditor.js +9 -3
- package/lib/structure/ui/StructureEditor.js.map +1 -1
- package/lib/structure/ui/StructureEditorGuide.d.ts +15 -0
- package/lib/structure/ui/StructureEditorGuide.d.ts.map +1 -0
- package/lib/structure/ui/StructureEditorGuide.js +26 -0
- package/lib/structure/ui/StructureEditorGuide.js.map +1 -0
- package/lib/structure/ui/structureEditorProps.d.ts +11 -1
- package/lib/structure/ui/structureEditorProps.d.ts.map +1 -1
- package/lib/structure/ui/useCanvasPress.d.ts +23 -0
- package/lib/structure/ui/useCanvasPress.d.ts.map +1 -0
- package/lib/structure/ui/useCanvasPress.js +53 -0
- package/lib/structure/ui/useCanvasPress.js.map +1 -0
- package/lib/ui.d.ts +1 -0
- package/lib/ui.d.ts.map +1 -1
- package/lib/ui.js +1 -0
- package/lib/ui.js.map +1 -1
- package/lib/xps/core/detectFormat.d.ts +6 -0
- package/lib/xps/core/detectFormat.d.ts.map +1 -1
- package/lib/xps/core/detectFormat.js +8 -0
- package/lib/xps/core/detectFormat.js.map +1 -1
- package/lib/xps/core/xpsEditorApi.d.ts +16 -0
- package/lib/xps/core/xpsEditorApi.d.ts.map +1 -1
- package/lib/xps/ui/XpsCanvas.d.ts +10 -1
- package/lib/xps/ui/XpsCanvas.d.ts.map +1 -1
- package/lib/xps/ui/XpsCanvas.js +14 -3
- package/lib/xps/ui/XpsCanvas.js.map +1 -1
- package/lib/xps/ui/XpsChart.d.ts.map +1 -1
- package/lib/xps/ui/XpsChart.js +12 -43
- package/lib/xps/ui/XpsChart.js.map +1 -1
- package/lib/xps/ui/XpsEditor.d.ts +8 -0
- package/lib/xps/ui/XpsEditor.d.ts.map +1 -1
- package/lib/xps/ui/XpsEditor.js +2 -2
- package/lib/xps/ui/XpsEditor.js.map +1 -1
- package/lib/xps/ui/XpsShell.d.ts +5 -0
- package/lib/xps/ui/XpsShell.d.ts.map +1 -1
- package/lib/xps/ui/XpsShell.js +18 -4
- package/lib/xps/ui/XpsShell.js.map +1 -1
- package/lib/xps/ui/dropEvents.d.ts +8 -1
- package/lib/xps/ui/dropEvents.d.ts.map +1 -1
- package/lib/xps/ui/dropEvents.js +15 -1
- package/lib/xps/ui/dropEvents.js.map +1 -1
- package/lib/xps/ui/useSpectrumDrop.d.ts +6 -0
- package/lib/xps/ui/useSpectrumDrop.d.ts.map +1 -1
- package/lib/xps/ui/useSpectrumDrop.js +1 -1
- package/lib/xps/ui/useSpectrumDrop.js.map +1 -1
- package/lib/xps/ui/useXpsEditorHandle.d.ts +4 -1
- package/lib/xps/ui/useXpsEditorHandle.d.ts.map +1 -1
- package/lib/xps/ui/useXpsEditorHandle.js +6 -2
- package/lib/xps/ui/useXpsEditorHandle.js.map +1 -1
- package/lib/xps/ui/useXpsReadout.d.ts +43 -0
- package/lib/xps/ui/useXpsReadout.d.ts.map +1 -0
- package/lib/xps/ui/useXpsReadout.js +59 -0
- package/lib/xps/ui/useXpsReadout.js.map +1 -0
- package/lib/xps/ui/xpsChartProps.d.ts +9 -0
- package/lib/xps/ui/xpsChartProps.d.ts.map +1 -1
- package/lib/xtb/core/taggedLogger.d.ts +11 -0
- package/lib/xtb/core/taggedLogger.d.ts.map +1 -0
- package/lib/xtb/core/taggedLogger.js +31 -0
- package/lib/xtb/core/taggedLogger.js.map +1 -0
- package/lib/xtb/core/xtbRelaxer.d.ts.map +1 -1
- package/lib/xtb/core/xtbRelaxer.js +13 -5
- package/lib/xtb/core/xtbRelaxer.js.map +1 -1
- package/package.json +4 -3
- package/src/core.ts +1 -0
- package/src/drawing/captionEditor/CaptionEditor.tsx +8 -3
- package/src/drawing/captionEditor/CaptionToolbar.tsx +18 -2
- package/src/drawing/captionEditor/index.ts +2 -0
- package/src/drawing/captionEditor/toolbarInView.ts +73 -0
- package/src/drawing/core/camera.ts +3 -0
- package/src/drawing/core/index.ts +1 -0
- package/src/drawing/render/index.ts +2 -0
- package/src/drawing/render/pageGrid.ts +29 -11
- package/src/drawing/ui/PageField.tsx +104 -0
- package/src/drawing/ui/PageGrid.tsx +48 -0
- package/src/drawing/ui/PageSideInput.tsx +81 -0
- package/src/drawing/ui/PageToolbar.tsx +45 -0
- package/src/drawing/ui/PrintSheets.tsx +57 -0
- package/src/drawing/ui/TextToolIcon.tsx +48 -0
- package/src/drawing/ui/ZoomControl.tsx +112 -0
- package/src/drawing/ui/index.ts +10 -0
- package/src/guide/ui/EmptyGuide.tsx +20 -13
- package/src/guide/ui/GuideFigures.tsx +15 -4
- package/src/locales/de.json +4 -0
- package/src/locales/en.json +4 -0
- package/src/locales/es.json +4 -0
- package/src/locales/fr.json +4 -0
- package/src/locales/it.json +4 -0
- package/src/log/core/index.ts +9 -0
- package/src/log/core/logGroups.ts +159 -0
- package/src/log/core/logLines.ts +44 -0
- package/src/log/ui/LogBadge.tsx +89 -0
- package/src/log/ui/LogCallouts.tsx +103 -0
- package/src/log/ui/index.ts +6 -0
- package/src/log/ui/logIcon.ts +21 -0
- package/src/log/ui/useLogEntries.ts +57 -0
- package/src/mass/core/index.ts +1 -0
- package/src/mass/core/massDomain.ts +9 -3
- package/src/mass/core/massSpectrum.ts +9 -0
- package/src/mass/core/verticalScale.ts +48 -0
- package/src/mass/ui/MassChart.tsx +12 -43
- package/src/mass/ui/massChartLayers.ts +66 -0
- package/src/structure/core/conformerMinimise.ts +34 -8
- package/src/structure/core/conformerRefine.ts +29 -13
- package/src/structure/core/conformers.ts +23 -12
- package/src/structure/core/geometryRelaxer.ts +11 -3
- package/src/structure/core/index.ts +1 -0
- package/src/structure/core/relaxerLogLines.ts +39 -0
- package/src/structure/core/structurePicture.ts +78 -4
- package/src/structure/ui/StructureEditor.tsx +13 -2
- package/src/structure/ui/StructureEditorGuide.tsx +35 -0
- package/src/structure/ui/structureEditorProps.ts +11 -1
- package/src/structure/ui/useCanvasPress.ts +69 -0
- package/src/ui.ts +1 -0
- package/src/xps/core/detectFormat.ts +9 -0
- package/src/xps/core/xpsEditorApi.ts +16 -0
- package/src/xps/ui/XpsCanvas.tsx +26 -3
- package/src/xps/ui/XpsChart.tsx +12 -56
- package/src/xps/ui/XpsEditor.tsx +10 -0
- package/src/xps/ui/XpsShell.tsx +37 -7
- package/src/xps/ui/dropEvents.ts +16 -1
- package/src/xps/ui/useSpectrumDrop.ts +7 -1
- package/src/xps/ui/useXpsEditorHandle.ts +12 -2
- package/src/xps/ui/useXpsReadout.ts +104 -0
- package/src/xps/ui/xpsChartProps.ts +9 -0
- package/src/xtb/core/taggedLogger.ts +35 -0
- package/src/xtb/core/xtbRelaxer.ts +15 -5
- package/styles/caption-editor.css +15 -1
- package/styles/chrome.css +164 -9
- package/styles/drawing.css +100 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the pointer reads off the XPS chart, and what of it the rest of the
|
|
3
|
+
* viewer hears: the crosshair follows every pixel, the viewer only the peak.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { RefObject } from 'react';
|
|
7
|
+
import { useCallback, useRef } from 'react';
|
|
8
|
+
|
|
9
|
+
import type { PlotRect } from '../../chart/core/chartGeometry.ts';
|
|
10
|
+
import type { ChartScale } from '../../chart/core/chartScale.ts';
|
|
11
|
+
import { chartValue } from '../../chart/core/chartScale.ts';
|
|
12
|
+
import type { ChartPoint } from '../../chart/core/svgPoint.ts';
|
|
13
|
+
import type { ChartPointer } from '../../chart/ui/useChartPointer.ts';
|
|
14
|
+
import { useChartPointer } from '../../chart/ui/useChartPointer.ts';
|
|
15
|
+
import type { NearestPeak } from '../core/nearestPeak.ts';
|
|
16
|
+
import { nearestPeakEnergy, sameNearestPeak } from '../core/nearestPeak.ts';
|
|
17
|
+
import type { XpsHighlight } from '../core/xpsHighlight.ts';
|
|
18
|
+
import { NO_HIGHLIGHT } from '../core/xpsHighlight.ts';
|
|
19
|
+
import type { EnergyAxis } from '../core/xpsSettings.ts';
|
|
20
|
+
import type { XpsSpectrum } from '../core/xpsSpectrum.ts';
|
|
21
|
+
|
|
22
|
+
import type { XpsReadout } from './XpsPointerTracker.tsx';
|
|
23
|
+
|
|
24
|
+
/** What {@link useXpsReadout} reads the pointer against. */
|
|
25
|
+
export interface XpsReadoutOptions {
|
|
26
|
+
/** The chart's SVG, which the pointer is heard on. */
|
|
27
|
+
svgRef: RefObject<SVGSVGElement | null>;
|
|
28
|
+
/** The plot, outside which the pointer reads nothing. */
|
|
29
|
+
plot: PlotRect;
|
|
30
|
+
/** The spectra drawn, whose peaks the pointer is nearest to. */
|
|
31
|
+
spectra: readonly XpsSpectrum[];
|
|
32
|
+
/** The energy axis the chart is drawn against. */
|
|
33
|
+
axis: EnergyAxis;
|
|
34
|
+
/** The energy scale on screen. */
|
|
35
|
+
xScale: ChartScale;
|
|
36
|
+
/** The counts scale on screen. */
|
|
37
|
+
yScale: ChartScale;
|
|
38
|
+
/**
|
|
39
|
+
* Told whenever the peak under the pointer changes.
|
|
40
|
+
* @default undefined
|
|
41
|
+
*/
|
|
42
|
+
onHighlightChange?: (highlight: XpsHighlight) => void;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Follow the pointer over the chart, and tell the viewer which peak it is on.
|
|
47
|
+
*
|
|
48
|
+
* Only a change of peak is reported, starting from none: the pointer coming
|
|
49
|
+
* onto the plot over no peak says nothing, so a guide a panel put on the chart
|
|
50
|
+
* stays until the pointer actually reaches a peak.
|
|
51
|
+
* @param options - See {@link XpsReadoutOptions}.
|
|
52
|
+
* @returns Where the pointer is and what it reads.
|
|
53
|
+
*/
|
|
54
|
+
export function useXpsReadout(
|
|
55
|
+
options: XpsReadoutOptions,
|
|
56
|
+
): ChartPointer<XpsReadout> {
|
|
57
|
+
const { svgRef, plot, spectra, axis, xScale, yScale, onHighlightChange } =
|
|
58
|
+
options;
|
|
59
|
+
const read = useCallback(
|
|
60
|
+
(point: ChartPoint): XpsReadout => ({
|
|
61
|
+
energy: chartValue(xScale, point.x),
|
|
62
|
+
counts: chartValue(yScale, point.y),
|
|
63
|
+
peak: nearestPeakEnergy(spectra, axis, xScale, point.x),
|
|
64
|
+
}),
|
|
65
|
+
[xScale, yScale, spectra, axis],
|
|
66
|
+
);
|
|
67
|
+
const reportedPeak = useRef<NearestPeak | null>(null);
|
|
68
|
+
const onReadout = useCallback(
|
|
69
|
+
(readout: XpsReadout | null) => {
|
|
70
|
+
const found = readout?.peak ?? null;
|
|
71
|
+
if (sameNearestPeak(reportedPeak.current, found)) return;
|
|
72
|
+
reportedPeak.current = found;
|
|
73
|
+
onHighlightChange?.(
|
|
74
|
+
found === null
|
|
75
|
+
? NO_HIGHLIGHT
|
|
76
|
+
: {
|
|
77
|
+
spectrumId: found.spectrumId,
|
|
78
|
+
peakId: found.peak.id,
|
|
79
|
+
componentId: null,
|
|
80
|
+
bindingEnergy: found.peak.bindingEnergy,
|
|
81
|
+
},
|
|
82
|
+
);
|
|
83
|
+
},
|
|
84
|
+
[onHighlightChange],
|
|
85
|
+
);
|
|
86
|
+
return useChartPointer<XpsReadout>({
|
|
87
|
+
svgRef,
|
|
88
|
+
plot,
|
|
89
|
+
read,
|
|
90
|
+
sameReadout: samePeakReadout,
|
|
91
|
+
onReadout,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Whether two readings are about the same peak, which is all the rest of the
|
|
97
|
+
* viewer hears about: the energy under the crosshair changes on every pixel.
|
|
98
|
+
* @param current - The reading last reported.
|
|
99
|
+
* @param next - The reading now.
|
|
100
|
+
* @returns Whether nothing needs reporting.
|
|
101
|
+
*/
|
|
102
|
+
function samePeakReadout(current: XpsReadout, next: XpsReadout): boolean {
|
|
103
|
+
return sameNearestPeak(current.peak, next.peak);
|
|
104
|
+
}
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* test.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
+
import type { ChartSize } from '../../chart/core/chartGeometry.ts';
|
|
15
16
|
import type { XpsHighlight } from '../core/xpsHighlight.ts';
|
|
16
17
|
import type { XpsDomain, XpsRegion, XpsSpectrum } from '../core/xpsSpectrum.ts';
|
|
17
18
|
import type { XpsSettings } from '../core/xpsState.ts';
|
|
@@ -66,6 +67,14 @@ export interface XpsChartProps {
|
|
|
66
67
|
* @default false
|
|
67
68
|
*/
|
|
68
69
|
isReading?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* The size to draw at, in CSS pixels, instead of the box the chart is put in
|
|
72
|
+
* — for a chart drawn where nothing is laid out, as a figure written to a
|
|
73
|
+
* file by `renderToStaticMarkup`, which would otherwise come out at the
|
|
74
|
+
* smallest plot there is.
|
|
75
|
+
* @default undefined — the box the chart is put in, measured
|
|
76
|
+
*/
|
|
77
|
+
size?: ChartSize;
|
|
69
78
|
}
|
|
70
79
|
|
|
71
80
|
/** Windows shaded on the chart for one spectrum, beside the ones its file defines. */
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { LightLogger } from 'cheminfo-types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A logger that adds some fields to every entry before passing it on — what
|
|
5
|
+
* xtb-wasm's pool does for the structures of a batch, done here for the ones
|
|
6
|
+
* relaxed in turn on this thread.
|
|
7
|
+
* @param logger - Where the entries go.
|
|
8
|
+
* @param context - The fields every entry gains, e.g. `{ structure: 2 }`.
|
|
9
|
+
* @returns The tagging logger.
|
|
10
|
+
*/
|
|
11
|
+
export function taggedLogger(
|
|
12
|
+
logger: LightLogger,
|
|
13
|
+
context: Record<string, unknown>,
|
|
14
|
+
): LightLogger {
|
|
15
|
+
function forward(level: Level) {
|
|
16
|
+
return (value: unknown, message?: string): void => {
|
|
17
|
+
if (value instanceof Error) {
|
|
18
|
+
logger[level](context, message ?? value.message);
|
|
19
|
+
} else if (typeof value === 'object' && value !== null) {
|
|
20
|
+
logger[level]({ ...context, ...value }, message ?? '');
|
|
21
|
+
} else {
|
|
22
|
+
logger[level](context, message ?? String(value));
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
trace: forward('trace'),
|
|
28
|
+
debug: forward('debug'),
|
|
29
|
+
info: forward('info'),
|
|
30
|
+
warn: forward('warn'),
|
|
31
|
+
error: forward('error'),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
type Level = 'trace' | 'debug' | 'info' | 'warn' | 'error';
|
|
@@ -8,6 +8,8 @@ import type {
|
|
|
8
8
|
RelaxerOptions,
|
|
9
9
|
} from '../../structure/core/geometryRelaxer.ts';
|
|
10
10
|
|
|
11
|
+
import { taggedLogger } from './taggedLogger.ts';
|
|
12
|
+
|
|
11
13
|
/**
|
|
12
14
|
* kcal/mol per hartree, CODATA 2018. Every energy a relaxer reports is in
|
|
13
15
|
* kcal/mol, so it can be read against a force-field energy without the reader
|
|
@@ -73,6 +75,7 @@ export function xtbRelaxer(options: XtbRelaxerOptions = {}): GeometryRelaxer {
|
|
|
73
75
|
maxWorkers: options.maxWorkers,
|
|
74
76
|
onSettled: runOptions.onSettled,
|
|
75
77
|
signal: runOptions.signal,
|
|
78
|
+
logger: runOptions.logger,
|
|
76
79
|
})
|
|
77
80
|
: await relaxHere(xtb, requests, runOptions);
|
|
78
81
|
const relaxed: RelaxedGeometry[] = [];
|
|
@@ -86,7 +89,6 @@ export function xtbRelaxer(options: XtbRelaxerOptions = {}): GeometryRelaxer {
|
|
|
86
89
|
: result.energy.dispersion * KCAL_PER_MOL_PER_HARTREE,
|
|
87
90
|
cycles: result.cycles,
|
|
88
91
|
converged: result.converged,
|
|
89
|
-
warnings: result.warnings,
|
|
90
92
|
});
|
|
91
93
|
}
|
|
92
94
|
return relaxed;
|
|
@@ -118,7 +120,8 @@ export async function disposeXtbRelaxer(): Promise<void> {
|
|
|
118
120
|
* Relax one structure after another on this thread, for want of a pool.
|
|
119
121
|
* @param xtb - The loaded `xtb-wasm` module.
|
|
120
122
|
* @param requests - The structures to relax, with their settings.
|
|
121
|
-
* @param runOptions - Progress and
|
|
123
|
+
* @param runOptions - Progress, cancellation, and the logger each structure's
|
|
124
|
+
* messages go to under its index, as the pool would have logged them.
|
|
122
125
|
* @returns One `xtb-wasm` result per request, in request order.
|
|
123
126
|
* @throws {Error} When the run is cancelled, or when occ fails.
|
|
124
127
|
*/
|
|
@@ -127,15 +130,22 @@ async function relaxHere(
|
|
|
127
130
|
requests: ReadonlyArray<Parameters<XtbModule['relaxGeometryInProcess']>[0]>,
|
|
128
131
|
runOptions: RelaxerOptions,
|
|
129
132
|
): Promise<Array<Awaited<ReturnType<XtbModule['relaxGeometryInProcess']>>>> {
|
|
133
|
+
const { logger, signal, onSettled } = runOptions;
|
|
130
134
|
const results = [];
|
|
131
135
|
for (const [index, request] of requests.entries()) {
|
|
132
|
-
if (
|
|
136
|
+
if (signal?.aborted === true) {
|
|
133
137
|
throw new Error('calculation cancelled');
|
|
134
138
|
}
|
|
139
|
+
const options = {
|
|
140
|
+
logger:
|
|
141
|
+
logger === undefined
|
|
142
|
+
? undefined
|
|
143
|
+
: taggedLogger(logger, { structure: index }),
|
|
144
|
+
};
|
|
135
145
|
/* eslint-disable-next-line no-await-in-loop -- there is one thread: the
|
|
136
146
|
whole point of this path is that the structures run in turn. */
|
|
137
|
-
results.push(await xtb.relaxGeometryInProcess(request));
|
|
138
|
-
|
|
147
|
+
results.push(await xtb.relaxGeometryInProcess(request, options));
|
|
148
|
+
onSettled?.(index + 1, requests.length);
|
|
139
149
|
}
|
|
140
150
|
return results;
|
|
141
151
|
}
|
|
@@ -92,10 +92,18 @@
|
|
|
92
92
|
font-family: inherit;
|
|
93
93
|
font-size: 13px;
|
|
94
94
|
gap: 4px;
|
|
95
|
-
|
|
95
|
+
/* Centred over its caption, then moved back inside the figure when the
|
|
96
|
+
caption sits near an edge (`useToolbarInView`). */
|
|
97
|
+
transform: translateX(calc(-50% + var(--caption-toolbar-shift, 0px)));
|
|
96
98
|
white-space: nowrap;
|
|
97
99
|
}
|
|
98
100
|
|
|
101
|
+
/* With no room above the caption, the bar goes under it. */
|
|
102
|
+
.caption-toolbar[data-below] {
|
|
103
|
+
top: calc(100% + 4px);
|
|
104
|
+
bottom: auto;
|
|
105
|
+
}
|
|
106
|
+
|
|
99
107
|
.caption-toolbar__size {
|
|
100
108
|
display: flex;
|
|
101
109
|
align-items: center;
|
|
@@ -109,3 +117,9 @@
|
|
|
109
117
|
.caption-toolbar__unit {
|
|
110
118
|
color: var(--text-muted);
|
|
111
119
|
}
|
|
120
|
+
|
|
121
|
+
/* The tick keeps the caption: it stands apart from the styles. */
|
|
122
|
+
.caption-toolbar__done {
|
|
123
|
+
padding-left: 4px;
|
|
124
|
+
border-left: 1px solid var(--border);
|
|
125
|
+
}
|
package/styles/chrome.css
CHANGED
|
@@ -1778,6 +1778,40 @@ span.taxon-lineage__name {
|
|
|
1778
1778
|
color: var(--accent);
|
|
1779
1779
|
}
|
|
1780
1780
|
|
|
1781
|
+
/* ── What a logger collected ────────────────────────────────────────────── */
|
|
1782
|
+
|
|
1783
|
+
/*
|
|
1784
|
+
`<LogCallouts>` and the popover of `<LogBadge>`: one callout per message,
|
|
1785
|
+
worst first, close enough to read as one list.
|
|
1786
|
+
*/
|
|
1787
|
+
.log-callouts {
|
|
1788
|
+
display: flex;
|
|
1789
|
+
flex-direction: column;
|
|
1790
|
+
gap: 6px;
|
|
1791
|
+
}
|
|
1792
|
+
|
|
1793
|
+
.log-badge__popover .log-callouts {
|
|
1794
|
+
max-width: 460px;
|
|
1795
|
+
padding: 8px;
|
|
1796
|
+
}
|
|
1797
|
+
|
|
1798
|
+
.log-callouts__count {
|
|
1799
|
+
margin-left: 0.4em;
|
|
1800
|
+
color: var(--text-muted);
|
|
1801
|
+
font-variant-numeric: tabular-nums;
|
|
1802
|
+
}
|
|
1803
|
+
|
|
1804
|
+
/* Where a message comes from — a file, a line — read before the message. */
|
|
1805
|
+
.log-callouts__source {
|
|
1806
|
+
margin-right: 0.4em;
|
|
1807
|
+
font-weight: 600;
|
|
1808
|
+
}
|
|
1809
|
+
|
|
1810
|
+
.log-callouts__more {
|
|
1811
|
+
color: var(--text-muted);
|
|
1812
|
+
font-size: 12px;
|
|
1813
|
+
}
|
|
1814
|
+
|
|
1781
1815
|
/* ── The splitter ───────────────────────────────────────────────────────── */
|
|
1782
1816
|
|
|
1783
1817
|
/*
|
|
@@ -2519,18 +2553,14 @@ span.taxon-lineage__name {
|
|
|
2519
2553
|
/*
|
|
2520
2554
|
What a tool shows while it holds nothing: `<EmptyGuide>`. Grey on purpose, so
|
|
2521
2555
|
it reads as the empty space saying how to start and never as content. The
|
|
2522
|
-
pointer goes through it to the tool, except on
|
|
2523
|
-
|
|
2556
|
+
pointer goes through it to the tool, except on what can be clicked or typed
|
|
2557
|
+
in, so a first stroke can start on the words.
|
|
2524
2558
|
*/
|
|
2525
2559
|
.empty-guide {
|
|
2526
2560
|
position: absolute;
|
|
2527
|
-
display: flex;
|
|
2528
|
-
flex-direction: column;
|
|
2529
|
-
padding: 12px 20px;
|
|
2530
2561
|
color: var(--text-muted);
|
|
2531
2562
|
container-type: size;
|
|
2532
2563
|
font-size: 12.5px;
|
|
2533
|
-
gap: 10px;
|
|
2534
2564
|
inset: 0;
|
|
2535
2565
|
line-height: 1.4;
|
|
2536
2566
|
overflow: hidden;
|
|
@@ -2540,15 +2570,40 @@ span.taxon-lineage__name {
|
|
|
2540
2570
|
animation: empty-guide-in 240ms ease-out 120ms both;
|
|
2541
2571
|
}
|
|
2542
2572
|
|
|
2573
|
+
/* Laid out inside the box that is measured, so a small box can tighten it. */
|
|
2574
|
+
.empty-guide__body {
|
|
2575
|
+
display: flex;
|
|
2576
|
+
height: 100%;
|
|
2577
|
+
box-sizing: border-box;
|
|
2578
|
+
flex-direction: column;
|
|
2579
|
+
padding: 12px 20px;
|
|
2580
|
+
gap: 10px;
|
|
2581
|
+
}
|
|
2582
|
+
|
|
2543
2583
|
.empty-guide a,
|
|
2544
2584
|
.empty-guide button {
|
|
2545
2585
|
color: inherit;
|
|
2546
|
-
pointer-events: auto;
|
|
2547
2586
|
text-decoration: underline;
|
|
2548
2587
|
text-decoration-color: var(--border-strong);
|
|
2549
2588
|
text-underline-offset: 2px;
|
|
2550
2589
|
}
|
|
2551
2590
|
|
|
2591
|
+
/* Whatever can be clicked or typed in takes the pointer: a link, a button, a
|
|
2592
|
+
capsule or a tab drawn as one, a field and the label that ticks a box. */
|
|
2593
|
+
.empty-guide a,
|
|
2594
|
+
.empty-guide button,
|
|
2595
|
+
.empty-guide label,
|
|
2596
|
+
.empty-guide input,
|
|
2597
|
+
.empty-guide select,
|
|
2598
|
+
.empty-guide textarea,
|
|
2599
|
+
.empty-guide [role='button'],
|
|
2600
|
+
.empty-guide [role='checkbox'],
|
|
2601
|
+
.empty-guide [role='radio'],
|
|
2602
|
+
.empty-guide [role='switch'],
|
|
2603
|
+
.empty-guide [role='tab'] {
|
|
2604
|
+
pointer-events: auto;
|
|
2605
|
+
}
|
|
2606
|
+
|
|
2552
2607
|
.empty-guide a:hover,
|
|
2553
2608
|
.empty-guide button:hover {
|
|
2554
2609
|
color: var(--accent);
|
|
@@ -2687,6 +2742,34 @@ button.empty-guide__figure:focus-visible img {
|
|
|
2687
2742
|
opacity: 1;
|
|
2688
2743
|
}
|
|
2689
2744
|
|
|
2745
|
+
/* A figure's name, one line under it, read before the faint picture is. */
|
|
2746
|
+
.empty-guide__label {
|
|
2747
|
+
overflow: hidden;
|
|
2748
|
+
flex: none;
|
|
2749
|
+
margin-top: 4px;
|
|
2750
|
+
color: var(--text-muted);
|
|
2751
|
+
font-size: 12.5px;
|
|
2752
|
+
font-weight: 600;
|
|
2753
|
+
text-align: center;
|
|
2754
|
+
text-overflow: ellipsis;
|
|
2755
|
+
white-space: nowrap;
|
|
2756
|
+
}
|
|
2757
|
+
|
|
2758
|
+
/* A named figure sits on its name, whatever room is left above it. */
|
|
2759
|
+
.empty-guide__figure:has(> .empty-guide__label) img {
|
|
2760
|
+
object-position: 50% 100%;
|
|
2761
|
+
}
|
|
2762
|
+
|
|
2763
|
+
/* A name is not a link: the figure it names is what is clicked. */
|
|
2764
|
+
.empty-guide button.empty-guide__figure {
|
|
2765
|
+
text-decoration: none;
|
|
2766
|
+
}
|
|
2767
|
+
|
|
2768
|
+
button.empty-guide__figure:hover .empty-guide__label,
|
|
2769
|
+
button.empty-guide__figure:focus-visible .empty-guide__label {
|
|
2770
|
+
color: var(--accent);
|
|
2771
|
+
}
|
|
2772
|
+
|
|
2690
2773
|
.empty-guide__hint {
|
|
2691
2774
|
display: flex;
|
|
2692
2775
|
flex: none;
|
|
@@ -2706,14 +2789,86 @@ button.empty-guide__figure:focus-visible img {
|
|
|
2706
2789
|
animation: empty-guide-in 400ms ease-out both;
|
|
2707
2790
|
}
|
|
2708
2791
|
|
|
2709
|
-
/*
|
|
2710
|
-
|
|
2792
|
+
/* A small view — half an editor, a short window — keeps its figures: the help
|
|
2793
|
+
says each section's title and its first line, the buttons shrink, and the
|
|
2794
|
+
figures take what is left, never less than a third of the height. */
|
|
2711
2795
|
@container (max-width: 640px) or (max-height: 520px) {
|
|
2796
|
+
.empty-guide__body {
|
|
2797
|
+
padding: 8px 12px;
|
|
2798
|
+
font-size: 12px;
|
|
2799
|
+
gap: 6px;
|
|
2800
|
+
line-height: 1.35;
|
|
2801
|
+
}
|
|
2802
|
+
|
|
2803
|
+
/* One row of sections, as many as the width holds: a section that would
|
|
2804
|
+
wrap is left out whole rather than cut through a line. */
|
|
2805
|
+
.empty-guide__help {
|
|
2806
|
+
min-height: 0;
|
|
2807
|
+
flex: 0 1 auto;
|
|
2808
|
+
gap: 0 16px;
|
|
2809
|
+
grid-auto-rows: 0;
|
|
2810
|
+
grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
|
|
2811
|
+
grid-template-rows: auto;
|
|
2812
|
+
overflow: hidden;
|
|
2813
|
+
}
|
|
2814
|
+
|
|
2815
|
+
.empty-guide__title {
|
|
2816
|
+
margin-bottom: 1px;
|
|
2817
|
+
font-size: 12px;
|
|
2818
|
+
}
|
|
2819
|
+
|
|
2820
|
+
.empty-guide__section > :nth-child(n + 3),
|
|
2821
|
+
.empty-guide__help .shortcut-list__row:nth-child(n + 4) {
|
|
2822
|
+
display: none;
|
|
2823
|
+
}
|
|
2824
|
+
|
|
2825
|
+
.empty-guide__section p {
|
|
2826
|
+
margin: 0;
|
|
2827
|
+
}
|
|
2828
|
+
|
|
2829
|
+
.empty-guide__start {
|
|
2830
|
+
gap: 6px 10px;
|
|
2831
|
+
}
|
|
2832
|
+
|
|
2833
|
+
.empty-guide button.empty-guide__action {
|
|
2834
|
+
min-height: 34px;
|
|
2835
|
+
padding: 0 14px;
|
|
2836
|
+
font-size: 13.5px;
|
|
2837
|
+
gap: 6px;
|
|
2838
|
+
}
|
|
2839
|
+
|
|
2840
|
+
.empty-guide__figures-title {
|
|
2841
|
+
font-size: 13px;
|
|
2842
|
+
}
|
|
2843
|
+
|
|
2844
|
+
.empty-guide__figures:not(:empty) {
|
|
2845
|
+
min-height: 33cqh;
|
|
2846
|
+
}
|
|
2847
|
+
|
|
2848
|
+
.empty-guide__stack {
|
|
2849
|
+
gap: 6px;
|
|
2850
|
+
}
|
|
2851
|
+
|
|
2852
|
+
.empty-guide__label {
|
|
2853
|
+
margin-top: 2px;
|
|
2854
|
+
font-size: 12px;
|
|
2855
|
+
}
|
|
2856
|
+
}
|
|
2857
|
+
|
|
2858
|
+
/* A phone-sized view takes the words alone: a picture the size of a stamp
|
|
2859
|
+
shows nothing, and leaves its caption floating. */
|
|
2860
|
+
@container (max-width: 440px) or (max-height: 300px) {
|
|
2712
2861
|
.empty-guide__figures,
|
|
2713
2862
|
.empty-guide__figures-title {
|
|
2714
2863
|
display: none;
|
|
2715
2864
|
}
|
|
2716
2865
|
|
|
2866
|
+
/* With no figures to make room for, every section is said. */
|
|
2867
|
+
.empty-guide__help {
|
|
2868
|
+
gap: 4px 16px;
|
|
2869
|
+
grid-auto-rows: auto;
|
|
2870
|
+
}
|
|
2871
|
+
|
|
2717
2872
|
/* First, or a help taller than the view would push the buttons out of it. */
|
|
2718
2873
|
.empty-guide__start {
|
|
2719
2874
|
order: -1;
|
package/styles/drawing.css
CHANGED
|
@@ -30,6 +30,21 @@
|
|
|
30
30
|
stroke: var(--border-strong);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
/* The lines `PageGrid` draws between the sheets of a drawing, and the number
|
|
34
|
+
each sheet prints under. */
|
|
35
|
+
.draw-sheet {
|
|
36
|
+
fill: none;
|
|
37
|
+
pointer-events: none;
|
|
38
|
+
stroke: var(--border-strong);
|
|
39
|
+
stroke-dasharray: 6 4;
|
|
40
|
+
vector-effect: non-scaling-stroke;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.draw-sheet__number {
|
|
44
|
+
fill: var(--text-faint);
|
|
45
|
+
pointer-events: none;
|
|
46
|
+
}
|
|
47
|
+
|
|
33
48
|
/* What `PageMask` hides around a page shown alone, and its edge. */
|
|
34
49
|
.draw-page-mask {
|
|
35
50
|
fill: var(--surface-sunken);
|
|
@@ -179,3 +194,88 @@
|
|
|
179
194
|
color: var(--text-faint);
|
|
180
195
|
font-style: italic;
|
|
181
196
|
}
|
|
197
|
+
|
|
198
|
+
/* `ZoomControl`, at the right of an editor's status bar. */
|
|
199
|
+
.zoom-control {
|
|
200
|
+
display: inline-flex;
|
|
201
|
+
flex: none;
|
|
202
|
+
align-items: center;
|
|
203
|
+
gap: 4px;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/* Blueprint's slider is 40px tall for its labels; without them the 16px handle
|
|
207
|
+
is the whole of it, and the status bar keeps its height. */
|
|
208
|
+
.zoom-control .bp6-slider {
|
|
209
|
+
width: 120px;
|
|
210
|
+
min-width: 120px;
|
|
211
|
+
height: 16px;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/* As wide at 25 % as at 1600 %, so what stands beside it does not move. */
|
|
215
|
+
.zoom-control .zoom-control__level {
|
|
216
|
+
min-width: 92px;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
@media (width < 640px) {
|
|
220
|
+
.zoom-control .bp6-slider {
|
|
221
|
+
display: none;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/* `PageField`: the orientation, then a page's width × height in centimetres. */
|
|
226
|
+
.page-field__orientation {
|
|
227
|
+
margin-top: 4px;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.page-field__size {
|
|
231
|
+
display: flex;
|
|
232
|
+
align-items: center;
|
|
233
|
+
margin-top: 4px;
|
|
234
|
+
gap: 6px;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.page-field__size .bp6-input-group {
|
|
238
|
+
width: 5rem;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.page-field__unit {
|
|
242
|
+
color: var(--text-muted);
|
|
243
|
+
font-size: 0.8125rem;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/* `PrintSheets`: on paper the editor gives way to the figure it holds, at the
|
|
247
|
+
size it was laid out at and shrunk only when it would not fit the page. */
|
|
248
|
+
.draw-print {
|
|
249
|
+
display: none;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
@media print {
|
|
253
|
+
.draw-print {
|
|
254
|
+
display: flex;
|
|
255
|
+
justify-content: center;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.draw-print__figure {
|
|
259
|
+
width: auto;
|
|
260
|
+
height: auto;
|
|
261
|
+
max-width: 100%;
|
|
262
|
+
max-height: 100vh;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/* A grid of sheets: the paper is the sheet, so each one fills a sheet of
|
|
266
|
+
paper and nothing is shrunk. */
|
|
267
|
+
.draw-print--sheets {
|
|
268
|
+
display: block;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.draw-print--sheets .draw-print__figure {
|
|
272
|
+
display: block;
|
|
273
|
+
max-width: none;
|
|
274
|
+
max-height: none;
|
|
275
|
+
break-after: page;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.draw-print--sheets .draw-print__figure:last-child {
|
|
279
|
+
break-after: auto;
|
|
280
|
+
}
|
|
281
|
+
}
|