Internmap doc - #186
Closed
Fil wants to merge 5 commits into
Closed
Internmap doc#186Fil wants to merge 5 commits into
Fil wants to merge 5 commits into
Conversation
Merged
mbostock
requested changes
Jan 22, 2021
| Methods for computing basic summary statistics. | ||
|
|
||
| <a name="min" href="#min">#</a> d3.<b>min</b>(<i>iterable</i>[, <i>accessor</i>]) · [Source](https://github.com/d3/d3-array/blob/master/src/min.js), [Examples](https://observablehq.com/@d3/d3-min-d3-max-d3-extent) | ||
| <a name="min" href="#min">#</a> d3.<b>min</b>(<i>iterable</i>[, <i>accessor</i>]) · [Source](https://github.com/d3/d3-array/blob/master/src/min.js), [Examples](https://observablehq.com/@d3/extent) |
Member
There was a problem hiding this comment.
Suggested change
| <a name="min" href="#min">#</a> d3.<b>min</b>(<i>iterable</i>[, <i>accessor</i>]) · [Source](https://github.com/d3/d3-array/blob/master/src/min.js), [Examples](https://observablehq.com/@d3/extent) | |
| <a name="min" href="#min">#</a> d3.<b>min</b>(<i>iterable</i>[, <i>accessor</i>]) · [Source](https://github.com/d3/d3-array/blob/master/src/min.js), [Examples](https://observablehq.com/@d3/d3-extent) |
| See also [extent](#extent). | ||
|
|
||
| <a name="minIndex" href="#minIndex">#</a> d3.<b>minIndex</b>(<i>iterable</i>[, <i>accessor</i>]) · [Source](https://github.com/d3/d3-array/blob/master/src/minIndex.js), [Examples](https://observablehq.com/@d3/d3-min-d3-max-d3-extent) | ||
| <a name="minIndex" href="#minIndex">#</a> d3.<b>minIndex</b>(<i>iterable</i>[, <i>accessor</i>]) · [Source](https://github.com/d3/d3-array/blob/master/src/minIndex.js), [Examples](https://observablehq.com/@d3/extent) |
Member
There was a problem hiding this comment.
Suggested change
| <a name="minIndex" href="#minIndex">#</a> d3.<b>minIndex</b>(<i>iterable</i>[, <i>accessor</i>]) · [Source](https://github.com/d3/d3-array/blob/master/src/minIndex.js), [Examples](https://observablehq.com/@d3/extent) | |
| <a name="minIndex" href="#minIndex">#</a> d3.<b>minIndex</b>(<i>iterable</i>[, <i>accessor</i>]) · [Source](https://github.com/d3/d3-array/blob/master/src/minIndex.js), [Examples](https://observablehq.com/@d3/d3-extent) |
| Unlike the built-in [Math.min](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Math/min), this method ignores undefined, null and NaN values; this is useful for ignoring missing data. In addition, elements are compared using natural order rather than numeric order. For example, the minimum of the strings [“20”, “3”] is “20”, while the minimum of the numbers [20, 3] is 3. | ||
|
|
||
| <a name="max" href="#max">#</a> d3.<b>max</b>(<i>iterable</i>[, <i>accessor</i>]) · [Source](https://github.com/d3/d3-array/blob/master/src/max.js), [Examples](https://observablehq.com/@d3/d3-min-d3-max-d3-extent) | ||
| <a name="max" href="#max">#</a> d3.<b>max</b>(<i>iterable</i>[, <i>accessor</i>]) · [Source](https://github.com/d3/d3-array/blob/master/src/max.js), [Examples](https://observablehq.com/@d3/extent) |
Member
There was a problem hiding this comment.
Suggested change
| <a name="max" href="#max">#</a> d3.<b>max</b>(<i>iterable</i>[, <i>accessor</i>]) · [Source](https://github.com/d3/d3-array/blob/master/src/max.js), [Examples](https://observablehq.com/@d3/extent) | |
| <a name="max" href="#max">#</a> d3.<b>max</b>(<i>iterable</i>[, <i>accessor</i>]) · [Source](https://github.com/d3/d3-array/blob/master/src/max.js), [Examples](https://observablehq.com/@d3/d3-extent) |
| See also [extent](#extent). | ||
|
|
||
| <a name="maxIndex" href="#maxIndex">#</a> d3.<b>maxIndex</b>(<i>iterable</i>[, <i>accessor</i>]) · [Source](https://github.com/d3/d3-array/blob/master/src/maxIndex.js), [Examples](https://observablehq.com/@d3/d3-min-d3-max-d3-extent) | ||
| <a name="maxIndex" href="#maxIndex">#</a> d3.<b>maxIndex</b>(<i>iterable</i>[, <i>accessor</i>]) · [Source](https://github.com/d3/d3-array/blob/master/src/maxIndex.js), [Examples](https://observablehq.com/@d3/extent) |
Member
There was a problem hiding this comment.
Suggested change
| <a name="maxIndex" href="#maxIndex">#</a> d3.<b>maxIndex</b>(<i>iterable</i>[, <i>accessor</i>]) · [Source](https://github.com/d3/d3-array/blob/master/src/maxIndex.js), [Examples](https://observablehq.com/@d3/extent) | |
| <a name="maxIndex" href="#maxIndex">#</a> d3.<b>maxIndex</b>(<i>iterable</i>[, <i>accessor</i>]) · [Source](https://github.com/d3/d3-array/blob/master/src/maxIndex.js), [Examples](https://observablehq.com/@d3/d3-extent) |
| Unlike the built-in [Math.max](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Math/max), this method ignores undefined values; this is useful for ignoring missing data. In addition, elements are compared using natural order rather than numeric order. For example, the maximum of the strings [“20”, “3”] is “3”, while the maximum of the numbers [20, 3] is 20. | ||
|
|
||
| <a name="extent" href="#extent">#</a> d3.<b>extent</b>(<i>iterable</i>[, <i>accessor</i>]) · [Source](https://github.com/d3/d3-array/blob/master/src/extent.js), [Examples](https://observablehq.com/@d3/d3-min-d3-max-d3-extent) | ||
| <a name="extent" href="#extent">#</a> d3.<b>extent</b>(<i>iterable</i>[, <i>accessor</i>]) · [Source](https://github.com/d3/d3-array/blob/master/src/extent.js), [Examples](https://observablehq.com/@d3/extent) |
Member
There was a problem hiding this comment.
Suggested change
| <a name="extent" href="#extent">#</a> d3.<b>extent</b>(<i>iterable</i>[, <i>accessor</i>]) · [Source](https://github.com/d3/d3-array/blob/master/src/extent.js), [Examples](https://observablehq.com/@d3/extent) | |
| <a name="extent" href="#extent">#</a> d3.<b>extent</b>(<i>iterable</i>[, <i>accessor</i>]) · [Source](https://github.com/d3/d3-array/blob/master/src/extent.js), [Examples](https://observablehq.com/@d3/d3-extent) |
Comment on lines
+836
to
+842
| const g = new d3.InternMap( | ||
| d3.group( | ||
| [[["foo", "bar"], 1], [["foo", "baz"], 2], [["goo", "bee"], 3]], | ||
| d => d[0] | ||
| ), | ||
| JSON.stringify | ||
| ); |
Member
There was a problem hiding this comment.
I wouldn’t recommend this approach: the interning would only apply after grouping, so any duplicate keys in the original entries would still be considered separate groups, and then the last of the duplicate groups would “win” in the returned InternMap rather than being combined. I think for simplicity’s sake we should just drop this note and example.
Member
|
I’ll merge my suggestions and land, but please followup if there’s more if you disagree! |
Member
Author
|
All good! |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add documentation