ethstats-server/public/js/script.js

57 lines
2.1 KiB
JavaScript
Raw Normal View History

2015-01-20 19:29:31 +01:00
(function() {
2015-02-05 09:27:12 +01:00
$('body').on('mouseenter', '[data-toggle="tooltip"]', function( event ) {
$(this).tooltip('show');
}).on('mouseleave', '[data-toggle="tooltip"]', function( event ) {
$(this).tooltip('hide');
2015-02-18 09:57:45 +01:00
});
2015-03-27 17:52:42 +01:00
$.fn.sparkline.defaults.bar.height = 50;
$.fn.sparkline.defaults.bar.barWidth = 6;
$.fn.sparkline.defaults.bar.barSpacing = 2;
$.fn.sparkline.defaults.bar.tooltipClassname = 'jqstooltip';
$.fn.sparkline.defaults.bar.tooltipOffsetX = 0;
2015-04-17 02:12:15 +02:00
$.fn.sparkline.defaults.bar.tooltipFormat = $.spformat('<div class="tooltip-arrow"></div><div class="tooltip-inner">{{prefix}}{{value}}{{suffix}}</div>');
2015-03-27 17:52:42 +01:00
$.fn.sparkline.defaults.bar.colorMap = $.range_map({
2015-04-06 13:02:52 +02:00
'0:5': '#10a0de',
'6:12': '#7bcc3a',
'13:19': '#FFD162',
'20:29': '#ff8a00',
2015-03-27 17:52:42 +01:00
'30:': '#F74B4B'
});
moment.relativeTimeThreshold('s', 60);
2015-04-23 15:17:31 +02:00
moment.relativeTimeThreshold('m', 60);
moment.relativeTimeThreshold('h', 24);
moment.relativeTimeThreshold('d', 28);
moment.relativeTimeThreshold('M', 12);
// var bar = svg.insert("g", ".axis")
// .attr("class", "bar")
// .selectAll("g")
// .data(histogram)
// .enter().append("g")
// .attr("transform", function(d) { return "translate(" + x(d.x) + ",0)"; });
// bar.append("rect")
// .attr("class", "b")
// .attr("x", 1)
// .attr("y", function(d) { return y(d.b); })
// .attr("width", x(histogram[0].dx) - 1)
// .attr("height", function(d) { return height - y(d.b); });
// bar.append("rect")
// .attr("class", "a")
// .attr("x", 1)
// .attr("y", function(d) { return y(d.y); })
// .attr("width", x(histogram[0].dx) - 1)
// .attr("height", function(d) { return height - y(d.a); });
// bar.filter(function(d) { return d.y / n >= .0095; }).append("text")
// .attr("dy", ".015em")
// .attr("transform", function(d) { return "translate(" + x(histogram[0].dx) / 2 + "," + (y(1000) + 6) + ")rotate(-90)"; })
// // .attr("transform", function(d) { return "translate(" + x(histogram[0].dx) / 2 + "," + (y(d.y) + 6) + ")rotate(-90)"; })
// .text(function(d) { return formatPercent(d.y / n); });
// });
2015-01-20 19:29:31 +01:00
})();