diff options
author | Jakob Odersky <jodersky@gmail.com> | 2014-05-10 18:31:53 +0200 |
---|---|---|
committer | Jakob Odersky <jodersky@gmail.com> | 2014-05-10 18:34:52 +0200 |
commit | 6d22aef60227e4cb4129d0c40521cb9464e44d69 (patch) | |
tree | 38e98b7497bdb968f1dd4e46f7a6b67413f9baa8 | |
parent | ddba3742edbbb85c9d1654ac23b44d8f1f8872ec (diff) | |
download | playGraph-6d22aef60227e4cb4129d0c40521cb9464e44d69.tar.gz playGraph-6d22aef60227e4cb4129d0c40521cb9464e44d69.tar.bz2 playGraph-6d22aef60227e4cb4129d0c40521cb9464e44d69.zip |
add dummy points
-rw-r--r-- | app/data.json | 60 | ||||
-rw-r--r-- | app/index.html | 15 | ||||
-rw-r--r-- | app/js/app.js | 77 | ||||
-rw-r--r-- | app/js/controllers.js | 12 |
4 files changed, 160 insertions, 4 deletions
diff --git a/app/data.json b/app/data.json new file mode 100644 index 0000000..ea4e559 --- /dev/null +++ b/app/data.json @@ -0,0 +1,60 @@ +{ + "points": [ + { + "x": 10, + "y": 20 + }, + { + "x": 30, + "y": 30 + }, + { + "x": 50, + "y": 25 + }, + { + "x": 60, + "y": 200 + }, + { + "x": 90, + "y": 230 + }, + { + "x": 400, + "y": 300 + }, + { + "x": 100, + "y": 220 + }, + { + "x": 200, + "y": 20 + }, + { + "x": 150, + "y": 450 + }, + { + "x": 70, + "y": 80 + }, + { + "x": 400, + "y": 80 + } + { + "x": 420, + "y": 40 + } + { + "x": 390, + "y": 65 + } + { + "x": 440, + "y": 120 + } + ] +}
\ No newline at end of file diff --git a/app/index.html b/app/index.html index d41493e..ed08ff2 100644 --- a/app/index.html +++ b/app/index.html @@ -10,6 +10,21 @@ </head> <body ng-app="playGraph" ng-controller="pointCtrl"> + <svg id="world" width="500" height="500"> + <circle data-ng-repeat="point in points" cx="{{point.x}}" cy="{{point.y}}" r="10" stroke="gray" stroke-width="2" fill="white"></circle> + </svg> + + <script> + /* + $(document).onload(function() { + var svg = $('#world').svg('get'); + $('circle', svg.root()).click(function () { + attr('cx', '300'); + }); + }); + */ + </script + <p>Nothing here {{text}}</p> </body> </html> diff --git a/app/js/app.js b/app/js/app.js index a98a0c3..f8666c0 100644 --- a/app/js/app.js +++ b/app/js/app.js @@ -7,3 +7,80 @@ var Point = function(x,y){ this.y = y; }; +var dummyPoints= [ + { + x: 10, + y: 20 + }, + { + x: 30, + y: 30 + }, + { + x: 50, + y: 25 + }, + { + x: 60, + y: 200 + }, + { + x: 90, + y: 230 + }, + { + x: 400, + y: 300 + }, + { + x: 100, + y: 220 + }, + { + x: 200, + y: 20 + }, + { + x: 150, + y: 450 + }, + { + x: 70, + y: 80 + }, + { + x: 400, + y: 80 + }, + { + x: 430, + y: 90 + }, + { + x: 420, + y: 65 + }, + { + x: 380, + y: 320 + }, + { + x: 490, + y: 340 + }, + { + x: 400, + y: 400 + }, + { + x: 480, + y: 360 + }, + { + x: 420, + y: 490 + } + + ] + + diff --git a/app/js/controllers.js b/app/js/controllers.js index 56e22df..4b87295 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -3,7 +3,11 @@ /* Controllers */ var p = new Point(1,2); -app.controller('pointCtrl', function($scope){ - $scope.song= [ - ]; -}); +app.controller('pointCtrl', ['$scope', '$http', function($scope, $http){ + $scope.points=dummyPoints; + + /*$http.get('data.json').then( function (response) { + console.log(response.data.points); + $scope.points=JSON.parse(response.data.points); + });*/ +}]); |