Raphaël (JavaScript library)

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

Template:Short description Script error: No such module "Infobox". Script error: No such module "Check for unknown parameters".Script error: No such module "Check for conflicting parameters". Raphaël, named for Italian painter Raffaello Sanzio da Urbino,[1] is a cross-browser JavaScript library that draws Vector graphics for web sites. It will use SVG for most browsers, but will use VML for older versions of Internet Explorer. Raphaël currentlyTemplate:As of? supports Chrome 5.0+ Firefox 3.0+, Safari 3.0+, Opera 9.5+ and Internet Explorer 6.0+.

Use

Raphaël is used by first creating an instance of the Raphaël object, which manages the creation of the canvas. The following examples create a canvas that is 320 pixels wide and 200 pixels high:Script error: No such module "Unsubst".

// top left of canvas at the viewport's 10,50 coordinate
var r = Raphael(10, 50, 320, 200);

// top left of canvas at the  top left corner of the #example element (in elements where dir="ltr")
var r = Raphael(document.getElementById("example"), 320, 200);

// same as above
var r = Raphael("example", 320, 200);

Once the Raphaël object has been instantiated, its various drawing, resizing and animation methods may be called to build up a vector graphic. This library includes support of Cùfon fonts, a format that turns a given font into a set of vector paths. It is extensible through plugins.Script error: No such module "Unsubst".

Usage

The widget is used on the Washington Post and the Times Online websites.Script error: No such module "Unsubst".

Raphaël is also used by iCloud.com, and by Mass Relevance in the White House.[2]

See also

Script error: No such module "Portal".

References

<templatestyles src="Reflist/styles.css" />

Script error: No such module "Check for unknown parameters".

Further reading

  • Script error: No such module "citation/CS1".

External links