This panel draw forcaset result of selected target data by linear regression.
- @types/d3 doesn't support enough type to use d3's library on Grafana
- so I change some type as any type
where : @type/d3 -> d3-array -> index.d.ts
how : insert 'any type' in max interface
- In the end, adove one is not able to pass CircleCI pipline test
- So I changed my code as any type to pass it
- CircleCI reinstalls all dependencies and test your code with strong prettier and lint rules
- I recommend you to check your code in CircleCI when you do pull request to grafana plugin repository.
Using Docker:
- Clone the repository and
cd
to it - make sure you have yarn installed
- install project dependencies:
yarn install --pure-lockfile
- Start the "watch" task:
yarn watch
- Run a local Grafana instance with the development version of the plugin:
docker run -p 3000:3000 -d --name grafana-plugin-dev --volume $(pwd)/dist:/var/lib/grafana/plugins/clock-panel grafana/grafana
- Check the logs to see that Grafana has started up:
docker logs -f grafana-plugin-dev
- Open Grafana at http://localhost:3000/
- Log in with username "admin" and password "admin"
- Create new dashboard and add the plugin
To build a production build with minification: yarn build
https://grafana.com/tutorials/build-a-panel-plugin-with-d3/#8
- CircleCI pipline 을 통해서 코딩 규칙 테스트 완료후 진행
- pull request 는 github.com 온라인 페이지에서 진행
- bellow is a image for how to do pull request to Grafana plugin
d3-array -> index.d.ts 관련부분
export function max(array: ArrayLike, accessor: (datum: T, index: number, array: ArrayLike) => any | string | undefined | null): any | string | undefined; export function min(array: ArrayLike, accessor: (datum: T, index: number, array: ArrayLike) => any | string | undefined | null): any | string | undefined;
package.json 부분
"dependencies": { "@types/d3": "^5.7.2", "@types/d3-array": "file:MyModule/d3-array" }, "resolutions": { "@types/d3-array": "1.2.7" }