@tscircuit/schematic-trace-solver 0.0.148 → 0.0.150
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/schematic-trace-visualization/SKILL.md +7 -2
- package/dist/index.d.ts +31 -2
- package/dist/index.js +127 -46
- package/lib/solvers/InlineNetLabelSolver/InlineNetLabelSolver.ts +115 -6
- package/lib/solvers/NetLabelPlacementSolver/NetLabelPlacementSolver.ts +17 -1
- package/lib/solvers/NetLabelPlacementSolver/SingleNetLabelPlacementSolver/SingleNetLabelPlacementSolver.ts +2 -0
- package/lib/solvers/NetLabelPlacementSolver/SingleNetLabelPlacementSolver/solvePortOnlyPin.ts +2 -0
- package/lib/types/InputProblem.ts +27 -1
- package/package.json +8 -1
- package/site/examples/example51.page.tsx +4 -0
- package/tests/assets/example51.json +5102 -0
- package/tests/bug-reports/bug-report-20260706T213649Z/__snapshots__/bug-report-20260706T213649Z.snap.svg +751 -5
- package/tests/bug-reports/bug-report-20260706T220324Z/__snapshots__/bug-report-20260706T220324Z.snap.svg +660 -5
- package/tests/bug-reports/bug-report-20260707T020342Z/__snapshots__/bug-report-20260707T020342Z.snap.svg +44 -5
- package/tests/bug-reports/bug-report-20260707T092615Z/__snapshots__/bug-report-20260707T092615Z.snap.svg +394 -5
- package/tests/bug-reports/bug-report-20260707T134549Z/__snapshots__/bug-report-20260707T134549Z.snap.svg +170 -5
- package/tests/bug-reports/bug-report-20260707T134722Z/__snapshots__/bug-report-20260707T134722Z.snap.svg +79 -5
- package/tests/bug-reports/bug-report-20260707T140410Z/__snapshots__/bug-report-20260707T140410Z.snap.svg +219 -5
- package/tests/bug-reports/bug-report-20260707T141025Z/__snapshots__/bug-report-20260707T141025Z.snap.svg +65 -5
- package/tests/bug-reports/bug-report-20260707T141421Z/__snapshots__/bug-report-20260707T141421Z.snap.svg +142 -5
- package/tests/bug-reports/bug-report-20260707T230831Z/__snapshots__/bug-report-20260707T230831Z.snap.svg +100 -5
- package/tests/bug-reports/bug-report-20260708T053736Z/__snapshots__/bug-report-20260708T053736Z.snap.svg +23 -5
- package/tests/bug-reports/bug-report-20260708T055430Z/__snapshots__/bug-report-20260708T055430Z.snap.svg +58 -5
- package/tests/bug-reports/bug-report-20260708T095725Z/__snapshots__/bug-report-20260708T095725Z.snap.svg +86 -5
- package/tests/bug-reports/bug-report-20260716T144856Z/__snapshots__/bug-report-20260716T144856Z.snap.svg +226 -5
- package/tests/bug-reports/bug-report-20260717T022934Z/__snapshots__/bug-report-20260717T022934Z.snap.svg +191 -5
- package/tests/bug-reports/bug-report-20260717T031704Z/__snapshots__/bug-report-20260717T031704Z.snap.svg +30 -5
- package/tests/bug-reports/bug-report-20260717T042845Z/__snapshots__/bug-report-20260717T042845Z.snap.svg +37 -5
- package/tests/bug-reports/bug-report-20260721T221026Z/__snapshots__/bug-report-20260721T221026Z.snap.svg +580 -2
- package/tests/bug-reports/bug-report-20260724T175257Z/__snapshots__/bug-report-20260724T175257Z.snap.svg +44 -5
- package/tests/bug-reports/bug-report-20260728T144234Z/__snapshots__/bug-report-20260728T144234Z.snap.svg +107 -5
- package/tests/bug-reports/bug-report-20260728T225606Z/__snapshots__/bug-report-20260728T225606Z.snap.svg +114 -5
- package/tests/bug-reports/bug-report-20260730T061837Z/__snapshots__/bug-report-20260730T061837Z.snap.svg +121 -5
- package/tests/bug-reports/bug-report-20260731T052229Z/__snapshots__/bug-report-20260731T052229Z.snap.svg +51 -5
- package/tests/bug-reports/bug-report-20260804T095800Z/__snapshots__/bug-report-20260804T095800Z.snap.svg +212 -5
- package/tests/bug-reports/bug-report-20260804T171919Z/__snapshots__/bug-report-20260804T171919Z.snap.svg +569 -5
- package/tests/bug-reports/bug-report-20260804T225912Z/__snapshots__/bug-report-20260804T225912Z.snap.svg +37 -5
- package/tests/bug-reports/bug-report-20260805T061316Z/__snapshots__/bug-report-20260805T061316Z.snap.svg +289 -5
- package/tests/bug-reports/bug-report-20260806T061548Z/__snapshots__/bug-report-20260806T061548Z.snap.svg +289 -5
- package/tests/bug-reports/bug-report-20260806T093501Z/__snapshots__/bug-report-20260806T093501Z.snap.svg +149 -5
- package/tests/bug-reports/bug-report-20260811T075142Z/__snapshots__/bug-report-20260811T075142Z.snap.svg +93 -5
- package/tests/bug-reports/bug-report-20260815T073240Z/__snapshots__/bug-report-20260815T073240Z.snap.svg +79 -5
- package/tests/bug-reports/bug-report-20260819T091818Z/__snapshots__/bug-report-20260819T091818Z.snap.svg +244 -2
- package/tests/examples/__snapshots__/example01.snap.svg +44 -5
- package/tests/examples/__snapshots__/example02.snap.svg +51 -5
- package/tests/examples/__snapshots__/example03.snap.svg +86 -5
- package/tests/examples/__snapshots__/example04.snap.svg +30 -5
- package/tests/examples/__snapshots__/example05.snap.svg +30 -5
- package/tests/examples/__snapshots__/example06.snap.svg +30 -5
- package/tests/examples/__snapshots__/example07.snap.svg +58 -5
- package/tests/examples/__snapshots__/example08.snap.svg +37 -5
- package/tests/examples/__snapshots__/example09.snap.svg +149 -5
- package/tests/examples/__snapshots__/example10.snap.svg +65 -5
- package/tests/examples/__snapshots__/example11.snap.svg +51 -5
- package/tests/examples/__snapshots__/example12.snap.svg +51 -5
- package/tests/examples/__snapshots__/example13.snap.svg +72 -5
- package/tests/examples/__snapshots__/example14.snap.svg +79 -5
- package/tests/examples/__snapshots__/example15.snap.svg +86 -5
- package/tests/examples/__snapshots__/example16.snap.svg +51 -5
- package/tests/examples/__snapshots__/example17.snap.svg +51 -5
- package/tests/examples/__snapshots__/example18.snap.svg +58 -5
- package/tests/examples/__snapshots__/example19.snap.svg +44 -5
- package/tests/examples/__snapshots__/example20.snap.svg +44 -5
- package/tests/examples/__snapshots__/example21.snap.svg +72 -5
- package/tests/examples/__snapshots__/example22.snap.svg +51 -5
- package/tests/examples/__snapshots__/example23.snap.svg +51 -5
- package/tests/examples/__snapshots__/example24.snap.svg +51 -5
- package/tests/examples/__snapshots__/example25.snap.svg +86 -5
- package/tests/examples/__snapshots__/example26.snap.svg +51 -5
- package/tests/examples/__snapshots__/example27.snap.svg +72 -5
- package/tests/examples/__snapshots__/example28.snap.svg +44 -5
- package/tests/examples/__snapshots__/example29.snap.svg +324 -5
- package/tests/examples/__snapshots__/example30.snap.svg +107 -5
- package/tests/examples/__snapshots__/example31.snap.svg +37 -5
- package/tests/examples/__snapshots__/example32.snap.svg +149 -5
- package/tests/examples/__snapshots__/example33.snap.svg +93 -5
- package/tests/examples/__snapshots__/example34.snap.svg +51 -5
- package/tests/examples/__snapshots__/example35.snap.svg +58 -5
- package/tests/examples/__snapshots__/example36.snap.svg +44 -5
- package/tests/examples/__snapshots__/example37.snap.svg +72 -5
- package/tests/examples/__snapshots__/example38.snap.svg +30 -5
- package/tests/examples/__snapshots__/example39.snap.svg +37 -5
- package/tests/examples/__snapshots__/example40.snap.svg +100 -5
- package/tests/examples/__snapshots__/example41.snap.svg +44 -5
- package/tests/examples/__snapshots__/example42.snap.svg +65 -5
- package/tests/examples/__snapshots__/example43.snap.svg +58 -5
- package/tests/examples/__snapshots__/example44.snap.svg +107 -5
- package/tests/examples/__snapshots__/example45.snap.svg +51 -5
- package/tests/examples/__snapshots__/example46.snap.svg +93 -5
- package/tests/examples/__snapshots__/example47.snap.svg +93 -5
- package/tests/examples/__snapshots__/example48.snap.svg +65 -5
- package/tests/examples/__snapshots__/example49.snap.svg +177 -5
- package/tests/examples/__snapshots__/example50.snap.svg +93 -5
- package/tests/examples/__snapshots__/example51.snap.svg +952 -0
- package/tests/examples/example51.test.ts +12 -0
- package/tests/fixtures/convertSolverOutputToCircuitJson.test.ts +219 -0
- package/tests/fixtures/convertSolverOutputToCircuitJson.ts +1058 -0
- package/tests/fixtures/matcher.ts +45 -8
- package/tests/repros/__snapshots__/board-1273-trace-overlap-cycle.snap.svg +762 -2
- package/tests/repros/__snapshots__/board-15984-same-net-junction.snap.svg +111 -2
- package/tests/repros/__snapshots__/board1096-usb-label-overlap-iteration.snap.svg +167 -2
- package/tests/repros/__snapshots__/bugreport-001-gnd-overlap.snap.svg +65 -5
- package/tests/repros/__snapshots__/manufacturePartNumber-text-box.snap.svg +30 -5
- package/tests/repros/__snapshots__/netlabel-connector-through-rail-label.snap.svg +79 -5
- package/tests/repros/__snapshots__/repro-atmega328p-fault-pullup.snap.svg +65 -5
- package/tests/repros/__snapshots__/repro-atmega328p-missing-gnd-netlabel.snap.svg +149 -5
- package/tests/repros/__snapshots__/repro-board-589-regulator-section.snap.svg +55 -2
- package/tests/repros/__snapshots__/repro-board-648-esp12f-section.snap.svg +160 -2
- package/tests/repros/__snapshots__/repro-bq24074-battery-charger.snap.svg +135 -5
- package/tests/repros/__snapshots__/repro-bq25895-cross-net-trace-overlap.snap.svg +69 -2
- package/tests/repros/__snapshots__/repro-cc2340r5.snap.svg +86 -5
- package/tests/repros/__snapshots__/repro-core-555-power-cross-net-overlap.snap.svg +44 -5
- package/tests/repros/__snapshots__/repro-core-subcircuit-missing-ground.snap.svg +44 -5
- package/tests/repros/__snapshots__/repro-core-tb67s579ftg-inline-label-routing.snap.svg +260 -0
- package/tests/repros/__snapshots__/repro-example35-minimize-trace-crossing.snap.svg +335 -2
- package/tests/repros/__snapshots__/repro-ground-label-on-lower-rail-end.snap.svg +48 -2
- package/tests/repros/__snapshots__/repro-ina237-current-monitor.snap.svg +149 -5
- package/tests/repros/__snapshots__/repro-missing-trace-netlabel.snap.svg +72 -5
- package/tests/repros/__snapshots__/repro-netlabel-collision-687.snap.svg +100 -5
- package/tests/repros/__snapshots__/repro-netlabel-overlap-trace.snap.svg +51 -5
- package/tests/repros/__snapshots__/repro-nrf52810-clock-routing.snap.svg +90 -2
- package/tests/repros/__snapshots__/repro-power-group-rail-labels.snap.svg +37 -5
- package/tests/repros/__snapshots__/repro-rectifier-trace-overlap.snap.svg +44 -5
- package/tests/repros/__snapshots__/repro-rp2040-gamepad-trace-alignment.snap.svg +237 -2
- package/tests/repros/__snapshots__/repro-rp2040-usb-cc2-ground-overlap.snap.svg +72 -5
- package/tests/repros/__snapshots__/repro-rp2040-v3v3-label-placement.snap.svg +51 -5
- package/tests/repros/__snapshots__/repro-rp2040-zero-crystal-fallback-netlabels.snap.svg +30 -5
- package/tests/repros/__snapshots__/repro-ti-power-output-section.snap.svg +79 -5
- package/tests/repros/__snapshots__/repro-tida010076-j4-ground-bus.snap.svg +27 -2
- package/tests/repros/__snapshots__/repro-tida010076-page02.snap.svg +1150 -5
- package/tests/repros/__snapshots__/repro-tps61222-trace-intersection.snap.svg +51 -5
- package/tests/repros/__snapshots__/repro-type-c-16pin-self-connection.snap.svg +30 -5
- package/tests/repros/__snapshots__/repro-type-c-16pin-to-resistor.snap.svg +30 -5
- package/tests/repros/__snapshots__/repro-type-c-vbus-led-ground-label.snap.svg +44 -5
- package/tests/repros/__snapshots__/repro-usb-power-vbus-label-detour.snap.svg +685 -2
- package/tests/repros/__snapshots__/repro-vcc-pin1-detour.snap.svg +27 -2
- package/tests/repros/__snapshots__/repro129-host-custom-symbol-passives.snap.svg +51 -5
- package/tests/repros/__snapshots__/repro130-bq27441-fuel-gauge-trace-through-c1.snap.svg +100 -5
- package/tests/repros/__snapshots__/repro161-power-section-autolayout.snap.svg +107 -5
- package/tests/repros/__snapshots__/repro47-endpoint-obstacle-detour.snap.svg +51 -5
- package/tests/repros/__snapshots__/repro48-555-timer-vcc-rail-label.snap.svg +104 -2
- package/tests/repros/__snapshots__/repro5-escape-padded-text-obstacles.snap.svg +30 -5
- package/tests/repros/__snapshots__/repro51-overlap-junction-crossing.snap.svg +65 -5
- package/tests/repros/__snapshots__/repro84-stacked-gnd-label-orientation.snap.svg +27 -2
- package/tests/repros/__snapshots__/small-variant-resistor-facing-direction.snap.svg +58 -5
- package/tests/repros/__snapshots__/trace-overlap-box-resistor.snap.svg +37 -5
- package/tests/repros/assets/repro-core-tb67s579ftg-inline-label-routing.input.json +900 -0
- package/tests/repros/repro-core-tb67s579ftg-inline-label-routing.test.ts +40 -0
- package/tests/solvers/InlineNetLabelSolver/__snapshots__/fallback-net-label-width.snap.svg +25 -7
- package/tests/solvers/InlineNetLabelSolver/__snapshots__/inline-net-label-anchored-label-clearance.snap.svg +34 -2
- package/tests/solvers/InlineNetLabelSolver/__snapshots__/inline-net-label-port-stub.snap.svg +23 -5
- package/tests/solvers/InlineNetLabelSolver/__snapshots__/inline-net-label-two-pin-net.snap.svg +23 -5
- package/tests/solvers/InlineNetLabelSolver/__snapshots__/inline-net-label01.snap.svg +23 -5
- package/tests/solvers/InlineNetLabelSolver/__snapshots__/inline-net-label02.snap.svg +23 -5
- package/tests/solvers/InlineNetLabelSolver/__snapshots__/terminal-stub-trace-clearance.snap.svg +71 -0
- package/tests/solvers/InlineNetLabelSolver/fallback-net-label-width.test.ts +10 -1
- package/tests/solvers/InlineNetLabelSolver/terminal-stub-trace-clearance.test.ts +102 -0
- package/tests/solvers/SchematicTraceSingleLineSolver2/__snapshots__/SchematicTraceSingleLineSolver2_01-example17-d1_1-u1_1.snap.svg +23 -5
- package/tests/solvers/SchematicTraceSingleLineSolver2/__snapshots__/SchematicTraceSingleLineSolver2_repro47-short-opposing-pins.snap.svg +20 -2
- package/tests/solvers/TraceCleanupSolver/__snapshots__/TraceCleanupSolver.snap.svg +44 -5
- package/tests/solvers/TraceLabelOverlapAvoidanceSolver/__snapshots__/TraceLabelOverlapAvoidanceSolver.snap.svg +79 -5
- package/tests/solvers/TraceLabelOverlapAvoidanceSolver/sub-solver/__snapshots__/MergedNetLabelObstacles.snap.svg +44 -5
- package/tests/solvers/TraceLabelOverlapAvoidanceSolver/sub-solver/__snapshots__/OverlapAvoidanceStepSolver.snap.svg +23 -5
- package/tests/solvers/TraceLabelOverlapAvoidanceSolver/sub-solver/__snapshots__/SingleOverlapSolver.snap.svg +30 -5
|
@@ -18,6 +18,7 @@ import { getNetLabelWidthForConnection } from "lib/utils/getNetLabelWidthForConn
|
|
|
18
18
|
export type OverlappingSameNetTraceGroup = {
|
|
19
19
|
globalConnNetId: string
|
|
20
20
|
netId?: string
|
|
21
|
+
netLabelText?: string
|
|
21
22
|
overlappingTraces?: SolvedTracePath
|
|
22
23
|
portOnlyPinId?: string
|
|
23
24
|
mspConnectionPairIds?: MspConnectionPairId[]
|
|
@@ -30,6 +31,8 @@ export interface NetLabelPlacement {
|
|
|
30
31
|
* Optional user-provided net identifier (if present in the input problem).
|
|
31
32
|
*/
|
|
32
33
|
netId?: string
|
|
34
|
+
/** User-facing label content, separate from the connectivity identifier. */
|
|
35
|
+
netLabelText?: string
|
|
33
36
|
/**
|
|
34
37
|
* MSP pair ids that the label is associated with. Port-only labels use [].
|
|
35
38
|
*/
|
|
@@ -116,18 +119,27 @@ export class NetLabelPlacementSolver extends BaseSolver {
|
|
|
116
119
|
}
|
|
117
120
|
}
|
|
118
121
|
|
|
119
|
-
// Map pins to user-provided
|
|
122
|
+
// Map pins to user-provided connectivity ids and display text (if any).
|
|
120
123
|
const userNetIdByPinId: Record<string, string | undefined> = {}
|
|
124
|
+
const netLabelTextByPinId: Record<string, string | undefined> = {}
|
|
121
125
|
for (const dc of this.inputProblem.directConnections) {
|
|
122
126
|
if (dc.netId) {
|
|
123
127
|
const [a, b] = dc.pinIds
|
|
124
128
|
userNetIdByPinId[a] = dc.netId
|
|
125
129
|
userNetIdByPinId[b] = dc.netId
|
|
126
130
|
}
|
|
131
|
+
const netLabelText = dc.netLabelText?.trim()
|
|
132
|
+
if (netLabelText) {
|
|
133
|
+
const [a, b] = dc.pinIds
|
|
134
|
+
netLabelTextByPinId[a] = netLabelText
|
|
135
|
+
netLabelTextByPinId[b] = netLabelText
|
|
136
|
+
}
|
|
127
137
|
}
|
|
128
138
|
for (const nc of this.inputProblem.netConnections) {
|
|
129
139
|
for (const pid of nc.pinIds) {
|
|
130
140
|
userNetIdByPinId[pid] = nc.netId
|
|
141
|
+
const netLabelText = nc.netLabelText?.trim()
|
|
142
|
+
if (netLabelText) netLabelTextByPinId[pid] = netLabelText
|
|
131
143
|
}
|
|
132
144
|
}
|
|
133
145
|
|
|
@@ -237,6 +249,9 @@ export class NetLabelPlacementSolver extends BaseSolver {
|
|
|
237
249
|
const group = {
|
|
238
250
|
globalConnNetId,
|
|
239
251
|
netId: userNetId,
|
|
252
|
+
netLabelText: [...component]
|
|
253
|
+
.map((pinId) => netLabelTextByPinId[pinId])
|
|
254
|
+
.find((text): text is string => Boolean(text)),
|
|
240
255
|
overlappingTraces: rep,
|
|
241
256
|
mspConnectionPairIds,
|
|
242
257
|
}
|
|
@@ -249,6 +264,7 @@ export class NetLabelPlacementSolver extends BaseSolver {
|
|
|
249
264
|
groups.push({
|
|
250
265
|
globalConnNetId,
|
|
251
266
|
netId: userNetId,
|
|
267
|
+
netLabelText: netLabelTextByPinId[p],
|
|
252
268
|
portOnlyPinId: p,
|
|
253
269
|
})
|
|
254
270
|
}
|
|
@@ -354,6 +354,7 @@ export class SingleNetLabelPlacementSolver extends BaseSolver {
|
|
|
354
354
|
this.overlappingSameNetTraceGroup.globalConnNetId,
|
|
355
355
|
dcConnNetId: curr.dcConnNetId,
|
|
356
356
|
netId: this.overlappingSameNetTraceGroup.netId,
|
|
357
|
+
netLabelText: this.overlappingSameNetTraceGroup.netLabelText,
|
|
357
358
|
mspConnectionPairIds: [curr.mspPairId],
|
|
358
359
|
pinIds: [curr.pins[0].pinId, curr.pins[1].pinId],
|
|
359
360
|
orientation,
|
|
@@ -374,6 +375,7 @@ export class SingleNetLabelPlacementSolver extends BaseSolver {
|
|
|
374
375
|
globalConnNetId: this.overlappingSameNetTraceGroup.globalConnNetId,
|
|
375
376
|
dcConnNetId: bestCandidate.dcConnNetId,
|
|
376
377
|
netId: this.overlappingSameNetTraceGroup.netId,
|
|
378
|
+
netLabelText: this.overlappingSameNetTraceGroup.netLabelText,
|
|
377
379
|
mspConnectionPairIds: [bestCandidate.mspPairId],
|
|
378
380
|
pinIds: bestCandidate.pinIds,
|
|
379
381
|
orientation: bestCandidate.orientation,
|
package/lib/solvers/NetLabelPlacementSolver/SingleNetLabelPlacementSolver/solvePortOnlyPin.ts
CHANGED
|
@@ -195,6 +195,7 @@ export function solveNetLabelPlacementForPortOnlyPin(params: {
|
|
|
195
195
|
globalConnNetId: overlappingSameNetTraceGroup.globalConnNetId,
|
|
196
196
|
dcConnNetId: undefined,
|
|
197
197
|
netId: overlappingSameNetTraceGroup.netId,
|
|
198
|
+
netLabelText: overlappingSameNetTraceGroup.netLabelText,
|
|
198
199
|
mspConnectionPairIds: [],
|
|
199
200
|
pinIds: [pinId],
|
|
200
201
|
orientation,
|
|
@@ -230,6 +231,7 @@ export function solveNetLabelPlacementForPortOnlyPin(params: {
|
|
|
230
231
|
globalConnNetId: overlappingSameNetTraceGroup.globalConnNetId,
|
|
231
232
|
dcConnNetId: undefined,
|
|
232
233
|
netId: overlappingSameNetTraceGroup.netId,
|
|
234
|
+
netLabelText: overlappingSameNetTraceGroup.netLabelText,
|
|
233
235
|
mspConnectionPairIds: [],
|
|
234
236
|
pinIds: [pinId],
|
|
235
237
|
orientation: fallbackOrientation,
|
|
@@ -24,6 +24,15 @@ export interface TextBoxes {
|
|
|
24
24
|
|
|
25
25
|
export interface InputChip {
|
|
26
26
|
chipId: ChipId
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Exact directional/oriented schematic-symbol name when the caller has it.
|
|
30
|
+
* `center`, `width`, and `height` describe the solver obstacle and may be
|
|
31
|
+
* expanded to include reference/value or manufacturer-part-number text, so
|
|
32
|
+
* renderers should use this symbol's geometry for the component body.
|
|
33
|
+
*/
|
|
34
|
+
symbolName?: string
|
|
35
|
+
|
|
27
36
|
center: { x: number; y: number }
|
|
28
37
|
width: number
|
|
29
38
|
height: number
|
|
@@ -33,6 +42,14 @@ export interface InputChip {
|
|
|
33
42
|
export interface InputDirectConnection {
|
|
34
43
|
pinIds: [PinId, PinId]
|
|
35
44
|
netId?: string
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* User-facing text to render for this net label. `netId` remains the stable
|
|
48
|
+
* connectivity identifier and may be an internal id. When this is omitted
|
|
49
|
+
* but a label width is provided, renderers should use a width-preserving
|
|
50
|
+
* placeholder instead of exposing `netId` as label text.
|
|
51
|
+
*/
|
|
52
|
+
netLabelText?: string
|
|
36
53
|
netLabelWidth?: number
|
|
37
54
|
|
|
38
55
|
/**
|
|
@@ -58,7 +75,8 @@ export interface InputDirectConnection {
|
|
|
58
75
|
|
|
59
76
|
/**
|
|
60
77
|
* Extent of the inline net label along the trace. Falls back to
|
|
61
|
-
* `netLabelWidth`, then to an estimate from
|
|
78
|
+
* `netLabelWidth`, then to an estimate from `netLabelText` (or `netId` for
|
|
79
|
+
* backwards compatibility).
|
|
62
80
|
*/
|
|
63
81
|
inlineNetLabelWidth?: number
|
|
64
82
|
|
|
@@ -72,6 +90,14 @@ export interface InputDirectConnection {
|
|
|
72
90
|
export interface InputNetConnection {
|
|
73
91
|
netId: string
|
|
74
92
|
pinIds: Array<PinId>
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* User-facing text to render for this net label. `netId` remains the stable
|
|
96
|
+
* connectivity identifier and may be an internal id. When this is omitted
|
|
97
|
+
* but a label width is provided, renderers should use a width-preserving
|
|
98
|
+
* placeholder instead of exposing `netId` as label text.
|
|
99
|
+
*/
|
|
100
|
+
netLabelText?: string
|
|
75
101
|
netLabelWidth?: number
|
|
76
102
|
fallbackNetLabelWidth?: number
|
|
77
103
|
netLabelHeight?: number
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"url": "https://github.com/tscircuit/schematic-trace-solver.git"
|
|
6
6
|
},
|
|
7
7
|
"main": "dist/index.js",
|
|
8
|
-
"version": "0.0.
|
|
8
|
+
"version": "0.0.150",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"start": "cosmos",
|
|
@@ -17,10 +17,15 @@
|
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@biomejs/biome": "^2.2.2",
|
|
19
19
|
"@react-hook/resize-observer": "^2.0.2",
|
|
20
|
+
"@tscircuit/alphabet": "^0.0.26",
|
|
21
|
+
"@tscircuit/circuit-json-util": "^0.0.111",
|
|
20
22
|
"@tscircuit/math-utils": "^0.0.36",
|
|
21
23
|
"@types/bun": "^1.2.21",
|
|
22
24
|
"bun-match-svg": "^0.0.13",
|
|
23
25
|
"calculate-elbow": "^0.0.12",
|
|
26
|
+
"circuit-json": "^0.0.475",
|
|
27
|
+
"circuit-json-to-connectivity-map": "^0.0.29",
|
|
28
|
+
"circuit-to-svg": "^0.0.407",
|
|
24
29
|
"connectivity-map": "^1.0.0",
|
|
25
30
|
"flatbush": "^4.5.0",
|
|
26
31
|
"graphics-debug": "^0.0.98",
|
|
@@ -28,6 +33,8 @@
|
|
|
28
33
|
"react-cosmos": "^7.0.0",
|
|
29
34
|
"react-cosmos-plugin-vite": "^7.0.0",
|
|
30
35
|
"react-dom": "^19.1.1",
|
|
36
|
+
"schematic-symbols": "^0.0.241",
|
|
37
|
+
"stack-svgs": "^0.0.1",
|
|
31
38
|
"tsup": "^8.5.0",
|
|
32
39
|
"vite": "^7.1.3"
|
|
33
40
|
},
|