Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: base Chart component #958

Merged
merged 1 commit into from
Dec 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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