Skip to content

Commit

Permalink
allow local testing
Browse files Browse the repository at this point in the history
  • Loading branch information
jwildfire committed Jan 30, 2018
1 parent 7fddef8 commit 46394e9
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,14 @@ <h1>Webcharts Visual Tests</h1>

}

function initTestSuite(version){
var root = "https://rawgit.com/RhoInc/Webcharts/"+version+"/test";
var rendererPath = "https://rawgit.com/RhoInc/Webcharts/"+version+"/build/webcharts.js";
function initTestSuite(version,path){
//attempt to load from a relative path if one is given (allows for local testing)
var location = version.slice(0,3)=="../" ? version : path+version
var root = location+"/test";
var rendererPath = location+"/build/webcharts.js";

var link = document.createElement("link");
link.href ="https://rawgit.com/RhoInc/Webcharts/"+version+"/css/webcharts.css"
link.href =location+"/css/webcharts.css"
link.type = "text/css";
link.rel = "stylesheet";
document.getElementsByTagName("head")[0].appendChild(link);
Expand Down Expand Up @@ -227,7 +229,7 @@ <h1>Webcharts Visual Tests</h1>
d3.selectAll(".charts *").remove()
d3.selectAll(".controls *").remove()
var version = webchartsVersion.node().value
initTestSuite(version)
initTestSuite(version,"https://rawgit.com/RhoInc/Webcharts/")
})


Expand Down

0 comments on commit 46394e9

Please sign in to comment.