Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nens/nxt-graph

OBSOLETE: This package is embedded in threedi-server. Lizard 5 graph library using D3.js
https://github.com/nens/nxt-graph

Last synced: 4 days ago
JSON representation

OBSOLETE: This package is embedded in threedi-server. Lizard 5 graph library using D3.js

Awesome Lists containing this project

README

        

nxt-graph
==========================================

Introduction
------------

Generic javascript graph library.

Prerequisities
--------------

You must use AngularJS in order to use nxt-graph (get it from elsewhere). Also include d3, nv, nxt-graph js and css (embedded in nxt-graph) in your document::





Usage
-----

Make directives and modify the infourl from Angular. The nxt-timeseries and nxt-profile will automagically become fancy nv d3 graphs! Even more: every time when the inner url is updated, the graph will refresh itself. This way you can get realtime moving graphs!

Example::

app.controller("InfoPoint", ["$scope", function($scope) {
$scope.$on("infopoint", function(message, content) {
$scope.$apply(function() {
console.log("open box infopoint");
var lonlat = content.point;
var $layer = document.getElementsByClassName("workspace-wms-layer")[0]; // there is only one
$scope.infourl = $layer.dataset['workspaceWmsUrl'].split('/wms')[0] + '/data?' + "REQUEST=gettimeseries&LAYERS=" + content.loaded_model + "&SRS=EPSG:4326&POINT="+lonlat.lng.toString() + ',' + lonlat.lat.toString();
});
});

}]);

Timeseries
==========

Example::

The url must contain data in the format::

{"timeseries": [["2012-01-01T00:01:00", -0.946], ["2012-01-01T00:02:00", -0.946],
["2012-01-01T00:03:00", -0.946], ["2012-01-01T00:04:00", -0.946],
["2012-01-01T00:05:00", -0.946], ["2012-01-01T00:06:00", -0.946]]}

Profiles
========

Example::

The url must contain data in the format::

{"depth": [[0.0, 0.2673], [1e-05, 0.2673], [3e-05, 0.2673], [3e-05, 0.2673], [4e-05, 0.2773]],
"waterheight": [[0.0, 0.2673], [1e-05, 0.2673], [3e-05, 0.2673], [3e-05, 0.2673], [4e-05, 0.2773]],
"bathymetry": [[0.0, 0.2673], [1e-05, 0.2673], [3e-05, 0.2673], [3e-05, 0.2673], [4e-05, 0.2773]]}