Latest updates
TeX line breaking algorithm in HTML5 Canvas
Posted on Saturday November 7 2009
I spent some time over the last few weeks implementing the Knuth and Plass line breaking algorithm (as used in TeX and LaTeX) using JavaScript and the HTML5 canvas element. The code is still quite rough, but early results are quite promising and in my opinion better than what browsers commonly implement. The example page contains an example paragraph, some rough documentation and a rather random collection of ideas and notes.
Grid layout update & jQuery UI integration demo
Posted on Saturday November 7 2009
The jLayout grid layout received a small bug fix and a new feature; you can now specify how you want the grid to be filled in, from left to right and top to bottom, or top to bottom and left to right. There is also a new demo showing how easily jQuery UI components can be integrated with jLayout.
jQuery text overflow plugin: inline markup support
Posted on Saturday September 12 2009
The jQuery Text Overflow plugin now supports truncating text nodes with inline markup. This means you can now call the plugin on any DOM element, and not have to worry about it removing your inline markup or creating invalid markup.
Plotting with JavaScript, Canvas & Interval Arithmetic
Posted on Wednesday September 2 2009
I decided to have some fun with the new features in Firefox 3.5 and reimplemented the function plotting from my (still unreleased) chart library using the HTML5 Canvas element and Web Workers. Charts are plotted using interval arithmetic. The basic idea behind this is to recursively subdivide the range in which to plot a function. It keeps subdividing the range until the subdivisions are smaller than one screen pixel. At that point it will plot a pixel on that location. This pixel is then guaranteed to contain the correct solution. This also means that plots are always correct, in that they have no missing singularities or artifacts that are difficult to plot using other methods (well, that's the theory anyway―the interval arithmetic implementation I wrote does not guarantee correctness.) Web workers are used to run some of the recursive subdivisions in separate "threads" for better performance.
Equations are parsed using a Shunting Yard parser and converted internally to interval arithmetic. Most common mathematical operators are supported, such as: sin, cos, sqrt, abs, fmod, exp, log, et cetera. The code is still very much alpha quality, but I thought it might be interesting to put it online. You can find it right here: http://www.bramstein.com/projects/interplot/plot.html.
JavaScript Preprocessor
Posted on Monday August 10 2009
I spent the weekend working on a new project: a simple JavaScript preprocessor to enable conditional compilation in JavaScript code using the syntax of the C preprocessor (well, a subset of.) This will hopefully make it easy to generate multiple versions of your project to―for example―create a debug build, or a specialized version designed to work in restrictive environments. It can be called from JavaScript, an Ant build script, or the command line.
New jLayout algorithm, examples & plugin update
Posted on Thursday July 30 2009
As promised a new layout algorithm: flow layout. The flow layout algoritm lays out components in rows with components overflowing to new rows if there is not enough horizontal space. The jQuery jLayout plugin has also been updated with a minor bug fix for nested border layouts. There are also three new examples, a nested resizable border layout, a resizable layout with guides, and an example of a smoothly resizing layout.
Book Review: JQuery UI 1.6: The User Interface Library for jQuery
Posted on Wednesday July 29 2009
I recently started using the jQuery UI library in a work project so I was rather interested when I noticed a book had been published on this library by Dan Wellman. You can read my review of “jQuery UI 1.6: The User Interface Library for jQuery” in the articles book review section.
Text Alignment jQuery plugin
Posted on Saturday July 4 2009
Imagine you have worked hard to make your tables look good, but one thing keeps bugging you; the alignment of the text in the cells. You would, for example, like to align the contents of each cell on the comma character. Unfortunately, no browser supports aligning table cells on characters. This is where the new jQuery Text Alignment Plugin comes in; it adds support for aligning text based on characters to all browsers. You can see it in action on the example page, or read the documentation on the text-alignment plugin project page.
New jQuery plugin: CSS3 text-overflow
Posted on Sunday June 28 2009
This new jQuery plugin implements a simplified version of the CSS3
text-overflow property, which allows stylesheet authors to specify
how and where text should be clipped. This is usually done by adding an
ellipsis character "…" or three dots at the point the
text should be cut off. Unfortunately, not all browser support this CSS
property, and this plugin was designed to simulate it when the property is
not natively available. The plugin is basically a rewrite of an
existing jQuery text-overflow plugin, with the goal of being
faster and more reliable (for example, one of the optimizations is that it
uses a binary search to find the correct clipping point, instead of a
linear search.)
XSLTJSON Bug fix release
Posted on Sunday June 28 2009
Today sees a new release of XSLTJSON, bringing the version number up to 0.87. This new release contains several bug fixes for the recently introduced json:force-array feature. Upgrading from previous versions is recommended if you are using the force-array feature.