{"id":23167458,"url":"https://github.com/tscircuit/schematic-autolayout","last_synced_at":"2026-02-13T05:31:54.700Z","repository":{"id":235976209,"uuid":"791649052","full_name":"tscircuit/schematic-autolayout","owner":"tscircuit","description":"autolayout algorithms for tscircuit PCBs and Schematics","archived":false,"fork":false,"pushed_at":"2024-11-11T20:33:14.000Z","size":775,"stargazers_count":2,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-17T20:50:07.622Z","etag":null,"topics":["schematic"],"latest_commit_sha":null,"homepage":"https://autolayout.tscircuit.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tscircuit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-25T05:29:36.000Z","updated_at":"2025-03-30T01:16:05.000Z","dependencies_parsed_at":"2024-05-08T04:26:35.811Z","dependency_job_id":"0241f3c5-1e50-465c-b694-ecf4abccf34a","html_url":"https://github.com/tscircuit/schematic-autolayout","commit_stats":null,"previous_names":["tscircuit/autolayout","tscircuit/schematic-autolayout"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tscircuit/schematic-autolayout","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tscircuit%2Fschematic-autolayout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tscircuit%2Fschematic-autolayout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tscircuit%2Fschematic-autolayout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tscircuit%2Fschematic-autolayout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tscircuit","download_url":"https://codeload.github.com/tscircuit/schematic-autolayout/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tscircuit%2Fschematic-autolayout/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270954734,"owners_count":24674757,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["schematic"],"created_at":"2024-12-18T02:28:34.441Z","updated_at":"2026-02-13T05:31:54.654Z","avatar_url":"https://github.com/tscircuit.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @tscircuit/schematic-autolayout\n\n[Visual Examples](https://autolayout.tscircuit.com)\n\nAlgorithms for automatic layout PCBs and Schematics\n\nFor routing algorithms, see [@tscircuit/routing](https://github.com/tscircuit/routing)\n\n## Usage\n\nTo use this library in your project:\n\n1. Install the package:\n\n```bash\nnpm install @tscircuit/schematic-autolayout\n```\n\n2. Import the necessary functions:\n\n```typescript\nimport { scene, ascendingCentralLrBug1 } from \"@tscircuit/schematic-autolayout\"\n```\n\n3. Create a scene and apply the layout algorithm:\n\n```typescript\nconst myScene = scene()\n  .addCcwBox(\"U1\", { x: 0, y: 0, leftPorts: 3, rightPorts: 3 })\n  .addLrBox(\"R1\", { x: -2, y: 0 })\n  .connect(\"U1.1\", \"R1.right\")\n  .build()\n\nconst layoutedScene = ascendingCentralLrBug1(myScene)\n```\n\n4. Use the layouted scene in your application, for example with a renderer:\n\n```typescript\nimport { PlaygroundScene } from \"@tscircuit/schematic-autolayout\"\n\nfunction MyComponent() {\n  return \u003cPlaygroundScene scene={layoutedScene} /\u003e\n}\n```\n\n## Main Layout\n\nThe main autolayout algorithm we're working on currently focuses on schematic\nlayout and determines which of the following scenarios is the best fit:\n\n1. Row layout (a simple row, e.g. multiple passives)\n2. Column layout (a simple column, e.g. multiple passives)\n3. Central LR bug with ascending columns\n\n![](./docs/2024-04-24-22-36-58.png)\n\n## Post-layout Processing\n\nIn this stage, ports are aligned for the layout is adjusted for general orderly-ness.\n\n1. Port alignment\n2. Central LR Bug Only: Shift columns downward where the adjacent colum has the\n   same bottom net\n\n![](./docs/2024-04-24-22-39-24.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftscircuit%2Fschematic-autolayout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftscircuit%2Fschematic-autolayout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftscircuit%2Fschematic-autolayout/lists"}