├── .github ├── ISSUE_TEMPLATE │ └── bug_report.md └── workflows │ └── browser-test.yml ├── .gitignore ├── .npmrc ├── .prettierrc ├── .vscode └── settings.json ├── CHANGELOG.md ├── LICENSE ├── README.md ├── debug ├── nuxt3 │ ├── .gitignore │ ├── .npmrc │ ├── README.md │ ├── app.vue │ ├── nuxt.config.ts │ ├── package.json │ ├── plugins │ │ └── chartjs.client.ts │ ├── tsconfig.json │ └── yarn.lock ├── vite │ ├── .gitignore │ ├── .vscode │ │ └── extensions.json │ ├── README.md │ ├── index.html │ ├── package.json │ ├── pnpm-lock.yaml │ ├── public │ │ └── favicon.ico │ ├── src │ │ ├── App.vue │ │ ├── cases │ │ │ └── PushData.vue │ │ ├── env.d.ts │ │ └── main.ts │ ├── tsconfig.json │ └── vite.config.ts └── vue-cli │ ├── .eslintignore │ ├── .eslintrc.js │ ├── .gitignore │ ├── README.md │ ├── babel.config.js │ ├── package.json │ ├── pnpm-lock.yaml │ ├── public │ ├── favicon.ico │ └── index.html │ ├── src │ ├── App.vue │ ├── main.ts │ ├── mixed.d.ts │ └── shims-vue.d.ts │ ├── tsconfig.json │ └── yarn.lock ├── docs ├── .vuepress │ ├── config.ts │ ├── public │ │ ├── favicon.ico │ │ └── images │ │ │ ├── logo.png │ │ │ └── logo.svg │ └── styles │ │ ├── index.scss │ │ └── palette.scss ├── README.md ├── components │ ├── README.md │ └── hooks │ │ ├── README.md │ │ └── example.md ├── guide │ ├── README.md │ ├── configuration │ │ ├── README.md │ │ └── plugins.md │ ├── examples.md │ ├── examples │ │ ├── nuxt2.md │ │ ├── vue2-class.md │ │ ├── vue2-composition.md │ │ └── vue3.md │ └── usage │ │ ├── README.md │ │ ├── actions.md │ │ ├── chart-instance.md │ │ ├── dynamic-data.md │ │ ├── manual-update.md │ │ └── typescript.md └── package.json ├── media └── logo.svg ├── package.json ├── pnpm-lock.yaml ├── src ├── core │ ├── component.builder.ts │ ├── component.types.ts │ └── index.ts ├── exports │ ├── component.exports.ts │ ├── hooks.exports.ts │ └── index.ts ├── hooks │ ├── hooks.builder.ts │ ├── hooks.types.ts │ └── index.ts ├── index.ts ├── misc │ ├── index.ts │ └── vue.types.ts └── utils │ ├── format.utils.ts │ ├── index.ts │ └── types.utils.ts ├── tests ├── setup.d.ts ├── setup.ts ├── unit │ ├── components │ │ └── BarChart.spec.ts │ └── vue3.spec.ts └── utils │ ├── index.ts │ ├── misc.utils.ts │ └── setup.utils.ts ├── tsconfig.build.json ├── tsconfig.json ├── tsup.config.ts └── vite.config.ts /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "\U0001F41E Bug report" 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | ## Describe the bug 11 | *A clear and concise description of what the bug is.* 12 | 13 | # Remember, `vue-chart-3` is only an *adapter* to use `chart.js` with Vue easily. So any `chart.js` related issue or question will be dismissed 14 | 15 | ## To Reproduce 16 | 17 | *Put a reproduction link here based on this templates* 18 | 19 | - [Template for Vue 3](https://codesandbox.io/s/demo-vue-chart-3-ugynm) 20 | - [Template for Vue 2](https://codesandbox.io/s/vue-chart-3-vue-2-composition-api-mw54f) 21 | - [Template for Nuxt 2](https://codesandbox.io/s/vue-chart-3-nuxt-2-mrtej) 22 | 23 | ## Version of `vue-chart-3` 24 | *ex: v3.0.2* 25 | 26 | ## Version of Vue 27 | 28 | - [ ] Vue 3 29 | - [ ] Vue 2 30 | - [ ] Nuxt 2 31 | - [ ] Nuxt 3 32 | -------------------------------------------------------------------------------- /.github/workflows/browser-test.yml: -------------------------------------------------------------------------------- 1 | name: Node.js CI 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | build: 7 | 8 | runs-on: ubuntu-latest 9 | 10 | strategy: 11 | matrix: 12 | node-version: [14.x] 13 | 14 | steps: 15 | - uses: actions/checkout@v2 16 | - name: Use Node.js ${{ matrix.node-version }} 17 | uses: actions/setup-node@v1 18 | with: 19 | node-version: ${{ matrix.node-version }} 20 | - run: yarn 21 | - run: yarn test 22 | env: 23 | CI: true -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | .temp 18 | .cache 19 | .DS_STORE 20 | 21 | # Directory for instrumented libs generated by jscoverage/JSCover 22 | lib-cov 23 | 24 | # Coverage directory used by tools like istanbul 25 | coverage 26 | *.lcov 27 | 28 | # nyc test coverage 29 | .nyc_output 30 | 31 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 32 | .grunt 33 | 34 | # Bower dependency directory (https://bower.io/) 35 | bower_components 36 | 37 | # node-waf configuration 38 | .lock-wscript 39 | 40 | # Compiled binary addons (https://nodejs.org/api/addons.html) 41 | build/Release 42 | 43 | # Dependency directories 44 | node_modules/ 45 | jspm_packages/ 46 | 47 | # TypeScript v1 declaration files 48 | typings/ 49 | types/ 50 | 51 | # TypeScript cache 52 | *.tsbuildinfo 53 | 54 | # Optional npm cache directory 55 | .npm 56 | 57 | # Optional eslint cache 58 | .eslintcache 59 | 60 | # Microbundle cache 61 | .rpt2_cache/ 62 | .rts2_cache_cjs/ 63 | .rts2_cache_es/ 64 | .rts2_cache_umd/ 65 | 66 | # Optional REPL history 67 | .node_repl_history 68 | 69 | # Output of 'npm pack' 70 | *.tgz 71 | 72 | # Yarn Integrity file 73 | .yarn-integrity 74 | 75 | # dotenv environment variables file 76 | .env 77 | .env.test 78 | 79 | # parcel-bundler cache (https://parceljs.org/) 80 | .cache 81 | 82 | # Next.js build output 83 | .next 84 | 85 | # Nuxt.js build / generate output 86 | .nuxt 87 | dist 88 | 89 | # Gatsby files 90 | .cache/ 91 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 92 | # https://nextjs.org/blog/next-9-1#public-directory-support 93 | # public 94 | 95 | # vuepress build output 96 | .vuepress/dist 97 | 98 | # Serverless directories 99 | .serverless/ 100 | 101 | # FuseBox cache 102 | .fusebox/ 103 | 104 | # DynamoDB Local files 105 | .dynamodb/ 106 | 107 | # TernJS port file 108 | .tern-port 109 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | shamefully-hoist = true -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 100, 3 | "tabWidth": 2, 4 | "trailingComma": "es5", 5 | "singleQuote": true, 6 | "semi": true, 7 | "bracketSpacing": true 8 | } 9 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "typescript.tsdk": "node_modules/typescript/lib" 3 | } -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | # 3.1.3 (2022-03-08) 7 | 8 | - Fixed array mutation call stack loop #58 9 | - Fixed animations for array mutations 10 | 11 | # 3.1.2 (2022-02-23) 12 | 13 | - Fixed pascalCase 14 | 15 | # 3.1.1 (2022-02-22) 16 | 17 | - Fixed @vue/runtime-[core|dom] peer deps 18 | - Refacto unit tests 19 | 20 | # 3.1.0 (2022-02-15) 21 | 22 | - Refactored the project to add esm and cjs builds 23 | - Compatible with Vite.js and Nuxt 3 24 | - Changed Jest to Vitest ⚡️ 25 | - Fixed docs 26 | - Added useful JSdocs 27 | - more 28 | 29 | # 3.0.9 (2022-01-21) 30 | 31 | # 3.0.0 and 2.0.0 (2021-11-23) 32 | 33 | - Breaking changes and new versions numbers 34 | 35 | In previous versions, `vue-demi` was used. It worked really well, but as the project advanced, they were a lot of problems with vue-related typescript definitions, tests and conflict between dependencies. 36 | 37 | This new system will keep `vue-chart-3` working for both Vue 2 & 3 with designated versions (`2.x` and `3.x` respectively), but each one designed for their specific Vue version. 38 | 39 | The usage of components of hooks is unchanged for both versions. 40 | 41 | Code wise, there is not big breaking changes. But the Vue 3 version will have improved type checking for components template (with Volar extension). 42 | 43 | - New docs using vuepress next! 44 | 45 | # 0.5.10 (2021-10-27) 46 | 47 | - Fixed types for Vue 3 imports 48 | 49 | # 0.5.10 (2021-10-25) 50 | 51 | - Fix `postinstall` bugs with npm update 52 | 53 | # 0.5.9 (2021-10-25) 54 | 55 | - Fix `Plugin` types in hooks 56 | 57 | # 0.4.7 (2021-07-18) 58 | 59 | - `chartInstance` is now accessible by reference to the component! 60 | 61 | # 0.4.5 (2021-07-18) 62 | 63 | - Fixed call stack loop when using reactive options using data or ref 64 | - Fixed bundle size thanks to @DRoet 65 | 66 | # 0.4.1 (2021-07-16) 67 | 68 | - Fixed component names taking chartId instead of chartType 69 | 70 | # 0.4.0 (2021-07-16) 71 | 72 | # Breaking changes 73 | 74 | - Renamed `data` prop to `chartData` due to type merging issues 75 | 76 | # Features 77 | 78 | - All components are now correctly typed if using Volar on VSCode 79 | - Added `ExtractComponentData` utility type 80 | - Added `ExtractComponentProps` utility type 81 | - Reactive `options` 82 | 83 | # 0.4.0-alpha.1 (2021-07-15) 84 | 85 | **Note:** Version bump only for package vue-chart-3 86 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Victor Garcia 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## I'm joining [vue-chartjs](https://github.com/apertureless/vue-chartjs) as a core maintainer so this package will be kept just for those who already use it. I'm encouraging new users to use `vue-chartjs` instead 2 | 3 | # 📊 Chart.js 3 for Vue 2 and Vue 3 4 | 5 |
6 |
7 |
8 |
9 |