This is a lightweight example that showcases creating a custom Van component as a wrapper for an external library -- in this case, the Chart
component from Chart.js.
The chart is connected to state (chart data) that re-renders when it changes. A "Randomize" button is provided to refresh the data, and a debug menu dropdown is also provided to view the chart data state.
This repository was spawned from the vite-vanjs-ts
template.
Vite + VanJS with TypeScript template. This Vite template uses:
- TypeScript
- VanJS core (vanjs-core)
- VanX (vanjs-ext)
- Clone the repository:
git clone https://github.com/csm-kb/vanjs-chartjs-example.git
- Navigate to cloned directory:
cd vanjs-chartjs-example
- Install the dependencies:
yarn install
- Start development server:
yarn dev