Skip to content

Commit 793277d

Browse files
50raynlee00678
authored andcommitted
Shared | Vue: Fix Scatter Plot with Varied Shape gallery demo
* update dependencies in `/packages/vue` * squash some little eslint warnings * fix vite warning * move `.eslintrc.cjs` to `eslint.config.js` since it is depracated in ESLint v9
1 parent ab17795 commit 793277d

File tree

13 files changed

+5367
-2879
lines changed

13 files changed

+5367
-2879
lines changed

package-lock.json

Lines changed: 5309 additions & 2822 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/shared/examples/shaped-scatter-plot/shaped-scatter-plot-solid.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import { JSX } from 'solid-js'
2-
import { colors, Scale, Scatter } from '@unovis/ts'
31
import { VisAxis, VisBulletLegend, VisScatter, VisTooltip, VisXYContainer } from '@unovis/solid'
2+
import { colors, Scale, Scatter } from '@unovis/ts'
3+
import { JSX } from 'solid-js'
4+
import { categories, data, DataRecord, shapes, sumCategories } from './data'
45

5-
import { data, DataRecord, shapes, categories, sumCategories } from './data'
66

77
const ShapedScatterPlot = (): JSX.Element => {
88
const shapeScale = Scale.scaleOrdinal(shapes).domain(categories)
99
const colorScale = Scale.scaleOrdinal(colors).domain(categories)
1010

1111
// scatter props
12-
const x = (d: DataRecord) => +new Date(d.date)
12+
const x = (d: DataRecord) => +(new Date(`01-${d.date}`))
1313
const y = (d: DataRecord) => d.trainedParam
1414
const color = (d: DataRecord) => colorScale(sumCategories(d.owner))
1515
const shape = (d: DataRecord) => shapeScale(sumCategories(d.owner))

packages/shared/examples/shaped-scatter-plot/shaped-scatter-plot.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Component } from '@angular/core'
2-
import { Scale, Scatter, StringAccessor, colors } from '@unovis/ts'
2+
import { Scale, Scatter, colors } from '@unovis/ts'
33
import { data, DataRecord, shapes, categories, sumCategories } from './data'
44

55
const shapeScale = Scale.scaleOrdinal(shapes).domain(categories)
@@ -12,7 +12,7 @@ const colorScale = Scale.scaleOrdinal(colors).domain(categories)
1212
export class ShapedScatterPlotComponent {
1313
data = data
1414

15-
getX = (d: DataRecord): number => +(new Date(d.date))
15+
getX = (d: DataRecord): number => +(new Date(`01-${d.date}`))
1616
getY = (d: DataRecord): number => d.trainedParam
1717
getColor = (d: DataRecord): string => colorScale(sumCategories(d.owner))
1818
getShape = (d: DataRecord): string => shapeScale(sumCategories(d.owner))

packages/shared/examples/shaped-scatter-plot/shaped-scatter-plot.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
const colorScale = Scale.scaleOrdinal(colors).domain(categories)
88
99
// scatter props
10-
const x = (d: DataRecord) => +(new Date(d.date))
10+
const x = (d: DataRecord) => +(new Date(`01-${d.date}`))
1111
const y = (d: DataRecord) => d.trainedParam
1212
const color = (d: DataRecord) => colorScale(sumCategories(d.owner))
1313
const shape = (d: DataRecord) => shapeScale(sumCategories(d.owner))

packages/shared/examples/shaped-scatter-plot/shaped-scatter-plot.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Axis, BulletLegend, Position, Scale, Scatter, Tooltip, XYContainer, colors } from '@unovis/ts'
1+
import { Axis, BulletLegend, Scale, Scatter, Tooltip, XYContainer, colors } from '@unovis/ts'
22
import { data, DataRecord, shapes, categories, sumCategories } from './data'
33

44
const shapeScale = Scale.scaleOrdinal(shapes).domain(categories)
@@ -14,7 +14,7 @@ const legend = new BulletLegend(container, {
1414
})
1515

1616
const scatter = new Scatter<DataRecord>({
17-
x: (d: DataRecord) => +(new Date(d.date)),
17+
x: (d: DataRecord) => +(new Date(`01-${d.date}`)),
1818
y: (d: DataRecord) => d.trainedParam,
1919
color: (d: DataRecord) => colorScale(sumCategories(d.owner)),
2020
shape: (d: DataRecord) => shapeScale(sumCategories(d.owner)),

packages/shared/examples/shaped-scatter-plot/shaped-scatter-plot.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import React, { useCallback } from 'react'
2-
import { Position, Scale, Scatter, colors } from '@unovis/ts'
31
import { VisAxis, VisBulletLegend, VisScatter, VisTooltip, VisXYContainer } from '@unovis/react'
4-
import { data, DataRecord, shapes, categories, sumCategories } from './data'
2+
import { colors, Scale, Scatter } from '@unovis/ts'
3+
import React, { useCallback } from 'react'
4+
import { categories, data, DataRecord, shapes, sumCategories } from './data'
55

66
const shapeScale = Scale.scaleOrdinal(shapes).domain(categories)
77
const colorScale = Scale.scaleOrdinal(colors).domain(categories)
@@ -20,7 +20,7 @@ export default function ShapedScatterPlot (): JSX.Element {
2020
<VisBulletLegend items={legendItems}/>
2121
<VisXYContainer data={data} height={'60vh'} scaleByDomain={true}>
2222
<VisScatter
23-
x={useCallback((d: DataRecord) => +(new Date(d.date)), [])}
23+
x={useCallback((d: DataRecord) => +(new Date(`01-${d.date}`)), [])}
2424
y={useCallback((d: DataRecord) => d.trainedParam, [])}
2525
shape={useCallback((d: DataRecord) => shapeScale(sumCategories(d.owner)), [])}
2626
size={15}

packages/shared/examples/shaped-scatter-plot/shaped-scatter-plot.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<script setup lang="ts">
2-
import { Position, Scale, Scatter, colors } from '@unovis/ts'
2+
import { Scale, Scatter, colors } from '@unovis/ts'
33
import { VisXYContainer, VisScatter, VisAxis, VisTooltip, VisBulletLegend } from '@unovis/vue'
44
import { data, DataRecord, shapes, categories, sumCategories } from './data'
55
66
const shapeScale = Scale.scaleOrdinal(shapes).domain(categories)
77
const colorScale = Scale.scaleOrdinal(colors).domain(categories)
88
99
// scatter props
10-
const x = (d: DataRecord) => +(new Date(d.date))
10+
const x = (d: DataRecord) => +(new Date(`01-${d.date}`))
1111
const y = (d: DataRecord) => d.trainedParam
1212
const color = (d: DataRecord) => colorScale(sumCategories(d.owner))
1313
const shape = (d: DataRecord) => shapeScale(sumCategories(d.owner))

packages/vue/.eslintrc.cjs

Lines changed: 0 additions & 28 deletions
This file was deleted.

packages/vue/eslint.config.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import antfu from '@antfu/eslint-config'
2+
3+
export default antfu({
4+
ignorePatterns: ['dist/*'],
5+
overrides: [
6+
{
7+
files: ['src/**/*.vue'],
8+
extends: [
9+
'plugin:@typescript-eslint/recommended',
10+
'plugin:@typescript-eslint/recommended-requiring-type-checking',
11+
'@antfu',
12+
],
13+
parserOptions: {
14+
parser: '@typescript-eslint/parser',
15+
project: ['./tsconfig.json', './autogen/tsconfig.json'],
16+
extraFileExtensions: ['.vue'],
17+
tsconfigRootDir: __dirname,
18+
},
19+
rules: {
20+
'vue/indent': ['error'],
21+
'import/first': 'off',
22+
'no-use-before-define': 'off',
23+
'@typescript-eslint/explicit-function-return-type': 'off',
24+
'@typescript-eslint/no-unsafe-call': 'off',
25+
'@typescript-eslint/no-unsafe-assignment': 'off',
26+
'@typescript-eslint/no-unsafe-member-access': 'off',
27+
},
28+
},
29+
],
30+
})

packages/vue/licences.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name license period license type installed version author
22
---- -------------- ------------ ----------------- ------
3-
@antfu/eslint-config perpetual MIT 0.41.4 Anthony Fu <[email protected]> (https://github.com/antfu/)
3+
@antfu/eslint-config perpetual MIT 3.9.1 Anthony Fu <[email protected]> (https://github.com/antfu/)
44
@rollup/plugin-node-resolve perpetual MIT 13.3.0 Rich Harris <[email protected]>
5-
@vitejs/plugin-vue perpetual MIT 4.4.0 Evan You
5+
@vitejs/plugin-vue perpetual MIT 5.2.0 Evan You
66
@vue/tsconfig perpetual MIT 0.4.0 Haoqun Jiang <[email protected]>
77
de-indent perpetual MIT 1.0.2 Evan You
88
jju perpetual MIT 1.4.0 Alex Kocharin [email protected]
@@ -11,10 +11,10 @@ rollup-plugin-commonjs perpetual MIT 10.1.0
1111
rollup-plugin-typescript2 perpetual MIT 0.31.2 @ezolenko
1212
tslib perpetual 0BSD 2.6.2 Microsoft Corp.
1313
typescript perpetual Apache-2.0 4.2.4 Microsoft Corp.
14-
vite perpetual MIT 4.5.2 Evan You
14+
vite perpetual MIT 5.4.11 Evan You
1515
vite-plugin-css-injected-by-js perpetual MIT 3.3.0 Marco Prontera
1616
vite-plugin-dts perpetual MIT 3.6.0 qmhc
17-
vue perpetual MIT 3.3.4 Evan You
17+
vue perpetual MIT 3.5.13 Evan You
1818
vue-tsc perpetual MIT 1.8.19 n/a
1919
@unovis/ts perpetual Apache-2.0 1.4.4 Nikita Rokotyan, F5 Inc. <[email protected]> (https://rokotyan.com)
20-
vue perpetual MIT 3.3.4 Evan You
20+
vue perpetual MIT 3.5.13 Evan You

0 commit comments

Comments
 (0)