From 12f0a3c2f1aef0747bf431837b2d94171107fc86 Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Sat, 8 Mar 2025 10:30:44 +0000 Subject: [PATCH] Add new exporter --- visualisations/d3.py | 41 +++ visualisations/mermaid-mindmap-example.md | 359 +++++++++++----------- 2 files changed, 227 insertions(+), 173 deletions(-) create mode 100644 visualisations/d3.py diff --git a/visualisations/d3.py b/visualisations/d3.py new file mode 100644 index 0000000..ee26913 --- /dev/null +++ b/visualisations/d3.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python3 +""" +Reads a GlobalTalk Scraper JSON file and dumps a hierarchical layout for use with D3 +""" + +import argparse +import sys +import json + +# Object types to include in the export +INCLUDED_TYPES = ['AFPServer', 'Workstation', 'ImageWriter', 'LaserWriter', 'Darwin'] + + +def main(): + parser = argparse.ArgumentParser("sunburst") + parser.add_argument("json", type=argparse.FileType("r")) + parser.add_argument("--output", type=argparse.FileType("w"), default=sys.stdout) + args = parser.parse_args() + + obj = json.load(args.json) + + data = { + "name": "GlobalTalk", + "children": [ + { + "name": x, + "children": [ + {"name": "{0} - {1}".format(y["object"], y['type']), "children": []} + for y in obj["nodes"] + if y["zone"] == x and y['type'] in INCLUDED_TYPES + ], + } + for x in obj["zones"] + ], + } + + args.output.write(json.dumps(data)) + + +if __name__ == "__main__": + main() diff --git a/visualisations/mermaid-mindmap-example.md b/visualisations/mermaid-mindmap-example.md index d510dc7..902316e 100644 --- a/visualisations/mermaid-mindmap-example.md +++ b/visualisations/mermaid-mindmap-example.md @@ -2,199 +2,212 @@ mindmap root)GlobalTalk( Doofnet - nas-afp jrouter v0.0.12 + Bluey HP LJ Pro 200 Color - SafetyThird - Smitty's SE30 - MacSE/30 - Smitty - 1Bit - 1Bit_QEMU - gutbomb - HP Neverstop Laser 1001nw 7AC4A - Totally Legit LaserWriter - zoidberg - GutBomb's Server - gutbomb + nas-afp + Bandit + MacLab House + jrouter v0.0.12 scotgate - LaserWriter 4/600 PS - lcdsoundsystem + Quadra 800 - QEMU EPSON WP 4535 Series - scotgate - PDF + jrouter v0.0.13 wolfalice u2 - ClayNet - - ClayNet - Unnamed - Vintage Computer Garage - applepi - VCG GlobalTalk - Vintage Computer Garage + asiandubfoundation + chris + PDF + LaserWriter 4/600 PS + superfurryanimals + lcdsoundsystem + scotgate + Mystery Quadra 950 + Myster Quadra 950 + 950 + Daniel's Lab + retrouter.FastEthernet0 + MacServ + 192.168.228.2 + 509464 + 247077 + FlatSE + AIR LC475 + PDF-Printer + retrouter.Vlan84 + retrouter.Vlan86 + 247088 + Daniel + B154FD21B4661D2A + MacCDs + PM7600 + MacBack + Daniel's IIcx + retrouter.Vlan83 + KennyLoginsDangerZone + ImageScribbler + AsantéPrint 9474A792 + Rackintosh LC Joe's Computer Museum Pumpkintosh Joe's LaserWriter 320 Joe's ImageWriter - PurrTopia + Vintage Computer Garage + PBG3 + Vintage Computer Garage + VCG GlobalTalk + applepi + Captain's Quarters II BBS + Quadra 605 + Brother DCP L2550DW series + CQFileServer + Mac IIci + + gutbomb + Totally Legit LaserWriter + gutbomb + zoidberg + GutBomb's Server + HP Neverstop Laser 1001nw 7AC4A + 68kradio.ddns.net + PowerGlove G3 Beige 300 + 68K RADIO TOWER + 68K Radio HQ (LC III) + LC Hammer + a møøse onçe bit my router + PowerGlove G3 Beige 300∏.Õg + 68k-utm-router + a møøse once bit my router + Poodle Palace jrouter v0.0.12 - Recta_Pete - Recta_Pete - FDF6D36AEF075652E686979642E95672 - Quadra 650 - Peter Fletcher’s Power Mac G4 + AsantéTalk 9408500A + Molten Software + Molten Software + Molten G3 B&W + Biosrhythm + Biosrhythm AIR LikesOldMacs + Lyle's IWII Q700 LyleWriter 2400 Lyle @likesoldmacs - Lyle's IWII - Syracuse NY - Syracuse SE/30 - Syracuse NY - The Barn Yard - jrouter v0.0.12 - retrolab - jrouter v0.0.13 - Green SE - BlueSCSI HQ - jrouter v0.0.12 - beagle - OptiplexMicro - SquakersSUSLaserWriter - Quadra 605 - Biosrhythm - Biosrhythm AIR - Woodland Digital Studios - GlobalTalk Router - Brother - netatalk - PDF - airhost - Cloudbusting - BROTHER-PRINTER - BRN_3937AC_P1_AT - BROTHER-PR_P1 - CloudTalk - Puppet Head - arm64 - Poodle Palace - AsantéTalk 9408500A - jrouter - Captain's Quarters II BBS - - Mac IIci - Brother DCP L2550DW series - CQFileServer - Quadra 605 - BabCom - BabCom Gateway - BabCom-PDF - VALEN - apfelbaum - Sunny - Babylon 5 - BabCom - Apfelbaum - the polpo zone - portola - ImageScribbler - Performa 400 - 691468 - 40Mhz is enough for anyone! - SmallNAS - raspberrypi - GlobalTalk - QEMU - Brother MFC-L2730DW - GlobalTalk PDF Printer - Nanoraptor - Nanoraptor - Wafflenet - Reiko - 0D61ADF690BA7804F91096300B35@WOZ - Wafflenet ImageWriter II - Lisa - Wafflenet - RToD LC - RToD LC - kero's world - jrouter - Daniel's Lab - retrouter.Vlan85 - 247088 - retrouter.Vlan86 - retrouter.Vlan82 - PM7600 - Daniel - retrouter.FastEthernet0 - FlatSE - 192.168.228.181 - MacServ - retrouter.Vlan83 - 247077 - MacCDs - 192.168.228.2 - Daniel's IIcx - B154FD21B4661D2A - PDF-Printer - retrouter.Vlan81 - MacBack - retrouter.Vlan84 - anotherzone - ciscots - ciscots.FastEthernet0/0 - Vintage - - bbtrtr.GigabitEthernet0/0.1140 - FEATHER - bbtrtr - bbtrtr.Tunnel97 - BBT GlobalTalk - Unnamed - feather - foobar - bbtrtr - bbtrtr.Tunnel95 - RTC - Panasonic KXP2123 (LaserWriter) - RTC_Qemu - Compaq Armada 1700 - A1700 - 884928-F2Af7F1 - BaroNet - kallebooLombard - Lombard - Blackbird - BaroNet - TechToolPro3CP - Wallstreet - MacLab House - jrouter v0.0.12 - KennyLoginsDangerZone - AsantéPrint 9474A792 - Rackintosh LC - SNAKSrV - Laserwriter - snacky - 192.168.151.1 - retronet-qemu3 - Emulated Mac - GlobalSwim - Thermite - raspi - JurassicMac - Airaga - Airaga Base Router - AIR Admin’s Guide Server MintyLand MintyNode MintyLand - Mystery Quadra 950 - 950 - Myster Quadra 950 + Vintage + bbtrtr + + bbtrtr.GigabitEthernet0/0.1140 + FEATHER + bbtrtr.Tunnel97 + feather + BBT GlobalTalk + Unnamed + Cloudbusting + arm64 + BRN_3937AC_P1_AT + BROTHER-PRINTER + CloudTalk + Puppet Head + BROTHER-PR_P1 + beagle + OptiplexMicro + Quadra 605 + SquakersSUSLaserWriter LowTechNet Brads IICX LowTechNet + Syracuse NY + 3400C + Syracuse NY + LaserWriter Select + Syracuse SE/30 + BabCom + VALEN + BabCom Gateway + BabCom + Apfelbaum + Babylon 5 + Sunny + apfelbaum + BabCom-PDF + retrolab + jrouter v0.0.13 + Green SE + jagHaus + + Quicksilver + appleshare + Brother HL L2360D series + Quadra 800 + PDF + EPSON XP 7100 Series + Unnamed + GlobalSwim + JurassicMac + Thermite + raspi + netjibbing + jrouter v0.0.12 + Airaga + AIR Admin’s Guide Server + Airaga Base Router + foobar + bbtrtr + bbtrtr.Tunnel95 + Woodland Digital Studios + netatalk + airhost + GlobalTalk Router + PDF + Brother + ClayNet + + Unnamed + ClayNet + PurrTopia + jrouter v0.0.12 + Nanoraptor + jrouter v0.0.12 + Nanoraptor + PowerBook 500 + kero's world + jrouter + 40Mhz is enough for anyone! + QEMU + GlobalTalk PDF Printer + SmallNAS + raspberrypi + GlobalTalk + Brother MFC-L2730DW + anotherzone + ciscots.FastEthernet0/0 + ciscots + Recta_Pete + Peter Fletcher’s Power Mac G4 + FDF6D36AEF075652E686979642E95672 + Recta_Pete + Quadra 650 + BaroNet + BaroNet + kallebooLombard + Blackbird + Wallstreet + Lombard + TechToolPro3CP + the polpo zone + Performa 400 + 691468 + portola + BlueSCSI HQ + jrouter v0.0.12 + 1Bit + 1Bit_QEMU + Wafflenet + Lisa + Reiko + Wafflenet + 0D61ADF690BA7804F91096300B35@WOZ + Wafflenet ImageWriter II ``` \ No newline at end of file