Skip to main content

Frames

Frames help to visually organize different subgraphs of circuits. These subgraphs are determined during execution of the circuitscript code and is used by the layout engine to group graphical circuits together.

Frames must completely encapsulate a subgraph/multiple subgraphs, otherwise the graphical output may be incorrect/unpredictable.

info

It is always a good practice to organize schematics for clarity

Example:

from "std" import *
v5v = supply("5V")
gnd = dgnd()

frame:
..title = "Pull down resistor"

at v5v
wire down 100
add res(10k)
wire down 100
to gnd

frame:
..title = "Decoupling cap"

at v5v
wire down 100
add cap(100n)
wire down 100
to gnd
5VR110kGND5VC1100nGNDPull down resistorDecoupling cap

Frame properties

Frame properties can be set by using the double dot (..) operator followed by the property name. This operator must be used immediately after the frame command is called.

title

Specify the title to display in the frame.

from "std" import *
v5v = supply("5V")
gnd = dgnd()

frame:
..title = "Pull down resistor"

at v5v
wire down 100
add res(10k)
wire down 100
to gnd
5VR110kGNDPull down resistor

border

The frame border thickness can be set to draw thicker/thinner borders. Set the frame border to 0 to hide the border.

from "std" import *
v5v = supply("5V")
v3v3 = supply("3V3")
gnd = dgnd()

frame:
..title = "With border"
..border = 5

at v5v
wire down 100
add res(10k)
wire down 100
to gnd

frame:
..title = "With no border"
..border = 0

at v5v
wire down 100
add res(10k)
wire down 100
to gnd

frame:
..title = "With thicker border"
..border = 20

at v5v
wire down 100
add res(10k)
wire down 100
to gnd
5VR110kGND5VR210kGND5VR310kGNDWith borderWith no borderWith thicker border

width and height

Sets the dimensions of the frame

from "std" import *
v5v = supply("5V")
gnd = dgnd()

frame:
..width = 1500
..height = 1500

at v5v
wire down 100
add res(10k)
wire down 100
to gnd
5VR110kGND

direction

Specify how subgraphs within the frame should be arranged. There are currently two possible options: row and column. When unspecified, the frame direction is row.

Example for row direction:

from "std" import *
v5v = supply("5V")
v3v3 = supply("3V3")
gnd = dgnd()

frame:
..title = "Pull down resistors"

at v5v
wire down 100
add res(10k)
wire down 100
to gnd

at v3v3
wire down 100
add res(20k)
wire down 100
to gnd
5VR110kGND3V3R220kGNDPull down resistors

Example for column direction:

from "std" import *
v5v = supply("5V")
v3v3 = supply("3V3")
gnd = dgnd()

frame:
..title = "Pull down resistors"
..direction = "column"

at v5v
wire down 100
add res(10k)
wire down 100
to gnd

at v3v3
wire down 100
add res(20k)
wire down 100
to gnd
5VR110kGND3V3R220kGNDPull down resistors

align

Sets the horizontal alignment of content within the frame. Possible values are "left", "center", "right".

from "std" import *
v5v = supply("5V")
v3v3 = supply("3V3")
gnd = dgnd()

frame:
..title = "align left"
..direction = "row"
..align = "left"
..width = 1000

at v3v3
wire down 100
add res(20k)
wire down 100
to gnd

frame:
..title = "align center"
..direction = "row"
..align = "center"
..width = 1000

at v3v3
wire down 100
add res(20k)
wire down 100
to gnd

frame:
..title = "align right"
..direction = "row"
..align = "right"
..width = 1000

at v3v3
wire down 100
add res(20k)
wire down 100
to gnd

3V3R120kGND3V3R220kGND3V3R320kGNDalign leftalign centeralign right

valign

Sets the vertical alignment of content within the frame. Possible values are "top", "center", "bottom".

from "std" import *
v5v = supply("5V")
v3v3 = supply("3V3")
gnd = dgnd()

frame:
..title = "align top"
..direction = "row"
..valign = "top"
..width = 1000
..height = 2000

at v3v3
wire down 100
add res(20k)
wire down 100
to gnd

frame:
..title = "align center"
..direction = "row"
..valign = "center"
..width = 1000
..height = 2000

at v3v3
wire down 100
add res(20k)
wire down 100
to gnd

frame:
..title = "align bottom"
..direction = "row"
..valign = "bottom"
..width = 1000
..height = 2000

at v3v3
wire down 100
add res(20k)
wire down 100
to gnd

3V3R120kGND3V3R220kGND3V3R320kGNDalign topalign centeralign bottom

Nested frames and arranging frames

Frames can be nested and combined to visually organize circuits better.

from "std" import *
v3v3 = supply("3V3")
gnd = dgnd()


frame:
..border = 0
..title = "LEDs"
..direction = "row"

frame:
..title = "LED 1"

at v3v3
wire down 100
add res(100)
wire down 100
add led("green") pin 2
wire down 100
to gnd

frame:
..title = "LED 2"

at v3v3
wire down 100
add res(100)
wire down 100
add led("green") pin 2
wire down 100
to gnd

frame:
..title = "LED 3"

at v3v3
wire down 100
add res(100)
wire down 100
add led("green") pin 2
wire down 100
to gnd

3V3R110012D1greenGND3V3R210012D2greenGND3V3R310012D3greenGNDLEDsLED 1LED 2LED 3