|
1 | | -/** |
2 | | - * Copyright 2023 Craig Gidney |
3 | | - * Copyright 2025 Riverlane |
4 | | - * |
5 | | - * Licensed under the Apache License, Version 2.0 (the "License"); |
6 | | - * you may not use this file except in compliance with the License. |
7 | | - * You may obtain a copy of the License at |
8 | | - * |
9 | | - * http://www.apache.org/licenses/LICENSE-2.0 |
10 | | - * |
11 | | - * Unless required by applicable law or agreed to in writing, software |
12 | | - * distributed under the License is distributed on an "AS IS" BASIS, |
13 | | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
14 | | - * See the License for the specific language governing permissions and |
15 | | - * limitations under the License. |
16 | | - * |
17 | | - * Modifications: |
18 | | - * - Refactored for CrumPy |
19 | | - */ |
20 | | - |
21 | 1 | const pitch = 50; |
22 | 2 | const rad = 10; |
23 | 3 | const OFFSET_X = -pitch + Math.floor(pitch / 4) + 0.5; |
24 | 4 | const OFFSET_Y = -pitch + Math.floor(pitch / 4) + 0.5; |
25 | | -let indentCircuitLines = true; |
26 | 5 | let curveConnectors = true; |
27 | | -let showAnnotationRegions = true; |
28 | | - |
29 | | -const setIndentCircuitLines = (newBool) => { |
30 | | - if (typeof newBool !== "boolean") { |
31 | | - throw new TypeError(`Expected a boolean, but got ${typeof newBool}`); |
32 | | - } |
33 | | - indentCircuitLines = newBool; |
34 | | -}; |
35 | | - |
36 | | -const setCurveConnectors = (newBool) => { |
37 | | - if (typeof newBool !== "boolean") { |
38 | | - throw new TypeError(`Expected a boolean, but got ${typeof newBool}`); |
39 | | - } |
40 | | - curveConnectors = newBool; |
41 | | -}; |
42 | | - |
43 | | -const setShowAnnotationRegions = (newBool) => { |
44 | | - if (typeof newBool !== "boolean") { |
45 | | - throw new TypeError(`Expected a boolean, but got ${typeof newBool}`); |
46 | | - } |
47 | | - showAnnotationRegions = newBool; |
48 | | -}; |
49 | 6 |
|
50 | | -export { |
51 | | - pitch, |
52 | | - rad, |
53 | | - OFFSET_X, |
54 | | - OFFSET_Y, |
55 | | - indentCircuitLines, |
56 | | - curveConnectors, |
57 | | - showAnnotationRegions, |
58 | | - setIndentCircuitLines, |
59 | | - setCurveConnectors, |
60 | | - setShowAnnotationRegions, |
61 | | -}; |
| 7 | +export {pitch, rad, OFFSET_X, OFFSET_Y, curveConnectors}; |
0 commit comments