/
defaults.ts
64 lines (55 loc) · 1.65 KB
/
defaults.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import { ModernMotionProps, SvgDefsAndFill } from '@nivo/core'
import { AreaBumpCommonProps, AreaBumpComputedSerie, DefaultAreaBumpDatum } from './types'
import { AreaTooltip } from './AreaTooltip'
const commonDefaultProps: Omit<
AreaBumpCommonProps<DefaultAreaBumpDatum, Record<string, unknown>>,
| 'onMouseEnter'
| 'onMouseMove'
| 'onMouseLeave'
| 'onClick'
| 'margin'
| 'theme'
| 'renderWrapper'
> = {
align: 'middle',
layers: ['grid', 'axes', 'labels', 'areas'],
interpolation: 'smooth',
spacing: 0,
xPadding: 0.6,
colors: { scheme: 'nivo' },
blendMode: 'normal',
fillOpacity: 0.8,
activeFillOpacity: 1,
inactiveFillOpacity: 0.15,
borderWidth: 1,
activeBorderWidth: 1,
inactiveBorderWidth: 0,
borderColor: { from: 'color', modifiers: [['darker', 0.4]] },
borderOpacity: 1,
activeBorderOpacity: 1,
inactiveBorderOpacity: 0,
startLabel: false,
startLabelPadding: 12,
startLabelTextColor: { from: 'color', modifiers: [['darker', 1]] },
endLabel: true,
endLabelPadding: 12,
endLabelTextColor: { from: 'color', modifiers: [['darker', 1]] },
enableGridX: true,
axisTop: {},
axisBottom: {},
isInteractive: true,
defaultActiveSerieIds: [],
tooltip: AreaTooltip,
role: 'img',
}
export const areaBumpSvgDefaultProps: typeof commonDefaultProps &
SvgDefsAndFill<AreaBumpComputedSerie<DefaultAreaBumpDatum, Record<string, unknown>>> & {
animate: boolean
motionConfig: ModernMotionProps['motionConfig']
} = {
...commonDefaultProps,
defs: [],
fill: [],
animate: true,
motionConfig: 'gentle',
}