Home :: GUI :: Shapes

  1. Introduction
  2. Reference
    1. Methods
      1. constructor
      2. init
      3. realize
      4. refresh
      5. registerHandles
      6. unregisterHandles
      7. selectHandles
      8. showHandles
      9. parseData
      10. tokenize
      11. getIntersectionParams
    2. Class Properties
      1. COMMAND
      2. NUMBER
      3. EOF
      4. PARAMS
    3. Properties
      1. segments
  3. Example
  4. Download

Introduction

Path is a JavaScript object that allows you to interactively manipulate a path via Handle objects. The Path object is a container of path segment objects. This object will act as a single SVG element; however, methods called on this object will result in calls to all path segments managed by this object. Currently, the following path segments have been defined:

This code is used in the 2D Geometry section of this site.


Reference

Methods

constructor - new Path(svgNode);

This method creates a new Path object. All initialization is handled by the init() method. All parameters for this method are described below.

init(svgNode);

realize();

refresh();

registerHandles();

unregisterHandles();

selectHandles();

showHandles();

parseData(d);

tokenize(d);

getIntersectionParams() : IntersectionParams;

Class Properties

Properties


Example

This example allows you to adjust path elements within the SVG document. The curves below consist of the following path segments: Moveto, Lineto, Quadratic Bezier, and Cubic Bezier. Here is a brief summary of the editing procedures:


Download

Path.js - the path object only...cannot be used in isolation

2D.js.gz - all objects needed to use this object and other 2D geometry objects