Guest User

Untitled

a guest
May 24th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. function row1(data) {
  2.  
  3. var check = false;
  4.  
  5. update(check);
  6.  
  7. function update(check) {
  8.  
  9. var team = d3.selectAll(".select1").property("value")
  10.  
  11. data.forEach(function(d, i, columns) {
  12. d.male = +(d.male);
  13. d.female = +(d.female);
  14. d["Woman" + team] = +d["Woman" + team];
  15. d["Man" + team] = +d["Man" + team];
  16. return d;
  17. })
  18.  
  19. if (check) {
  20. pyramid.update(data, team)
  21. percent.update(data, team)
  22. totals.update(data, team)
  23. } else {
  24. pyramid(data, team);
  25. percent(data, team);
  26. totals(data, team);
  27. }
  28. }
  29.  
  30. d3.selectAll(".select1").on("change", function() {
  31. check = true;
  32. durations = 750;
  33. update(check);
  34. })
  35.  
  36. }
  37.  
  38. function row1(data) {
  39.  
  40. data.forEach(function(d) {
  41. for (var key in d) {
  42. if (key !== "AgeRange") {
  43. d[key] = +d[key]
  44. }
  45. }
  46. });
  47.  
  48. pyramid(data, "_one");
  49. percent(data, "_two");
  50. totals(data, "_three");
  51.  
  52. d3.selectAll(".select1").on("change", function() {
  53. durations = 750;
  54. pyramid.update(data, this.value)
  55. percent.update(data, this.value)
  56. totals.update(data, this.value)
  57. });
  58.  
  59. }
Add Comment
Please, Sign In to add comment