Contains code to manage the UI (header interactions, buttons, infoText update, etc.).
Members
(inner) headerVisible :boolean
Type:
- boolean
Methods
(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) initUI(fractalRenderer)
Initializes the UI and registers UI event handlers
Parameters:
Name | Type | Description |
---|---|---|
fractalRenderer |
(static) parseUserInput(input) → {PRESET|Object}
Parses a string of the form:
p = [, i] c = [, i] zoom = r =
and returns an object with the parsed numbers.
If a part is invalid or missing, an error message is returned.
Parameters:
Name | Type | Description |
---|---|---|
input |
string | The input string. |
Returns:
- Type
- PRESET | Object
(static) resetActivePresetIndex()
This needs to happen on any fractal change
(static) resetAppState()
Resets buttons, active presets and URL
(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 |
<optional> |
If present, it's set as the default state through travelToPreset |
(static) switchFractalModeWithPersistence(mode) → {Promise.<void>}
Switches among fractal modes but keeps the c/pan settings so the fractals match each other.
Parameters:
Name | Type | Description |
---|---|---|
mode |
FRACTAL_TYPE |
Returns:
- Type
- Promise.<void>
(static) toggleDebugLines()
Toggles x/y axes
(static) toggleDemo() → {Promise.<void>}
Turns demo on/off and/or stops current animation
Returns:
- Type
- Promise.<void>
(static) toggleHeader(show)
Shows/hides/toggles header.
Parameters:
Name | Type | Description |
---|---|---|
show |
boolean | null | Show header? If null, then toggles current state |
(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) updateColorTheme(paletteopt)
Updates color scheme
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
palette |
PALETTE |
<optional> |
defaults to the fractal palette |
(static) updateInfo()
Updates the bottom info bar
(inner) exitAnimationMode()
Enables controls, resets demo button
(inner) initAnimationMode()
Disables controls, activates demo button
(inner) initCommonButtonEvents()
Inits behavior common for all buttons
(inner) initDebugMode()
Inits debug bar with various information permanently shown on the screen
(async, inner) startJuliaDemo()
Starts the Julia demo
(async, inner) startMandelbrotDemo()
Starts the Mandelbrot demo