Skip to content

Commit

Permalink
feat: base Chart component (#958)
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 f3ecfb0
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
@@ -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
@@ -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
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
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.

0 comments on commit f3ecfb0

Please sign in to comment.