forked from tungstenfabric/tf-webui-third-party
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnvd3_1.1.15b_bulletChart.patch
More file actions
77 lines (70 loc) · 3.14 KB
/
Copy pathnvd3_1.1.15b_bulletChart.patch
File metadata and controls
77 lines (70 loc) · 3.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
diff -Naur old/contrail-webui-third-party/nvd3/nv.d3.js new/contrail-webui-third-party/nvd3/nv.d3.js
--- old/contrail-webui-third-party/nvd3/nv.d3.js 2014-08-06 15:02:54.000000000 -0700
+++ new/contrail-webui-third-party/nvd3/nv.d3.js 2014-08-11 16:19:35.000000000 -0700
@@ -784,6 +784,9 @@
, ranges = function(d) { return d.ranges }
, markers = function(d) { return d.markers }
, measures = function(d) { return d.measures }
+ , rangeLabels = function(d) { return d.rangeLabels ? d.rangeLabels : [] }
+ , markerLabels = function(d) { return d.markerLabels ? d.markerLabels : [] }
+ , measureLabels = function(d) { return d.measureLabels ? d.measureLabels : [] }
, forceX = [0] // List of numbers to Force into the X scale (ie. 0, or a max / min, etc.)
, width = 380
, height = 30
@@ -803,7 +806,10 @@
var rangez = ranges.call(this, d, i).slice().sort(d3.descending),
markerz = markers.call(this, d, i).slice().sort(d3.descending),
- measurez = measures.call(this, d, i).slice().sort(d3.descending);
+ measurez = measures.call(this, d, i).slice().sort(d3.descending),
+ rangeLabelz = rangeLabels.call(this, d, i).slice(),
+ markerLabelz = markerLabels.call(this, d, i).slice(),
+ measureLabelz = measureLabels.call(this, d, i).slice();
//------------------------------------------------------------
@@ -910,14 +916,14 @@
.on('mouseover', function() {
dispatch.elementMouseover({
value: measurez[0],
- label: 'Current',
+ label: measureLabelz[0] || 'Current',
pos: [x1(measurez[0]), availableHeight/2]
})
})
.on('mouseout', function() {
dispatch.elementMouseout({
value: measurez[0],
- label: 'Current'
+ label: measureLabelz[0] || 'Current'
})
})
@@ -929,14 +935,14 @@
.on('mouseover', function() {
dispatch.elementMouseover({
value: markerz[0],
- label: 'Previous',
+ label: markerLabelz[0] || 'Previous',
pos: [x1(markerz[0]), availableHeight/2]
})
})
.on('mouseout', function() {
dispatch.elementMouseout({
value: markerz[0],
- label: 'Previous'
+ label: markerLabelz[0] || 'Previous'
})
});
} else {
@@ -946,7 +952,7 @@
wrap.selectAll('.nv-range')
.on('mouseover', function(d,i) {
- var label = !i ? "Maximum" : i == 1 ? "Mean" : "Minimum";
+ var label = rangeLabelz[i] || (!i ? "Maximum" : i == 1 ? "Mean" : "Minimum");
dispatch.elementMouseover({
value: d,
@@ -955,7 +961,7 @@
})
})
.on('mouseout', function(d,i) {
- var label = !i ? "Maximum" : i == 1 ? "Mean" : "Minimum";
+ var label = rangeLabelz[i] || (!i ? "Maximum" : i == 1 ? "Mean" : "Minimum");
dispatch.elementMouseout({
value: d,