`
- ).join('');
+// Launch the explorer for a searched artist (closes the dropdown first).
+function artMapExploreArtist(name) {
+ const results = document.getElementById('artist-map-search-results');
+ if (results) { results.style.display = 'none'; results.innerHTML = ''; }
+ const input = document.getElementById('artist-map-search');
+ if (input) input.value = '';
+ _artMap._skipSectionToggle = true;
+ _openArtistMapExplorerWithName(name);
}
function artMapZoomToNode(nodeId) {
@@ -6461,7 +6587,7 @@ async function _openGenreMapWithSelection(selectedGenre) {
}));
_artMapLayoutIslands(groups);
_artMap.edges = [];
- _artMapFitToContent();
+ _artMap._oneIsland = true; // focus one genre island at a time
const placedCount = _artMap.placed.filter(n => !n._isLabel).length;
_artMapSetupInteraction(canvas);
@@ -6472,8 +6598,7 @@ async function _openGenreMapWithSelection(selectedGenre) {
const le = document.getElementById('artist-map-loading');
if (le) le.remove();
- _artMap.dirty = true;
- _artMapBeginReveal();
+ _artMapFocusIsland(0, { bloom: true }); // frame + bloom the selected genre island
// Stream images in throttled waves — interactive immediately, sharpens in place.
_artMapStreamImages(_artMap.placed.filter(n => !n._isLabel));
@@ -6570,6 +6695,8 @@ async function _openArtistMapExplorerWithName(name) {
const groups = _artMapGroupByGenre(rawNodes);
_artMapLayoutIslands(groups);
_artMap.edges = _artMapRemapEdges(data.edges);
+ _artMap._oneIsland = false; // explore stays multi-island (it's small)
+ _artMapUpdateIslandNav(); // tear down any leftover nav from a prior map
_artMapFitToContent();
_artMapSetupInteraction(canvas);
@@ -6813,10 +6940,13 @@ function _artMapStreamImages(imgNodes, concurrent = 24) {
.then(bmp => {
if (bmp && token === _artMap._loadToken) {
_artMap.images[n.id] = bmp;
+ // Hidden bubbles (other islands in one-island mode): just
+ // cache the image for when you navigate there — don't
+ // redraw/rebuild for something off-screen.
+ if ((n.opacity || 0) < 0.01) return;
// Composite just this node into the existing buffer (cheap)
// and blit. Only fall back to a full rebuild if the buffer
- // isn't built yet. This keeps pan/hover at blit-speed the
- // whole time images are streaming in — the lag fix.
+ // isn't built yet. Keeps pan/hover at blit-speed while images stream.
if (_artMapCompositeNode(n)) _artMapRender();
else scheduleRedraw();
}
@@ -6885,6 +7015,8 @@ function _artMapSetupInteraction(canvas) {
_artMap.dirty = true;
_artMapRender();
}
+ else if (_artMap._oneIsland && e.key === 'ArrowLeft') { _artMapIslandNav(-1); e.preventDefault(); }
+ else if (_artMap._oneIsland && e.key === 'ArrowRight') { _artMapIslandNav(1); e.preventDefault(); }
}
window.addEventListener('keydown', _artMapKeyHandler);
_artMap._keyHandler = _artMapKeyHandler;