BIG news: jGoBoard 3 is now released and available at GitHub:
It is a complete rewrite of jGoBoard using HTML5 canvas. This means greatly improved performance, as over 1000 divs are no longer needed. This should especially help tablet and smartphone users. A few other feature highlights:
- New “large” size textures for board and stones (1k x 1k board and 48×48 stones), alternate walnut board texture, B&W “diagram” styles (i.e. no textures)
- Dynamic rendering allows any board size (up to 19×19) & partial views (nice for tsumego and diagrams)
- Fully parametrized board rendering allows vast amount of customization (background color, grid widths, margins, fonts, amount of star points rendered etc.) and custom boards
- All methods encapsulated in single JGO namespace (JGO.Board, JGO.BLACK, JGO.util.loadSGF etc.) to minimize variable space pollution
- Full auto-generated API docs with JSdoc
- All js files pass checking with JSHint with strict settings enabled
- Automatic build system using Grunt (including script concatenation and minimizing)
- The minimized single .js version is mere 24 kB and only 7 kB gzipped
- No external dependecies in the library (some of the demos use jQuery)
- Automatic diagram generation for blog users
- Project hosted at github for easy cloning and other nice features
I am still in progress of improving the SGF player subsystems so the jgoboard.com SGF viewer will for the moment run on 2.1, but for direct users of jGoBoard the current 3.1 is ready to use. Licensing is the same Creative Commons Non-commercial as for 2.1. Take a look at the demos:
More features to be added. Comments on the new versions are welcome!
New jGoBoard version is out! The API has not changed much, but new version has some nice additions:
- There is a new
- I compiled a single minified
all-min.js with Google’s Closure Compiler so you only need one, fast-loading script tag. Nice!
Basically all you need to do is to head to Download page and grab it, and look at the source of embedding demo and you should have a pretty clear idea how to embed jGoBoard to your blog, website, or whatever. Have fun!
Oh, one final remark: Remote SGF loading uses JSONP service I have created that fetches an SGF file, parses it’s structure and returns it to your script in parsed form. To avoid abuse, I’ve put quotas on the amount that one domain can use the service – 1000 requests a day and max 10 MB data in or out. So if you are expecting to exceed this, either put your SGF files in a place you can reference them locally (i.e. no need for http:// in the URL), cache them that way or contact me to negotiate a bigger quota. :)
A substantially improved version of jGoBoard library is now available. The basic usage is the same, but some notable changes include:
- New board image with less distortion than the previous one
- Correct “descending” order for board letter coordinates (A1 is bottom left, not top left corner :)
- New stone graphics and shadows make a cleaner look (some may like the old ones more, but I’m not redoing these until I get my hands on slate & shell stones)
- Board is now a <div> instead of <table>, and stones are absolutely positioned divs – should be more straightforward to render for a browser (although it’s 1160 divs for a 19×19 board, talk about heavy)
- Complete support for standard SGF markers (circle, square, cross, triangle, number and letter labels)
- Territory markers which highlight underlying stones “dead”
- Some additional nifty code under hood, such as <pre>board.each</pre> iteration functionality
I’ll be doing some documentation soon on how to use all of this new functionality, but meanwhile you can download jGoBoard 2 and take a look at the internals, of give it a spin on the renewed SGF viewer with support for markers and territory display!
If you’re anxious to see the territory markers and don’t want to locate a SGF file from the net with markers or make your own, fast forward this one to the end and also see the second last move with markers: example.sgf (sorry for the bad play :).
To avoid spending too much time with manual HTML editing, I’ve upgraded the site to run on WordPress. This also enables people to comment on stuff, and me to post articles on using jGoBoard in different ways.