1.0?#19
Conversation
- using hexbin.context([context]), hexbin.hexagon() and hexbin.mesh() support canvas ; fixes #1 - incremental updates: bins.add(point); bins.addAll(points); remove(point); bins.removeAll(points); fixes #3 - hexbin.angle([angle]) sets or reads an angle (default 0°, use 90° for flat-topped hexagons) ; fixes #8
…ifferent order) note: I made it be a setter, which sort of duplicates hexbin(data)
- remove .data(), instead use bins.flat() to get the data, and hexbin() to update without adding points. - don't rebin aggressively when changing parameters, only on update ie when calling hexbin() - all the new methods are on hexbin not on bins
Including a bit more centers solves the issue. The solution breaks a test on centers() in the angle=0 case, which we could keep backwards compatible by testing for angle===0; but I don't think it's a problem if we have a few more centers (better safe than sorry).
|
i've updated https://observablehq.com/@fil/d3-hexbin-playground to use the new code. |
|
@mbostock can we go with this? It would make a nice 1.0 version |
|
Here is another use case for the |
|
@Fil any update on this? |
|
Wow I forgot about this. It's only been 4½ years! I might have to review the code a bit. Have you tried it? |
| @@ -9,7 +9,7 @@ Hexagonal binning is useful for aggregating data into a coarser representation f | |||
| If you use NPM, `npm install d3-hexbin`. Otherwise, download the [latest release](https://github.com/d3/d3-hexbin/releases/latest). You can also load directly from [d3js.org](https://d3js.org), either as a [standalone library](https://d3js.org/d3-hexbin.v0.2.min.js). AMD, CommonJS, and vanilla environments are supported. In vanilla, a `d3_hexbin` global is exported: | |||
There was a problem hiding this comment.
| If you use NPM, `npm install d3-hexbin`. Otherwise, download the [latest release](https://github.com/d3/d3-hexbin/releases/latest). You can also load directly from [d3js.org](https://d3js.org), either as a [standalone library](https://d3js.org/d3-hexbin.v0.2.min.js). AMD, CommonJS, and vanilla environments are supported. In vanilla, a `d3_hexbin` global is exported: | |
| If you use NPM, `npm install d3-hexbin`. Otherwise, download the [latest release](https://github.com/d3/d3-hexbin/releases/latest). You can also load directly from [d3js.org](https://d3js.org), either as a [standalone library](https://d3js.org/d3-hexbin.v1.min.js). AMD, CommonJS, and vanilla environments are supported. In vanilla, a `d3_hexbin` global is exported: |
(I think we'll want to update the distribution pattern.)
|
Less than 5 years ago should still be OK, right? 😉 |
Alternative to #17 ; in this version, changing accessors does not result in the (awkward) rebinning of already-present points.
Closes #1 #3 #5 #8 #18.