Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Layout builder pattern #107

Open
seveibar opened this issue May 3, 2024 · 0 comments
Open

Layout builder pattern #107

seveibar opened this issue May 3, 2024 · 0 comments
Labels

Comments

@seveibar
Copy link
Contributor

seveibar commented May 3, 2024

The layout builder pattern works like this:

import { layout } from "tscircuit"

export const MyCircuit = () => (
  <group layout={layout().auto_layout_schematic({ padding: 2 }).manual_pcb_positions({ ... })}>
   {/* ... */}
  </group>
)

It will take too long to rebuild css for circuits, so this is a way of making tscircuit layout extensive.

People can create their out layout() builders that match the api, or register middleware with layout().load(myLayoutFunc)

@seveibar seveibar added the api label May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant