Skip to content

Commit bd71fb9

Browse files
authored
Edit of READMEs for app examples (#229)
* Light edit of app examples * Edit titles for consistency
1 parent 883c2a9 commit bd71fb9

File tree

9 files changed

+77
-76
lines changed

9 files changed

+77
-76
lines changed

Diff for: README.md

+27-27
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,34 @@ This repository contains example plugins to showcase different use cases.
66

77
| Example | Description |
88
| ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
9-
| [app-basic](examples/app-basic) | demonstrates how to build a basic app plugin that uses custom routing. |
10-
| [app-with-dashboards](examples/app-with-dashboards) | demonstrates how to include pre-built dashboards in an app plugin. |
11-
| [app-with-backend](examples/app-with-backend) | demonstrates how to build an app plugin with its own backend. |
12-
| [app-with-extensions](examples/app-with-extensions) | demonstrates how to build an app plugin that extends the Grafana core ui. |
13-
| [app-with-extension-point](examples/app-with-extension-point) | demonstrates how to add an extension point in the plugin UI that can be extended by other plugins |
14-
| [app-with-scenes](examples/app-with-scenes) | demonstrates how to build a basic app with [@grafana/scenes](https://github.com/grafana/scenes/) |
9+
| [app-basic](examples/app-basic) | Shows how to build a basic app plugin that uses custom routing |
10+
| [app-with-dashboards](examples/app-with-dashboards) | Shows how to include pre-built dashboards in an app plugin |
11+
| [app-with-backend](examples/app-with-backend) | Shows how to build an app plugin with its own backend |
12+
| [app-with-extensions](examples/app-with-extensions) | Shows how to build an app plugin that extends the Grafana core UI |
13+
| [app-with-extension-point](examples/app-with-extension-point) | Shows how to add an extension point in the plugin UI that can be extended by other plugins |
14+
| [app-with-scenes](examples/app-with-scenes) | Shows how to build a basic app with [@grafana/scenes](https://github.com/grafana/scenes/) |
1515

1616
## Panel plugins
1717

1818
| Example | Description |
1919
| ------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
20-
| [panel-flot](examples/panel-flot) | demonstrates how to use the [Flot](http://www.flotcharts.org) plotting library in a panel plugin. |
21-
| [panel-frame-select](examples/panel-frame-select) | demonstrates how to update panel options with values from a data query response. |
22-
| [panel-plotly](examples/panel-plotly) | demonstrates how to use the [Plotly](https://plotly.com/javascript/) graphing library in a panel plugin. |
23-
| [panel-scatterplot](examples/panel-scatterplot) | demonstrates how to use D3 and SVG to create a scatter plot panel. |
24-
| [panel-visx](examples/panel-visx) | demonstrates how to use [visx](https://github.com/airbnb/visx) to create a time series graph. |
25-
| [panel-basic](examples/panel-basic) | demonstrates how to build a panel plugin that uses the time series graph from `@grafana/ui` to read and update the dashboard time range. |
26-
| [panel-datalinks](examples/panel-datalinks) | demonstrates how to build a panel plugin that uses the datalinks functionality of Grafana. |
20+
| [panel-flot](examples/panel-flot) | Shows how to use the [Flot](http://www.flotcharts.org) plotting library in a panel plugin. |
21+
| [panel-frame-select](examples/panel-frame-select) | Shows how to update panel options with values from a data query response. |
22+
| [panel-plotly](examples/panel-plotly) | Shows how to use the [Plotly](https://plotly.com/javascript/) graphing library in a panel plugin. |
23+
| [panel-scatterplot](examples/panel-scatterplot) | Shows how to use D3 and SVG to create a scatter plot panel. |
24+
| [panel-visx](examples/panel-visx) | Shows how to use [visx](https://github.com/airbnb/visx) to create a time series graph. |
25+
| [panel-basic](examples/panel-basic) | Shows how to build a panel plugin that uses the time series graph from `@grafana/ui` to read and update the dashboard time range. |
26+
| [panel-datalinks](examples/panel-datalinks) | Shows how to build a panel plugin that uses the datalinks functionality of Grafana. |
2727

2828
## Data source plugins
2929

3030
| Example | Description |
3131
| ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
32-
| [datasource-http](examples/datasource-http) | demonstrates how to query data from HTTP-based APIs. The HTTP call happens on the frontend. |
33-
| [datasource-http-backend](examples/datasource-http-backend) | demonstrates how to query data from HTTP-based APIs, where the HTTP calls happens on the backend. Supports alerting. |
34-
| [datasource-streaming-websocket](examples/datasource-streaming-websocket) | demonstrates how to create an event-based data source plugin using RxJS and web sockets. |
35-
| [datasource-streaming-backend-websocket](examples/datasource-streaming-backend-websocket) | demonstrates how to create an event-based data source plugin using backend streams. |
36-
| [datasource-basic](examples/datasource-basic) | demonstrates how to build a basic data source plugin. |
32+
| [datasource-http](examples/datasource-http) | Shows how to query data from HTTP-based APIs. The HTTP call happens on the frontend. |
33+
| [datasource-http-backend](examples/datasource-http-backend) | Shows how to query data from HTTP-based APIs, where the HTTP calls happens on the backend. Supports alerting. |
34+
| [datasource-streaming-websocket](examples/datasource-streaming-websocket) | Shows how to create an event-based data source plugin using RxJS and WebSockets. |
35+
| [datasource-streaming-backend-websocket](examples/datasource-streaming-backend-websocket) | Shows how to create an event-based data source plugin using backend streams. |
36+
| [datasource-basic](examples/datasource-basic) | Shows how to build a basic data source plugin. |
3737

3838
## Integration tests
3939

@@ -45,7 +45,7 @@ Some of the examples in this repository contain integration tests that make use
4545

4646
### Testing against latest versions of Grafana
4747

48-
There is a github workflow `.github/workflows/integration-tests.yml` which finds all plugin examples identified by the existence of `src/plugin.json`. For every example plugin build scripts will be run to confirm the plugins can be built against intended and canary npm packages. Any example plugin that has a cypress directory defined it will run the following:
48+
The GitHub workflow `.github/workflows/integration-tests.yml` finds all plugin examples identified by the existence of `src/plugin.json`. For every example plugin build scripts will be run to confirm the plugins can be built against intended and canary NPM packages. Any example plugin that has a cypress directory defined will run the following:
4949

5050
1. Build the plugin with the provided version of Grafana packages and test against the provided version of Grafana
5151
- _asserting the plugin works with its expected versions_
@@ -58,29 +58,29 @@ There is a github workflow `.github/workflows/integration-tests.yml` which finds
5858

5959
All of the examples use [grafana/create-plugin](https://grafana.com/developers/plugin-tools) instead of `@grafana/toolkit`.
6060

61-
You can read more about customizing and extending the base configuration [here](https://grafana.com/developers/plugin-tools/create-a-plugin/extend-a-plugin/extend-configurations)
61+
You can read more about customizing and extending the base configuration in our [documentation](https://grafana.com/developers/plugin-tools/create-a-plugin/extend-a-plugin/extend-configurations).
6262

6363
## API Compatibility
6464

65-
If your plugin uses typescript you can use [`@grafana/levitate`](https://github.com/grafana/levitate/) to test if the Grafana APIs your plugin is using are compatible with a certain version of Grafana.
65+
If your plugin uses TypeScript, then you can use [`@grafana/levitate`](https://github.com/grafana/levitate/) to test if the Grafana APIs your plugin is using are compatible with a certain version of Grafana.
6666

67-
e.g. to see a compatibility report of your plugin code and the latest release of the grafana APIs
67+
For example, to see a compatibility report of your plugin code and the latest release of the grafana APIs, use:
6868

6969
```
7070
npx @grafana/levitate@latest is-compatible --path src/module.ts --target @grafana/data,@grafana/ui,@grafana/runtime
7171
7272
```
7373

74-
you may also specify a target version
74+
You may also specify a target version:
7575

7676
```
7777
npx @grafana/levitate@latest is-compatible --path src/module.ts --target @grafana/[email protected],@grafana/[email protected],@grafana/[email protected]
7878
7979
```
8080

81-
The following github workflow example can be used in your project to keep an eye on the compatibility of your plugin and the grafana API.
81+
The following GitHub workflow example can be used in your project to keep an eye on the compatibility of your plugin and the grafana API.
8282

83-
If you host your project in GitHub and want to use [GitHub Actions](https://docs.github.com/en/actions). You could create a new file in your project in `.github/workflows/levitate.yml` and put the following content:
83+
If you host your project in GitHub and want to use [GitHub Actions](https://docs.github.com/en/actions), then you could create a new file in your project in `.github/workflows/levitate.yml` and add the following content:
8484

8585
```yaml
8686
name: Compatibility check
@@ -106,6 +106,6 @@ jobs:
106106
fail-if-incompatible: "no"
107107
```
108108
109-
This will run a compatibility check for the latest release of grafana plugins API in your project everytime a new push or pull request is open. If it reports an error you will see a message indicating you have an incompatibility.
109+
This runs a compatibility check for the latest release of Grafana plugins API in your project every time a new push or pull request is open. If it finds an error you will see a message indicating you have an incompatibility.
110110
111-
Sometimes incompatibilities are minor. e.g. a type changed but this doesn't affect your plugin. We advice you to upgrade your grafana dependencies if this is the case so you always use the latest API.
111+
Sometimes incompatibilities are minor. For example, a type changed but this doesn't affect your plugin. We recommend that you upgrade your Grafana dependencies if this is the case so you always use the latest API.

Diff for: examples/app-basic/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Grafana Basic App plugin
1+
# Grafana Basic App plugin example
22

33
The Grafana Basic App plugin sample demonstrates how to build a basic app plugin for Grafana with custom routing.
44

Diff for: examples/app-with-backend/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# Grafana App with Backend Plugin Template
1+
# Grafana App with Backend Plugin example
22

33
This template is a starting point for building an app plugin for Grafana. It includes a backend component.
44

55
## What are Grafana app plugins?
66

7-
App plugins can let you create a custom out-of-the-box monitoring experience by custom pages, nested datasources and panel plugins. A backend allows it to perform a variety of additional tasks, like handling incoming HTTP requests.
7+
App plugins can let you create a custom out-of-the-box monitoring experience by including custom pages, nested data sources, and panel plugins. A backend allows it to perform a variety of additional tasks, like handling incoming HTTP requests.
88

9-
## Getting started
9+
## Get started
1010

1111
### Frontend
1212

@@ -95,4 +95,4 @@ Below you can find source code for existing app plugins and other related docume
9595

9696
- [All plugin examples](https://github.com/grafana/grafana-plugin-examples/tree/master/examples/)
9797
- [Plugin.json documentation](https://grafana.com/developers/plugin-tools/reference-plugin-json)
98-
- [How to sign a plugin?](https://grafana.com/developers/plugin-tools/publish-a-plugin/sign-a-plugin)
98+
- [Sign a plugin](https://grafana.com/developers/plugin-tools/publish-a-plugin/sign-a-plugin)

Diff for: examples/app-with-dashboards/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# Grafana App Plugin Template
1+
# Grafana App with Dashboards Plugin example
22

3-
This template is a starting point for building an app plugin for Grafana.
3+
This template is a starting point for building an app plugin for Grafana. It includes a dashboard.
44

55
## What are Grafana app plugins?
66

7-
App plugins can let you create a custom out-of-the-box monitoring experience by custom pages, nested datasources and panel plugins.
7+
App plugins can let you create a custom out-of-the-box monitoring experience by custom pages, nested datas ources, and panel plugins.
88

9-
## Getting started
9+
## Get started
1010

1111
### Frontend
1212

@@ -74,4 +74,4 @@ Below you can find source code for existing app plugins and other related docume
7474

7575
- [Basic app plugin example](https://github.com/grafana/grafana-plugin-examples/tree/master/examples/app-basic#readme)
7676
- [Plugin.json documentation](https://grafana.com/developers/plugin-tools/reference-plugin-json)
77-
- [How to sign a plugin?](https://grafana.com/developers/plugin-tools/publish-a-plugin/sign-a-plugin)
77+
- [Sign a plugin](https://grafana.com/developers/plugin-tools/publish-a-plugin/sign-a-plugin)

Diff for: examples/app-with-extension-point/README.md

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Grafana App Plugin which adds a plugin UI extension point
1+
# Grafana App Plugin with UI extension point example
22

33
This example demonstrates how to add a plugin extension point that can be extended by other plugins. It works by bundling three different app plugins within the same bundle. First we have the `myorg-extensionpoint-app` that creates an extension point. Then we have the `src/plugins/myorg-a-app` and `src/plugins/myorg-b-app` that extends the `myorg-extensionpoint-app` UI with links.
44

@@ -8,27 +8,27 @@ This example demonstrates how to add a plugin extension point that can be extend
88

99
| **Example** | **Source** |
1010
| ---------------------------------------------------------------- | ---------------- |
11-
| [How to add an extension point?](#how-to-add-an-extension-point) | [`App.ts#L12-18`](./src/components/App/App.tsx#L12-18) |
11+
| [Add an extension point](#add-an-extension-point) | [`App.ts#L12-18`](./src/components/App/App.tsx#L12-18) |
1212

13-
### How to add an extension point?
13+
### Add an extension point
1414

1515
**Example:** [`App.ts#L12-18`](./src/components/App/App.tsx#L12-18)
1616

17-
The first thing you need to do is to define a id for your extension point. Each extension point needs an unique identifier that other plugins can reference when adding extensions. It should be in the following format: `plugins/<your-plugin-id>/<extension-name>`, where:
17+
1. Define an ID for your extension point. Each extension point needs an unique identifier that other plugins can reference when adding extensions. It should be in the following format: `plugins/<your-plugin-id>/<extension-name>`, where:
1818

19-
- `<your-plugin-id>` is the full ID of your plugin, e.g. `"myorg-b-app"`
20-
- `<extension-name>` is an identifier for the extension point, unique inside your plugin, e.g. `"header"`
19+
- `<your-plugin-id>` is the full ID of your plugin, e.g., `"myorg-b-app"`
20+
- `<extension-name>` is an identifier for the extension point, unique inside your plugin, e.g. `"header"`
2121

22-
The next thing you need to do is to call `getPluginExtensions` with the defined `pluginExtensionId` and Grafana will return all extensions added for that placement.
22+
2. Call `getPluginExtensions` with the defined `pluginExtensionId` and Grafana will return all extensions added for that placement.
2323

24-
```typescript
25-
const placement = 'plugins/myorg-extensionpoint-app/actions';
26-
const context: AppExtensionContext = {};
24+
```typescript
25+
const placement = 'plugins/myorg-extensionpoint-app/actions';
26+
const context: AppExtensionContext = {};
2727

28-
const { extensions } = getPluginExtensions({
29-
placement,
30-
context,
31-
});
32-
```
28+
const { extensions } = getPluginExtensions({
29+
placement,
30+
context,
31+
});
32+
```
3333

3434
---

Diff for: examples/app-with-extensions/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Grafana App extending Grafana core ui template
1+
# Grafana App extending Grafana Core UI example
22

3-
> Note! This feature is available in Grafana 9.5 and above
3+
> Note: This feature is available in Grafana 9.5 and later versions.
44
5-
This example demonstrates how to extend the core Grafana UI with plugin extensions. The only thing you need to do is to configure your extension points in your app. See `src/module.tsx` for a full example.
5+
This example demonstrates how to extend the core Grafana UI with plugin extensions. The only thing you need to do is to configure your extension points in your app. Refer to `src/module.tsx` for a full example.

0 commit comments

Comments
 (0)