Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,11 @@ export interface BreakoutProps extends Omit<
SubcircuitGroupProps,
"subcircuit"
> {
/**
* Autorouter used to escape the components inside the breakout boundary.
* Defaults to the multilayer fanout autorouter.
*/
autorouter?: AutorouterProp;
padding?: Distance;
paddingLeft?: Distance;
paddingRight?: Distance;
Expand Down
6 changes: 6 additions & 0 deletions generated/COMPONENT_TYPES.md
Original file line number Diff line number Diff line change
Expand Up @@ -1257,13 +1257,19 @@ export const boardProps = subcircuitGroupProps
```typescript
export interface BreakoutProps
extends Omit<SubcircuitGroupProps, "subcircuit"> {
autorouter?: AutorouterProp
padding?: Distance
paddingLeft?: Distance
paddingRight?: Distance
paddingTop?: Distance
paddingBottom?: Distance
}
/**
* Autorouter used to escape the components inside the breakout boundary.
* Defaults to the multilayer fanout autorouter.
*/
export const breakoutProps = subcircuitGroupProps.extend({
autorouter: autorouterProp.default("fanout"),
padding: distance.optional(),
paddingLeft: distance.optional(),
paddingRight: distance.optional(),
Expand Down
13 changes: 12 additions & 1 deletion lib/components/breakout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,20 @@ import { distance } from "circuit-json"
import type { Distance } from "lib/common/distance"
import { expectTypesMatch } from "lib/typecheck"
import { z } from "zod"
import { subcircuitGroupProps, type SubcircuitGroupProps } from "./group"
import {
autorouterProp,
subcircuitGroupProps,
type AutorouterProp,
type SubcircuitGroupProps,
} from "./group"

export interface BreakoutProps
extends Omit<SubcircuitGroupProps, "subcircuit"> {
/**
* Autorouter used to escape the components inside the breakout boundary.
* Defaults to the multilayer fanout autorouter.
*/
autorouter?: AutorouterProp
padding?: Distance
paddingLeft?: Distance
paddingRight?: Distance
Expand All @@ -14,6 +24,7 @@ export interface BreakoutProps
}

export const breakoutProps = subcircuitGroupProps.extend({
autorouter: autorouterProp.default("fanout"),
padding: distance.optional(),
paddingLeft: distance.optional(),
paddingRight: distance.optional(),
Expand Down
7 changes: 7 additions & 0 deletions tests/breakout.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ test("should parse breakout props with padding", () => {
expect(parsed.paddingLeft).toBe(2)
})

test("breakout and fanout elements default to the fanout autorouter", () => {
expect(breakoutProps.parse({}).autorouter).toBe("fanout")
expect(
breakoutProps.parse({ autorouter: "single_layer_fanout" }).autorouter,
).toBe("single_layer_fanout")
})
Comment on lines +20 to +25

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A *.test.ts file may have AT MOST one test(...) call. After this modification, breakout.test.ts contains at least two test(...) blocks (the pre-existing ones plus the newly added "breakout and fanout elements default to the fanout autorouter" test). The file should be split into multiple numbered files, e.g. breakout1.test.ts, breakout2.test.ts, breakout3.test.ts, with each file containing exactly one test(...).

Spotted by Graphite (based on custom rule: Custom rule)

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.


test("should parse breakout point props", () => {
const raw: BreakoutPointProps = {
pcbX: 5,
Expand Down
Loading