Skip to content

Commit

Permalink
Switch to Roboto font, fix value font scaling (grafana#26)
Browse files Browse the repository at this point in the history
* Switch to Roboto font, fix value font scaling

* move params outside of panel config

* refactor variables, add global unit format and decimals to options

* handle lack of thresholds

* add roboto

* add support for global unit formatting

* update changes

* implement new threshold processor

* use gf-form-switch vs editor-checkbox

* consistent naming and formatting for click through url

* disable all shapes other than hexagon and circle

* allow bitwise

* implement custom color gradients per override

* remove debug output

* update version to 1.0.13

* update doc

* update dist

* comment out import

* add comments

* temp fix for tests

* update tests

* update tests

* fix mock
  • Loading branch information
briangann authored Oct 5, 2018
1 parent 68e43d3 commit 8f76b43
Show file tree
Hide file tree
Showing 39 changed files with 1,110 additions and 738 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ Then browse to http://localhost:3000
* bower
* grunt

## Enable Grafana TestData

`Grafana TestData` is not enabled by default. To enable it, first navigate to the Plugins section, found in your Grafana main menu. Click the Apps tabs in the Plugins section and select the Grafana TestData App. (Or navigate to http://your_grafana_instance/plugins/testdata/edit to go directly there). Finally click the enable button to enable.


#### Acknowledgements

This panel is based on this D3 example:
Expand All @@ -172,3 +177,11 @@ This panel is based on this D3 example:
- Single shape now centers itself
- Non-composites now show their value if possible
- New tests added to verify fixes
##### v1.0.13
- Default to roboto font
- Default to short units and 2 decimals
- Moved panel options outside of saved config
- Add global unit format and global decimals
- No longer errors when thresholds not found
- Refactor thresholds to allow range evaluation in overrides
- Refactor and implement custom gradients for overrides
13 changes: 13 additions & 0 deletions dist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ Then browse to http://localhost:3000
* bower
* grunt

## Enable Grafana TestData

`Grafana TestData` is not enabled by default. To enable it, first navigate to the Plugins section, found in your Grafana main menu. Click the Apps tabs in the Plugins section and select the Grafana TestData App. (Or navigate to http://your_grafana_instance/plugins/testdata/edit to go directly there). Finally click the enable button to enable.


#### Acknowledgements

This panel is based on this D3 example:
Expand All @@ -172,3 +177,11 @@ This panel is based on this D3 example:
- Single shape now centers itself
- Non-composites now show their value if possible
- New tests added to verify fixes
##### v1.0.13
- Default to roboto font
- Default to short units and 2 decimals
- Moved panel options outside of saved config
- Add global unit format and global decimals
- No longer errors when thresholds not found
- Refactor thresholds to allow range evaluation in overrides
- Refactor and implement custom gradients for overrides
12 changes: 12 additions & 0 deletions dist/color.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export declare class Color {
r: number;
g: number;
b: number;
constructor(r: number, g: number, b: number);
asHex(): string;
asRGB(): string;
blendWith(col: any, a: any): Color;
Mul(col: any, a: any): Color;
fromHex(hex: any): void;
static createGradients(data: any): any;
}
56 changes: 56 additions & 0 deletions dist/color.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions dist/composites_manager.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ export declare class CompositesManager {
removeMetricFromComposite(composite: any, metric: any): void;
matchComposite(pattern: any): number;
applyComposites(data: any): any;
getWorstSeries(series1: any, series2: any): any;
getThresholdLevelForSeriesValue(series: any): number;
metricNameChanged(item: any): void;
moveMetricCompositeUp(item: any): void;
moveMetricCompositeDown(item: any): void;
Expand Down
44 changes: 7 additions & 37 deletions dist/composites_manager.js

Large diffs are not rendered by default.

133 changes: 68 additions & 65 deletions dist/ctrl.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,94 +7,95 @@ import { CompositesManager } from "./composites_manager";
declare class D3PolystatPanelCtrl extends MetricsPanelCtrl {
private $sanitize;
static templateUrl: string;
animationModes: {
value: string;
text: string;
}[];
displayModes: {
value: string;
text: string;
}[];
thresholdStates: {
value: number;
text: string;
}[];
shapes: {
value: string;
text: string;
}[];
fontSizes: number[];
fontTypes: string[];
unitFormats: any;
operatorOptions: {
value: string;
text: string;
}[];
sortDirections: {
value: string;
text: string;
}[];
sortFields: {
value: string;
text: string;
}[];
dataRaw: any;
polystatData: PolystatModel[];
scoperef: any;
alertSrvRef: any;
initialized: boolean;
panelContainer: any;
d3Object: D3Wrapper;
data: any;
series: any[];
templateSrv: any;
overridesCtrl: MetricOverridesManager;
compositesManager: CompositesManager;
tooltipContent: string[];
d3DivId: string;
containerDivId: string;
svgContainer: any;
panelWidth: any;
panelHeight: any;
panelDefaults: {
animationModes: {
value: string;
text: string;
}[];
displayModes: {
value: string;
text: string;
}[];
thresholdStates: {
value: number;
text: string;
}[];
shapes: {
value: string;
text: string;
}[];
savedComposites: any[];
savedOverrides: any[];
fontSizes: number[];
fontTypes: string[];
unitFormats: any;
operatorOptions: {
value: string;
text: string;
}[];
operatorName: string;
colors: string[];
notcolors: string[];
decimals: number;
format: string;
sortDirections: {
value: string;
text: string;
}[];
sortFields: {
value: string;
text: string;
}[];
polystat: {
shape: string;
globalDisplayMode: string;
globalOperatorName: string;
rows: string;
rowAutoSize: boolean;
animationSpeed: number;
columns: string;
columnAutoSize: boolean;
displayLimit: number;
maxMetrics: number;
radius: string;
radiusAutoSize: boolean;
tooltipFontSize: number;
tooltipFontType: string;
animationSpeed: number;
defaultClickThrough: string;
defaultClickThroughSanitize: boolean;
fontAutoScale: boolean;
fontSize: number;
fontType: string;
globalUnitFormat: string;
globalDecimals: number;
globalDisplayMode: string;
globalOperatorName: string;
gradientEnabled: boolean;
hexagonSortByDirection: string;
hexagonSortByField: string;
maxMetrics: number;
polygonBorderSize: number;
polygonBorderColor: string;
radius: string;
radiusAutoSize: boolean;
rows: string;
rowAutoSize: boolean;
shape: string;
tooltipDisplayMode: string;
tooltipDisplayTextTriggeredEmpty: string;
tooltipFontSize: number;
tooltipFontType: string;
tooltipPrimarySortDirection: string;
tooltipPrimarySortField: string;
tooltipSecondarySortDirection: string;
tooltipSecondarySortField: string;
tooltipTimestampEnabled: boolean;
fontSize: number;
fontAutoScale: boolean;
gradientEnabled: boolean;
};
};
dataRaw: any;
polystatData: PolystatModel[];
containerDivId: any;
scoperef: any;
alertSrvRef: any;
initialized: boolean;
panelContainer: any;
panelWidth: any;
panelHeight: any;
d3Object: D3Wrapper;
data: any;
series: any[];
templateSrv: any;
overridesCtrl: MetricOverridesManager;
compositesManager: CompositesManager;
tooltipContent: string[];
constructor($scope: any, $injector: any, templateSrv: any, alertSrv: any, $sanitize: any);
onInitEditMode(): void;
setContainer(container: any): void;
Expand All @@ -108,6 +109,7 @@ declare class D3PolystatPanelCtrl extends MetricsPanelCtrl {
addRangeMap(): void;
link(scope: any, elem: any, attrs: any, ctrl: any): void;
setValues(dataList: any): void;
applyGlobalFormatting(data: any): void;
filterByGlobalDisplayMode(data: any): any;
onDataError(err: any): void;
onDataReceived(dataList: any): void;
Expand All @@ -120,5 +122,6 @@ declare class D3PolystatPanelCtrl extends MetricsPanelCtrl {
validateBorderSizeValue(): void;
updatePolygonBorderColor(): void;
getDefaultClickThrough(): any;
setGlobalUnitFormat(subItem: any): void;
}
export { D3PolystatPanelCtrl, D3PolystatPanelCtrl as MetricsPanelCtrl };
Loading

0 comments on commit 8f76b43

Please sign in to comment.