Questions tagged [bonsaijs]

A lightweight graphics library with an intuitive graphics API and an SVG renderer.

Bonsai is a JavaScript graphics library.

Bonsai's main features include:

  • Architecturally separated runner and renderer
  • iFrame, Worker and Node running contexts
  • Paths
  • Assets (Audio, Video, Images, Fonts, SubMovies)
  • Keyframe and time based animations (easing functions too)
  • Path morphing
  • and much more...

Community

For the finer details, see the documentation.

20 questions
6
votes
1 answer

Uncaught TypeError: Illegal constructor – Using Bonsai.JS in Backbone.JS

I'm still new to js and I'm trying to fit bonsai.js into a backbone app. I'm following this guide here: https://github.com/iamdustan/bonsai-demos , and trying to 'Separate Things Out' by putting the animation into a separate file titled…
ac360
  • 7,735
  • 13
  • 52
  • 91
2
votes
1 answer

Animate a movie along a path in BonsaiJS

I have been building a series of animations using BonsaiJs and really enjoying using the library. Thinks have been working really well for some keyframe animations, and shape animations. However I have come a bit unstuck trying to animate a Movie…
Matt
  • 1,247
  • 8
  • 16
1
vote
1 answer

how to use variable on bonsai.js?

var star = document.getElementById("star"); var color = "#ef6360"; bonsai.run(star, { code: function() { new Star(30, 30, 20, 5, 0.7).attr({ fillColor: color }).addTo(stage); } }); it doesn't work, but…
tga
  • 538
  • 4
  • 15
1
vote
1 answer

Accessing the position of simple shapes

I have a Rect assigned to a variable myrect: var myrect = new Rect (250,0,20,200); I thought that writing: console.log(myrect.x); would output 250 but, it says "undefined". I would like to know how I can redraw this rectangle by…
A1A2A3A4
  • 413
  • 1
  • 5
  • 11
1
vote
0 answers

Benchmark.js and Bonsai.js

I'm currently testing some Visualization toolkits performance and have a problem testing bonsai.js. Every time I run the benchmark the chrome renderer crashes, and i can't seem to find the problem because bonsai.js is pretty hard to debug. var i =…
Rene Koller
  • 375
  • 1
  • 6
  • 15
1
vote
1 answer

How to pass event data from the stage to the parent context without deconstructing/reconstructing it?

consider the following code: window.stage = bonsai.run(document.getElementById('stage'), { code: function() { var circle; circle = new Circle(200, 200, 50); circle.stroke('green', 2); circle.addTo(stage); circle.on('click',…
georgedyer
  • 2,737
  • 1
  • 21
  • 25
1
vote
0 answers

WORKER undefined

bonsai docs “Communication” section (http://docs.bonsaijs.org/overview/Communication.html) has the following example which runs everywhere, except IE9:
Alex
  • 11
  • 1
0
votes
1 answer

Bonsai JS error

The HTML: