on main help sign in
fix a bunch of madness in star chart and add peer and pal filtering
commite735a6c7c1cccac137be2bddcbeacd6eeaeb191d authorJohn Hyde <johnhydefour@gmail.com> dateTue 13 Dec 2022, 20:34 (4 years ago) parent15920bd
10 files changed+211−152
desk/app/astrolabe.hoon+1−1 desk/lib/state.hoon+5−7 desk/sur/astrolabe.hoon+1−1 desk/tests/lib/state.hoon+10−10 ui/package-lock.json+9−9 ui/package.json+1−1 ui/src/components/StarChart.svelte+20−9 ui/src/lib/colors.ts+3 ui/src/lib/graph.ts+152−105 ui/src/styles/tailwind-output.css+9−9
desk/app/astrolabe.hoon+1−1
@@ -26,7 +26,7 @@
2626 ^- (quip card _this)
2727 =/ old !<(versioned-state old-state)
2828 =/ [cards-01=(list card) new=state-latest]
29− ?. ?=(?(%0 %1 %2 %3) -.old) `old
29+ ?. |(?=(?(%0 %1 %2 %3) -.old) (lth bump.old bump)) `old
3030 (on-naive-state:hc get-nas:hc)
3131 ?> ?=(%4 -.new)
3232 =/ cards=(list card)
desk/lib/state.hoon+5−7
@@ -8,15 +8,13 @@
88 ?: =(parent child) s
99 ?: (is-npoint-locked npoint) s
1010 =/ pdata (pdata:smel (pmeta:smel child npoint) ~)
11+ =. spam.s (~(put bi spam.s) parent child pdata)
1112 =* spo sponsor.net.npoint
1213 =/ prev (~(gut by prev-spo.s) child parent)
13− =/ unsponsored-state
14− =. prev-spo.s (~(del by prev-spo.s) child)
15− =. spam.s (~(del bi spam.s) prev child)
16− s
17− ?. has.spo unsponsored-state
18− =? s !=(prev who.spo)
19− unsponsored-state
14+ =. prev-spo.s (~(del by prev-spo.s) child)
15+ =? spam.s !=(parent prev)
16+ (~(del bi spam.s) prev child)
17+ ?. has.spo s
2018 =. prev-spo.s (~(put by prev-spo.s) child who.spo)
2119 =. spam.s (~(put bi spam.s) who.spo child pdata)
2220 s
desk/sur/astrolabe.hoon+1−1
@@ -29,7 +29,7 @@
2929 ==
3030+$ state-4
3131 $: %4
32− bump=@ud :: bump to update state without changing the type
32+ bump=_1 :: bump to update state without changing the type
3333 prev-spo=(map ship ship) :: so we know who the old sponsor was when sponsor changes
3434 spam=spawn-mip
3535 fropoints-1
desk/tests/lib/state.hoon+10−10
@@ -1,5 +1,5 @@
11/- *astrolabe
2−/+ *astrolabe, *state, *test
2+/+ *astrolabe, *state, *mip, *test
33|%
44++ test-put-in-spawn-mip
55 =| state=state-latest
@@ -13,18 +13,18 @@
1313 %+ expect-eq
1414 !> :-
1515 `~zod :: new prev-spo
16− %.y :: spawn-mip has something under ~zod
16+ "marzod:s;" :: spawn-mip has something under ~zod
1717 !> =- :-
1818 (~(get by prev-spo) ~marzod)
19− (~(has by spam) ~zod)
19+ (~(gut bi spam) ~zod ~marzod "nothing!")
2020 (put-in-spawn-mip ~marzod *npoint state)
2121 ::
2222 %+ expect-eq
2323 !> :*
2424 `~hec :: new prev-spo
25− %.n :: nothing under ~zod
25+ "marzod:s:hec!zod;" :: under ~zod
2626 %.n :: nothing under ~bus
27− %.y :: something under ~hec
27+ "marzod:s:hec!zod;" :: under ~hec
2828 ==
2929 !>
3030 =. state (put-in-spawn-mip ~marzod *npoint state)
@@ -32,17 +32,17 @@
3232 =+ (put-in-spawn-mip ~marzod moved-to-hec state)
3333 :*
3434 (~(get by prev-spo) ~marzod)
35− (~(has by spam) ~zod)
35+ (~(gut bi spam) ~zod ~marzod "nothing!")
3636 (~(has by spam) ~bus)
37− (~(has by spam) ~hec)
37+ (~(gut bi spam) ~hec ~marzod "nothing!")
3838 ==
3939 ::
4040 %+ expect-eq
4141 !> :*
4242 `~zod :: new prev-spo
43− %.y :: something under ~zod
43+ "marzod:s;" :: under ~zod
4444 %.n :: nothing under ~bus
45− %.n :: something under ~hec
45+ %.n :: nothing under ~hec
4646 ==
4747 !>
4848 =. state (put-in-spawn-mip ~marzod *npoint state)
@@ -51,7 +51,7 @@
5151 =+ (put-in-spawn-mip ~marzod *npoint state)
5252 :*
5353 (~(get by prev-spo) ~marzod)
54− (~(has by spam) ~zod)
54+ (~(gut bi spam) ~zod ~marzod "nothing!")
5555 (~(has by spam) ~bus)
5656 (~(has by spam) ~hec)
5757 ==
ui/package-lock.json+9−9
@@ -16,7 +16,7 @@
1616 "bn.js": "^5.2.0",
1717 "graphology": "^0.24.1",
1818 "lodash": "^4.17.21",
19− "sigma": "^2.3.1",
19+ "sigma-jh": "^2.4.2",
2020 "svelte-copy-to-clipboard": "^0.2.5",
2121 "svelte-markdown": "^0.2.3",
2222 "tippy.js": "^6.3.7",
@@ -2467,10 +2467,10 @@
24672467 "node": ">=8"
24682468 }
24692469 },
2470− "node_modules/sigma": {
2471− "version": "2.3.1",
2472− "resolved": "https://registry.npmjs.org/sigma/-/sigma-2.3.1.tgz",
2473− "integrity": "sha512-YfQsVZf78CeIUv8EYLqp/yvhMwwBXGrbpy+rD1N2X9IqtJ11+VfQRjWfVqHDhjM8oPfWPsaJMtpWFQ8pIflvCA==",
2470+ "node_modules/sigma-jh": {
2471+ "version": "2.4.2",
2472+ "resolved": "https://registry.npmjs.org/sigma-jh/-/sigma-jh-2.4.2.tgz",
2473+ "integrity": "sha512-viB4M5Y79N5rAgs0z3M4Gff4HX53S+UMwblPDEH/Nkwwe7AcmcWwsEYsGv/xL/TNQzLIBBb0NaNAg5ZhnbEm8g==",
24742474 "dependencies": {
24752475 "@yomguithereal/helpers": "^1.1.1",
24762476 "events": "^3.3.0",
@@ -4782,10 +4782,10 @@
47824782 "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
47834783 "dev": true
47844784 },
4785− "sigma": {
4786− "version": "2.3.1",
4787− "resolved": "https://registry.npmjs.org/sigma/-/sigma-2.3.1.tgz",
4788− "integrity": "sha512-YfQsVZf78CeIUv8EYLqp/yvhMwwBXGrbpy+rD1N2X9IqtJ11+VfQRjWfVqHDhjM8oPfWPsaJMtpWFQ8pIflvCA==",
4785+ "sigma-jh": {
4786+ "version": "2.4.2",
4787+ "resolved": "https://registry.npmjs.org/sigma-jh/-/sigma-jh-2.4.2.tgz",
4788+ "integrity": "sha512-viB4M5Y79N5rAgs0z3M4Gff4HX53S+UMwblPDEH/Nkwwe7AcmcWwsEYsGv/xL/TNQzLIBBb0NaNAg5ZhnbEm8g==",
47894789 "requires": {
47904790 "@yomguithereal/helpers": "^1.1.1",
47914791 "events": "^3.3.0",
ui/package.json+1−1
@@ -51,7 +51,7 @@
5151 "bn.js": "^5.2.0",
5252 "graphology": "^0.24.1",
5353 "lodash": "^4.17.21",
54− "sigma": "^2.3.1",
54+ "sigma-jh": "^2.4.2",
5555 "svelte-copy-to-clipboard": "^0.2.5",
5656 "svelte-markdown": "^0.2.3",
5757 "tippy.js": "^6.3.7",
ui/src/components/StarChart.svelte+20−9
@@ -3,11 +3,12 @@
33
44 import { push } from 'svelte-spa-router'
55
6− import Sigma from 'sigma';
6+ import Sigma from 'sigma-jh';
77 import Graph from 'graphology';
88
99 import { clan } from 'urbit-ob';
1010 import DocLink from './docs/DocLink.svelte';
11+ import store from 'stores/store';
1112 import { cite, normalizeId } from 'lib/id';
1213 import { parseChartData, populateGraph } from 'lib/graph';
1314 import { getChartData } from 'lib/api';
@@ -33,7 +34,7 @@
3334 allowInvalidContainer: true,
3435 // labelColor: { color: WHITE },
3536 labelFont: 'monospace',
36− labelRenderedSizeThreshold: 9,
37+ labelRenderedSizeThreshold: 2.2,
3738 zIndex: true,
3839 maxCameraRatio: 10,
3940 });
@@ -93,8 +94,8 @@
9394 rawChartData = { error };
9495 });
9596 }
96− $: parsedChartData = parseChartData(rawChartData);
97− $: [parsedChartData, bySponsor], populateGraph(g, parsedChartData, bySponsor, () => {
97+ $: parsedChartData = parseChartData(rawChartData, filterSet);
98+ $: [parsedChartData, childKey], populateGraph(g, parsedChartData, childKey, () => {
9899 searchFunc();
99100 });
100101
@@ -145,7 +146,10 @@
145146 "w-full" :
146147 "border-r";
147148 }
148− let bySponsor = true;
149+ let childKey: ('sponsees' | 'children') = 'sponsees';
150+ let filterSet: Set<string> = null;
151+ $: peersSet = new Set($store.peers);
152+ $: palsSet = new Set(Object.keys($store.pals.outgoing));
149153</script>
150154
151155<div class="border border-gold bg-navy w-full grow flex flex-col relative">
@@ -187,13 +191,20 @@
187191 on:click={() => push('/') }>
188192 X
189193 </div>
190− <div class="flex flex-col absolute -bottom-2 inset-x-0 text-white z-10 2xs:-bottom-3.5">
194+ <div class="flex absolute -bottom-2 inset-x-0 text-white z-10 2xs:-bottom-3.5">
191195 <!-- <div class="ml-8 px-4 py-1 flex gap-x-1 items-center text-white"> -->
192196 <!-- <span>Arrange by</span> -->
193− <InlineSelect bind:value={bySponsor}
197+ <InlineSelect bind:value={childKey}
194198 options={[
195− ['Sponsors', true],
196− ['Parents', false]
199+ ['Sponsors', 'sponsees'],
200+ ['Parents', 'children']
201+ ]}
202+ ></InlineSelect>
203+ <InlineSelect bind:value={filterSet}
204+ options={[
205+ ['All', null],
206+ ['Peers', peersSet],
207+ ['Pals', palsSet],
197208 ]}
198209 ></InlineSelect>
199210 <!-- </div> -->
ui/src/lib/colors.ts+3
@@ -6,9 +6,12 @@ export const GOLDS2 = '#caa93e';
66export const WHITE = '#FFF';
77export const LGREY = '#BBB';
88export const DGREY = '#777';
9+export const DDGREY = '#555';
910export const BLUE = '#1792c7';
1011export const GREEN = '#17c76a';
1112export const YOU_ARE_HERE = '#802';
1213export const YOU = '#b01';
1314export const YOUR_STAR = '#d71';
1415export const YOUR_GAL = '#fb1';
16+export const SUB_PICKED = LGREY;
17+export const NOT_PICKED = DDGREY;
ui/src/lib/graph.ts+152−105
@@ -6,123 +6,161 @@ const example = '[0[3216291:t;9219219;4608:s[156546;1612196;219621:~;321965149:4
66export interface ChartPoint {
77 patp: string,
88 dominion: ('l1' | 'l2' | 'spawn'),
9+ picked: boolean,
10+ pickedChildren?: boolean,
11+ pickedSponsees?: boolean,
912 sponsor?: string,
1013 parent?: string,
1114 children?: ChartPoint[],
1215 sponsees?: ChartPoint[],
1316}
1417
15−function parseMetaString(metaString: string): ChartPoint {
16− let idString, subMetaString = '';
17− const colIndex = metaString.indexOf(':');
18− if (colIndex === -1) {
19− idString = metaString;
20− } else {
21− idString = metaString.slice(0, colIndex);
22− subMetaString = metaString.slice(colIndex + 1);
23− }
24− const meta: ChartPoint = {
25− patp: '~' + idString,
26− dominion: 'l1',
18+interface ChartSubs {
19+ children: ChartPoint[],
20+ sponsees: ChartPoint[],
21+}
22+
23+class ChartDataParser {
24+ filter: Set<string>;
25+
26+ constructor(filter: Set<string>) {
27+ this.filter = filter;
2728 }
28− if (subMetaString) {
29− const firstChar = subMetaString[0];
30− if (firstChar === 't') {
31− meta.dominion = 'l2';
32− subMetaString = subMetaString.slice(1);
33− } else if (firstChar === 's') {
34− meta.dominion = 'spawn';
35− subMetaString = subMetaString.slice(1);
29+
30+ parseMetaString(metaString: string): ChartPoint {
31+ let idString, subMetaString = '';
32+ const colIndex = metaString.indexOf(':');
33+ if (colIndex === -1) {
34+ idString = metaString;
35+ } else {
36+ idString = metaString.slice(0, colIndex);
37+ subMetaString = metaString.slice(colIndex + 1);
38+ }
39+ const patp = '~' + idString;
40+ const meta: ChartPoint = {
41+ patp,
42+ picked: !this.filter ? true : (this.filter.has(patp)),
43+ dominion: 'l1',
3644 }
3745 if (subMetaString) {
38− if (subMetaString[0] === '~') {
39− meta.sponsor = null;
40− } else {
41− let [sponsor, parent] = subMetaString.slice(1).split('!');
42− meta.sponsor = '~' + sponsor;
43− meta.parent = '~' + parent;
46+ const firstChar = subMetaString[0];
47+ if (firstChar === 't') {
48+ meta.dominion = 'l2';
49+ subMetaString = subMetaString.slice(1);
50+ } else if (firstChar === 's') {
51+ meta.dominion = 'spawn';
52+ subMetaString = subMetaString.slice(1);
53+ }
54+ if (subMetaString) {
55+ if (subMetaString[0] === '~') {
56+ meta.sponsor = null;
57+ } else {
58+ let [sponsor, parent] = subMetaString.slice(1).split('!');
59+ meta.sponsor = '~' + sponsor;
60+ meta.parent = '~' + parent;
61+ }
4462 }
4563 }
64+ return meta;
4665 }
47− return meta;
48−}
4966
50−function extractMeta(data: string): [ChartPoint, string] {
51− const index = data.search(/[[;]/);
52− if (index === -1) {
53− throw new Error(`No point meta present in ${data}`);
67+ extractMeta(data: string): [ChartPoint, string] {
68+ const index = data.search(/[[;]/);
69+ if (index === -1) {
70+ throw new Error(`No point meta present in ${data}`);
71+ }
72+ const metaString = data.slice(0, index);
73+ data = data.slice(index);
74+ return [this.parseMetaString(metaString), data];
5475 }
55− const metaString = data.slice(0, index);
56− data = data.slice(index);
57− return [parseMetaString(metaString), data];
58−}
5976
60−function extractChildren(data: string, sup: string = undefined): [ChartPoint[], ChartPoint[], string] {
61− if (data[0] === ';') return [[], [], data.slice(1)];
62− if (data[0] !== '[') throw new Error('Invalid children in data: ' + data.slice(0, 20));
77+ extractChildren(data: string, sup: string = undefined): [ChartSubs, string] {
78+ if (data[0] === ';')
79+ return [{
80+ children: [],
81+ sponsees: [],
82+ }, data.slice(1)];
83+ if (data[0] !== '[') throw new Error('Invalid children in data: ' + data.slice(0, 20));
6384
64− let endFound = false;
65− let counter = 0;
66− data = data.slice(1);
67− const children = [];
68− const sponsees = [];
69− while (!endFound && data.length && counter < 20000) {
70− if (data[0] === ']') {
71− endFound = true;
72− data = data.slice(1);
73− } else {
74− let sub;
75− [sub, data] = extractChartPoint(data);
76− if (!sub.parent || sub.parent === sup)
77− children.push(sub);
78− if (sub.sponsor === undefined || sub.sponsor === sup)
79− sponsees.push(sub);
85+ let endFound = false;
86+ let counter = 0;
87+ data = data.slice(1);
88+ const children = [];
89+ const sponsees = [];
90+ while (!endFound && data.length && counter < 20000) {
91+ if (data[0] === ']') {
92+ endFound = true;
93+ data = data.slice(1);
94+ } else {
95+ let sub;
96+ [sub, data] = this.extractChartPoint(data);
97+ if (!sub.parent || sub.parent === sup)
98+ children.push(sub);
99+ if (sub.sponsor === undefined || sub.sponsor === sup)
100+ sponsees.push(sub);
101+ }
102+ counter++;
80103 }
81− counter++;
104+ return [{ children, sponsees }, data];
82105 }
83− return [children, sponsees, data];
84−}
85106
86−function extractChartPoint(data: string): [ChartPoint, string] {
87− let point, children, sponsees;
88− [point, data] = extractMeta(data);
89− [children, sponsees, data] = extractChildren(data, point.patp);
90− point.children = children;
91− point.sponsees = sponsees;
92− return [point, data];
93−}
107+ extractChartPoint(data: string): [ChartPoint, string] {
108+ let point, subs;
109+ [point, data] = this.extractMeta(data);
110+ [subs, data] = this.extractChildren(data, point.patp);
111+ point = {
112+ ...point,
113+ ...subs,
114+ };
115+ return [point, data];
116+ }
94117
95−function linkChartData(points: ChartPoint[], store: any): ChartPoint[] {
96− if (!points) return points;
97− return points.map(point => {
98− if (!store[point.patp]) return point;
99− if (!point.children?.length) {
100− point.children = linkChartData(store[point.patp].children, store);
101− }
102− if (!point.sponsees?.length) {
103− point.sponsees = linkChartData(store[point.patp].sponsees, store);
104− }
105− return point;
106− });
107−}
118+ linkChartData(points: ChartPoint[], store: any): ChartPoint[] {
119+ if (!points) return points;
120+ return points.map(point => {
121+ if (!store[point.patp]) return point;
122+ if (!point.children?.length) {
123+ point.children = this.linkChartData(store[point.patp].children, store);
124+ let picked = point.children.filter(child => child.picked || child.pickedChildren);
125+ point.pickedChildren = picked.length > 0;
126+ }
127+ if (!point.sponsees?.length) {
128+ point.sponsees = this.linkChartData(store[point.patp].sponsees, store);
129+ let picked = point.sponsees.filter(child => child.picked || child.pickedSponsees);
130+ point.pickedSponsees = picked.length > 0;
131+ }
132+ return point;
133+ });
134+ }
108135
109−function _parseChartData(str: string): ChartPoint[] {
110− if (!str) return [];
111− let [baseChildren, _] = extractChildren(str);
112− let store = {};
113− baseChildren.forEach(child => {
114− store[child.patp] = {
115− children: child.children,
116− sponsees: child.sponsees,
117− };
118− });
136+ parse(str: string): ChartSubs {
137+ if (!str) return { children: [], sponsees: [] };
138+ let [{ children: baseChildren }, _] = this.extractChildren(str, undefined);
139+ let store = {};
140+ baseChildren.forEach(child => {
141+ store[child.patp] = {
142+ children: child.children,
143+ sponsees: child.sponsees,
144+ };
145+ });
146+ let base: ChartPoint = {
147+ patp: '~base',
148+ dominion: 'l1',
149+ picked: true,
150+ }
119151
120− return linkChartData(store['~base'].children, store);
152+ let points = this.linkChartData([base], store);
153+ return {
154+ children: points[0].children || [],
155+ sponsees: points[0].sponsees || [],
156+ }
157+ }
121158}
122159
123−export function parseChartData(data: string): ChartPoint[] {
160+export function parseChartData(data: string, filter: Set<string>): ChartSubs {
124161 let start = Date.now();
125− let parsed = _parseChartData(data);
162+ let parser = new ChartDataParser(filter);
163+ let parsed = parser.parse(data);
126164 // console.log(`finished parsing chart data to js object in ${Date.now() - start} ms`);
127165 return parsed;
128166}
@@ -188,16 +226,23 @@ export function arrangePointsInSpirals(
188226 minDistanceBetween,
189227 };
190228}
191−
192−export function populateGraph(g: Graph, chartData: ChartPoint[], bySponsor: boolean, callback?): Graph {
193− if (!(chartData instanceof Array)) return;
229+type childKey = ('sponsees' | 'children');
230+export function populateGraph(g: Graph, chartSubs: ChartSubs, subsKey: childKey, callback?): Graph {
231+ let pickedSubsKey = subsKey == 'children' ? 'pickedChildren' : 'pickedSponsees';
232+ function pickedColor(point: ChartPoint, normal: string) {
233+ return point.picked ? normal : (point[pickedSubsKey] ? colors.SUB_PICKED : colors.NOT_PICKED);
234+ }
235+ function pickedArmColor(point: ChartPoint, normal: string) {
236+ return point[pickedSubsKey] ? normal : colors.NOT_PICKED;
237+ }
238+ let points = chartSubs[subsKey];
239+ if (!(points instanceof Array)) return;
194240 if (!g) {
195241 g = new Graph();
196242 } else {
197243 g.clear();
198244 }
199245
200− let subsKey = bySponsor ? 'sponsees' : 'children';
201246 let sponsorEdges = [];
202247
203248 let offsetX = 0;
@@ -207,7 +252,7 @@ export function populateGraph(g: Graph, chartData: ChartPoint[], bySponsor: bool
207252 let b = 9000000;
208253 let theta = 0;
209254
210− chartData.forEach((galaxy, gi) => {
255+ points.forEach((galaxy, gi) => {
211256 offsetX = 0 + (a + b * theta) * Math.cos(theta);
212257 offsetY = 0 + (a + b * theta) * Math.sin(theta);
213258
@@ -217,7 +262,7 @@ export function populateGraph(g: Graph, chartData: ChartPoint[], bySponsor: bool
217262 g.addNode(gPatp, {
218263 label: gPatp,
219264 size: 3,
220− color: itsYou ? colors.YOU : colors.WHITE,
265+ color: itsYou ? colors.YOU : pickedColor(galaxy, colors.WHITE),
221266 x: offsetX,
222267 y: offsetY,
223268 zIndex: 10,
@@ -242,6 +287,7 @@ export function populateGraph(g: Graph, chartData: ChartPoint[], bySponsor: bool
242287 });
243288 let lastStarArm = null;
244289 let lastStarPatp = null;
290+ let GSarmColor = pickedArmColor(galaxy, colors.LGREY)
245291 stars.forEach((star, si) => {
246292 const sPatp = star.patp;
247293
@@ -256,20 +302,20 @@ export function populateGraph(g: Graph, chartData: ChartPoint[], bySponsor: bool
256302 g.addNode(sPatp, {
257303 label: sPatp,
258304 size: starSize,
259− color: itsYou ? colors.YOU : colors.GOLDT2,
305+ color: itsYou ? colors.YOU : pickedColor(star, colors.GOLDT2),
260306 x: starX,
261307 y: starY,
262308 zIndex: 8,
263309 });
264310 if (lastStarArm == arm) {
265311 g.addEdge(sPatp, lastStarPatp, {
266− color: colors.LGREY,
312+ color: GSarmColor,
267313 size: 0.1,
268314 zIndex: 7,
269315 });
270316 } else {
271317 g.addEdge(sPatp, gPatp, {
272− color: colors.LGREY,
318+ color: GSarmColor,
273319 size: 0.2,
274320 zIndex: 9,
275321 });
@@ -304,7 +350,8 @@ export function populateGraph(g: Graph, chartData: ChartPoint[], bySponsor: bool
304350 });
305351 let lastPlanetArm = null;
306352 let lastPlanetPatp = null;
307− planets.forEach((planet, pi) => {
353+ let SParmColor = pickedArmColor(star, colors.DGREY)
354+ planets.forEach((planet, pi) => {
308355 const pPatp = planet.patp;
309356 const [planetX, planetY] = planetCoords[pi].coords;
310357 const arm = planetCoords[pi].arm;
@@ -319,21 +366,21 @@ export function populateGraph(g: Graph, chartData: ChartPoint[], bySponsor: bool
319366 g.addNode(pPatp, {
320367 label: pPatp,
321368 size: planetSize,
322− color: itsYou ? colors.YOU : (planet.dominion == 'l2' ? colors.GREEN : colors.BLUE),
369+ color: itsYou ? colors.YOU : pickedColor(planet, planet.dominion == 'l2' ? colors.GREEN : colors.BLUE),
323370 x: planetX,
324371 y: planetY,
325372 zIndex: 6,
326373 });
327374 if (lastPlanetArm == arm) {
328375 g.addEdge(pPatp, lastPlanetPatp, {
329− color: colors.DGREY,
376+ color: SParmColor,
330377 size: planetEdgeSize,
331378 zIndex: 5,
332379 });
333380 } else {
334381 if (numPlanetArms == 1) {
335382 g.addEdge(pPatp, sPatp, {
336− color: colors.DGREY,
383+ color: SParmColor,
337384 size: planetEdgeSize,
338385 zIndex: 5,
339386 });
ui/src/styles/tailwind-output.css+9−9
@@ -650,15 +650,15 @@ Ensure the default browser behavior of the `hidden` attribute.
650650.ml-\[22px\] {
651651 margin-left: 22px;
652652}
653−.mr-4 {
654− margin-right: 1rem;
655−}
656653.mr-1 {
657654 margin-right: 0.25rem;
658655}
659656.ml-8 {
660657 margin-left: 2rem;
661658}
659+.mr-4 {
660+ margin-right: 1rem;
661+}
662662.ml-1 {
663663 margin-left: 0.25rem;
664664}
@@ -764,15 +764,15 @@ Ensure the default browser behavior of the `hidden` attribute.
764764.h-full {
765765 height: 100%;
766766}
767−.h-12 {
768− height: 3rem;
769−}
770767.h-3 {
771768 height: 0.75rem;
772769}
773770.h-\[100vh\] {
774771 height: 100vh;
775772}
773+.h-12 {
774+ height: 3rem;
775+}
776776.h-5 {
777777 height: 1.25rem;
778778}
@@ -857,9 +857,6 @@ Ensure the default browser behavior of the `hidden` attribute.
857857 width: -moz-min-content;
858858 width: min-content;
859859}
860−.w-12 {
861− width: 3rem;
862−}
863860.w-3 {
864861 width: 0.75rem;
865862}
@@ -869,6 +866,9 @@ Ensure the default browser behavior of the `hidden` attribute.
869866.w-\[100vw\] {
870867 width: 100vw;
871868}
869+.w-12 {
870+ width: 3rem;
871+}
872872.w-5 {
873873 width: 1.25rem;
874874}