mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-01 16:18:11 +08:00
Specify histogram thresholds in fixed-length array (#1086)
* Specify histogram thresholds in fixed-length array Fixes https://github.com/chanzuckerberg/cellxgene/issues/1082 For background, see the following: * https://github.com/d3/d3-array/issues/46 * https://stackoverflow.com/questions/15880058/d3-js-ticks-function-giving-more-elements-than-needed * Oops, off by one!
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { range, rangeFill } from "../../src/util/range";
|
||||
import { range, rangeFill, linspace } from "../../src/util/range";
|
||||
|
||||
describe("range", () => {
|
||||
test("no defaults", () => {
|
||||
@@ -40,3 +40,11 @@ describe("rangefill", () => {
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("linspace", () => {
|
||||
test("linspace(arr, start, step)", () => {
|
||||
expect(linspace(0.0, 2.0, 5)).toMatchObject(
|
||||
[0.0, 0.5, 1.0, 1.5, 2.0]
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user