hook up parallel coords to real data

This commit is contained in:
Colin Megill
2017-10-23 12:49:14 -07:00
parent bbe6107f49
commit bd8912b9ec
3 changed files with 45 additions and 7 deletions
+16 -3
View File
@@ -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",