circuitscript 0.4.1 → 0.5.0
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/cjs/BaseVisitor.js +16 -10
- package/dist/cjs/BomGeneration.js +3 -3
- package/dist/cjs/ComponentMatchConditions.js +2 -2
- package/dist/cjs/annotate/RefdesAnnotationVisitor.js +4 -0
- package/dist/cjs/builtinMethods.js +10 -10
- package/dist/cjs/execute.js +25 -23
- package/dist/cjs/globals.js +7 -14
- package/dist/cjs/helpers.js +4 -3
- package/dist/cjs/lexer.js +8 -4
- package/dist/cjs/objects/BlockTypes.js +10 -0
- package/dist/cjs/objects/NumericValue.js +196 -0
- package/dist/cjs/objects/ParamDefinition.js +1 -149
- package/dist/cjs/objects/PercentageValue.js +15 -0
- package/dist/cjs/objects/PinDefinition.js +2 -2
- package/dist/cjs/objects/WrappedNumber.js +15 -0
- package/dist/cjs/pipeline.js +2 -2
- package/dist/cjs/render/draw_symbols.js +78 -78
- package/dist/cjs/render/export.js +2 -2
- package/dist/cjs/render/geometry.js +11 -12
- package/dist/cjs/render/graph.js +2 -2
- package/dist/cjs/render/layout.js +46 -46
- package/dist/cjs/render/render.js +19 -19
- package/dist/cjs/semantic-tokens/SemanticTokenVisitor.js +59 -59
- package/dist/cjs/utils.js +21 -83
- package/dist/cjs/visitor.js +45 -31
- package/dist/esm/BaseVisitor.js +8 -2
- package/dist/esm/BomGeneration.js +1 -1
- package/dist/esm/ComponentMatchConditions.js +1 -1
- package/dist/esm/annotate/RefdesAnnotationVisitor.js +4 -0
- package/dist/esm/builtinMethods.js +2 -2
- package/dist/esm/execute.js +4 -2
- package/dist/esm/globals.js +1 -8
- package/dist/esm/helpers.js +3 -2
- package/dist/esm/lexer.js +8 -4
- package/dist/esm/objects/BlockTypes.js +7 -0
- package/dist/esm/objects/NumericValue.js +189 -0
- package/dist/esm/objects/ParamDefinition.js +0 -148
- package/dist/esm/objects/PercentageValue.js +12 -0
- package/dist/esm/objects/PinDefinition.js +1 -1
- package/dist/esm/objects/WrappedNumber.js +12 -0
- package/dist/esm/pipeline.js +2 -2
- package/dist/esm/render/draw_symbols.js +2 -2
- package/dist/esm/render/export.js +1 -1
- package/dist/esm/render/geometry.js +1 -2
- package/dist/esm/render/graph.js +1 -1
- package/dist/esm/render/layout.js +2 -2
- package/dist/esm/render/render.js +1 -1
- package/dist/esm/semantic-tokens/SemanticTokenVisitor.js +58 -58
- package/dist/esm/utils.js +16 -74
- package/dist/esm/visitor.js +17 -3
- package/dist/types/ComponentMatchConditions.d.ts +1 -1
- package/dist/types/annotate/RefdesAnnotationVisitor.d.ts +3 -1
- package/dist/types/execute.d.ts +4 -2
- package/dist/types/globals.d.ts +1 -7
- package/dist/types/helpers.d.ts +2 -2
- package/dist/types/lexer.d.ts +1 -0
- package/dist/types/objects/BlockTypes.d.ts +6 -0
- package/dist/types/objects/ClassComponent.d.ts +1 -1
- package/dist/types/objects/ExecutionScope.d.ts +2 -1
- package/dist/types/objects/NumericValue.d.ts +35 -0
- package/dist/types/objects/ParamDefinition.d.ts +0 -41
- package/dist/types/objects/PercentageValue.d.ts +6 -0
- package/dist/types/objects/PinDefinition.d.ts +1 -1
- package/dist/types/objects/WrappedNumber.d.ts +6 -0
- package/dist/types/objects/types.d.ts +2 -1
- package/dist/types/render/draw_symbols.d.ts +1 -1
- package/dist/types/render/geometry.d.ts +1 -1
- package/dist/types/render/layout.d.ts +1 -1
- package/dist/types/semantic-tokens/SemanticTokenVisitor.d.ts +3 -4
- package/dist/types/utils.d.ts +1 -7
- package/package.json +1 -1
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { isReference } from "../utils.js";
|
|
2
|
+
import { Big } from 'big.js';
|
|
3
|
+
import { WrappedNumber } from "./WrappedNumber.js";
|
|
4
|
+
export class NumericValue {
|
|
5
|
+
value;
|
|
6
|
+
valuePart;
|
|
7
|
+
prefixPart;
|
|
8
|
+
constructor(value, prefix = 0) {
|
|
9
|
+
this.value = value;
|
|
10
|
+
if (typeof value === 'string') {
|
|
11
|
+
const matches = value.match(/^([\d]+(?:.[\d]+)?)([\w]*)$/);
|
|
12
|
+
if (matches) {
|
|
13
|
+
this.valuePart = new Big(matches[1]);
|
|
14
|
+
this.prefixPart = getNumberExponential(matches[2]);
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
throw new Error("Invalid numeric value: " + value);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
this.valuePart = new Big(value);
|
|
22
|
+
this.prefixPart = prefix;
|
|
23
|
+
this.value = this.valuePart.toString()
|
|
24
|
+
+ getNumberExponentialText(prefix);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
toString() {
|
|
28
|
+
return 'numeric:' + this.value;
|
|
29
|
+
}
|
|
30
|
+
toDisplayString() {
|
|
31
|
+
if (typeof this.value === 'number') {
|
|
32
|
+
return this.value.toString();
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
return this.valuePart.toString()
|
|
36
|
+
+ getNumberExponentialText(this.prefixPart);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
toNumber() {
|
|
40
|
+
return this.toBigNumber().toNumber();
|
|
41
|
+
}
|
|
42
|
+
toBigNumber() {
|
|
43
|
+
return this.valuePart.mul(new Big(Math.pow(10, this.prefixPart)));
|
|
44
|
+
}
|
|
45
|
+
div(value) {
|
|
46
|
+
if (typeof value === 'number') {
|
|
47
|
+
value = numeric(value);
|
|
48
|
+
}
|
|
49
|
+
return resolveToNumericValue(this.toBigNumber().div(value.toBigNumber()));
|
|
50
|
+
}
|
|
51
|
+
half() {
|
|
52
|
+
return this.div(2);
|
|
53
|
+
}
|
|
54
|
+
mul(value) {
|
|
55
|
+
if (typeof value === 'number') {
|
|
56
|
+
value = numeric(value);
|
|
57
|
+
}
|
|
58
|
+
return resolveToNumericValue(this.toBigNumber().mul(value.toBigNumber()));
|
|
59
|
+
}
|
|
60
|
+
add(value) {
|
|
61
|
+
if (typeof value === 'number') {
|
|
62
|
+
value = numeric(value);
|
|
63
|
+
}
|
|
64
|
+
return resolveToNumericValue(this.toBigNumber().add(value.toBigNumber()));
|
|
65
|
+
}
|
|
66
|
+
sub(value) {
|
|
67
|
+
if (typeof value === 'number') {
|
|
68
|
+
value = numeric(value);
|
|
69
|
+
}
|
|
70
|
+
return resolveToNumericValue(this.toBigNumber().sub(value.toBigNumber()));
|
|
71
|
+
}
|
|
72
|
+
mod(value) {
|
|
73
|
+
if (typeof value === 'number') {
|
|
74
|
+
value = numeric(value);
|
|
75
|
+
}
|
|
76
|
+
return resolveToNumericValue(this.toBigNumber().mod(value.toBigNumber()));
|
|
77
|
+
}
|
|
78
|
+
neg() {
|
|
79
|
+
return resolveToNumericValue(this.toBigNumber().neg());
|
|
80
|
+
}
|
|
81
|
+
eq(value) {
|
|
82
|
+
return this.toBigNumber().eq(value.toBigNumber());
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
export class NumberOperator {
|
|
86
|
+
prepare(value) {
|
|
87
|
+
if (typeof value === 'number') {
|
|
88
|
+
return new WrappedNumber(value);
|
|
89
|
+
}
|
|
90
|
+
else if (isReference(value)) {
|
|
91
|
+
return value.value;
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
return value;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
multiply(value1, value2) {
|
|
98
|
+
const big1 = new Big(value1.toNumber());
|
|
99
|
+
const big2 = new Big(value2.toNumber());
|
|
100
|
+
return resolveToNumericValue(big1.mul(big2));
|
|
101
|
+
}
|
|
102
|
+
divide(value1, value2) {
|
|
103
|
+
const big1 = new Big(value1.toNumber());
|
|
104
|
+
const big2 = new Big(value2.toNumber());
|
|
105
|
+
return resolveToNumericValue(big1.div(big2));
|
|
106
|
+
}
|
|
107
|
+
addition(value1, value2) {
|
|
108
|
+
const big1 = new Big(value1.toNumber());
|
|
109
|
+
const big2 = new Big(value2.toNumber());
|
|
110
|
+
return resolveToNumericValue(big1.add(big2));
|
|
111
|
+
}
|
|
112
|
+
subtraction(value1, value2) {
|
|
113
|
+
const big1 = new Big(value1.toNumber());
|
|
114
|
+
const big2 = new Big(value2.toNumber());
|
|
115
|
+
return resolveToNumericValue(big1.sub(big2));
|
|
116
|
+
}
|
|
117
|
+
modulus(value1, value2) {
|
|
118
|
+
const big1 = new Big(value1.toNumber());
|
|
119
|
+
const big2 = new Big(value2.toNumber());
|
|
120
|
+
return resolveToNumericValue(big1.mod(big2));
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
export function numeric(value) {
|
|
124
|
+
return new NumericValue(value);
|
|
125
|
+
}
|
|
126
|
+
export function getNumberExponentialText(value) {
|
|
127
|
+
switch (value) {
|
|
128
|
+
case -15:
|
|
129
|
+
return 'f';
|
|
130
|
+
case -12:
|
|
131
|
+
return 'p';
|
|
132
|
+
case -9:
|
|
133
|
+
return 'n';
|
|
134
|
+
case -6:
|
|
135
|
+
return 'u';
|
|
136
|
+
case -3:
|
|
137
|
+
return 'm';
|
|
138
|
+
case 3:
|
|
139
|
+
return 'k';
|
|
140
|
+
case 6:
|
|
141
|
+
return 'M';
|
|
142
|
+
case 9:
|
|
143
|
+
return 'G';
|
|
144
|
+
case 0:
|
|
145
|
+
default:
|
|
146
|
+
return '';
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
export function getNumberExponential(value) {
|
|
150
|
+
value = value.trim();
|
|
151
|
+
switch (value) {
|
|
152
|
+
case 'G':
|
|
153
|
+
return 9;
|
|
154
|
+
case 'M':
|
|
155
|
+
return 6;
|
|
156
|
+
case 'k':
|
|
157
|
+
case 'K':
|
|
158
|
+
return 3;
|
|
159
|
+
case 'm':
|
|
160
|
+
return -3;
|
|
161
|
+
case 'u':
|
|
162
|
+
return -6;
|
|
163
|
+
case 'n':
|
|
164
|
+
return -9;
|
|
165
|
+
case 'p':
|
|
166
|
+
return -12;
|
|
167
|
+
case 'f':
|
|
168
|
+
return -15;
|
|
169
|
+
default:
|
|
170
|
+
return 0;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
export function resolveToNumericValue(value) {
|
|
174
|
+
if (value.toNumber() === 0) {
|
|
175
|
+
return new NumericValue(0);
|
|
176
|
+
}
|
|
177
|
+
const isNeg = value.lt(0);
|
|
178
|
+
const positiveValue = isNeg ? value.neg() : value;
|
|
179
|
+
const prefixPart = Math.floor(Math.log10(positiveValue.toNumber()) / 3);
|
|
180
|
+
let useValue = value;
|
|
181
|
+
if (prefixPart !== 0) {
|
|
182
|
+
const tmpValue1 = positiveValue.div(Math.pow(10, prefixPart * 3));
|
|
183
|
+
useValue = isNeg ? tmpValue1.neg() : tmpValue1;
|
|
184
|
+
}
|
|
185
|
+
return new NumericValue(useValue, prefixPart * 3);
|
|
186
|
+
}
|
|
187
|
+
export function roundValue(value) {
|
|
188
|
+
return resolveToNumericValue(new Big(value.toBigNumber().toFixed(7)));
|
|
189
|
+
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { getNumberExponential, getNumberExponentialText, isReference, resolveToNumericValue } from "../utils.js";
|
|
2
|
-
import { Big } from 'big.js';
|
|
3
1
|
export class ParamDefinition {
|
|
4
2
|
paramName;
|
|
5
3
|
paramValue;
|
|
@@ -8,149 +6,3 @@ export class ParamDefinition {
|
|
|
8
6
|
this.paramValue = paramValue;
|
|
9
7
|
}
|
|
10
8
|
}
|
|
11
|
-
export class NumericValue {
|
|
12
|
-
value;
|
|
13
|
-
valuePart;
|
|
14
|
-
prefixPart;
|
|
15
|
-
constructor(value, prefix = 0) {
|
|
16
|
-
this.value = value;
|
|
17
|
-
if (typeof value === 'string') {
|
|
18
|
-
const matches = value.match(/^([\d]+(?:.[\d]+)?)([\w]*)$/);
|
|
19
|
-
if (matches) {
|
|
20
|
-
this.valuePart = new Big(matches[1]);
|
|
21
|
-
this.prefixPart = getNumberExponential(matches[2]);
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
throw new Error("Invalid numeric value: " + value);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
this.valuePart = new Big(value);
|
|
29
|
-
this.prefixPart = prefix;
|
|
30
|
-
this.value = this.valuePart.toString()
|
|
31
|
-
+ getNumberExponentialText(prefix);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
toString() {
|
|
35
|
-
return 'numeric:' + this.value;
|
|
36
|
-
}
|
|
37
|
-
toDisplayString() {
|
|
38
|
-
if (typeof this.value === 'number') {
|
|
39
|
-
return this.value.toString();
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
return this.valuePart.toString()
|
|
43
|
-
+ getNumberExponentialText(this.prefixPart);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
toNumber() {
|
|
47
|
-
return this.toBigNumber().toNumber();
|
|
48
|
-
}
|
|
49
|
-
toBigNumber() {
|
|
50
|
-
return this.valuePart.mul(new Big(Math.pow(10, this.prefixPart)));
|
|
51
|
-
}
|
|
52
|
-
div(value) {
|
|
53
|
-
if (typeof value === 'number') {
|
|
54
|
-
value = numeric(value);
|
|
55
|
-
}
|
|
56
|
-
return resolveToNumericValue(this.toBigNumber().div(value.toBigNumber()));
|
|
57
|
-
}
|
|
58
|
-
half() {
|
|
59
|
-
return this.div(2);
|
|
60
|
-
}
|
|
61
|
-
mul(value) {
|
|
62
|
-
if (typeof value === 'number') {
|
|
63
|
-
value = numeric(value);
|
|
64
|
-
}
|
|
65
|
-
return resolveToNumericValue(this.toBigNumber().mul(value.toBigNumber()));
|
|
66
|
-
}
|
|
67
|
-
add(value) {
|
|
68
|
-
if (typeof value === 'number') {
|
|
69
|
-
value = numeric(value);
|
|
70
|
-
}
|
|
71
|
-
return resolveToNumericValue(this.toBigNumber().add(value.toBigNumber()));
|
|
72
|
-
}
|
|
73
|
-
sub(value) {
|
|
74
|
-
if (typeof value === 'number') {
|
|
75
|
-
value = numeric(value);
|
|
76
|
-
}
|
|
77
|
-
return resolveToNumericValue(this.toBigNumber().sub(value.toBigNumber()));
|
|
78
|
-
}
|
|
79
|
-
mod(value) {
|
|
80
|
-
if (typeof value === 'number') {
|
|
81
|
-
value = numeric(value);
|
|
82
|
-
}
|
|
83
|
-
return resolveToNumericValue(this.toBigNumber().mod(value.toBigNumber()));
|
|
84
|
-
}
|
|
85
|
-
neg() {
|
|
86
|
-
return resolveToNumericValue(this.toBigNumber().neg());
|
|
87
|
-
}
|
|
88
|
-
eq(value) {
|
|
89
|
-
return this.toBigNumber().eq(value.toBigNumber());
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
export function numeric(value) {
|
|
93
|
-
return new NumericValue(value);
|
|
94
|
-
}
|
|
95
|
-
export class PercentageValue {
|
|
96
|
-
value;
|
|
97
|
-
constructor(value) {
|
|
98
|
-
this.value = value;
|
|
99
|
-
}
|
|
100
|
-
toString() {
|
|
101
|
-
return this.value.toString();
|
|
102
|
-
}
|
|
103
|
-
toNumber() {
|
|
104
|
-
return 0;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
export class WrappedNumber {
|
|
108
|
-
value;
|
|
109
|
-
constructor(value) {
|
|
110
|
-
this.value = value;
|
|
111
|
-
}
|
|
112
|
-
toString() {
|
|
113
|
-
return this.value.toString();
|
|
114
|
-
}
|
|
115
|
-
toNumber() {
|
|
116
|
-
return this.value;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
export class NumberOperator {
|
|
120
|
-
prepare(value) {
|
|
121
|
-
if (typeof value === 'number') {
|
|
122
|
-
return new WrappedNumber(value);
|
|
123
|
-
}
|
|
124
|
-
else if (isReference(value)) {
|
|
125
|
-
return value.value;
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
128
|
-
return value;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
multiply(value1, value2) {
|
|
132
|
-
const big1 = new Big(value1.toNumber());
|
|
133
|
-
const big2 = new Big(value2.toNumber());
|
|
134
|
-
return resolveToNumericValue(big1.mul(big2));
|
|
135
|
-
}
|
|
136
|
-
divide(value1, value2) {
|
|
137
|
-
const big1 = new Big(value1.toNumber());
|
|
138
|
-
const big2 = new Big(value2.toNumber());
|
|
139
|
-
return resolveToNumericValue(big1.div(big2));
|
|
140
|
-
}
|
|
141
|
-
addition(value1, value2) {
|
|
142
|
-
const big1 = new Big(value1.toNumber());
|
|
143
|
-
const big2 = new Big(value2.toNumber());
|
|
144
|
-
return resolveToNumericValue(big1.add(big2));
|
|
145
|
-
}
|
|
146
|
-
subtraction(value1, value2) {
|
|
147
|
-
const big1 = new Big(value1.toNumber());
|
|
148
|
-
const big2 = new Big(value2.toNumber());
|
|
149
|
-
return resolveToNumericValue(big1.sub(big2));
|
|
150
|
-
}
|
|
151
|
-
modulus(value1, value2) {
|
|
152
|
-
const big1 = new Big(value1.toNumber());
|
|
153
|
-
const big2 = new Big(value2.toNumber());
|
|
154
|
-
return resolveToNumericValue(big1.mod(big2));
|
|
155
|
-
}
|
|
156
|
-
}
|
package/dist/esm/pipeline.js
CHANGED
|
@@ -53,7 +53,7 @@ export async function renderScriptCustom(scriptData, outputPath, options, parseH
|
|
|
53
53
|
visitor.log(`current file: ${inputPath}`);
|
|
54
54
|
visitor.onImportFile = (visitor, filePath, fileData, errorHandler, fileLineOffset = 0) => {
|
|
55
55
|
visitor.enterFile(filePath);
|
|
56
|
-
|
|
56
|
+
const numErrors = errors.length;
|
|
57
57
|
const result = parseFileWithVisitor(visitor, fileData, {
|
|
58
58
|
enableLexerDiagnostics: lexerDiagnostics,
|
|
59
59
|
enableLexerVerbose: lexerVerbose,
|
|
@@ -61,7 +61,7 @@ export async function renderScriptCustom(scriptData, outputPath, options, parseH
|
|
|
61
61
|
});
|
|
62
62
|
const { throwError, tree, tokens } = result;
|
|
63
63
|
let { hasError, hasParseError } = result;
|
|
64
|
-
if (errors.length >
|
|
64
|
+
if (errors.length > numErrors) {
|
|
65
65
|
hasError = true;
|
|
66
66
|
hasParseError = true;
|
|
67
67
|
}
|
|
@@ -2,9 +2,9 @@ import { milsToMM } from "../helpers.js";
|
|
|
2
2
|
import { ColorScheme, CustomSymbolParamTextSize, CustomSymbolPinIdSize, CustomSymbolPinTextSize, CustomSymbolRefDesSize, PinTypesList, PortArrowSize, PortPaddingHorizontal, PortPaddingVertical, ReferenceTypes, RenderFlags, SymbolPinSide, defaultFont, defaultPinIdTextSize, defaultPinNameTextSize, defaultSymbolLineWidth, fontDisplayScale } from "../globals.js";
|
|
3
3
|
import { Geometry, GeometryProp, HorizontalAlign, HorizontalAlignProp, Textbox, VerticalAlign, VerticalAlignProp } from "./geometry.js";
|
|
4
4
|
import { PinTypes } from "../objects/PinTypes.js";
|
|
5
|
-
import {
|
|
5
|
+
import { RuntimeExecutionError, throwWithContext } from "../utils.js";
|
|
6
6
|
import { DeclaredReference, UndeclaredReference } from "../objects/types.js";
|
|
7
|
-
import { numeric,
|
|
7
|
+
import { NumericValue, numeric, roundValue } from "../objects/NumericValue.js";
|
|
8
8
|
import { PinId } from "../objects/PinDefinition.js";
|
|
9
9
|
export class SymbolGraphic {
|
|
10
10
|
drawPortsName = true;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import Flatten from '@flatten-js/core';
|
|
2
2
|
import { measureTextSize2 } from '../sizing.js';
|
|
3
3
|
import { defaultFont, fontDisplayScale, PortArrowSize, PortPaddingHorizontal, PortPaddingVertical } from '../globals.js';
|
|
4
|
-
import { numeric,
|
|
4
|
+
import { NumericValue, numeric, roundValue } from '../objects/NumericValue.js';
|
|
5
5
|
import { AllPinTypes, PinTypes } from '../objects/PinTypes.js';
|
|
6
|
-
import { roundValue } from '../utils.js';
|
|
7
6
|
export class Textbox extends Flatten.Polygon {
|
|
8
7
|
id;
|
|
9
8
|
text;
|
package/dist/esm/render/graph.js
CHANGED
|
@@ -5,7 +5,7 @@ import { milsToMM } from "../helpers.js";
|
|
|
5
5
|
import { RenderFrame, RenderComponent, applyComponentParamsToSymbol, RenderWire } from "./layout.js";
|
|
6
6
|
import { SequenceAction, FrameAction } from "../objects/ExecutionScope.js";
|
|
7
7
|
import { Frame, FixedFrameIds, FrameParamKeys } from "../objects/Frame.js";
|
|
8
|
-
import { numeric } from "../objects/
|
|
8
|
+
import { numeric } from "../objects/NumericValue.js";
|
|
9
9
|
import { NetTypes } from "../objects/types.js";
|
|
10
10
|
import Matrix, { solve } from "ml-matrix";
|
|
11
11
|
import { getPinDefinition, PinId } from "../objects/PinDefinition.js";
|
|
@@ -4,11 +4,11 @@ import { SymbolCustom, SymbolDrawing, SymbolPlaceholder, SymbolText, PlaceHolder
|
|
|
4
4
|
import { DefaultComponentUnit, defaultFrameTitleTextSize, defaultGridSizeUnits, FrameType, NetGraphicsParams, ParamKeys, WireAutoDirection } from '../globals.js';
|
|
5
5
|
import { Geometry, HorizontalAlign, VerticalAlign } from './geometry.js';
|
|
6
6
|
import { FixedFrameIds, Frame, FrameParamKeys, FramePlotDirection } from '../objects/Frame.js';
|
|
7
|
-
import { areasOverlap, combineMaps, getBoundsSize, printBounds, resizeBounds, resizeToNearestGrid,
|
|
7
|
+
import { areasOverlap, combineMaps, getBoundsSize, printBounds, resizeBounds, resizeToNearestGrid, toNearestGrid } from '../utils.js';
|
|
8
8
|
import { Direction } from '../objects/types.js';
|
|
9
9
|
import { PinId } from '../objects/PinDefinition.js';
|
|
10
10
|
import { milsToMM, UnitDimension } from '../helpers.js';
|
|
11
|
-
import { numeric } from '../objects/
|
|
11
|
+
import { numeric, roundValue } from '../objects/NumericValue.js';
|
|
12
12
|
import { generateLayoutPinDefinition, getWireName, RenderItemType } from './graph.js';
|
|
13
13
|
export class LayoutEngine {
|
|
14
14
|
logger;
|
|
@@ -2,7 +2,7 @@ import { SVG, registerWindow } from '@svgdotjs/svg.js';
|
|
|
2
2
|
import { ExtractDrawingRects, RenderFrameType, getBounds } from "./layout.js";
|
|
3
3
|
import { applyFontsToSVG } from '../sizing.js';
|
|
4
4
|
import { ColorScheme, ComponentTypes, FrameType, MMToPt, MMToPx, MilsToMM, ParamKeys, RenderFlags, defaultGridSizeUnits, defaultPageSpacingMM, defaultWireLineWidth, fontDisplayScale, junctionSize } from '../globals.js';
|
|
5
|
-
import {
|
|
5
|
+
import { NumericValue, numeric } from '../objects/NumericValue.js';
|
|
6
6
|
import { combineMaps, getBoundsSize } from '../utils.js';
|
|
7
7
|
import { milsToMM } from '../helpers.js';
|
|
8
8
|
import { getPaperSize } from "./PaperSizes.js";
|