Complete fractal generation configuration
Complete SVG document as a string
import { generateMandelbrotSVG, interestingPoints } from '@prachwal/mandelbrot-generator';
// Generate classic view
const svg = generateMandelbrotSVG({
width: 800,
height: 600,
maxIterations: 100,
escapeRadius: 2,
zoom: 1,
centerX: -0.5,
centerY: 0,
colorPalette: 'rainbow'
});
// Use with predefined locations
const elephantSvg = generateMandelbrotSVG({
width: 1200,
height: 800,
maxIterations: 256,
escapeRadius: 2,
colorPalette: 'fire',
...interestingPoints.elephant
});
// Save to file or use directly
document.getElementById('fractal').innerHTML = svg;
Generates SVG content for a Mandelbrot fractal
This function creates a complete SVG document as a string, containing the visual representation of the Mandelbrot set. The SVG can be saved to a file, embedded in HTML, or processed further.