├── .nvmrc ├── provisioning ├── dashboards │ ├── .gitkeep │ └── test-dashboard.json └── README.md ├── .cprc.json ├── cypress.json ├── .config ├── .cprc.json ├── webpack │ ├── constants.ts │ ├── utils.ts │ └── webpack.config.ts ├── .prettierrc.js ├── .eslintrc ├── types │ └── custom.d.ts ├── Dockerfile ├── tsconfig.json ├── jest-setup.js ├── jest │ ├── mocks │ │ └── react-inlinesvg.tsx │ └── utils.js ├── jest.config.js └── README.md ├── .envrc ├── .eslintrc ├── tsconfig.json ├── jest-setup.js ├── CHANGELOG.md ├── windrose-light.png ├── dist ├── CHANGELOG.md ├── README.md ├── plugin.json ├── module.js ├── img │ └── logo.svg ├── module.js.map └── LICENSE ├── .prettierrc.js ├── src ├── README.md ├── types.ts ├── plugin.json ├── module.ts ├── components │ └── SimplePanel.tsx └── img │ └── logo.svg ├── cypress └── integration │ └── 01-smoke.spec.ts ├── jest.config.js ├── docker-compose.yaml ├── .gitignore ├── package.json ├── README.md └── LICENSE /.nvmrc: -------------------------------------------------------------------------------- 1 | 20 2 | -------------------------------------------------------------------------------- /provisioning/dashboards/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.cprc.json: -------------------------------------------------------------------------------- 1 | { 2 | "features": {} 3 | } 4 | -------------------------------------------------------------------------------- /cypress.json: -------------------------------------------------------------------------------- 1 | { 2 | "video": false 3 | } 4 | -------------------------------------------------------------------------------- /.config/.cprc.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "3.1.2" 3 | } 4 | -------------------------------------------------------------------------------- /.envrc: -------------------------------------------------------------------------------- 1 | export PATH="`realpath ./node_modules/.bin/`:$PATH" 2 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./.config/.eslintrc" 3 | } 4 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./.config/tsconfig.json" 3 | } 4 | -------------------------------------------------------------------------------- /jest-setup.js: -------------------------------------------------------------------------------- 1 | // Jest setup provided by Grafana scaffolding 2 | import './.config/jest-setup'; 3 | -------------------------------------------------------------------------------- /.config/webpack/constants.ts: -------------------------------------------------------------------------------- 1 | export const SOURCE_DIR = 'src'; 2 | export const DIST_DIR = 'dist'; 3 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## 0.0.2 (Unreleased) 4 | 5 | Initial release of React version. 6 | -------------------------------------------------------------------------------- /windrose-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spectraphilic/grafana-windrose/HEAD/windrose-light.png -------------------------------------------------------------------------------- /dist/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## 0.0.2 (Unreleased) 4 | 5 | Initial release of React version. 6 | -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | // Prettier configuration provided by Grafana scaffolding 3 | ...require('./.config/.prettierrc.js'), 4 | }; 5 | -------------------------------------------------------------------------------- /provisioning/README.md: -------------------------------------------------------------------------------- 1 | For more information see [Provision dashboards and data sources](https://grafana.com/tutorials/provision-dashboards-and-data-sources/) 2 | -------------------------------------------------------------------------------- /src/README.md: -------------------------------------------------------------------------------- 1 | # Windrose panel plugin 2 | 3 | Example query: 4 | 5 | SELECT 6 | $timeSeries as t, 7 | WS_16_33_1_1_1 AS "speed", 8 | WD_20_35_1_1_1 AS "direction" 9 | FROM $table 10 | WHERE $timeFilter 11 | ORDER BY t 12 | -------------------------------------------------------------------------------- /dist/README.md: -------------------------------------------------------------------------------- 1 | # Windrose panel plugin 2 | 3 | Example query: 4 | 5 | SELECT 6 | $timeSeries as t, 7 | WS_16_33_1_1_1 AS "speed", 8 | WD_20_35_1_1_1 AS "direction" 9 | FROM $table 10 | WHERE $timeFilter 11 | ORDER BY t 12 | -------------------------------------------------------------------------------- /cypress/integration/01-smoke.spec.ts: -------------------------------------------------------------------------------- 1 | import { e2e } from '@grafana/e2e'; 2 | 3 | e2e.scenario({ 4 | describeName: 'Smoke test', 5 | itName: 'Smoke test', 6 | scenario: () => { 7 | e2e.pages.Home.visit(); 8 | e2e().contains('Welcome to Grafana').should('be.visible'); 9 | }, 10 | }); 11 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | // force timezone to UTC to allow tests to work regardless of local timezone 2 | // generally used by snapshots, but can affect specific tests 3 | process.env.TZ = 'UTC'; 4 | 5 | module.exports = { 6 | // Jest configuration provided by Grafana scaffolding 7 | ...require('./.config/jest.config'), 8 | }; 9 | -------------------------------------------------------------------------------- /.config/.prettierrc.js: -------------------------------------------------------------------------------- 1 | /* 2 | * ⚠️⚠️⚠️ THIS FILE WAS SCAFFOLDED BY `@grafana/create-plugin`. DO NOT EDIT THIS FILE DIRECTLY. ⚠️⚠️⚠️ 3 | * 4 | * In order to extend the configuration follow the steps in .config/README.md 5 | */ 6 | 7 | module.exports = { 8 | endOfLine: 'auto', 9 | printWidth: 120, 10 | trailingComma: 'es5', 11 | semi: true, 12 | jsxSingleQuote: false, 13 | singleQuote: true, 14 | useTabs: false, 15 | tabWidth: 2, 16 | }; 17 | -------------------------------------------------------------------------------- /src/types.ts: -------------------------------------------------------------------------------- 1 | type GridLabels = 'degrees' | 'compass'; 2 | type Scale = 'absolute' | 'percent'; 3 | 4 | export interface SimpleOptions { 5 | slices: number, 6 | rings: number, 7 | x_grid: GridLabels, 8 | opacity: number, 9 | start: number, 10 | step: string, 11 | unit: string, 12 | scale: Scale, 13 | windroseAlignment: 'center' | 'left' | 'top'| 'bottom'; 14 | legendFontSize: number; 15 | speedFontSize: number; 16 | directionFontSize: number; 17 | } 18 | -------------------------------------------------------------------------------- /docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: '3.0' 2 | 3 | services: 4 | grafana: 5 | container_name: 'spectraphilic-windrose-panel' 6 | platform: 'linux/amd64' 7 | build: 8 | context: ./.config 9 | args: 10 | grafana_image: ${GRAFANA_IMAGE:-grafana-enterprise} 11 | grafana_version: ${GRAFANA_VERSION:-10.0.3} 12 | ports: 13 | - 3000:3000/tcp 14 | volumes: 15 | - ./dist:/var/lib/grafana/plugins/spectraphilic-windrose-panel 16 | - ./provisioning:/etc/grafana/provisioning 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules/ 2 | .*.swp 3 | 4 | # Logs 5 | logs 6 | *.log 7 | npm-debug.log* 8 | yarn-debug.log* 9 | yarn-error.log* 10 | .pnpm-debug.log* 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | 24 | # Compiled binary addons (https://nodejs.org/api/addons.html) 25 | artifacts/ 26 | work/ 27 | ci/ 28 | e2e-results/ 29 | **/cypress/videos 30 | **/cypress/report.json 31 | 32 | # Editor 33 | .idea 34 | 35 | .eslintcache 36 | -------------------------------------------------------------------------------- /.config/.eslintrc: -------------------------------------------------------------------------------- 1 | /* 2 | * ⚠️⚠️⚠️ THIS FILE WAS SCAFFOLDED BY `@grafana/create-plugin`. DO NOT EDIT THIS FILE DIRECTLY. ⚠️⚠️⚠️ 3 | * 4 | * In order to extend the configuration follow the steps in 5 | * https://grafana.com/developers/plugin-tools/create-a-plugin/extend-a-plugin/extend-configurations#extend-the-eslint-config 6 | */ 7 | { 8 | "extends": ["@grafana/eslint-config"], 9 | "root": true, 10 | "rules": { 11 | "react/prop-types": "off" 12 | }, 13 | "overrides": [ 14 | { 15 | "plugins": ["deprecation"], 16 | "files": ["src/**/*.{ts,tsx}"], 17 | "rules": { 18 | "deprecation/deprecation": "warn" 19 | }, 20 | "parserOptions": { 21 | "project": "./tsconfig.json" 22 | } 23 | } 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /.config/types/custom.d.ts: -------------------------------------------------------------------------------- 1 | // Image declarations 2 | declare module '*.gif' { 3 | const src: string; 4 | export default src; 5 | } 6 | 7 | declare module '*.jpg' { 8 | const src: string; 9 | export default src; 10 | } 11 | 12 | declare module '*.jpeg' { 13 | const src: string; 14 | export default src; 15 | } 16 | 17 | declare module '*.png' { 18 | const src: string; 19 | export default src; 20 | } 21 | 22 | declare module '*.webp' { 23 | const src: string; 24 | export default src; 25 | } 26 | 27 | declare module '*.svg' { 28 | const content: string; 29 | export default content; 30 | } 31 | 32 | // Font declarations 33 | declare module '*.woff'; 34 | declare module '*.woff2'; 35 | declare module '*.eot'; 36 | declare module '*.ttf'; 37 | declare module '*.otf'; 38 | -------------------------------------------------------------------------------- /.config/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG grafana_version=latest 2 | ARG grafana_image=grafana-enterprise 3 | 4 | FROM grafana/${grafana_image}:${grafana_version} 5 | 6 | # Make it as simple as possible to access the grafana instance for development purposes 7 | # Do NOT enable these settings in a public facing / production grafana instance 8 | ENV GF_AUTH_ANONYMOUS_ORG_ROLE "Admin" 9 | ENV GF_AUTH_ANONYMOUS_ENABLED "true" 10 | ENV GF_AUTH_BASIC_ENABLED "false" 11 | # Set development mode so plugins can be loaded without the need to sign 12 | ENV GF_DEFAULT_APP_MODE "development" 13 | 14 | # Inject livereload script into grafana index.html 15 | USER root 16 | RUN sed -i 's/<\/body><\/html>/