circuit-to-svg 0.0.217 → 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.js +7 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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.
|
|
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:
|
|
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
|
|
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(
|
|
8588
|
+
transform: `translate(${formatNumber(x)} ${formatNumber(y)})`
|
|
8588
8589
|
},
|
|
8589
8590
|
[
|
|
8590
8591
|
svgElement("line", {
|