rushabhcodes/tt
This code models a 10mm by 10mm PCB with a 1kΩ resistor and a 1000pF capacitor connected via a trace.
Usage: To import and use the package "@tsci/rushabhcodes.tt" in a project: 1. Import the package: ```tsx import CircuitDesign from "@tsci/rushabhcodes.tt" ``` 2. Use the component in a React component or directly: ```tsx function App() { return <CircuitDesign /> } ``` The example demonstrates a basic circuit with a 1k resistor and a 1000pF capacitor connected by a trace.
- Version
- 0.0.1
- License
- unset
- Stars
- 0
dist/schematic.svg
PCB
Schematic
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="600" style="background-color: rgb(245, 241, 237)" data-real-to-screen-transform="matrix(134.5291479821,0,0,-134.5291479821,600,123.7668161435)" data-software-used-string="@tscircuit/core@0.0.1036"><style>
.boundary { fill: rgb(245, 241, 237); }
.schematic-boundary { fill: none; stroke: #fff; }
.component { fill: none; stroke: rgb(132, 0, 0); }
.chip { fill: rgb(255, 255, 194); stroke: rgb(132, 0, 0); }
.component-pin { fill: none; stroke: rgb(132, 0, 0); }
/* Basic per-trace hover fallback */
.trace:hover {
filter: invert(1);
}
.trace:hover .trace-crossing-outline {
opacity: 0;
}
.trace:hover .trace-junction {
filter: invert(1);
}
/* Net-hover highlighting: when a trace or its overlays are hovered,
invert color for all traces (base + overlays) sharing the same
subcircuit connectivity key. Also hide crossing outline during hover. */
svg:has(:is(g.trace[data-subcircuit-connectivity-map-key="unnamedsubcircuit34_connectivity_net0"], g.trace-overlays[data-subcircuit-connectivity-map-key="unnamedsubcircuit34_connectivity_net0"]):hover) :is(g.trace[data-subcircuit-connectivity-map-key="unnamedsubcircuit34_connectivity_net0"], g.trace-overlays[data-subcircuit-connectivity-map-key="unnamedsubcircuit34_connectivity_net0"]) { filter: invert(1); }
svg:has(:is(g.trace[data-subcircuit-connectivity-map-key="unnamedsubcircuit34_connectivity_net0"], g.trace-overlays[data-subcircuit-connectivity-map-key="unnamedsubcircuit34_connectivity_net0"]):hover) g.trace-overlays[data-subcircuit-connectivity-map-key="unnamedsubcircuit34_connectivity_net0"] .trace-crossing-outline { opacity: 0; }
.text { font-family: sans-serif; fill: rgb(0, 150, 0); }
.pin-number { fill: rgb(169, 0, 0); }
.port-label { fill: rgb(0, 100, 100); }
.component-name { fill: rgb(0, 100, 100); }
</style><rect class="boundary" x="0" y="0" width="1200" height="600"/><g class="trace" data-layer="base" data-circuit-json-type="schematic_trace" data-schematic-trace-id="schematic_trace_0" data-subcircuit-connectivity-map-key="unnamedsubcircuit34_connectivity_net0"><path d="M 647.085201793735 123.7668161435 L 552.914798206265 123.76681614350001" class="trace-invisible-hover-outline" stroke="rgb(0, 150, 0)" fill="none" stroke-width="21.524663677136px" stroke-linecap="round" opacity="0" stroke-linejoin="round"/><path d="M 647.085201793735 123.7668161435 L 552.914798206265 123.76681614350001" stroke="rgb(0, 150, 0)" fill="none" stroke-width="2.690582959642px" stroke-linecap="round" stroke-linejoin="round"/></g><g class="trace-overlays" data-layer="overlay" data-circuit-json-type="schematic_trace" data-schematic-trace-id="schematic_trace_0" data-subcircuit-connectivity-map-key="unnamedsubcircuit34_connectivity_net0"/><g data-circuit-json-type="schematic_component" data-schematic-component-id="schematic_component_0"><rect class="component-overlay" x="647.085201793735" y="106.27802690582698" width="147.98206278031" height="36.32286995516699" fill="transparent"/><path d="M 647.085201793735 123.76681614349998 L 684.7533632287231 123.76681614349998" stroke="rgb(132, 0, 0)" fill="none" stroke-width="2.690582959642px" stroke-linecap="round"/><path d="M 756.053811659236 123.76681614349998 L 795.067264574045 123.76681614349998" stroke="rgb(132, 0, 0)" fill="none" stroke-width="2.690582959642px" stroke-linecap="round"/><path d="M 721.07623318389 106.27802690582698 L 756.053811659236 106.27802690582698 L 756.053811659236 142.60089686099397 L 684.7533632287231 142.60089686099397 L 684.7533632287231 106.27802690582698 L 721.07623318389 106.27802690582698" stroke="rgb(132, 0, 0)" fill="none" stroke-width="2.690582959642px" stroke-linecap="round"/><text x="718.385650224248" y="99.6248408071705" stroke="rgb(245, 241, 237)" stroke-width="2.690582959642px" paint-order="stroke" fill="rgb(15, 15, 15)" font-family="sans-serif" text-anchor="middle" dominant-baseline="ideographic" font-size="24.215246636777998px">R1</text><text x="718.385650224248" y="151.94466591929245" fill="rgb(15, 15, 15)" font-family="sans-serif" text-anchor="middle" dominant-baseline="hanging" font-size="24.215246636777998px">1kΩ</text><circle cx="795.067264574045" cy="123.76681614349998" r="2.690582959642px" stroke-width="2.690582959642px" fill="none" stroke="rgb(132, 0, 0)"/></g><g data-circuit-json-type="schematic_component" data-schematic-component-id="schematic_component_1"><rect class="component-overlay" x="404.932735425955" y="88.78923766815396" width="147.98206278031" height="71.30044843051303" fill="transparent"/><path d="M 552.914798206265 123.76681614349998 L 488.340807174857 123.76681614349998" stroke="rgb(132, 0, 0)" fill="none" stroke-width="2.690582959642px" stroke-linecap="round"/><path d="M 466.816143497721 123.76681614349998 L 404.932735425955 123.76681614349998" stroke="rgb(132, 0, 0)" fill="none" stroke-width="2.690582959642px" stroke-linecap="round"/><path d="M 488.340807174857 88.78923766815396 L 488.340807174857 160.089686098667" stroke="rgb(132, 0, 0)" fill="none" stroke-width="2.690582959642px" stroke-linecap="round"/><path d="M 466.816143497721 88.78923766815396 L 466.816143497721 160.089686098667" stroke="rgb(132, 0, 0)" fill="none" stroke-width="2.690582959642px" stroke-linecap="round"/><text x="477.578475336289" y="69.95515695065997" stroke="rgb(245, 241, 237)" stroke-width="2.690582959642px" paint-order="stroke" fill="rgb(15, 15, 15)" font-family="sans-serif" text-anchor="middle" dominant-baseline="ideographic" font-size="24.215246636777998px">C1</text><text x="478.92376681611" y="182.95964125562398" fill="rgb(15, 15, 15)" font-family="sans-serif" text-anchor="middle" dominant-baseline="hanging" font-size="24.215246636777998px">1000pF</text><circle cx="404.932735425955" cy="123.76681614349998" r="2.690582959642px" stroke-width="2.690582959642px" fill="none" stroke="rgb(132, 0, 0)"/></g><g data-circuit-json-type="schematic_component" data-schematic-component-id="schematic_component_2"><rect class="component chip" x="552.9147982062648" y="395.515695067342" width="53.81165919284001" height="107.62331838568002" stroke-width="2.690582959642px" fill="rgb(255, 255, 194)" stroke="rgb(132, 0, 0)"/><rect class="component-overlay" x="552.9147982062648" y="395.515695067342" width="53.81165919284001" height="107.62331838568002" fill="transparent"/><text x="552.9147982062648" y="520.627802690695" fill="#006464" text-anchor="start" dominant-baseline="middle" font-family="sans-serif" font-size="24.215246636777998px" transform="rotate(0, 552.9147982062648, 520.627802690695)"></text><text x="552.9147982062648" y="378.026905829669" fill="#006464" text-anchor="start" dominant-baseline="middle" font-family="sans-serif" font-size="24.215246636777998px" transform="rotate(0, 552.9147982062648, 378.026905829669)">JP1</text><line class="component-pin" x1="606.7264573991048" y1="476.23318385660195" x2="657.8475336323029" y2="476.23318385660195" stroke-width="2.690582959642px"/><g data-schematic-port-id="source_port_4"><circle class="component-pin" cx="660.5381165919448" cy="476.23318385660195" r="2.690582959642" stroke-width="2.690582959642px"/><rect x="657.8475336323028" y="473.54260089696" width="5.381165919284" height="5.381165919284" opacity="0"/></g><text class="pin-number" x="633.6322869955249" y="473.54260089696004" style="font-family: sans-serif;" fill="rgb(169, 0, 0)" text-anchor="middle" dominant-baseline="auto" font-size="20.179372197315px" transform="">1</text><line class="component-pin" x1="606.7264573991048" y1="449.327354260182" x2="657.8475336323029" y2="449.327354260182" stroke-width="2.690582959642px"/><g data-schematic-port-id="source_port_5"><circle class="component-pin" cx="660.5381165919448" cy="449.327354260182" r="2.690582959642" stroke-width="2.690582959642px"/><rect x="657.8475336323028" y="446.63677130054003" width="5.381165919284" height="5.381165919284" opacity="0"/></g><text class="pin-number" x="633.6322869955249" y="446.63677130054" style="font-family: sans-serif;" fill="rgb(169, 0, 0)" text-anchor="middle" dominant-baseline="auto" font-size="20.179372197315px" transform="">2</text><line class="component-pin" x1="606.7264573991048" y1="422.42152466376194" x2="657.8475336323029" y2="422.42152466376194" stroke-width="2.690582959642px"/><g data-schematic-port-id="source_port_6"><circle class="component-pin" cx="660.5381165919448" cy="422.42152466376194" r="2.690582959642" stroke-width="2.690582959642px"/><rect x="657.8475336323028" y="419.73094170411997" width="5.381165919284" height="5.381165919284" opacity="0"/></g><text class="pin-number" x="633.6322869955249" y="419.7309417041199" style="font-family: sans-serif;" fill="rgb(169, 0, 0)" text-anchor="middle" dominant-baseline="auto" font-size="20.179372197315px" transform="">3</text></g><g class="schematic-port-hover" data-schematic-port-id="source_port_0"><circle cx="647.085201793735" cy="123.7668161435" r="5.381165919284" fill="red" opacity="0"/></g><g class="schematic-port-hover" data-schematic-port-id="source_port_1"><circle cx="795.067264574045" cy="123.7668161435" r="5.381165919284" fill="red" opacity="0"/></g><g class="schematic-port-hover" data-schematic-port-id="source_port_2"><circle cx="552.914798206265" cy="123.76681614350001" r="5.381165919284" fill="red" opacity="0"/></g><g class="schematic-port-hover" data-schematic-port-id="source_port_3"><circle cx="404.932735425955" cy="123.76681614349998" r="5.381165919284" fill="red" opacity="0"/></g><g class="schematic-port-hover" data-schematic-port-id="source_port_4"><circle cx="660.5381165919448" cy="476.23318385660195" r="5.381165919284" fill="red" opacity="0"/></g><g class="schematic-port-hover" data-schematic-port-id="source_port_5"><circle cx="660.5381165919448" cy="449.327354260182" r="5.381165919284" fill="red" opacity="0"/></g><g class="schematic-port-hover" data-schematic-port-id="source_port_6"><circle cx="660.5381165919448" cy="422.42152466376194" r="5.381165919284" fill="red" opacity="0"/></g></svg>