Skip to content

Commit

Permalink
feat: base Chart component
Browse files Browse the repository at this point in the history
it can be used for multitype charts and as a base for custom charts

BREAKING CHANGE: chart events were removed
  • Loading branch information
dangreen committed Dec 3, 2022
1 parent 19e6049 commit 7dc476d
Show file tree
Hide file tree
Showing 12 changed files with 340 additions and 475 deletions.
8 changes: 4 additions & 4 deletions .size-limit.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
[
{
"path": "dist/index.cjs",
"limit": "2.3 KB",
"limit": "1.75 KB",
"webpack": false,
"running": false
},
{
"path": "dist/index.cjs",
"limit": "60 KB",
"limit": "1 KB",
"import": "{ Bar }"
},
{
"path": "dist/index.js",
"limit": "2.25 KB",
"limit": "1.7 KB",
"webpack": false,
"running": false
},
{
"path": "dist/index.js",
"limit": "8.5 KB",
"limit": "1 KB",
"import": "{ Bar }"
}
]
10 changes: 2 additions & 8 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import vue from '@vitejs/plugin-vue'
import { swc } from 'rollup-plugin-swc3'
import { nodeResolve } from '@rollup/plugin-node-resolve'
import pkg from './package.json' assert { type: 'json' }

const extensions = ['.js', '.ts']
const external = _ => /node_modules/.test(_) && !/@swc\/helpers/.test(_)
const plugins = (targets, vueOptions = {}) => [
vue(vueOptions),
const plugins = (targets) => [
nodeResolve({
extensions
}),
Expand All @@ -25,11 +23,7 @@ const plugins = (targets, vueOptions = {}) => [
export default [
{
input: pkg.main,
plugins: plugins('defaults, not ie 11, not ie_mob 11', {
template: {
optimizeSSR: true
}
}),
plugins: plugins('defaults, not ie 11, not ie_mob 11'),
external,
output: {
format: 'cjs',
Expand Down
2 changes: 1 addition & 1 deletion sandboxes/reactive/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const data = ref<ChartData<'bar'>>({
onMounted(() => {
setInterval(() => {
data.value = { ...chartConfig.data }
data.value = chartConfig.randomData()
}, 3000)
})
</script>
4 changes: 2 additions & 2 deletions sandboxes/reactive/src/chartConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ function getRandomInt() {
return Math.floor(Math.random() * (50 - 5 + 1)) + 5
}

export const data = {
export const randomData = () => ({
labels: [
'January' + getRandomInt(),
'February',
Expand Down Expand Up @@ -37,7 +37,7 @@ export const data = {
]
}
]
}
})

export const options = {
responsive: true,
Expand Down
285 changes: 0 additions & 285 deletions src/BaseCharts.ts

This file was deleted.

Loading

0 comments on commit 7dc476d

Please sign in to comment.