Release of version 0.80

With version 0.80 JSXGraph starts the support of multitouch devices like the Apple iPhone and iPod touch, or devices running Mozilla Fennec. Surprisingly, JSXGraph runs quite smoothly on these devices.
JSXGraph is part of the European Intergeo project (http://i2geo.net) and supports the Intergeo file format – as well as many other European Interactive Geometry software will do. This will enable the display of a huge amount of Geometry resources on multitouch devices like tablet computers.
To our knowledge, JSXGraph is the first platform-independent interactive Geometry software supporting multitouch devices like the iPhone or related devices.

You can watch demonstrations of JSXGraph on an iPod touch at YouTube:

Euler line

Bezier curves


Update Jan, 27. 2010
: We were not able to test it, but there should be no problems that prevent JSXGraph from running on the new Apple iPad.

Posted in Releases | Tagged , , , , | 3 Comments

Release of version 0.79

Version 0.79 includes massive speed optimizations for the Internet Explorer, some bugs have been fixed and the source code has been considerably refactored. The support for bitmap images has been improved, new elements are regular polygons. Further, a flexible layer system and several new options have has been introduced.

Posted in Releases | Leave a comment

JSXCompressor – Python script

A simple Python script to compress a file to be uncompressed by the JavaScript JSXCompressor is the following:


#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import urllib
import base64
import zlib

if __name__ == '__main__':
    if len(sys.argv)<1:
        sys.stderr.write("call: python compress.py filename\n")
        sys.exit(0)
    filename = sys.argv[1]
    if not os.path.exists(filename):
        sys.stderr.write("file '%s' not found\n" % filename)
        sys.exit(0)
    f = open(filename, "r")
    text = f.read()
    text = base64.b64encode(zlib.compress(urllib.quote(text)))
    print text

It can be downloaded here.

Posted in JSXCompressor | Tagged , , , | Leave a comment

Release of version 0.78

The most notable change is that all dependencies of JSXGraph on third-party libraries like jquery or prototype have been removed. JSXGraph is now a stand-alone library. If delivered compressed, its size is only 81 kByte. Now, two possible types of texts are possible: ‘html’ which uses an HTML-div element, and ‘internal’ which uses the text element of SVG or VML, respectively. The consequence is that on SVG capable browsers it is possible to export a static SVG image from the JSXGraph construction. This can be done for instance by calling “XMLSerializer().serializeToString(board.renderer.svgRoot);”
The use of ASCIIMathML in texts and labels of type ‘html’ has been enabled. Further, the options system has been overhauled. Now, before the initialization of a JSXGraph board options may be set via

JXG.Options.text.useASCIIMathML = true

for examples, see http://jsxgraph.uni-bayreuth.de/wiki/index.php/Options. JSXGraph is now fully functional on the Internet Explorer 8, even in standard mode. Before, on IE8 JSXGraph had to fall back in compatibility mode. JSXGraph also runs without problems on IE6 and IE7. Gradients in fill colors are possible. As always, bugs have been removed and many new examples have been added to the wiki, especially the section on charts has been improved.

Posted in Releases | Leave a comment

Release of version 0.77

Version 0.77 of the JavaScript plotting and Geometry library JSXGraph contains many improvements and feature enhancements. Beside of bug fixes the performance could also be improved considerably, again. The visual appearance of JSXGraph is another area where great progress could be achieved. The main issues were the automatic labeling of axes, the default colors of geometric elements, gradient filling, improved, animated highlighting, flexible animations. A forthcoming blog entry will be devoted to animations in greater detail. The algorithm for curve plotting has been completely rewritten. Now, function graphs having discontinuities and poles are displayed correctly in most cases. New elements are cubic Bezier curves, “the other intersection point”, improved charts, tangent from point to circle.
Further, a spin off product JSXCompressor has been released. It uses our JavaScript implementation of gunzip and zip to deliver compressed JavaScript in an HTML file.

Posted in Releases | Tagged , , , | Leave a comment

JSXCompressor – zlib compressed JavaScript code

The open source library JSXGraph (http://jsxgraph.org) contains utilities to read files which
have been compressed by the ZLIB (http://zlib.org) library. That means, JSXGraph has a pure
JavaScript implementation of deflate, unzip and base64_decode. This can be used for delivering compressed JavaScript inside of an HTML file. Of course, with todays browsers it depends on the transmission bandwidth if this is worthwile. If the web server does not support compression of data, then this tool may be an option.

One possibility to compress the JavaScript source on server side is to use PHP. The code below writes the content of a JavaScript file as a compressed, base64 encoded string on-the-fly into the HTML. Then on client side this string can be accessed via the JavaScript variable jsxcompressed.

<?php
function jxgcompress($filename)
{
    if (file_exists($filename)) {
        $base64 = base64_encode(gzcompress(rawurlencode(file_get_contents($filename)),9));
        echo "var jxgcompressed = "$base64";\n";
    } else {
        throw new Exception("$filename not found");
    }
}
?>

<script type="text/javascript">
<?php
    jxgcompress("./helloworld.js");
?>
</script>

To uncompress and run this code on client side, the following code has to be included in the HTML code:

<script src="./jsxcompressor.js" type="text/javascript"></script>
<script type="text/javascript">
eval(JXG.decompress(jxgcompressed));
</script>

Thats all! The compression rate should be fairly good, since the compression algorithm is essentially gzip. There is some additional overhead since the compressed output has additionally to be base64 encoded.

Of course, this effort is useless, if the web server delivers the content already compressed with gzip.

The zip file jsxcompressor.zip contains two examples: testhelloworld.php and testjsxgraph.php. The jsxcompressor code is open source and can be downloaded here. The source code of the minified JavaScript file jsxcompressor.js consists of the file Util.js from the JSXGraph project, prepended by the string

JXG = {};
JXG.decompress = function(str) {
    return unescape(
                (new JXG.Util.Unzip(JXG.Util.Base64.decodeAsArray(str))).unzip()[0][0]
             );
};

The source code of the JSXGraph library can be downloaded from http://sourceforge.net/projects/jsxgraph/.
JSXCompressor is released under the LGPL.

Enjoy,
Alfred Wassermann

Posted in JSXCompressor | Tagged , , , | 5 Comments

Release of version 0.76

Version 0.76 of the JavaScript plotting and Geometry library JSXGraph contains major improvements. First, the display quality has been improved greatly. Curves are much more smooth now and use the full power of the vector graphics capabilities of SVG and VML.

Then, eye candy like shadows and gradient filling has been introduced. Unfortunately, browser support for shadows exists only partially, yet. Chrome, Safari and Opera still have problems displaying shadows based on SVG filters. Hopefully, with the new Webkit version this may change. You can admire examples at “shadow example” and “pie chart“. Additionally, this pie chart example uses the new feature that meanwhile every JSXGraph element has its own highlight method, which can be overwritten. This enables a wide range of new possibilities for visualization.

Mathematically, the 0.76 release introduces new elements: circumcircle arc, circumcircle sector, semicircle
and regression polynomials of arbitrary degree.

Internally, there are also many improvements and bug fixes. Computationally expensive functions can be implemented much more efficient now (see the polynomial regression example). Optionally it is possible to activate the Ramen, Douglas, Peuker algorithm for curve smoothing.

This release also introduce some API changes. By default, multiple boards in one html file are independent
from each other now. They may be connected by brd1.addChild(brd2);
JXG.GetReferenceFromParameter() has been shortened to JXG.getReference().

Last but not least, a lot of work has been spent on improving the documentation and filling the wiki with many new examples.

Posted in Releases | Leave a comment

Problems with IE

Since a couple of days we experience problems viewing our site with Internet Explorer 8, version 8.0.600.1.18702. The errors seem to be related with our wordpress theme and not with JSXGraph. We would be very happy to receive hints what is going wrong.

Posted in Uncategorized | Tagged | 4 Comments

Who’s using JSXGraph?

If you are using JSXGraph on your web site or if JSXGraph is part of your exciting software project, we would be happy if you let us know. Please post a comment with an URL and a short description.

Posted in Uncategorized | Tagged | 6 Comments

JSXGraph at CADGME 09

Yesterday we presented JSXGraph at the CADGME 09 conference which is hosted in the beautifully located Castle of Hagenberg, Austria. Among many other things we showed the interaction between JSXGraph and JQuery UI widgets, the computation of geometric loci on server side using CoCoa, and the display of Intergeo and GeoGebra files with JSXGraph. The HTML slides of our talk (presented by Michael Gerhäuser, Bianca Valentin, and Alfred Wassermann) are online on our web page. The HTML template for this presentation has been written by Carsten Miller. It uses some special features of the Firefox 3.5.

Posted in Uncategorized | Leave a comment