circuitscript 0.0.13 → 0.0.14
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/__tests__/renderData/script1.cst.svg +1 -1
- package/__tests__/renderData/script2.cst.svg +1 -1
- package/__tests__/renderData/script3.cst.svg +1 -1
- package/__tests__/renderData/script4.cst.svg +1 -1
- package/__tests__/renderData/script5.cst.svg +1 -1
- package/build/src/draw_symbols.js +2 -4
- package/build/src/globals.js +2 -1
- package/build/src/helpers.js +69 -0
- package/build/src/main.js +2 -69
- package/build/src/regenerate-tests.js +1 -1
- package/build/src/sizing.js +4 -10
- package/package.json +1 -1
- package/src/draw_symbols.ts +3 -7
- package/src/geometry.ts +2 -1
- package/src/globals.ts +3 -1
- package/src/helpers.ts +111 -0
- package/src/main.ts +2 -112
- package/src/regenerate-tests.ts +1 -1
- package/src/sizing.ts +5 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.dev/svgjs" width="410" height="510.5" viewBox="-25 -25.5 410 510.5"><g transform="matrix(1,0,0,1,0,0)"><path d="M -20 -20.5 L -20 480 M 0 -20.5 L 0 480 M 20 -20.5 L 20 480 M 40 -20.5 L 40 480 M 60 -20.5 L 60 480 M 80 -20.5 L 80 480 M 100 -20.5 L 100 480 M 120 -20.5 L 120 480 M 140 -20.5 L 140 480 M 160 -20.5 L 160 480 M 180 -20.5 L 180 480 M 200 -20.5 L 200 480 M 220 -20.5 L 220 480 M 240 -20.5 L 240 480 M 260 -20.5 L 260 480 M 280 -20.5 L 280 480 M 300 -20.5 L 300 480 M 320 -20.5 L 320 480 M 340 -20.5 L 340 480 M 360 -20.5 L 360 480 M 380 -20.5 L 380 480" fill="none" stroke-dasharray="1,19" stroke-width="1" stroke="#aaaaaa"></path></g><g transform="matrix(1,0,0,1,20,30)"><g><path d="M -15 0 L 15 0" stroke-width="1" stroke="#333333" fill="none"></path><path d="M 0 10 L 0 0" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Inter" font-size="10" text-anchor="middle" dominant-baseline="text-top" transform="matrix(1,0,0,1,0,-5)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">5V</tspan></text></g></g><g transform="matrix(1,0,0,1,20.000000000000004,120)"><g><path d="M 9.999999999999998 -20 L 10.000000000000002 20 L -9.999999999999998 20 L -10.000000000000002 -20 Z" stroke-width="1" stroke="#333333" fill="#ffffff"></path><path d="M -2.4492935982947065e-15 -40 L -1.2246467991473533e-15 -20 M 2.4492935982947065e-15 40 L 1.2246467991473533e-15 20" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Inter" font-size="10" text-anchor="middle" dominant-baseline="middle" transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,-1,6.123233995736766e-17)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">10k</tspan></text><text fill="#333333" font-family="Inter" font-size="10" text-anchor="start" dominant-baseline="text-top" transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,14.999999999999998,-20)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">R1</tspan></text><path d="M -10.000000000000002 -40 L 10.000000000000002 40 M 10.000000000000002 -40 L -10.000000000000002 40" stroke-width="2" stroke="red"></path></g></g><g transform="matrix(1,0,0,1,20.000000000000004,190)"><g><path d="M -10 0 L 10 0 L 0 10 Z" stroke-width="1" stroke="#333333" fill="#ffffff"></path><path d="M 0 -10 L 0 0" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Inter" font-size="10" text-anchor="middle" dominant-baseline="text-top" transform="matrix(1,0,0,1,0,20)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">GND</tspan></text></g></g><g transform="matrix(1,0,0,1,60,120)"><g><path d="M 9.999999999999998 -20 L 10.000000000000002 20 L -9.999999999999998 20 L -10.000000000000002 -20 Z" stroke-width="1" stroke="#333333" fill="#ffffff"></path><path d="M -2.4492935982947065e-15 -40 L -1.2246467991473533e-15 -20 M 2.4492935982947065e-15 40 L 1.2246467991473533e-15 20" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Inter" font-size="10" text-anchor="middle" dominant-baseline="middle" transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,-1,6.123233995736766e-17)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">20k</tspan></text><text fill="#333333" font-family="Inter" font-size="10" text-anchor="start" dominant-baseline="text-top" transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,14.999999999999998,-20)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">R2</tspan></text></g></g><g transform="matrix(1,0,0,1,60,190)"><g><path d="M -10 0 L 10 0 L 0 10 Z" stroke-width="1" stroke="#333333" fill="#ffffff"></path><path d="M 0 -10 L 0 0" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Inter" font-size="10" text-anchor="middle" dominant-baseline="text-top" transform="matrix(1,0,0,1,0,20)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">GND</tspan></text></g></g><g transform="matrix(1,0,0,1,100,100)"><g><path d="M -10 -3 L 10 -3" stroke-width="1" stroke="#333333" fill="none"></path><path d="M -10 3 L 10 3" stroke-width="1" stroke="#333333" fill="none"></path><path d="M 0 -20 L 0 -3 M 0 20 L 0 3" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Inter" font-size="10" text-anchor="start" dominant-baseline="text-top" transform="matrix(1,0,0,1,12,0)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">C1</tspan></text><text fill="#333333" font-family="Inter" font-size="10" text-anchor="start" dominant-baseline="hanging" transform="matrix(1,0,0,1,12,5)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">100n</tspan></text></g></g><g transform="matrix(1,0,0,1,100,150)"><g><path d="M -10 0 L 10 0 L 0 10 Z" stroke-width="1" stroke="#333333" fill="#ffffff"></path><path d="M 0 -10 L 0 0" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Inter" font-size="10" text-anchor="middle" dominant-baseline="text-top" transform="matrix(1,0,0,1,0,20)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">GND</tspan></text></g></g><g transform="matrix(1,0,0,1,140,60)"><g><path d="M 0 0 L 0 0" stroke-width="2" stroke="#333333"></path></g></g><g transform="matrix(1,0,0,1,210,80)"><g><path d="M -50 -40 L 50 -40 L 50 40 L -50 40 Z" stroke-width="1" stroke="#333333" fill="#fffeaf"></path><path d="M -70 -20 L -50 -20 M -70 0 L -50 0 M -70 20 L -50 20 M 70 -20 L 50 -20 M 70 0 L 50 0 M 70 20 L 50 20" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Inter" font-size="10" text-anchor="start" dominant-baseline="middle" transform="matrix(1,0,0,1,-46,-20)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">1</tspan></text><text fill="#333333" font-family="Inter" font-size="8" text-anchor="end" dominant-baseline="text-top" transform="matrix(1,0,0,1,-52,-22)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">1</tspan></text><text fill="#333333" font-family="Inter" font-size="10" text-anchor="start" dominant-baseline="middle" transform="matrix(1,0,0,1,-46,0)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">2</tspan></text><text fill="#333333" font-family="Inter" font-size="8" text-anchor="end" dominant-baseline="text-top" transform="matrix(1,0,0,1,-52,-2)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">2</tspan></text><text fill="#333333" font-family="Inter" font-size="10" text-anchor="start" dominant-baseline="middle" transform="matrix(1,0,0,1,-46,20)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">3</tspan></text><text fill="#333333" font-family="Inter" font-size="8" text-anchor="end" dominant-baseline="text-top" transform="matrix(1,0,0,1,-52,18)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">3</tspan></text><text fill="#333333" font-family="Inter" font-size="10" text-anchor="end" dominant-baseline="middle" transform="matrix(1,0,0,1,46,-20)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">6</tspan></text><text fill="#333333" font-family="Inter" font-size="8" text-anchor="start" dominant-baseline="text-top" transform="matrix(1,0,0,1,52,-22)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">6</tspan></text><text fill="#333333" font-family="Inter" font-size="10" text-anchor="end" dominant-baseline="middle" transform="matrix(1,0,0,1,46,0)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">5</tspan></text><text fill="#333333" font-family="Inter" font-size="8" text-anchor="start" dominant-baseline="text-top" transform="matrix(1,0,0,1,52,-2)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">5</tspan></text><text fill="#333333" font-family="Inter" font-size="10" text-anchor="end" dominant-baseline="middle" transform="matrix(1,0,0,1,46,20)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">4</tspan></text><text fill="#333333" font-family="Inter" font-size="8" text-anchor="start" dominant-baseline="text-top" transform="matrix(1,0,0,1,52,18)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">4</tspan></text><text fill="#333333" font-family="Inter" font-size="10" text-anchor="start" dominant-baseline="text-top" transform="matrix(1,0,0,1,-50,-44)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">tmp</tspan></text></g></g><g transform="matrix(1,0,0,1,300,130)"><g><path d="M -10 0 L 10 0 L 0 10 Z" stroke-width="1" stroke="#333333" fill="#ffffff"></path><path d="M 0 -10 L 0 0" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Inter" font-size="10" text-anchor="middle" dominant-baseline="text-top" transform="matrix(1,0,0,1,0,20)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">GND</tspan></text></g></g><g transform="matrix(1,0,0,1,340,140)"><g><path d="M 9.999999999999998 -20 L 10.000000000000002 20 L -9.999999999999998 20 L -10.000000000000002 -20 Z" stroke-width="1" stroke="#333333" fill="#ffffff"></path><path d="M -2.4492935982947065e-15 -40 L -1.2246467991473533e-15 -20 M 2.4492935982947065e-15 40 L 1.2246467991473533e-15 20" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Inter" font-size="10" text-anchor="middle" dominant-baseline="middle" transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,-1,6.123233995736766e-17)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">10k</tspan></text><text fill="#333333" font-family="Inter" font-size="10" text-anchor="start" dominant-baseline="text-top" transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,14.999999999999998,-20)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">R3</tspan></text><path d="M -10.000000000000002 -40 L 10.000000000000002 40 M 10.000000000000002 -40 L -10.000000000000002 40" stroke-width="2" stroke="red"></path></g></g><g transform="matrix(1,0,0,1,340,210)"><g><path d="M -10 0 L 10 0 L 0 10 Z" stroke-width="1" stroke="#333333" fill="#ffffff"></path><path d="M 0 -10 L 0 0" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Inter" font-size="10" text-anchor="middle" dominant-baseline="text-top" transform="matrix(1,0,0,1,0,20)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">GND</tspan></text></g></g><g transform="matrix(1,0,0,1,180,290)"><g><path d="M -15 0 L 15 0" stroke-width="1" stroke="#333333" fill="none"></path><path d="M 0 10 L 0 0" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Inter" font-size="10" text-anchor="middle" dominant-baseline="text-top" transform="matrix(1,0,0,1,0,-5)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">3V</tspan></text></g></g><g transform="matrix(1,0,0,1,180,360)"><g><path d="M 9.999999999999998 -20 L 10.000000000000002 20 L -9.999999999999998 20 L -10.000000000000002 -20 Z" stroke-width="1" stroke="#333333" fill="#ffffff"></path><path d="M -2.4492935982947065e-15 -40 L -1.2246467991473533e-15 -20 M 2.4492935982947065e-15 40 L 1.2246467991473533e-15 20" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Inter" font-size="10" text-anchor="middle" dominant-baseline="middle" transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,-1,6.123233995736766e-17)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">20k</tspan></text><text fill="#333333" font-family="Inter" font-size="10" text-anchor="start" dominant-baseline="text-top" transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,14.999999999999998,-20)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">R4</tspan></text></g></g><g transform="matrix(1,0,0,1,180,430)"><g><path d="M -10 0 L 10 0 L 0 10 Z" stroke-width="1" stroke="#333333" fill="#ffffff"></path><path d="M 0 -10 L 0 0" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Inter" font-size="10" text-anchor="middle" dominant-baseline="text-top" transform="matrix(1,0,0,1,0,20)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">GND</tspan></text></g></g><g><line x1="20" y1="40" x2="20" y2="60" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="20" y1="60" x2="20" y2="80" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="20" y1="60" x2="60" y2="60" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="60" y1="60" x2="60" y2="80" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="60" y1="60" x2="100" y2="60" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="100" y1="60" x2="100" y2="80" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="100" y1="60" x2="140" y2="60" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><circle r="2.5" cx="2.5" cy="2.5" transform="matrix(1,0,0,1,17.5,57.5)" fill="#008400" stroke="none"></circle><circle r="2.5" cx="2.5" cy="2.5" transform="matrix(1,0,0,1,57.5,57.5)" fill="#008400" stroke="none"></circle><circle r="2.5" cx="2.5" cy="2.5" transform="matrix(1,0,0,1,97.5,57.5)" fill="#008400" stroke="none"></circle><line x1="20.000000000000004" y1="160" x2="20.000000000000004" y2="180" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="60" y1="160" x2="60" y2="180" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="100" y1="120" x2="100" y2="140" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="280" y1="100" x2="300" y2="100" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="300" y1="100" x2="300" y2="120" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="340" y1="180" x2="340" y2="200" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="180" y1="400" x2="180" y2="420" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="280" y1="80" x2="340" y2="80" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="340" y1="80" x2="340" y2="100" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="180" y1="300" x2="180" y2="320" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line></g><g></g></svg>
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.dev/svgjs" width="410" height="510.5" viewBox="-25 -25.5 410 510.5"><g transform="matrix(1,0,0,1,0,0)"><path d="M -20 -20.5 L -20 480 M 0 -20.5 L 0 480 M 20 -20.5 L 20 480 M 40 -20.5 L 40 480 M 60 -20.5 L 60 480 M 80 -20.5 L 80 480 M 100 -20.5 L 100 480 M 120 -20.5 L 120 480 M 140 -20.5 L 140 480 M 160 -20.5 L 160 480 M 180 -20.5 L 180 480 M 200 -20.5 L 200 480 M 220 -20.5 L 220 480 M 240 -20.5 L 240 480 M 260 -20.5 L 260 480 M 280 -20.5 L 280 480 M 300 -20.5 L 300 480 M 320 -20.5 L 320 480 M 340 -20.5 L 340 480 M 360 -20.5 L 360 480 M 380 -20.5 L 380 480" fill="none" stroke-dasharray="1,19" stroke-width="1" stroke="#aaaaaa"></path></g><g transform="matrix(1,0,0,1,20,30)"><g><path d="M -15 0 L 15 0" stroke-width="1" stroke="#333333" fill="none"></path><path d="M 0 10 L 0 0" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="middle" dominant-baseline="text-top" font-weight="regular" transform="matrix(1,0,0,1,0,-5)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">5V</tspan></text></g></g><g transform="matrix(1,0,0,1,20.000000000000004,120)"><g><path d="M 9.999999999999998 -20 L 10.000000000000002 20 L -9.999999999999998 20 L -10.000000000000002 -20 Z" stroke-width="1" stroke="#333333" fill="#ffffff"></path><path d="M -2.4492935982947065e-15 -40 L -1.2246467991473533e-15 -20 M 2.4492935982947065e-15 40 L 1.2246467991473533e-15 20" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="middle" dominant-baseline="middle" font-weight="regular" transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,-1,6.123233995736766e-17)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">10k</tspan></text><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="start" dominant-baseline="text-top" font-weight="regular" transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,14.999999999999998,-20)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">R1</tspan></text><path d="M -10.000000000000002 -40 L 10.000000000000002 40 M 10.000000000000002 -40 L -10.000000000000002 40" stroke-width="2" stroke="red"></path></g></g><g transform="matrix(1,0,0,1,20.000000000000004,190)"><g><path d="M -10 0 L 10 0 L 0 10 Z" stroke-width="1" stroke="#333333" fill="#ffffff"></path><path d="M 0 -10 L 0 0" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="middle" dominant-baseline="text-top" font-weight="regular" transform="matrix(1,0,0,1,0,20)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">GND</tspan></text></g></g><g transform="matrix(1,0,0,1,60,120)"><g><path d="M 9.999999999999998 -20 L 10.000000000000002 20 L -9.999999999999998 20 L -10.000000000000002 -20 Z" stroke-width="1" stroke="#333333" fill="#ffffff"></path><path d="M -2.4492935982947065e-15 -40 L -1.2246467991473533e-15 -20 M 2.4492935982947065e-15 40 L 1.2246467991473533e-15 20" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="middle" dominant-baseline="middle" font-weight="regular" transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,-1,6.123233995736766e-17)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">20k</tspan></text><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="start" dominant-baseline="text-top" font-weight="regular" transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,14.999999999999998,-20)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">R2</tspan></text></g></g><g transform="matrix(1,0,0,1,60,190)"><g><path d="M -10 0 L 10 0 L 0 10 Z" stroke-width="1" stroke="#333333" fill="#ffffff"></path><path d="M 0 -10 L 0 0" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="middle" dominant-baseline="text-top" font-weight="regular" transform="matrix(1,0,0,1,0,20)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">GND</tspan></text></g></g><g transform="matrix(1,0,0,1,100,100)"><g><path d="M -10 -3 L 10 -3" stroke-width="1" stroke="#333333" fill="none"></path><path d="M -10 3 L 10 3" stroke-width="1" stroke="#333333" fill="none"></path><path d="M 0 -20 L 0 -3 M 0 20 L 0 3" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="start" dominant-baseline="text-top" font-weight="regular" transform="matrix(1,0,0,1,12,0)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">C1</tspan></text><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="start" dominant-baseline="hanging" font-weight="regular" transform="matrix(1,0,0,1,12,5)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">100n</tspan></text></g></g><g transform="matrix(1,0,0,1,100,150)"><g><path d="M -10 0 L 10 0 L 0 10 Z" stroke-width="1" stroke="#333333" fill="#ffffff"></path><path d="M 0 -10 L 0 0" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="middle" dominant-baseline="text-top" font-weight="regular" transform="matrix(1,0,0,1,0,20)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">GND</tspan></text></g></g><g transform="matrix(1,0,0,1,140,60)"><g><path d="M 0 0 L 0 0" stroke-width="2" stroke="#333333"></path></g></g><g transform="matrix(1,0,0,1,210,80)"><g><path d="M -50 -40 L 50 -40 L 50 40 L -50 40 Z" stroke-width="1" stroke="#333333" fill="#fffeaf"></path><path d="M -70 -20 L -50 -20 M -70 0 L -50 0 M -70 20 L -50 20 M 70 -20 L 50 -20 M 70 0 L 50 0 M 70 20 L 50 20" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="start" dominant-baseline="middle" font-weight="regular" transform="matrix(1,0,0,1,-46,-20)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">1</tspan></text><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="8" text-anchor="end" dominant-baseline="text-top" font-weight="regular" transform="matrix(1,0,0,1,-52,-22)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">1</tspan></text><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="start" dominant-baseline="middle" font-weight="regular" transform="matrix(1,0,0,1,-46,0)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">2</tspan></text><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="8" text-anchor="end" dominant-baseline="text-top" font-weight="regular" transform="matrix(1,0,0,1,-52,-2)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">2</tspan></text><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="start" dominant-baseline="middle" font-weight="regular" transform="matrix(1,0,0,1,-46,20)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">3</tspan></text><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="8" text-anchor="end" dominant-baseline="text-top" font-weight="regular" transform="matrix(1,0,0,1,-52,18)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">3</tspan></text><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="end" dominant-baseline="middle" font-weight="regular" transform="matrix(1,0,0,1,46,-20)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">6</tspan></text><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="8" text-anchor="start" dominant-baseline="text-top" font-weight="regular" transform="matrix(1,0,0,1,52,-22)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">6</tspan></text><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="end" dominant-baseline="middle" font-weight="regular" transform="matrix(1,0,0,1,46,0)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">5</tspan></text><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="8" text-anchor="start" dominant-baseline="text-top" font-weight="regular" transform="matrix(1,0,0,1,52,-2)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">5</tspan></text><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="end" dominant-baseline="middle" font-weight="regular" transform="matrix(1,0,0,1,46,20)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">4</tspan></text><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="8" text-anchor="start" dominant-baseline="text-top" font-weight="regular" transform="matrix(1,0,0,1,52,18)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">4</tspan></text><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="start" dominant-baseline="text-top" font-weight="regular" transform="matrix(1,0,0,1,-50,-44)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">tmp</tspan></text></g></g><g transform="matrix(1,0,0,1,300,130)"><g><path d="M -10 0 L 10 0 L 0 10 Z" stroke-width="1" stroke="#333333" fill="#ffffff"></path><path d="M 0 -10 L 0 0" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="middle" dominant-baseline="text-top" font-weight="regular" transform="matrix(1,0,0,1,0,20)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">GND</tspan></text></g></g><g transform="matrix(1,0,0,1,340,140)"><g><path d="M 9.999999999999998 -20 L 10.000000000000002 20 L -9.999999999999998 20 L -10.000000000000002 -20 Z" stroke-width="1" stroke="#333333" fill="#ffffff"></path><path d="M -2.4492935982947065e-15 -40 L -1.2246467991473533e-15 -20 M 2.4492935982947065e-15 40 L 1.2246467991473533e-15 20" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="middle" dominant-baseline="middle" font-weight="regular" transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,-1,6.123233995736766e-17)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">10k</tspan></text><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="start" dominant-baseline="text-top" font-weight="regular" transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,14.999999999999998,-20)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">R3</tspan></text><path d="M -10.000000000000002 -40 L 10.000000000000002 40 M 10.000000000000002 -40 L -10.000000000000002 40" stroke-width="2" stroke="red"></path></g></g><g transform="matrix(1,0,0,1,340,210)"><g><path d="M -10 0 L 10 0 L 0 10 Z" stroke-width="1" stroke="#333333" fill="#ffffff"></path><path d="M 0 -10 L 0 0" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="middle" dominant-baseline="text-top" font-weight="regular" transform="matrix(1,0,0,1,0,20)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">GND</tspan></text></g></g><g transform="matrix(1,0,0,1,180,290)"><g><path d="M -15 0 L 15 0" stroke-width="1" stroke="#333333" fill="none"></path><path d="M 0 10 L 0 0" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="middle" dominant-baseline="text-top" font-weight="regular" transform="matrix(1,0,0,1,0,-5)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">3V</tspan></text></g></g><g transform="matrix(1,0,0,1,180,360)"><g><path d="M 9.999999999999998 -20 L 10.000000000000002 20 L -9.999999999999998 20 L -10.000000000000002 -20 Z" stroke-width="1" stroke="#333333" fill="#ffffff"></path><path d="M -2.4492935982947065e-15 -40 L -1.2246467991473533e-15 -20 M 2.4492935982947065e-15 40 L 1.2246467991473533e-15 20" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="middle" dominant-baseline="middle" font-weight="regular" transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,-1,6.123233995736766e-17)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">20k</tspan></text><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="start" dominant-baseline="text-top" font-weight="regular" transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,14.999999999999998,-20)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">R4</tspan></text></g></g><g transform="matrix(1,0,0,1,180,430)"><g><path d="M -10 0 L 10 0 L 0 10 Z" stroke-width="1" stroke="#333333" fill="#ffffff"></path><path d="M 0 -10 L 0 0" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="middle" dominant-baseline="text-top" font-weight="regular" transform="matrix(1,0,0,1,0,20)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">GND</tspan></text></g></g><g><line x1="20" y1="40" x2="20" y2="60" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="20" y1="60" x2="20" y2="80" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="20" y1="60" x2="60" y2="60" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="60" y1="60" x2="60" y2="80" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="60" y1="60" x2="100" y2="60" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="100" y1="60" x2="100" y2="80" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="100" y1="60" x2="140" y2="60" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><circle r="2.5" cx="2.5" cy="2.5" transform="matrix(1,0,0,1,17.5,57.5)" fill="#008400" stroke="none"></circle><circle r="2.5" cx="2.5" cy="2.5" transform="matrix(1,0,0,1,57.5,57.5)" fill="#008400" stroke="none"></circle><circle r="2.5" cx="2.5" cy="2.5" transform="matrix(1,0,0,1,97.5,57.5)" fill="#008400" stroke="none"></circle><line x1="20.000000000000004" y1="160" x2="20.000000000000004" y2="180" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="60" y1="160" x2="60" y2="180" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="100" y1="120" x2="100" y2="140" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="280" y1="100" x2="300" y2="100" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="300" y1="100" x2="300" y2="120" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="340" y1="180" x2="340" y2="200" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="180" y1="400" x2="180" y2="420" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="280" y1="80" x2="340" y2="80" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="340" y1="80" x2="340" y2="100" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="180" y1="300" x2="180" y2="320" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line></g><g></g></svg>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.dev/svgjs" width="290" height="150.5" viewBox="-25 -25.5 290 150.5"><g transform="matrix(1,0,0,1,0,0)"><path d="M -20 -20.5 L -20 120 M 0 -20.5 L 0 120 M 20 -20.5 L 20 120 M 40 -20.5 L 40 120 M 60 -20.5 L 60 120 M 80 -20.5 L 80 120 M 100 -20.5 L 100 120 M 120 -20.5 L 120 120 M 140 -20.5 L 140 120 M 160 -20.5 L 160 120 M 180 -20.5 L 180 120 M 200 -20.5 L 200 120 M 220 -20.5 L 220 120 M 240 -20.5 L 240 120 M 260 -20.5 L 260 120" fill="none" stroke-dasharray="1,19" stroke-width="1" stroke="#aaaaaa"></path></g><g transform="matrix(1,0,0,1,30,20)"><g><path d="M -9.18485099360515e-16 15 L 9.18485099360515e-16 -15" stroke-width="1" stroke="#333333" fill="none"></path><path d="M 10 6.123233995736766e-16 L 0 0" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.dev/svgjs" width="290" height="150.5" viewBox="-25 -25.5 290 150.5"><g transform="matrix(1,0,0,1,0,0)"><path d="M -20 -20.5 L -20 120 M 0 -20.5 L 0 120 M 20 -20.5 L 20 120 M 40 -20.5 L 40 120 M 60 -20.5 L 60 120 M 80 -20.5 L 80 120 M 100 -20.5 L 100 120 M 120 -20.5 L 120 120 M 140 -20.5 L 140 120 M 160 -20.5 L 160 120 M 180 -20.5 L 180 120 M 200 -20.5 L 200 120 M 220 -20.5 L 220 120 M 240 -20.5 L 240 120 M 260 -20.5 L 260 120" fill="none" stroke-dasharray="1,19" stroke-width="1" stroke="#aaaaaa"></path></g><g transform="matrix(1,0,0,1,30,20)"><g><path d="M -9.18485099360515e-16 15 L 9.18485099360515e-16 -15" stroke-width="1" stroke="#333333" fill="none"></path><path d="M 10 6.123233995736766e-16 L 0 0" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="middle" dominant-baseline="text-top" font-weight="regular" transform="matrix(6.123233995736766e-17,-1,1,6.123233995736766e-17,-5,-3.061616997868383e-16)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">5V</tspan></text></g></g><g transform="matrix(1,0,0,1,120,20)"><g><path d="M -20 -10 L 20 -10 L 20 10 L -20 10 Z" stroke-width="1" stroke="#333333" fill="#ffffff"></path><path d="M -40 0 L -20 0 M 40 0 L 20 0" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="middle" dominant-baseline="middle" font-weight="regular" transform="matrix(1,0,0,1,0,1)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">10k</tspan></text><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="start" dominant-baseline="text-top" font-weight="regular" transform="matrix(1,0,0,1,-20,-15)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">R1</tspan></text></g></g><g transform="matrix(1,0,0,1,210,20)"><g><path d="M -6.123233995736766e-16 10 L 6.123233995736766e-16 -10 L 10 6.123233995736766e-16 Z" stroke-width="1" stroke="#333333" fill="#ffffff"></path><path d="M -10 -6.123233995736766e-16 L 0 0" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="middle" dominant-baseline="text-top" font-weight="regular" transform="matrix(6.123233995736766e-17,-1,1,6.123233995736766e-17,20,1.2246467991473533e-15)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">GND</tspan></text></g></g><g transform="matrix(1,0,0,1,30,80)"><g><path d="M -9.18485099360515e-16 15 L 9.18485099360515e-16 -15" stroke-width="1" stroke="#333333" fill="none"></path><path d="M 10 6.123233995736766e-16 L 0 0" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="middle" dominant-baseline="text-top" font-weight="regular" transform="matrix(6.123233995736766e-17,-1,1,6.123233995736766e-17,-5,-3.061616997868383e-16)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">5V</tspan></text></g></g><g transform="matrix(1,0,0,1,120,80)"><g><path d="M -20 -10 L 20 -10 L 20 10 L -20 10 Z" stroke-width="1" stroke="#333333" fill="#ffffff"></path><path d="M -40 0 L -20 0 M 40 0 L 20 0" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="middle" dominant-baseline="middle" font-weight="regular" transform="matrix(1,0,0,1,0,1)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">10k</tspan></text><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="start" dominant-baseline="text-top" font-weight="regular" transform="matrix(1,0,0,1,-20,-15)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">R2</tspan></text></g></g><g transform="matrix(1,0,0,1,210,80)"><g><path d="M -6.123233995736766e-16 10 L 6.123233995736766e-16 -10 L 10 6.123233995736766e-16 Z" stroke-width="1" stroke="#333333" fill="#ffffff"></path><path d="M -10 -6.123233995736766e-16 L 0 0" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="middle" dominant-baseline="text-top" font-weight="regular" transform="matrix(6.123233995736766e-17,-1,1,6.123233995736766e-17,20,1.2246467991473533e-15)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">GND</tspan></text></g></g><g><line x1="40" y1="20" x2="80" y2="20" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="40" y1="80" x2="80" y2="80" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="160" y1="20" x2="200" y2="20" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="160" y1="80" x2="200" y2="80" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line></g><g></g></svg>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.dev/svgjs" width="410" height="790.5" viewBox="-25 -25.5 410 790.5"><g transform="matrix(1,0,0,1,0,0)"><path d="M -20 -20.5 L -20 760 M 0 -20.5 L 0 760 M 20 -20.5 L 20 760 M 40 -20.5 L 40 760 M 60 -20.5 L 60 760 M 80 -20.5 L 80 760 M 100 -20.5 L 100 760 M 120 -20.5 L 120 760 M 140 -20.5 L 140 760 M 160 -20.5 L 160 760 M 180 -20.5 L 180 760 M 200 -20.5 L 200 760 M 220 -20.5 L 220 760 M 240 -20.5 L 240 760 M 260 -20.5 L 260 760 M 280 -20.5 L 280 760 M 300 -20.5 L 300 760 M 320 -20.5 L 320 760 M 340 -20.5 L 340 760 M 360 -20.5 L 360 760 M 380 -20.5 L 380 760" fill="none" stroke-dasharray="1,19" stroke-width="1" stroke="#aaaaaa"></path></g><g transform="matrix(1,0,0,1,140,170)"><g><path d="M -15 0 L 15 0" stroke-width="1" stroke="#333333" fill="none"></path><path d="M 0 10 L 0 0" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.dev/svgjs" width="410" height="790.5" viewBox="-25 -25.5 410 790.5"><g transform="matrix(1,0,0,1,0,0)"><path d="M -20 -20.5 L -20 760 M 0 -20.5 L 0 760 M 20 -20.5 L 20 760 M 40 -20.5 L 40 760 M 60 -20.5 L 60 760 M 80 -20.5 L 80 760 M 100 -20.5 L 100 760 M 120 -20.5 L 120 760 M 140 -20.5 L 140 760 M 160 -20.5 L 160 760 M 180 -20.5 L 180 760 M 200 -20.5 L 200 760 M 220 -20.5 L 220 760 M 240 -20.5 L 240 760 M 260 -20.5 L 260 760 M 280 -20.5 L 280 760 M 300 -20.5 L 300 760 M 320 -20.5 L 320 760 M 340 -20.5 L 340 760 M 360 -20.5 L 360 760 M 380 -20.5 L 380 760" fill="none" stroke-dasharray="1,19" stroke-width="1" stroke="#aaaaaa"></path></g><g transform="matrix(1,0,0,1,140,170)"><g><path d="M -15 0 L 15 0" stroke-width="1" stroke="#333333" fill="none"></path><path d="M 0 10 L 0 0" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="middle" dominant-baseline="text-top" font-weight="regular" transform="matrix(1,0,0,1,0,-5)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">3v3</tspan></text></g></g><g transform="matrix(1,0,0,1,140,240)"><g><path d="M 9.999999999999998 -20 L 10.000000000000002 20 L -9.999999999999998 20 L -10.000000000000002 -20 Z" stroke-width="1" stroke="#333333" fill="#ffffff"></path><path d="M -2.4492935982947065e-15 -40 L -1.2246467991473533e-15 -20 M 2.4492935982947065e-15 40 L 1.2246467991473533e-15 20" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="middle" dominant-baseline="middle" font-weight="regular" transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,-1,6.123233995736766e-17)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">20k</tspan></text><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="start" dominant-baseline="text-top" font-weight="regular" transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,14.999999999999998,-20)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">R1</tspan></text></g></g><g transform="matrix(1,0,0,1,140,360)"><g><path d="M 9.999999999999998 -20 L 10.000000000000002 20 L -9.999999999999998 20 L -10.000000000000002 -20 Z" stroke-width="1" stroke="#333333" fill="#ffffff"></path><path d="M -2.4492935982947065e-15 -40 L -1.2246467991473533e-15 -20 M 2.4492935982947065e-15 40 L 1.2246467991473533e-15 20" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="middle" dominant-baseline="middle" font-weight="regular" transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,-1,6.123233995736766e-17)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">20k</tspan></text><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="start" dominant-baseline="text-top" font-weight="regular" transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,14.999999999999998,-20)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">R2</tspan></text></g></g><g transform="matrix(1,0,0,1,140,430)"><g><path d="M -10 0 L 10 0 L 0 10 Z" stroke-width="1" stroke="#333333" fill="#ffffff"></path><path d="M 0 -10 L 0 0" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="middle" dominant-baseline="text-top" font-weight="regular" transform="matrix(1,0,0,1,0,20)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">GND</tspan></text></g></g><g transform="matrix(1,0,0,1,210,300)"><g><path d="M 2.7554552980815444e-15 -15 L -2.7554552980815444e-15 15" stroke-width="1" stroke="#333333" fill="none"></path><path d="M -10 -1.8369701987210296e-15 L 0 0" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="middle" dominant-baseline="text-top" font-weight="regular" transform="matrix(-1.8369701987210297e-16,1,-1,-1.8369701987210297e-16,5,9.184850993605148e-16)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">out</tspan></text></g></g><g transform="matrix(1,0,0,1,160,530)"><g><path d="M -15 0 L 15 0" stroke-width="1" stroke="#333333" fill="none"></path><path d="M 0 10 L 0 0" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="middle" dominant-baseline="text-top" font-weight="regular" transform="matrix(1,0,0,1,0,-5)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">3v3</tspan></text></g></g><g transform="matrix(1,0,0,1,160,600)"><g><path d="M 9.999999999999998 -20 L 10.000000000000002 20 L -9.999999999999998 20 L -10.000000000000002 -20 Z" stroke-width="1" stroke="#333333" fill="#ffffff"></path><path d="M -2.4492935982947065e-15 -40 L -1.2246467991473533e-15 -20 M 2.4492935982947065e-15 40 L 1.2246467991473533e-15 20" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="middle" dominant-baseline="middle" font-weight="regular" transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,-1,6.123233995736766e-17)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">10k</tspan></text><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="start" dominant-baseline="text-top" font-weight="regular" transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,14.999999999999998,-20)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">R3</tspan></text></g></g><g transform="matrix(1,0,0,1,200,630)"><g><path d="M -15 0 L 15 0" stroke-width="1" stroke="#333333" fill="none"></path><path d="M 0 10 L 0 0" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="middle" dominant-baseline="text-top" font-weight="regular" transform="matrix(1,0,0,1,0,-5)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">out</tspan></text></g></g><g><line x1="140" y1="180" x2="140" y2="200" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="160" y1="540" x2="160" y2="560" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="140" y1="280" x2="140" y2="300" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="140" y1="300" x2="140" y2="320" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="140" y1="300" x2="200" y2="300" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="160" y1="640" x2="160" y2="660" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="160" y1="660" x2="200" y2="660" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="200" y1="660" x2="200" y2="640" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><circle r="2.5" cx="2.5" cy="2.5" transform="matrix(1,0,0,1,137.5,297.5)" fill="#008400" stroke="none"></circle><line x1="140" y1="400" x2="140" y2="420" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line></g><g><rect width="360" height="740" fill="none" stroke-width="1" stroke="#111111" transform="matrix(1,0,0,1,0,0)"></rect><rect width="320" height="700" fill="none" stroke-width="1" stroke="#111111" transform="matrix(1,0,0,1,20,20)"></rect><rect width="280" height="660" fill="none" stroke-width="1" stroke="#111111" transform="matrix(1,0,0,1,40,40)"></rect><rect width="240" height="420" fill="none" stroke-width="1" stroke="#111111" transform="matrix(1,0,0,1,60,60)"></rect></g><g transform="matrix(1,0,0,1,180,100)"><g><path d="M0 0 " stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="16" text-anchor="middle" dominant-baseline="text-top" font-weight="bold" transform="matrix(1,0,0,1,0,0)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">Voltage divider circuit</tspan></text></g></g></svg>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.dev/svgjs" width="170" height="170.5" viewBox="-25 -25.5 170 170.5"><g transform="matrix(1,0,0,1,0,0)"><path d="M -20 -20.5 L -20 140 M 0 -20.5 L 0 140 M 20 -20.5 L 20 140 M 40 -20.5 L 40 140 M 60 -20.5 L 60 140 M 80 -20.5 L 80 140 M 100 -20.5 L 100 140 M 120 -20.5 L 120 140 M 140 -20.5 L 140 140" fill="none" stroke-dasharray="1,19" stroke-width="1" stroke="#aaaaaa"></path></g><g transform="matrix(1,0,0,1,40,30)"><g><path d="M -15 0 L 15 0" stroke-width="1" stroke="#333333" fill="none"></path><path d="M 0 10 L 0 0" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.dev/svgjs" width="170" height="170.5" viewBox="-25 -25.5 170 170.5"><g transform="matrix(1,0,0,1,0,0)"><path d="M -20 -20.5 L -20 140 M 0 -20.5 L 0 140 M 20 -20.5 L 20 140 M 40 -20.5 L 40 140 M 60 -20.5 L 60 140 M 80 -20.5 L 80 140 M 100 -20.5 L 100 140 M 120 -20.5 L 120 140 M 140 -20.5 L 140 140" fill="none" stroke-dasharray="1,19" stroke-width="1" stroke="#aaaaaa"></path></g><g transform="matrix(1,0,0,1,40,30)"><g><path d="M -15 0 L 15 0" stroke-width="1" stroke="#333333" fill="none"></path><path d="M 0 10 L 0 0" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="middle" dominant-baseline="text-top" font-weight="regular" transform="matrix(1,0,0,1,0,-5)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">5v</tspan></text></g></g><g transform="matrix(1,0,0,1,60,60)"><g><path d="M -20 -10 L 20 -10 L 20 10 L -20 10 Z" stroke-width="1" stroke="#333333" fill="#ffffff"></path><path d="M 0 -20 L 20 -20" stroke-width="1" stroke="#333333" fill="none"></path><path d="M 0 20 L 0 40" stroke-width="1" stroke="#333333" fill="none"></path><path d="M 0 0 L 20 20" stroke-width="1" stroke="#333333" fill="none"></path><path d="M -20 0 L -40 0 M 20 0 L 40 0" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="middle" dominant-baseline="middle" font-weight="regular" transform="matrix(1,0,0,1,0,0)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">10k</tspan></text><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="start" dominant-baseline="text-top" font-weight="regular" transform="matrix(1,0,0,1,-20,-15)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">R1</tspan></text></g></g><g transform="matrix(1,0,0,1,80,90)"><g><path d="M -10 0 L 10 0 L 0 10 Z" stroke-width="1" stroke="#333333" fill="#ffffff"></path><path d="M 0 -10 L 0 0" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="middle" dominant-baseline="text-top" font-weight="regular" transform="matrix(1,0,0,1,0,20)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">GND</tspan></text></g></g><g><line x1="40" y1="40" x2="40" y2="60" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="80" y1="60" x2="80" y2="80" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line></g><g></g></svg>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.dev/svgjs" width="190" height="310.5" viewBox="-25 -25.5 190 310.5"><g transform="matrix(1,0,0,1,0,0)"><path d="M -20 -20.5 L -20 280 M 0 -20.5 L 0 280 M 20 -20.5 L 20 280 M 40 -20.5 L 40 280 M 60 -20.5 L 60 280 M 80 -20.5 L 80 280 M 100 -20.5 L 100 280 M 120 -20.5 L 120 280 M 140 -20.5 L 140 280 M 160 -20.5 L 160 280" fill="none" stroke-dasharray="1,19" stroke-width="1" stroke="#aaaaaa"></path></g><g transform="matrix(1,0,0,1,20,90)"><g><path d="M -10 0 L 10 0 L 0 10 Z" stroke-width="1" stroke="#333333" fill="#ffffff"></path><path d="M 0 -10 L 0 0" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.dev/svgjs" width="190" height="310.5" viewBox="-25 -25.5 190 310.5"><g transform="matrix(1,0,0,1,0,0)"><path d="M -20 -20.5 L -20 280 M 0 -20.5 L 0 280 M 20 -20.5 L 20 280 M 40 -20.5 L 40 280 M 60 -20.5 L 60 280 M 80 -20.5 L 80 280 M 100 -20.5 L 100 280 M 120 -20.5 L 120 280 M 140 -20.5 L 140 280 M 160 -20.5 L 160 280" fill="none" stroke-dasharray="1,19" stroke-width="1" stroke="#aaaaaa"></path></g><g transform="matrix(1,0,0,1,20,90)"><g><path d="M -10 0 L 10 0 L 0 10 Z" stroke-width="1" stroke="#333333" fill="#ffffff"></path><path d="M 0 -10 L 0 0" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="middle" dominant-baseline="text-top" font-weight="regular" transform="matrix(1,0,0,1,0,20)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">GND</tspan></text></g></g><g transform="matrix(1,0,0,1,70,60)"><g><path d="M -10.000000000000002 9.999999999999998 L -9.999999999999998 -10.000000000000002" stroke-width="1" stroke="#333333" fill="none"></path><path d="M 9.999999999999998 10.000000000000002 L 10.000000000000002 -9.999999999999998 L -10 -1.2246467991473533e-15 Z" stroke-width="1" stroke="#333333" fill="#ffffff"></path><path d="M 9.797174393178826e-16 -8 L -4.999999999999998 -18" stroke-width="1" stroke="#333333" fill="none"></path><path d="M -2.999999999999999 -8 L -7.999999999999998 -18" stroke-width="1" stroke="#333333" fill="none"></path><path d="M 30 3.67394039744206e-15 L 10 1.2246467991473533e-15 M -30 -3.67394039744206e-15 L -10 -1.2246467991473533e-15" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="end" dominant-baseline="hanging" font-weight="regular" transform="matrix(1,0,0,1,-15,5)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">D1</tspan></text></g></g><g transform="matrix(1,0,0,1,120,30.000000000000007)"><g><path d="M -15 0 L 15 0" stroke-width="1" stroke="#333333" fill="none"></path><path d="M 0 10 L 0 0" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="middle" dominant-baseline="text-top" font-weight="regular" transform="matrix(1,0,0,1,0,-5)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">5v</tspan></text></g></g><g transform="matrix(1,0,0,1,20,170)"><g><path d="M -15 0 L 15 0" stroke-width="1" stroke="#333333" fill="none"></path><path d="M 0 10 L 0 0" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="middle" dominant-baseline="text-top" font-weight="regular" transform="matrix(1,0,0,1,0,-5)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">5v</tspan></text></g></g><g transform="matrix(1,0,0,1,70,200)"><g><path d="M 10 -10 L 10 10" stroke-width="1" stroke="#333333" fill="none"></path><path d="M -10 -10 L -10 10 L 10 0 Z" stroke-width="1" stroke="#333333" fill="#ffffff"></path><path d="M 0 8 L 5 18" stroke-width="1" stroke="#333333" fill="none"></path><path d="M 3 8 L 8 18" stroke-width="1" stroke="#333333" fill="none"></path><path d="M -30 0 L -10 0 M 30 0 L 10 0" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="start" dominant-baseline="hanging" font-weight="regular" transform="matrix(1,0,0,1,15,5)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">D2</tspan></text></g></g><g transform="matrix(1,0,0,1,120,230)"><g><path d="M -10 0 L 10 0 L 0 10 Z" stroke-width="1" stroke="#333333" fill="#ffffff"></path><path d="M 0 -10 L 0 0" stroke-width="2" stroke="#333333"></path><text fill="#333333" font-family="Open Sans-Regular, Arial" font-size="10" text-anchor="middle" dominant-baseline="text-top" font-weight="regular" transform="matrix(1,0,0,1,0,20)" svgjs:data="{"leading":"1.3"}"><tspan dy="0" x="0" svgjs:data="{"newLined":true}">GND</tspan></text></g></g><g><line x1="20" y1="80" x2="20" y2="60" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="20" y1="60" x2="40" y2="60" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="100" y1="200" x2="120" y2="200" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="120" y1="200" x2="120" y2="220" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="100" y1="60.00000000000001" x2="120" y2="60.00000000000001" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="120" y1="60.00000000000001" x2="120" y2="40.00000000000001" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="20" y1="180" x2="20" y2="200" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line><line x1="20" y1="200" x2="40" y2="200" stroke-linecap="square" stroke-width="1" stroke="#008400" fill="none"></line></g><g></g></svg>
|
|
@@ -129,10 +129,7 @@ export class SymbolGraphic {
|
|
|
129
129
|
break;
|
|
130
130
|
}
|
|
131
131
|
const position = tmpLabel.getLabelPosition();
|
|
132
|
-
|
|
133
|
-
if (fontWeight === 'bold') {
|
|
134
|
-
useFont = 'Inter-Bold';
|
|
135
|
-
}
|
|
132
|
+
const useFont = defaultFont;
|
|
136
133
|
const text = group.text(tmpLabel.text)
|
|
137
134
|
.fill('#333')
|
|
138
135
|
.font({
|
|
@@ -140,6 +137,7 @@ export class SymbolGraphic {
|
|
|
140
137
|
size: fontSize,
|
|
141
138
|
anchor: anchorStyle,
|
|
142
139
|
'dominant-baseline': dominantBaseline,
|
|
140
|
+
weight: fontWeight,
|
|
143
141
|
});
|
|
144
142
|
if (isRotation180) {
|
|
145
143
|
text.translate(-position[0], position[1]);
|
package/build/src/globals.js
CHANGED
|
@@ -26,7 +26,8 @@ export var SymbolPinSide;
|
|
|
26
26
|
})(SymbolPinSide || (SymbolPinSide = {}));
|
|
27
27
|
export const portWidth = 20;
|
|
28
28
|
export const portHeight = 2;
|
|
29
|
-
export const defaultFont = '
|
|
29
|
+
export const defaultFont = 'Open Sans-Regular, Arial';
|
|
30
|
+
export const defaultFontBold = 'Open Sans-Bold, Arial-Bold, Arial';
|
|
30
31
|
export const defaultFontSize = 10;
|
|
31
32
|
export const bodyColor = '#FFFEAF';
|
|
32
33
|
export const junctionSize = 5;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { writeFileSync } from "fs";
|
|
2
|
+
import { generateKiCADNetList } from "./export.js";
|
|
3
|
+
import { LayoutEngine } from "./layout.js";
|
|
4
|
+
import { SequenceAction } from "./objects/ExecutionScope.js";
|
|
5
|
+
import { parseFileWithVisitor } from "./parser.js";
|
|
6
|
+
import { generateSVG2 } from "./render.js";
|
|
7
|
+
import { SimpleStopwatch } from "./utils.js";
|
|
8
|
+
import { MainVisitor } from "./visitor.js";
|
|
9
|
+
export function renderScript(scriptData, outputPath, options) {
|
|
10
|
+
const { currentDirectory = null, defaultLibsPath, dumpNets = false, dumpData = false, kicadNetlistPath = null, showStats = false } = options;
|
|
11
|
+
const visitor = new MainVisitor(true);
|
|
12
|
+
visitor.onImportFile = visitor.createImportFileHandler(currentDirectory, defaultLibsPath);
|
|
13
|
+
visitor.print('reading file');
|
|
14
|
+
visitor.print('done reading file');
|
|
15
|
+
const { tree, parser, hasParseError, hasError, parserTimeTaken, lexerTimeTaken } = parseFileWithVisitor(visitor, scriptData);
|
|
16
|
+
showStats && console.log('Lexing took:', lexerTimeTaken);
|
|
17
|
+
showStats && console.log('Parsing took:', parserTimeTaken);
|
|
18
|
+
dumpNets && console.log(visitor.dumpNets());
|
|
19
|
+
dumpData && writeFileSync('dump/tree.lisp', tree.toStringTree(null, parser));
|
|
20
|
+
dumpData && writeFileSync('dump/raw-parser.txt', visitor.logger.dump());
|
|
21
|
+
if (hasError || hasParseError) {
|
|
22
|
+
console.log('Error while parsing');
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
visitor.annotateComponents();
|
|
26
|
+
if (kicadNetlistPath) {
|
|
27
|
+
const kicadNetList = generateKiCADNetList(visitor.getNetList());
|
|
28
|
+
writeFileSync(kicadNetlistPath, kicadNetList);
|
|
29
|
+
console.log('Generated KiCad netlist file');
|
|
30
|
+
}
|
|
31
|
+
const { sequence, nets } = visitor.getGraph();
|
|
32
|
+
const tmpSequence = sequence.map(item => {
|
|
33
|
+
const tmp = [...item];
|
|
34
|
+
const action = tmp[0];
|
|
35
|
+
if (action === SequenceAction.Wire) {
|
|
36
|
+
tmp[2] = tmp[2].map(item2 => {
|
|
37
|
+
return [item2.direction, item2.value].join(",");
|
|
38
|
+
}).join(" ");
|
|
39
|
+
}
|
|
40
|
+
else if (action === SequenceAction.Frame) {
|
|
41
|
+
tmp[1] = item[1].frameId;
|
|
42
|
+
}
|
|
43
|
+
else if (action !== SequenceAction.WireJump) {
|
|
44
|
+
tmp[1] = item[1].instanceName;
|
|
45
|
+
}
|
|
46
|
+
return tmp.join(" | ");
|
|
47
|
+
});
|
|
48
|
+
dumpData && writeFileSync('dump/raw-sequence.txt', tmpSequence.join('\n'));
|
|
49
|
+
let svgOutput = null;
|
|
50
|
+
try {
|
|
51
|
+
const layoutEngine = new LayoutEngine();
|
|
52
|
+
const layoutTimer = new SimpleStopwatch();
|
|
53
|
+
const graph = layoutEngine.runLayout(sequence, nets);
|
|
54
|
+
layoutEngine.printWarnings();
|
|
55
|
+
showStats && console.log('Layout took:', layoutTimer.lap());
|
|
56
|
+
dumpData && writeFileSync('dump/raw-layout.txt', layoutEngine.logger.dump());
|
|
57
|
+
const generateSvgTimer = new SimpleStopwatch();
|
|
58
|
+
svgOutput = generateSVG2(graph);
|
|
59
|
+
showStats && console.log('Render took:', generateSvgTimer.lap());
|
|
60
|
+
if (outputPath) {
|
|
61
|
+
writeFileSync(outputPath, svgOutput);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
catch (err) {
|
|
65
|
+
console.log('Failed to render:');
|
|
66
|
+
console.log(err);
|
|
67
|
+
}
|
|
68
|
+
return svgOutput;
|
|
69
|
+
}
|
package/build/src/main.js
CHANGED
|
@@ -3,15 +3,9 @@ import { program } from 'commander';
|
|
|
3
3
|
import figlet from 'figlet';
|
|
4
4
|
import path from 'path';
|
|
5
5
|
import { fileURLToPath } from 'url';
|
|
6
|
-
import { readFileSync, watch
|
|
7
|
-
import { MainVisitor } from './visitor.js';
|
|
6
|
+
import { readFileSync, watch } from 'fs';
|
|
8
7
|
import { prepareSizing } from './sizing.js';
|
|
9
|
-
import {
|
|
10
|
-
import { generateSVG2 } from './render.js';
|
|
11
|
-
import { SequenceAction } from './objects/ExecutionScope.js';
|
|
12
|
-
import { parseFileWithVisitor } from './parser.js';
|
|
13
|
-
import { generateKiCADNetList } from './export.js';
|
|
14
|
-
import { SimpleStopwatch } from './utils.js';
|
|
8
|
+
import { renderScript } from './helpers.js';
|
|
15
9
|
export default async function main() {
|
|
16
10
|
const toolSrcPath = fileURLToPath(import.meta.url);
|
|
17
11
|
const toolDirectory = path.dirname(toolSrcPath) + '/../../';
|
|
@@ -84,65 +78,4 @@ export default async function main() {
|
|
|
84
78
|
});
|
|
85
79
|
}
|
|
86
80
|
}
|
|
87
|
-
export function renderScript(scriptData, outputPath, options) {
|
|
88
|
-
const { currentDirectory = null, defaultLibsPath, dumpNets = false, dumpData = false, kicadNetlistPath = null, showStats = false } = options;
|
|
89
|
-
const visitor = new MainVisitor(true);
|
|
90
|
-
visitor.onImportFile = visitor.createImportFileHandler(currentDirectory, defaultLibsPath);
|
|
91
|
-
visitor.print('reading file');
|
|
92
|
-
visitor.print('done reading file');
|
|
93
|
-
const { tree, parser, hasParseError, hasError, parserTimeTaken, lexerTimeTaken } = parseFileWithVisitor(visitor, scriptData);
|
|
94
|
-
showStats && console.log('Lexing took:', lexerTimeTaken);
|
|
95
|
-
showStats && console.log('Parsing took:', parserTimeTaken);
|
|
96
|
-
dumpNets && console.log(visitor.dumpNets());
|
|
97
|
-
dumpData && writeFileSync('dump/tree.lisp', tree.toStringTree(null, parser));
|
|
98
|
-
dumpData && writeFileSync('dump/raw-parser.txt', visitor.logger.dump());
|
|
99
|
-
if (hasError || hasParseError) {
|
|
100
|
-
console.log('Error while parsing');
|
|
101
|
-
return null;
|
|
102
|
-
}
|
|
103
|
-
visitor.annotateComponents();
|
|
104
|
-
if (kicadNetlistPath) {
|
|
105
|
-
const kicadNetList = generateKiCADNetList(visitor.getNetList());
|
|
106
|
-
writeFileSync(kicadNetlistPath, kicadNetList);
|
|
107
|
-
console.log('Generated KiCad netlist file');
|
|
108
|
-
}
|
|
109
|
-
const { sequence, nets } = visitor.getGraph();
|
|
110
|
-
const tmpSequence = sequence.map(item => {
|
|
111
|
-
const tmp = [...item];
|
|
112
|
-
const action = tmp[0];
|
|
113
|
-
if (action === SequenceAction.Wire) {
|
|
114
|
-
tmp[2] = tmp[2].map(item2 => {
|
|
115
|
-
return [item2.direction, item2.value].join(",");
|
|
116
|
-
}).join(" ");
|
|
117
|
-
}
|
|
118
|
-
else if (action === SequenceAction.Frame) {
|
|
119
|
-
tmp[1] = item[1].frameId;
|
|
120
|
-
}
|
|
121
|
-
else if (action !== SequenceAction.WireJump) {
|
|
122
|
-
tmp[1] = item[1].instanceName;
|
|
123
|
-
}
|
|
124
|
-
return tmp.join(" | ");
|
|
125
|
-
});
|
|
126
|
-
dumpData && writeFileSync('dump/raw-sequence.txt', tmpSequence.join('\n'));
|
|
127
|
-
let svgOutput = null;
|
|
128
|
-
try {
|
|
129
|
-
const layoutEngine = new LayoutEngine();
|
|
130
|
-
const layoutTimer = new SimpleStopwatch();
|
|
131
|
-
const graph = layoutEngine.runLayout(sequence, nets);
|
|
132
|
-
layoutEngine.printWarnings();
|
|
133
|
-
showStats && console.log('Layout took:', layoutTimer.lap());
|
|
134
|
-
dumpData && writeFileSync('dump/raw-layout.txt', layoutEngine.logger.dump());
|
|
135
|
-
const generateSvgTimer = new SimpleStopwatch();
|
|
136
|
-
svgOutput = generateSVG2(graph);
|
|
137
|
-
showStats && console.log('Render took:', generateSvgTimer.lap());
|
|
138
|
-
if (outputPath) {
|
|
139
|
-
writeFileSync(outputPath, svgOutput);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
catch (err) {
|
|
143
|
-
console.log('Failed to render:');
|
|
144
|
-
console.log(err);
|
|
145
|
-
}
|
|
146
|
-
return svgOutput;
|
|
147
|
-
}
|
|
148
81
|
main();
|
package/build/src/sizing.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { SVG, registerWindow } from '@svgdotjs/svg.js';
|
|
2
2
|
import { config, createSVGWindow } from 'svgdom';
|
|
3
3
|
import { HorizontalAlign, VerticalAlign } from './geometry.js';
|
|
4
|
+
import { defaultFont } from './globals.js';
|
|
4
5
|
let MainCanvas = null;
|
|
5
|
-
const supportedFonts = {
|
|
6
|
-
'Inter': 'Inter-Regular.ttf',
|
|
7
|
-
'Inter-Bold': 'Inter-Bold.ttf',
|
|
8
|
-
};
|
|
6
|
+
const supportedFonts = {};
|
|
9
7
|
export async function prepareSizing(fontsPath) {
|
|
10
8
|
await config.setFontDir(fontsPath)
|
|
11
9
|
.setFontFamilyMappings(supportedFonts)
|
|
@@ -39,17 +37,13 @@ export function measureTextSize2(text, fontFamily, fontSize, fontWeight = 'regul
|
|
|
39
37
|
dominantBaseline = 'text-top';
|
|
40
38
|
break;
|
|
41
39
|
}
|
|
42
|
-
|
|
43
|
-
fontFamily = 'Inter-Bold';
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
fontFamily = 'Inter-Regular';
|
|
47
|
-
}
|
|
40
|
+
fontFamily = defaultFont;
|
|
48
41
|
const tmpTextElement = MainCanvas.text(text).font({
|
|
49
42
|
family: fontFamily,
|
|
50
43
|
size: fontSize,
|
|
51
44
|
anchor: anchor,
|
|
52
45
|
'dominant-baseline': dominantBaseline,
|
|
46
|
+
weight: fontWeight,
|
|
53
47
|
}).fill('#333');
|
|
54
48
|
const textbox = tmpTextElement.bbox();
|
|
55
49
|
const { width, height } = textbox;
|
package/package.json
CHANGED
package/src/draw_symbols.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { G } from "@svgdotjs/svg.js";
|
|
2
2
|
|
|
3
|
-
import { SymbolPinSide, bodyColor, defaultFont } from "./globals.js";
|
|
3
|
+
import { SymbolPinSide, bodyColor, defaultFontBold, defaultFont } from "./globals.js";
|
|
4
4
|
import { Feature, Geometry, GeometryProp, HorizontalAlign, Label, LabelStyle, VerticalAlign } from "./geometry.js";
|
|
5
5
|
import { Logger } from "./logger.js";
|
|
6
6
|
|
|
@@ -196,11 +196,7 @@ export abstract class SymbolGraphic {
|
|
|
196
196
|
}
|
|
197
197
|
|
|
198
198
|
const position = tmpLabel.getLabelPosition();
|
|
199
|
-
|
|
200
|
-
let useFont = defaultFont;
|
|
201
|
-
if (fontWeight === 'bold'){
|
|
202
|
-
useFont = 'Inter-Bold';
|
|
203
|
-
}
|
|
199
|
+
const useFont = defaultFont;
|
|
204
200
|
|
|
205
201
|
const text = group.text(tmpLabel.text)
|
|
206
202
|
.fill('#333')
|
|
@@ -209,7 +205,7 @@ export abstract class SymbolGraphic {
|
|
|
209
205
|
size: fontSize,
|
|
210
206
|
anchor: anchorStyle,
|
|
211
207
|
'dominant-baseline': dominantBaseline,
|
|
212
|
-
|
|
208
|
+
weight: fontWeight,
|
|
213
209
|
});
|
|
214
210
|
|
|
215
211
|
if (isRotation180){
|
package/src/geometry.ts
CHANGED
|
@@ -68,7 +68,8 @@ export class Label extends Flatten.Polygon {
|
|
|
68
68
|
fontWeight = 'regular',
|
|
69
69
|
} = style ?? {};
|
|
70
70
|
|
|
71
|
-
// Determine the size of the text
|
|
71
|
+
// Determine the size of the text, this is needed to determine the
|
|
72
|
+
// bounding box of the text for layout purposes.
|
|
72
73
|
const { width, height, box } =
|
|
73
74
|
measureTextSize2(text, defaultFont, fontSize, fontWeight,
|
|
74
75
|
anchor, vanchor);
|
package/src/globals.ts
CHANGED
|
@@ -33,7 +33,9 @@ export enum SymbolPinSide {
|
|
|
33
33
|
export const portWidth = 20;
|
|
34
34
|
export const portHeight = 2;
|
|
35
35
|
|
|
36
|
-
export const defaultFont = '
|
|
36
|
+
export const defaultFont = 'Open Sans-Regular, Arial';
|
|
37
|
+
export const defaultFontBold = 'Open Sans-Bold, Arial-Bold, Arial';
|
|
38
|
+
|
|
37
39
|
export const defaultFontSize = 10;
|
|
38
40
|
|
|
39
41
|
export const bodyColor = '#FFFEAF';
|
package/src/helpers.ts
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { writeFileSync } from "fs";
|
|
2
|
+
import { generateKiCADNetList } from "./export.js";
|
|
3
|
+
import { LayoutEngine } from "./layout.js";
|
|
4
|
+
import { SequenceAction } from "./objects/ExecutionScope.js";
|
|
5
|
+
import { parseFileWithVisitor } from "./parser.js";
|
|
6
|
+
import { generateSVG2 } from "./render.js";
|
|
7
|
+
import { SimpleStopwatch } from "./utils.js";
|
|
8
|
+
import { MainVisitor } from "./visitor.js";
|
|
9
|
+
|
|
10
|
+
export function renderScript(scriptData: string, outputPath: string, options): string {
|
|
11
|
+
|
|
12
|
+
const {
|
|
13
|
+
currentDirectory = null,
|
|
14
|
+
defaultLibsPath,
|
|
15
|
+
dumpNets = false,
|
|
16
|
+
dumpData = false,
|
|
17
|
+
kicadNetlistPath = null,
|
|
18
|
+
showStats = false} = options;
|
|
19
|
+
|
|
20
|
+
const visitor = new MainVisitor(true);
|
|
21
|
+
|
|
22
|
+
visitor.onImportFile = visitor.createImportFileHandler(currentDirectory, defaultLibsPath);
|
|
23
|
+
|
|
24
|
+
visitor.print('reading file');
|
|
25
|
+
visitor.print('done reading file');
|
|
26
|
+
|
|
27
|
+
const { tree, parser,
|
|
28
|
+
hasParseError, hasError,
|
|
29
|
+
parserTimeTaken,
|
|
30
|
+
lexerTimeTaken } = parseFileWithVisitor(visitor, scriptData);
|
|
31
|
+
|
|
32
|
+
showStats && console.log('Lexing took:', lexerTimeTaken);
|
|
33
|
+
showStats && console.log('Parsing took:', parserTimeTaken);
|
|
34
|
+
dumpNets && console.log(visitor.dumpNets());
|
|
35
|
+
|
|
36
|
+
dumpData && writeFileSync('dump/tree.lisp', tree.toStringTree(null, parser));
|
|
37
|
+
dumpData && writeFileSync('dump/raw-parser.txt', visitor.logger.dump());
|
|
38
|
+
|
|
39
|
+
if (hasError || hasParseError) {
|
|
40
|
+
console.log('Error while parsing');
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
visitor.annotateComponents();
|
|
45
|
+
|
|
46
|
+
if (kicadNetlistPath) {
|
|
47
|
+
const kicadNetList = generateKiCADNetList(visitor.getNetList());
|
|
48
|
+
writeFileSync(kicadNetlistPath, kicadNetList);
|
|
49
|
+
console.log('Generated KiCad netlist file');
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
// await writeFile('dump/raw-netlist.json', JSON.stringify(visitor.dump2(), null, 2));
|
|
54
|
+
|
|
55
|
+
const { sequence, nets } = visitor.getGraph();
|
|
56
|
+
|
|
57
|
+
// const tmpInstances = visitor.getExecutor().scope.instances;
|
|
58
|
+
// for (const [instanceName, instance] of tmpInstances){
|
|
59
|
+
// console.log(instanceName);
|
|
60
|
+
// console.log(instance.pinNets);
|
|
61
|
+
// }
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
const tmpSequence = sequence.map(item => {
|
|
65
|
+
const tmp = [...item];
|
|
66
|
+
|
|
67
|
+
const action = tmp[0];
|
|
68
|
+
|
|
69
|
+
if (action === SequenceAction.Wire) {
|
|
70
|
+
tmp[2] = tmp[2].map(item2 => {
|
|
71
|
+
return [item2.direction, item2.value].join(",");
|
|
72
|
+
}).join(" ");
|
|
73
|
+
} else if (action === SequenceAction.Frame) {
|
|
74
|
+
tmp[1] = item[1].frameId;
|
|
75
|
+
|
|
76
|
+
} else if (action !== SequenceAction.WireJump) {
|
|
77
|
+
tmp[1] = item[1].instanceName;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return tmp.join(" | ");
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
dumpData && writeFileSync('dump/raw-sequence.txt', tmpSequence.join('\n'));
|
|
84
|
+
let svgOutput: string = null;
|
|
85
|
+
|
|
86
|
+
try {
|
|
87
|
+
const layoutEngine = new LayoutEngine();
|
|
88
|
+
const layoutTimer = new SimpleStopwatch();
|
|
89
|
+
|
|
90
|
+
const graph = layoutEngine.runLayout(sequence, nets);
|
|
91
|
+
|
|
92
|
+
layoutEngine.printWarnings();
|
|
93
|
+
|
|
94
|
+
showStats && console.log('Layout took:', layoutTimer.lap());
|
|
95
|
+
|
|
96
|
+
dumpData && writeFileSync('dump/raw-layout.txt', layoutEngine.logger.dump());
|
|
97
|
+
|
|
98
|
+
const generateSvgTimer = new SimpleStopwatch();
|
|
99
|
+
svgOutput = generateSVG2(graph);
|
|
100
|
+
showStats && console.log('Render took:', generateSvgTimer.lap());
|
|
101
|
+
|
|
102
|
+
if (outputPath){
|
|
103
|
+
writeFileSync(outputPath, svgOutput);
|
|
104
|
+
}
|
|
105
|
+
} catch (err) {
|
|
106
|
+
console.log('Failed to render:');
|
|
107
|
+
console.log(err)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return svgOutput;
|
|
111
|
+
}
|
package/src/main.ts
CHANGED
|
@@ -4,16 +4,10 @@ import { program } from 'commander';
|
|
|
4
4
|
import figlet from 'figlet';
|
|
5
5
|
import path from 'path';
|
|
6
6
|
import { fileURLToPath } from 'url';
|
|
7
|
-
import { readFileSync, watch
|
|
7
|
+
import { readFileSync, watch } from 'fs';
|
|
8
8
|
|
|
9
|
-
import { MainVisitor } from './visitor.js';
|
|
10
9
|
import { prepareSizing } from './sizing.js';
|
|
11
|
-
import {
|
|
12
|
-
import { generateSVG2 } from './render.js';
|
|
13
|
-
import { SequenceAction } from './objects/ExecutionScope.js';
|
|
14
|
-
import { parseFileWithVisitor } from './parser.js';
|
|
15
|
-
import { generateKiCADNetList } from './export.js';
|
|
16
|
-
import { SimpleStopwatch } from './utils.js';
|
|
10
|
+
import { renderScript } from './helpers.js';
|
|
17
11
|
|
|
18
12
|
export default async function main(): Promise<void> {
|
|
19
13
|
const toolSrcPath = fileURLToPath(import.meta.url);
|
|
@@ -108,108 +102,4 @@ export default async function main(): Promise<void> {
|
|
|
108
102
|
}
|
|
109
103
|
}
|
|
110
104
|
|
|
111
|
-
|
|
112
|
-
export function renderScript(scriptData: string, outputPath: string, options): string {
|
|
113
|
-
|
|
114
|
-
const {
|
|
115
|
-
currentDirectory = null,
|
|
116
|
-
defaultLibsPath,
|
|
117
|
-
dumpNets = false,
|
|
118
|
-
dumpData = false,
|
|
119
|
-
kicadNetlistPath = null,
|
|
120
|
-
showStats = false} = options;
|
|
121
|
-
|
|
122
|
-
const visitor = new MainVisitor(true);
|
|
123
|
-
|
|
124
|
-
visitor.onImportFile = visitor.createImportFileHandler(currentDirectory, defaultLibsPath);
|
|
125
|
-
|
|
126
|
-
visitor.print('reading file');
|
|
127
|
-
visitor.print('done reading file');
|
|
128
|
-
|
|
129
|
-
const { tree, parser,
|
|
130
|
-
hasParseError, hasError,
|
|
131
|
-
parserTimeTaken,
|
|
132
|
-
lexerTimeTaken } = parseFileWithVisitor(visitor, scriptData);
|
|
133
|
-
|
|
134
|
-
showStats && console.log('Lexing took:', lexerTimeTaken);
|
|
135
|
-
showStats && console.log('Parsing took:', parserTimeTaken);
|
|
136
|
-
dumpNets && console.log(visitor.dumpNets());
|
|
137
|
-
|
|
138
|
-
dumpData && writeFileSync('dump/tree.lisp', tree.toStringTree(null, parser));
|
|
139
|
-
dumpData && writeFileSync('dump/raw-parser.txt', visitor.logger.dump());
|
|
140
|
-
|
|
141
|
-
if (hasError || hasParseError) {
|
|
142
|
-
console.log('Error while parsing');
|
|
143
|
-
return null;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
visitor.annotateComponents();
|
|
147
|
-
|
|
148
|
-
if (kicadNetlistPath) {
|
|
149
|
-
const kicadNetList = generateKiCADNetList(visitor.getNetList());
|
|
150
|
-
writeFileSync(kicadNetlistPath, kicadNetList);
|
|
151
|
-
console.log('Generated KiCad netlist file');
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
// await writeFile('dump/raw-netlist.json', JSON.stringify(visitor.dump2(), null, 2));
|
|
156
|
-
|
|
157
|
-
const { sequence, nets } = visitor.getGraph();
|
|
158
|
-
|
|
159
|
-
// const tmpInstances = visitor.getExecutor().scope.instances;
|
|
160
|
-
// for (const [instanceName, instance] of tmpInstances){
|
|
161
|
-
// console.log(instanceName);
|
|
162
|
-
// console.log(instance.pinNets);
|
|
163
|
-
// }
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
const tmpSequence = sequence.map(item => {
|
|
167
|
-
const tmp = [...item];
|
|
168
|
-
|
|
169
|
-
const action = tmp[0];
|
|
170
|
-
|
|
171
|
-
if (action === SequenceAction.Wire) {
|
|
172
|
-
tmp[2] = tmp[2].map(item2 => {
|
|
173
|
-
return [item2.direction, item2.value].join(",");
|
|
174
|
-
}).join(" ");
|
|
175
|
-
} else if (action === SequenceAction.Frame) {
|
|
176
|
-
tmp[1] = item[1].frameId;
|
|
177
|
-
|
|
178
|
-
} else if (action !== SequenceAction.WireJump) {
|
|
179
|
-
tmp[1] = item[1].instanceName;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
return tmp.join(" | ");
|
|
183
|
-
});
|
|
184
|
-
|
|
185
|
-
dumpData && writeFileSync('dump/raw-sequence.txt', tmpSequence.join('\n'));
|
|
186
|
-
let svgOutput: string = null;
|
|
187
|
-
|
|
188
|
-
try {
|
|
189
|
-
const layoutEngine = new LayoutEngine();
|
|
190
|
-
const layoutTimer = new SimpleStopwatch();
|
|
191
|
-
|
|
192
|
-
const graph = layoutEngine.runLayout(sequence, nets);
|
|
193
|
-
|
|
194
|
-
layoutEngine.printWarnings();
|
|
195
|
-
|
|
196
|
-
showStats && console.log('Layout took:', layoutTimer.lap());
|
|
197
|
-
|
|
198
|
-
dumpData && writeFileSync('dump/raw-layout.txt', layoutEngine.logger.dump());
|
|
199
|
-
|
|
200
|
-
const generateSvgTimer = new SimpleStopwatch();
|
|
201
|
-
svgOutput = generateSVG2(graph);
|
|
202
|
-
showStats && console.log('Render took:', generateSvgTimer.lap());
|
|
203
|
-
|
|
204
|
-
if (outputPath){
|
|
205
|
-
writeFileSync(outputPath, svgOutput);
|
|
206
|
-
}
|
|
207
|
-
} catch (err) {
|
|
208
|
-
console.log('Failed to render:');
|
|
209
|
-
console.log(err)
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
return svgOutput;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
105
|
main();
|
package/src/regenerate-tests.ts
CHANGED
package/src/sizing.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { Box, SVG, SVGTypeMapping, registerWindow } from '@svgdotjs/svg.js';
|
|
2
2
|
import { config, createSVGWindow } from 'svgdom';
|
|
3
3
|
import { HorizontalAlign, VerticalAlign } from './geometry.js';
|
|
4
|
+
import { defaultFont } from './globals.js';
|
|
4
5
|
|
|
5
6
|
let MainCanvas = null;
|
|
6
7
|
|
|
7
8
|
const supportedFonts = {
|
|
8
9
|
// 'Roboto': 'Roboto-Regular.ttf',
|
|
9
|
-
'Inter': 'Inter-Regular.ttf',
|
|
10
|
-
'Inter-Bold': 'Inter-Bold.ttf',
|
|
10
|
+
// 'Inter': 'Inter-Regular.ttf',
|
|
11
|
+
// 'Inter-Bold': 'Inter-Bold.ttf',
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
export async function prepareSizing(fontsPath): Promise<void> {
|
|
@@ -68,18 +69,14 @@ export function measureTextSize2(text: string, fontFamily: string,
|
|
|
68
69
|
break;
|
|
69
70
|
}
|
|
70
71
|
|
|
71
|
-
|
|
72
|
-
fontFamily = 'Inter-Bold';
|
|
73
|
-
} else {
|
|
74
|
-
fontFamily = 'Inter-Regular';
|
|
75
|
-
}
|
|
72
|
+
fontFamily = defaultFont;
|
|
76
73
|
|
|
77
74
|
const tmpTextElement = MainCanvas.text(text).font({
|
|
78
75
|
family: fontFamily,
|
|
79
76
|
size: fontSize,
|
|
80
77
|
anchor: anchor,
|
|
81
78
|
'dominant-baseline': dominantBaseline,
|
|
82
|
-
|
|
79
|
+
weight: fontWeight,
|
|
83
80
|
}).fill('#333');
|
|
84
81
|
|
|
85
82
|
const textbox = tmpTextElement.bbox();
|