DiagramStyle Module
Types and nested modules
| Type/Module | Description |
Functions and values
| Function or value | Description |
|
|
Full Usage:
belowHeaderStyle headerSize overflow
Parameters:
'a
overflow : OverflowOptions
Returns: HTMLAttr
|
Fill what is left of the height below a header of the given size, scrolling if the content does not fit. The overflow is a parameter rather than always Auto because the caller needs to switch it off for a moment, and saying so with a second Style prop does not work: React keeps the last style it is given and drops the rest, so the height quietly went with it - which left the right tab body with no height at all, and nothing in it able to scroll.
|
|
|
|
|
|
|
|
|
|
What is written across the top of the canvas about the sheet below it: the read-only banner and the sheet-kind legend, one under the other. They are stacked in a flex column rather than each given its own offset from the top of the canvas, because either can be absent and neither knows whether the other is showing - an offset would be a number that has to be kept in step with the height of something else. Over the canvas rather than above it, so that nothing moves when one of them appears, and taking no pointer events: this sits on top of the schematic, and a band the mouse could not draw through would be worse than no banner.
|
|
|
|
|
|
|
|
|
|
|
|
|
Full Usage:
getHeaderHeight ()
Parameters:
unit
Returns: float
|
The header's height. NOT snapped to device pixels, and that matters: the seam the eye picks up is where the canvas BACKGROUND begins, which is the inner edge of the rule below the header - (58 + 2) CSS pixels, a whole number of device pixels at every scaling in use. Snapping the 58 on its own moves that inner edge off the grid and paints the hairline this was meant to remove.
|
Full Usage:
headerHeight ()
Parameters:
unit
Returns: string
|
|
|
The keys to press for a shortcut on the platform this is running on, drawn as keys. Read off the shortcut table, never written out, for the same reason the shortcut list in Info is generated from it: prose that names a key cannot be held to what the key dispatcher does, and the two chords the window size warning was first written with said Ctrl and Alt on a Mac, where they are Cmd and Opt.
|
|
|
|
|
|
|
|
|
Full Usage:
minEditorWidth ()
Parameters:
unit
Returns: int
|
|
Full Usage:
minViewerWidth
Returns: int
|
|
|
|
|
|
|
|
Full Usage:
px cssPx
Parameters:
float
Returns: string
|
|
Full Usage:
refreshSvg color height
Parameters:
string
height : string
Returns: ReactElement
|
|
|
|
|
|
|
|
Full Usage:
rightSectionWidthViewerDefault
Returns: int
|
|
|
|
|
|
|
|
Full Usage:
toWholeDevicePixels cssPx
Parameters:
float
Returns: float
|
Round a CSS length so that it lands on a whole DEVICE pixel. **An edge that falls between two device pixels is painted blended.** The browser covers the boundary pixel only partly, so it comes out a mixture of what lies on each side of it, and a seam between two flat colours becomes a hairline of a third. On the canvas that reads as a fine line of the sheet's background along an edge - loudest in the Light theme, whose background is a pale yellow against a white pane and a grey rule. It is not a rounding error in this code. The fixed widths here are whole CSS pixels and Windows display scaling is what turns them into fractions of a device pixel - but those are the same every run, and land on the grid at the scalings in use. The one that does not is the width of the right-hand pane in the waveform simulator, which is whatever the user dragged the divider to: at 125% scaling a 573-pixel pane is 716.25 device pixels, so the seam between the pane and the canvas falls a quarter of a pixel inside one, and that pixel is painted part pane and part canvas. Only lengths that decide such a SEAM should come through here. Snapping one that does not is worse than leaving it: the header's height is 58 CSS pixels and the rule below it 2 more, and it is where the rule ENDS - at 60 - that the canvas background begins. Rounding the 58 on its own moves that boundary off the grid and paints exactly the hairline this exists to remove, which is what happened when it was first tried here. The ratio is read at each call rather than once, because it changes when the window is dragged to a monitor with different scaling.
|
|
|
|
|
|
|
|
|
|
|