Skip to content

Commit

Permalink
Document nested arrays in a documentationjs-compatible way
Browse files Browse the repository at this point in the history
  • Loading branch information
jfirebaugh committed Jun 10, 2015
1 parent ceeaedc commit 82ee089
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion js/symbol/check_max_angle.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = checkMaxAngle;
* Labels placed around really sharp angles aren't readable. Check if any
* part of the potential label has a combined angle that is too big.
*
* @param {Point[]} line
* @param {Array<Point>} line
* @param {Anchor} anchor The point on the line around which the label is anchored.
* @param {number} labelLength The length of the label in geometry units.
* @param {number} windowSize The check fails if the combined angles within a part of the line that is `windowSize` long is too big.
Expand Down
4 changes: 2 additions & 2 deletions js/symbol/clip_line.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ module.exports = clipLine;
/**
* Returns the part of a multiline that intersects with the provided rectangular box.
*
* @param {Point[][]} lines
* @param {Array<Array<Point>>} lines
* @param {number} x1 the left edge of the box
* @param {number} y1 the top edge of the box
* @param {number} x2 the right edge of the box
* @param {number} y2 the bottom edge of the box
* @returns {Point[][]} lines
* @returns {Array<Array<Point>>} lines
* @private
*/
function clipLine(lines, x1, y1, x2, y2) {
Expand Down
4 changes: 2 additions & 2 deletions js/symbol/collision_feature.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = CollisionFeature;
* objects.
*
* @class CollisionFeature
* @param {Point[]} line The geometry the label is placed on.
* @param {Array<Point>} line The geometry the label is placed on.
* @param {Anchor} anchor The point along the line around which the label is anchored.
* @param {Object} shaped The text or icon shaping results.
* @param {number} boxScale A magic number used to convert from glyph metrics units to geometry units.
Expand Down Expand Up @@ -50,7 +50,7 @@ function CollisionFeature(line, anchor, shaped, boxScale, padding, alignLine) {
/**
* Create a set of CollisionBox objects for a line.
*
* @param {Point[]} line
* @param {Array<Point>} line
* @param {Anchor} anchor
* @param {number} labelLength The length of the label in geometry units.
* @param {number} boxSize The size of the collision boxes that will be created.
Expand Down
14 changes: 7 additions & 7 deletions js/symbol/quads.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ function SymbolQuad(anchorPoint, tl, tr, bl, br, tex, angle, minScale, maxScale)
* @param {Anchor} anchor
* @param {PositionedIcon} shapedIcon
* @param {number} boxScale A magic number for converting glyph metric units to geometry units.
* @param {Point[][]} line
* @param {Array<Array<Point>>} line
* @param {LayoutProperties} layout
* @param {boolean} alongLine Whether the icon should be placed along the line.
* @returns {SymbolQuad[]}
* @returns {Array<SymbolQuad>}
* @private
*/
function getIconQuads(anchor, shapedIcon, boxScale, line, layout, alongLine) {
Expand Down Expand Up @@ -91,10 +91,10 @@ function getIconQuads(anchor, shapedIcon, boxScale, line, layout, alongLine) {
* @param {Anchor} anchor
* @param {Shaping} shaping
* @param {number} boxScale A magic number for converting from glyph metric units to geometry units.
* @param {Point[][]} line
* @param {Array<Array<Point>>} line
* @param {LayoutProperties} layout
* @param {boolean} alongLine Whether the label should be placed along the line.
* @returns {SymbolQuad[]}
* @returns {Array<SymbolQuad>}
* @private
*/
function getGlyphQuads(anchor, shaping, boxScale, line, layout, alongLine) {
Expand Down Expand Up @@ -181,14 +181,14 @@ function getGlyphQuads(anchor, shaping, boxScale, line, layout, alongLine) {
* This creates all the instances of a glyph that are necessary to render a label.
*
* We need a
* @param {Object[]} glyphInstances An empty array that glyphInstances are added to.
* @param {Array<Object>} glyphInstances An empty array that glyphInstances are added to.
* @param {Anchor} anchor
* @param {number} offset The glyph's offset from the center of the label.
* @param {Point[]} line
* @param {Array<Point>} line
* @param {number} segment The index of the segment of the line on which the anchor exists.
* @param {boolean} forward If true get the glyphs that come later on the line, otherwise get the glyphs that come earlier.
*
* @returns {Object[]} glyphInstances
* @returns {Array<Object>} glyphInstances
* @private
*/
function getSegmentGlyphs(glyphs, anchor, offset, line, segment, forward) {
Expand Down

0 comments on commit 82ee089

Please sign in to comment.