Rostlab / JS16_ProjectF

In this project we will build a web portal for our GoT data analysis and visualization system. The website will integrate all the apps created in projects B-D with the help of the integration team assigned to Project E.
GNU General Public License v3.0
10 stars 8 forks source link

Only one Twitter Graph on Homepage gets resized #445

Closed marcusnovotny closed 8 years ago

marcusnovotny commented 8 years ago

Only the right graph gets resized, the left one is simply overshadowed.

The function d3.select(window).on('resize', function(){ . . . }); has to resize both charts

Extreme example: resize error

yashha commented 8 years ago
var chart1 = new characterChart(d3.select("#chart1"), "/d4/csv/" + name1 + ".csv"); /*eslint no-undef:0*/
d3.select(window).on('resize', chart1.resize);/*eslint no-undef:0*/
var chart2 = new characterChart(d3.select("#chart2"), "/d4/csv/" + name2 + ".csv"); /*eslint no-undef:0*/
d3.select(window).on('resize', chart2.resize);/*eslint no-undef:0*/
marcusnovotny commented 8 years ago

That won't work because you can only specify one dom event handler per event. Make it

d3.select(window).on('resize', function(){ chart1.resize; chart2.resize;}

yashha commented 8 years ago

Thanks, I'll try it! :)

marcusnovotny commented 8 years ago

Tell me if it's not working, I had it running once already :smile: