-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation improvements and cleanup #1891
Merged
+524
−242
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e33572c
fix typo
shunter f95cb5b
Document functions with callback syntax
shunter 7ce2359
Document non-method modules as `@namespace`. Turn on function signat…
shunter bee4354
Fix typo
shunter 64315f0
Document functions with callback syntax.
shunter f08f491
Use Cesium prefix.
shunter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Document functions with callback syntax
- workspaces
- pre-template-literals
- pre-prettier-v3
- pre-prettier
- pre-let-const
- post-workspaces
- post-template-literals
- post-prettier-v3
- post-prettier
- post-let-const
- cesium-workspaces
- 1.127
- 1.126
- 1.125
- 1.124
- 1.123.1
- 1.123
- 1.122
- 1.121.1
- 1.121
- 1.120
- 1.119
- 1.118.2
- 1.118.1
- 1.118
- 1.117
- 1.116
- 1.115
- 1.114
- 1.113
- 1.112
- 1.111
- 1.111-release
- 1.110.1
- 1.110
- 1.109
- 1.108
- 1.107.2
- 1.107.1
- 1.107
- 1.106.1
- 1.106
- 1.105.2
- 1.105.1
- 1.105
- 1.104
- 1.103
- 1.102
- 1.101
- 1.100
- 1.99
- 1.98.1
- 1.98
- 1.97
- 1.96
- 1.95
- 1.94.3
- 1.94.2
- 1.94.1
- 1.94
- 1.93
- 1.92
- 1.91
- 1.90
- 1.89
- 1.88
- 1.87.1
- 1.87
- 1.86.1
- 1.86
- 1.85
- 1.84
- 1.83
- 1.82
- 1.81
- 1.80
- 1.79.1
- 1.79
- 1.78
- 1.77
- 1.76
- 1.75
- 1.74
- 1.73
- 1.72
- 1.71
- 1.70.1
- 1.70
- 1.69
- 1.68
- 1.67
- 1.66
- 1.65
- 1.64
- 1.63.1
- 1.63
- 1.62
- 1.61
- 1.60
- 1.59
- 1.58.1
- 1.58
- 1.57
- 1.56.1
- 1.56
- 1.55
- 1.54
- 1.53
- 1.52
- 1.51
- 1.50
- 1.49
- 1.48
- 1.47
- 1.46
- 1.45
- 1.44
- 1.43
- 1.42.1
- 1.42
- 1.41
- 1.40
- 1.39
- 1.38
- 1.37
- 1.36
- 1.35.2
- 1.35
- 1.34
- 1.33
- 1.32
- 1.31
- 1.30
- 1.29
- 1.28
- 1.27
- 1.26
- 1.25
- 1.24
- 1.23
- 1.22.2
- 1.22.1
- 1.22
- 1.21
- 1.20
- 1.19
- 1.18
- 1.17
- 1.16
- 1.15
- 1.14
- 1.13
- 1.12
- 1.11
- 1.10
- 1.9
- 1.8
- 1.7.1
- 1.7
- 1.6
- 1.5
- 1.4
- 1.3
- 1.2
- 1.1
- 1.0
commit f95cb5b23b91c528a6966b483da6c63786872338
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,18 +60,15 @@ define([ | |
* @exports mergeSort | ||
* | ||
* @param {Array} array The array to sort. | ||
* @param {Function} comparator The function to use to compare the item to elements in the array. | ||
* If the first parameter is less than the second parameter, the function should return a | ||
* negative value. If it is greater, the function should return a positive value. If the | ||
* items are equal, it should return 0. | ||
* @param {Object} [userDefinedObject] An object to pass as the third parameter to comparator. | ||
* @param {mergeSort~Comparator} comparator The function to use to compare elements in the array. | ||
* @param {Object} [userDefinedObject] An object to pass as the third parameter to <code>comparator</code>. | ||
* | ||
* @example | ||
* // Sort an array of numbers in increasing order | ||
* var array = // Array of bounding spheres in world coordinates | ||
* // Assume array contains BoundingSpheres in world coordinates. | ||
* // Sort them in ascending order of distance from the camera. | ||
* var position = camera.positionWC; | ||
* mergeSort(array, function(a, b, position) { | ||
* return BoundingSphere.distanceSquaredTo(b.sphere, position) - BounsingSphere.distanceSquaredTo(a.sphere, position); | ||
* return BoundingSphere.distanceSquaredTo(b, position) - BoundingSphere.distanceSquaredTo(a, position); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can't quite remember, but are we supposed to be using the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed. |
||
* }, position); | ||
*/ | ||
var mergeSort = function(array, comparator, userDefinedObject) { | ||
|
@@ -98,5 +95,22 @@ define([ | |
rightScratchArray.length = 0; | ||
}; | ||
|
||
/** | ||
* A function used to compare two items while performing a merge sort. | ||
* @callback mergeSort~Comparator | ||
* | ||
* @param {Object} a An item in the array. | ||
* @param {Object} b An item in the array. | ||
* @param {Object} [userDefinedObject] An object that was passed to {@link mergeSort}. | ||
* @returns {Number} Returns a negative value if <code>a</code> is less than <code>b</code>, | ||
* a positive value if <code>a</code> is greater than <code>b</code>, or | ||
* 0 if <code>a</code> is equal to <code>b</code>. | ||
* | ||
* @example | ||
* function compareNumbers(a, b, userDefinedObject) { | ||
* return a - b; | ||
* } | ||
*/ | ||
|
||
return mergeSort; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be better to use
left
andright
here instead ofa
andb
? That's the convention we seem to use elsewhere.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left
andright
make somewhat more sense for something likeequals
, which in better languages would be defined as infix operators, e.g.left == right
. Comparison functions seem to generally be different. MDN for JavaScript usesa, b
. Java useso1, o2
. .NET usesx, y
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine by me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this ready then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah.