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
27913289
Unverified
Commit
27913289
authored
Mar 25, 2020
by
Ryan McKinley
Committed by
GitHub
Mar 25, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Chore: fix typo and remove deprecation (#23073)
parent
e5d7c6e2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
27 deletions
+2
-27
packages/grafana-data/src/dataframe/processDataFrame.test.ts
+0
-13
packages/grafana-data/src/dataframe/processDataFrame.ts
+1
-13
public/app/plugins/panel/singlestat/module.ts
+1
-1
No files found.
packages/grafana-data/src/dataframe/processDataFrame.test.ts
View file @
27913289
...
...
@@ -80,19 +80,6 @@ describe('toDataFrame', () => {
).
toThrowError
(
'Expected table rows to be array, got object.'
);
});
it
(
'migrate from 6.3 style rows'
,
()
=>
{
const
oldDataFrame
=
{
fields
:
[{
name
:
'A'
},
{
name
:
'B'
},
{
name
:
'C'
}],
rows
:
[
[
100
,
'A'
,
1
],
[
200
,
'B'
,
2
],
[
300
,
'C'
,
3
],
],
};
const
data
=
toDataFrame
(
oldDataFrame
);
expect
(
data
.
length
).
toBe
(
oldDataFrame
.
rows
.
length
);
});
it
(
'Guess Colum Types from value'
,
()
=>
{
expect
(
guessFieldTypeFromValue
(
1
)).
toBe
(
FieldType
.
number
);
expect
(
guessFieldTypeFromValue
(
1.234
)).
toBe
(
FieldType
.
number
);
...
...
packages/grafana-data/src/dataframe/processDataFrame.ts
View file @
27913289
...
...
@@ -16,7 +16,6 @@ import {
DataFrameDTO
,
}
from
'../types/index'
;
import
{
isDateTime
}
from
'../datetime/moment_wrapper'
;
import
{
deprecationWarning
}
from
'../utils/deprecationWarning'
;
import
{
ArrayVector
}
from
'../vector/ArrayVector'
;
import
{
MutableDataFrame
}
from
'./MutableDataFrame'
;
import
{
SortedVector
}
from
'../vector/SortedVector'
;
...
...
@@ -224,7 +223,7 @@ export function guessFieldTypeForField(field: Field): FieldType | undefined {
export
const
guessFieldTypes
=
(
series
:
DataFrame
):
DataFrame
=>
{
for
(
let
i
=
0
;
i
<
series
.
fields
.
length
;
i
++
)
{
if
(
!
series
.
fields
[
i
].
type
)
{
// Somethi
gn is missing a type
return a modified copy
// Somethi
ng is missing a type,
return a modified copy
return
{
...
series
,
fields
:
series
.
fields
.
map
(
field
=>
{
...
...
@@ -250,17 +249,6 @@ export const isDataFrame = (data: any): data is DataFrame => data && data.hasOwn
export
const
toDataFrame
=
(
data
:
any
):
DataFrame
=>
{
if
(
data
.
hasOwnProperty
(
'fields'
))
{
// @deprecated -- remove in 6.5
if
(
data
.
hasOwnProperty
(
'rows'
))
{
const
v
=
new
MutableDataFrame
(
data
as
DataFrameDTO
);
const
rows
=
data
.
rows
as
any
[][];
for
(
let
i
=
0
;
i
<
rows
.
length
;
i
++
)
{
v
.
appendRow
(
rows
[
i
]);
}
deprecationWarning
(
'DataFrame'
,
'.rows'
,
'columnar format'
);
return
v
;
}
// DataFrameDTO does not have length
if
(
data
.
hasOwnProperty
(
'length'
))
{
return
data
as
DataFrame
;
...
...
public/app/plugins/panel/singlestat/module.ts
View file @
27913289
...
...
@@ -700,7 +700,7 @@ function getColorForValue(data: any, value: number) {
//------------------------------------------------
// Private utility functions
// Somethi
gn
like this should be avaliable in a
// Somethi
ng
like this should be avaliable in a
// DataFrame[] abstraction helper
//------------------------------------------------
...
...
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