circuit-to-svg 0.0.294 → 0.0.295
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/README.md +2 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +29 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -172,6 +172,8 @@ const schematicSimulationSvg = convertCircuitJsonToSchematicSimulationSvg({
|
|
|
172
172
|
- `schematicOptions` – forward additional schematic rendering options (except `width`, `height`, and `includeVersion`).
|
|
173
173
|
- `includeVersion` – if `true`, add a `data-circuit-to-svg-version` attribute to
|
|
174
174
|
the root `<svg>`.
|
|
175
|
+
- `graphAboveSchematic` – if `true`, place the simulation graph above the
|
|
176
|
+
schematic instead of below (defaults to `false`).
|
|
175
177
|
|
|
176
178
|
## convertCircuitJsonToSimulationGraphSvg
|
|
177
179
|
|
package/dist/index.d.ts
CHANGED
|
@@ -341,9 +341,11 @@ interface ConvertSchematicSimulationParams {
|
|
|
341
341
|
schematicHeightRatio?: number;
|
|
342
342
|
schematicOptions?: Omit<Parameters<typeof convertCircuitJsonToSchematicSvg>[1], "width" | "height" | "includeVersion">;
|
|
343
343
|
includeVersion?: boolean;
|
|
344
|
+
/** When true, place the simulation graph above the schematic instead of below (defaults to false). */
|
|
345
|
+
graphAboveSchematic?: boolean;
|
|
344
346
|
showErrorsInTextOverlay?: boolean;
|
|
345
347
|
}
|
|
346
|
-
declare function convertCircuitJsonToSchematicSimulationSvg({ circuitJson, simulation_experiment_id, simulation_transient_voltage_graph_ids, width, height, schematicHeightRatio, schematicOptions, includeVersion, showErrorsInTextOverlay, }: ConvertSchematicSimulationParams): string;
|
|
348
|
+
declare function convertCircuitJsonToSchematicSimulationSvg({ circuitJson, simulation_experiment_id, simulation_transient_voltage_graph_ids, width, height, schematicHeightRatio, schematicOptions, includeVersion, graphAboveSchematic, showErrorsInTextOverlay, }: ConvertSchematicSimulationParams): string;
|
|
347
349
|
|
|
348
350
|
interface Options {
|
|
349
351
|
layer: "top" | "bottom";
|
package/dist/index.js
CHANGED
|
@@ -5562,7 +5562,7 @@ function getSoftwareUsedString(circuitJson) {
|
|
|
5562
5562
|
var package_default = {
|
|
5563
5563
|
name: "circuit-to-svg",
|
|
5564
5564
|
type: "module",
|
|
5565
|
-
version: "0.0.
|
|
5565
|
+
version: "0.0.294",
|
|
5566
5566
|
description: "Convert Circuit JSON to SVG",
|
|
5567
5567
|
main: "dist/index.js",
|
|
5568
5568
|
files: [
|
|
@@ -12793,6 +12793,7 @@ function convertCircuitJsonToSchematicSimulationSvg({
|
|
|
12793
12793
|
schematicHeightRatio = DEFAULT_SCHEMATIC_RATIO,
|
|
12794
12794
|
schematicOptions,
|
|
12795
12795
|
includeVersion,
|
|
12796
|
+
graphAboveSchematic = false,
|
|
12796
12797
|
showErrorsInTextOverlay
|
|
12797
12798
|
}) {
|
|
12798
12799
|
const schematicElements = circuitJson.filter(
|
|
@@ -12823,18 +12824,33 @@ function convertCircuitJsonToSchematicSimulationSvg({
|
|
|
12823
12824
|
const schematicNode = ensureElementNode(parseSync3(schematicSvg));
|
|
12824
12825
|
const simulationNode = ensureElementNode(parseSync3(simulationSvg));
|
|
12825
12826
|
const combinedChildren = [];
|
|
12826
|
-
|
|
12827
|
-
|
|
12828
|
-
|
|
12829
|
-
|
|
12830
|
-
|
|
12831
|
-
|
|
12832
|
-
|
|
12833
|
-
|
|
12834
|
-
|
|
12835
|
-
|
|
12836
|
-
|
|
12837
|
-
|
|
12827
|
+
if (graphAboveSchematic) {
|
|
12828
|
+
combinedChildren.push(
|
|
12829
|
+
translateNestedSvg(simulationNode, 0, 0, width, simulationHeight)
|
|
12830
|
+
);
|
|
12831
|
+
combinedChildren.push(
|
|
12832
|
+
translateNestedSvg(
|
|
12833
|
+
schematicNode,
|
|
12834
|
+
0,
|
|
12835
|
+
simulationHeight,
|
|
12836
|
+
width,
|
|
12837
|
+
schematicHeight
|
|
12838
|
+
)
|
|
12839
|
+
);
|
|
12840
|
+
} else {
|
|
12841
|
+
combinedChildren.push(
|
|
12842
|
+
translateNestedSvg(schematicNode, 0, 0, width, schematicHeight)
|
|
12843
|
+
);
|
|
12844
|
+
combinedChildren.push(
|
|
12845
|
+
translateNestedSvg(
|
|
12846
|
+
simulationNode,
|
|
12847
|
+
0,
|
|
12848
|
+
schematicHeight,
|
|
12849
|
+
width,
|
|
12850
|
+
simulationHeight
|
|
12851
|
+
)
|
|
12852
|
+
);
|
|
12853
|
+
}
|
|
12838
12854
|
const softwareUsedString = getSoftwareUsedString(schematicElements);
|
|
12839
12855
|
const svgObject = {
|
|
12840
12856
|
name: "svg",
|