summaryrefslogtreecommitdiffstats
path: root/web/gui/src/dashboard.js/charting/d3.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/gui/src/dashboard.js/charting/d3.js')
-rw-r--r--web/gui/src/dashboard.js/charting/d3.js43
1 files changed, 43 insertions, 0 deletions
diff --git a/web/gui/src/dashboard.js/charting/d3.js b/web/gui/src/dashboard.js/charting/d3.js
new file mode 100644
index 0000000..6528208
--- /dev/null
+++ b/web/gui/src/dashboard.js/charting/d3.js
@@ -0,0 +1,43 @@
+
+// ----------------------------------------------------------------------------------------------------------------
+// D3
+
+NETDATA.d3Initialize = function(callback) {
+ if (typeof netdataStopD3 === 'undefined' || !netdataStopD3) {
+ $.ajax({
+ url: NETDATA.d3_js,
+ cache: true,
+ dataType: "script",
+ xhrFields: { withCredentials: true } // required for the cookie
+ })
+ .done(function() {
+ NETDATA.registerChartLibrary('d3', NETDATA.d3_js);
+ })
+ .fail(function() {
+ NETDATA.chartLibraries.d3.enabled = false;
+ NETDATA.error(100, NETDATA.d3_js);
+ })
+ .always(function() {
+ if (typeof callback === "function")
+ return callback();
+ });
+ } else {
+ NETDATA.chartLibraries.d3.enabled = false;
+ if (typeof callback === "function")
+ return callback();
+ }
+};
+
+NETDATA.d3ChartUpdate = function(state, data) {
+ void(state);
+ void(data);
+
+ return false;
+};
+
+NETDATA.d3ChartCreate = function(state, data) {
+ void(state);
+ void(data);
+
+ return false;
+};