5 var cell_svg = d3.select("#cell-canvas")
7 .attr("class", "cell-drawing")
11 $(document).bind('deck.change', function(event, from, to) {
12 var target = $.deck('getSlide', to);
13 var slide_id = target.attr('id');
15 case "cell-animation-begin":
16 cell_animation_reset();
17 cell_animation_begin(cell_svg, 250, 200);
19 case "cell-animation-factory":
20 cell_animation_factory(cell_svg, 250, 200);
22 case "bacteria-animation-begin":
23 bacteria_animation_begin();
25 case "bacteria-animation-grow":
26 bacteria_animation_grow();
28 case "background-dna":
29 $("#dna-canvas").html("<img src='dna_backbone.svg'>");
31 case "background-dna-single":
32 $("#dna-canvas").html("<img src='dna_single_strand.svg'>");
34 case "background-dna-double":
35 $("#dna-canvas").html("<img src='dna_double_strand.svg'>");
37 case "antismash-find-orfs":
38 $("#orf-canvas").html("<img src='sequence_unannotated.svg'>");
40 case "antismash-find-orfs-start":
41 $("#orf-canvas").html("<img src='sequence_start_codons.svg'>");
43 case "antismash-find-orfs-stop":
44 $("#orf-canvas").html("<img src='sequence_stop_codons.svg'>");
46 case "antismash-find-orfs-all":
47 $("#orf-canvas").html("<img src='sequence_annotated.svg'>");
50 $("#svm-canvas").html("<img src='classification-untrained.png' height='500'>");
52 case "antismash-svm-trained":
53 $("#svm-canvas").html("<img src='classification.png' height='500'>");
55 case "antismash-svm-new":
56 $("#svm-canvas").html("<img src='classification-new.png' height='500'>");
62 /************* Cell == Factory ******************/
63 function cell_animation_begin(container, x, y) {
64 var cell = container.append("svg:rect")
70 .attr("class", "cell")
71 //draw_cilium(container, x+300, y+(120/2));
74 function cell_animation_reset() {
75 d3.selectAll(".factory-window").remove();
76 d3.selectAll(".chimney").remove();
77 d3.select(".cilium").remove();
78 d3.select(".cell").remove();
81 function cell_animation_factory(container, x, y) {
82 var chimney = container.append("svg:rect")
87 .attr("class", "chimney");
89 draw_window(container, x+50, y);
90 draw_window(container, x+120, y);
93 function draw_window(container, x, y) {
94 var window1 = container.append("svg:path")
95 .attr("class", "factory-window")
96 .attr("d", "M " + x + " " + y + " l 60 -60 v 60 z");
99 function draw_cilium(container, x, y) {
100 var cilium = container.append("svg:path")
101 .attr("class", "cilium")
102 .attr("d", "M " + x +" " + y + " a 60 100 0 0 1 100 0 a 45 90 0 0 0 75 0 a 40 100 0 0 1 50 0");
105 /************************* Bacterial Growth ***********************/
107 function bacteria_animation_begin() {
108 $("#bacteria-canvas").html("<img src='starter_culture.svg' height='500'>");
111 function bacteria_animation_grow() {
112 $("#bacteria-canvas").html("<img src='grown_culture.svg' height='500'>");