add rain detector to arch diagram
This commit is contained in:
parent
c56ec0d15b
commit
1529df5c7c
3 changed files with 62 additions and 50 deletions
|
|
@ -6,10 +6,18 @@ To install dependencies:
|
|||
bun install
|
||||
```
|
||||
|
||||
To run:
|
||||
To generate the diagram:
|
||||
|
||||
```bash
|
||||
bun run index.ts
|
||||
bun run index.ts > arch.svg
|
||||
```
|
||||
|
||||
or to preview the diagram text bases:
|
||||
|
||||
```bash
|
||||
bun run index.ts --ascii
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
This project was created using `bun init` in bun v1.2.21. [Bun](https://bun.com) is a fast all-in-one JavaScript runtime.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 902.1000000000001 691" width="902.1000000000001" height="691" style="--bg:#FFFFFF;--fg:#27272A;background:var(--bg)">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1051.05 691" width="1051.05" height="691" style="--bg:#FFFFFF;--fg:#27272A;background:var(--bg)">
|
||||
<style>
|
||||
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
|
||||
text { font-family: 'Inter', system-ui, sans-serif; }
|
||||
|
|
@ -29,54 +29,57 @@
|
|||
<rect x="40" y="40" width="224.95000000000005" height="285" rx="0" ry="0" fill="var(--_group-fill)" stroke="var(--_node-stroke)" stroke-width="1" />
|
||||
<rect x="40" y="40" width="224.95000000000005" height="28" rx="0" ry="0" fill="var(--_group-hdr)" stroke="var(--_node-stroke)" stroke-width="1" />
|
||||
<text x="52" y="54" dy="0.35em" font-size="12" font-weight="600" fill="var(--_text-sec)">Node1</text>
|
||||
<rect x="284.95000000000005" y="40" width="431.09999999999997" height="285" rx="0" ry="0" fill="var(--_group-fill)" stroke="var(--_node-stroke)" stroke-width="1" />
|
||||
<rect x="284.95000000000005" y="40" width="431.09999999999997" height="28" rx="0" ry="0" fill="var(--_group-hdr)" stroke="var(--_node-stroke)" stroke-width="1" />
|
||||
<rect x="284.95000000000005" y="40" width="580.05" height="285" rx="0" ry="0" fill="var(--_group-fill)" stroke="var(--_node-stroke)" stroke-width="1" />
|
||||
<rect x="284.95000000000005" y="40" width="580.05" height="28" rx="0" ry="0" fill="var(--_group-hdr)" stroke="var(--_node-stroke)" stroke-width="1" />
|
||||
<text x="296.95000000000005" y="54" dy="0.35em" font-size="12" font-weight="600" fill="var(--_text-sec)">Node2</text>
|
||||
<rect x="736.05" y="40" width="126.05000000000007" height="285" rx="0" ry="0" fill="var(--_group-fill)" stroke="var(--_node-stroke)" stroke-width="1" />
|
||||
<rect x="736.05" y="40" width="126.05000000000007" height="28" rx="0" ry="0" fill="var(--_group-hdr)" stroke="var(--_node-stroke)" stroke-width="1" />
|
||||
<text x="748.05" y="54" dy="0.35em" font-size="12" font-weight="600" fill="var(--_text-sec)">Node3</text>
|
||||
<polyline points="99.45000000000002,132 99.45000000000002,287 113.23750000000003,287" fill="none" stroke="var(--_line)" stroke-width="0.75" marker-end="url(#arrowhead)" />
|
||||
<polyline points="201.92500000000004,132 201.92500000000004,287 188.13750000000005,287" fill="none" stroke="var(--_line)" stroke-width="0.75" marker-end="url(#arrowhead)" />
|
||||
<polyline points="150.68750000000003,305 150.68750000000003,460 427.30000000000007,460" fill="none" stroke="var(--_line)" stroke-width="0.75" marker-end="url(#arrowhead)" />
|
||||
<polyline points="482.62500000000006,478 482.62500000000006,615" fill="none" stroke="var(--_line)" stroke-width="0.75" marker-end="url(#arrowhead)" />
|
||||
<polyline points="482.62500000000006,305 482.62500000000006,442" fill="none" stroke="var(--_line)" stroke-width="0.75" marker-end="url(#arrowhead)" />
|
||||
<polyline points="358.70000000000005,132 358.70000000000005,287 445.17500000000007,287" fill="none" stroke="var(--_line)" stroke-width="0.75" marker-end="url(#arrowhead)" />
|
||||
<polyline points="482.62500000000006,132 482.62500000000006,269" fill="none" stroke="var(--_line)" stroke-width="0.75" marker-end="url(#arrowhead)" />
|
||||
<polyline points="624.425,132 624.425,287 520.075,287" fill="none" stroke="var(--_line)" stroke-width="0.75" marker-end="url(#arrowhead)" />
|
||||
<polyline points="799.075,305 799.075,460 537.95,460" fill="none" stroke="var(--_line)" stroke-width="0.75" marker-end="url(#arrowhead)" />
|
||||
<polyline points="799.075,132 799.075,269" fill="none" stroke="var(--_line)" stroke-width="0.75" marker-end="url(#arrowhead)" />
|
||||
<rect x="82.87000000000002" y="187" width="33.16" height="27" rx="4" ry="4" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="0.5" />
|
||||
<text x="99.45000000000002" y="200.5" text-anchor="middle" dy="0.35em" font-size="11" font-weight="400" fill="var(--_text-muted)">i2c</text>
|
||||
<rect x="182.48500000000004" y="187" width="38.88" height="27" rx="4" ry="4" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="0.5" />
|
||||
<text x="201.92500000000004" y="200.5" text-anchor="middle" dy="0.35em" font-size="11" font-weight="400" fill="var(--_text-muted)">uart</text>
|
||||
<rect x="114.08750000000003" y="360" width="73.2" height="27" rx="4" ry="4" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="0.5" />
|
||||
<text x="150.68750000000003" y="373.5" text-anchor="middle" dy="0.35em" font-size="11" font-weight="400" fill="var(--_text-muted)">Custom TCP</text>
|
||||
<rect x="463.18500000000006" y="533" width="38.88" height="27" rx="4" ry="4" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="0.5" />
|
||||
<text x="482.62500000000006" y="546.5" text-anchor="middle" dy="0.35em" font-size="11" font-weight="400" fill="var(--_text-muted)">mqtt</text>
|
||||
<rect x="446.02500000000003" y="360" width="73.2" height="27" rx="4" ry="4" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="0.5" />
|
||||
<text x="482.62500000000006" y="373.5" text-anchor="middle" dy="0.35em" font-size="11" font-weight="400" fill="var(--_text-muted)">Custom TCP</text>
|
||||
<rect x="762.475" y="360" width="73.2" height="27" rx="4" ry="4" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="0.5" />
|
||||
<text x="799.075" y="373.5" text-anchor="middle" dy="0.35em" font-size="11" font-weight="400" fill="var(--_text-muted)">Custom TCP</text>
|
||||
<rect x="427.30000000000007" y="442" width="110.65" height="36" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
|
||||
<rect x="387.975" y="615" width="189.3" height="36" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
|
||||
<rect x="62.000000000000014" y="96" width="74.9" height="36" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
|
||||
<rect x="113.23750000000003" y="269" width="74.9" height="36" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
|
||||
<rect x="160.90000000000003" y="96" width="82.05000000000001" height="36" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
|
||||
<rect x="885" y="40" width="126.04999999999998" height="285" rx="0" ry="0" fill="var(--_group-fill)" stroke="var(--_node-stroke)" stroke-width="1" />
|
||||
<rect x="885" y="40" width="126.04999999999998" height="28" rx="0" ry="0" fill="var(--_group-hdr)" stroke="var(--_node-stroke)" stroke-width="1" />
|
||||
<text x="897" y="54" dy="0.35em" font-size="12" font-weight="600" fill="var(--_text-sec)">Node3</text>
|
||||
<polyline points="99.45000000000005,132 99.45000000000005,287 113.2375,287" fill="none" stroke="var(--_line)" stroke-width="0.75" marker-end="url(#arrowhead)" />
|
||||
<polyline points="201.92499999999995,132 201.92499999999995,287 188.1375,287" fill="none" stroke="var(--_line)" stroke-width="0.75" marker-end="url(#arrowhead)" />
|
||||
<polyline points="150.6875,305 150.6875,460 494.62500000000006,460" fill="none" stroke="var(--_line)" stroke-width="0.75" marker-end="url(#arrowhead)" />
|
||||
<polyline points="549.95,478 549.95,615" fill="none" stroke="var(--_line)" stroke-width="0.75" marker-end="url(#arrowhead)" />
|
||||
<polyline points="549.95,305 549.95,442" fill="none" stroke="var(--_line)" stroke-width="0.75" marker-end="url(#arrowhead)" />
|
||||
<polyline points="358.70000000000005,132 358.70000000000005,287 512.5,287" fill="none" stroke="var(--_line)" stroke-width="0.75" marker-end="url(#arrowhead)" />
|
||||
<polyline points="482.625,132 482.625,287 512.5,287" fill="none" stroke="var(--_line)" stroke-width="0.75" marker-end="url(#arrowhead)" />
|
||||
<polyline points="617.2750000000001,132 617.2750000000001,287 587.4000000000001,287" fill="none" stroke="var(--_line)" stroke-width="0.75" marker-end="url(#arrowhead)" />
|
||||
<polyline points="773.375,132 773.375,287 587.4000000000001,287" fill="none" stroke="var(--_line)" stroke-width="0.75" marker-end="url(#arrowhead)" />
|
||||
<polyline points="948.025,305 948.025,460 605.2750000000001,460" fill="none" stroke="var(--_line)" stroke-width="0.75" marker-end="url(#arrowhead)" />
|
||||
<polyline points="948.025,132 948.025,269" fill="none" stroke="var(--_line)" stroke-width="0.75" marker-end="url(#arrowhead)" />
|
||||
<rect x="82.87000000000005" y="187" width="33.16" height="27" rx="4" ry="4" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="0.5" />
|
||||
<text x="99.45000000000005" y="200.5" text-anchor="middle" dy="0.35em" font-size="11" font-weight="400" fill="var(--_text-muted)">i2c</text>
|
||||
<rect x="182.48499999999996" y="187" width="38.88" height="27" rx="4" ry="4" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="0.5" />
|
||||
<text x="201.92499999999995" y="200.5" text-anchor="middle" dy="0.35em" font-size="11" font-weight="400" fill="var(--_text-muted)">uart</text>
|
||||
<rect x="114.0875" y="360" width="73.2" height="27" rx="4" ry="4" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="0.5" />
|
||||
<text x="150.6875" y="373.5" text-anchor="middle" dy="0.35em" font-size="11" font-weight="400" fill="var(--_text-muted)">Custom TCP</text>
|
||||
<rect x="530.51" y="533" width="38.88" height="27" rx="4" ry="4" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="0.5" />
|
||||
<text x="549.95" y="546.5" text-anchor="middle" dy="0.35em" font-size="11" font-weight="400" fill="var(--_text-muted)">mqtt</text>
|
||||
<rect x="513.35" y="360" width="73.2" height="27" rx="4" ry="4" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="0.5" />
|
||||
<text x="549.95" y="373.5" text-anchor="middle" dy="0.35em" font-size="11" font-weight="400" fill="var(--_text-muted)">Custom TCP</text>
|
||||
<rect x="911.425" y="360" width="73.2" height="27" rx="4" ry="4" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="0.5" />
|
||||
<text x="948.025" y="373.5" text-anchor="middle" dy="0.35em" font-size="11" font-weight="400" fill="var(--_text-muted)">Custom TCP</text>
|
||||
<rect x="494.62500000000006" y="442" width="110.65" height="36" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
|
||||
<rect x="455.30000000000007" y="615" width="189.3" height="36" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
|
||||
<rect x="62.00000000000004" y="96" width="74.9" height="36" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
|
||||
<rect x="113.2375" y="269" width="74.9" height="36" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
|
||||
<rect x="160.89999999999995" y="96" width="82.05000000000001" height="36" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
|
||||
<rect x="306.95000000000005" y="96" width="103.5" height="36" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
|
||||
<rect x="445.17500000000007" y="269" width="74.9" height="36" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
|
||||
<rect x="434.45000000000005" y="96" width="96.35000000000001" height="36" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
|
||||
<rect x="554.8" y="96" width="139.25" height="36" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
|
||||
<rect x="758.0500000000001" y="96" width="82.05000000000001" height="36" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
|
||||
<rect x="761.625" y="269" width="74.9" height="36" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
|
||||
<text x="482.62500000000006" y="460" text-anchor="middle" dy="0.35em" font-size="13" font-weight="500" fill="var(--_text)">Event Proxy</text>
|
||||
<text x="482.625" y="633" text-anchor="middle" dy="0.35em" font-size="13" font-weight="500" fill="var(--_text)">Home Assistant Servier</text>
|
||||
<text x="99.45000000000002" y="114" text-anchor="middle" dy="0.35em" font-size="13" font-weight="500" fill="var(--_text)">bme280</text>
|
||||
<text x="150.68750000000003" y="287" text-anchor="middle" dy="0.35em" font-size="13" font-weight="500" fill="var(--_text)">pico w</text>
|
||||
<text x="201.92500000000004" y="114" text-anchor="middle" dy="0.35em" font-size="13" font-weight="500" fill="var(--_text)">pms5003</text>
|
||||
<rect x="512.5" y="269" width="74.9" height="36" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
|
||||
<rect x="434.45" y="96" width="96.35000000000001" height="36" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
|
||||
<rect x="554.8000000000001" y="96" width="124.95" height="36" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
|
||||
<rect x="703.75" y="96" width="139.25" height="36" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
|
||||
<rect x="907" y="96" width="82.05000000000001" height="36" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
|
||||
<rect x="910.5749999999999" y="269" width="74.9" height="36" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
|
||||
<text x="549.95" y="460" text-anchor="middle" dy="0.35em" font-size="13" font-weight="500" fill="var(--_text)">Event Proxy</text>
|
||||
<text x="549.95" y="633" text-anchor="middle" dy="0.35em" font-size="13" font-weight="500" fill="var(--_text)">Home Assistant Servier</text>
|
||||
<text x="99.45000000000005" y="114" text-anchor="middle" dy="0.35em" font-size="13" font-weight="500" fill="var(--_text)">bme280</text>
|
||||
<text x="150.6875" y="287" text-anchor="middle" dy="0.35em" font-size="13" font-weight="500" fill="var(--_text)">pico w</text>
|
||||
<text x="201.92499999999995" y="114" text-anchor="middle" dy="0.35em" font-size="13" font-weight="500" fill="var(--_text)">pms5003</text>
|
||||
<text x="358.70000000000005" y="114" text-anchor="middle" dy="0.35em" font-size="13" font-weight="500" fill="var(--_text)">Anemometer</text>
|
||||
<text x="482.62500000000006" y="287" text-anchor="middle" dy="0.35em" font-size="13" font-weight="500" fill="var(--_text)">pico w</text>
|
||||
<text x="482.62500000000006" y="114" text-anchor="middle" dy="0.35em" font-size="13" font-weight="500" fill="var(--_text)">Wind Vane</text>
|
||||
<text x="624.425" y="114" text-anchor="middle" dy="0.35em" font-size="13" font-weight="500" fill="var(--_text)">MIPS Microphone</text>
|
||||
<text x="799.075" y="114" text-anchor="middle" dy="0.35em" font-size="13" font-weight="500" fill="var(--_text)">ltr-559</text>
|
||||
<text x="799.075" y="287" text-anchor="middle" dy="0.35em" font-size="13" font-weight="500" fill="var(--_text)">pico w</text>
|
||||
<text x="549.95" y="287" text-anchor="middle" dy="0.35em" font-size="13" font-weight="500" fill="var(--_text)">pico w</text>
|
||||
<text x="482.625" y="114" text-anchor="middle" dy="0.35em" font-size="13" font-weight="500" fill="var(--_text)">Wind Vane</text>
|
||||
<text x="617.2750000000001" y="114" text-anchor="middle" dy="0.35em" font-size="13" font-weight="500" fill="var(--_text)">Rain Detector</text>
|
||||
<text x="773.375" y="114" text-anchor="middle" dy="0.35em" font-size="13" font-weight="500" fill="var(--_text)">MIPS Microphone</text>
|
||||
<text x="948.025" y="114" text-anchor="middle" dy="0.35em" font-size="13" font-weight="500" fill="var(--_text)">ltr-559</text>
|
||||
<text x="948.025" y="287" text-anchor="middle" dy="0.35em" font-size="13" font-weight="500" fill="var(--_text)">pico w</text>
|
||||
</svg>
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 9.3 KiB |
|
|
@ -18,6 +18,7 @@ flowchart TD
|
|||
subgraph Node2
|
||||
wind_speed[Anemometer] --> mc2
|
||||
wind_dir[Wind Vane] --> mc2
|
||||
rain[Rain Detector] --> mc2
|
||||
mic[MIPS Microphone] --> mc2
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue