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
ade8aa5b
Commit
ade8aa5b
authored
Sep 27, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(graph): refactorings
parent
34f15d92
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
60 deletions
+4
-60
pkg/tsdb/models.go
+2
-2
public/app/plugins/app/testdata/datasource/datasource.ts
+0
-6
public/app/plugins/datasource/grafana/datasource.ts
+2
-0
public/app/plugins/panel/graph/data_processor.ts
+0
-52
No files found.
pkg/tsdb/models.go
View file @
ade8aa5b
...
...
@@ -56,8 +56,8 @@ type QueryResult struct {
}
type
TimeSeries
struct
{
Name
string
`json:"
name
"`
Points
[][
2
]
*
float64
`json:"points"`
Name
string
`json:"
target
"`
Points
[][
2
]
*
float64
`json:"
data
points"`
}
type
TimeSeriesSlice
[]
*
TimeSeries
...
...
public/app/plugins/app/testdata/datasource/datasource.ts
View file @
ade8aa5b
...
...
@@ -22,12 +22,6 @@ class TestDataDatasource {
scenario
:
options
.
targets
[
0
].
scenario
,
interval
:
options
.
intervalMs
,
maxDataPoints
:
options
.
maxDataPoints
,
}).
then
(
res
=>
{
res
.
data
=
res
.
data
.
map
(
item
=>
{
return
{
target
:
item
.
name
,
datapoints
:
item
.
points
};
});
return
res
;
});
}
...
...
public/app/plugins/datasource/grafana/datasource.ts
View file @
ade8aa5b
...
...
@@ -9,6 +9,8 @@ class GrafanaDatasource {
return
this
.
backendSrv
.
get
(
'/api/metrics/test'
,
{
from
:
options
.
range
.
from
.
valueOf
(),
to
:
options
.
range
.
to
.
valueOf
(),
scenario
:
'random_walk'
,
interval
:
options
.
intervalMs
,
maxDataPoints
:
options
.
maxDataPoints
});
}
...
...
public/app/plugins/panel/graph/data_processor.ts
View file @
ade8aa5b
...
...
@@ -98,65 +98,13 @@ export class DataProcessor {
}
customHandler
(
dataItem
)
{
console
.
log
(
'custom'
,
dataItem
);
let
nameField
=
this
.
panel
.
xaxis
.
name
;
if
(
!
nameField
)
{
throw
{
message
:
'No field name specified to use for x-axis, check your axes settings'
};
}
// let valueField = this.panel.xaxis.esValueField;
// let datapoints = _.map(seriesData.datapoints, (doc) => {
// return [
// pluckDeep(doc, valueField), // Y value
// pluckDeep(doc, xField) // X value
// ];
// });
//
// // Remove empty points
// datapoints = _.filter(datapoints, (point) => {
// return point[0] !== undefined;
// });
//
// var alias = valueField;
// re
return
[];
}
// tableHandler(seriesData, index) {
// var xColumnIndex = Number(this.panel.xaxis.columnIndex);
// var valueColumnIndex = Number(this.panel.xaxis.valueColumnIndex);
// var datapoints = _.map(seriesData.rows, (row) => {
// var value = valueColumnIndex ? row[valueColumnIndex] : _.last(row);
// return [
// value, // Y value
// row[xColumnIndex] // X value
// ];
// });
//
// var alias = seriesData.columns[valueColumnIndex].text;
//
// return this.seriesHandler(seriesData, index, datapoints, alias);
// }
// esRawDocHandler(seriesData, index) {
// let xField = this.panel.xaxis.esField;
// let valueField = this.panel.xaxis.esValueField;
// let datapoints = _.map(seriesData.datapoints, (doc) => {
// return [
// pluckDeep(doc, valueField), // Y value
// pluckDeep(doc, xField) // X value
// ];
// });
//
// // Remove empty points
// datapoints = _.filter(datapoints, (point) => {
// return point[0] !== undefined;
// });
//
// var alias = valueField;
// return this.seriesHandler(seriesData, index, datapoints, alias);
// }
validateXAxisSeriesValue
()
{
switch
(
this
.
panel
.
xaxis
.
mode
)
{
case
'series'
:
{
...
...
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