@tscircuit/core 0.0.868 → 0.0.869
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 +64 -60
- package/dist/index.js +109 -9
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
|
@@ -16649,19 +16649,9 @@ declare const voltageSourceProps: z.ZodObject<{
|
|
|
16649
16649
|
schY?: number | undefined;
|
|
16650
16650
|
pcbX?: number | undefined;
|
|
16651
16651
|
pcbY?: number | undefined;
|
|
16652
|
-
voltage?: number | undefined;
|
|
16653
|
-
frequency?: number | undefined;
|
|
16654
|
-
pcbStyle?: {
|
|
16655
|
-
silkscreenFontSize?: number | undefined;
|
|
16656
|
-
silkscreenTextPosition?: "centered" | "outside" | "none" | {
|
|
16657
|
-
offsetX: number;
|
|
16658
|
-
offsetY: number;
|
|
16659
|
-
} | undefined;
|
|
16660
|
-
silkscreenTextVisibility?: "hidden" | "visible" | "inherit" | undefined;
|
|
16661
|
-
} | undefined;
|
|
16662
|
-
pcbPositionAnchor?: string | undefined;
|
|
16663
16652
|
pcbOffsetX?: number | undefined;
|
|
16664
16653
|
pcbOffsetY?: number | undefined;
|
|
16654
|
+
pcbPositionAnchor?: string | undefined;
|
|
16665
16655
|
pcbPositionMode?: "auto" | "relative_to_group_anchor" | "relative_to_board_anchor" | "relative_to_component_anchor" | undefined;
|
|
16666
16656
|
pcbMarginTop?: number | undefined;
|
|
16667
16657
|
pcbMarginRight?: number | undefined;
|
|
@@ -16669,6 +16659,14 @@ declare const voltageSourceProps: z.ZodObject<{
|
|
|
16669
16659
|
pcbMarginLeft?: number | undefined;
|
|
16670
16660
|
pcbMarginX?: number | undefined;
|
|
16671
16661
|
pcbMarginY?: number | undefined;
|
|
16662
|
+
pcbStyle?: {
|
|
16663
|
+
silkscreenFontSize?: number | undefined;
|
|
16664
|
+
silkscreenTextPosition?: "centered" | "outside" | "none" | {
|
|
16665
|
+
offsetX: number;
|
|
16666
|
+
offsetY: number;
|
|
16667
|
+
} | undefined;
|
|
16668
|
+
silkscreenTextVisibility?: "hidden" | "visible" | "inherit" | undefined;
|
|
16669
|
+
} | undefined;
|
|
16672
16670
|
schMarginTop?: number | undefined;
|
|
16673
16671
|
schMarginRight?: number | undefined;
|
|
16674
16672
|
schMarginBottom?: number | undefined;
|
|
@@ -16678,6 +16676,7 @@ declare const voltageSourceProps: z.ZodObject<{
|
|
|
16678
16676
|
schRotation?: number | undefined;
|
|
16679
16677
|
schRelative?: boolean | undefined;
|
|
16680
16678
|
pcbRelative?: boolean | undefined;
|
|
16679
|
+
supplierPartNumbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
|
|
16681
16680
|
cadModel?: string | react.ReactElement<any, string | react.JSXElementConstructor<any>> | {
|
|
16682
16681
|
stlUrl: string;
|
|
16683
16682
|
rotationOffset?: number | {
|
|
@@ -16813,6 +16812,9 @@ declare const voltageSourceProps: z.ZodObject<{
|
|
|
16813
16812
|
modelUnitToMmScale?: number | undefined;
|
|
16814
16813
|
zOffsetFromSurface?: number | undefined;
|
|
16815
16814
|
} | null | undefined;
|
|
16815
|
+
symbolName?: string | undefined;
|
|
16816
|
+
doNotPlace?: boolean | undefined;
|
|
16817
|
+
obstructsWithinBounds?: boolean | undefined;
|
|
16816
16818
|
pinAttributes?: Record<string, {
|
|
16817
16819
|
providesPower?: boolean | undefined;
|
|
16818
16820
|
requiresPower?: boolean | undefined;
|
|
@@ -16824,13 +16826,11 @@ declare const voltageSourceProps: z.ZodObject<{
|
|
|
16824
16826
|
includeInBoardPinout?: boolean | undefined;
|
|
16825
16827
|
highlightColor?: string | undefined;
|
|
16826
16828
|
}> | undefined;
|
|
16829
|
+
voltage?: number | undefined;
|
|
16830
|
+
frequency?: number | undefined;
|
|
16827
16831
|
peakToPeakVoltage?: number | undefined;
|
|
16828
16832
|
waveShape?: "square" | "sinewave" | "triangle" | "sawtooth" | undefined;
|
|
16829
16833
|
dutyCycle?: number | undefined;
|
|
16830
|
-
supplierPartNumbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
|
|
16831
|
-
symbolName?: string | undefined;
|
|
16832
|
-
doNotPlace?: boolean | undefined;
|
|
16833
|
-
obstructsWithinBounds?: boolean | undefined;
|
|
16834
16834
|
}, {
|
|
16835
16835
|
name: string;
|
|
16836
16836
|
symbol?: _tscircuit_props.SymbolProp | undefined;
|
|
@@ -16847,19 +16847,9 @@ declare const voltageSourceProps: z.ZodObject<{
|
|
|
16847
16847
|
schY?: string | number | undefined;
|
|
16848
16848
|
pcbX?: string | number | undefined;
|
|
16849
16849
|
pcbY?: string | number | undefined;
|
|
16850
|
-
voltage?: string | number | undefined;
|
|
16851
|
-
frequency?: string | number | undefined;
|
|
16852
|
-
pcbStyle?: {
|
|
16853
|
-
silkscreenFontSize?: string | number | undefined;
|
|
16854
|
-
silkscreenTextPosition?: "centered" | "outside" | "none" | {
|
|
16855
|
-
offsetX: number;
|
|
16856
|
-
offsetY: number;
|
|
16857
|
-
} | undefined;
|
|
16858
|
-
silkscreenTextVisibility?: "hidden" | "visible" | "inherit" | undefined;
|
|
16859
|
-
} | undefined;
|
|
16860
|
-
pcbPositionAnchor?: string | undefined;
|
|
16861
16850
|
pcbOffsetX?: string | number | undefined;
|
|
16862
16851
|
pcbOffsetY?: string | number | undefined;
|
|
16852
|
+
pcbPositionAnchor?: string | undefined;
|
|
16863
16853
|
pcbPositionMode?: "auto" | "relative_to_group_anchor" | "relative_to_board_anchor" | "relative_to_component_anchor" | undefined;
|
|
16864
16854
|
pcbMarginTop?: string | number | undefined;
|
|
16865
16855
|
pcbMarginRight?: string | number | undefined;
|
|
@@ -16867,6 +16857,14 @@ declare const voltageSourceProps: z.ZodObject<{
|
|
|
16867
16857
|
pcbMarginLeft?: string | number | undefined;
|
|
16868
16858
|
pcbMarginX?: string | number | undefined;
|
|
16869
16859
|
pcbMarginY?: string | number | undefined;
|
|
16860
|
+
pcbStyle?: {
|
|
16861
|
+
silkscreenFontSize?: string | number | undefined;
|
|
16862
|
+
silkscreenTextPosition?: "centered" | "outside" | "none" | {
|
|
16863
|
+
offsetX: number;
|
|
16864
|
+
offsetY: number;
|
|
16865
|
+
} | undefined;
|
|
16866
|
+
silkscreenTextVisibility?: "hidden" | "visible" | "inherit" | undefined;
|
|
16867
|
+
} | undefined;
|
|
16870
16868
|
schMarginTop?: string | number | undefined;
|
|
16871
16869
|
schMarginRight?: string | number | undefined;
|
|
16872
16870
|
schMarginBottom?: string | number | undefined;
|
|
@@ -16876,6 +16874,7 @@ declare const voltageSourceProps: z.ZodObject<{
|
|
|
16876
16874
|
schRotation?: string | number | undefined;
|
|
16877
16875
|
schRelative?: boolean | undefined;
|
|
16878
16876
|
pcbRelative?: boolean | undefined;
|
|
16877
|
+
supplierPartNumbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
|
|
16879
16878
|
cadModel?: string | react.ReactElement<any, string | react.JSXElementConstructor<any>> | {
|
|
16880
16879
|
stlUrl: string;
|
|
16881
16880
|
rotationOffset?: number | {
|
|
@@ -17011,6 +17010,9 @@ declare const voltageSourceProps: z.ZodObject<{
|
|
|
17011
17010
|
modelUnitToMmScale?: string | number | undefined;
|
|
17012
17011
|
zOffsetFromSurface?: string | number | undefined;
|
|
17013
17012
|
} | null | undefined;
|
|
17013
|
+
symbolName?: string | undefined;
|
|
17014
|
+
doNotPlace?: boolean | undefined;
|
|
17015
|
+
obstructsWithinBounds?: boolean | undefined;
|
|
17014
17016
|
pinAttributes?: Record<string, {
|
|
17015
17017
|
providesPower?: boolean | undefined;
|
|
17016
17018
|
requiresPower?: boolean | undefined;
|
|
@@ -17022,13 +17024,11 @@ declare const voltageSourceProps: z.ZodObject<{
|
|
|
17022
17024
|
includeInBoardPinout?: boolean | undefined;
|
|
17023
17025
|
highlightColor?: string | undefined;
|
|
17024
17026
|
}> | undefined;
|
|
17027
|
+
voltage?: string | number | undefined;
|
|
17028
|
+
frequency?: string | number | undefined;
|
|
17025
17029
|
peakToPeakVoltage?: string | number | undefined;
|
|
17026
17030
|
waveShape?: "square" | "sinewave" | "triangle" | "sawtooth" | undefined;
|
|
17027
17031
|
dutyCycle?: number | undefined;
|
|
17028
|
-
supplierPartNumbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
|
|
17029
|
-
symbolName?: string | undefined;
|
|
17030
|
-
doNotPlace?: boolean | undefined;
|
|
17031
|
-
obstructsWithinBounds?: boolean | undefined;
|
|
17032
17032
|
}>;
|
|
17033
17033
|
declare class VoltageSource extends NormalComponent<typeof voltageSourceProps, "terminal1" | "terminal2"> {
|
|
17034
17034
|
get config(): {
|
|
@@ -17738,19 +17738,9 @@ declare class VoltageSource extends NormalComponent<typeof voltageSourceProps, "
|
|
|
17738
17738
|
schY?: number | undefined;
|
|
17739
17739
|
pcbX?: number | undefined;
|
|
17740
17740
|
pcbY?: number | undefined;
|
|
17741
|
-
voltage?: number | undefined;
|
|
17742
|
-
frequency?: number | undefined;
|
|
17743
|
-
pcbStyle?: {
|
|
17744
|
-
silkscreenFontSize?: number | undefined;
|
|
17745
|
-
silkscreenTextPosition?: "centered" | "outside" | "none" | {
|
|
17746
|
-
offsetX: number;
|
|
17747
|
-
offsetY: number;
|
|
17748
|
-
} | undefined;
|
|
17749
|
-
silkscreenTextVisibility?: "hidden" | "visible" | "inherit" | undefined;
|
|
17750
|
-
} | undefined;
|
|
17751
|
-
pcbPositionAnchor?: string | undefined;
|
|
17752
17741
|
pcbOffsetX?: number | undefined;
|
|
17753
17742
|
pcbOffsetY?: number | undefined;
|
|
17743
|
+
pcbPositionAnchor?: string | undefined;
|
|
17754
17744
|
pcbPositionMode?: "auto" | "relative_to_group_anchor" | "relative_to_board_anchor" | "relative_to_component_anchor" | undefined;
|
|
17755
17745
|
pcbMarginTop?: number | undefined;
|
|
17756
17746
|
pcbMarginRight?: number | undefined;
|
|
@@ -17758,6 +17748,14 @@ declare class VoltageSource extends NormalComponent<typeof voltageSourceProps, "
|
|
|
17758
17748
|
pcbMarginLeft?: number | undefined;
|
|
17759
17749
|
pcbMarginX?: number | undefined;
|
|
17760
17750
|
pcbMarginY?: number | undefined;
|
|
17751
|
+
pcbStyle?: {
|
|
17752
|
+
silkscreenFontSize?: number | undefined;
|
|
17753
|
+
silkscreenTextPosition?: "centered" | "outside" | "none" | {
|
|
17754
|
+
offsetX: number;
|
|
17755
|
+
offsetY: number;
|
|
17756
|
+
} | undefined;
|
|
17757
|
+
silkscreenTextVisibility?: "hidden" | "visible" | "inherit" | undefined;
|
|
17758
|
+
} | undefined;
|
|
17761
17759
|
schMarginTop?: number | undefined;
|
|
17762
17760
|
schMarginRight?: number | undefined;
|
|
17763
17761
|
schMarginBottom?: number | undefined;
|
|
@@ -17767,6 +17765,7 @@ declare class VoltageSource extends NormalComponent<typeof voltageSourceProps, "
|
|
|
17767
17765
|
schRotation?: number | undefined;
|
|
17768
17766
|
schRelative?: boolean | undefined;
|
|
17769
17767
|
pcbRelative?: boolean | undefined;
|
|
17768
|
+
supplierPartNumbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
|
|
17770
17769
|
cadModel?: string | react.ReactElement<any, string | react.JSXElementConstructor<any>> | {
|
|
17771
17770
|
stlUrl: string;
|
|
17772
17771
|
rotationOffset?: number | {
|
|
@@ -17902,6 +17901,9 @@ declare class VoltageSource extends NormalComponent<typeof voltageSourceProps, "
|
|
|
17902
17901
|
modelUnitToMmScale?: number | undefined;
|
|
17903
17902
|
zOffsetFromSurface?: number | undefined;
|
|
17904
17903
|
} | null | undefined;
|
|
17904
|
+
symbolName?: string | undefined;
|
|
17905
|
+
doNotPlace?: boolean | undefined;
|
|
17906
|
+
obstructsWithinBounds?: boolean | undefined;
|
|
17905
17907
|
pinAttributes?: Record<string, {
|
|
17906
17908
|
providesPower?: boolean | undefined;
|
|
17907
17909
|
requiresPower?: boolean | undefined;
|
|
@@ -17913,13 +17915,11 @@ declare class VoltageSource extends NormalComponent<typeof voltageSourceProps, "
|
|
|
17913
17915
|
includeInBoardPinout?: boolean | undefined;
|
|
17914
17916
|
highlightColor?: string | undefined;
|
|
17915
17917
|
}> | undefined;
|
|
17918
|
+
voltage?: number | undefined;
|
|
17919
|
+
frequency?: number | undefined;
|
|
17916
17920
|
peakToPeakVoltage?: number | undefined;
|
|
17917
17921
|
waveShape?: "square" | "sinewave" | "triangle" | "sawtooth" | undefined;
|
|
17918
17922
|
dutyCycle?: number | undefined;
|
|
17919
|
-
supplierPartNumbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
|
|
17920
|
-
symbolName?: string | undefined;
|
|
17921
|
-
doNotPlace?: boolean | undefined;
|
|
17922
|
-
obstructsWithinBounds?: boolean | undefined;
|
|
17923
17923
|
}, {
|
|
17924
17924
|
name: string;
|
|
17925
17925
|
symbol?: _tscircuit_props.SymbolProp | undefined;
|
|
@@ -17936,19 +17936,9 @@ declare class VoltageSource extends NormalComponent<typeof voltageSourceProps, "
|
|
|
17936
17936
|
schY?: string | number | undefined;
|
|
17937
17937
|
pcbX?: string | number | undefined;
|
|
17938
17938
|
pcbY?: string | number | undefined;
|
|
17939
|
-
voltage?: string | number | undefined;
|
|
17940
|
-
frequency?: string | number | undefined;
|
|
17941
|
-
pcbStyle?: {
|
|
17942
|
-
silkscreenFontSize?: string | number | undefined;
|
|
17943
|
-
silkscreenTextPosition?: "centered" | "outside" | "none" | {
|
|
17944
|
-
offsetX: number;
|
|
17945
|
-
offsetY: number;
|
|
17946
|
-
} | undefined;
|
|
17947
|
-
silkscreenTextVisibility?: "hidden" | "visible" | "inherit" | undefined;
|
|
17948
|
-
} | undefined;
|
|
17949
|
-
pcbPositionAnchor?: string | undefined;
|
|
17950
17939
|
pcbOffsetX?: string | number | undefined;
|
|
17951
17940
|
pcbOffsetY?: string | number | undefined;
|
|
17941
|
+
pcbPositionAnchor?: string | undefined;
|
|
17952
17942
|
pcbPositionMode?: "auto" | "relative_to_group_anchor" | "relative_to_board_anchor" | "relative_to_component_anchor" | undefined;
|
|
17953
17943
|
pcbMarginTop?: string | number | undefined;
|
|
17954
17944
|
pcbMarginRight?: string | number | undefined;
|
|
@@ -17956,6 +17946,14 @@ declare class VoltageSource extends NormalComponent<typeof voltageSourceProps, "
|
|
|
17956
17946
|
pcbMarginLeft?: string | number | undefined;
|
|
17957
17947
|
pcbMarginX?: string | number | undefined;
|
|
17958
17948
|
pcbMarginY?: string | number | undefined;
|
|
17949
|
+
pcbStyle?: {
|
|
17950
|
+
silkscreenFontSize?: string | number | undefined;
|
|
17951
|
+
silkscreenTextPosition?: "centered" | "outside" | "none" | {
|
|
17952
|
+
offsetX: number;
|
|
17953
|
+
offsetY: number;
|
|
17954
|
+
} | undefined;
|
|
17955
|
+
silkscreenTextVisibility?: "hidden" | "visible" | "inherit" | undefined;
|
|
17956
|
+
} | undefined;
|
|
17959
17957
|
schMarginTop?: string | number | undefined;
|
|
17960
17958
|
schMarginRight?: string | number | undefined;
|
|
17961
17959
|
schMarginBottom?: string | number | undefined;
|
|
@@ -17965,6 +17963,7 @@ declare class VoltageSource extends NormalComponent<typeof voltageSourceProps, "
|
|
|
17965
17963
|
schRotation?: string | number | undefined;
|
|
17966
17964
|
schRelative?: boolean | undefined;
|
|
17967
17965
|
pcbRelative?: boolean | undefined;
|
|
17966
|
+
supplierPartNumbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
|
|
17968
17967
|
cadModel?: string | react.ReactElement<any, string | react.JSXElementConstructor<any>> | {
|
|
17969
17968
|
stlUrl: string;
|
|
17970
17969
|
rotationOffset?: number | {
|
|
@@ -18100,6 +18099,9 @@ declare class VoltageSource extends NormalComponent<typeof voltageSourceProps, "
|
|
|
18100
18099
|
modelUnitToMmScale?: string | number | undefined;
|
|
18101
18100
|
zOffsetFromSurface?: string | number | undefined;
|
|
18102
18101
|
} | null | undefined;
|
|
18102
|
+
symbolName?: string | undefined;
|
|
18103
|
+
doNotPlace?: boolean | undefined;
|
|
18104
|
+
obstructsWithinBounds?: boolean | undefined;
|
|
18103
18105
|
pinAttributes?: Record<string, {
|
|
18104
18106
|
providesPower?: boolean | undefined;
|
|
18105
18107
|
requiresPower?: boolean | undefined;
|
|
@@ -18111,13 +18113,11 @@ declare class VoltageSource extends NormalComponent<typeof voltageSourceProps, "
|
|
|
18111
18113
|
includeInBoardPinout?: boolean | undefined;
|
|
18112
18114
|
highlightColor?: string | undefined;
|
|
18113
18115
|
}> | undefined;
|
|
18116
|
+
voltage?: string | number | undefined;
|
|
18117
|
+
frequency?: string | number | undefined;
|
|
18114
18118
|
peakToPeakVoltage?: string | number | undefined;
|
|
18115
18119
|
waveShape?: "square" | "sinewave" | "triangle" | "sawtooth" | undefined;
|
|
18116
18120
|
dutyCycle?: number | undefined;
|
|
18117
|
-
supplierPartNumbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
|
|
18118
|
-
symbolName?: string | undefined;
|
|
18119
|
-
doNotPlace?: boolean | undefined;
|
|
18120
|
-
obstructsWithinBounds?: boolean | undefined;
|
|
18121
18121
|
}>;
|
|
18122
18122
|
sourceFtype: Ftype;
|
|
18123
18123
|
};
|
|
@@ -39158,6 +39158,9 @@ declare class AnalogSimulation extends PrimitiveComponent<typeof analogSimulatio
|
|
|
39158
39158
|
|
|
39159
39159
|
declare class VoltageProbe extends PrimitiveComponent<typeof voltageProbeProps> {
|
|
39160
39160
|
simulation_voltage_probe_id: string | null;
|
|
39161
|
+
schematic_voltage_probe_id: string | null;
|
|
39162
|
+
finalProbeName: string | null;
|
|
39163
|
+
color: string | null;
|
|
39161
39164
|
get config(): {
|
|
39162
39165
|
componentName: string;
|
|
39163
39166
|
zodProps: z.ZodObject<Omit<{
|
|
@@ -40233,6 +40236,7 @@ declare class VoltageProbe extends PrimitiveComponent<typeof voltageProbeProps>
|
|
|
40233
40236
|
}>;
|
|
40234
40237
|
};
|
|
40235
40238
|
doInitialSimulationRender(): void;
|
|
40239
|
+
doInitialSchematicReplaceNetLabelsWithSymbols(): void;
|
|
40236
40240
|
}
|
|
40237
40241
|
|
|
40238
40242
|
declare const useRenderedCircuit: (reactElements: react__default.ReactElement) => {
|
package/dist/index.js
CHANGED
|
@@ -12918,6 +12918,42 @@ var getSpiceyEngine = () => {
|
|
|
12918
12918
|
};
|
|
12919
12919
|
};
|
|
12920
12920
|
|
|
12921
|
+
// lib/utils/simulation/getSimulationColorForId.ts
|
|
12922
|
+
var SIMULATION_COLOR_PALETTE = [
|
|
12923
|
+
"rgb(132, 0, 0)",
|
|
12924
|
+
"rgb(194, 194, 0)",
|
|
12925
|
+
"rgb(194, 0, 194)",
|
|
12926
|
+
"rgb(194, 0, 0)",
|
|
12927
|
+
"rgb(0, 132, 132)",
|
|
12928
|
+
"rgb(0, 132, 0)",
|
|
12929
|
+
"rgb(0, 0, 132)",
|
|
12930
|
+
"rgb(132, 132, 132)",
|
|
12931
|
+
"rgb(132, 0, 132)",
|
|
12932
|
+
"rgb(194, 194, 194)",
|
|
12933
|
+
"rgb(132, 0, 132)",
|
|
12934
|
+
"rgb(132, 0, 0)",
|
|
12935
|
+
"rgb(132, 132, 0)",
|
|
12936
|
+
"rgb(194, 194, 194)",
|
|
12937
|
+
"rgb(0, 0, 132)",
|
|
12938
|
+
"rgb(0, 132, 0)"
|
|
12939
|
+
];
|
|
12940
|
+
var idToColorMap = /* @__PURE__ */ new Map();
|
|
12941
|
+
var colorIndex = 0;
|
|
12942
|
+
function getSimulationColorForId(id) {
|
|
12943
|
+
if (idToColorMap.has(id)) {
|
|
12944
|
+
const color2 = idToColorMap.get(id);
|
|
12945
|
+
return color2;
|
|
12946
|
+
}
|
|
12947
|
+
const color = SIMULATION_COLOR_PALETTE[colorIndex];
|
|
12948
|
+
colorIndex = (colorIndex + 1) % SIMULATION_COLOR_PALETTE.length;
|
|
12949
|
+
idToColorMap.set(id, color);
|
|
12950
|
+
return color;
|
|
12951
|
+
}
|
|
12952
|
+
function resetSimulationColorState() {
|
|
12953
|
+
idToColorMap.clear();
|
|
12954
|
+
colorIndex = 0;
|
|
12955
|
+
}
|
|
12956
|
+
|
|
12921
12957
|
// lib/components/primitive-components/Group/Group_doInitialSimulationSpiceEngineRender.ts
|
|
12922
12958
|
var debug10 = Debug12("tscircuit:core:Group_doInitialSimulationSpiceEngineRender");
|
|
12923
12959
|
function Group_doInitialSimulationSpiceEngineRender(group) {
|
|
@@ -12926,14 +12962,17 @@ function Group_doInitialSimulationSpiceEngineRender(group) {
|
|
|
12926
12962
|
if (!root) return;
|
|
12927
12963
|
const analogSims = group.selectAll("analogsimulation");
|
|
12928
12964
|
if (analogSims.length === 0) return;
|
|
12965
|
+
const voltageProbes = group.selectAll("voltageprobe");
|
|
12966
|
+
resetSimulationColorState();
|
|
12929
12967
|
const spiceEngineMap = { ...root.platform?.spiceEngineMap };
|
|
12930
12968
|
if (!spiceEngineMap.spicey) {
|
|
12931
12969
|
spiceEngineMap.spicey = getSpiceyEngine();
|
|
12932
12970
|
}
|
|
12933
12971
|
const circuitJson = root.db.toArray();
|
|
12934
12972
|
let spiceString;
|
|
12973
|
+
let spiceNetlist;
|
|
12935
12974
|
try {
|
|
12936
|
-
|
|
12975
|
+
spiceNetlist = circuitJsonToSpice(circuitJson);
|
|
12937
12976
|
spiceString = spiceNetlist.toSpiceString();
|
|
12938
12977
|
debug10(`Generated SPICE string:
|
|
12939
12978
|
${spiceString}`);
|
|
@@ -12970,6 +13009,10 @@ ${spiceString}`);
|
|
|
12970
13009
|
for (const element of result.simulationResultCircuitJson) {
|
|
12971
13010
|
if (element.type === "simulation_transient_voltage_graph") {
|
|
12972
13011
|
element.simulation_experiment_id = simulationExperiment.simulation_experiment_id;
|
|
13012
|
+
const probeMatch = voltageProbes.find(
|
|
13013
|
+
(p) => p.finalProbeName === element.name
|
|
13014
|
+
);
|
|
13015
|
+
if (probeMatch) element.color = probeMatch.color;
|
|
12973
13016
|
}
|
|
12974
13017
|
const elementType = element.type;
|
|
12975
13018
|
if (elementType && root.db[elementType]) {
|
|
@@ -17977,6 +18020,9 @@ import { voltageProbeProps } from "@tscircuit/props";
|
|
|
17977
18020
|
import "zod";
|
|
17978
18021
|
var VoltageProbe = class extends PrimitiveComponent2 {
|
|
17979
18022
|
simulation_voltage_probe_id = null;
|
|
18023
|
+
schematic_voltage_probe_id = null;
|
|
18024
|
+
finalProbeName = null;
|
|
18025
|
+
color = null;
|
|
17980
18026
|
get config() {
|
|
17981
18027
|
return {
|
|
17982
18028
|
componentName: "VoltageProbe",
|
|
@@ -18013,14 +18059,68 @@ var VoltageProbe = class extends PrimitiveComponent2 {
|
|
|
18013
18059
|
);
|
|
18014
18060
|
return;
|
|
18015
18061
|
}
|
|
18062
|
+
const connectedId = port?.source_port_id ?? net?.source_net_id;
|
|
18063
|
+
if (!connectedId) {
|
|
18064
|
+
this.renderError(`Could not identify connected source for VoltageProbe`);
|
|
18065
|
+
return;
|
|
18066
|
+
}
|
|
18067
|
+
this.color = getSimulationColorForId(connectedId);
|
|
18068
|
+
let finalName = name;
|
|
18069
|
+
if (!finalName) {
|
|
18070
|
+
finalName = targets[0].split(" > ").map((s) => s.replace(/^\./, "")).join(".");
|
|
18071
|
+
}
|
|
18072
|
+
this.finalProbeName = finalName;
|
|
18016
18073
|
const { simulation_voltage_probe_id } = db.simulation_voltage_probe.insert({
|
|
18017
|
-
name:
|
|
18074
|
+
name: finalName,
|
|
18018
18075
|
source_port_id: port?.source_port_id ?? void 0,
|
|
18019
18076
|
source_net_id: net?.source_net_id ?? void 0,
|
|
18020
|
-
subcircuit_id: subcircuit.subcircuit_id || void 0
|
|
18077
|
+
subcircuit_id: subcircuit.subcircuit_id || void 0,
|
|
18078
|
+
color: this.color
|
|
18021
18079
|
});
|
|
18022
18080
|
this.simulation_voltage_probe_id = simulation_voltage_probe_id;
|
|
18023
18081
|
}
|
|
18082
|
+
doInitialSchematicReplaceNetLabelsWithSymbols() {
|
|
18083
|
+
if (this.root?.schematicDisabled) return;
|
|
18084
|
+
const { db } = this.root;
|
|
18085
|
+
const { connectsTo, name } = this._parsedProps;
|
|
18086
|
+
const subcircuit = this.getSubcircuit();
|
|
18087
|
+
if (!subcircuit) {
|
|
18088
|
+
return;
|
|
18089
|
+
}
|
|
18090
|
+
const targets = Array.isArray(connectsTo) ? connectsTo : [connectsTo];
|
|
18091
|
+
if (targets.length !== 1) {
|
|
18092
|
+
return;
|
|
18093
|
+
}
|
|
18094
|
+
const targetSelector = targets[0];
|
|
18095
|
+
const port = subcircuit.selectOne(targetSelector, {
|
|
18096
|
+
type: "port"
|
|
18097
|
+
});
|
|
18098
|
+
if (!port) return;
|
|
18099
|
+
if (!port.schematic_port_id) return;
|
|
18100
|
+
const position = port._getGlobalSchematicPositionAfterLayout();
|
|
18101
|
+
let targetTraceId = null;
|
|
18102
|
+
for (const trace of db.schematic_trace.list()) {
|
|
18103
|
+
for (const edge of trace.edges) {
|
|
18104
|
+
if (Math.abs(edge.from.x - position.x) < 1e-6 && Math.abs(edge.from.y - position.y) < 1e-6 || Math.abs(edge.to.x - position.x) < 1e-6 && Math.abs(edge.to.y - position.y) < 1e-6) {
|
|
18105
|
+
targetTraceId = trace.schematic_trace_id;
|
|
18106
|
+
break;
|
|
18107
|
+
}
|
|
18108
|
+
}
|
|
18109
|
+
if (targetTraceId) break;
|
|
18110
|
+
}
|
|
18111
|
+
if (!targetTraceId) {
|
|
18112
|
+
return;
|
|
18113
|
+
}
|
|
18114
|
+
const probeName = this.finalProbeName;
|
|
18115
|
+
const schematic_voltage_probe = db.schematic_voltage_probe.insert({
|
|
18116
|
+
name: probeName,
|
|
18117
|
+
position,
|
|
18118
|
+
schematic_trace_id: targetTraceId,
|
|
18119
|
+
subcircuit_id: subcircuit.subcircuit_id || void 0,
|
|
18120
|
+
color: this.color ?? void 0
|
|
18121
|
+
});
|
|
18122
|
+
this.schematic_voltage_probe_id = schematic_voltage_probe.schematic_voltage_probe_id;
|
|
18123
|
+
}
|
|
18024
18124
|
};
|
|
18025
18125
|
|
|
18026
18126
|
// lib/RootCircuit.ts
|
|
@@ -18032,7 +18132,7 @@ import { identity as identity6 } from "transformation-matrix";
|
|
|
18032
18132
|
var package_default = {
|
|
18033
18133
|
name: "@tscircuit/core",
|
|
18034
18134
|
type: "module",
|
|
18035
|
-
version: "0.0.
|
|
18135
|
+
version: "0.0.868",
|
|
18036
18136
|
types: "dist/index.d.ts",
|
|
18037
18137
|
main: "dist/index.js",
|
|
18038
18138
|
module: "dist/index.js",
|
|
@@ -18075,7 +18175,7 @@ var package_default = {
|
|
|
18075
18175
|
"@tscircuit/matchpack": "^0.0.16",
|
|
18076
18176
|
"@tscircuit/math-utils": "^0.0.29",
|
|
18077
18177
|
"@tscircuit/miniflex": "^0.0.4",
|
|
18078
|
-
"@tscircuit/ngspice-spice-engine": "^0.0.
|
|
18178
|
+
"@tscircuit/ngspice-spice-engine": "^0.0.3",
|
|
18079
18179
|
"@tscircuit/props": "^0.0.403",
|
|
18080
18180
|
"@tscircuit/schematic-autolayout": "^0.0.6",
|
|
18081
18181
|
"@tscircuit/schematic-match-adapt": "^0.0.16",
|
|
@@ -18090,13 +18190,13 @@ var package_default = {
|
|
|
18090
18190
|
"bun-match-svg": "0.0.12",
|
|
18091
18191
|
"calculate-elbow": "^0.0.12",
|
|
18092
18192
|
"chokidar-cli": "^3.0.0",
|
|
18093
|
-
"circuit-json": "^0.0.
|
|
18193
|
+
"circuit-json": "^0.0.316",
|
|
18094
18194
|
"circuit-json-to-bpc": "^0.0.13",
|
|
18095
18195
|
"circuit-json-to-connectivity-map": "^0.0.22",
|
|
18096
18196
|
"circuit-json-to-gltf": "^0.0.31",
|
|
18097
18197
|
"circuit-json-to-simple-3d": "^0.0.9",
|
|
18098
|
-
"circuit-json-to-spice": "^0.0.
|
|
18099
|
-
"circuit-to-svg": "^0.0.
|
|
18198
|
+
"circuit-json-to-spice": "^0.0.24",
|
|
18199
|
+
"circuit-to-svg": "^0.0.271",
|
|
18100
18200
|
concurrently: "^9.1.2",
|
|
18101
18201
|
"connectivity-map": "^1.0.0",
|
|
18102
18202
|
debug: "^4.3.6",
|
|
@@ -18112,7 +18212,7 @@ var package_default = {
|
|
|
18112
18212
|
react: "^19.1.0",
|
|
18113
18213
|
"react-dom": "^19.1.0",
|
|
18114
18214
|
"schematic-symbols": "^0.0.202",
|
|
18115
|
-
spicey: "^0.0.
|
|
18215
|
+
spicey: "^0.0.14",
|
|
18116
18216
|
"ts-expect": "^1.3.0",
|
|
18117
18217
|
tsup: "^8.2.4"
|
|
18118
18218
|
},
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.869",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@tscircuit/matchpack": "^0.0.16",
|
|
45
45
|
"@tscircuit/math-utils": "^0.0.29",
|
|
46
46
|
"@tscircuit/miniflex": "^0.0.4",
|
|
47
|
-
"@tscircuit/ngspice-spice-engine": "^0.0.
|
|
47
|
+
"@tscircuit/ngspice-spice-engine": "^0.0.3",
|
|
48
48
|
"@tscircuit/props": "^0.0.403",
|
|
49
49
|
"@tscircuit/schematic-autolayout": "^0.0.6",
|
|
50
50
|
"@tscircuit/schematic-match-adapt": "^0.0.16",
|
|
@@ -59,13 +59,13 @@
|
|
|
59
59
|
"bun-match-svg": "0.0.12",
|
|
60
60
|
"calculate-elbow": "^0.0.12",
|
|
61
61
|
"chokidar-cli": "^3.0.0",
|
|
62
|
-
"circuit-json": "^0.0.
|
|
62
|
+
"circuit-json": "^0.0.316",
|
|
63
63
|
"circuit-json-to-bpc": "^0.0.13",
|
|
64
64
|
"circuit-json-to-connectivity-map": "^0.0.22",
|
|
65
65
|
"circuit-json-to-gltf": "^0.0.31",
|
|
66
66
|
"circuit-json-to-simple-3d": "^0.0.9",
|
|
67
|
-
"circuit-json-to-spice": "^0.0.
|
|
68
|
-
"circuit-to-svg": "^0.0.
|
|
67
|
+
"circuit-json-to-spice": "^0.0.24",
|
|
68
|
+
"circuit-to-svg": "^0.0.271",
|
|
69
69
|
"concurrently": "^9.1.2",
|
|
70
70
|
"connectivity-map": "^1.0.0",
|
|
71
71
|
"debug": "^4.3.6",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"react": "^19.1.0",
|
|
82
82
|
"react-dom": "^19.1.0",
|
|
83
83
|
"schematic-symbols": "^0.0.202",
|
|
84
|
-
"spicey": "^0.0.
|
|
84
|
+
"spicey": "^0.0.14",
|
|
85
85
|
"ts-expect": "^1.3.0",
|
|
86
86
|
"tsup": "^8.2.4"
|
|
87
87
|
},
|