Module: JuliaPreview

Manages the floating Julia set preview shown on middle-click in Mandelbrot mode.
Author:
  • Radim Brnka
License:
  • MIT
Source:

Members

(inner, constant) CURSOR_OFFSET_X

Offset from cursor position
Source:

(inner, constant) PREVIEW_WIDTH

Preview canvas size in pixels
Source:

(inner) floatingCanvas :HTMLCanvasElement

Type:
  • HTMLCanvasElement
Source:

(inner) pendingInnerStops :Float32Array|null

Type:
  • Float32Array | null
Source:

(inner) previewActive :boolean

Type:
  • boolean
Source:

(inner) previewRenderer :JuliaPreviewRenderer

Type:
Source:

Methods

(static) destroyJuliaPreview()

Destroys the Julia preview renderer and cleans up resources. Call this when switching away from Mandelbrot mode.
Source:

(static) hideJuliaPreview()

Hides the Julia preview.
Source:

(static) initJuliaPreview()

Initializes the Julia preview system. Should be called once during app initialization.
Source:

(static) isJuliaPreviewActive() → {boolean}

Returns whether the preview is currently active.
Source:
Returns:
Type
boolean

(static) recolorJuliaPreview(palette)

Recolors the Julia preview with a new palette.
Parameters:
Name Type Description
palette Array.<number> RGB palette [r, g, b] in range [0,1]
Source:

(static) resetJuliaPreview()

Resets the Julia preview renderer to default state.
Source:

(static) showJuliaPreview(screenX, screenY, cx, cy)

Shows the Julia preview at the given screen position with the specified c parameter.
Parameters:
Name Type Description
screenX number Screen X coordinate (clientX)
screenY number Screen Y coordinate (clientY)
cx number Real part of Julia c parameter
cy number Imaginary part of Julia c parameter
Source:

(static) updateJuliaPreview(screenX, screenY, cx, cy)

Updates the Julia preview position and c parameter as the mouse moves.
Parameters:
Name Type Description
screenX number Screen X coordinate (clientX)
screenY number Screen Y coordinate (clientY)
cx number Real part of Julia c parameter
cy number Imaginary part of Julia c parameter
Source:

(inner) updatePreviewPosition(screenX, screenY)

Updates the floating canvas position relative to cursor. Ensures the preview stays within viewport bounds.
Parameters:
Name Type Description
screenX number Screen X coordinate
screenY number Screen Y coordinate
Source: