mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-29 03:18:12 +08:00
hook up parallel coords to real data
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import _ from "lodash";
|
||||
|
||||
const paddingRight = 120;
|
||||
|
||||
export const margin = {top: 66, right: 110, bottom: 20, left: 60};
|
||||
@@ -7,9 +9,6 @@ export const innerHeight = height - 2;
|
||||
|
||||
export const devicePixelRatio = window.devicePixelRatio || 1;
|
||||
|
||||
export const color = d3.scaleOrdinal()
|
||||
.range(["#5DA5B3","#D58323","#DD6CA7","#54AF52","#8C92E8","#E15E5A","#725D82","#776327","#50AB84","#954D56","#AB9C27","#517C3F","#9D5130","#357468","#5E9ACF","#C47DCB","#7D9E33","#DB7F85","#BA89AD","#4C6C86","#B59248","#D8597D","#944F7E","#D67D4B","#8F86C2"]);
|
||||
|
||||
export const types = {
|
||||
"Number": {
|
||||
key: "Number",
|
||||
@@ -34,6 +33,20 @@ export const types = {
|
||||
}
|
||||
};
|
||||
|
||||
export const createDimensions = (data) => {
|
||||
const newArr = []
|
||||
_.each(data, (value, key) => {
|
||||
if (value.range) {
|
||||
newArr.push({
|
||||
key: key, /* room for confusion: lodash calls this key, it's also the name of the property parallel coords code is looking for */
|
||||
type: types["Number"],
|
||||
scale: d3.scaleSqrt().range([innerHeight, 0])
|
||||
})
|
||||
}
|
||||
})
|
||||
return newArr;
|
||||
}
|
||||
|
||||
export const dimensions = [
|
||||
{
|
||||
key: "Total_reads",
|
||||
|
||||
Reference in New Issue
Block a user