circuit-to-svg 0.0.216 → 0.0.218

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
@@ -312,6 +312,8 @@ interface SimulationTransientVoltageGraphElement {
312
312
  name?: string;
313
313
  }
314
314
  type CircuitJsonWithSimulation = AnyCircuitElement | SimulationExperimentElement | SimulationTransientVoltageGraphElement;
315
+ declare function isSimulationTransientVoltageGraph(value: CircuitJsonWithSimulation): value is SimulationTransientVoltageGraphElement;
316
+ declare function isSimulationExperiment(value: CircuitJsonWithSimulation): value is SimulationExperimentElement;
315
317
 
316
318
  interface ConvertSchematicSimulationParams {
317
319
  circuitJson: CircuitJsonWithSimulation[];
@@ -353,4 +355,4 @@ declare const createSvgObjectsForSchComponentPortHovers: ({ component, transform
353
355
  circuitJson: AnyCircuitElement[];
354
356
  }) => INode[];
355
357
 
356
- export { type AssemblySvgContext, CIRCUIT_TO_SVG_VERSION, type ColorMap, type ColorOverrides, type PcbColorMap, type PcbColorOverrides, type PcbContext, type PinoutLabel, type PinoutSvgContext, circuitJsonToPcbSvg, circuitJsonToSchematicSvg, convertCircuitJsonToAssemblySvg, convertCircuitJsonToPcbSvg, convertCircuitJsonToPinoutSvg, convertCircuitJsonToSchematicSimulationSvg, convertCircuitJsonToSchematicSvg, convertCircuitJsonToSimulationGraphSvg, convertCircuitJsonToSolderPasteMask, createSvgObjectsForSchComponentPortHovers, getSoftwareUsedString };
358
+ export { type AssemblySvgContext, CIRCUIT_TO_SVG_VERSION, type CircuitJsonWithSimulation, type ColorMap, type ColorOverrides, type ExperimentType, type PcbColorMap, type PcbColorOverrides, type PcbContext, type PinoutLabel, type PinoutSvgContext, type SimulationExperimentElement, type SimulationTransientVoltageGraphElement, circuitJsonToPcbSvg, circuitJsonToSchematicSvg, convertCircuitJsonToAssemblySvg, convertCircuitJsonToPcbSvg, convertCircuitJsonToPinoutSvg, convertCircuitJsonToSchematicSimulationSvg, convertCircuitJsonToSchematicSvg, convertCircuitJsonToSimulationGraphSvg, convertCircuitJsonToSolderPasteMask, createSvgObjectsForSchComponentPortHovers, getSoftwareUsedString, isSimulationExperiment, isSimulationTransientVoltageGraph };
package/dist/index.js CHANGED
@@ -1783,7 +1783,7 @@ function getSoftwareUsedString(circuitJson) {
1783
1783
  var package_default = {
1784
1784
  name: "circuit-to-svg",
1785
1785
  type: "module",
1786
- version: "0.0.215",
1786
+ version: "0.0.217",
1787
1787
  description: "Convert Circuit JSON to SVG",
1788
1788
  main: "dist/index.js",
1789
1789
  files: [
@@ -8189,7 +8189,7 @@ function isSimulationExperiment(value) {
8189
8189
  // lib/sim/convert-circuit-json-to-simulation-graph-svg.ts
8190
8190
  var DEFAULT_WIDTH = 1200;
8191
8191
  var DEFAULT_HEIGHT = 600;
8192
- var MARGIN = { top: 64, right: 48, bottom: 80, left: 100 };
8192
+ var MARGIN = { top: 64, right: 100, bottom: 80, left: 100 };
8193
8193
  var FALLBACK_LINE_COLOR = "#1f77b4";
8194
8194
  function convertCircuitJsonToSimulationGraphSvg({
8195
8195
  circuitJson,
@@ -8262,7 +8262,7 @@ function convertCircuitJsonToSimulationGraphSvg({
8262
8262
  plotWidth,
8263
8263
  plotHeight
8264
8264
  }),
8265
- createLegend(preparedGraphs),
8265
+ createLegend(preparedGraphs, width),
8266
8266
  ...titleNode ? [titleNode] : []
8267
8267
  ];
8268
8268
  const svgObject = svgElement(
@@ -8577,14 +8577,15 @@ function createAxes({
8577
8577
  );
8578
8578
  return svgElement("g", { class: "axes" }, children);
8579
8579
  }
8580
- function createLegend(graphs) {
8580
+ function createLegend(graphs, width) {
8581
8581
  const children = graphs.map((entry, index) => {
8582
- const y = MARGIN.top - 28 + index * 20;
8582
+ const y = MARGIN.top + index * 24;
8583
+ const x = width - MARGIN.right + 20;
8583
8584
  return svgElement(
8584
8585
  "g",
8585
8586
  {
8586
8587
  class: "legend-item",
8587
- transform: `translate(${formatNumber(MARGIN.left)} ${formatNumber(y)})`
8588
+ transform: `translate(${formatNumber(x)} ${formatNumber(y)})`
8588
8589
  },
8589
8590
  [
8590
8591
  svgElement("line", {
@@ -9069,6 +9070,8 @@ export {
9069
9070
  convertCircuitJsonToSimulationGraphSvg,
9070
9071
  convertCircuitJsonToSolderPasteMask,
9071
9072
  createSvgObjectsForSchComponentPortHovers,
9072
- getSoftwareUsedString
9073
+ getSoftwareUsedString,
9074
+ isSimulationExperiment,
9075
+ isSimulationTransientVoltageGraph
9073
9076
  };
9074
9077
  //# sourceMappingURL=index.js.map