Skip to content

Commit

Permalink
setup standardjs + split colors in a file
Browse files Browse the repository at this point in the history
  • Loading branch information
nicgirault committed Mar 10, 2017
1 parent 5a7e4a9 commit d186577
Show file tree
Hide file tree
Showing 35 changed files with 12,726 additions and 12,697 deletions.
6 changes: 0 additions & 6 deletions .eslintrc

This file was deleted.

80 changes: 40 additions & 40 deletions demo/chords/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,84 +10,84 @@ var gieStainColor = {
gneg: 'rgb(255,255,255)',
acen: 'rgb(217,47,39)',
stalk: 'rgb(100,127,164)',
select: 'rgb(135,177,255)',
};
select: 'rgb(135,177,255)'
}

var drawCircos = function(error, GRCh37, cytobands, data) {
var drawCircos = function (error, GRCh37, cytobands, data) {
var circos = new Circos({
container: '#chart',
width: 1000,
height: 1050,
});
height: 1050
})

cytobands = cytobands.map(function(d) {
cytobands = cytobands.map(function (d) {
return {
block_id: d.chrom,
start: parseInt(d.chromStart),
end: parseInt(d.chromEnd),
gieStain: d.gieStain,
name: d.name,
};
});
name: d.name
}
})

data = data.map(function(d) {
data = data.map(function (d) {
return {
source: {
id: d.source_id,
start: parseInt(d.source_breakpoint) - 2000000,
end: parseInt(d.source_breakpoint) + 2000000,
end: parseInt(d.source_breakpoint) + 2000000
},
target: {
id: d.target_id,
start: parseInt(d.target_breakpoint) - 2000000,
end: parseInt(d.target_breakpoint) + 2000000,
},
};
});
end: parseInt(d.target_breakpoint) + 2000000
}
}
})

circos
.layout(
GRCh37,
{
innerRadius: 400,
outerRadius: 440,
labels: {
radialOffset: 70,
},
ticks: {
display: true,
labelDenominator: 1000000,
},
{
innerRadius: 400,
outerRadius: 440,
labels: {
radialOffset: 70
},
ticks: {
display: true,
labelDenominator: 1000000
}
}
)
.highlight('cytobands', cytobands, {
innerRadius: 400,
outerRadius: 440,
opacity: 0.3,
color: function(d) {
return gieStainColor[d.gieStain];
},
tooltipContent: function(d) {
return d.name;
color: function (d) {
return gieStainColor[d.gieStain]
},
tooltipContent: function (d) {
return d.name
}
})
.chords(
'l1',
data,
{
logScale: false,
opacity: 0.7,
color: '#ff5722',
tooltipContent: function(d) {
return d.source.id + ' ➤ ' + d.target.id + ': ' + d.value;
},
{
logScale: false,
opacity: 0.7,
color: '#ff5722',
tooltipContent: function (d) {
return d.source.id + ' ➤ ' + d.target.id + ': ' + d.value
}
}
)
.render();
};
.render()
}

d3.queue()
.defer(d3.json, '../data/GRCh37.json')
.defer(d3.csv, '../data/cytobands.csv')
.defer(d3.csv, '../data/fusion-genes.csv')
.await(drawCircos);
.await(drawCircos)
Loading

0 comments on commit d186577

Please sign in to comment.