Skip to content

Commit

Permalink
Merge remote-tracking branch 'grafana/master' into anno-regions
Browse files Browse the repository at this point in the history
* grafana/master:
  DataFrame: convert from row based to a columnar value format (grafana#18391)
  Packages: Temporarily skip canary releases if packages build fail (grafana#18577)
  Update latest.json to latest stable version (grafana#18575)
  Docs: Update changelog for v6.3.3 (grafana#18569)
  Graph: Fixed issue clicking on series line icon (grafana#18563)
  grafana/toolkit: Unpublish previous "next" version when releasing a new one (grafana#18552)
  Toolkit: write PR report to a folder with the circle build number (grafana#18560)
  CI: Fail build if yarn.lock is not up to date (grafana#18555)
  Chore: Updates react-dependant packages to address react warnings (grafana#18549)
  Prometheus: Fix regression of rerunning query on legend/interval change (grafana#18147)
  Explore/Prometheus: More consistently allows for multi-line queries (grafana#18362)
  Login: Fixes undefined redirect (grafana#18545)
  Plugins: expose react-redux, redux (grafana#18501)
  TimeSeries: assume values are all numbers (grafana#18540)
  • Loading branch information
ryantxu committed Aug 15, 2019
2 parents 5382ba0 + e59bae5 commit 68fe216
Show file tree
Hide file tree
Showing 85 changed files with 2,120 additions and 1,156 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ jobs:
key: dependency-cache-{{ checksum "yarn.lock" }}
- run:
name: yarn install
command: 'yarn install --pure-lockfile --no-progress'
command: 'yarn install --frozen-lockfile --no-progress'
no_output_timeout: 15m
- save_cache:
key: dependency-cache-{{ checksum "yarn.lock" }}
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# 6.4.0 (unreleased)

# 6.3.3 (2019-08-15)

### Bug Fixes
* **Annotations**: Fix failing annotation query when time series query is cancelled. [#18532](https://github.com/grafana/grafana/pull/18532), [@dprokop](https://github.com/dprokop)
* **Auth**: Do not set SameSite cookie attribute if cookie_samesite is none. [#18462](https://github.com/grafana/grafana/pull/18462), [@papagian](https://github.com/papagian)
* **DataLinks**: Apply scoped variables to data links correctly. [#18454](https://github.com/grafana/grafana/pull/18454), [@dprokop](https://github.com/dprokop)
* **DataLinks**: Respect timezone when displaying datapoint's timestamp in graph context menu. [#18461](https://github.com/grafana/grafana/pull/18461), [@dprokop](https://github.com/dprokop)
* **DataLinks**: Use datapoint timestamp correctly when interpolating variables. [#18459](https://github.com/grafana/grafana/pull/18459), [@dprokop](https://github.com/dprokop)
* **Explore**: Fix loading error for empty queries. [#18488](https://github.com/grafana/grafana/pull/18488), [@davkal](https://github.com/davkal)
* **Graph**: Fixes legend issue clicking on series line icon and issue with horizontal scrollbar being visible on windows. [#18563](https://github.com/grafana/grafana/pull/18563), [@torkelo](https://github.com/torkelo)
* **Graphite**: Avoid glob of single-value array variables . [#18420](https://github.com/grafana/grafana/pull/18420), [@gotjosh](https://github.com/gotjosh)
* **Prometheus**: Fix queries with label_replace remove the $1 match when loading query editor. [#18480](https://github.com/grafana/grafana/pull/18480), [@hugohaggmark](https://github.com/hugohaggmark)
* **Prometheus**: More consistently allows for multi-line queries in editor. [#18362](https://github.com/grafana/grafana/pull/18362), [@kaydelaney](https://github.com/kaydelaney)
* **TimeSeries**: Assume values are all numbers. [#18540](https://github.com/grafana/grafana/pull/18540), [@ryantxu](https://github.com/ryantxu)

# 6.3.2 (2019-08-07)

### Bug Fixes
Expand Down
4 changes: 2 additions & 2 deletions latest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"stable": "6.3.2",
"testing": "6.3.2"
"stable": "6.3.3",
"testing": "6.3.3"
}
30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
"@types/react-dom": "16.8.5",
"@types/react-grid-layout": "0.16.7",
"@types/react-select": "2.0.15",
"@types/react-transition-group": "2.0.16",
"@types/react-virtualized": "9.18.12",
"@types/react-window": "1.7.0",
"@types/react-transition-group": "4.2.2",
"@types/react-virtualized": "9.21.4",
"@types/react-window": "1.8.1",
"angular-mocks": "1.6.6",
"autoprefixer": "9.5.0",
"axios": "0.19.0",
Expand Down Expand Up @@ -179,9 +179,9 @@
"@types/marked": "0.6.5",
"@types/mousetrap": "1.6.3",
"@types/prismjs": "1.16.0",
"@types/react-redux": "7.0.8",
"@types/react-redux": "7.1.1",
"@types/react-table": "6.8.5",
"@types/react-test-renderer": "16.8.2",
"@types/react-test-renderer": "16.9.0",
"@types/redux-logger": "3.0.7",
"@types/redux-mock-store": "1.0.1",
"@types/reselect": "2.2.0",
Expand Down Expand Up @@ -217,16 +217,16 @@
"react": "16.9.0",
"react-dom": "16.9.0",
"react-grid-layout": "0.16.6",
"react-highlight-words": "0.11.0",
"react-popper": "1.3.3",
"react-redux": "5.1.1",
"react-sizeme": "2.5.2",
"react-table": "6.9.2",
"react-transition-group": "2.6.1",
"react-use": "9.0.0",
"react-virtualized": "9.21.0",
"react-window": "1.7.1",
"redux": "4.0.1",
"react-highlight-words": "0.16.0",
"react-popper": "1.3.4",
"react-redux": "7.1.0",
"react-sizeme": "2.6.7",
"react-table": "6.10.0",
"react-transition-group": "4.2.2",
"react-use": "10.5.0",
"react-virtualized": "9.21.1",
"react-window": "1.8.5",
"redux": "4.0.4",
"redux-logger": "3.0.6",
"redux-observable": "1.1.0",
"redux-thunk": "2.3.0",
Expand Down
35 changes: 0 additions & 35 deletions packages/grafana-data/src/types/data.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import { Threshold } from './threshold';
import { ValueMapping } from './valueMapping';

export enum LoadingState {
NotStarted = 'NotStarted',
Loading = 'Loading',
Expand All @@ -9,14 +6,6 @@ export enum LoadingState {
Error = 'Error',
}

export enum FieldType {
time = 'time', // or date
number = 'number',
string = 'string',
boolean = 'boolean',
other = 'other', // Object, Array, etc
}

export interface QueryResultMeta {
[key: string]: any;

Expand All @@ -42,34 +31,10 @@ export interface QueryResultBase {
meta?: QueryResultMeta;
}

export interface Field {
name: string; // The column name
title?: string; // The display value for this field. This supports template variables blank is auto
type?: FieldType;
filterable?: boolean;
unit?: string;
decimals?: number | null; // Significant digits (for display)
min?: number | null;
max?: number | null;

// Convert input values into a display value
mappings?: ValueMapping[];

// Must be sorted by 'value', first value is always -Infinity
thresholds?: Threshold[];
}

export interface Labels {
[key: string]: string;
}

export interface DataFrame extends QueryResultBase {
name?: string;
fields: Field[];
rows: any[][];
labels?: Labels;
}

export interface Column {
text: string; // For a Column, the 'text' is the field name
filterable?: boolean;
Expand Down
110 changes: 110 additions & 0 deletions packages/grafana-data/src/types/dataFrame.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
import { Threshold } from './threshold';
import { ValueMapping } from './valueMapping';
import { QueryResultBase, Labels, NullValueMode } from './data';
import { FieldCalcs } from '../utils/index';
import { DisplayProcessor } from './displayValue';

export enum FieldType {
time = 'time', // or date
number = 'number',
string = 'string',
boolean = 'boolean',
other = 'other', // Object, Array, etc
}

/**
* Every property is optional
*
* Plugins may extend this with additional properties. Somethign like series overrides
*/
export interface FieldConfig {
title?: string; // The display value for this field. This supports template variables blank is auto
filterable?: boolean;

// Numeric Options
unit?: string;
decimals?: number | null; // Significant digits (for display)
min?: number | null;
max?: number | null;

// Convert input values into a display string
mappings?: ValueMapping[];

// Must be sorted by 'value', first value is always -Infinity
thresholds?: Threshold[];

// Used when reducing field values
nullValueMode?: NullValueMode;

// Alternative to empty string
noValue?: string;
}

export interface Vector<T = any> {
length: number;

/**
* Access the value by index (Like an array)
*/
get(index: number): T;

/**
* Get the resutls as an array.
*/
toArray(): T[];

/**
* Return the values as a simple array for json serialization
*/
toJSON(): any; // same results as toArray()
}

export interface Field<T = any> {
name: string; // The column name
type: FieldType;
config: FieldConfig;
values: Vector<T>; // `buffer` when JSON

/**
* Cache of reduced values
*/
calcs?: FieldCalcs;

/**
* Convert text to the field value
*/
parse?: (value: any) => T;

/**
* Convert a value for display
*/
display?: DisplayProcessor;
}

export interface DataFrame extends QueryResultBase {
name?: string;
fields: Field[]; // All fields of equal length
labels?: Labels;

// The number of rows
length: number;
}

/**
* Like a field, but properties are optional and values may be a simple array
*/
export interface FieldDTO<T = any> {
name: string; // The column name
type?: FieldType;
config?: FieldConfig;
values?: Vector<T> | T[]; // toJSON will always be T[], input could be either
}

/**
* Like a DataFrame, but fields may be a FieldDTO
*/
export interface DataFrameDTO extends QueryResultBase {
name?: string;
labels?: Labels;
fields: Array<FieldDTO | Field>;
}
2 changes: 2 additions & 0 deletions packages/grafana-data/src/types/displayValue.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export type DisplayProcessor = (value: any) => DisplayValue;

export interface DisplayValue {
text: string; // Show in the UI
numeric: number; // Use isNaN to check if it is a real number
Expand Down
1 change: 1 addition & 0 deletions packages/grafana-data/src/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export * from './data';
export * from './dataFrame';
export * from './dataLink';
export * from './logs';
export * from './navModel';
Expand Down
Loading

0 comments on commit 68fe216

Please sign in to comment.