Skip to main content
Built-in Elements

<assembly.drawing.wiringtable />

assembly.drawing.wiringtable lists the wires of one assembly.cable on an assembly.drawing.page, one row per assembly.cablewire in fromPin order.

import { assembly } from "tscircuit"

export default () => (
<assembly.device>
<board width={40} height={20} routingDisabled>
<connector name="J1" standard="jst_sh" pinCount={4}
footprint="jst4_sh" pcbX={-12} />
<connector name="J2" standard="jst_ph" pinCount={4}
footprint="jst4_ph" pcbX={12} />
</board>
<assembly.cable name="SENSOR" from=".J1" to=".J2"
model="adaptercable_a(jst_sh_pins4)_b(jst_ph_pins4)"
length="100mm" lengthTolerance="5mm" wireAwg={28}
fromConnectorName="SH" toConnectorName="PH">
<assembly.cablewire name="GND" fromPin={1} toPin={2} color="black" />
<assembly.cablewire name="3V3" fromPin={2} toPin={1} color="red" />
<assembly.cablewire name="SDA" fromPin={3} toPin={3} color="blue" />
<assembly.cablewire name="SCL" fromPin={4} toPin={4} color="yellow" />
</assembly.cable>
<assembly.drawing.page name="sensor-adapter" width={200} height={125}>
<assembly.drawing.harnessview cableRef="SENSOR"
width={180} height={60} centerY={28} />
<assembly.drawing.wiringtable cableRef="SENSOR" title="WIRING"
paperX={0} paperY={-12} anchorAlignment="top_center" />
</assembly.drawing.page>
</assembly.device>
)
Drawing 1 of 1: sensor-adapter

Properties​

PropertyDescription
cableRefRequired. The cable's name or a selector that matches exactly one assembly.cable with wires.
paperX, paperYRequired position relative to the page's anchorAlignment, in millimetres or unit strings. Positive X is right; positive Y is up.
anchorAlignmentRequired. Which point of the table paperX/paperY locates: top_left, top_center, top_right, center_left, center, center_right, bottom_left, bottom_center or bottom_right.
titleOptional heading row spanning the table.
nameOptional table identity.

A table's position is never implied, so all three placement props are required. With anchorAlignment="top_right", for example, paperX/paperY is the table's top-right corner and the table extends left and down from it.

Columns​

The first and last columns hold the pin at each end. They are headed with the cable's fromConnectorName and toConnectorName, or A and B.

SIGNAL, COLOR and AWG columns appear only when at least one wire states a name, a color or a gauge. A cable whose wires state only pins and a gauge gets a narrower table:

import { assembly } from "tscircuit"

const pinout = [3, 1, 5, 2, 8, 4, 6, 7]

export default () => (
<assembly.device>
<board width={40} height={20} routingDisabled>
<connector name="J1" standard="jst_ph" pinCount={8}
footprint="jst8_ph" pcbX={-12} />
<connector name="J2" standard="jst_ph" pinCount={8}
footprint="jst8_ph" pcbX={12} />
</board>
<assembly.cable name="SHUFFLE" from=".J1" to=".J2"
length="120mm" wireAwg={26}>
{pinout.map((toPin, index) => (
<assembly.cablewire key={toPin} fromPin={index + 1} toPin={toPin} />
))}
</assembly.cable>
<assembly.drawing.page name="shuffled-pinout" width={200} height={135}>
<assembly.drawing.harnessview cableRef="SHUFFLE"
width={180} height={62} centerY={32} />
<assembly.drawing.wiringtable cableRef="SHUFFLE"
paperX={0} paperY={-5} anchorAlignment="top_center" />
</assembly.drawing.page>
</assembly.device>
)
Drawing 1 of 1: shuffled-pinout

Pin columns are 14 mm wide, detail columns are 24 mm wide and rows are 6 mm tall, so a table's size follows from its wire count and columns.