Skip to content

Commit

Permalink
20180904 bugfixes (grafana#13)
Browse files Browse the repository at this point in the history
* update jest

* update packages, remove failing test

* update modules and fix jest

* fixes for composite state evaluation and added new tests

* update version

* implement polygon bordersize and color customization

* update readme

* show non-composite value if possible

* center polygon when there is just one row and column

* fix centering and prefer more columns to rows

* add dist, update doc

* add circleci

* add circleci status

* add circleci status with token

* add jest to global install
  • Loading branch information
briangann authored Sep 7, 2018
1 parent b220186 commit 68e43d3
Show file tree
Hide file tree
Showing 45 changed files with 1,666 additions and 172 deletions.
3 changes: 3 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ jobs:
- run:
name: Install grunt
command: 'sudo npm install -g grunt'
- run:
name: Install jest
command: 'sudo npm install -g jest'
- run: node -p "require('node-sass').info"
- save_cache:
key: v2-dependencies-{{ checksum "package.json" }}
Expand Down
27 changes: 3 additions & 24 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const sass = require('node-sass');
module.exports = function(grunt) {

require('load-grunt-tasks')(grunt);
Expand Down Expand Up @@ -66,35 +67,13 @@ module.exports = function(grunt) {

ts: {
build: {
src: ['src/**/*.ts', '!src/**/*.d.ts'],
dest: 'dist',
options: {
module: 'system',
target: 'es5',
rootDir: 'src',
sourceMap: true,
sourceRoot: 'src',
declaration: true,
emitDecoratorMetadata: true,
experimentalDecorators: true,
noImplicitAny: false,
noUnusedLocals: true,
noUnusedParameters: true,
noImplicitReturns: true,
noImplicitThis: true,
noFallthroughCasesInSwitch: true,
strictNullChecks: false,
strictPropertyInitialization: false,
allowJs: false,
jsx: "react",
strictFunctionTypes: false,
alwaysStrict: true
}
tsconfig: './tsconfig.json'
}
},

sass: {
options: {
implementation: sass,
sourceMap: true
},
dist: {
Expand Down
40 changes: 25 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Grafana Polystat Panel
[![CircleCI](https://circleci.com/gh/grafana/grafana-polystat-panel.svg?style=svg&circle-token=b78cf4ee3d98c447a7473f542a8dee69f9901f4d)](https://circleci.com/gh/grafana/grafana-polystat-panel)

This panel plugin provides a [D3-based](http://www.d3js.org) multistat panel for [Grafana](http://www.grafana.org) 3.x/4.x/5.x.

Expand All @@ -9,19 +10,19 @@ A hexagon is create for each metric received, with the ability to group metrics
This plugin supports autoscaling for best-fit sizing of each polygon to the panel size. When the complete text cannot be displayed, only tooltips are active.

### All visible
![Scaled3](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-scaled3.png?token=AHBelVMwePbR84Lvm0a441yGv1-oYRHxks5bPZn2wA%3D%3D)
![Scaled3](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-scaled3.png)
### Scaled down
![Scaled1](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-scaled1.png?token=AHBelc7t0KnPYPhdCXoGlDUr94MRQ26bks5bPZpfwA%3D%3D)
![Scaled1](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-scaled1.png)
### Scaled down with tooltip
![Scaled2](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-scaled2.png?token=AHBelfDDlMA9l_kdxoyJWF2xTPCFjIAvks5bPZqBwA%3D%3D)
![Scaled2](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-scaled2.png)

## Options

![State with Composites](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-options-all.png?token=AHBelbOGGpJ0HX70ajMXl3XAcc1hMOHBks5bPZqZwA%3D%3D)
![State with Composites](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-options-all.png)

### Layout

![Layout](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-options-layout.png?token=AHBelZTu1VR3g8zqNi4n04kz3UJCf3Szks5bPZq1wA%3D%3D)
![Layout](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-options-layout.png)

Specify the desired number of columns and rows, or select Autosize to allow the plugin to calculate a "best fit" for the size of the panel.

Expand All @@ -35,26 +36,26 @@ NOTE: if both columns and rows are set, only rows*columns will be displayed, gen
Set a limit on number of hexagons to be displayed, set to 0 for no limit.

### Sizing
![Sizing](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-options-sizing.png?token=AHBelZ71kGjJjai2SJTKRWnKFdYPTmVBks5bPZrQwA%3D%3D)
![Sizing](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-options-sizing.png)

Set the size of the polygon to a fixed size, or select auto-size for "best fit".

### Sorting
![Sorting](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-options-sorting.png?token=AHBelZNWQODVZR-2EPEwJzf-sdx28LH9ks5bPZrmwA%3D%3D)
![Sorting](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-options-sorting.png)

### Tooltips

![Tooltips](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-options-tooltips.png?token=AHBelVOgciJkmll_BXcaPpXAuJU-zYXoks5bPZr4wA%3D%3D)
![Tooltips](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-options-tooltips.png)

Set the font to be used for Tooltips

### Global

![Global](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-options-global.png?token=AHBelTbJcmJGZBwMrHcaBdnMchKPqGGEks5bPZsNwA%3D%3D)
![Global](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-options-global.png)

### Animation

![Animation](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-options-animation.png?token=AHBelcYWw5as0R_PUbY2_OptPqjDHpWRks5bPZsiwA%3D%3D)
![Animation](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-options-animation.png)

#### Speed

Expand Down Expand Up @@ -85,11 +86,11 @@ Animate hexagon to display metrics if there are composites

## Overrides

![Overrides](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-overrides-all.png?token=AHBelZ0gKiwbiByMGYxi_lx6WzulQxamks5bPZs2wA%3D%3D)
![Overrides](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-overrides-all.png)

## Composites

![Composites](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-composites-all.png?token=AHBelfcW7VqnZubK3PMd6ilkj_Ppqu8Hks5bPZtKwA%3D%3D)
![Composites](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-composites-all.png)

## Value Mappings

Expand All @@ -102,17 +103,18 @@ Animate hexagon to display metrics if there are composites
Hovering over a hexagon shows the metrics that comprise the displayed state.
For composites this will expand members of the composite.

![Tooltip](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-tooltip.png?token=AHBelUgpo8dN0wXl4MgaOx-jLg8q5hThks5bPZtpwA%3D%3D)
![Tooltip](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-tooltip.png)

#### State with composites

This shows creation of composites, where you select which metrics comprise the composite.

![State with Composites](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-composite-example1.png?token=AHBelVeXvIfTh_x5wX9uu5QZ1eHrKSGvks5bPZt8wA%3D%3D)
![State with Composites](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-composite-example1.png)

This shows composites configured for GPU 0,1,2,3, and non-grouped metrics from GPU4-7.

![State with partial composites](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-gpu-state-composites.png?token=AHBelXmqTBW2k3gB9TRwmdMnptr-ba4kks5bPZuNwA%3D%3D)
![State with partial composites](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-gpu-state-composites.png)

## Building

This plugin relies on Grunt/NPM/Bower, typical build sequence:
Expand Down Expand Up @@ -162,3 +164,11 @@ This panel is based on this D3 example:
- Initial commit
##### v1.0.1
- Added Options -> Show Timestamp checkbox for tooltips
##### v1.0.11
- Panel no longer shares data/affects other panels of same type
##### v1.0.12
- Fixed composite state evaluations
- Added ability to set color and size of polygon border
- Single shape now centers itself
- Non-composites now show their value if possible
- New tests added to verify fixes
40 changes: 25 additions & 15 deletions dist/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Grafana Polystat Panel
[![CircleCI](https://circleci.com/gh/grafana/grafana-polystat-panel.svg?style=svg&circle-token=b78cf4ee3d98c447a7473f542a8dee69f9901f4d)](https://circleci.com/gh/grafana/grafana-polystat-panel)

This panel plugin provides a [D3-based](http://www.d3js.org) multistat panel for [Grafana](http://www.grafana.org) 3.x/4.x/5.x.

Expand All @@ -9,19 +10,19 @@ A hexagon is create for each metric received, with the ability to group metrics
This plugin supports autoscaling for best-fit sizing of each polygon to the panel size. When the complete text cannot be displayed, only tooltips are active.

### All visible
![Scaled3](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-scaled3.png?token=AHBelVMwePbR84Lvm0a441yGv1-oYRHxks5bPZn2wA%3D%3D)
![Scaled3](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-scaled3.png)
### Scaled down
![Scaled1](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-scaled1.png?token=AHBelc7t0KnPYPhdCXoGlDUr94MRQ26bks5bPZpfwA%3D%3D)
![Scaled1](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-scaled1.png)
### Scaled down with tooltip
![Scaled2](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-scaled2.png?token=AHBelfDDlMA9l_kdxoyJWF2xTPCFjIAvks5bPZqBwA%3D%3D)
![Scaled2](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-scaled2.png)

## Options

![State with Composites](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-options-all.png?token=AHBelbOGGpJ0HX70ajMXl3XAcc1hMOHBks5bPZqZwA%3D%3D)
![State with Composites](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-options-all.png)

### Layout

![Layout](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-options-layout.png?token=AHBelZTu1VR3g8zqNi4n04kz3UJCf3Szks5bPZq1wA%3D%3D)
![Layout](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-options-layout.png)

Specify the desired number of columns and rows, or select Autosize to allow the plugin to calculate a "best fit" for the size of the panel.

Expand All @@ -35,26 +36,26 @@ NOTE: if both columns and rows are set, only rows*columns will be displayed, gen
Set a limit on number of hexagons to be displayed, set to 0 for no limit.

### Sizing
![Sizing](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-options-sizing.png?token=AHBelZ71kGjJjai2SJTKRWnKFdYPTmVBks5bPZrQwA%3D%3D)
![Sizing](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-options-sizing.png)

Set the size of the polygon to a fixed size, or select auto-size for "best fit".

### Sorting
![Sorting](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-options-sorting.png?token=AHBelZNWQODVZR-2EPEwJzf-sdx28LH9ks5bPZrmwA%3D%3D)
![Sorting](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-options-sorting.png)

### Tooltips

![Tooltips](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-options-tooltips.png?token=AHBelVOgciJkmll_BXcaPpXAuJU-zYXoks5bPZr4wA%3D%3D)
![Tooltips](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-options-tooltips.png)

Set the font to be used for Tooltips

### Global

![Global](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-options-global.png?token=AHBelTbJcmJGZBwMrHcaBdnMchKPqGGEks5bPZsNwA%3D%3D)
![Global](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-options-global.png)

### Animation

![Animation](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-options-animation.png?token=AHBelcYWw5as0R_PUbY2_OptPqjDHpWRks5bPZsiwA%3D%3D)
![Animation](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-options-animation.png)

#### Speed

Expand Down Expand Up @@ -85,11 +86,11 @@ Animate hexagon to display metrics if there are composites

## Overrides

![Overrides](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-overrides-all.png?token=AHBelZ0gKiwbiByMGYxi_lx6WzulQxamks5bPZs2wA%3D%3D)
![Overrides](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-overrides-all.png)

## Composites

![Composites](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-composites-all.png?token=AHBelfcW7VqnZubK3PMd6ilkj_Ppqu8Hks5bPZtKwA%3D%3D)
![Composites](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-composites-all.png)

## Value Mappings

Expand All @@ -102,17 +103,18 @@ Animate hexagon to display metrics if there are composites
Hovering over a hexagon shows the metrics that comprise the displayed state.
For composites this will expand members of the composite.

![Tooltip](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-tooltip.png?token=AHBelUgpo8dN0wXl4MgaOx-jLg8q5hThks5bPZtpwA%3D%3D)
![Tooltip](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-tooltip.png)

#### State with composites

This shows creation of composites, where you select which metrics comprise the composite.

![State with Composites](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-composite-example1.png?token=AHBelVeXvIfTh_x5wX9uu5QZ1eHrKSGvks5bPZt8wA%3D%3D)
![State with Composites](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-composite-example1.png)

This shows composites configured for GPU 0,1,2,3, and non-grouped metrics from GPU4-7.

![State with partial composites](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-gpu-state-composites.png?token=AHBelXmqTBW2k3gB9TRwmdMnptr-ba4kks5bPZuNwA%3D%3D)
![State with partial composites](https://raw.githubusercontent.com/grafana/grafana-polystat-panel/master/src/screenshots/polystat-gpu-state-composites.png)

## Building

This plugin relies on Grunt/NPM/Bower, typical build sequence:
Expand Down Expand Up @@ -162,3 +164,11 @@ This panel is based on this D3 example:
- Initial commit
##### v1.0.1
- Added Options -> Show Timestamp checkbox for tooltips
##### v1.0.11
- Panel no longer shares data/affects other panels of same type
##### v1.0.12
- Fixed composite state evaluations
- Added ability to set color and size of polygon border
- Single shape now centers itself
- Non-composites now show their value if possible
- New tests added to verify fixes
16 changes: 14 additions & 2 deletions dist/composites_manager.js

Large diffs are not rendered by default.

Loading

0 comments on commit 68e43d3

Please sign in to comment.