Contains code to manage the UI (header interactions, buttons, infoText update, etc.).
Members
(static, constant) isAnimationActive
(inner, constant) FRACTAL_MODE_NAMES
Fractal mode display names
(inner) headerVisible :boolean
Type:
- boolean
Methods
(static) cycleToNextDive()
Cycles to the next dive (wraps around). Julia mode only.
(static) cycleToNextFractalMode()
Cycles to the next fractal mode in order: Mandelbrot → Julia → Riemann → Rossler → Mandelbrot
(static) cycleToNextPreset()
Cycles to the next preset (wraps around).
Uses travelingToPresetIndex if mid-travel for instant consecutive cycling.
(static) cycleToPreviousPreset()
Cycles to the previous preset (wraps around).
Uses travelingToPresetIndex if mid-travel for instant consecutive cycling.
(static) enableMandelbrotMode()
Implemented in a way it's not needed to be called at the first render. Everything should be pre-initialized
for Mandelbrot mode.
(static) getActivePresetIndex() → {number}
Gets the current active preset index
Returns:
- Type
- number
(static) getCurrentPaletteId() → {string|null}
Returns the current palette ID from the fractal renderer
Returns:
- Type
- string | null
(static) getUserPresets() → {Array.<PRESET>}
Gets user presets from localStorage for current fractal mode
Returns:
- Type
- Array.<PRESET>
(static) hideViewInfo()
Hides the view info overlay and all markers.
Called when user interacts with the view (pan/zoom/etc) making preset info inaccurate.
(static) initUI(fractalRenderer)
Initializes the UI and registers UI event handlers
Parameters:
| Name | Type | Description |
|---|---|---|
fractalRenderer |
(static) resetActivePresetIndex()
This needs to happen on any fractal change
(static) resetAppState()
Resets buttons, active presets and URL
(static) showEditCoordsDialog()
Shows the edit coordinates dialog
(static) showQuickInfo(title, descriptionopt, coloropt, durationopt)
Shows a quick info overlay for palette changes, mode switches, and dive starts.
Auto-hides after the specified duration.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
title |
string | The title to display (e.g., palette name, mode name) | ||
description |
string |
<optional> |
Optional description | |
color |
string |
<optional> |
Optional accent color (hex) | |
duration |
number |
<optional> |
2000 | Auto-hide delay in ms |
(static) showSaveViewDialog()
Shows the save view dialog
(static) startJuliaDive(dives, index) → {Promise.<void>}
Starts the Julia dive infinite animation
Parameters:
| Name | Type | Description |
|---|---|---|
dives |
Array.<DIVE> | |
index |
number | Index of the dive |
Returns:
- Type
- Promise.<void>
(static) switchFractalMode(mode, presetopt)
Switches among fractal modes
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
mode |
FRACTAL_TYPE | ||
preset |
PRESET | MANDELBROT_PRESET | JULIA_PRESET |
<optional> |
If present, it's set as the default state through travelToPreset |
(static) switchFractalTypeWithPersistence(targetType) → {Promise.<void>}
Switches among fractal modes but keeps the c/pan settings so the fractals match each other.
Parameters:
| Name | Type | Description |
|---|---|---|
targetType |
FRACTAL_TYPE |
Returns:
- Type
- Promise.<void>
(static) syncRiemannControls()
Syncs all Riemann UI controls (sliders and toggles) with renderer state.
Called after reset to update UI to match default values.
(static) syncRiemannToggleStates()
Syncs Riemann toggle button states with renderer state.
Called from hotkeyController after hotkey toggles.
(static) syncRosslerControls()
Syncs Rossler control slider values with renderer state.
Called after reset and palette changes.
(static) toggleAxes()
Toggles the axes overlay on/off
(static) toggleCenterLines()
Toggles x/y axes
(static) toggleDebugMode()
Inits debug bar with various information permanently shown on the screen
(static) toggleDemo() → {Promise.<void>}
Turns demo on/off and/or stops current animation
Returns:
- Type
- Promise.<void>
(static) toggleDoublePrecision()
Toggles between standard (borwein) and double precision shader in Riemann mode.
Sets manual override to prevent auto-switching.
(static) toggleHeader(show)
Shows/hides/toggles header.
Parameters:
| Name | Type | Description |
|---|---|---|
show |
boolean | null | Show header? If null, then toggles current state |
(static) toggleRiemannDisplayDropdown()
Toggles the Riemann display dropdown menu
(static) toggleZetaPath()
Toggles the zeta path overlay on/off
(static) travelToPreset(presets, index) → {Promise.<void>}
Travels to preset at given index
Parameters:
| Name | Type | Description |
|---|---|---|
presets |
Array.<PRESET> | |
index |
number | Preset array index |
Returns:
- Type
- Promise.<void>
(static) updateAxes()
Updates axes when view changes
(static) updateColorTheme(paletteopt)
Updates color scheme
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
palette |
PALETTE |
<optional> |
defaults to the fractal palette |
(static) updateInfo(force)
Updates the bottom info bar.
Throttled to avoid layout thrashing during animations (max ~10 updates/sec).
Parameters:
| Name | Type | Description |
|---|---|---|
force |
boolean | If true, ensures an update is scheduled even if throttled (won't be dropped) |
(static) updatePaletteCycleButtonState()
Updates the palette cycle button state to match the actual cycling state
(static) updatePaletteDropdownStateWithInfo()
Updates palette dropdown state and shows quick info overlay for palette cycling.
Used as callback for startPaletteCycling.
(static) updateZetaPath()
Updates zeta path when view changes
(async, inner) applyEditedCoords()
Applies the edited coordinates and animates travel
(inner) applyHotkeyHints()
Highlights the first letter of all buttons in the header panel.
Wraps the first letter in a span with the hotkey-hint class.
Only runs if FF_HOTKEY_HINTS feature flag is enabled.
(inner) closeDivesDropdown()
Closes the dives dropdown menu
(inner) closeFractalDropdown()
Closes the fractal mode dropdown menu
(inner) closePaletteDropdown()
Closes the palette dropdown menu
(inner) closePresetsDropdown()
Closes the presets dropdown menu
(inner) closeRiemannDisplayDropdown()
Closes the Riemann display dropdown menu
(inner) closeRiemannShaderDropdown()
Closes the Riemann shader dropdown menu
(inner) deleteUserPreset(presetId)
Deletes a user preset by its id
Parameters:
| Name | Type | Description |
|---|---|---|
presetId |
string |
(inner) destroyMandelbrotControls()
Destroys Mandelbrot-specific UI controls and hides them
(inner) destroyRiemannControls()
Destroys Riemann-specific UI controls and hides them
(inner) destroyRosslerControls()
Destroys Rossler-specific UI controls and hides them
(inner) exitAnimationMode()
Enables controls, resets demo button
(inner) formatButtonText(text) → {string}
Formats button text with hotkey hint styling on the first letter.
Parameters:
| Name | Type | Description |
|---|---|---|
text |
string | The button text |
Returns:
HTML string with hotkey hint markup, or plain text if FF_HOTKEY_HINTS is disabled
- Type
- string
(inner) getUserPresetsKey() → {string}
Gets the localStorage key for user presets based on current fractal mode
Returns:
- Type
- string
(inner) handleShaderChange()
Handles shader selection
(inner) hideAllMarkers()
Hides all marker types (point, line, region, segment, pair)
(inner) hideAxes()
Hides the axes overlay
(inner) hideEditCoordsDialog()
Hides the edit coordinates dialog
(inner) hideSaveViewDialog()
Hides the save view dialog
(inner) initAnimationMode()
Disables controls, activates demo button
(inner) initCommonButtonEvents()
Inits behavior common for all buttons
(inner) initEditCoordsDialog()
Initializes the edit coordinates dialog events
(inner) initFractalDropdown()
Initializes the fractal mode dropdown
(inner) initFractalModeButtons()
Initializes the fractal mode dropdown buttons
(inner) initMandelbrotControls()
Initializes Mandelbrot-specific UI controls
(inner) initRiemannControls()
Initializes Riemann-specific UI controls
(inner) initRosslerControls()
Initializes Rossler-specific UI controls
(inner) initSaveViewDialog()
Initializes the save view dialog events
(inner) onDemoPresetReached(preset, index, total, isRiemannopt)
Callback for demo to show view info overlay
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
preset |
Object | The preset object | ||
index |
number | Current index | ||
total |
number | Total presets | ||
isRiemann |
boolean |
<optional> |
false | Whether this is Riemann mode |
(inner) parseEditCoordsInput() → {Object}
Parses user input from either JSON or individual fields
Tries JSON first, then falls back to field-by-field parsing
Returns:
Parsed coordinates object or {error: string}
- Type
- Object
(inner) saveCurrentViewAsPreset(name)
Saves the current view as a user preset
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string | The name for the preset |
(inner) saveUserPresets(presets)
Saves user presets to localStorage for current fractal mode
Parameters:
| Name | Type | Description |
|---|---|---|
presets |
Array.<PRESET> |
(inner) setDivesToggleText()
Sets the dives toggle button text with optional hotkey hint
(inner) setFractalToggleText()
Sets the fractal toggle button text with optional hotkey hint
(inner) setPaletteToggleText()
Sets the palette toggle button text with optional hotkey hint
(inner) setPresetsToggleText()
Sets the presets toggle button text with optional hotkey hint
(inner) setRiemannDisplayToggleText()
Sets the Riemann display toggle button text with optional hotkey hint
(inner) setRiemannShaderToggleText()
Sets the Riemann shader toggle button text with optional hotkey hint
(inner) showAxes()
Shows the axes overlay and draws coordinate grid
(inner) showViewInfo(preset, index, total, isRiemannopt)
Shows the view info overlay with information about the current view/point
Works for both Zeta Tour points (with descriptions) and Demo presets (just title)
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
preset |
Object | The preset/point with id or name, pan, and optional description | ||
index |
number | The current index (0-based) | ||
total |
number | Total number of items | ||
isRiemann |
boolean |
<optional> |
false | Whether this is Riemann mode (show coordinates differently) |
(async, inner) startJuliaDemo()
Starts the Julia demo
(async, inner) startMandelbrotDemo()
Starts the Mandelbrot demo
(async, inner) startRiemannDemo()
Starts the Riemann tour (zero tour through significant points)
(async, inner) startRosslerDemo()
Starts the Rossler demo
(inner) syncMandelbrotControls()
Syncs Mandelbrot UI controls with renderer state.
Called on every draw to reflect adaptive quality changes.
(inner) toggleDivesDropdown()
Toggles the dives dropdown menu
(inner) toggleFractalDropdown()
Toggles the fractal mode dropdown menu
(inner) togglePaletteDropdown()
Toggles the palette dropdown menu
(inner) togglePresetsDropdown()
Toggles the presets dropdown menu
(inner) toggleRiemannShaderDropdown()
Toggles the Riemann shader dropdown menu
(inner) updateFractalDropdownState(mode)
Updates the fractal dropdown toggle text and button active states
Parameters:
| Name | Type | Description |
|---|---|---|
mode |
FRACTAL_TYPE |
(inner) updateHLineMarkerPosition()
Updates the horizontal line marker position to show the real axis (Im(s) = 0).
The line spans the entire viewport width at the y-coordinate of the real axis.
(inner) updatePairMarkerPosition(preset)
Updates the pair marker to show two saddle points.
Saddle points (zeros of ζ'(s)) come in pairs.
Parameters:
| Name | Type | Description |
|---|---|---|
preset |
Object | The current preset containing pan coordinates and optional saddle point data |
(inner) updateRegionMarkerPosition()
Updates the region marker position to wrap the critical strip (0 < Re(s) < 1).
The marker spans from x=0 to x=1 in fractal coordinates, full height of viewport.
(inner) updateSegmentMarkerPosition(accentColor)
Updates the segment marker to show trivial zeros at -2, -4, -6, etc.
Creates/updates multiple point markers along the negative real axis.
Parameters:
| Name | Type | Description |
|---|---|---|
accentColor |
string | The accent color for the markers |
(inner) validateEditCoordsInput() → {boolean}
Validates current input and updates UI accordingly
Returns:
True if valid
- Type
- boolean