mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-24 03:28:12 +08:00
move color rgb to own file, remove generators
This commit is contained in:
@@ -23,40 +23,3 @@
|
||||
//
|
||||
// return expressionsCountsMap;
|
||||
// }
|
||||
|
||||
|
||||
export const generatePoints = function (count) {
|
||||
return Array(count).fill().map(function () {
|
||||
return [
|
||||
Math.random() - 0.5,
|
||||
Math.random() - 0.5
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
export const generateSizes = function (count) {
|
||||
return Array(count).fill().map(function () {
|
||||
return Math.random() * 10
|
||||
})
|
||||
}
|
||||
|
||||
export const generateColors = function (count) {
|
||||
return Array(count).fill().map(function () {
|
||||
return [
|
||||
Math.random(),
|
||||
Math.random(),
|
||||
Math.random()
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
export const scaleRGB = (input) => {
|
||||
const outputMax = 1;
|
||||
const outputMin = 0;
|
||||
|
||||
const inputMax = 255;
|
||||
const inputMin = 0;
|
||||
|
||||
const percent = (input - inputMin) / (inputMax - inputMin);
|
||||
return percent * (outputMax - outputMin) + outputMin;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user