Skip to content

Commit 660c70e

Browse files
fix: fix type of default props aggregators
1 parent 6ef67a7 commit 660c70e

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/helper/defaultProps.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import { aggregators, locales } from './utilities'
22
import { redColorScaleGenerator } from './redColorScaleGenerator'
33
import type { PropType } from 'vue'
4+
import type { AggregatorTemplate } from './utilities'
45

56
export default {
67
data: {
78
type: [Array, Object, Function] as PropType<any>,
89
required: true
910
},
1011
aggregators: {
11-
type: Object as PropType<Record<string, Function>>,
12+
type: Object as PropType<Record<string, AggregatorTemplate>>,
1213
default: () => aggregators
1314
},
1415
aggregatorName: {

src/helper/redColorScaleGenerator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export function redColorScaleGenerator(values: number[]) {
2-
const min = Math.min.apply(Math, values)
3-
const max = Math.max.apply(Math, values)
2+
const min = Math.min(...values)
3+
const max = Math.max(...values)
44
return (x: number) => {
55
const nonRed = 255 - Math.round((255 * (x - min)) / (max - min))
66
return { backgroundColor: `rgb(255,${nonRed},${nonRed})` }

0 commit comments

Comments
 (0)