A small javascript library to generate 2D fractals using HTML5 canvas and a lot of dependency injection.
It depends on the jPalette library.
npm install --save jpalette jfractal
Just download repositories jPalette and jFractal.
import * as jPalette from 'jpalette';
import * as jFractal from 'jfractal';
<script src="jpalette.min.js"></script>
<script src="jfractal.min.js"></script>
<canvas id="fractal" width="400" height="300"></canvas>
let display = new jFractal.StandardDisplay(
new jFractal.Picture(
document.getElementById('fractal'),
{left:-2.5, right:0.5, bottom:-1.5, top:1.5, keepRatio: true}
),
new jFractal.SmoothBailoutColoring(
new jFractal.BailoutAlgo(new jFractal.MandelbrotEquation(), 40, 1 << 16),
jPalette.Color.get('black')(255),
jPalette.ColorMap.get('night')(2000)
)
).refresh();
- SimpleDisplay
- ProgressiveDisplay
- ThreadedDisplay (worker.min.js must be in the same directory as your index.html)
- BailoutAlgo
- NewtonAlgo
- MandelbrotEquation
- TricornEquation
- BurningShipEquation
- NewtonEquation
- SimpleColoring
- BailoutColoring
- SmoothBailoutColoring
- AngleColoring
- BinaryColoring