Skip to content

Commit f3ecfb0

Browse files
authored
feat: base Chart component (#958)
it can be used for multitype charts and as a base for custom charts BREAKING CHANGE: chart events were removed
1 parent 19e6049 commit f3ecfb0

12 files changed

+340
-475
lines changed

Diff for: .size-limit.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
[
22
{
33
"path": "dist/index.cjs",
4-
"limit": "2.3 KB",
4+
"limit": "1.75 KB",
55
"webpack": false,
66
"running": false
77
},
88
{
99
"path": "dist/index.cjs",
10-
"limit": "60 KB",
10+
"limit": "1 KB",
1111
"import": "{ Bar }"
1212
},
1313
{
1414
"path": "dist/index.js",
15-
"limit": "2.25 KB",
15+
"limit": "1.7 KB",
1616
"webpack": false,
1717
"running": false
1818
},
1919
{
2020
"path": "dist/index.js",
21-
"limit": "8.5 KB",
21+
"limit": "1 KB",
2222
"import": "{ Bar }"
2323
}
2424
]

Diff for: rollup.config.mjs

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
import vue from '@vitejs/plugin-vue'
21
import { swc } from 'rollup-plugin-swc3'
32
import { nodeResolve } from '@rollup/plugin-node-resolve'
43
import pkg from './package.json' assert { type: 'json' }
54

65
const extensions = ['.js', '.ts']
76
const external = _ => /node_modules/.test(_) && !/@swc\/helpers/.test(_)
8-
const plugins = (targets, vueOptions = {}) => [
9-
vue(vueOptions),
7+
const plugins = (targets) => [
108
nodeResolve({
119
extensions
1210
}),
@@ -25,11 +23,7 @@ const plugins = (targets, vueOptions = {}) => [
2523
export default [
2624
{
2725
input: pkg.main,
28-
plugins: plugins('defaults, not ie 11, not ie_mob 11', {
29-
template: {
30-
optimizeSSR: true
31-
}
32-
}),
26+
plugins: plugins('defaults, not ie 11, not ie_mob 11'),
3327
external,
3428
output: {
3529
format: 'cjs',

Diff for: sandboxes/reactive/src/App.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const data = ref<ChartData<'bar'>>({
2626
2727
onMounted(() => {
2828
setInterval(() => {
29-
data.value = { ...chartConfig.data }
29+
data.value = chartConfig.randomData()
3030
}, 3000)
3131
})
3232
</script>

Diff for: sandboxes/reactive/src/chartConfig.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ function getRandomInt() {
22
return Math.floor(Math.random() * (50 - 5 + 1)) + 5
33
}
44

5-
export const data = {
5+
export const randomData = () => ({
66
labels: [
77
'January' + getRandomInt(),
88
'February',
@@ -37,7 +37,7 @@ export const data = {
3737
]
3838
}
3939
]
40-
}
40+
})
4141

4242
export const options = {
4343
responsive: true,

Diff for: src/BaseCharts.ts

-285
This file was deleted.

0 commit comments

Comments
 (0)