@johndimm/constellations 1.0.0

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.
Files changed (44) hide show
  1. package/App.tsx +480 -0
  2. package/FullPageConstellations.tsx +74 -0
  3. package/FullPageConstellationsHostShell.tsx +27 -0
  4. package/README.md +116 -0
  5. package/components/AppConfirmDialog.tsx +46 -0
  6. package/components/AppHeader.tsx +73 -0
  7. package/components/AppNotifications.tsx +21 -0
  8. package/components/BrowsePeople.tsx +832 -0
  9. package/components/ControlPanel.tsx +1023 -0
  10. package/components/Graph.tsx +1525 -0
  11. package/components/HelpOverlay.tsx +168 -0
  12. package/components/NodeContextMenu.tsx +160 -0
  13. package/components/PeopleBrowserSidebar.tsx +690 -0
  14. package/components/Sidebar.tsx +271 -0
  15. package/components/TimelineView.tsx +4 -0
  16. package/hooks/useExpansion.ts +889 -0
  17. package/hooks/useGraphActions.ts +325 -0
  18. package/hooks/useGraphState.ts +414 -0
  19. package/hooks/useKioskMode.ts +47 -0
  20. package/hooks/useNodeClickHandler.ts +172 -0
  21. package/hooks/useSearchHandlers.ts +369 -0
  22. package/host.ts +16 -0
  23. package/index.css +101 -0
  24. package/index.tsx +16 -0
  25. package/kioskDomains.ts +307 -0
  26. package/package.json +78 -0
  27. package/services/aiUtils.ts +364 -0
  28. package/services/cacheService.ts +76 -0
  29. package/services/crossrefService.ts +107 -0
  30. package/services/geminiService.ts +1359 -0
  31. package/services/get-local-graphs.js +5 -0
  32. package/services/graphUtils.ts +347 -0
  33. package/services/imageService.ts +39 -0
  34. package/services/llmClient.ts +194 -0
  35. package/services/openAlexService.ts +173 -0
  36. package/services/wikipediaImage.ts +40 -0
  37. package/services/wikipediaService.ts +1175 -0
  38. package/sessionHandoff.ts +132 -0
  39. package/types.ts +99 -0
  40. package/useFullPageConstellationsHost.ts +116 -0
  41. package/utils/evidenceUtils.ts +107 -0
  42. package/utils/graphLogicUtils.ts +32 -0
  43. package/utils/graphNodeToChannelNotes.ts +71 -0
  44. package/utils/wikiUtils.ts +34 -0
@@ -0,0 +1,307 @@
1
+ export type KioskDomain = {
2
+ id: string;
3
+ label: string;
4
+ description?: string;
5
+ // NOTE: The bipartite pair should be assigned by the LLM.
6
+ // We keep this optional field only for backwards-compatibility with older saved configs,
7
+ // but the client does not use it to force a pair.
8
+ lockPair?: { atomicType: string; compositeType: string };
9
+ terms: string[];
10
+ };
11
+
12
+ export const DEFAULT_KIOSK_DOMAINS: KioskDomain[] = [
13
+ {
14
+ id: "actors-movies-tv",
15
+ label: "Actors / Movies / TV",
16
+ description: "People ↔ Works (films / TV).",
17
+ terms: [
18
+ "The Godfather",
19
+ "Pulp Fiction",
20
+ "Schindler's List",
21
+ "2001: A Space Odyssey",
22
+ "The Lord of the Rings (film series)",
23
+ "The Sopranos",
24
+ "Breaking Bad",
25
+ "Game of Thrones",
26
+ "Martin Scorsese",
27
+ "Stanley Kubrick",
28
+ "Steven Spielberg",
29
+ "Alfred Hitchcock",
30
+ "Meryl Streep",
31
+ "Marlon Brando",
32
+ "Tom Hanks",
33
+ "Kevin Bacon",
34
+ "Christopher Nolan",
35
+ "Coen Brothers"
36
+ ]
37
+ },
38
+ {
39
+ id: "mathematicians",
40
+ label: "Mathematics",
41
+ description: "Mostly mathematicians (people), plus a few foundational ideas.",
42
+ terms: [
43
+ "Paul Erdős",
44
+ "Euclid",
45
+ "Archimedes",
46
+ "Isaac Newton",
47
+ "Leonhard Euler",
48
+ "Carl Friedrich Gauss",
49
+ "Bernhard Riemann",
50
+ "David Hilbert",
51
+ "Emmy Noether",
52
+ "Henri Poincaré",
53
+ "Alan Turing",
54
+ "Kurt Gödel",
55
+ "John von Neumann",
56
+ "Andrew Wiles",
57
+ "Srinivasa Ramanujan"
58
+ ]
59
+ },
60
+ {
61
+ id: "literature",
62
+ label: "Literature",
63
+ description: "Authors ↔ Books (and book-related events/works).",
64
+ terms: [
65
+ "Stephen King",
66
+ "Cormac McCarthy",
67
+ "Charles Dickens",
68
+ "William Shakespeare",
69
+ "Jane Austen",
70
+ "Leo Tolstoy",
71
+ "Fyodor Dostoevsky",
72
+ "Virginia Woolf",
73
+ "Franz Kafka",
74
+ "Gabriel Garcia Marquez",
75
+ "George Orwell",
76
+ "Toni Morrison",
77
+ "J. R. R. Tolkien",
78
+ "H. P. Lovecraft",
79
+ "Mary Shelley",
80
+ "Moby-Dick",
81
+ "Pride and Prejudice",
82
+ "1984",
83
+ "The Road",
84
+ "Blood Meridian"
85
+ ]
86
+ },
87
+ {
88
+ id: "popular-music",
89
+ label: "Popular Music",
90
+ description: "Artists, albums, and songs.",
91
+ terms: [
92
+ "The Beatles",
93
+ "Abbey Road",
94
+ "Beyoncé",
95
+ "Lemonade (Beyoncé album)",
96
+ "Taylor Swift",
97
+ "Billie Eilish",
98
+ "Olivia Rodrigo",
99
+ "Radiohead",
100
+ "Kendrick Lamar",
101
+ "To Pimp a Butterfly",
102
+ "DAMN.",
103
+ "Drake",
104
+ "Travis Scott",
105
+ "ASTROWORLD",
106
+ "Cardi B",
107
+ "Megan Thee Stallion",
108
+ "Tyler, the Creator",
109
+ "Bad Bunny",
110
+ "Doja Cat",
111
+ "Lil Nas X",
112
+ "Prince",
113
+ "David Bowie",
114
+ "Daft Punk",
115
+ "Discovery (Daft Punk album)",
116
+ "Giant Steps (album)"
117
+ ]
118
+ },
119
+ {
120
+ id: "classical-music",
121
+ label: "Classical Music",
122
+ description: "Composers/Performers ↔ Compositions.",
123
+ terms: [
124
+ "Ludwig van Beethoven",
125
+ "Wolfgang Amadeus Mozart",
126
+ "Johann Sebastian Bach",
127
+ "Pyotr Ilyich Tchaikovsky",
128
+ "Frédéric Chopin",
129
+ "Igor Stravinsky",
130
+ "Yo-Yo Ma",
131
+ "Glenn Gould",
132
+ "Maria Callas",
133
+ "Luciano Pavarotti",
134
+ "Gustavo Dudamel",
135
+ "Hilary Hahn",
136
+ "The Rite of Spring",
137
+ "The Magic Flute",
138
+ "Symphony No. 5 (Beethoven)",
139
+ "Goldberg Variations"
140
+ ]
141
+ },
142
+ {
143
+ id: "history",
144
+ label: "History",
145
+ description: "People ↔ Events.",
146
+ terms: [
147
+ "Francis Fukuyama",
148
+ "Yuval Noah Harari",
149
+ "Jared Diamond",
150
+ "Julius Caesar",
151
+ "Cleopatra",
152
+ "Alexander the Great",
153
+ "Genghis Khan",
154
+ "Martin Luther",
155
+ "Protestant Reformation",
156
+ "George Washington",
157
+ "American Revolution",
158
+ "Abraham Lincoln",
159
+ "American Civil War",
160
+ "Napoleon Bonaparte",
161
+ "French Revolution",
162
+ "World War II",
163
+ "Winston Churchill",
164
+ "Cold War",
165
+ "Fall of the Berlin Wall",
166
+ "Mahatma Gandhi",
167
+ "Indian independence movement",
168
+ "Nelson Mandela",
169
+ "Apartheid",
170
+ "Watergate scandal",
171
+ "Apollo 11",
172
+ "Renaissance"
173
+ ]
174
+ },
175
+ {
176
+ id: "science",
177
+ label: "Science",
178
+ description: "Scientists ↔ Discoveries/Experiments (safe, high-signal).",
179
+ terms: [
180
+ "Galileo Galilei",
181
+ "Isaac Newton",
182
+ "Michael Faraday",
183
+ "James Clerk Maxwell",
184
+ "Nikola Tesla",
185
+ "Louis Pasteur",
186
+ "Max Planck",
187
+ "Niels Bohr",
188
+ "Enrico Fermi",
189
+ "Richard Feynman",
190
+ "Richard Dawkins",
191
+ "Marie Curie",
192
+ "radioactivity",
193
+ "Albert Einstein",
194
+ "general relativity",
195
+ "Charles Darwin",
196
+ "On the Origin of Species",
197
+ "Gregor Mendel",
198
+ "Mendelian inheritance",
199
+ "Rosalind Franklin",
200
+ "DNA",
201
+ "CRISPR",
202
+ "James Watson",
203
+ "Francis Crick"
204
+ ]
205
+ },
206
+ {
207
+ id: "technology",
208
+ label: "Technology",
209
+ description: "Inventors/Researchers ↔ Inventions/Systems.",
210
+ terms: [
211
+ "Internet",
212
+ "World Wide Web",
213
+ "Tim Berners-Lee",
214
+ "Alan Turing",
215
+ "Turing machine",
216
+ "Unix",
217
+ "Linux",
218
+ "Linus Torvalds",
219
+ "C programming language",
220
+ "Dennis Ritchie",
221
+ "TCP/IP",
222
+ "Vint Cerf",
223
+ "Claude Shannon",
224
+ "information theory"
225
+ ]
226
+ },
227
+ {
228
+ id: "art",
229
+ label: "Art",
230
+ description: "Artists ↔ Artworks/Movements.",
231
+ terms: [
232
+ "Michelangelo",
233
+ "David (Michelangelo)",
234
+ "Sistine Chapel ceiling",
235
+ "Leonardo da Vinci",
236
+ "Mona Lisa",
237
+ "Vincent van Gogh",
238
+ "The Starry Night",
239
+ "Pablo Picasso",
240
+ "Guernica (Picasso)",
241
+ "Frida Kahlo",
242
+ "The Two Fridas",
243
+ "Claude Monet",
244
+ "Impressionism"
245
+ ]
246
+ },
247
+ {
248
+ id: "philosophy",
249
+ label: "Philosophy",
250
+ description: "Philosophers, schools, and foundational works (ancient → modern).",
251
+ terms: [
252
+ // Ancients
253
+ "Socrates",
254
+ "Plato",
255
+ "Aristotle",
256
+ "Epicurus",
257
+ "Zeno of Citium",
258
+ "Cicero",
259
+ "Seneca the Younger",
260
+ "Marcus Aurelius",
261
+ "Plotinus",
262
+
263
+ // Early modern / modern canon (high-signal entry points)
264
+ "René Descartes",
265
+ "David Hume",
266
+ "Immanuel Kant",
267
+
268
+ // Analytic tradition + 20th century
269
+ "Gottlob Frege",
270
+ "Bertrand Russell",
271
+ "Ludwig Wittgenstein",
272
+ "W. V. O. Quine",
273
+ "Hilary Putnam",
274
+ "Thomas Nagel",
275
+ "Saul Kripke",
276
+ "John Rawls"
277
+ ]
278
+ }
279
+ ];
280
+
281
+ export const KIOSK_DOMAINS_STORAGE_KEY = "constellations_kiosk_domains_v1";
282
+ export const KIOSK_SELECTED_DOMAIN_STORAGE_KEY = "constellations_kiosk_selected_domain_v1";
283
+
284
+ export function hasLocalKioskDomains(): boolean {
285
+ return false;
286
+ }
287
+
288
+ export function clearLocalKioskDomains() {
289
+ }
290
+
291
+ export function clearLocalSelectedKioskDomainId() {
292
+ }
293
+
294
+ export function loadKioskDomains(): KioskDomain[] {
295
+ return DEFAULT_KIOSK_DOMAINS;
296
+ }
297
+
298
+ export function saveKioskDomains(domains: KioskDomain[]) {
299
+ }
300
+
301
+ export function loadSelectedKioskDomainId(domains: KioskDomain[]): string {
302
+ return domains[0]?.id || "history";
303
+ }
304
+
305
+ export function saveSelectedKioskDomainId(domainId: string) {
306
+ }
307
+
package/package.json ADDED
@@ -0,0 +1,78 @@
1
+ {
2
+ "name": "@johndimm/constellations",
3
+ "version": "1.0.0",
4
+ "type": "module",
5
+ "main": "./index.tsx",
6
+ "exports": {
7
+ ".": "./index.tsx",
8
+ "./App": "./App.tsx",
9
+ "./FullPageConstellations": "./FullPageConstellations.tsx",
10
+ "./host": "./host.ts",
11
+ "./index.css": "./index.css",
12
+ "./sessionHandoff": "./sessionHandoff.ts",
13
+ "./graphNodeToChannelNotes": "./utils/graphNodeToChannelNotes.ts",
14
+ "./types": "./types.ts"
15
+ },
16
+ "files": [
17
+ "App.tsx",
18
+ "FullPageConstellations.tsx",
19
+ "FullPageConstellationsHostShell.tsx",
20
+ "host.ts",
21
+ "index.css",
22
+ "index.tsx",
23
+ "kioskDomains.ts",
24
+ "sessionHandoff.ts",
25
+ "types.ts",
26
+ "useFullPageConstellationsHost.ts",
27
+ "components/",
28
+ "hooks/",
29
+ "services/",
30
+ "utils/"
31
+ ],
32
+ "scripts": {
33
+ "dev": "vite",
34
+ "build": "vite build",
35
+ "preview": "vite preview",
36
+ "start:cache": "tsx server.ts",
37
+ "test:render:classify": "tsx scripts/test_render_classify_start.ts",
38
+ "test:render:works": "tsx scripts/test_render_works.ts",
39
+ "fetch:top-bios": "node scripts/fetchTopBiographies.js",
40
+ "render:paper": "node scripts/renderPaperMarkdown.mjs",
41
+ "render:paper:pdf": "node scripts/renderPaperPdf.mjs",
42
+ "render:paper:tex": "node scripts/renderPaperTex.mjs",
43
+ "render:paper:tex:pdf": "node scripts/renderPaperTex.mjs && latexmk -pdf -interaction=nonstopmode -halt-on-error -jobname=paper -outdir=public/paper/rendered public/paper/tex/constellations.tex",
44
+ "build:ext": "vite build -c vite.config.ext.ts && cp chrome-extension/manifest.json dist-extension/ && cp -r chrome-extension/icons dist-extension/ && rm -f dist-extension/*.mp4",
45
+ "bundle:ext": "npm run build:ext && rm -f constellations-extension.zip && zip -r constellations-extension.zip dist-extension/*"
46
+ },
47
+ "peerDependencies": {
48
+ "react": "^18.0.0 || ^19.0.0",
49
+ "react-dom": "^18.0.0 || ^19.0.0"
50
+ },
51
+ "dependencies": {
52
+ "@google/genai": "^1.33.0",
53
+ "d3": "^7.9.0",
54
+ "dotenv": "^16.4.5",
55
+ "lucide-react": "^0.560.0"
56
+ },
57
+ "devDependencies": {
58
+ "@tailwindcss/postcss": "^4.1.18",
59
+ "@tailwindcss/vite": "^4.1.18",
60
+ "@types/chrome": "^0.1.36",
61
+ "@types/node": "^22.14.0",
62
+ "@vitejs/plugin-react": "^5.0.0",
63
+ "autoprefixer": "^10.4.23",
64
+ "body-parser": "^2.2.1",
65
+ "chrome-extension": "^0.0.1",
66
+ "cors": "^2.8.5",
67
+ "express": "^4.22.1",
68
+ "node-fetch": "^3.3.2",
69
+ "pg": "^8.16.3",
70
+ "postcss": "^8.5.6",
71
+ "react": "^19.2.1",
72
+ "react-dom": "^19.2.1",
73
+ "tailwindcss": "^4.1.18",
74
+ "tsx": "^4.21.0",
75
+ "typescript": "~5.8.2",
76
+ "vite": "^6.2.0"
77
+ }
78
+ }