-
Notifications
You must be signed in to change notification settings - Fork 0
/
husky_theme.py
121 lines (117 loc) · 3.5 KB
/
husky_theme.py
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
def husky_theme():
purple = '#4b2e83'
gold = '#b7a57a'
metallic_gold = '#85754d'
light_gray = '#d9d9d9'
dark_gray = '#444444'
white = '#ffffff'
black = '#000000'
header_font = 'EncodeSans-Regular'
body_font = 'OpenSans-Regular'
body_font_bold = 'OpenSans-Bold'
return {
"width": 450,
"height": 300,
"config": {
"title": {
"fontSize": 18,
"font": header_font,
"anchor": "start", # equivalent of left-aligned
"color": purple
},
"axisX": {
"domain": True,
"domainColor": dark_gray,
"domainWidth": 1,
"grid": True,
"gridColor": light_gray,
"gridWidth": 0.5,
"labelFont": body_font,
"labelFontSize": 12,
"labelColor": dark_gray,
"labelAngle": 0,
"tickColor": dark_gray,
"tickSize": 5,
"titleFont": body_font_bold,
"titleFontSize": 12,
},
"axisY": {
"domain": True,
"domainColor": dark_gray,
"grid": True,
"gridColor": light_gray,
"gridWidth": 0.5,
"labelFont": body_font,
"labelFontSize": 12,
"labelAngle": 0,
"ticks": True,
"titleFont": body_font_bold,
"titleFontSize": 12,
},
"header": {
"labelFont": body_font,
"labelFontSize": 16,
"titleFont": body_font_bold,
"titleFontSize": 16
},
"range": {
"category": [purple, gold, light_gray, metallic_gold, black, dark_gray],
"diverging": [purple,'#c2a5cf', light_gray, gold, metallic_gold],
},
"legend": {
"labelFont": body_font,
"labelFontSize": 12,
"symbolSize": 100, # default,
"titleFont": body_font_bold,
"titleFontSize": 12,
},
### MARKS CONFIGURATIONS ###
"area": {
"fill": purple,
},
"circle": {
"fill": purple,
"size": 40
},
"line": {
"color": purple,
"stroke": purple,
"strokeWidth": 3,
},
"trail": {
"color": purple,
"stroke": purple,
"strokeWidth": 0,
"size": 1,
},
"path": {
"stroke": purple,
"strokeWidth": 0.5,
},
"point": {
"color": purple,
"size": 40
},
"text": {
"font": body_font,
"color": purple,
"fontSize": 11,
"align": "right",
"size": 14,
},
"bar": {
"size": 10,
"binSpacing": 1,
"continuousBandSize": 10,
# "discreteBandSize": 10,
"fill": purple,
"stroke": False,
},
"tick": {
"color": purple
}
}
}
import altair as alt
alt.themes.register("husky_theme", husky_theme)
alt.themes.enable("husky_theme")