Skip to content

Commit bcd4cf2

Browse files
committed
Use clusters instead of breaks
1 parent 7f39d36 commit bcd4cf2

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ D3 scale that clusters data into discrete groups
33

44
###Usage
55

6-
This scale largely has the same API as [d3.scaleQuantile](https://github.com/d3/d3-scale/blob/master/README.md#scaleQuantile) (however we use `breaks()` instead of `quantiles()`)
6+
This scale largely has the same API as [d3.scaleQuantile](https://github.com/d3/d3-scale/blob/master/README.md#scaleQuantile) (however we use `clusters()` instead of `quantiles()`)
77

88
```js
99
var scale = d3.scaleCluster()
1010
.domain([1, 2, 4, 5, 12, 43, 52, 123, 234, 1244])
1111
.range(['#E5D6EA', '#C798D3', '#9E58AF', '#7F3391', '#581F66', '#30003A']);
1212

13-
var breaks = scale.breaks(); // [12, 43, 123, 234, 1244]
13+
var clusters = scale.clusters(); // [12, 43, 123, 234, 1244]
1414
var color = scale(52); // '#9E58AF'
1515
var extent = scale.invertExtent('#9E58AF'); // [43, 123]
1616
```

dist/d3-scale-cluster.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

spec/ScaleSpec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ describe('Scale', function () {
99
scale = d3scaleCluster();
1010
});
1111

12-
it('should find natural breaks', function () {
12+
it('should find clusters', function () {
1313
scale
1414
.domain(DEFAULT_DOMAIN)
1515
.range(DEFAULT_RANGE);
1616

17-
var breaks = scale.breaks();
18-
expect(breaks).toEqual([12, 43, 123, 234, 1244]);
17+
var clusters = scale.clusters();
18+
expect(clusters).toEqual([12, 43, 123, 234, 1244]);
1919
expect(scale(52)).toEqual('c');
2020
});
2121

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function d3scaleCluster () {
6767
return [extentA, extentB];
6868
};
6969

70-
scale.breaks = function () {
70+
scale.clusters = function () {
7171
return breakpoints.slice(1);
7272
};
7373

0 commit comments

Comments
 (0)