var sky = paper.rect( 0,0,200,200 ).attr({ 'stroke-width': 0, 'fill': '#3e7dbb'}) var sun = paper.circle( 100,100,50 ).attr({ 'stroke-width': 0, 'fill': 'white'}) var sunglow = sun.glow({ 'width': 90, 'fill': true, 'opacity': 0.8, 'color': 'pink'})
for ( i = 0; i < 5; i++ ) { var s = paper.rect( 20+(i*100), 20, 60, 60 ) } paper.forEach( function (e) { e.attr({ stroke: "blue" }); });
// Assuming paths called P1 and P2 have been defined var point = Raphael.pathIntersection( P1,P2 ) console.log( point.x, point.y )
// Assuming path called P has been defined var point = P.getPointAtLength( 200 ) console.log( point.x, point.y )
paper.getElementByPoint( 50, 80 )
var paper = new Raphael(document.getElementById('point'), 200, 200); for( i = 0; i < 100; i++ ) { var c = paper.circle( Math.random() * 200, Math.random() * 200, Math.random() * 30 ) } var centerPoint= paper.circle( 100, 100, 5) // draw circle at center, to make sure we get at least one red one var centerCircles = paper.getElementsByPoint( 100, 100 ) // create set of circles that touch the center centerCircles.attr({ 'fill':'red', 'opacity':0.7 }) // turn them all red