Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage? :) #1

Closed
ser opened this issue Oct 22, 2020 · 5 comments
Closed

Usage? :) #1

ser opened this issue Oct 22, 2020 · 5 comments

Comments

@ser
Copy link

ser commented Oct 22, 2020

Hi, maybe I am doing something wrong, but I have this:

<script src="fractal.js" type="text/javascript"></script>
<script type="text/javascript">
  var fractal = new Fractal(document.getElementById("frac1"));
</script>

and dev console says:

(index):227 Uncaught ReferenceError: Fractal is not defined

Where is my fault? :)

@rafgraph
Copy link
Owner

It’s under the window.mandelbrotFractal.Fractal namespace.
https://github.com/rafgraph/fractal/blob/gh-pages/app/fractal.js#L10

@ser
Copy link
Author

ser commented Oct 22, 2020

Hi, thanks, I have rewritten my invocation, but still have errors.

<script src="fractal.js" type="text/javascript"></script>
<script type="text/javascript">
  var fractal = new window.mandelbrotFractal.Fractal(document.getElementById("frac1"));
</script>

and dev console says:

Uncaught TypeError: canvas.getContext is not a function

Where is my fault? :)

@rafgraph
Copy link
Owner

Not sure... you need to make sure the frac1 element is a canvas element, like https://github.com/rafgraph/fractal/blob/gh-pages/index.html#L51

@ser
Copy link
Author

ser commented Oct 22, 2020

OK, it works now! Thanks for a hint :) :)

I had

<img id="xxx">

instead of

<canvas id="xxx"></canvas>

One more question. You have a few screenshots on README.md - what are required parameters to get them? Have you experimented a way to get a random fractal?

@rafgraph
Copy link
Owner

Don’t know... the maxEscapeTime Was probably 896 or 1792. They were created using https://fractal.rafgraph.dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants