Skip to content

Commit 030820d

Browse files
committed
bump v2.2.0
1 parent 54ec45f commit 030820d

9 files changed

+927
-927
lines changed

dist/axes.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Chart } from "chart.js/auto";
2-
import { ChartDatasourcePrometheusPluginOptions } from "./options";
3-
export declare function setTimeAxesOptions(chart: Chart): void;
4-
export declare function fillGaps(chart: Chart, start: Date, end: Date, step: number, options: ChartDatasourcePrometheusPluginOptions): void;
1+
import { Chart } from "chart.js/auto";
2+
import { ChartDatasourcePrometheusPluginOptions } from "./options";
3+
export declare function setTimeAxesOptions(chart: Chart): void;
4+
export declare function fillGaps(chart: Chart, start: Date, end: Date, step: number, options: ChartDatasourcePrometheusPluginOptions): void;

dist/chartjs-plugin-datasource-prometheus.cjs.js

Lines changed: 403 additions & 403 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/chartjs-plugin-datasource-prometheus.esm.js

Lines changed: 403 additions & 403 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/chartjs-plugin-datasource-prometheus.umd.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/datasource.d.ts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
import { PrometheusConnectionOptions, QueryResult } from "prometheus-query";
2-
import { ChartDatasourcePrometheusPluginOptionsTimeRange, PrometheusQuery, PrometheusTimeRangeAbsolute } from "./options";
3-
declare const _default: {
4-
/**
5-
* Compute a step for range_query (interval between 2 points in second)
6-
* Min step: 1s
7-
* Default: 1 step every 25px
8-
* @param {Date} start
9-
* @param {Date} end
10-
* @param {number} chartWidth: width in pixel
11-
*/
12-
getPrometheusStepAuto: (start: Date, end: Date, chartWidth: number) => number;
13-
/**
14-
* Return Date objects containing the start and end date of interval.
15-
* Relative dates are computed to absolute
16-
* @param {object} timeRange
17-
*/
18-
getStartAndEndDates(timeRange: ChartDatasourcePrometheusPluginOptionsTimeRange): PrometheusTimeRangeAbsolute;
19-
executeQueries: (prometheus: PrometheusConnectionOptions, queries: PrometheusQuery[], start: Date, end: Date, step: number) => Promise<QueryResult>[];
20-
};
21-
export default _default;
1+
import { PrometheusConnectionOptions, QueryResult } from "prometheus-query";
2+
import { ChartDatasourcePrometheusPluginOptionsTimeRange, PrometheusQuery, PrometheusTimeRangeAbsolute } from "./options";
3+
declare const _default: {
4+
/**
5+
* Compute a step for range_query (interval between 2 points in second)
6+
* Min step: 1s
7+
* Default: 1 step every 25px
8+
* @param {Date} start
9+
* @param {Date} end
10+
* @param {number} chartWidth: width in pixel
11+
*/
12+
getPrometheusStepAuto: (start: Date, end: Date, chartWidth: number) => number;
13+
/**
14+
* Return Date objects containing the start and end date of interval.
15+
* Relative dates are computed to absolute
16+
* @param {object} timeRange
17+
*/
18+
getStartAndEndDates(timeRange: ChartDatasourcePrometheusPluginOptionsTimeRange): PrometheusTimeRangeAbsolute;
19+
executeQueries: (prometheus: PrometheusConnectionOptions, queries: PrometheusQuery[], start: Date, end: Date, step: number) => Promise<QueryResult>[];
20+
};
21+
export default _default;

dist/index.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import { ChartDatasourcePrometheusPlugin } from './plugin';
2-
declare const _default: ChartDatasourcePrometheusPlugin;
3-
export default _default;
1+
import { ChartDatasourcePrometheusPlugin } from './plugin';
2+
declare const _default: ChartDatasourcePrometheusPlugin;
3+
export default _default;

dist/options.d.ts

Lines changed: 76 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,76 @@
1-
import { ChartDataset } from "chart.js";
2-
import { Metric, PrometheusConnectionOptions } from "prometheus-query";
3-
export declare class PrometheusTimeRange {
4-
step?: number | null;
5-
minStep?: number | null;
6-
msUpdateInterval?: number | null;
7-
}
8-
export interface PrometheusTimeRangeRelative {
9-
type: 'relative';
10-
start: number;
11-
end: number;
12-
}
13-
export interface PrometheusTimeRangeAbsolute {
14-
type: 'absolute';
15-
start: Date;
16-
end: Date;
17-
}
18-
export declare type ChartDatasourcePrometheusPluginOptionsTimeRange = PrometheusTimeRange & (PrometheusTimeRangeRelative | PrometheusTimeRangeAbsolute);
19-
export declare type PrometheusQuery = string | ((start: Date, end: Date, step: number) => Promise<any>);
20-
export declare type PrometheusQueries = PrometheusQuery | PrometheusQuery[];
21-
export declare type PrometheusSerieHook = (serie: Metric) => string | null;
22-
export declare type DataSetHook = (datasets: ChartDataset[]) => ChartDataset[];
23-
export declare class ChartDatasourcePrometheusPluginNoDataMsg {
24-
message?: string;
25-
font?: string;
26-
textAlign?: CanvasTextAlign;
27-
textBaseline?: CanvasTextBaseline;
28-
direction?: CanvasDirection;
29-
}
30-
export declare class ChartDatasourcePrometheusPluginErrorMsg {
31-
message?: string | null;
32-
font?: string;
33-
textAlign?: CanvasTextAlign;
34-
textBaseline?: CanvasTextBaseline;
35-
direction?: CanvasDirection;
36-
}
37-
export declare class ChartDatasourcePrometheusPluginLoadingMsg {
38-
message?: string;
39-
font?: string;
40-
textAlign?: CanvasTextAlign;
41-
textBaseline?: CanvasTextBaseline;
42-
direction?: CanvasDirection;
43-
}
44-
export declare class ChartDatasourcePrometheusPluginOptions {
45-
/**
46-
* Options for Prometheus requests
47-
*/
48-
prometheus: PrometheusConnectionOptions | null;
49-
query: PrometheusQueries;
50-
timeRange: ChartDatasourcePrometheusPluginOptionsTimeRange;
51-
/**
52-
* Options for designing Charts
53-
* See https://learnui.design/tools/data-color-picker.html#palette
54-
*/
55-
fillGaps?: boolean;
56-
tension?: number;
57-
cubicInterpolationMode?: 'default' | 'monotone';
58-
stepped?: boolean;
59-
fill?: boolean;
60-
stacked?: boolean;
61-
borderWidth?: number;
62-
borderColor?: string[];
63-
backgroundColor?: string[];
64-
noDataMsg?: ChartDatasourcePrometheusPluginNoDataMsg;
65-
errorMsg?: ChartDatasourcePrometheusPluginErrorMsg;
66-
loadingMsg?: ChartDatasourcePrometheusPluginLoadingMsg;
67-
findInLabelMap?: PrometheusSerieHook | null;
68-
findInBorderColorMap?: PrometheusSerieHook | null;
69-
findInBackgroundColorMap?: PrometheusSerieHook | null;
70-
dataSetHook?: DataSetHook | null;
71-
/**
72-
* Compute a step for range_query (interval between 2 points in second)
73-
*/
74-
assertPluginOptions(): void;
75-
getQueries(): PrometheusQuery[];
76-
}
1+
import { ChartDataset } from "chart.js";
2+
import { Metric, PrometheusConnectionOptions } from "prometheus-query";
3+
export declare class PrometheusTimeRange {
4+
step?: number | null;
5+
minStep?: number | null;
6+
msUpdateInterval?: number | null;
7+
}
8+
export interface PrometheusTimeRangeRelative {
9+
type: 'relative';
10+
start: number;
11+
end: number;
12+
}
13+
export interface PrometheusTimeRangeAbsolute {
14+
type: 'absolute';
15+
start: Date;
16+
end: Date;
17+
}
18+
export type ChartDatasourcePrometheusPluginOptionsTimeRange = PrometheusTimeRange & (PrometheusTimeRangeRelative | PrometheusTimeRangeAbsolute);
19+
export type PrometheusQuery = string | ((start: Date, end: Date, step: number) => Promise<any>);
20+
export type PrometheusQueries = PrometheusQuery | PrometheusQuery[];
21+
export type PrometheusSerieHook = (serie: Metric) => string | null;
22+
export type DataSetHook = (datasets: ChartDataset[]) => ChartDataset[];
23+
export declare class ChartDatasourcePrometheusPluginNoDataMsg {
24+
message?: string;
25+
font?: string;
26+
textAlign?: CanvasTextAlign;
27+
textBaseline?: CanvasTextBaseline;
28+
direction?: CanvasDirection;
29+
}
30+
export declare class ChartDatasourcePrometheusPluginErrorMsg {
31+
message?: string | null;
32+
font?: string;
33+
textAlign?: CanvasTextAlign;
34+
textBaseline?: CanvasTextBaseline;
35+
direction?: CanvasDirection;
36+
}
37+
export declare class ChartDatasourcePrometheusPluginLoadingMsg {
38+
message?: string;
39+
font?: string;
40+
textAlign?: CanvasTextAlign;
41+
textBaseline?: CanvasTextBaseline;
42+
direction?: CanvasDirection;
43+
}
44+
export declare class ChartDatasourcePrometheusPluginOptions {
45+
/**
46+
* Options for Prometheus requests
47+
*/
48+
prometheus: PrometheusConnectionOptions | null;
49+
query: PrometheusQueries;
50+
timeRange: ChartDatasourcePrometheusPluginOptionsTimeRange;
51+
/**
52+
* Options for designing Charts
53+
* See https://learnui.design/tools/data-color-picker.html#palette
54+
*/
55+
fillGaps?: boolean;
56+
tension?: number;
57+
cubicInterpolationMode?: 'default' | 'monotone';
58+
stepped?: boolean;
59+
fill?: boolean;
60+
stacked?: boolean;
61+
borderWidth?: number;
62+
borderColor?: string[];
63+
backgroundColor?: string[];
64+
noDataMsg?: ChartDatasourcePrometheusPluginNoDataMsg;
65+
errorMsg?: ChartDatasourcePrometheusPluginErrorMsg;
66+
loadingMsg?: ChartDatasourcePrometheusPluginLoadingMsg;
67+
findInLabelMap?: PrometheusSerieHook | null;
68+
findInBorderColorMap?: PrometheusSerieHook | null;
69+
findInBackgroundColorMap?: PrometheusSerieHook | null;
70+
dataSetHook?: DataSetHook | null;
71+
/**
72+
* Compute a step for range_query (interval between 2 points in second)
73+
*/
74+
assertPluginOptions(): void;
75+
getQueries(): PrometheusQuery[];
76+
}

dist/plugin.d.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { Chart } from 'chart.js';
2-
export declare class ChartDatasourcePrometheusPlugin {
3-
id: string;
4-
beforeInit(chart: Chart, options: any): void;
5-
afterInit(chart: Chart, args: any, _options: any): void;
6-
beforeUpdate(chart: Chart, args: any, _options: any): boolean;
7-
afterDraw(chart: Chart, args: any, _options: any): void;
8-
updateMessage(chart: Chart, _options: any): void;
9-
writeText(chart: Chart, message: string, fn?: (ctx: CanvasRenderingContext2D) => void): void;
10-
afterDestroy(chart: Chart, args: any, _options: any): void;
11-
private resumeRendering;
12-
}
1+
import { Chart } from 'chart.js';
2+
export declare class ChartDatasourcePrometheusPlugin {
3+
id: string;
4+
beforeInit(chart: Chart, options: any): void;
5+
afterInit(chart: Chart, args: any, _options: any): void;
6+
beforeUpdate(chart: Chart, args: any, _options: any): boolean;
7+
afterDraw(chart: Chart, args: any, _options: any): void;
8+
updateMessage(chart: Chart, _options: any): void;
9+
writeText(chart: Chart, message: string, fn?: (ctx: CanvasRenderingContext2D) => void): void;
10+
afterDestroy(chart: Chart, args: any, _options: any): void;
11+
private resumeRendering;
12+
}

dist/serie.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ChartDatasourcePrometheusPluginOptions } from "./options";
2-
export declare function selectLabel(options: ChartDatasourcePrometheusPluginOptions, serie: any, i: any): any;
3-
export declare function selectBackGroundColor(options: ChartDatasourcePrometheusPluginOptions, serie: any, i: any): string;
4-
export declare function selectBorderColor(options: ChartDatasourcePrometheusPluginOptions, serie: any, i: any): string;
1+
import { ChartDatasourcePrometheusPluginOptions } from "./options";
2+
export declare function selectLabel(options: ChartDatasourcePrometheusPluginOptions, serie: any, i: any): any;
3+
export declare function selectBackGroundColor(options: ChartDatasourcePrometheusPluginOptions, serie: any, i: any): string;
4+
export declare function selectBorderColor(options: ChartDatasourcePrometheusPluginOptions, serie: any, i: any): string;

0 commit comments

Comments
 (0)