I have been trying to include static HTML+JavaScript inside the Meteor / Telescope (telesc.pe) application, and have not been able to get things working with Blaze.
To create a simpler case than my original, I have tried inserting a simple HTML + javascript code block (very basic D3.js visualization that creates a circle) in via Meteor which is below. This HTML block is stored inside a collection in MongoDB and accessed using the template below
<script type="text/javascript" src="http://mpld3.github.io/js/mpld3.v0.2.js"></script>
<h1>Circle</h1>
<div id="viz"></div>
<h1>/Circle</h1>
<script type="text/javascript">
var sampleSVG = d3.select("#viz")
.append("svg")
.attr("width", 100)
.attr("height", 100);
sampleSVG.append("circle")
.style("stroke", "gray")
.style("fill", "white")
.attr("r", 40)
.attr("cx", 50)
.attr("cy", 50)
.on("mouseover", function(){d3.select(this).style("fill", "aliceblue");})
.on("mouseout", function(){d3.select(this).style("fill", "white");});
</script>
I've been including it in Meteor as an unescaped tag. e.g.
<template name="post_body">
{{{ htmlBody }}}
</template>
The HTML inside the snippet above renders correctly (the text Circle and /Circle), but it does not appear to try to load any of the javascript elements that I have included.
I am completely aware that this is not an optimal way to load a visualization into a Meteor app, but will most likely need to do it this way as the (more complicated) visualizations I'm using are generated statically using an external app.
Any help on how to get this working would be much appreciated!