This is an example to demonstrate d3js JSON reader
Created
March 6, 2017 18:41
-
-
Save dimitardanailov/af83d0c0c0ea1ac245f1e2567dd13497 to your computer and use it in GitHub Desktop.
Simple JSON reader with d3js
This file contains hidden or 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
license: gpl-3.0 |
This file contains hidden or 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
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<body> | |
<script src="//d3js.org/d3.v3.min.js"></script> | |
<script> | |
d3.json('lines.json', function(data) { | |
console.log(data[0]); | |
}); | |
</script> |
This file contains hidden or 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
[ | |
{ | |
"x1": 350, | |
"y1": 15, | |
"x2": 250, | |
"y2": 33 | |
}, | |
{ | |
"x1": 420, | |
"y1": 420, | |
"x2": 250, | |
"y2": 333 | |
}, | |
{ | |
"x1": 140, | |
"y1": 120, | |
"x2": 220, | |
"y2": 220 | |
}, | |
{ | |
"x1": 180, | |
"y1": 55, | |
"x2": 330, | |
"y2": 320 | |
}, | |
{ | |
"x1": 200, | |
"y1": 260, | |
"x2": 150, | |
"y2": 180 | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment