Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
e7f34808
Commit
e7f34808
authored
Nov 13, 2017
by
Alexander Zobnin
Committed by
Torkel Ödegaard
Nov 13, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
heatmap: fix tooltip in "Time series bucket" mode, #9332 (#9867)
parent
ecbe7d06
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
10 deletions
+20
-10
public/app/plugins/panel/heatmap/heatmap_data_converter.ts
+10
-1
public/app/plugins/panel/heatmap/heatmap_tooltip.ts
+3
-2
public/app/plugins/panel/heatmap/specs/heatmap_data_converter.jest.ts
+7
-7
No files found.
public/app/plugins/panel/heatmap/heatmap_data_converter.ts
View file @
e7f34808
...
...
@@ -35,7 +35,16 @@ function elasticHistogramToHeatmap(seriesList) {
bucket
=
heatmap
[
time
]
=
{
x
:
time
,
buckets
:
{}};
}
bucket
.
buckets
[
bound
]
=
{
y
:
bound
,
count
:
count
,
values
:
[],
points
:
[]};
bucket
.
buckets
[
bound
]
=
{
y
:
bound
,
count
:
count
,
bounds
:
{
top
:
null
,
bottom
:
bound
},
values
:
[],
points
:
[]
};
}
}
...
...
public/app/plugins/panel/heatmap/heatmap_tooltip.ts
View file @
e7f34808
...
...
@@ -83,7 +83,7 @@ export class HeatmapTooltip {
let
xData
=
data
.
buckets
[
xBucketIndex
];
// Search in special 'zero' bucket also
let
yData
=
_
.
find
(
xData
.
buckets
,
(
bucket
,
bucketIndex
)
=>
{
return
bucket
.
bounds
.
bottom
===
yBucketIndex
||
bucketIndex
===
yBucketIndex
;
return
bucket
.
bounds
.
bottom
===
yBucketIndex
||
bucketIndex
===
yBucketIndex
.
toString
()
;
});
let
tooltipTimeFormat
=
'YYYY-MM-DD HH:mm:ss'
;
...
...
@@ -168,7 +168,8 @@ export class HeatmapTooltip {
let
yBucketSize
=
this
.
scope
.
ctrl
.
data
.
yBucketSize
;
let
{
min
,
max
,
ticks
}
=
this
.
scope
.
ctrl
.
data
.
yAxis
;
let
histogramData
=
_
.
map
(
xBucket
.
buckets
,
bucket
=>
{
return
[
bucket
.
bounds
.
bottom
,
bucket
.
values
.
length
];
let
count
=
bucket
.
count
!==
undefined
?
bucket
.
count
:
bucket
.
values
.
length
;
return
[
bucket
.
bounds
.
bottom
,
count
];
});
histogramData
=
_
.
filter
(
histogramData
,
d
=>
{
return
d
[
0
]
>=
min
&&
d
[
0
]
<=
max
;
...
...
public/app/plugins/panel/heatmap/specs/heatmap_data_converter.jest.ts
View file @
e7f34808
...
...
@@ -222,23 +222,23 @@ describe('ES Histogram converter', () => {
'1422774000000'
:
{
x
:
1422774000000
,
buckets
:
{
'1'
:
{
y
:
1
,
count
:
1
,
values
:
[],
points
:
[]
},
'2'
:
{
y
:
2
,
count
:
5
,
values
:
[],
points
:
[]
},
'3'
:
{
y
:
3
,
count
:
0
,
values
:
[],
points
:
[]
}
'1'
:
{
y
:
1
,
count
:
1
,
values
:
[],
points
:
[]
,
bounds
:
{
bottom
:
1
,
top
:
null
}
},
'2'
:
{
y
:
2
,
count
:
5
,
values
:
[],
points
:
[]
,
bounds
:
{
bottom
:
2
,
top
:
null
}
},
'3'
:
{
y
:
3
,
count
:
0
,
values
:
[],
points
:
[]
,
bounds
:
{
bottom
:
3
,
top
:
null
}
}
}
},
'1422774060000'
:
{
x
:
1422774060000
,
buckets
:
{
'1'
:
{
y
:
1
,
count
:
0
,
values
:
[],
points
:
[]
},
'2'
:
{
y
:
2
,
count
:
3
,
values
:
[],
points
:
[]
},
'3'
:
{
y
:
3
,
count
:
1
,
values
:
[],
points
:
[]
}
'1'
:
{
y
:
1
,
count
:
0
,
values
:
[],
points
:
[]
,
bounds
:
{
bottom
:
1
,
top
:
null
}
},
'2'
:
{
y
:
2
,
count
:
3
,
values
:
[],
points
:
[]
,
bounds
:
{
bottom
:
2
,
top
:
null
}
},
'3'
:
{
y
:
3
,
count
:
1
,
values
:
[],
points
:
[]
,
bounds
:
{
bottom
:
3
,
top
:
null
}
}
}
},
};
let
heatmap
=
elasticHistogramToHeatmap
(
ctx
.
series
);
expect
(
heatmap
).
to
MatchObject
(
expectedHeatmap
);
expect
(
heatmap
).
to
Equal
(
expectedHeatmap
);
});
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment