/
defaults.ts
78 lines (66 loc) · 1.67 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import { DefaultHeatMapDatum, HeatMapCommonProps, LayerId } from './types'
import { HeatMapTooltip } from './HeatMapTooltip'
export const commonDefaultProps: Omit<
HeatMapCommonProps<DefaultHeatMapDatum>,
| 'margin'
| 'theme'
| 'valueFormat'
| 'onClick'
| 'renderWrapper'
| 'role'
| 'ariaLabel'
| 'ariaLabelledBy'
| 'ariaDescribedBy'
> & {
layers: LayerId[]
} = {
layers: ['grid', 'axes', 'cells', 'legends', 'annotations'],
minValue: 'auto',
maxValue: 'auto',
forceSquare: false,
xInnerPadding: 0,
xOuterPadding: 0,
yInnerPadding: 0,
yOuterPadding: 0,
sizeVariation: 0,
opacity: 1,
activeOpacity: 1,
inactiveOpacity: 0.15,
borderWidth: 0,
borderColor: { from: 'color', modifiers: [['darker', 0.8]] },
enableGridX: false,
enableGridY: false,
enableLabels: true,
label: 'formattedValue',
labelTextColor: { from: 'color', modifiers: [['darker', 2]] },
colors: {
type: 'sequential',
scheme: 'brown_blueGreen',
},
emptyColor: '#000000',
legends: [],
annotations: [],
isInteractive: true,
hoverTarget: 'rowColumn',
tooltip: HeatMapTooltip,
animate: true,
motionConfig: 'gentle' as const,
}
export const svgDefaultProps = {
...commonDefaultProps,
axisTop: {},
axisRight: null,
axisBottom: null,
axisLeft: {},
borderRadius: 0,
cellComponent: 'rect',
}
export const canvasDefaultProps = {
...commonDefaultProps,
axisTop: {},
axisRight: null,
axisBottom: null,
axisLeft: {},
renderCell: 'rect',
pixelRatio: typeof window !== 'undefined' ? window.devicePixelRatio || 1 : 1,
}