@tscircuit/schematic-viewer 1.3.0 → 1.4.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/README.md +1 -1
- package/dist/index.d.ts +3 -4
- package/dist/index.js +694 -687
- package/dist/index.js.map +1 -1
- package/package.json +5 -6
- package/src/Schematic.tsx +139 -65
- package/src/lib/types/core.ts +14 -49
- package/src/lib/types/source-component.ts +5 -0
- package/src/lib/utils/collect-element-refs.ts +1 -0
- package/src/lib/utils/colors.ts +236 -0
- package/src/schematic-components/SVGPathComponent.tsx +84 -144
- package/src/schematic-components/SchematicChip.tsx +183 -0
- package/src/schematic-components/SchematicComponent.tsx +18 -24
- package/src/schematic-components/SchematicComponentFromSymbol.tsx +44 -0
- package/src/schematic-components/SchematicElement.tsx +0 -28
- package/src/schematic-components/SchematicTrace.tsx +4 -3
- package/src/schematic-components/index.tsx +7 -14
- package/src/stories/basics/schematic-net-labels-2.stories.tsx +22 -20
- package/src/stories/bug-connections.stories.tsx +3 -0
- package/src/stories/bug-high-port-numbers.stories.tsx +99 -85
- package/src/stories/bugs/bug3-scaling-trace.stories.tsx +11 -5
- package/src/stories/bugs/bug4-schematic-line.stories.tsx +0 -1
- package/src/stories/bugs/bug5-diode.stories.tsx +0 -1
- package/src/stories/bugs/bug8-autolayout.stories.tsx +20 -29
- package/src/stories/circuit-components/diode.stories.tsx +3 -1
- package/src/stories/circuit-components/resistor.stories.tsx +3 -1
- package/src/stories/led-circuit-react.stories.tsx +40 -48
- package/src/pages/led-circuit.tsx +0 -96
- package/src/schematic-components/ProjectComponent.tsx +0 -70
- package/src/schematic-components/SchematicBox.tsx +0 -29
- package/src/schematic-components/SchematicBug.tsx +0 -107
- package/src/schematic-components/SchematicLine.tsx +0 -48
- package/src/schematic-components/SchematicPath.tsx +0 -51
- package/src/schematic-components/SchematicPort.tsx +0 -63
- package/src/schematic-components/SimpleCapacitor.tsx +0 -29
- package/src/schematic-components/SimpleDiode.tsx +0 -42
- package/src/schematic-components/SimpleGround.tsx +0 -30
- package/src/schematic-components/SimpleInductor.tsx +0 -29
- package/src/schematic-components/SimplePowerSource.tsx +0 -43
- package/src/schematic-components/SimpleResistor.tsx +0 -28
- package/src/stories/led-circuit-builder.stories.tsx +0 -104
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/schematic-viewer",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -17,8 +17,6 @@
|
|
|
17
17
|
"chromatic": "npx chromatic --project-token=chpt_d88a6beb0734bbe"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"@tscircuit/builder": "*",
|
|
21
|
-
"@tscircuit/react-fiber": "*",
|
|
22
20
|
"@tscircuit/table-viewer": "*",
|
|
23
21
|
"react": "*"
|
|
24
22
|
},
|
|
@@ -35,8 +33,6 @@
|
|
|
35
33
|
"@storybook/nextjs": "^8.1.3",
|
|
36
34
|
"@storybook/react": "^8.1.3",
|
|
37
35
|
"@storybook/testing-library": "^0.0.14-next.2",
|
|
38
|
-
"@tscircuit/builder": "^1.5.126",
|
|
39
|
-
"@tscircuit/react-fiber": "^1.1.29",
|
|
40
36
|
"@tscircuit/routing": "^1.3.0",
|
|
41
37
|
"@tscircuit/table-viewer": "^0.0.6",
|
|
42
38
|
"@types/node": "^18.6.0",
|
|
@@ -67,12 +63,15 @@
|
|
|
67
63
|
},
|
|
68
64
|
"dependencies": {
|
|
69
65
|
"@storybook/react-vite": "^8.1.3",
|
|
66
|
+
"@tscircuit/core": "^0.0.125",
|
|
70
67
|
"@tscircuit/layout": "^0.0.25",
|
|
71
68
|
"@tscircuit/props": "^0.0.23",
|
|
72
|
-
"@tscircuit/soup-util": "^0.0.
|
|
69
|
+
"@tscircuit/soup-util": "^0.0.38",
|
|
70
|
+
"circuit-to-svg": "^0.0.40",
|
|
73
71
|
"convert-units": "^2.3.4",
|
|
74
72
|
"react-error-boundary": "^4.0.4",
|
|
75
73
|
"react-supergrid": "^1.0.10",
|
|
74
|
+
"schematic-symbols": "^0.0.78",
|
|
76
75
|
"use-mouse-matrix-transform": "^1.1.12"
|
|
77
76
|
},
|
|
78
77
|
"bugs": {
|
package/src/Schematic.tsx
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
createProjectFromElements,
|
|
5
|
-
findBoundsAndCenter,
|
|
6
|
-
} from "@tscircuit/builder"
|
|
7
|
-
import TscReactFiber, { createRoot } from "@tscircuit/react-fiber"
|
|
8
|
-
import { AnyCircuitElement } from "circuit-json"
|
|
1
|
+
import { useRenderedCircuit } from "@tscircuit/core"
|
|
2
|
+
import { findBoundsAndCenter } from "@tscircuit/soup-util"
|
|
3
|
+
import type { AnyCircuitElement } from "circuit-json"
|
|
9
4
|
import { useGlobalStore } from "lib/render-context"
|
|
10
|
-
import { useCallback, useEffect, useState } from "react"
|
|
5
|
+
import React, { useCallback, useEffect, useRef, useState } from "react"
|
|
11
6
|
import { ErrorBoundary as TypedErrorBoundary } from "react-error-boundary"
|
|
12
7
|
import { SuperGrid, toMMSI } from "react-supergrid"
|
|
13
8
|
import useMeasure from "react-use-measure"
|
|
14
9
|
import { ContextProviders } from "schematic-components"
|
|
15
10
|
import { SchematicElement } from "schematic-components/SchematicElement"
|
|
16
|
-
import {
|
|
17
|
-
|
|
11
|
+
import {
|
|
12
|
+
applyToPoint,
|
|
13
|
+
compose,
|
|
14
|
+
inverse,
|
|
15
|
+
Matrix,
|
|
16
|
+
scale,
|
|
17
|
+
translate,
|
|
18
|
+
} from "transformation-matrix"
|
|
18
19
|
import { TableViewer } from "./schematic-components/TableViewer"
|
|
19
20
|
|
|
20
21
|
const ErrorBoundary = TypedErrorBoundary as any
|
|
@@ -34,16 +35,9 @@ const toMMSINeg = (v: number, z: number) =>
|
|
|
34
35
|
|
|
35
36
|
export interface SchematicProps {
|
|
36
37
|
children?: any
|
|
37
|
-
|
|
38
|
-
/** @deprecated use soup */
|
|
39
|
-
elements?: any
|
|
40
|
-
|
|
41
38
|
soup?: AnyCircuitElement[]
|
|
42
|
-
|
|
43
|
-
style?: any
|
|
44
|
-
|
|
39
|
+
style?: React.CSSProperties
|
|
45
40
|
showTable?: boolean
|
|
46
|
-
|
|
47
41
|
_soupPostProcessor?: (soup: AnyCircuitElement[]) => AnyCircuitElement[]
|
|
48
42
|
}
|
|
49
43
|
|
|
@@ -57,28 +51,54 @@ export const Schematic = (props: SchematicProps) => {
|
|
|
57
51
|
|
|
58
52
|
export const SchematicWithoutContext = ({
|
|
59
53
|
children,
|
|
60
|
-
|
|
61
|
-
soup: initialSoup,
|
|
54
|
+
soup,
|
|
62
55
|
style,
|
|
63
56
|
showTable = false,
|
|
64
57
|
_soupPostProcessor,
|
|
65
58
|
}: SchematicProps) => {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
59
|
+
const {
|
|
60
|
+
circuitJson: circuitJsonFromChildren,
|
|
61
|
+
error: errorFromChildren,
|
|
62
|
+
isLoading,
|
|
63
|
+
} = useRenderedCircuit(children)
|
|
64
|
+
|
|
65
|
+
const [elements, setElements] = useState<AnyCircuitElement[]>([])
|
|
66
|
+
const { setCameraTransform } = useGlobalStore()
|
|
72
67
|
const [boundsRef, bounds] = useMeasure()
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
68
|
+
const containerRef = useRef<HTMLDivElement>(null)
|
|
69
|
+
const transformRef = useRef<Matrix>(compose(translate(0, 0), scale(1, 1)))
|
|
70
|
+
const isDraggingRef = useRef(false)
|
|
71
|
+
const lastMousePosRef = useRef({ x: 0, y: 0 })
|
|
72
|
+
const [, forceUpdate] = useState({})
|
|
73
|
+
|
|
74
|
+
const updateTransform = useCallback(
|
|
75
|
+
(newTransform: Matrix) => {
|
|
76
|
+
transformRef.current = newTransform
|
|
77
|
+
setCameraTransform(newTransform)
|
|
78
|
+
forceUpdate({})
|
|
76
79
|
},
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
[setCameraTransform],
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
useEffect(() => {
|
|
84
|
+
let processedElements: AnyCircuitElement[] = []
|
|
85
|
+
if (circuitJsonFromChildren && (!soup || soup.length === 0)) {
|
|
86
|
+
processedElements = circuitJsonFromChildren as AnyCircuitElement[]
|
|
87
|
+
} else if (soup && soup.length > 0) {
|
|
88
|
+
processedElements = soup
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (processedElements.length > 0) {
|
|
92
|
+
if (_soupPostProcessor) {
|
|
93
|
+
processedElements = _soupPostProcessor(processedElements)
|
|
94
|
+
}
|
|
95
|
+
setElements(processedElements)
|
|
96
|
+
}
|
|
97
|
+
}, [circuitJsonFromChildren, soup, _soupPostProcessor])
|
|
98
|
+
|
|
99
|
+
useEffect(() => {
|
|
100
|
+
if (elements.length > 0 && containerRef.current) {
|
|
101
|
+
const elmBounds = containerRef.current.getBoundingClientRect()
|
|
82
102
|
|
|
83
103
|
const { center, width, height } = elements.some((e) =>
|
|
84
104
|
e.type.startsWith("schematic_"),
|
|
@@ -93,38 +113,88 @@ export const SchematicWithoutContext = ({
|
|
|
93
113
|
(elmBounds.height ?? 0) / height,
|
|
94
114
|
100,
|
|
95
115
|
)
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
scale(scaleFactor, -scaleFactor, 0, 0),
|
|
102
|
-
translate(-center.x, -center.y),
|
|
103
|
-
),
|
|
116
|
+
|
|
117
|
+
const newTransform = compose(
|
|
118
|
+
translate((elmBounds.width ?? 0) / 2, (elmBounds.height ?? 0) / 2),
|
|
119
|
+
scale(scaleFactor, -scaleFactor, 0, 0),
|
|
120
|
+
translate(-center.x, -center.y),
|
|
104
121
|
)
|
|
122
|
+
|
|
123
|
+
updateTransform(newTransform)
|
|
124
|
+
}
|
|
125
|
+
}, [elements, bounds.width, bounds.height, updateTransform])
|
|
126
|
+
|
|
127
|
+
const handleMouseDown = useCallback((e: React.MouseEvent) => {
|
|
128
|
+
isDraggingRef.current = true
|
|
129
|
+
lastMousePosRef.current = { x: e.clientX, y: e.clientY }
|
|
130
|
+
}, [])
|
|
131
|
+
|
|
132
|
+
const handleMouseMove = useCallback(
|
|
133
|
+
(e: React.MouseEvent) => {
|
|
134
|
+
if (!isDraggingRef.current) return
|
|
135
|
+
|
|
136
|
+
const dx = e.clientX - lastMousePosRef.current.x
|
|
137
|
+
const dy = e.clientY - lastMousePosRef.current.y
|
|
138
|
+
lastMousePosRef.current = { x: e.clientX, y: e.clientY }
|
|
139
|
+
|
|
140
|
+
const scale = transformRef.current.a // Assuming uniform scaling
|
|
141
|
+
const dragSensitivity = 150 / scale // Adjust this value to change drag speed
|
|
142
|
+
|
|
143
|
+
const newTransform = compose(
|
|
144
|
+
translate(dx * dragSensitivity, dy * dragSensitivity),
|
|
145
|
+
transformRef.current,
|
|
146
|
+
)
|
|
147
|
+
updateTransform(newTransform)
|
|
105
148
|
},
|
|
106
|
-
[
|
|
149
|
+
[updateTransform],
|
|
150
|
+
)
|
|
151
|
+
|
|
152
|
+
const handleMouseUp = useCallback(() => {
|
|
153
|
+
isDraggingRef.current = false
|
|
154
|
+
}, [])
|
|
155
|
+
|
|
156
|
+
const handleWheel = useCallback(
|
|
157
|
+
(e: WheelEvent) => {
|
|
158
|
+
e.preventDefault()
|
|
159
|
+
const scaleMultiplier = Math.pow(0.999, e.deltaY)
|
|
160
|
+
|
|
161
|
+
if (containerRef.current) {
|
|
162
|
+
const rect = containerRef.current.getBoundingClientRect()
|
|
163
|
+
const mouseX = e.clientX - rect.left
|
|
164
|
+
const mouseY = e.clientY - rect.top
|
|
165
|
+
|
|
166
|
+
const inverseTransform = inverse(transformRef.current)
|
|
167
|
+
const transformedPoint = applyToPoint(inverseTransform, {
|
|
168
|
+
x: mouseX,
|
|
169
|
+
y: mouseY,
|
|
170
|
+
})
|
|
171
|
+
|
|
172
|
+
const newTransform = compose(
|
|
173
|
+
transformRef.current,
|
|
174
|
+
translate(transformedPoint.x, transformedPoint.y),
|
|
175
|
+
scale(scaleMultiplier, scaleMultiplier),
|
|
176
|
+
translate(-transformedPoint.x, -transformedPoint.y),
|
|
177
|
+
)
|
|
178
|
+
|
|
179
|
+
updateTransform(newTransform)
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
[updateTransform],
|
|
107
183
|
)
|
|
108
184
|
|
|
109
185
|
useEffect(() => {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
186
|
+
const container = containerRef.current
|
|
187
|
+
if (container) {
|
|
188
|
+
container.addEventListener("wheel", handleWheel, { passive: false })
|
|
189
|
+
return () => {
|
|
190
|
+
container.removeEventListener("wheel", handleWheel)
|
|
191
|
+
}
|
|
113
192
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
elements = _soupPostProcessor(elements)
|
|
120
|
-
}
|
|
121
|
-
setElementsAndCamera(elements)
|
|
122
|
-
})
|
|
123
|
-
.catch((e) => {
|
|
124
|
-
console.error("ERROR RENDERING CIRCUIT")
|
|
125
|
-
throw e
|
|
126
|
-
})
|
|
127
|
-
}, [children])
|
|
193
|
+
}, [handleWheel])
|
|
194
|
+
|
|
195
|
+
if (errorFromChildren) {
|
|
196
|
+
return <div>Error: {errorFromChildren.message}</div>
|
|
197
|
+
}
|
|
128
198
|
|
|
129
199
|
return (
|
|
130
200
|
<>
|
|
@@ -136,13 +206,17 @@ export const SchematicWithoutContext = ({
|
|
|
136
206
|
overflow: "hidden",
|
|
137
207
|
position: "relative",
|
|
138
208
|
isolation: "isolate",
|
|
139
|
-
cursor: "grab",
|
|
209
|
+
cursor: isDraggingRef.current ? "grabbing" : "grab",
|
|
140
210
|
...style,
|
|
141
211
|
}}
|
|
142
212
|
ref={(el) => {
|
|
143
|
-
|
|
213
|
+
containerRef.current = el
|
|
144
214
|
boundsRef(el)
|
|
145
215
|
}}
|
|
216
|
+
onMouseDown={handleMouseDown}
|
|
217
|
+
onMouseMove={handleMouseMove}
|
|
218
|
+
onMouseUp={handleMouseUp}
|
|
219
|
+
onMouseLeave={handleMouseUp}
|
|
146
220
|
>
|
|
147
221
|
<SuperGrid
|
|
148
222
|
stringifyCoord={(x, y, z) => {
|
|
@@ -151,7 +225,7 @@ export const SchematicWithoutContext = ({
|
|
|
151
225
|
}}
|
|
152
226
|
width={bounds.width}
|
|
153
227
|
height={bounds.height}
|
|
154
|
-
transform={
|
|
228
|
+
transform={transformRef.current}
|
|
155
229
|
/>
|
|
156
230
|
{elements?.map((elm, i) => (
|
|
157
231
|
<ErrorBoundary key={i} fallbackRender={fallbackRender(elm)}>
|
|
@@ -163,7 +237,7 @@ export const SchematicWithoutContext = ({
|
|
|
163
237
|
</ErrorBoundary>
|
|
164
238
|
))}
|
|
165
239
|
</div>
|
|
166
|
-
{showTable !== false && elements && <TableViewer elements={elements} />}
|
|
240
|
+
{showTable !== false && elements && <TableViewer elements={elements as any} />}
|
|
167
241
|
</>
|
|
168
242
|
)
|
|
169
243
|
}
|
package/src/lib/types/core.ts
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
import { AnySourceComponent, SourceComponent } from "./source-component"
|
|
2
|
+
import {
|
|
3
|
+
Size,
|
|
4
|
+
Point,
|
|
5
|
+
PcbTrace,
|
|
6
|
+
PcbComponent,
|
|
7
|
+
PcbPort,
|
|
8
|
+
SourceGroup,
|
|
9
|
+
} from "circuit-json"
|
|
2
10
|
|
|
3
11
|
export interface SchematicConfig {
|
|
4
12
|
type: "schematic_config"
|
|
5
13
|
}
|
|
6
14
|
|
|
7
|
-
export interface Point {
|
|
8
|
-
x: number
|
|
9
|
-
y: number
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface Size {
|
|
13
|
-
width: number
|
|
14
|
-
height: number
|
|
15
|
-
}
|
|
16
|
-
|
|
17
15
|
export interface SourceConfig {
|
|
18
16
|
type: "source_config"
|
|
19
17
|
}
|
|
@@ -111,32 +109,6 @@ export interface SchematicPort {
|
|
|
111
109
|
facing_direction?: "up" | "down" | "left" | "right"
|
|
112
110
|
}
|
|
113
111
|
|
|
114
|
-
export interface PCBTrace {
|
|
115
|
-
type: "pcb_trace"
|
|
116
|
-
source_trace_id: string
|
|
117
|
-
pcb_trace_id: string
|
|
118
|
-
route: Array<{
|
|
119
|
-
x: number
|
|
120
|
-
y: number
|
|
121
|
-
strokeWidth: number
|
|
122
|
-
cap: "butt" | "round" | "square"
|
|
123
|
-
start_pcb_port_id?: string
|
|
124
|
-
end_pcb_port_id?: string
|
|
125
|
-
}>
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
export interface PCBComponent {
|
|
129
|
-
type: "pcb_component"
|
|
130
|
-
pcb_component_id: string
|
|
131
|
-
source_component_id: string
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
export interface PCBPort {
|
|
135
|
-
type: "pcb_port"
|
|
136
|
-
pcb_port_id: string
|
|
137
|
-
source_port_id: string
|
|
138
|
-
}
|
|
139
|
-
|
|
140
112
|
export interface PCBGroup {
|
|
141
113
|
type: "pcb_group"
|
|
142
114
|
source_group_id: string
|
|
@@ -153,13 +125,6 @@ export interface SourceTrace {
|
|
|
153
125
|
connected_source_port_ids: string[]
|
|
154
126
|
}
|
|
155
127
|
|
|
156
|
-
export interface SourceGroup {
|
|
157
|
-
type: "source_group"
|
|
158
|
-
source_group_id: string
|
|
159
|
-
name: string
|
|
160
|
-
children_source_component_ids: string[]
|
|
161
|
-
}
|
|
162
|
-
|
|
163
128
|
export interface SourcePort {
|
|
164
129
|
type: "source_port"
|
|
165
130
|
name: string
|
|
@@ -178,9 +143,9 @@ export interface Project {
|
|
|
178
143
|
schematic_ports: SchematicPort[]
|
|
179
144
|
pcb_config: PCBConfig
|
|
180
145
|
pcb_groups: PCBGroup[]
|
|
181
|
-
pcb_components:
|
|
182
|
-
pcb_traces:
|
|
183
|
-
pcb_ports:
|
|
146
|
+
pcb_components: PcbComponent[]
|
|
147
|
+
pcb_traces: PcbTrace[]
|
|
148
|
+
pcb_ports: PcbPort[]
|
|
184
149
|
source_config: SourceConfig
|
|
185
150
|
source_traces: SourceTrace[]
|
|
186
151
|
source_groups: SourceGroup[]
|
|
@@ -195,11 +160,11 @@ export type AnyElement =
|
|
|
195
160
|
| SourceGroup
|
|
196
161
|
| SourceTrace
|
|
197
162
|
| SourcePort
|
|
198
|
-
|
|
|
199
|
-
|
|
|
163
|
+
| PcbTrace
|
|
164
|
+
| PcbComponent
|
|
200
165
|
| PCBGroup
|
|
201
166
|
| PCBConfig
|
|
202
|
-
|
|
|
167
|
+
| PcbPort
|
|
203
168
|
| SchematicGroup
|
|
204
169
|
| SchematicComponent
|
|
205
170
|
| SchematicTrace
|
|
@@ -38,6 +38,10 @@ export interface SimpleBug extends SourceComponentBase {
|
|
|
38
38
|
manufacturerPartNumber: any
|
|
39
39
|
ftype: "simple_bug"
|
|
40
40
|
}
|
|
41
|
+
export interface SimpleChip extends SourceComponentBase {
|
|
42
|
+
manufacturerPartNumber: any
|
|
43
|
+
ftype: "simple_chip"
|
|
44
|
+
}
|
|
41
45
|
|
|
42
46
|
export interface SimplePowerSource extends SourceComponentBase {
|
|
43
47
|
ftype: "simple_power_source"
|
|
@@ -52,6 +56,7 @@ export type AnySourceComponent =
|
|
|
52
56
|
| SimpleResistor
|
|
53
57
|
| SimpleCapacitor
|
|
54
58
|
| SimpleBug
|
|
59
|
+
| SimpleChip
|
|
55
60
|
| SimpleInductor
|
|
56
61
|
| SimplePowerSource
|
|
57
62
|
| SimpleGround
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
// Kicad-2020 color scheme
|
|
2
|
+
export const colorMap = {
|
|
3
|
+
"3d_viewer": {
|
|
4
|
+
background_bottom: "rgb(102, 102, 128)",
|
|
5
|
+
background_top: "rgb(204, 204, 230)",
|
|
6
|
+
board: "rgb(51, 43, 23)",
|
|
7
|
+
copper: "rgb(179, 156, 0)",
|
|
8
|
+
silkscreen_bottom: "rgb(230, 230, 230)",
|
|
9
|
+
silkscreen_top: "rgb(230, 230, 230)",
|
|
10
|
+
soldermask: "rgb(20, 51, 36)",
|
|
11
|
+
solderpaste: "rgb(128, 128, 128)",
|
|
12
|
+
},
|
|
13
|
+
board: {
|
|
14
|
+
anchor: "rgb(255, 38, 226)",
|
|
15
|
+
aux_items: "rgb(255, 255, 255)",
|
|
16
|
+
b_adhes: "rgb(0, 0, 132)",
|
|
17
|
+
b_crtyd: "rgb(255, 38, 226)",
|
|
18
|
+
b_fab: "rgb(88, 93, 132)",
|
|
19
|
+
b_mask: "rgba(2, 255, 238, 0.400)",
|
|
20
|
+
b_paste: "rgb(0, 194, 194)",
|
|
21
|
+
b_silks: "rgb(232, 178, 167)",
|
|
22
|
+
background: "rgb(0, 16, 35)",
|
|
23
|
+
cmts_user: "rgb(89, 148, 220)",
|
|
24
|
+
copper: {
|
|
25
|
+
b: "rgb(77, 127, 196)",
|
|
26
|
+
f: "rgb(200, 52, 52)",
|
|
27
|
+
in1: "rgb(127, 200, 127)",
|
|
28
|
+
in10: "rgb(237, 124, 51)",
|
|
29
|
+
in11: "rgb(91, 195, 235)",
|
|
30
|
+
in12: "rgb(247, 111, 142)",
|
|
31
|
+
in13: "rgb(167, 165, 198)",
|
|
32
|
+
in14: "rgb(40, 204, 217)",
|
|
33
|
+
in15: "rgb(232, 178, 167)",
|
|
34
|
+
in16: "rgb(242, 237, 161)",
|
|
35
|
+
in17: "rgb(237, 124, 51)",
|
|
36
|
+
in18: "rgb(91, 195, 235)",
|
|
37
|
+
in19: "rgb(247, 111, 142)",
|
|
38
|
+
in2: "rgb(206, 125, 44)",
|
|
39
|
+
in20: "rgb(167, 165, 198)",
|
|
40
|
+
in21: "rgb(40, 204, 217)",
|
|
41
|
+
in22: "rgb(232, 178, 167)",
|
|
42
|
+
in23: "rgb(242, 237, 161)",
|
|
43
|
+
in24: "rgb(237, 124, 51)",
|
|
44
|
+
in25: "rgb(91, 195, 235)",
|
|
45
|
+
in26: "rgb(247, 111, 142)",
|
|
46
|
+
in27: "rgb(167, 165, 198)",
|
|
47
|
+
in28: "rgb(40, 204, 217)",
|
|
48
|
+
in29: "rgb(232, 178, 167)",
|
|
49
|
+
in3: "rgb(79, 203, 203)",
|
|
50
|
+
in30: "rgb(242, 237, 161)",
|
|
51
|
+
in4: "rgb(219, 98, 139)",
|
|
52
|
+
in5: "rgb(167, 165, 198)",
|
|
53
|
+
in6: "rgb(40, 204, 217)",
|
|
54
|
+
in7: "rgb(232, 178, 167)",
|
|
55
|
+
in8: "rgb(242, 237, 161)",
|
|
56
|
+
in9: "rgb(141, 203, 129)",
|
|
57
|
+
},
|
|
58
|
+
cursor: "rgb(255, 255, 255)",
|
|
59
|
+
drc: "rgb(194, 194, 194)",
|
|
60
|
+
drc_error: "rgba(215, 91, 107, 0.800)",
|
|
61
|
+
drc_exclusion: "rgb(255, 255, 255)",
|
|
62
|
+
drc_warning: "rgba(255, 208, 66, 0.902)",
|
|
63
|
+
dwgs_user: "rgb(194, 194, 194)",
|
|
64
|
+
eco1_user: "rgb(180, 219, 210)",
|
|
65
|
+
eco2_user: "rgb(216, 200, 82)",
|
|
66
|
+
edge_cuts: "rgb(208, 210, 205)",
|
|
67
|
+
f_adhes: "rgb(132, 0, 132)",
|
|
68
|
+
f_crtyd: "rgb(255, 0, 245)",
|
|
69
|
+
f_fab: "rgb(175, 175, 175)",
|
|
70
|
+
f_mask: "rgba(216, 100, 255, 0.400)",
|
|
71
|
+
f_paste: "rgba(180, 160, 154, 0.902)",
|
|
72
|
+
f_silks: "rgb(242, 237, 161)",
|
|
73
|
+
footprint_text_back: "rgb(0, 0, 132)",
|
|
74
|
+
footprint_text_front: "rgb(194, 194, 194)",
|
|
75
|
+
footprint_text_invisible: "rgb(132, 132, 132)",
|
|
76
|
+
grid: "rgb(132, 132, 132)",
|
|
77
|
+
grid_axes: "rgb(194, 194, 194)",
|
|
78
|
+
margin: "rgb(255, 38, 226)",
|
|
79
|
+
microvia: "rgb(0, 132, 132)",
|
|
80
|
+
no_connect: "rgb(0, 0, 132)",
|
|
81
|
+
pad_back: "rgb(77, 127, 196)",
|
|
82
|
+
pad_front: "rgb(200, 52, 52)",
|
|
83
|
+
pad_plated_hole: "rgb(194, 194, 0)",
|
|
84
|
+
pad_through_hole: "rgb(227, 183, 46)",
|
|
85
|
+
plated_hole: "rgb(26, 196, 210)",
|
|
86
|
+
ratsnest: "rgba(245, 255, 213, 0.702)",
|
|
87
|
+
select_overlay: "rgb(4, 255, 67)",
|
|
88
|
+
through_via: "rgb(236, 236, 236)",
|
|
89
|
+
user_1: "rgb(194, 194, 194)",
|
|
90
|
+
user_2: "rgb(89, 148, 220)",
|
|
91
|
+
user_3: "rgb(180, 219, 210)",
|
|
92
|
+
user_4: "rgb(216, 200, 82)",
|
|
93
|
+
user_5: "rgb(194, 194, 194)",
|
|
94
|
+
user_6: "rgb(89, 148, 220)",
|
|
95
|
+
user_7: "rgb(180, 219, 210)",
|
|
96
|
+
user_8: "rgb(216, 200, 82)",
|
|
97
|
+
user_9: "rgb(232, 178, 167)",
|
|
98
|
+
via_blind_buried: "rgb(187, 151, 38)",
|
|
99
|
+
via_hole: "rgb(227, 183, 46)",
|
|
100
|
+
via_micro: "rgb(0, 132, 132)",
|
|
101
|
+
via_through: "rgb(236, 236, 236)",
|
|
102
|
+
worksheet: "rgb(200, 114, 171)",
|
|
103
|
+
},
|
|
104
|
+
gerbview: {
|
|
105
|
+
axes: "rgb(0, 0, 132)",
|
|
106
|
+
background: "rgb(0, 0, 0)",
|
|
107
|
+
dcodes: "rgb(255, 255, 255)",
|
|
108
|
+
grid: "rgb(132, 132, 132)",
|
|
109
|
+
layers: [
|
|
110
|
+
"rgb(132, 0, 0)",
|
|
111
|
+
"rgb(194, 194, 0)",
|
|
112
|
+
"rgb(194, 0, 194)",
|
|
113
|
+
"rgb(194, 0, 0)",
|
|
114
|
+
"rgb(0, 132, 132)",
|
|
115
|
+
"rgb(0, 132, 0)",
|
|
116
|
+
"rgb(0, 0, 132)",
|
|
117
|
+
"rgb(132, 132, 132)",
|
|
118
|
+
"rgb(132, 0, 132)",
|
|
119
|
+
"rgb(194, 194, 194)",
|
|
120
|
+
"rgb(132, 0, 132)",
|
|
121
|
+
"rgb(132, 0, 0)",
|
|
122
|
+
"rgb(132, 132, 0)",
|
|
123
|
+
"rgb(194, 194, 194)",
|
|
124
|
+
"rgb(0, 0, 132)",
|
|
125
|
+
"rgb(0, 132, 0)",
|
|
126
|
+
"rgb(132, 0, 0)",
|
|
127
|
+
"rgb(194, 194, 0)",
|
|
128
|
+
"rgb(194, 0, 194)",
|
|
129
|
+
"rgb(194, 0, 0)",
|
|
130
|
+
"rgb(0, 132, 132)",
|
|
131
|
+
"rgb(0, 132, 0)",
|
|
132
|
+
"rgb(0, 0, 132)",
|
|
133
|
+
"rgb(132, 132, 132)",
|
|
134
|
+
"rgb(132, 0, 132)",
|
|
135
|
+
"rgb(194, 194, 194)",
|
|
136
|
+
"rgb(132, 0, 132)",
|
|
137
|
+
"rgb(132, 0, 0)",
|
|
138
|
+
"rgb(132, 132, 0)",
|
|
139
|
+
"rgb(194, 194, 194)",
|
|
140
|
+
"rgb(0, 0, 132)",
|
|
141
|
+
"rgb(0, 132, 0)",
|
|
142
|
+
"rgb(132, 0, 0)",
|
|
143
|
+
"rgb(194, 194, 0)",
|
|
144
|
+
"rgb(194, 0, 194)",
|
|
145
|
+
"rgb(194, 0, 0)",
|
|
146
|
+
"rgb(0, 132, 132)",
|
|
147
|
+
"rgb(0, 132, 0)",
|
|
148
|
+
"rgb(0, 0, 132)",
|
|
149
|
+
"rgb(132, 132, 132)",
|
|
150
|
+
"rgb(132, 0, 132)",
|
|
151
|
+
"rgb(194, 194, 194)",
|
|
152
|
+
"rgb(132, 0, 132)",
|
|
153
|
+
"rgb(132, 0, 0)",
|
|
154
|
+
"rgb(132, 132, 0)",
|
|
155
|
+
"rgb(194, 194, 194)",
|
|
156
|
+
"rgb(0, 0, 132)",
|
|
157
|
+
"rgb(0, 132, 0)",
|
|
158
|
+
"rgb(132, 0, 0)",
|
|
159
|
+
"rgb(194, 194, 0)",
|
|
160
|
+
"rgb(194, 0, 194)",
|
|
161
|
+
"rgb(194, 0, 0)",
|
|
162
|
+
"rgb(0, 132, 132)",
|
|
163
|
+
"rgb(0, 132, 0)",
|
|
164
|
+
"rgb(0, 0, 132)",
|
|
165
|
+
"rgb(132, 132, 132)",
|
|
166
|
+
"rgb(132, 0, 132)",
|
|
167
|
+
"rgb(194, 194, 194)",
|
|
168
|
+
"rgb(132, 0, 132)",
|
|
169
|
+
"rgb(132, 0, 0)",
|
|
170
|
+
],
|
|
171
|
+
negative_objects: "rgb(132, 132, 132)",
|
|
172
|
+
worksheet: "rgb(0, 0, 132)",
|
|
173
|
+
},
|
|
174
|
+
meta: {
|
|
175
|
+
filename: "kicad_2020",
|
|
176
|
+
name: "KiCad 2020",
|
|
177
|
+
version: 2,
|
|
178
|
+
},
|
|
179
|
+
palette: [
|
|
180
|
+
"rgb(132, 0, 0)",
|
|
181
|
+
"rgb(194, 194, 0)",
|
|
182
|
+
"rgb(194, 0, 194)",
|
|
183
|
+
"rgb(194, 0, 0)",
|
|
184
|
+
"rgb(0, 132, 132)",
|
|
185
|
+
"rgb(0, 132, 0)",
|
|
186
|
+
"rgb(0, 0, 132)",
|
|
187
|
+
"rgb(132, 132, 132)",
|
|
188
|
+
"rgb(132, 0, 132)",
|
|
189
|
+
"rgb(194, 194, 194)",
|
|
190
|
+
"rgb(132, 0, 132)",
|
|
191
|
+
"rgb(132, 0, 0)",
|
|
192
|
+
"rgb(132, 132, 0)",
|
|
193
|
+
"rgb(194, 194, 194)",
|
|
194
|
+
"rgb(0, 0, 132)",
|
|
195
|
+
"rgb(0, 132, 0)",
|
|
196
|
+
],
|
|
197
|
+
schematic: {
|
|
198
|
+
aux_items: "rgb(46, 46, 46)",
|
|
199
|
+
background: "rgb(245, 241, 237)",
|
|
200
|
+
brightened: "rgb(255, 0, 255)",
|
|
201
|
+
bus: "rgb(0, 0, 132)",
|
|
202
|
+
bus_junction: "rgb(0, 0, 132)",
|
|
203
|
+
component_body: "rgb(255, 255, 194)",
|
|
204
|
+
component_outline: "rgb(132, 0, 0)",
|
|
205
|
+
cursor: "rgb(15, 15, 15)",
|
|
206
|
+
erc_error: "rgba(230, 9, 13, 0.800)",
|
|
207
|
+
erc_warning: "rgba(209, 146, 0, 0.800)",
|
|
208
|
+
fields: "rgb(132, 0, 132)",
|
|
209
|
+
grid: "rgb(181, 181, 181)",
|
|
210
|
+
grid_axes: "rgb(0, 0, 132)",
|
|
211
|
+
hidden: "rgb(194, 194, 194)",
|
|
212
|
+
junction: "rgb(0, 150, 0)",
|
|
213
|
+
label_global: "rgb(132, 0, 0)",
|
|
214
|
+
label_hier: "rgb(114, 86, 0)",
|
|
215
|
+
label_local: "rgb(15, 15, 15)",
|
|
216
|
+
net_name: "rgb(132, 132, 132)",
|
|
217
|
+
no_connect: "rgb(0, 0, 132)",
|
|
218
|
+
note: "rgb(0, 0, 194)",
|
|
219
|
+
override_item_colors: false,
|
|
220
|
+
pin: "rgb(132, 0, 0)",
|
|
221
|
+
pin_name: "rgb(0, 100, 100)",
|
|
222
|
+
pin_number: "rgb(169, 0, 0)",
|
|
223
|
+
reference: "rgb(0, 100, 100)",
|
|
224
|
+
shadow: "rgba(102, 179, 255, 0.800)",
|
|
225
|
+
sheet: "rgb(132, 0, 0)",
|
|
226
|
+
sheet_background: "rgba(253, 255, 231, 0.000)",
|
|
227
|
+
sheet_fields: "rgb(132, 0, 132)",
|
|
228
|
+
sheet_filename: "rgb(114, 86, 0)",
|
|
229
|
+
sheet_label: "rgb(0, 100, 100)",
|
|
230
|
+
sheet_name: "rgb(0, 100, 100)",
|
|
231
|
+
value: "rgb(0, 100, 100)",
|
|
232
|
+
wire: "rgb(0, 150, 0)",
|
|
233
|
+
worksheet: "rgb(132, 0, 0)",
|
|
234
|
+
},
|
|
235
|
+
}
|
|
236
|
+
|