티스토리 뷰
아.. 이 글을 쓰는 이유는 너무 삽질해서 기록하려고 쓴다.
vuex에 Plotly.js 차트 사용하려는데, vue-plotly가 안읽혀서, 차트가 계속 안그려졌다.
config에도 추가해보고 npm으로 이것저것 다 다운로드 해보고, 공식페이지도 들어가서 했는데 결국 안됐다..
참고 사이트 :
https://bestofvue.com/repo/David-Desmaisons-vue-plotly-vuejs-charts
📈 vue wrapper for plotly.js | BestofVue
David-Desmaisons/vue-plotly, vue-plotly Thin vue wrapper for plotly.js It provides: all plotly.js methods and events data reactivity Redraw on resizing Live example https://david-
bestofvue.com
https://www.npmjs.com/package/vue-plotly
vue-plotly
<p align="center"><img width="140"src="https://raw.githubusercontent.com/David-Desmaisons/vue-plotly/master/example/assets/logo.png"></p>
www.npmjs.com
만약 vue-plotly 아시는분 알려주세요 ㅜㅜ (->궁서체 진심입니다..)
일단, 나는 빨리 구현해야했기 때문에,
https://github.com/plotly/plotly.js/
GitHub - plotly/plotly.js: Open-source JavaScript charting library behind Plotly and Dash
Open-source JavaScript charting library behind Plotly and Dash - GitHub - plotly/plotly.js: Open-source JavaScript charting library behind Plotly and Dash
github.com
이것을 보고 따라했다..
npm i --save plotly.js-dist-min
import 는
// ES6 module
import Plotly from 'plotly.js-dist-min'
// CommonJS
var Plotly = require('plotly.js-dist-min')
typescript를 사용해서, 에러도 많이 떴는데, 이것저것 tsconfig.json에 추가해서 에러 안나고 차트가 잘 그려졌다.
How to fix error TS7016: Could not find a declaration file for module ‘XYZ’ has an ‘any’ type
If you’re using TypeScript you might have run into this error before. The second part of the error says:
pjausovec.medium.com
'Vue' 카테고리의 다른 글
Vue error: The template requires child element vue/valid-template-root (0) | 2023.03.07 |
---|---|
Vue + HighChart (0) | 2022.01.10 |
Vue Error : Failed to resolve loader (sass-loader) (0) | 2021.12.01 |
- Total
- Today
- Yesterday
- Vue # Vuex #Plotly.js
- loop
- rasberrypi
- java
- 기초
- window
- mouse event
- vue
- 개발일기
- list자료형
- ubuntu
- OpenCV
- error
- 생성자
- Python
- javascript
- vue #error #npm
- Numpy
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |