Header menu logo issie

SheetDisplay Module

Functions and values

Function or value Description

displaySvgWithZoom model headerHeight style svgReact dispatch

Full Usage: displaySvgWithZoom model headerHeight style svgReact dispatch

Parameters:
Returns: ReactElement

This function zooms an SVG canvas by transforming its content and altering its size. Currently the zoom expands based on top left corner.

model : Model
headerHeight : float
style : CSSProp list
svgReact : List<ReactElement>
dispatch : Dispatch<Msg>
Returns: ReactElement

getDrawBlockPos ev headerHeight sheetModel

Full Usage: getDrawBlockPos ev headerHeight sheetModel

Parameters:
Returns: XYPos
ev : MouseEvent
headerHeight : float
sheetModel : Model
Returns: XYPos

isPhysicalModifierHeld ()

Full Usage: isPhysicalModifierHeld ()

Parameters:
    () : unit

Returns: bool
() : unit
Returns: bool

mDown ev

Full Usage: mDown ev

Parameters:
Returns: bool

Is the mouse button currently down?

ev : MouseEvent
Returns: bool

mouseOp op ev dispatch headerHeight

Full Usage: mouseOp op ev dispatch headerHeight

Parameters:

Dispatch a MouseMsg (compensated for zoom)

op : MouseOp
ev : MouseEvent
dispatch : Msg -> unit
headerHeight : float

onCanvasWheel dispatch e

Full Usage: onCanvasWheel dispatch e

Parameters:

Every wheel event over the canvas is decided here, and this is a NATIVE listener - registered non-passive on the document by Renderer.appSubscriptions - not a React one, because React 18 attaches its wheel listeners passively and a passive listener cannot preventDefault. A wheel that classifies as a zoom gesture - real Ctrl/Cmd held, or the synthetic ctrlKey Chromium puts on a trackpad pinch - must zoom and only zoom, so its native default (scrolling the canvas, or the browser's own page zoom) is suppressed even when the factor is too small to be worth dispatching: Ctrl + a diagonal two-finger scroll must not creep sideways. An unmodified wheel is left entirely alone, so the canvas scrolls natively as it always has.

dispatch : Msg -> unit
e : Event

setPhysicalModifierHeld value

Full Usage: setPhysicalModifierHeld value

Parameters:
    value : bool

value : bool

view model headerHeight style overlay dispatch

Full Usage: view model headerHeight style overlay dispatch

Parameters:
Returns: ReactElement

View function, displays symbols / wires and possibly also a grid / drag-to-select box / connecting ports line / snap-to-grid visualisation `overlay` is drawn on top of the wires, in draw block coordinates, so it pans and zooms with the schematic. It exists for things the draw block cannot work out for itself - at present the value on the wire under the cursor, which only the UI layer knows, because only it knows a simulation is running. Empty the rest of the time.

model : Model
headerHeight : float
style : CSSProp list
overlay : ReactElement list
dispatch : Msg -> unit
Returns: ReactElement

writeCanvasScroll scrollPos

Full Usage: writeCanvasScroll scrollPos

Parameters:
Returns: HTMLElement option

This actually writes to the DOM a new scroll position. In the special case that DOM has not yet been created it does nothing.

scrollPos : XYPos
Returns: HTMLElement option

Type something to start searching.