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
0ba07720
Commit
0ba07720
authored
Aug 13, 2019
by
Ryan McKinley
Committed by
Torkel Ödegaard
Aug 14, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TimeSeries: assume values are all numbers (#18540)
* assume number for TimeSeries types * use const
parent
91a911b6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
packages/grafana-data/src/utils/processDataFrame.test.ts
+9
-0
packages/grafana-data/src/utils/processDataFrame.ts
+1
-0
No files found.
packages/grafana-data/src/utils/processDataFrame.test.ts
View file @
0ba07720
...
@@ -29,6 +29,15 @@ describe('toDataFrame', () => {
...
@@ -29,6 +29,15 @@ describe('toDataFrame', () => {
expect
(
series
.
fields
[
0
].
name
).
toEqual
(
'Value'
);
expect
(
series
.
fields
[
0
].
name
).
toEqual
(
'Value'
);
});
});
it
(
'assumes TimeSeries values are numbers'
,
()
=>
{
const
input1
=
{
target
:
'time'
,
datapoints
:
[[
100
,
1
],
[
200
,
2
]],
};
const
data
=
toDataFrame
(
input1
);
expect
(
data
.
fields
[
0
].
type
).
toBe
(
FieldType
.
number
);
});
it
(
'keeps dataFrame unchanged'
,
()
=>
{
it
(
'keeps dataFrame unchanged'
,
()
=>
{
const
input
=
{
const
input
=
{
fields
:
[{
text
:
'A'
},
{
text
:
'B'
},
{
text
:
'C'
}],
fields
:
[{
text
:
'A'
},
{
text
:
'B'
},
{
text
:
'C'
}],
...
...
packages/grafana-data/src/utils/processDataFrame.ts
View file @
0ba07720
...
@@ -29,6 +29,7 @@ function convertTimeSeriesToDataFrame(timeSeries: TimeSeries): DataFrame {
...
@@ -29,6 +29,7 @@ function convertTimeSeriesToDataFrame(timeSeries: TimeSeries): DataFrame {
fields
:
[
fields
:
[
{
{
name
:
timeSeries
.
target
||
'Value'
,
name
:
timeSeries
.
target
||
'Value'
,
type
:
FieldType
.
number
,
unit
:
timeSeries
.
unit
,
unit
:
timeSeries
.
unit
,
},
},
{
{
...
...
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