Browse Source

npm -> yarn && yarn lint comand

merge-requests/2/head
vargburz 3 years ago
parent
commit
867017fc3e
  1. 12
      README.md
  2. 18006
      package-lock.json
  3. 5
      package.json
  4. 28
      src/components/Panel.tsx
  5. 12733
      yarn.lock

12
README.md

@ -4,7 +4,7 @@
[![Build Status](https://travis-ci.org/chartwerk/grafana-chartwerk-app.svg?branch=master)](https://travis-ci.org/chartwerk/grafana-chartwerk-app) [![Build Status](https://travis-ci.org/chartwerk/grafana-chartwerk-app.svg?branch=master)](https://travis-ci.org/chartwerk/grafana-chartwerk-app)
**Grafana Chartwerk Panel** renders metrics using ChartWerk libraries. For now, it can render as a line and a series of bars. We are working on adding new visualizations. **Grafana Chartwerk Panel** renders metrics using ChartWerk libraries. For now, it can render as a line and a series of bars. We are working on adding new visualizations.
![image](https://user-images.githubusercontent.com/66464000/84491085-10416280-acb5-11ea-8af0-2761ed97aecc.png) ![image](https://user-images.githubusercontent.com/66464000/84491085-10416280-acb5-11ea-8af0-2761ed97aecc.png)
![image](https://user-images.githubusercontent.com/66464000/84491069-0b7cae80-acb5-11ea-959b-ef67835c8055.png) ![image](https://user-images.githubusercontent.com/66464000/84491069-0b7cae80-acb5-11ea-959b-ef67835c8055.png)
@ -23,17 +23,22 @@
- customizable grid interval. - customizable grid interval.
## Installation ## Installation
### Linux / Mac OS X ### Linux / Mac OS X
- Navigate to either: - Navigate to either:
- `<GRAFANA_PATH>/data/plugins` (when installed from tarball or source) - `<GRAFANA_PATH>/data/plugins` (when installed from tarball or source)
- or `/var/lib/grafana/plugins` (when installed from `.deb`/`.rpm` package) - or `/var/lib/grafana/plugins` (when installed from `.deb`/`.rpm` package)
- Download ChartWerk panel - Download ChartWerk panel
``` ```
wget https://github.com/chartwerk/grafana-chartwerk-app/archive/0.3.3.zip wget https://github.com/chartwerk/grafana-chartwerk-app/archive/0.3.3.zip
``` ```
- Unpack downloaded files - Unpack downloaded files
``` ```
unzip 0.3.3.zip unzip 0.3.3.zip
``` ```
@ -42,11 +47,12 @@ unzip 0.3.3.zip
- For grafana installed via Standalone Linux Binaries: - For grafana installed via Standalone Linux Binaries:
- Stop any running instances of grafana-server - Stop any running instances of grafana-server
- Start grafana-server by: - Start grafana-server by:
```$GRAFANA_PATH/bin/grafana-server``` `$GRAFANA_PATH/bin/grafana-server`
- For grafana installed via Package Manager: - For grafana installed via Package Manager:
- type in ```systemctl restart grafana-server``` - type in `systemctl restart grafana-server`
### Grafana in Docker ### Grafana in Docker
You can install ChartWerk panel to Grafana in Docker passing it as environment variable (as described in [Grafana docs](http://docs.grafana.org/installation/docker/#installing-plugins-from-other-sources)) You can install ChartWerk panel to Grafana in Docker passing it as environment variable (as described in [Grafana docs](http://docs.grafana.org/installation/docker/#installing-plugins-from-other-sources))
```bash ```bash

18006
package-lock.json generated

File diff suppressed because it is too large Load Diff

5
package.json

@ -8,12 +8,13 @@
"dev": "grafana-toolkit plugin:dev", "dev": "grafana-toolkit plugin:dev",
"watch": "grafana-toolkit plugin:dev --watch", "watch": "grafana-toolkit plugin:dev --watch",
"sign": "grafana-toolkit plugin:sign", "sign": "grafana-toolkit plugin:sign",
"start": "yarn watch" "start": "yarn watch",
"lint": "yarn prettier --write ."
}, },
"author": "CorpGlory", "author": "CorpGlory",
"license": "GPL V3", "license": "GPL V3",
"devDependencies": { "devDependencies": {
"@chartwerk/gauge-pod": "gitlab:chartwerk/gauge-pod#9982c0b7ca149dba807bf3b3fa1daddaf114f1a1", "@chartwerk/gauge-pod": "@chartwerk/gauge-pod",
"@grafana/data": "latest", "@grafana/data": "latest",
"@grafana/toolkit": "latest", "@grafana/toolkit": "latest",
"@grafana/ui": "latest", "@grafana/ui": "latest",

28
src/components/Panel.tsx

@ -7,7 +7,6 @@ import { PanelProps } from '@grafana/data';
import React, { useRef } from 'react'; import React, { useRef } from 'react';
import { css } from 'emotion'; import { css } from 'emotion';
interface Props extends PanelProps<PanelOptions> {} interface Props extends PanelProps<PanelOptions> {}
export function Panel({ options, data, width, height, timeZone, timeRange, onChangeTimeRange }: Props) { export function Panel({ options, data, width, height, timeZone, timeRange, onChangeTimeRange }: Props) {
@ -18,16 +17,27 @@ export function Panel({ options, data, width, height, timeZone, timeRange, onCha
// TODO: pass datapoints // TODO: pass datapoints
// TODO: pass options // TODO: pass options
// TODO: switch / case pod type // TODO: switch / case pod type
const pod = new ChartwerkGaugePod((chartContainer as any).current, [{ target: 'test', datapoints: [[5, 5], [0, 10], [30, 15], [50, 20], [17, 25]] }]); const pod = new ChartwerkGaugePod((chartContainer as any).current, [
{
target: 'test',
datapoints: [
[5, 5],
[0, 10],
[30, 15],
[50, 20],
[17, 25],
],
},
]);
pod.render(); pod.render();
}); });
return <div return (
ref={chartContainer} <div
className={ ref={chartContainer}
css` className={css`
width: ${width}px; width: ${width}px;
height: ${height}px; height: ${height}px;
` `}
} ></div>
></div>; );
} }

12733
yarn.lock

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save