-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplotly_template.py
76 lines (66 loc) · 1.93 KB
/
plotly_template.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
import copy
import plotly.graph_objects as go
import plotly.io as pio
LAYOUT = {
# Fonts
'title': {
'font': {
'family': 'HelveticaNeue-CondensedBold, Helvetica, Sans-serif',
'size': 30,
'color': '#fff'
}
},
'font': {
'family': 'Helvetica Neue, Helvetica, Sans-serif',
'size': 24,
'color': '#fff'
},
'coloraxis': {'colorbar': {'outlinewidth': 0, 'ticks': ''}},
# Colorways
'colorway': ['#4872FD', '#FFD538'],
'shapedefaults': {'line': {'color': '#2a3f5f'}},
# Keep adding others as needed below
# 'hovermode': 'x unified',
'paper_bgcolor': 'rgba(0, 0, 0, 0)',
'plot_bgcolor': 'rgba(0, 0, 0, 0)',
'xaxis': {'automargin': True,
'gridcolor': 'rgba(255, 255, 255, 0.2)',
'linecolor': 'rgba(255, 255, 255, 0.2)',
'ticks': '',
'title': {'standoff': 15},
'zerolinecolor': 'rgba(255, 255, 255, 0.2)',
'zerolinewidth': 2},
'yaxis': {'automargin': True,
'gridcolor': 'rgba(255, 255, 255, 0.2)',
'linecolor': 'rgba(255, 255, 255, 0.2)',
'ticks': '',
'title': {'standoff': 15},
'zerolinecolor': 'rgba(255, 255, 255, 0.2)',
'zerolinewidth': 2}
}
DATA = {
# Each graph object must be in a tuple or list for each trace
'bar': [
go.Bar(
texttemplate='%{value:.2s}',
textposition='outside',
textfont={
'family': 'Helvetica Neue, Helvetica, Sans-serif',
'size': 20,
'color': '#FFFFFF'
}
)
]
}
pio.templates["dark-theme"] = go.layout.Template(
# LAYOUT
layout=LAYOUT,
# DATA
data=DATA,
)
pio.templates["dark-theme2"] = go.layout.Template(
# LAYOUT
layout=LAYOUT | {"font": (LAYOUT["font"] | {"size": 15})},
# DATA
data=DATA,
)