Last active
February 14, 2016 15:04
-
-
Save dogrunjp/97b622962a20ca5bce29 to your computer and use it in GitHub Desktop.
【javascript, D3.js】可変長の引数で渡されたリソースで、可変長のタスク(データの読み込み)を実行する方法。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var vchart = function(obj){ | |
var q = queue(); | |
for(var i=0; i <= arguments.length; i++){ | |
q.defer(d3.json, obj.datas[i].filepath); | |
} | |
q.await(multi_chart); | |
} | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//呼び出す側のHTML | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
<script src="http://d3js.org/queue.v1.min.js"></script> | |
<script src="http://d3_multichart.js"></script> | |
<script> | |
vchart({datas:[{"filepath":<url 1>},{"filepath": <url 2>}]}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment