From 1b60422c62d529d8e88b7cd45a29993a95119973 Mon Sep 17 00:00:00 2001 From: David Manthey Date: Wed, 23 May 2018 13:37:54 -0400 Subject: [PATCH 1/3] Improve polygon and line documentation. This should make it clearer what the position, line, and polygon accessors do. It also explicitly defines a polygon data type. --- src/feature.js | 6 +++++- src/gl/lineFeature.js | 3 ++- src/lineFeature.js | 22 +++++++++++++--------- src/polygonFeature.js | 30 ++++++++++++++---------------- src/typedef.js | 24 ++++++++++++++++++++++++ 5 files changed, 58 insertions(+), 27 deletions(-) diff --git a/src/feature.js b/src/feature.js index 040a24eb42..798d4f9bcd 100644 --- a/src/feature.js +++ b/src/feature.js @@ -399,7 +399,11 @@ var feature = function (arg) { }; /** - * Get/Set style used by the feature. + * Get/Set style used by the feature. Styles can be constant values or + * functions. If a function, the style is typically called with parameters + * such as `(dataElement, dataIndex)` or, if the specific style of a feature + * has a subfeature style, with `(subfeatureElement, subfeatureIndex, + * dataElement, dataIndex)`. * * @param {string|object} [arg1] If `undefined`, return the current style * object. If a string and `arg2` is undefined, return the style diff --git a/src/gl/lineFeature.js b/src/gl/lineFeature.js index 7a4e962eeb..a91821e8df 100644 --- a/src/gl/lineFeature.js +++ b/src/gl/lineFeature.js @@ -36,7 +36,8 @@ var flagsDebug = { // uses 1 bit /** * Create a new instance of lineFeature. * - * @class geo.gl.lineFeature + * @class + * @alias geo.gl.lineFeature * @extends geo.lineFeature * @param {geo.lineFeature.spec} arg * @returns {geo.gl.lineFeature} diff --git a/src/lineFeature.js b/src/lineFeature.js index f421888962..31d336802e 100644 --- a/src/lineFeature.js +++ b/src/lineFeature.js @@ -47,7 +47,8 @@ var util = require('./util'); /** * Create a new instance of class lineFeature. * - * @class geo.lineFeature + * @class + * @alias geo.lineFeature * @extends geo.feature * @param {geo.lineFeature.spec} arg * @returns {geo.lineFeature} @@ -82,11 +83,13 @@ var lineFeature = function (arg) { }; /** - * Get/set lineaccessor. + * Get/set line accessor. * - * @param {object} [val] if specified, use this for the line accessor - * and return the feature. If not specified, return the current line. - * @returns {object|this} The current line or this feature. + * @param {object|function} [val] If specified, use this for the line + * accessor and return the feature. If not specified, return the current + * line. If a function, this is passed `(dataElement, dataIndex)` and + * returns an array of vertex elements. + * @returns {object|function|this} The current line or this feature. */ this.line = function (val) { if (val === undefined) { @@ -102,10 +105,11 @@ var lineFeature = function (arg) { /** * Get/Set position accessor. * - * @param {object} [val] if specified, use this for the position accessor - * and return the feature. If not specified, return the current - * position. - * @returns {object|this} The current position or this feature. + * @param {object|function} [val] If specified, use this for the position + * accessor and return the feature. If not specified, return the current + * position. If a function, this is called with `(vertexElement, + * vertexIndex, dataElement, dataIndex)`. + * @returns {object|function|this} The current position or this feature. */ this.position = function (val) { if (val === undefined) { diff --git a/src/polygonFeature.js b/src/polygonFeature.js index f06a6d4e22..60ec2a066e 100644 --- a/src/polygonFeature.js +++ b/src/polygonFeature.js @@ -9,13 +9,8 @@ var transform = require('./transform'); * @typedef {geo.feature.spec} geo.polygonFeature.spec * @property {object|function} [position] Position of the data. Default is * (data). - * @property {object|function} [polygon] Polygons from the data. Default is - * (data). Typically, the data is an array of polygons, each of which is of - * the form {outer: [(coordinates)], inner: [[(coordinates of first hole)], - * [(coordinates of second hole)], ...]}. The inner record is optional. - * Alternately, if there are no holes, a polygon can just be an array of - * coordinates in the form of geo.geoPosition. The first and last point of - * each polygon may be the same. + * @property {geo.polygon|function} [polygon] Polygons from the data. Default + * (data). * @property {object} [style] Style object with default style options. * @property {boolean|function} [style.fill=true] True to fill polygon. * @property {geo.geoColor|function} [style.fillColor] Color to fill each @@ -105,8 +100,8 @@ var polygonFeature = function (arg) { * get the position of each vertex. * @param {function} [polyFunc=this.style.get('polygon')] The function to * get each polygon. - * @returns {object[]} An array of polygon positions. Each has `outer` and - * `inner` if it has any coordinates, or is undefined. + * @returns {geo.polygonObject[]} An array of polygon positions. Each has + * `outer` and `inner` if it has any coordinates, or is `undefined`. */ function getCoordinates(data, posFunc, polyFunc) { data = data || m_this.data(); @@ -154,8 +149,8 @@ var polygonFeature = function (arg) { /** * Get the set of normalized polygon coordinates. * - * @returns {object[]} An array of polygon positions. Each has `outer` and - * `inner` if it has any coordinates, or is undefined. + * @returns {geo.polygonObject[]} An array of polygon positions. Each has + * `outer` and `inner` if it has any coordinates, or is `undefined`. */ this.polygonCoordinates = function () { return m_coordinates; @@ -188,9 +183,11 @@ var polygonFeature = function (arg) { /** * Get/set polygon accessor. * - * @param {object} [val] if specified, use this for the polygon accessor - * and return the feature. If not specified, return the current polygon. - * @returns {object|this} The current polygon or this feature. + * @param {object|function} [val] If specified, use this for the polygon + * accessor and return the feature. If not specified, return the current + * polygon. If a function, this is passed `(dataElement, dataIndex)` and + * returns a `geo.polygon`. + * @returns {object|function|this} The current polygon or this feature. */ this.polygon = function (val) { if (val === undefined) { @@ -207,9 +204,10 @@ var polygonFeature = function (arg) { /** * Get/Set position accessor. * - * @param {object} [val] if specified, use this for the position accessor + * @param {object} [val] If specified, use this for the position accessor * and return the feature. If not specified, return the current - * position. + * position. If a function, this is called with `(vertexElement, + * vertexIndex, dataElement, dataIndex)`. * @returns {object|this} The current position or this feature. */ this.position = function (val) { diff --git a/src/typedef.js b/src/typedef.js index d62bc75fa2..879399bae7 100644 --- a/src/typedef.js +++ b/src/typedef.js @@ -271,3 +271,27 @@ * @property {number} [a] The opacity on a scale of [0-1]. If unspecified and * used, it should be treated as 1. */ + +/** + * Polygon as a flat array. An array of vertices. The polygon has no holes. + * The first and last point of may be the same. + * + * @typedef {geo.geoPosition[]} geo.polygonFlat + */ + +/** + * Polygon as a object. The polygon may have holes. + * + * @typedef {object} geo.polygonObject + * @property {geo.geoPosition[]} outer An array of vertices defining the + * outside of the polygon. The first and last point of may be the same. + * @property {Array.} [inner] An array of holes, each of + * which is an array of vertices. The first and last point of may be the + * same. + */ + +/** + * Polygon. + * + * @typedef {geo.polygonFlat|geo.polygonObject} geo.polygon + */ From eaf7bb2c41f869c65e77efae9d1cd6c0c5a36e40 Mon Sep 17 00:00:00 2001 From: David Manthey Date: Thu, 24 May 2018 11:52:15 -0400 Subject: [PATCH 2/3] Fix any jsdoc @class to be @class, @alias This change is the result of running ``` sed -i $'s/^ \* @class / * @class\\n * @alias /g' `git grep -l '^ \* @class '` ``` --- src/canvas/canvasRenderer.js | 3 ++- src/canvas/heatmapFeature.js | 3 ++- src/canvas/lineFeature.js | 3 ++- src/canvas/pixelmapFeature.js | 3 ++- src/canvas/quadFeature.js | 3 ++- src/choroplethFeature.js | 3 ++- src/d3/d3Renderer.js | 3 ++- src/d3/graphFeature.js | 3 ++- src/d3/lineFeature.js | 3 ++- src/d3/pathFeature.js | 3 ++- src/d3/pointFeature.js | 3 ++- src/d3/quadFeature.js | 3 ++- src/d3/vectorFeature.js | 3 ++- src/domRenderer.js | 3 ++- src/fileReader.js | 3 ++- src/gl/choroplethFeature.js | 3 ++- src/gl/contourFeature.js | 3 ++- src/gl/pointFeature.js | 3 ++- src/gl/quadFeature.js | 3 ++- src/gl/vglRenderer.js | 3 ++- src/graphFeature.js | 3 ++- src/heatmapFeature.js | 3 ++- src/pathFeature.js | 3 ++- src/pixelmapFeature.js | 3 ++- src/pointFeature.js | 3 ++- src/quadFeature.js | 3 ++- src/renderer.js | 3 ++- src/timestamp.js | 3 ++- src/transform.js | 3 ++- src/ui/legendWidget.js | 3 ++- src/ui/sliderWidget.js | 3 ++- src/vectorFeature.js | 3 ++- 32 files changed, 64 insertions(+), 32 deletions(-) diff --git a/src/canvas/canvasRenderer.js b/src/canvas/canvasRenderer.js index 4f36cbb375..ce4ed1730d 100644 --- a/src/canvas/canvasRenderer.js +++ b/src/canvas/canvasRenderer.js @@ -5,7 +5,8 @@ var renderer = require('../renderer'); /** * Create a new instance of class canvasRenderer. * - * @class geo.canvas.renderer + * @class + * @alias geo.canvas.renderer * @extends geo.renderer * @param {object} arg Options for the renderer. * @param {geo.layer} [arg.layer] Layer associated with the renderer. diff --git a/src/canvas/heatmapFeature.js b/src/canvas/heatmapFeature.js index 498b9e0f04..cbe022b663 100644 --- a/src/canvas/heatmapFeature.js +++ b/src/canvas/heatmapFeature.js @@ -8,7 +8,8 @@ var timestamp = require('../timestamp'); * Inspired from * https://github.com/mourner/simpleheat/blob/gh-pages/simpleheat.js * - * @class geo.canvas.heatmapFeature + * @class + * @alias geo.canvas.heatmapFeature * @param {Object} arg Options object * @extends geo.heatmapFeature * @returns {canvas_heatmapFeature} diff --git a/src/canvas/lineFeature.js b/src/canvas/lineFeature.js index 3a81544441..395dc11c1f 100644 --- a/src/canvas/lineFeature.js +++ b/src/canvas/lineFeature.js @@ -5,7 +5,8 @@ var lineFeature = require('../lineFeature'); /** * Create a new instance of class lineFeature. * - * @class geo.canvas.lineFeature + * @class + * @alias geo.canvas.lineFeature * @extends geo.lineFeature * @param {geo.lineFeature.spec} arg * @returns {geo.canvas.lineFeature} diff --git a/src/canvas/pixelmapFeature.js b/src/canvas/pixelmapFeature.js index 4effb0eb90..1f10ac9282 100644 --- a/src/canvas/pixelmapFeature.js +++ b/src/canvas/pixelmapFeature.js @@ -5,7 +5,8 @@ var pixelmapFeature = require('../pixelmapFeature'); /** * Create a new instance of class pixelmapFeature * - * @class geo.canvas.pixelmapFeature + * @class + * @alias geo.canvas.pixelmapFeature * @param {Object} arg Options object * @extends geo.pixelmapFeature * @returns {canvas_pixelmapFeature} diff --git a/src/canvas/quadFeature.js b/src/canvas/quadFeature.js index b524fa0c4d..37fd20e89e 100644 --- a/src/canvas/quadFeature.js +++ b/src/canvas/quadFeature.js @@ -6,7 +6,8 @@ var util = require('../util'); /** * Create a new instance of class quadFeature. * - * @class geo.canvas.quadFeature + * @class + * @alias geo.canvas.quadFeature * @param {geo.quadFeature.spec} arg Options object. * @extends geo.quadFeature * @returns {geo.canvas.quadFeature} diff --git a/src/choroplethFeature.js b/src/choroplethFeature.js index 54c7fd66cc..3fb89196d7 100644 --- a/src/choroplethFeature.js +++ b/src/choroplethFeature.js @@ -4,7 +4,8 @@ var feature = require('./feature'); /** * Create a new instance of class choroplethFeature * - * @class geo.choroplethFeature + * @class + * @alias geo.choroplethFeature * @param {Object} arg Options object * @extends geo.feature * @param {Array} [colorRange] Color lookup table for diff --git a/src/d3/d3Renderer.js b/src/d3/d3Renderer.js index 814e72a6a2..3188bbb266 100644 --- a/src/d3/d3Renderer.js +++ b/src/d3/d3Renderer.js @@ -5,7 +5,8 @@ var renderer = require('../renderer'); /** * Create a new instance of class d3Renderer. * - * @class geo.d3.renderer + * @class + * @alias geo.d3.renderer * @extends geo.renderer * @param {object} arg Options for the renderer. * @param {geo.layer} [arg.layer] Layer associated with the renderer. diff --git a/src/d3/graphFeature.js b/src/d3/graphFeature.js index a1110ef60f..675e6f8dfc 100644 --- a/src/d3/graphFeature.js +++ b/src/d3/graphFeature.js @@ -3,7 +3,8 @@ var registerFeature = require('../registry').registerFeature; var graphFeature = require('../graphFeature'); /** - * @class geo.d3.graphFeature + * @class + * @alias geo.d3.graphFeature * @extends geo.graphFeature */ var d3_graphFeature = function (arg) { diff --git a/src/d3/lineFeature.js b/src/d3/lineFeature.js index e809cbfbd3..ef96e0877d 100644 --- a/src/d3/lineFeature.js +++ b/src/d3/lineFeature.js @@ -5,7 +5,8 @@ var lineFeature = require('../lineFeature'); /** * Create a new instance of class lineFeature. * - * @class geo.d3.lineFeature + * @class + * @alias geo.d3.lineFeature * @extends geo.lineFeature * @param {geo.lineFeature.spec} arg * @returns {geo.d3.lineFeature} diff --git a/src/d3/pathFeature.js b/src/d3/pathFeature.js index 64d2d6a89b..acda18da69 100644 --- a/src/d3/pathFeature.js +++ b/src/d3/pathFeature.js @@ -5,7 +5,8 @@ var pathFeature = require('../pathFeature'); /** * Create a new instance of class pathFeature * - * @class geo.d3.pathFeature + * @class + * @alias geo.d3.pathFeature * @extends geo.pathFeature * @extends geo.d3.object * @returns {geo.d3.pathFeature} diff --git a/src/d3/pointFeature.js b/src/d3/pointFeature.js index 608f0a6eea..ee40cb1c4a 100644 --- a/src/d3/pointFeature.js +++ b/src/d3/pointFeature.js @@ -6,7 +6,8 @@ var pointFeature = require('../pointFeature'); * * Create a new instance of pointFeature * - * @class geo.d3.pointFeature + * @class + * @alias geo.d3.pointFeature * @extends geo.pointFeature * @extends geo.d3.object * @returns {geo.d3.pointFeature} diff --git a/src/d3/quadFeature.js b/src/d3/quadFeature.js index 61e3504d29..d18fe9e82e 100644 --- a/src/d3/quadFeature.js +++ b/src/d3/quadFeature.js @@ -5,7 +5,8 @@ var quadFeature = require('../quadFeature'); /** * Create a new instance of class quadFeature. * - * @class geo.d3.quadFeature + * @class + * @alias geo.d3.quadFeature * @param {geo.quadFeature.spec} arg Options object. * @extends geo.quadFeature * @returns {geo.d3.quadFeature} diff --git a/src/d3/vectorFeature.js b/src/d3/vectorFeature.js index 12e61d2342..c94122ecf2 100644 --- a/src/d3/vectorFeature.js +++ b/src/d3/vectorFeature.js @@ -5,7 +5,8 @@ var vectorFeature = require('../vectorFeature'); /** * Create a new instance of vectorFeature * - * @class geo.d3.vectorFeature + * @class + * @alias geo.d3.vectorFeature * @extends geo.vectorFeature * @extends geo.d3.object * @returns {geo.d3.vectorFeature} diff --git a/src/domRenderer.js b/src/domRenderer.js index 0e8c01f0ad..a9be557f02 100644 --- a/src/domRenderer.js +++ b/src/domRenderer.js @@ -5,7 +5,8 @@ var registerRenderer = require('./registry').registerRenderer; /** * Create a new instance of class domRenderer. * - * @class geo.domRenderer + * @class + * @alias geo.domRenderer * @extends geo.renderer * @param {object} arg Options for the renderer. * @param {geo.layer} [arg.layer] Layer associated with the renderer. diff --git a/src/fileReader.js b/src/fileReader.js index 7b5cec191d..03dcc4055e 100644 --- a/src/fileReader.js +++ b/src/fileReader.js @@ -5,7 +5,8 @@ var object = require('./object'); /** * Create a new instance of class fileReader * - * @class geo.fileReader + * @class + * @alias geo.fileReader * @extends geo.object * @returns {geo.fileReader} */ diff --git a/src/gl/choroplethFeature.js b/src/gl/choroplethFeature.js index 607a1befd7..a4e88b7a8b 100644 --- a/src/gl/choroplethFeature.js +++ b/src/gl/choroplethFeature.js @@ -5,7 +5,8 @@ var choroplethFeature = require('../choroplethFeature'); /** * Create a new instance of choroplethFeature * - * @class geo.gl.choroplethFeature + * @class + * @alias geo.gl.choroplethFeature * @extends geo.choroplethFeature * @returns {geo.gl.choroplethFeature} */ diff --git a/src/gl/contourFeature.js b/src/gl/contourFeature.js index f9c56d66a0..d857a4e621 100644 --- a/src/gl/contourFeature.js +++ b/src/gl/contourFeature.js @@ -5,7 +5,8 @@ var contourFeature = require('../contourFeature'); /** * Create a new instance of contourFeature * - * @class geo.gl.contourFeature + * @class + * @alias geo.gl.contourFeature * @extends geo.contourFeature * @returns {geo.gl.contourFeature} */ diff --git a/src/gl/pointFeature.js b/src/gl/pointFeature.js index 514049baee..abc61eed68 100644 --- a/src/gl/pointFeature.js +++ b/src/gl/pointFeature.js @@ -6,7 +6,8 @@ var pointFeature = require('../pointFeature'); /** * Create a new instance of pointFeature * - * @class geo.gl.pointFeature + * @class + * @alias geo.gl.pointFeature * @extends geo.pointFeature * @returns {geo.gl.pointFeature} */ diff --git a/src/gl/quadFeature.js b/src/gl/quadFeature.js index fe96fd34a6..0ed1f63050 100644 --- a/src/gl/quadFeature.js +++ b/src/gl/quadFeature.js @@ -5,7 +5,8 @@ var quadFeature = require('../quadFeature'); /** * Create a new instance of class quadFeature. * - * @class geo.gl.quadFeature + * @class + * @alias geo.gl.quadFeature * @param {geo.quadFeature.spec} arg Options object. * @extends geo.quadFeature * @returns {geo.gl.quadFeature} diff --git a/src/gl/vglRenderer.js b/src/gl/vglRenderer.js index 7e16f5eb85..9184efc1a0 100644 --- a/src/gl/vglRenderer.js +++ b/src/gl/vglRenderer.js @@ -5,7 +5,8 @@ var renderer = require('../renderer'); /** * Create a new instance of class vglRenderer. * - * @class geo.gl.vglRenderer + * @class + * @alias geo.gl.vglRenderer * @extends geo.renderer * @param {object} arg Options for the renderer. * @param {geo.layer} [arg.layer] Layer associated with the renderer. diff --git a/src/graphFeature.js b/src/graphFeature.js index 47df524ebb..f8be3e06e9 100644 --- a/src/graphFeature.js +++ b/src/graphFeature.js @@ -4,7 +4,8 @@ var feature = require('./feature'); /** * Create a new instance of class graphFeature * - * @class geo.graphFeature + * @class + * @alias geo.graphFeature * @extends geo.feature * @returns {geo.graphFeature} */ diff --git a/src/heatmapFeature.js b/src/heatmapFeature.js index 418bc2b633..d966308a5c 100644 --- a/src/heatmapFeature.js +++ b/src/heatmapFeature.js @@ -6,7 +6,8 @@ var transform = require('./transform'); /** * Create a new instance of class heatmapFeature * - * @class geo.heatmapFeature + * @class + * @alias geo.heatmapFeature * @param {Object} arg Options object * @extends geo.feature * @param {Object|Function} [position] Position of the data. Default is diff --git a/src/pathFeature.js b/src/pathFeature.js index 00efeb43ac..03c6b11e81 100644 --- a/src/pathFeature.js +++ b/src/pathFeature.js @@ -5,7 +5,8 @@ var feature = require('./feature'); /** * Create a new instance of class pathFeature * - * @class geo.pathFeature + * @class + * @alias geo.pathFeature * @extends geo.feature * @returns {geo.pathFeature} */ diff --git a/src/pixelmapFeature.js b/src/pixelmapFeature.js index 56d340c5ee..21100274a8 100644 --- a/src/pixelmapFeature.js +++ b/src/pixelmapFeature.js @@ -7,7 +7,8 @@ var util = require('./util'); /** * Create a new instance of class imagemapFeature * - * @class geo.pixelmapFeature + * @class + * @alias geo.pixelmapFeature * @param {Object} arg Options object * @extends geo.feature * @param {Object|Function|HTMLImageElement} [url] URL of a pixel map or an diff --git a/src/pointFeature.js b/src/pointFeature.js index 992f8fdfc6..a1cf5fbb82 100644 --- a/src/pointFeature.js +++ b/src/pointFeature.js @@ -4,7 +4,8 @@ var feature = require('./feature'); /** * Create a new instance of class pointFeature * - * @class geo.pointFeature + * @class + * @alias geo.pointFeature * @param {object} arg Options object * @param {boolean} arg.clustering Enable point clustering * @extends geo.feature diff --git a/src/quadFeature.js b/src/quadFeature.js index ae791fd158..def73f43b4 100644 --- a/src/quadFeature.js +++ b/src/quadFeature.js @@ -51,7 +51,8 @@ var feature = require('./feature'); /** * Create a new instance of class quadFeature. * - * @class geo.quadFeature + * @class + * @alias geo.quadFeature * @param {geo.quadFeature.spec} arg Options object. * @extends geo.feature * @returns {geo.quadFeature} diff --git a/src/renderer.js b/src/renderer.js index 60eb249792..07b1a979fb 100644 --- a/src/renderer.js +++ b/src/renderer.js @@ -4,7 +4,8 @@ var object = require('./object'); /** * Create a new instance of class renderer. * - * @class geo.renderer + * @class + * @alias geo.renderer * @extends geo.object * @param {object} arg Options for the renderer. * @param {geo.layer} [arg.layer] Layer associated with the renderer. diff --git a/src/timestamp.js b/src/timestamp.js index 9e874784ed..56f2e84122 100644 --- a/src/timestamp.js +++ b/src/timestamp.js @@ -4,7 +4,8 @@ var inherit = require('./inherit'); /** * Create a new instance of class timestamp. * - * @class geo.timestamp + * @class + * @alias geo.timestamp * @extends vgl.timestamp * @returns {geo.timestamp} */ diff --git a/src/transform.js b/src/transform.js index 44585ed0f4..ed44620072 100644 --- a/src/transform.js +++ b/src/transform.js @@ -16,7 +16,8 @@ var util = require('./util'); * z values that are ignored in current mapping context, but will in the * future perform more general 3D transformations. * - * @class geo.transform + * @class + * @alias geo.transform * @param {object} options Constructor options * @param {string} options.source A proj4 string for the source projection * @param {string} options.target A proj4 string for the target projection diff --git a/src/ui/legendWidget.js b/src/ui/legendWidget.js index 393444e962..4298d9f1c3 100644 --- a/src/ui/legendWidget.js +++ b/src/ui/legendWidget.js @@ -5,7 +5,8 @@ var registerWidget = require('../registry').registerWidget; /** * Create a new instance of class legendWidget * - * @class geo.gui.legendWidget + * @class + * @alias geo.gui.legendWidget * @extends geo.gui.svgWidget * @returns {geo.gui.legendWidget} */ diff --git a/src/ui/sliderWidget.js b/src/ui/sliderWidget.js index f387f2a809..e930f541de 100644 --- a/src/ui/sliderWidget.js +++ b/src/ui/sliderWidget.js @@ -5,7 +5,8 @@ var registerWidget = require('../registry').registerWidget; /** * Create a new instance of class sliderWidget * - * @class geo.gui.sliderWidget + * @class + * @alias geo.gui.sliderWidget * @extends {geo.gui.svgWidget} * @returns {geo.gui.sliderWidget} */ diff --git a/src/vectorFeature.js b/src/vectorFeature.js index ed5560d8ea..4183812afc 100644 --- a/src/vectorFeature.js +++ b/src/vectorFeature.js @@ -4,7 +4,8 @@ var feature = require('./feature'); /** * Create a new instance of class vectorFeature * - * @class geo.vectorFeature + * @class + * @alias geo.vectorFeature * @extends geo.feature * @returns {geo.vectorFeature} */ From d715877bd4f5686b10c49961f07bbaf45feca6f1 Mon Sep 17 00:00:00 2001 From: David Manthey Date: Tue, 29 May 2018 08:42:47 -0400 Subject: [PATCH 3/3] Reword some comments. --- src/lineFeature.js | 20 ++++++++++---------- src/polygonFeature.js | 19 ++++++++++--------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/lineFeature.js b/src/lineFeature.js index 31d336802e..b1b58e49d0 100644 --- a/src/lineFeature.js +++ b/src/lineFeature.js @@ -85,11 +85,11 @@ var lineFeature = function (arg) { /** * Get/set line accessor. * - * @param {object|function} [val] If specified, use this for the line - * accessor and return the feature. If not specified, return the current - * line. If a function, this is passed `(dataElement, dataIndex)` and - * returns an array of vertex elements. - * @returns {object|function|this} The current line or this feature. + * @param {object|function} [val] If not specified, return the current line + * accessor. If specified, use this for the line accessor and return + * `this`. If a function is given, the function is passed `(dataElement, + * dataIndex)` and returns an array of vertex elements. + * @returns {object|function|this} The current line accessor or this feature. */ this.line = function (val) { if (val === undefined) { @@ -105,10 +105,10 @@ var lineFeature = function (arg) { /** * Get/Set position accessor. * - * @param {object|function} [val] If specified, use this for the position - * accessor and return the feature. If not specified, return the current - * position. If a function, this is called with `(vertexElement, - * vertexIndex, dataElement, dataIndex)`. + * @param {object|function} [val] If not specified, return the current + * position accessor. If specified, use this for the position accessor + * and return `this`. If a function is given, this is called with + * `(vertexElement, vertexIndex, dataElement, dataIndex)`. * @returns {object|function|this} The current position or this feature. */ this.position = function (val) { @@ -263,7 +263,7 @@ var lineFeature = function (arg) { }; /** - * Take a set of data, reduce the number of vertices per linen using the + * Take a set of data, reduce the number of vertices per line using the * Ramer–Douglas–Peucker algorithm, and use the result as the new data. * This changes the instance's data, the position accessor, and the line * accessor. diff --git a/src/polygonFeature.js b/src/polygonFeature.js index 60ec2a066e..36b1ec005c 100644 --- a/src/polygonFeature.js +++ b/src/polygonFeature.js @@ -183,11 +183,12 @@ var polygonFeature = function (arg) { /** * Get/set polygon accessor. * - * @param {object|function} [val] If specified, use this for the polygon - * accessor and return the feature. If not specified, return the current - * polygon. If a function, this is passed `(dataElement, dataIndex)` and - * returns a `geo.polygon`. - * @returns {object|function|this} The current polygon or this feature. + * @param {object|function} [val] If not specified, return the current + * polygon accessor. If specified, use this for the polygon accessor and + * return `this`. If a function is given, the function is passed + * `(dataElement, dataIndex)` and returns a `geo.polygon`. + * @returns {object|function|this} The current polygon accessor or this + * feature. */ this.polygon = function (val) { if (val === undefined) { @@ -204,10 +205,10 @@ var polygonFeature = function (arg) { /** * Get/Set position accessor. * - * @param {object} [val] If specified, use this for the position accessor - * and return the feature. If not specified, return the current - * position. If a function, this is called with `(vertexElement, - * vertexIndex, dataElement, dataIndex)`. + * @param {object|function} [val] If not specified, return the current + * position accessor. If specified, use this for the position accessor + * and return `this`. If a function is given, this is called with + * `(vertexElement, vertexIndex, dataElement, dataIndex)`. * @returns {object|this} The current position or this feature. */ this.position = function (val) {