updated class config param doc include replacements with grunt

This commit is contained in:
Eric Rowell 2013-06-01 10:27:44 -07:00
parent 489b7825c3
commit 5d1a78589a
21 changed files with 128 additions and 43 deletions

View File

@ -56,8 +56,11 @@ module.exports = function(grunt) {
dist: { dist: {
options: { options: {
variables: { variables: {
'version': '<%= pkg.version %>', version: '<%= pkg.version %>',
'date': '<%= grunt.template.today("yyyy-mm-dd") %>' date: '<%= grunt.template.today("yyyy-mm-dd") %>',
nodeParams: '<%= grunt.file.read("doc-includes/NodeParams.txt") %>',
containerParams: '<%= grunt.file.read("doc-includes/ContainerParams.txt") %>',
shapeParams: '<%= grunt.file.read("doc-includes/ShapeParams.txt") %>'
}, },
prefix: '@@' prefix: '@@'
}, },

View File

@ -0,0 +1 @@
@param {Function} [config.clipFunc] clipping function

View File

@ -0,0 +1,20 @@
@param {Number} [config.x]
* @param {Number} [config.y]
* @param {Number} [config.width]
* @param {Number} [config.height]
* @param {Boolean} [config.visible]
* @param {Boolean} [config.listening] whether or not the node is listening for events
* @param {String} [config.id] unique id
* @param {String} [config.name] non-unique name
* @param {Number} [config.opacity] determines node opacity. Can be any number between 0 and 1
* @param {Object} [config.scale] set scale
* @param {Number} [config.scaleX] set scale x
* @param {Number} [config.scaleY] set scale y
* @param {Number} [config.rotation] rotation in radians
* @param {Number} [config.rotationDeg] rotation in degrees
* @param {Object} [config.offset] offset from center point and rotation point
* @param {Number} [config.offsetX] set offset x
* @param {Number} [config.offsetY] set offset y
* @param {Boolean} [config.draggable] makes the node draggable. When stages are draggable, you can drag and drop
* the entire stage by dragging any portion of the stage
* @param {Function} [config.dragBoundFunc]

View File

@ -0,0 +1,61 @@
@param {String} [config.fill] fill color
* @param {Object} [config.fillRGB] set fill color with an object literal containing an r, g, and b component
* @param {Integer} [config.fillR] set fill red component
* @param {Integer} [config.fillG] set fill green component
* @param {Integer} [config.fillB] set fill blue component
* @param {Image} [config.fillPatternImage] fill pattern image
* @param {Number} [config.fillPatternX]
* @param {Number} [config.fillPatternY]
* @param {Number|Array|Object} [config.fillPatternOffset] number, array with two elements, or object with x and y component
* @param {Number} [config.fillPatternOffsetX]
* @param {Number} [config.fillPatternOffsetY]
* @param {Number|Array|Object} [config.fillPatternScale] number, array with two elements, or object with x and y component
* @param {Number} [config.fillPatternScaleX]
* @param {Number} [config.fillPatternScaleY]
* @param {Number} [config.fillPatternRotation]
* @param {String} [config.fillPatternRepeat] can be 'repeat', 'repeat-x', 'repeat-y', or 'no-repeat'. The default is 'no-repeat'
* @param {Number|Array|Object} [config.fillLinearGradientStartPoint] number, array with two elements, or object with x and y component
* @param {Number} [config.fillLinearGradientStartPointX]
* @param {Number} [config.fillLinearGradientStartPointY]
* @param {Number|Array|Object} [config.fillLinearGradientEndPoint] number, array with two elements, or object with x and y component
* @param {Number|Array|Object} [config.fillLinearGradientEndPoint] number, array with two elements, or object with x and y component
* @param {Number} [config.fillLinearGradientEndPointX]
* @param {Number} [config.fillLinearGradientEndPointY]
* @param {Array} [config.fillLinearGradientColorStops] array of color stops
* @param {Number|Array|Object} [config.fillRadialGradientStartPoint] number, array with two elements, or object with x and y component
* @param {Number} [config.fillRadialGradientStartPointX]
* @param {Number} [config.fillRadialGradientStartPointY]
* @param {Number|Array|Object} [config.fillRadialGradientEndPoint] number, array with two elements, or object with x and y component
* @param {Number} [config.fillRadialGradientEndPointX]
* @param {Number} [config.fillRadialGradientEndPointY]
* @param {Number} [config.fillRadialGradientStartRadius]
* @param {Number} [config.fillRadialGradientEndRadius]
* @param {Array} [config.fillRadialGradientColorStops] array of color stops
* @param {Boolean} [config.fillEnabled] flag which enables or disables the fill. The default value is true
* @param {String} [config.fillPriority] can be color, linear-gradient, radial-graident, or pattern. The default value is color. The fillPriority property makes it really easy to toggle between different fill types. For example, if you want to toggle between a fill color style and a fill pattern style, simply set the fill property and the fillPattern properties, and then use setFillPriority('color') to render the shape with a color fill, or use setFillPriority('pattern') to render the shape with the pattern fill configuration
* @param {String} [config.stroke] stroke color
* @param {Object} [config.strokeRGB] set stroke color with an object literal containing an r, g, and b component
* @param {Integer} [config.strokeR] set stroke red component
* @param {Integer} [config.strokeG] set stroke green component
* @param {Integer} [config.strokeB] set stroke blue component
* @param {Number} [config.strokeWidth] stroke width
* @param {Boolean} [config.strokeScaleEnabled] flag which enables or disables stroke scale. The default is true
* @param {Boolean} [config.strokeEnabled] flag which enables or disables the stroke. The default value is true
* @param {String} [config.lineJoin] can be miter, round, or bevel. The default
* is miter
* @param {String} [config.lineCap] can be butt, round, or sqare. The default
* is butt
* @param {String} [config.shadowColor]
* @param {Object} [config.shadowColorRGB] set shadowColor color with an object literal containing an r, g, and b component
* @param {Integer} [config.shadowColorR] set shadowColor red component
* @param {Integer} [config.shadowColorG] set shadowColor green component
* @param {Integer} [config.shadowColorB] set shadowColor blue component
* @param {Number} [config.shadowBlur]
* @param {Object} [config.shadowOffset]
* @param {Number} [config.shadowOffsetX]
* @param {Number} [config.shadowOffsetY]
* @param {Number} [config.shadowOpacity] shadow opacity. Can be any real number
* between 0 and 1
* @param {Boolean} [config.shadowEnabled] flag which enables or disables the shadow. The default value is true
* @param {Array} [config.dashArray]
* @param {Boolean} [config.dashArrayEnabled] flag which enables or disables the dashArray. The default value is true

View File

@ -1,6 +1,6 @@
{ {
"name": "KineticJS", "name": "KineticJS",
"version": "4.5.4", "version": "current",
"devDependencies": { "devDependencies": {
"grunt": "~0.4.1", "grunt": "~0.4.1",
"grunt-contrib-jshint": "~0.1.1", "grunt-contrib-jshint": "~0.1.1",

View File

@ -45,7 +45,7 @@ var Kinetic = {};
* @memberof Kinetic * @memberof Kinetic
* @abstract * @abstract
* @param {Object} config * @param {Object} config
* {{NodeParams}} * @@nodeParams
*/ */
Kinetic.Node = function(config) { Kinetic.Node = function(config) {
this._nodeInit(config); this._nodeInit(config);
@ -58,8 +58,8 @@ var Kinetic = {};
* @memberof Kinetic * @memberof Kinetic
* @augments Kinetic.Node * @augments Kinetic.Node
* @param {Object} config * @param {Object} config
* {{ShapeParams}} * @@shapeParams
* {{NodeParams}} * @@nodeParams
* @example * @example
* var customShape = new Kinetic.Shape({<br> * var customShape = new Kinetic.Shape({<br>
* x: 5,<br> * x: 5,<br>
@ -88,8 +88,8 @@ var Kinetic = {};
* @augments Kinetic.Node * @augments Kinetic.Node
* @abstract * @abstract
* @param {Object} config * @param {Object} config
* {{NodeParams}} * @@nodeParams
* {{ContainerParams}} * @@containerParams
*/ */
Kinetic.Container = function(config) { Kinetic.Container = function(config) {
this._containerInit(config); this._containerInit(config);
@ -102,8 +102,8 @@ var Kinetic = {};
* @augments Kinetic.Container * @augments Kinetic.Container
* @param {Object} config * @param {Object} config
* @param {String|DomElement} config.container Container id or DOM element * @param {String|DomElement} config.container Container id or DOM element
* {{NodeParams}} * @@nodeParams
* {{ContainerParams}} * @@containerParams
* @example * @example
* var stage = new Kinetic.Stage({<br> * var stage = new Kinetic.Stage({<br>
* width: 500,<br> * width: 500,<br>
@ -124,8 +124,8 @@ var Kinetic = {};
* @param {Object} config * @param {Object} config
* @param {Boolean} [config.clearBeforeDraw] set this property to false if you don't want * @param {Boolean} [config.clearBeforeDraw] set this property to false if you don't want
* to clear the canvas before each layer draw. The default value is true. * to clear the canvas before each layer draw. The default value is true.
* {{NodeParams}} * @@nodeParams
* {{ContainerParams}} * @@containerParams
* @example * @example
* var layer = new Kinetic.Layer(); * var layer = new Kinetic.Layer();
*/ */
@ -139,8 +139,8 @@ var Kinetic = {};
* @memberof Kinetic * @memberof Kinetic
* @augments Kinetic.Container * @augments Kinetic.Container
* @param {Object} config * @param {Object} config
* {{NodeParams}} * @@nodeParams
* {{ContainerParams}} * @@containerParams
* @example * @example
* var group = new Kinetic.Group(); * var group = new Kinetic.Group();
*/ */

View File

@ -31,7 +31,7 @@
* @param {Number} [config.tag.pointerWidth] * @param {Number} [config.tag.pointerWidth]
* @param {Number} [config.tag.pointerHeight] * @param {Number} [config.tag.pointerHeight]
* @param {Number} [config.tag.cornerRadius] * @param {Number} [config.tag.cornerRadius]
* {{NodeParams}} * @@nodeParams
* @example * @example
* // create label * // create label
* var label = new Kinetic.Label({<br> * var label = new Kinetic.Label({<br>

View File

@ -7,8 +7,8 @@
* @augments Kinetic.Shape * @augments Kinetic.Shape
* @param {Object} config * @param {Object} config
* @param {String} config.data SVG data string * @param {String} config.data SVG data string
* {{ShapeParams}} * @@shapeParams
* {{NodeParams}} * @@nodeParams
* @example * @example
* var path = new Kinetic.Path({<br> * var path = new Kinetic.Path({<br>
* x: 240,<br> * x: 240,<br>

View File

@ -7,8 +7,8 @@
* @param {Object} config * @param {Object} config
* @param {Number} config.sides * @param {Number} config.sides
* @param {Number} config.radius * @param {Number} config.radius
* {{ShapeParams}} * @@shapeParams
* {{NodeParams}} * @@nodeParams
* @example * @example
* var hexagon = new Kinetic.RegularPolygon({<br> * var hexagon = new Kinetic.RegularPolygon({<br>
* x: 100,<br> * x: 100,<br>

View File

@ -8,8 +8,8 @@
* @param {Integer} config.numPoints * @param {Integer} config.numPoints
* @param {Number} config.innerRadius * @param {Number} config.innerRadius
* @param {Number} config.outerRadius * @param {Number} config.outerRadius
* {{ShapeParams}} * @@shapeParams
* {{NodeParams}} * @@nodeParams
* @example * @example
* var star = new Kinetic.Star({<br> * var star = new Kinetic.Star({<br>
* x: 100,<br> * x: 100,<br>

View File

@ -15,8 +15,8 @@
* @param {String} [config.fontStyle] can be normal, bold, or italic. Default is normal * @param {String} [config.fontStyle] can be normal, bold, or italic. Default is normal
* @param {String} config.text * @param {String} config.text
* @param {String} config.data SVG data string * @param {String} config.data SVG data string
* {{ShapeParams}} * @@shapeParams
* {{NodeParams}} * @@nodeParams
* @example * @example
* var textpath = new Kinetic.TextPath({<br> * var textpath = new Kinetic.TextPath({<br>
* x: 100,<br> * x: 100,<br>

View File

@ -9,8 +9,8 @@
* @param {Array} config.points can be a flattened array of points, an array of point arrays, or an array of point objects. * @param {Array} config.points can be a flattened array of points, an array of point arrays, or an array of point objects.
* e.g. [0,1,2,3], [[0,1],[2,3]] and [{x:0,y:1},{x:2,y:3}] are equivalent * e.g. [0,1,2,3], [[0,1],[2,3]] and [{x:0,y:1},{x:2,y:3}] are equivalent
* @param {Number} [config.tension] default value is 1. Higher values will result in a more curvy line. A value of 0 will result in no interpolation. * @param {Number} [config.tension] default value is 1. Higher values will result in a more curvy line. A value of 0 will result in no interpolation.
* {{ShapeParams}} * @@shapeParams
* {{NodeParams}} * @@nodeParams
* @example * @example
* var blob = new Kinetic.Blob({<br> * var blob = new Kinetic.Blob({<br>
* points: [73, 140, 340, 23, 500, 109, 300, 170],<br> * points: [73, 140, 340, 23, 500, 109, 300, 170],<br>

View File

@ -6,8 +6,8 @@
* @augments Kinetic.Shape * @augments Kinetic.Shape
* @param {Object} config * @param {Object} config
* @param {Number} config.radius * @param {Number} config.radius
* {{ShapeParams}} * @@shapeParams
* {{NodeParams}} * @@nodeParams
* @example * @example
* // create simple circle * // create simple circle
* var circle = new Kinetic.Circle({<br> * var circle = new Kinetic.Circle({<br>

View File

@ -12,8 +12,8 @@
* @param {Object} config * @param {Object} config
* @param {ImageObject} config.image * @param {ImageObject} config.image
* @param {Object} [config.crop] * @param {Object} [config.crop]
* {{ShapeParams}} * @@shapeParams
* {{NodeParams}} * @@nodeParams
* @example * @example
* var imageObj = new Image();<br> * var imageObj = new Image();<br>
* imageObj.onload = function() {<br> * imageObj.onload = function() {<br>

View File

@ -7,8 +7,8 @@
* @param {Object} config * @param {Object} config
* @param {Array} config.points can be a flattened array of points, an array of point arrays, or an array of point objects. * @param {Array} config.points can be a flattened array of points, an array of point arrays, or an array of point objects.
* e.g. [0,1,2,3], [[0,1],[2,3]] and [{x:0,y:1},{x:2,y:3}] are equivalent * e.g. [0,1,2,3], [[0,1],[2,3]] and [{x:0,y:1},{x:2,y:3}] are equivalent
* {{ShapeParams}} * @@shapeParams
* {{NodeParams}} * @@nodeParams
* @example * @example
* // simple line * // simple line
* var line = new Kinetic.Line({<br> * var line = new Kinetic.Line({<br>

View File

@ -7,8 +7,8 @@
* @param {Object} config * @param {Object} config
* @param {Array} config.points can be a flattened array of points, an array of point arrays, or an array of point objects. * @param {Array} config.points can be a flattened array of points, an array of point arrays, or an array of point objects.
* e.g. [0,1,2,3], [[0,1],[2,3]] and [{x:0,y:1},{x:2,y:3}] are equivalent * e.g. [0,1,2,3], [[0,1],[2,3]] and [{x:0,y:1},{x:2,y:3}] are equivalent
* {{ShapeParams}} * @@shapeParams
* {{NodeParams}} * @@nodeParams
* @example * @example
* var polygon = new Kinetic.Polygon({<br> * var polygon = new Kinetic.Polygon({<br>
* points: [73, 192, 73, 160, 340, 23, 500, 109, 499, 139, 342, 93],<br> * points: [73, 192, 73, 160, 340, 23, 500, 109, 499, 139, 342, 93],<br>

View File

@ -6,8 +6,8 @@
* @augments Kinetic.Shape * @augments Kinetic.Shape
* @param {Object} config * @param {Object} config
* @param {Number} [config.cornerRadius] * @param {Number} [config.cornerRadius]
* {{ShapeParams}} * @@shapeParams
* {{NodeParams}} * @@nodeParams
* @example * @example
* var rect = new Kinetic.Rect({<br> * var rect = new Kinetic.Rect({<br>
* width: 100,<br> * width: 100,<br>

View File

@ -9,8 +9,8 @@
* @param {Array} config.points can be a flattened array of points, an array of point arrays, or an array of point objects. * @param {Array} config.points can be a flattened array of points, an array of point arrays, or an array of point objects.
* e.g. [0,1,2,3], [[0,1],[2,3]] and [{x:0,y:1},{x:2,y:3}] are equivalent * e.g. [0,1,2,3], [[0,1],[2,3]] and [{x:0,y:1},{x:2,y:3}] are equivalent
* @param {Number} [config.tension] default value is 1. Higher values will result in a more curvy line. A value of 0 will result in no interpolation. * @param {Number} [config.tension] default value is 1. Higher values will result in a more curvy line. A value of 0 will result in no interpolation.
* {{ShapeParams}} * @@shapeParams
* {{NodeParams}} * @@nodeParams
* @example * @example
* var spline = new Kinetic.Spline({<br> * var spline = new Kinetic.Spline({<br>
* x: 100,<br> * x: 100,<br>

View File

@ -9,8 +9,8 @@
* @param {Object} config.animations animation map * @param {Object} config.animations animation map
* @param {Integer} [config.index] animation index * @param {Integer} [config.index] animation index
* @param {Image} config.image image object * @param {Image} config.image image object
* {{ShapeParams}} * @@shapeParams
* {{NodeParams}} * @@nodeParams
* @example * @example
* var animations = {<br> * var animations = {<br>
* idle: [{<br> * idle: [{<br>

View File

@ -43,8 +43,8 @@
* @param {Number} [config.height] default is auto * @param {Number} [config.height] default is auto
* @param {Number} [config.lineHeight] default is 1 * @param {Number} [config.lineHeight] default is 1
* @param {String} [config.wrap] can be word, char, or none. Default is word * @param {String} [config.wrap] can be word, char, or none. Default is word
* {{ShapeParams}} * @@shapeParams
* {{NodeParams}} * @@nodeParams
* @example * @example
* var text = new Kinetic.Text({<br> * var text = new Kinetic.Text({<br>
* x: stage.getWidth() / 2,<br> * x: stage.getWidth() / 2,<br>

View File

@ -8,8 +8,8 @@
* @param {Number} config.angleDeg angle in degrees * @param {Number} config.angleDeg angle in degrees
* @param {Number} config.radius * @param {Number} config.radius
* @param {Boolean} [config.clockwise] * @param {Boolean} [config.clockwise]
* {{ShapeParams}} * @@shapeParams
* {{NodeParams}} * @@nodeParams
* @example * @example
* // draw a wedge that's pointing downwards<br> * // draw a wedge that's pointing downwards<br>
* var wedge = new Kinetic.Wedge({<br> * var wedge = new Kinetic.Wedge({<br>