Javascript Kobon triangle generator
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

#Kobon triangles in JavaScript For a complete write-up and working example of SVG, see my blog.



in-browser with SVG

I added a demo of the svg code in the subdirectory /svg-demo. You should be able to run this in any modern browser, but I've only tried Chrome.

If you get a super sweet looking triangle, you can type this into your browser's console:


That will give you something like this:


Notice that's what I'm using to load the default triangle with the kobonLoad() function in the demo's script.js file:

	,null, 2));

You can similarly use the output from the node.js version of this to view anything cool generated from your node.js version.

using node.js

When using node, you pass how many lines to use and how many triangles to wait for.

For example:

 node nkobon 7 11

This will generate 11 triangles with 7 lines. The output is a JSON string that can be loaded with kobonLoad

If you put an impossible amount of triangles, you'll be waiting forever.