// Generated by CoffeeScript 1.10.0 (function() { window.AnnotationView = Backbone.D3View.extend({ namespace: null, tagName: 'div', initialize: function() { this.d3el.attr({ "class": 'AnnotationView' }); return this.listenTo(this.model, 'change:annotations', this.render); }, render: function() { var annotations, annotations_data; annotations_data = this.model.get('annotations'); annotations = this.d3el.selectAll('.annotation').data(annotations_data); annotations.enter().append('table').attr({ "class": 'annotation' }); annotations.html(function(d) { var id, rowspan, triples; rowspan = Math.max(1, d.triples.length); triples = ''; d.triples.forEach(function(t, i) { var object; if (i > 0) { triples += ''; } object = t.object_type === 'uri' ? "" + t.object + "" : t.object; return triples += "" + t.predicate + "" + object + ""; }); id = d.id[0] === '_' ? '' : d.id; return "" + id + "" + (d.text.replace(/\n/g, '↵')) + "" + triples + ""; }); return annotations.exit().remove(); } }); }).call(this);