@cryptotaxi247 / netdata-1 / commits / 31e9da37d

more d3pie optimizations

Costa Tsaousis (ktsaou) committed Feb 1, 2018 at 22:31 UTC 31e9da37dc5606ce144d158a89ca27441b06b317
3 files changed +13 -10
web/Makefile.am
+1 -1
@@ -47,7 +47,7 @@ dist_weblib_DATA = \
47 lib/clipboard-polyfill-be05dad.js \
48 lib/c3-0.4.18.min.js \
49 lib/d3-4.12.2.min.js \
50 - lib/d3pie-0.2.1-netdata-1.js \
50 + lib/d3pie-0.2.1-netdata-2.js \
51 lib/dygraph-combined-dd74404.js \
52 lib/dygraph-smooth-plotter-dd74404.js \
53 lib/fontawesome-all-5.0.1.min.js \
web/dashboard.js
+12 -9
@@ -243,7 +243,7 @@ var NETDATA = window.NETDATA || {};
243 NETDATA.raphael_js = NETDATA.serverStatic + 'lib/raphael-2.2.4-min.js';
244 NETDATA.c3_js = NETDATA.serverStatic + 'lib/c3-0.4.18.min.js';
245 NETDATA.c3_css = NETDATA.serverStatic + 'css/c3-0.4.18.min.css';
246 - NETDATA.d3pie_js = NETDATA.serverStatic + 'lib/d3pie-0.2.1-netdata-1.js';
246 + NETDATA.d3pie_js = NETDATA.serverStatic + 'lib/d3pie-0.2.1-netdata-2.js';
247 NETDATA.d3_js = NETDATA.serverStatic + 'lib/d3-4.12.2.min.js';
248 NETDATA.morris_js = NETDATA.serverStatic + 'lib/morris-0.5.1.min.js';
249 NETDATA.morris_css = NETDATA.serverStatic + 'css/morris-0.5.1.css';
@@ -7370,17 +7370,20 @@ var NETDATA = window.NETDATA || {};
7370 };
7371
7372 NETDATA.d3pieChange = function(state, content, footer) {
7373 - state.d3pie_options.data.content = content;
7374 -
7375 - if(state.d3pie_forced_subtitle === null)
7376 - state.d3pie_options.header.subtitle.text = state.units_current;
7373 + if(state.d3pie_forced_subtitle === null) {
7374 + //state.d3pie_instance.updateProp("header.subtitle.text", state.units_current);
7375 + state.d3pie_instance.options.header.subtitle.text = state.units_current;
7376 + }
7377
7378 - if(state.d3pie_forced_footer === null)
7379 - state.d3pie_options.footer.text = footer;
7378 + if(state.d3pie_forced_footer === null) {
7379 + //state.d3pie_instance.updateProp("footer.text", footer);
7380 + state.d3pie_instance.options.footer.text = footer;
7381 + }
7382
7383 + //state.d3pie_instance.updateProp("data.content", content);
7384 + state.d3pie_instance.options.data.content = content;
7385 state.d3pie_instance.destroy();
7382 - state.d3pie_instance = new d3pie(state.element_chart, state.d3pie_options);
7383 -
7386 + state.d3pie_instance.recreate();
7387 return true;
7388 };
7389
web/lib/d3pie-0.2.1-netdata-2.js renamed