|
18 | 18 | graphWorkspace: '', |
19 | 19 | graphData: null, |
20 | 20 | graphDataMode: 'overview', |
| 21 | + graphGalaxyQuality: false, |
21 | 22 | graphDataPreset: 'galaxy', |
22 | 23 | graphDataIncludeCode: false, |
23 | 24 | graphDataShowUnlinked: false, |
|
2338 | 2339 | const freezeRow = byId('graph-freeze-row'); |
2339 | 2340 | if (freezeRow) freezeRow.hidden = full; |
2340 | 2341 | const orbitPause = byId('graph-orbit-pause-row'); |
2341 | | - if (orbitPause) orbitPause.hidden = full; |
| 2342 | + const orbitCapable = galaxy && (!full || state.graphGalaxyQuality); |
| 2343 | + if (orbitPause) orbitPause.hidden = !orbitCapable; |
2342 | 2344 | const style = byId('graph-style').value; |
2343 | 2345 | const styleNotes = full ? GRAPH_LOD_STYLE_NOTES : GRAPH_STYLE_NOTES; |
2344 | 2346 | byId('graph-style-note').textContent = styleNotes[style] || styleNotes.classic; |
|
2359 | 2361 | function updateGraphGalaxyControls() { |
2360 | 2362 | const galaxy = graphIsGalaxy(); |
2361 | 2363 | const full = state.graphMode === 'full'; |
| 2364 | + const orbitCapable = galaxy && (!full || state.graphGalaxyQuality); |
2362 | 2365 | const size = byId('graph-size'); |
2363 | 2366 | if (galaxy && !full) { |
2364 | 2367 | if (['degree', 'betweenness'].includes(size.value)) size.dataset.legacyValue = size.value; |
|
2385 | 2388 | : ['Galactic gravity', 'Black hole mass', 'Local solar gravity', 'Space friction', 'Spring stiffness']; |
2386 | 2389 | ['graph-gravitational-constant-label', 'graph-black-hole-mass-label', |
2387 | 2390 | 'graph-local-gravitational-constant-label', 'graph-space-damping-label', |
| 2391 | +'graph-spring-stiffness-label'].forEach((id, index) => { |
| 2392 | + const label = byId(id); |
| 2393 | + if (label) label.textContent = forceLabels[index]; |
| 2394 | + }); |
| 2395 | + const springLabel = byId('graph-spring-stiffness-label'); |
| 2396 | + const springCapable = galaxy || (full && !state.graphGalaxyQuality); |
| 2397 | + if (springLabel && springLabel.parentElement) { |
| 2398 | + springLabel.parentElement.hidden = !springCapable; |
| 2399 | + } |
| 2400 | + const galaxyRenderer = galaxy && (!full || state.graphGalaxyQuality); |
| 2401 | + const everyRenderer = full && !state.graphGalaxyQuality; |
| 2402 | + byId('graph-spacetime-summary').textContent = galaxyRenderer |
| 2403 | + ? 'Spacetime · black-hole orbit controls' |
| 2404 | + : everyRenderer ? 'All-node force refinement' : 'Responsive force controls'; |
| 2405 | + byId('graph-spacetime-note').textContent = galaxyRenderer |
| 2406 | + ? 'Drag and release a node to slingshot it into a new orbit.' |
| 2407 | + : everyRenderer |
| 2408 | + ? 'These values refine the settled worker layout.' |
| 2409 | + : 'These values tune the responsive force layout.'; |
| 2410 | + byId('graph-orbits-pause-label').textContent = 'Pause orbits'; |
| 2411 | + byId('graph-orbits-pause-detail').textContent = 'physics'; |
| 2412 | + byId('graph-orbits-pause').setAttribute('aria-label', 'Pause orbital physics'); |
| 2413 | + const orbitPauseRow = byId('graph-orbit-pause-row'); |
| 2414 | + if (orbitPauseRow) orbitPauseRow.hidden = !orbitCapable; |
| 2415 | + } |
| 2416 | + |
2388 | 2417 | 'graph-spring-stiffness-label'].forEach((id, index) => { |
2389 | 2418 | const label = byId(id); |
2390 | 2419 | if (label) label.textContent = forceLabels[index]; |
|
3495 | 3524 | state.graphData = data; |
3496 | 3525 | state.graphWorkspace = targetWorkspace; |
3497 | 3526 | state.graphDataMode = targetMode; |
| 3527 | + state.graphGalaxyQuality = galaxyQuality; |
3498 | 3528 | state.graphDataPreset = byId('graph-preset').value; |
3499 | 3529 | state.graphDataIncludeCode = responseIncludeCode; |
3500 | 3530 | state.graphDataShowUnlinked = targetShowUnlinked; |
|
0 commit comments