Header menu logo issie

Sheet Module

Nested modules

Modules Description

Constants

SheetInterface

Functions and values

Function or value Description

addBoxMargin fractionalMargin absoluteMargin box

Full Usage: addBoxMargin fractionalMargin absoluteMargin box

Parameters:
    fractionalMargin : float
    absoluteMargin : float
    box : BoundingBox

Returns: BoundingBox
fractionalMargin : float
absoluteMargin : float
box : BoundingBox
Returns: BoundingBox

boxPointUnion box point

Full Usage: boxPointUnion box point

Parameters:
Returns: BoundingBox

Returns the smallest BB containing box and point. Could be made more efficient

box : BoundingBox
point : XYPos
Returns: BoundingBox

boxUnion box box'

Full Usage: boxUnion box box'

Parameters:
Returns: BoundingBox

calculates the smallest bounding box that contains two BBs, in form with W,H > 0

box : BoundingBox
box' : BoundingBox
Returns: BoundingBox

centreOfCanvas model

Full Usage: centreOfCanvas model

Parameters:
Returns: XYPos
model : Model
Returns: XYPos

centreOfScreen model

Full Usage: centreOfScreen model

Parameters:
Returns: XYPos option
model : Model
Returns: XYPos option

ensureCanvasExtendsBeyondScreen model

Full Usage: ensureCanvasExtendsBeyondScreen model

Parameters:
Returns: Model

Check that canvas is large enough to have space all round the visible area. If not, then change model by moving circuit on canvas and/or extending canvas. Keep components in same visible position during this process. returns new model with all positions updated if need be.

model : Model
Returns: Model

findIntersectingComponents model box1

Full Usage: findIntersectingComponents model box1

Parameters:
Returns: ComponentId list

Finds all components that touch a bounding box (which is usually the drag-to-select box)

model : Model
box1 : BoundingBox
Returns: ComponentId list

findNearbyComponents model pos range

Full Usage: findNearbyComponents model pos range

Parameters:
Returns: ComponentId list

Finds all components (that are stored in the Sheet model) near pos Optimised a little for space

model : Model
pos : XYPos
range : float
Returns: ComponentId list

findNearbyComponentsOld model pos range

Full Usage: findNearbyComponentsOld model pos range

Parameters:
Returns: ComponentId list

Finds all components (that are stored in the Sheet model) near pos

model : Model
pos : XYPos
range : float
Returns: ComponentId list

findNearbyPorts model

Full Usage: findNearbyPorts model

Parameters:
Returns: (InputPortId * XYPos) list * (OutputPortId * XYPos) list

Returns the ports of all model.NearbyComponents

model : Model
Returns: (InputPortId * XYPos) list * (OutputPortId * XYPos) list

fitCircuitToWindowParas model

Full Usage: fitCircuitToWindowParas model

Parameters:
Returns: Model * (type) option

shift circuit to middle of canvas, resizing canvas to allow enough border if needed. return scroll and zoom paras to display all of circuit in middle of window

model : Model
Returns: Model * (type) option

getScreenEdgeCoords model

Full Usage: getScreenEdgeCoords model

Parameters:
Returns: (type) option

return screen edge coords if possible

model : Model
Returns: (type) option

getScrollProps ()

Full Usage: getScrollProps ()

Parameters:
    () : unit

Returns: XYPos option

return X=CanvasDiv.scrollLeft, Y= canvasDiv.scrollTop

() : unit
Returns: XYPos option

getWindowParasToFitBox model box

Full Usage: getWindowParasToFitBox model box

Parameters:
Returns: (type) option

get scroll and zoom paras to fit box all on screen centred and occupying as much of screen as possible

model : Model
box : BoundingBox
Returns: (type) option

getWireBBox wire

Full Usage: getWireBBox wire

Parameters:
Returns: BoundingBox

could be made more efficient, since segments contain redundant info

wire : Wire
Returns: BoundingBox

insideBox pos boundingBox

Full Usage: insideBox pos boundingBox

Parameters:
Returns: bool

helper used inside Map.tryFind hence the unused parameter returns true if pos is insoie boundingbox

pos : XYPos
boundingBox : BoundingBox
Returns: bool

insideBoxMap boundingBoxes pos

Full Usage: insideBoxMap boundingBoxes pos

Parameters:
Returns: Option<ComponentId>
Modifiers: inline

Checks if pos is inside any of the bounding boxes of the components in boundingBoxes

boundingBoxes : Map<ComponentId, BoundingBox>
pos : XYPos
Returns: Option<ComponentId>

isAllVisible model conns comps

Full Usage: isAllVisible model conns comps

Parameters:
Returns: bool
model : Model
conns : ConnectionId list
comps : ComponentId list
Returns: bool

isBBoxAllVisible model bb

Full Usage: isBBoxAllVisible model bb

Parameters:
Returns: bool option
model : Model
bb : BoundingBox
Returns: bool option

mouseOn model pos

Full Usage: mouseOn model pos

Parameters:
Returns: MouseOn

Returns what is located at pos. Priority Order: InputPort -> OutputPort -> Label -> Wire -> Component -> Canvas

model : Model
pos : XYPos
Returns: MouseOn

mouseOnPort portList pos margin

Full Usage: mouseOnPort portList pos margin

Parameters:
    portList : ('a * XYPos) list
    pos : XYPos
    margin : float

Returns: ('a * XYPos) option

Checks if pos is inside any of the ports in portList

portList : ('a * XYPos) list
pos : XYPos
margin : float
Returns: ('a * XYPos) option

moveCircuit moveDelta model

Full Usage: moveCircuit moveDelta model

Parameters:
Returns: Model
moveDelta : XYPos
model : Model
Returns: Model

notIntersectingComponents model box1 inputId

Full Usage: notIntersectingComponents model box1 inputId

Parameters:
Returns: bool
model : Model
box1 : BoundingBox
inputId : ComponentId
Returns: bool

notIntersectingSelectedComponents model box1 inputId

Full Usage: notIntersectingSelectedComponents model box1 inputId

Parameters:
Returns: bool
model : Model
box1 : BoundingBox
inputId : ComponentId
Returns: bool

posAdd pos (a, b)

Full Usage: posAdd pos (a, b)

Parameters:
    pos : XYPos
    a : float
    b : float

Returns: XYPos
pos : XYPos
a : float
b : float
Returns: XYPos

putScrollProps props

Full Usage: putScrollProps props

Parameters:
Returns: HTMLElement option
props : XYPos
Returns: HTMLElement option

recentProgrammaticScrollPos

Full Usage: recentProgrammaticScrollPos

Returns: XYPos list

Used to filter OnScroll messages caused by recent scroll updates. These could reset scroll back to some previous value.

Returns: XYPos list

scrollSequence

Full Usage: scrollSequence

Returns: int

Used to filter out-of-sequence OnScroll messages. These could reset scroll to some previous value. Incremented by program UpdateScroll and OnScroll.

Returns: int

sheetCmd msg

Full Usage: sheetCmd msg

Parameters:
Returns: Cmd<Msg>
msg : Msg
Returns: Cmd<Msg>

standardiseBox box

Full Usage: standardiseBox box

Parameters:
Returns: BoundingBox

return a BB equivalent to input but with (X,Y) = LH Top coord, (X+W,Y+H) = RH bottom coord note that LH Top is lower end of the two screen coordinates

box : BoundingBox
Returns: BoundingBox

symDiff lst1 lst2

Full Usage: symDiff lst1 lst2

Parameters:
    lst1 : 'a list
    lst2 : 'a list

Returns: 'a list
lst1 : 'a list
lst2 : 'a list
Returns: 'a list

symbolBBUnion centresOnly symbols

Full Usage: symbolBBUnion centresOnly symbols

Parameters:
    centresOnly : bool
    symbols : Symbol list

Returns: BoundingBox option
centresOnly : bool
symbols : Symbol list
Returns: BoundingBox option

symbolCmd msg

Full Usage: symbolCmd msg

Parameters:
Returns: Cmd<Msg>

Creates a command to Symbol

msg : Msg
Returns: Cmd<Msg>

symbolToBB centresOnly symbol

Full Usage: symbolToBB centresOnly symbol

Parameters:
    centresOnly : bool
    symbol : Symbol

Returns: BoundingBox
centresOnly : bool
symbol : Symbol
Returns: BoundingBox

symbolToCentre symbol

Full Usage: symbolToCentre symbol

Parameters:
Returns: BoundingBox
symbol : Symbol
Returns: BoundingBox

symbolWireBBUnion model

Full Usage: symbolWireBBUnion model

Parameters:
Returns: BoundingBox

Returns the smallest BB that contains all symbols, labels, and wire segments. For empty circuit a BB is returned in middle of viewable screen.

model : Model
Returns: BoundingBox

transformScreenToPos screenPos scrollPos mag

Full Usage: transformScreenToPos screenPos scrollPos mag

Parameters:
Returns: XYPos
screenPos : XYPos
scrollPos : XYPos
mag : float
Returns: XYPos

tryInsideLabelBox model pos

Full Usage: tryInsideLabelBox model pos

Parameters:
Returns: Symbol option
Modifiers: inline

returns the symbol if pos is inside any symbol's LabelBoundingBox

model : Model
pos : XYPos
Returns: Symbol option

tryInsideSymCorner model pos

Full Usage: tryInsideSymCorner model pos

Parameters:
Returns: (Symbol * XYPos * int) option
Modifiers: inline

HLP23 AUTHOR: BRYAN TAN if pos is inside any one of the custom symbol's corners, return the diagonally opposite corner (its position is fixed during resizing), and the index of the corner being held

model : Model
pos : XYPos
Returns: (Symbol * XYPos * int) option

viewIsAfterUpdateScroll

Full Usage: viewIsAfterUpdateScroll

Returns: bool

True for the first view function evaluation after scroll has been programmatically updated. In that case OnScroll messages are never sent.

Returns: bool

wireCmd msg

Full Usage: wireCmd msg

Parameters:
Returns: Cmd<Msg>

Creates a command to BusWire

msg : Msg
Returns: Cmd<Msg>

wireToBB wire

Full Usage: wireToBB wire

Parameters:
Returns: BoundingBox

Returns the smallest BB that contains all segments of wire.

wire : Wire
Returns: BoundingBox

Type something to start searching.