From f657ca69902fe4745f2cf2b5c4acf6b5e9fa93e5 Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Sat, 14 Jun 2025 02:04:05 +0200 Subject: [PATCH] Update universe json with real data --- public/universe.json | 870 +++++++++++++++++++++++++++++++++++++++-- public/universe.sql | 28 ++ src/data/galaxyData.ts | 125 ------ 3 files changed, 876 insertions(+), 147 deletions(-) create mode 100644 public/universe.sql delete mode 100644 src/data/galaxyData.ts diff --git a/public/universe.json b/public/universe.json index 8a8a21a..7ef9d7a 100644 --- a/public/universe.json +++ b/public/universe.json @@ -1,38 +1,864 @@ - [ { "regionName": "Derelik", "x": "413", "y": "357", - "security": 0.3, - "connectsTo": ["Devoid", "Domain"] + "security": 0.5149152991697388, + "connectsTo": [ + "Devoid", + "Heimatar", + "Providence", + "Molden Heath", + "Curse", + "Great Wildlands" + ] }, { - "regionName": "Devoid", - "x": "200", - "y": "250", - "security": 0.7, - "connectsTo": ["Derelik", "Domain", "Genesis"] + "regionName": "The Forge", + "x": "394", + "y": "200", + "security": 0.607998281731568, + "connectsTo": [ + "The Citadel", + "Sinq Laison", + "Metropolis", + "Vale of the Silent", + "Lonetrek", + "Geminate", + "Etherium Reach", + "Genesis" + ] + }, + { + "regionName": "Vale of the Silent", + "x": "406", + "y": "122", + "security": -0.34033237092591845, + "connectsTo": [ + "Tribute", + "Geminate", + "The Forge", + "The Kalevala Expanse" + ] + }, + { + "regionName": "UUA-F4", + "x": "530", + "y": "63", + "security": -0.0100630626421844 + }, + { + "regionName": "Detorid", + "x": "574", + "y": "460", + "security": -0.38149775065935104, + "connectsTo": [ + "Wicked Creek", + "Insmother", + "Immensea", + "Tenerifis" + ] + }, + { + "regionName": "Wicked Creek", + "x": "528", + "y": "418", + "security": -0.36377813715148133, + "connectsTo": [ + "Insmother", + "Scalding Pass", + "Detorid" + ] + }, + { + "regionName": "Cache", + "x": "648", + "y": "284", + "security": -0.37385254575820037, + "connectsTo": [ + "Insmother", + "Great Wildlands", + "The Spire", + "Outer Passage" + ] + }, + { + "regionName": "Scalding Pass", + "x": "542", + "y": "368", + "security": -0.26204605431927636, + "connectsTo": [ + "Great Wildlands", + "Curse", + "Wicked Creek", + "Insmother" + ] + }, + { + "regionName": "Insmother", + "x": "618", + "y": "382", + "security": -0.38035062758311483, + "connectsTo": [ + "Wicked Creek", + "Detorid", + "Scalding Pass", + "Cache", + "Etherium Reach", + "The Spire" + ] + }, + { + "regionName": "Tribute", + "x": "340", + "y": "92", + "security": -0.32759587715029576, + "connectsTo": [ + "Pure Blind", + "Vale of the Silent", + "Venal", + "Lonetrek" + ] + }, + { + "regionName": "Great Wildlands", + "x": "534", + "y": "314", + "security": -0.17105834314078935, + "connectsTo": [ + "Scalding Pass", + "Curse", + "Molden Heath", + "Geminate", + "Cache", + "Derelik", + "Metropolis", + "Etherium Reach" + ] + }, + { + "regionName": "Curse", + "x": "442", + "y": "402", + "security": -0.07338164115656037, + "connectsTo": [ + "Scalding Pass", + "Great Wildlands", + "Catch", + "Derelik", + "Yasna Zakh" + ] + }, + { + "regionName": "Malpais", + "x": "559", + "y": "171", + "security": -0.40824559283333334, + "connectsTo": [ + "The Kalevala Expanse", + "Perrigen Falls", + "Oasa", + "Etherium Reach", + "The Spire" + ] + }, + { + "regionName": "Catch", + "x": "354", + "y": "472", + "security": -0.2717928654079326, + "connectsTo": [ + "Providence", + "Immensea", + "Stain", + "Curse", + "Khanid", + "Querious", + "Tenerifis", + "Impass" + ] + }, + { + "regionName": "Venal", + "x": "350", + "y": "52", + "security": -0.3001421437136561, + "connectsTo": [ + "Tribute", + "Deklein", + "Branch", + "Tenal", + "Perrigen Falls", + "Yasna Zakh" + ] + }, + { + "regionName": "Lonetrek", + "x": "339", + "y": "142", + "security": 0.606987031951157, + "connectsTo": [ + "The Citadel", + "Pure Blind", + "The Forge", + "Tribute", + "Black Rise" + ] + }, + { + "regionName": "J7HZ-F", + "x": "469", + "y": "64", + "security": -0.16418575262906632 + }, + { + "regionName": "The Spire", + "x": "616", + "y": "203", + "security": -0.475105936625, + "connectsTo": [ + "Perrigen Falls", + "Outer Passage", + "Oasa", + "Insmother", + "Cache", + "Etherium Reach", + "Malpais" + ] + }, + { + "regionName": "A821-A", + "x": "452", + "y": "36", + "security": -0.034137264544742495 + }, + { + "regionName": "Tash-Murkon", + "x": "221", + "y": "405", + "security": 0.6603052261710941, + "connectsTo": [ + "Domain", + "Kador", + "Khanid", + "Providence", + "Stain" + ] + }, + { + "regionName": "Outer Passage", + "x": "648", + "y": "146", + "security": -0.49631053780681816, + "connectsTo": [ + "The Spire", + "Cobalt Edge", + "Perrigen Falls", + "Cache" + ] + }, + { + "regionName": "Stain", + "x": "281", + "y": "497", + "security": -0.10455711547221865, + "connectsTo": [ + "Catch", + "Esoteria", + "Period Basis", + "Tash-Murkon" + ] + }, + { + "regionName": "Pure Blind", + "x": "271", + "y": "98", + "security": -0.14495905016215693, + "connectsTo": [ + "Tribute", + "Lonetrek", + "Fade", + "Cloud Ring", + "Placid" + ] + }, + { + "regionName": "Immensea", + "x": "436", + "y": "450", + "security": -0.4063121969772383, + "connectsTo": [ + "Catch", + "Tenerifis", + "Detorid" + ] + }, + { + "regionName": "Etherium Reach", + "x": "502", + "y": "197", + "security": -0.27166658504, + "connectsTo": [ + "The Kalevala Expanse", + "Perrigen Falls", + "Malpais", + "The Forge", + "Great Wildlands", + "Insmother", + "The Spire" + ] + }, + { + "regionName": "Molden Heath", + "x": "470", + "y": "304", + "security": 0.3680469879577652, + "connectsTo": [ + "Heimatar", + "Great Wildlands", + "Derelik", + "Metropolis" + ] + }, + { + "regionName": "Geminate", + "x": "444", + "y": "164", + "security": -0.3024275973019025, + "connectsTo": [ + "Vale of the Silent", + "Great Wildlands", + "The Forge", + "Metropolis", + "The Kalevala Expanse" + ] + }, + { + "regionName": "Heimatar", + "x": "410", + "y": "295", + "security": 0.669170560510317, + "connectsTo": [ + "Derelik", + "Metropolis", + "Molden Heath", + "Devoid", + "Sinq Laison", + "The Bleak Lands" + ] + }, + { + "regionName": "Impass", + "x": "376", + "y": "516", + "security": -0.2977719593499965, + "connectsTo": [ + "Tenerifis", + "Feythabolis", + "Catch" + ] + }, + { + "regionName": "Sinq Laison", + "x": "260", + "y": "255", + "security": 0.6156939756658657, + "connectsTo": [ + "The Forge", + "The Citadel", + "Everyshore", + "Essence", + "Metropolis", + "The Bleak Lands", + "Domain", + "Heimatar", + "Genesis" + ] + }, + { + "regionName": "The Citadel", + "x": "324", + "y": "199", + "security": 0.6309940396437572, + "connectsTo": [ + "Essence", + "Lonetrek", + "Sinq Laison", + "The Forge", + "Verge Vendor", + "Black Rise" + ] + }, + { + "regionName": "The Kalevala Expanse", + "x": "498", + "y": "135", + "security": -0.39691262036231884, + "connectsTo": [ + "Etherium Reach", + "Malpais", + "Vale of the Silent", + "Geminate" + ] + }, + { + "regionName": "Deklein", + "x": "253", + "y": "20", + "security": -0.6112487431751329, + "connectsTo": [ + "Venal", + "Branch", + "Fade" + ] + }, + { + "regionName": "Devoid", + "x": "319", + "y": "371", + "security": 0.5119248873994359, + "connectsTo": [ + "The Bleak Lands", + "Derelik", + "Providence", + "Domain", + "Heimatar" + ] + }, + { + "regionName": "Everyshore", + "x": "197", + "y": "248", + "security": 0.6360925705249215, + "connectsTo": [ + "Sinq Laison", + "Essence", + "Genesis" + ] + }, + { + "regionName": "The Bleak Lands", + "x": "319", + "y": "326", + "security": 0.47874671877399877, + "connectsTo": [ + "Devoid", + "Domain", + "Sinq Laison", + "Heimatar", + "Metropolis" + ] + }, + { + "regionName": "Esoteria", + "x": "256", + "y": "538", + "security": -0.31748632857731396, + "connectsTo": [ + "Stain", + "Paragon Soul", + "Feythabolis" + ] + }, + { + "regionName": "Oasa", + "x": "616", + "y": "97", + "security": -0.4332066145529412, + "connectsTo": [ + "Malpais", + "Perrigen Falls", + "Cobalt Edge", + "The Spire" + ] + }, + { + "regionName": "Syndicate", + "x": "93", + "y": "174", + "security": -0.13152558743062276, + "connectsTo": [ + "Placid", + "Verge Vendor", + "Outer Ring", + "Solitude", + "Cloud Ring" + ] + }, + { + "regionName": "Metropolis", + "x": "437", + "y": "254", + "security": 0.58966881561735, + "connectsTo": [ + "Heimatar", + "Sinq Laison", + "Molden Heath", + "The Forge", + "Great Wildlands", + "Geminate", + "The Bleak Lands", + "Genesis", + "Yasna Zakh" + ] }, { "regionName": "Domain", - "x": "600", - "y": "300", - "security": 0.9, - "connectsTo": ["Devoid", "Derelik", "Kador"] + "x": "250", + "y": "360", + "security": 0.622324871109413, + "connectsTo": [ + "Kador", + "Tash-Murkon", + "The Bleak Lands", + "Kor-Azor", + "Devoid", + "Providence", + "Sinq Laison" + ] }, { - "regionName": "Genesis", - "x": "350", - "y": "500", - "security": 0.4, - "connectsTo": ["Devoid", "Kador"] + "regionName": "Solitude", + "x": "85", + "y": "267", + "security": 0.43695860747334253, + "connectsTo": [ + "Syndicate", + "Aridia", + "Placid" + ] + }, + { + "regionName": "Tenal", + "x": "387", + "y": "4", + "security": -0.3992947466678551, + "connectsTo": [ + "Branch", + "Venal", + "Cobalt Edge" + ] + }, + { + "regionName": "Fade", + "x": "247", + "y": "58", + "security": -0.3635972129581686, + "connectsTo": [ + "Pure Blind", + "Cloud Ring", + "Deklein" + ] + }, + { + "regionName": "Providence", + "x": "319", + "y": "426", + "security": -0.14058107644986062, + "connectsTo": [ + "Derelik", + "Catch", + "Devoid", + "Tash-Murkon", + "Domain" + ] + }, + { + "regionName": "Placid", + "x": "180", + "y": "154", + "security": 0.32579435985104327, + "connectsTo": [ + "Verge Vendor", + "Syndicate", + "Cloud Ring", + "Pure Blind", + "Essence", + "Black Rise", + "Solitude", + "Yasna Zakh" + ] + }, + { + "regionName": "Khanid", + "x": "121", + "y": "412", + "security": 0.4707018411736416, + "connectsTo": [ + "Tash-Murkon", + "Kor-Azor", + "Querious", + "Catch", + "Aridia" + ] + }, + { + "regionName": "Querious", + "x": "161", + "y": "468", + "security": -0.30662408350814446, + "connectsTo": [ + "Khanid", + "Delve", + "Catch" + ] + }, + { + "regionName": "Cloud Ring", + "x": "144", + "y": "87", + "security": -0.0743454982001546, + "connectsTo": [ + "Syndicate", + "Fade", + "Outer Ring", + "Pure Blind", + "Placid", + "Fountain", + "Black Rise" + ] }, { "regionName": "Kador", - "x": "500", - "y": "180", - "security": 0.6, - "connectsTo": ["Domain", "Genesis"] + "x": "191", + "y": "338", + "security": 0.6126151510741249, + "connectsTo": [ + "Domain", + "Genesis", + "Tash-Murkon", + "Kor-Azor" + ] + }, + { + "regionName": "Cobalt Edge", + "x": "651", + "y": "60", + "security": -0.5536523969632012, + "connectsTo": [ + "Oasa", + "Outer Passage", + "Tenal" + ] + }, + { + "regionName": "Aridia", + "x": "65", + "y": "347", + "security": 0.24478602679259379, + "connectsTo": [ + "Genesis", + "Khanid", + "Fountain", + "Solitude", + "Delve", + "Kor-Azor" + ] + }, + { + "regionName": "Branch", + "x": "313", + "y": "1", + "security": -0.5066867665502245, + "connectsTo": [ + "Venal", + "Tenal", + "Deklein" + ] + }, + { + "regionName": "Feythabolis", + "x": "370", + "y": "565", + "security": -0.4091841058376114, + "connectsTo": [ + "Impass", + "Omist", + "Esoteria", + "Tenerifis" + ] + }, + { + "regionName": "Outer Ring", + "x": "48", + "y": "109", + "security": -0.11103294363595742, + "connectsTo": [ + "Syndicate", + "Fountain", + "Cloud Ring" + ] + }, + { + "regionName": "Fountain", + "x": "0", + "y": "219", + "security": -0.29222405411119884, + "connectsTo": [ + "Outer Ring", + "Aridia", + "Delve", + "Cloud Ring" + ] + }, + { + "regionName": "Paragon Soul", + "x": "191", + "y": "561", + "security": -0.24369043436760165, + "connectsTo": [ + "Esoteria", + "Period Basis" + ] + }, + { + "regionName": "Delve", + "x": "42", + "y": "448", + "security": -0.3946951739788309, + "connectsTo": [ + "Querious", + "Period Basis", + "Fountain", + "Aridia" + ] + }, + { + "regionName": "Tenerifis", + "x": "451", + "y": "496", + "security": -0.36507054923117094, + "connectsTo": [ + "Immensea", + "Impass", + "Catch", + "Omist", + "Feythabolis", + "Detorid" + ] + }, + { + "regionName": "Omist", + "x": "441", + "y": "546", + "security": -0.3901093373640807, + "connectsTo": [ + "Feythabolis", + "Tenerifis" + ] + }, + { + "regionName": "Period Basis", + "x": "68", + "y": "528", + "security": -0.42878320818367055, + "connectsTo": [ + "Delve", + "Paragon Soul", + "Stain" + ] + }, + { + "regionName": "Essence", + "x": "192", + "y": "192", + "security": 0.5887139407756176, + "connectsTo": [ + "Sinq Laison", + "Everyshore", + "Genesis", + "The Citadel", + "Verge Vendor", + "Placid", + "Black Rise" + ] + }, + { + "regionName": "Kor-Azor", + "x": "144", + "y": "370", + "security": 0.5162395295666038, + "connectsTo": [ + "Domain", + "Genesis", + "Kador", + "Khanid", + "Aridia" + ] + }, + { + "regionName": "Perrigen Falls", + "x": "554", + "y": "110", + "security": -0.44654669681730774, + "connectsTo": [ + "Malpais", + "The Spire", + "Oasa", + "Etherium Reach", + "Outer Passage", + "Venal" + ] + }, + { + "regionName": "Genesis", + "x": "134", + "y": "315", + "security": 0.449996365784655, + "connectsTo": [ + "Kador", + "Essence", + "Everyshore", + "Verge Vendor", + "Kor-Azor", + "Aridia", + "Sinq Laison", + "The Forge", + "Metropolis" + ] + }, + { + "regionName": "Verge Vendor", + "x": "132", + "y": "226", + "security": 0.6622543631310255, + "connectsTo": [ + "Essence", + "Genesis", + "Placid", + "Syndicate", + "The Citadel" + ] + }, + { + "regionName": "Black Rise", + "x": "282", + "y": "160", + "security": 0.3282094965606475, + "connectsTo": [ + "Lonetrek", + "Cloud Ring", + "Placid", + "The Citadel", + "Essence" + ] + }, + { + "regionName": "Pochven", + "x": "327", + "y": "292", + "security": -1 + }, + { + "regionName": "Yasna Zakh", + "x": "414", + "y": "327", + "security": -1, + "connectsTo": [ + "Metropolis", + "Placid", + "Venal", + "Curse" + ] } -] +] \ No newline at end of file diff --git a/public/universe.sql b/public/universe.sql new file mode 100644 index 0000000..32b84cb --- /dev/null +++ b/public/universe.sql @@ -0,0 +1,28 @@ +WITH RegionConnections AS ( + SELECT + ss.regionId AS fromRegionId, + ss_to.regionId AS toRegionId + FROM StarGates sg + JOIN SolarSystems ss ON sg.fromSystemId = ss.solarSystemId + JOIN SolarSystems ss_to ON sg.toSystemId = ss_to.solarSystemId + WHERE ss.regionId != ss_to.regionId +), +ConnectedRegions AS ( + SELECT + fromRegionId, + GROUP_CONCAT(DISTINCT r2.regionName) AS connectedRegions + FROM RegionConnections rc + JOIN Regions r2 ON rc.toRegionId = r2.regionId + GROUP BY fromRegionId +) +SELECT + re.regionName AS regionName, + rml.x, + rml.y, + AVG(ss.security) AS security, + COALESCE(cr.connectedRegions, '') AS connectsTo +FROM RegionMapLayout rml +JOIN Regions re ON rml.regionId = re.regionId +JOIN SolarSystems ss ON ss.regionId = re.regionId +LEFT JOIN ConnectedRegions cr ON re.regionId = cr.fromRegionId +GROUP BY re.regionId; \ No newline at end of file diff --git a/src/data/galaxyData.ts b/src/data/galaxyData.ts deleted file mode 100644 index 9e971d4..0000000 --- a/src/data/galaxyData.ts +++ /dev/null @@ -1,125 +0,0 @@ - -export const galaxyData = { - regions: [ - { id: 'outer-ring', name: 'Outer Ring' }, - { id: 'syndicate', name: 'Syndicate' }, - { id: 'fountain', name: 'Fountain' }, - { id: 'cloud-ring', name: 'Cloud Ring' }, - { id: 'fade', name: 'Fade' }, - { id: 'pure-blind', name: 'Pure Blind' }, - { id: 'deklein', name: 'Deklein' }, - { id: 'branch', name: 'Branch' }, - { id: 'tenal', name: 'Tenal' }, - { id: 'venal', name: 'Venal' }, - { id: 'tribute', name: 'Tribute' }, - { id: 'vale-of-silent', name: 'Vale of the Silent' }, - { id: 'geminate', name: 'Geminate' }, - { id: 'the-citadel', name: 'The Citadel' }, - { id: 'the-forge', name: 'The Forge' }, - { id: 'lonetrek', name: 'Lonetrek' } - ], - nodePositions: { - 'outer-ring': { x: 150, y: 200 }, - 'syndicate': { x: 250, y: 350 }, - 'fountain': { x: 120, y: 400 }, - 'cloud-ring': { x: 320, y: 220 }, - 'fade': { x: 450, y: 180 }, - 'pure-blind': { x: 480, y: 250 }, - 'deklein': { x: 450, y: 130 }, - 'branch': { x: 550, y: 100 }, - 'tenal': { x: 650, y: 120 }, - 'venal': { x: 580, y: 170 }, - 'tribute': { x: 580, y: 220 }, - 'vale-of-silent': { x: 680, y: 260 }, - 'geminate': { x: 720, y: 320 }, - 'the-citadel': { x: 560, y: 370 }, - 'the-forge': { x: 660, y: 370 }, - 'lonetrek': { x: 580, y: 290 } - }, - connections: [ - { from: 'outer-ring', to: 'syndicate' }, - { from: 'outer-ring', to: 'fountain' }, - { from: 'syndicate', to: 'cloud-ring' }, - { from: 'cloud-ring', to: 'fade' }, - { from: 'cloud-ring', to: 'pure-blind' }, - { from: 'fade', to: 'pure-blind' }, - { from: 'fade', to: 'deklein' }, - { from: 'deklein', to: 'branch' }, - { from: 'branch', to: 'tenal' }, - { from: 'tenal', to: 'venal' }, - { from: 'venal', to: 'tribute' }, - { from: 'pure-blind', to: 'tribute' }, - { from: 'tribute', to: 'vale-of-silent' }, - { from: 'vale-of-silent', to: 'geminate' }, - { from: 'tribute', to: 'lonetrek' }, - { from: 'lonetrek', to: 'the-citadel' }, - { from: 'lonetrek', to: 'the-forge' }, - { from: 'the-citadel', to: 'the-forge' }, - { from: 'geminate', to: 'the-forge' } - ] -}; - -export const regionData: Record = { - 'the-forge': { - name: 'The Forge', - systems: [ - { id: 'jita', name: 'Jita' }, - { id: 'perimeter', name: 'Perimeter' }, - { id: 'sobaseki', name: 'Sobaseki' }, - { id: 'urlen', name: 'Urlen' }, - { id: 'maurasi', name: 'Maurasi' }, - { id: 'kimotoro', name: 'Kimotoro' }, - { id: 'new-caldari', name: 'New Caldari' }, - { id: 'outuni', name: 'Outuni' } - ], - nodePositions: { - 'jita': { x: 600, y: 400 }, - 'perimeter': { x: 550, y: 350 }, - 'sobaseki': { x: 650, y: 350 }, - 'urlen': { x: 500, y: 400 }, - 'maurasi': { x: 700, y: 400 }, - 'kimotoro': { x: 600, y: 300 }, - 'new-caldari': { x: 600, y: 500 }, - 'outuni': { x: 550, y: 450 } - }, - connections: [ - { from: 'jita', to: 'perimeter' }, - { from: 'jita', to: 'sobaseki' }, - { from: 'jita', to: 'urlen' }, - { from: 'jita', to: 'maurasi' }, - { from: 'jita', to: 'kimotoro' }, - { from: 'jita', to: 'new-caldari' }, - { from: 'perimeter', to: 'kimotoro' }, - { from: 'perimeter', to: 'outuni' }, - { from: 'sobaseki', to: 'maurasi' }, - { from: 'new-caldari', to: 'outuni' } - ] - }, - 'syndicate': { - name: 'Syndicate', - systems: [ - { id: 'poitot', name: 'Poitot' }, - { id: '6-cz49', name: '6-CZ49' }, - { id: 'x-7omm', name: 'X-7OMM' }, - { id: 'pc9-ay', name: 'PC9-AY' }, - { id: 'mj-5f9', name: 'MJ-5F9' }, - { id: 'f-88pk', name: 'F-88PK' } - ], - nodePositions: { - 'poitot': { x: 600, y: 400 }, - '6-cz49': { x: 500, y: 350 }, - 'x-7omm': { x: 700, y: 350 }, - 'pc9-ay': { x: 550, y: 300 }, - 'mj-5f9': { x: 650, y: 300 }, - 'f-88pk': { x: 600, y: 250 } - }, - connections: [ - { from: 'poitot', to: '6-cz49' }, - { from: 'poitot', to: 'x-7omm' }, - { from: '6-cz49', to: 'pc9-ay' }, - { from: 'x-7omm', to: 'mj-5f9' }, - { from: 'pc9-ay', to: 'f-88pk' }, - { from: 'mj-5f9', to: 'f-88pk' } - ] - } -};