@tscircuit/core 0.0.826 → 0.0.827

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/dist/index.d.ts CHANGED
@@ -237,6 +237,7 @@ declare class RootCircuit {
237
237
  projectUrl?: string;
238
238
  });
239
239
  add(componentOrElm: PrimitiveComponent | ReactElement): void;
240
+ setPlatform(platform: Partial<PlatformConfig>): void;
240
241
  /**
241
242
  * Get the main board for this Circuit.
242
243
  */
package/dist/index.js CHANGED
@@ -12558,9 +12558,21 @@ ${spiceString}`);
12558
12558
  debug10(`Failed to convert circuit JSON to SPICE: ${error}`);
12559
12559
  return;
12560
12560
  }
12561
- for (const [engineName, spiceEngine] of Object.entries(spiceEngineMap)) {
12562
- debug10(`Queueing simulation for spice engine: ${engineName}`);
12563
- group._queueAsyncEffect(`spice-simulation-${engineName}`, async () => {
12561
+ for (const analogSim of analogSims) {
12562
+ const engineName = analogSim._parsedProps.spiceEngine ?? "spicey";
12563
+ const spiceEngine = spiceEngineMap[engineName];
12564
+ if (!spiceEngine) {
12565
+ throw new Error(
12566
+ `SPICE engine "${engineName}" not found in platform config. Available engines: ${JSON.stringify(
12567
+ Object.keys(spiceEngineMap).filter((k) => k !== "spicey")
12568
+ )}`
12569
+ );
12570
+ }
12571
+ const effectId = `spice-simulation-${engineName}-${analogSim.source_component_id}`;
12572
+ debug10(
12573
+ `Queueing simulation for spice engine: ${engineName} (id: ${effectId})`
12574
+ );
12575
+ group._queueAsyncEffect(effectId, async () => {
12564
12576
  try {
12565
12577
  debug10(`Running simulation with engine: ${engineName}`);
12566
12578
  const result = await spiceEngine.simulate(spiceString);
@@ -17310,7 +17322,7 @@ import { identity as identity6 } from "transformation-matrix";
17310
17322
  var package_default = {
17311
17323
  name: "@tscircuit/core",
17312
17324
  type: "module",
17313
- version: "0.0.825",
17325
+ version: "0.0.826",
17314
17326
  types: "dist/index.d.ts",
17315
17327
  main: "dist/index.js",
17316
17328
  module: "dist/index.js",
@@ -17351,6 +17363,7 @@ var package_default = {
17351
17363
  "@tscircuit/matchpack": "^0.0.16",
17352
17364
  "@tscircuit/math-utils": "^0.0.29",
17353
17365
  "@tscircuit/miniflex": "^0.0.4",
17366
+ "@tscircuit/ngspice-spice-engine": "^0.0.2",
17354
17367
  "@tscircuit/props": "0.0.381",
17355
17368
  "@tscircuit/schematic-autolayout": "^0.0.6",
17356
17369
  "@tscircuit/schematic-match-adapt": "^0.0.16",
@@ -17369,11 +17382,12 @@ var package_default = {
17369
17382
  "circuit-json-to-connectivity-map": "^0.0.22",
17370
17383
  "circuit-json-to-gltf": "^0.0.31",
17371
17384
  "circuit-json-to-simple-3d": "^0.0.9",
17372
- "circuit-json-to-spice": "^0.0.15",
17385
+ "circuit-json-to-spice": "^0.0.16",
17373
17386
  "circuit-to-svg": "^0.0.253",
17374
17387
  concurrently: "^9.1.2",
17375
17388
  "connectivity-map": "^1.0.0",
17376
17389
  debug: "^4.3.6",
17390
+ "eecircuit-engine": "^1.5.6",
17377
17391
  flatbush: "^4.5.0",
17378
17392
  "graphics-debug": "^0.0.60",
17379
17393
  howfat: "^0.3.8",
@@ -17467,6 +17481,12 @@ var RootCircuit = class {
17467
17481
  }
17468
17482
  this.children.push(component);
17469
17483
  }
17484
+ setPlatform(platform) {
17485
+ this.platform = {
17486
+ ...this.platform,
17487
+ ...platform
17488
+ };
17489
+ }
17470
17490
  /**
17471
17491
  * Get the main board for this Circuit.
17472
17492
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.826",
4
+ "version": "0.0.827",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -42,6 +42,7 @@
42
42
  "@tscircuit/matchpack": "^0.0.16",
43
43
  "@tscircuit/math-utils": "^0.0.29",
44
44
  "@tscircuit/miniflex": "^0.0.4",
45
+ "@tscircuit/ngspice-spice-engine": "^0.0.2",
45
46
  "@tscircuit/props": "0.0.381",
46
47
  "@tscircuit/schematic-autolayout": "^0.0.6",
47
48
  "@tscircuit/schematic-match-adapt": "^0.0.16",
@@ -60,11 +61,12 @@
60
61
  "circuit-json-to-connectivity-map": "^0.0.22",
61
62
  "circuit-json-to-gltf": "^0.0.31",
62
63
  "circuit-json-to-simple-3d": "^0.0.9",
63
- "circuit-json-to-spice": "^0.0.15",
64
+ "circuit-json-to-spice": "^0.0.16",
64
65
  "circuit-to-svg": "^0.0.253",
65
66
  "concurrently": "^9.1.2",
66
67
  "connectivity-map": "^1.0.0",
67
68
  "debug": "^4.3.6",
69
+ "eecircuit-engine": "^1.5.6",
68
70
  "flatbush": "^4.5.0",
69
71
  "graphics-debug": "^0.0.60",
70
72
  "howfat": "^0.3.8",