A Path object. A Path object can be used to draw lines or polygons with curves. Note: Do not use a Path if you can use a Polyline or a Polygon. A Path object renders significally slower than a Polyline or a Polygon.
new websis.graphic.Path([options]);
"<angle>-<colour>[-<colour>[:<offset>]]*-<colour>", example: "90-#fff-#000" - 90° gradient from white to black or "0-#fff-#f00:20-#000" - 0° gradient from white via red (at 20%) to black.Creates a new green Path with 4 points.
var path = new websis.graphic.Path({
style: {
fill: 'green'
},
shape: {
points: [
{x: 76281, y: 76312},
{x: 77856, y: 76329},
{x: 78804, y: 75347},
{x: 75655, y: 75246}
]
},
events: {
click: function(e, it) {
alert(it.id);
}
}
});
Creates a new Path with a Cubic Bézier Curve.
var path = new websis.graphic.Path({
style: {
fill: 'green'
},
shape: {
points: [
{x: 76281, y: 76312},
{cx: 76520, cy: 76490},
{cx: 77134, cy: 76538},
{x: 77856, y: 76329},
{x: 78804, y: 75347},
{x: 75655, y: 75246}
]
}
});
Creates a new Path with a Smooth Cubic Bézier Curve.
var path = new websis.graphic.Path({
style: {
fill: 'green'
},
shape: {
points: [
{x: 76281, y: 76312},
{cx: 76520, cy: 76490},
{cx: 77134, cy: 76538},
{x: 77856, y: 76329},
{sx: 78648, sy: 75813},
{x: 78804, y: 75347},
{x: 75655, y: 75246}
]
}
});
Creates a new Path with a Quadratic Bézier Curve.
var path = new websis.graphic.Path({
style: {
fill: 'green'
},
shape: {
points: [
{x: 76281, y: 76312},
{qx: 76631, qy: 78358},
{x: 77856, y: 76329},
{x: 78804, y: 75347},
{x: 75655, y: 75246}
]
}
});
Creates a new Path with a Smooth Quadratic Bézier Curve.
var path = new websis.graphic.Path({
style: {
fill: 'green'
},
shape: {
points: [
{x: 76281, y: 76312},
{qx: 76631, qy: 78358},
{x: 77856, y: 76329},
{tx: 78648, ty: 75813},
{x: 78804, y: 75347},
{x: 75655, y: 75246}
]
}
});
Creates a new Path with an Elliptical Arc Curve.
var path = new websis.graphic.Path({
style: {
fill: 'green'
},
shape: {
points: [
{x: 76281, y: 76312},
{arx: 400, ary: 200, ar: 10, al: 1, ac: 0},
{x: 77856, y: 76329},
{x: 78804, y: 75347},
{x: 75655, y: 75246}
]
}
});
See websis.graphic.Graphic for inherited methods.
Simplifies the path. The simplify method removes vertexes to reduce the number of coordinates a path has. The higher the number of vertexes, the slower is the performance. The graphic will be redrawn after this method call.
graphic.simplify(tolerance);
Reduces the number of vertexes in a path.
path.simplify(40);