mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-28 14:08:12 +08:00
more lint (#291)
* disable function-paren-newline warning * fix misc lint * lint * remove noop exponentiation
This commit is contained in:
@@ -8,11 +8,9 @@
|
||||
// myScale(0) === -1
|
||||
// this is is equivalent to d3.scaleLinear().domain([0,1]).range([-1,1])
|
||||
|
||||
export const scaleLinear = (domain, range) => {
|
||||
export default (domain, range) => {
|
||||
const domainStart = domain[0];
|
||||
const scale = (range[1] - range[0]) / (domain[1] - domain[0]);
|
||||
const rangeStart = range[0];
|
||||
return function(value) {
|
||||
return (value - domainStart) * scale + rangeStart;
|
||||
};
|
||||
return value => (value - domainStart) * scale + rangeStart;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user