Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

successfully inject map d3 into target/index.html (correct branch this time!) #35

Merged
merged 19 commits into from
Jan 5, 2018
Merged
20 changes: 20 additions & 0 deletions js/test_d3.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
var w = 800;
var h = 450;
var data = [132,71,337,93,78,43,20,16,30,8,17,21];
var svg = d3.select("body").append("svg")
.attr("id", "chart")
.attr("width", w)
.attr("height", h);
svg.selectAll(".bar")
.data(data)
.enter()
.append("rect")
.attr("class", "bar")
.attr("x", 0)
.attr("y", function(d,i){
return i * 20;
})
.attr("width", function(d,i){
return d;
})
.attr("height", 19)
13 changes: 11 additions & 2 deletions viz.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -232,13 +232,22 @@ visualize:
title: "SVG skeleton"
alttext: "Beginning of the full storm SVG"
publish:
-
mimetype: application/javascript
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's this line for?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops - forgot to delete it when I deleted the d3 library load

-
id: test_d3
location: "js/test_d3.js"
mimetype: application/javascript
-
id: vizstorm_page
name: index
template: fullpage
publisher: page
depends:
lib-d3-js: lib-d3-js
js: "test_d3"
storm_figure: "svg_skeleton"
context:
resources:
sections: "storm_figure"
resources: ["lib-d3-js"]
sections: ["storm_figure", "js"]