How wiinci/vue-charts works
Project type and purpose
• This is a front-end single-page application (SPA) that provides a reusable collection of interactive, data-driven charts (LineChart, Sankey, etc.).
• Built with Vue 3.5 + Vite, with TypeScript support and D3.js for data visualization.
• Purpose: offer a modular chart library/demo where each chart is a self-contained Vue component.
File structure
• Top level:
• index.html – the host page
• package.json, vite.config.ts – build tool and scripts
• tsconfig*.json – TypeScript configuration
• src/
• main.ts / main.js – Vue app bootstrap
• App.vue – root component
• assets/ – static constants and assets
• components/
– LineChart/ (Line.vue, LineChart.vue)
– Sankey/ (Sankey.vue, sub-components Nodes.vue, Links.vue, Labels.vue)
– common-ts/ (reusable chart primitives in TypeScript)
– common/ (JavaScript versions of primitives)
• composables/ – Composition API logic (useCollapsed, useHighlightLinks, useNodesAndLinks)
• hooks/ – analogous JavaScript logic for older paradigms
• utils/ – pure helper functions (formatTime, generateTransition, smartTicks, axis patterns)
• data/ – sample data (CSV, JSON)
README for additional insights
• Confirms tech stack: Vue 3.5, Vite 5, D3.js, TypeScript
• Emphasizes modern <script setup>, responsive charts, improved Suspense
Be comprehensive but structured
• Two parallel sets of logic code (TypeScript composables vs JavaScript hooks)
• That both sets ultimately feed data to the Vue components
• Call out that Vite’s config (vite.config.ts) sits at the root of the build layer