Skip to content

Commit 4d7cc91

Browse files
committed
gene plots have individual x and y axes. closes #37.
1 parent a266ee0 commit 4d7cc91

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

app/pods/components/gene-plots/component.js

+31
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export default Ember.Component.extend({
1616
attributeBindings: ['width', 'height'],
1717

1818
tick: 100,
19+
yticks: 5,
1920

2021
// if false, use first data element as a combined view
2122
addCombined: true,
@@ -226,6 +227,17 @@ export default Ember.Component.extend({
226227
.tickValues(ticks)
227228
.tickFormat(t => oneIndex(a2r[t]));
228229

230+
var xAxis_blank = d3.svg.axis()
231+
.scale(x)
232+
.orient("bottom")
233+
.ticks(0)
234+
.tickFormat('');
235+
236+
var yAxis = d3.svg.axis()
237+
.scale(y)
238+
.orient("right")
239+
.ticks(this.get('yticks'));
240+
229241
var focus_plots = [];
230242
var area_objects = [];
231243

@@ -260,6 +272,25 @@ export default Ember.Component.extend({
260272
.attr("class", "_pos_dS")
261273
.attr("clip-path", "url(" + url + "#clip)")
262274
.attr("d", local_areas[0]);
275+
276+
// blank x axis
277+
plot_svg.append("g")
278+
.attr("class", "pos x axis")
279+
.attr("transform", "translate(0," + height_each + ")")
280+
.call(xAxis_blank);
281+
282+
// yaxis
283+
plot_svg.append("g")
284+
.attr("class", "pos y axis")
285+
.attr("transform", "translate(" + width + " ,0)")
286+
.call(yAxis);
287+
// .append("text")
288+
// .attr("transform", "translate(0,0)")
289+
// .attr("dy", "-.4em")
290+
// .attr("dx", ".25em")
291+
// .style("text-anchor", "start")
292+
// .text("Site");
293+
263294
if (two_d) {
264295
plot_svg.append("path")
265296
.datum(data2[plot_id])

0 commit comments

Comments
 (0)