Skip to content

Commit

Permalink
add download SVG google analytics tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Lenail committed May 10, 2018
1 parent c357b50 commit 86e9c6d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion AlexNet.html
Original file line number Diff line number Diff line change
Expand Up @@ -758,10 +758,10 @@ <h4>Architecture:</h4>


$("#download").on("click", function() {
ga('send', 'event', 'downloadSVG', 'AlexNet');

$(this).attr("href", 'data:application/octet-stream;base64,' + btoa($('<div>').append($( $("#graph-container").html()).attr("xmlns", "http://www.w3.org/2000/svg") ).html()))
.attr("download", "nn.svg")

});


Expand Down
2 changes: 2 additions & 0 deletions LeNet.html
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,8 @@ <h4>Architecture:</h4>


d3.select("#download").on("click", function() {
ga('send', 'event', 'downloadSVG', 'LeNet');

d3.select(this)
.attr("href", 'data:application/octet-stream;base64,' + btoa(d3.select("#graph-container").html()))
.attr("download", "nn.svg")
Expand Down
2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,8 @@ <h4>Architecture:</h4>
});

d3.select("#download").on("click", function() {
ga('send', 'event', 'downloadSVG', 'FCNN');

d3.select(this)
.attr("href", 'data:application/octet-stream;base64,' + btoa(unescape(encodeURIComponent(d3.select("#graph-container").html()))))
.attr("download", "nn.svg")
Expand Down

0 comments on commit 86e9c6d

Please sign in to comment.