globals.py
3.5 KB
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
import os
from jinja2 import Environment, FileSystemLoader
from pyecharts.commons.utils import JsCode
class _RenderType:
CANVAS: str = "canvas"
SVG: str = "svg"
class _FileType:
SVG: str = "svg"
PNG: str = "png"
JPEG: str = "jpeg"
HTML: str = "html"
class _SymbolType:
RECT: str = "rect"
ROUND_RECT: str = "roundRect"
TRIANGLE: str = "triangle"
DIAMOND: str = "diamond"
ARROW: str = "arrow"
class _ChartType:
BAR: str = "bar"
BAR3D: str = "bar3D"
BOXPLOT: str = "boxplot"
EFFECT_SCATTER: str = "effectScatter"
FUNNEL: str = "funnel"
GAUGE: str = "gauge"
GEO: str = "geo"
GRAPH: str = "graph"
HEATMAP: str = "heatmap"
KLINE: str = "candlestick"
LINE: str = "line"
LINE3D: str = "line3D"
LINES: str = "lines"
LINES3D: str = "lines3D"
LIQUID: str = "liquidFill"
MAP: str = "map"
MAP3D: str = "map3D"
PARALLEL: str = "parallel"
PICTORIALBAR: str = "pictorialBar"
PIE: str = "pie"
POLAR: str = "polar"
RADAR: str = "radar"
SANKEY: str = "sankey"
SCATTER: str = "scatter"
SCATTER3D: str = "scatter3D"
SUNBURST: str = "sunburst"
THEMERIVER: str = "themeRiver"
TREE: str = "tree"
TREEMAP: str = "treemap"
WORDCLOUD: str = "wordCloud"
CUSTOM: str = "custom"
ToolTipFormatterType = {
_ChartType.GEO: JsCode(
"""function (params) {
return params.name + ' : ' + params.value[2];
}"""
),
_ChartType.GAUGE: "{a} <br/>{b} : {c}%",
}
class _ThemeType:
BUILTIN_THEMES = ["light", "dark", "white"]
LIGHT = "light"
DARK = "dark"
WHITE = "white"
CHALK: str = "chalk"
ESSOS: str = "essos"
INFOGRAPHIC: str = "infographic"
MACARONS: str = "macarons"
PURPLE_PASSION: str = "purple-passion"
ROMA: str = "roma"
ROMANTIC: str = "romantic"
SHINE: str = "shine"
VINTAGE: str = "vintage"
WALDEN: str = "walden"
WESTEROS: str = "westeros"
WONDERLAND: str = "wonderland"
class _GeoType:
SCATTER: str = "scatter"
EFFECT_SCATTER: str = "effectScatter"
HEATMAP: str = "heatmap"
LINES: str = "lines"
class _BMapType:
# BMap Control location
ANCHOR_TOP_LEFT = 0
ANCHOR_TOP_RIGHT = 1
ANCHOR_BOTTOM_LEFT = 2
ANCHOR_BOTTOM_RIGHT = 3
# BMap Navigation Control Type
NAVIGATION_CONTROL_LARGE = 0
NAVIGATION_CONTROL_SMALL = 1
NAVIGATION_CONTROL_PAN = 2
NAVIGATION_CONTROL_ZOOM = 3
# BMap Maptype Control Type
MAPTYPE_CONTROL_HORIZONTAL = 0
MAPTYPE_CONTROL_DROPDOWN = 1
MAPTYPE_CONTROL_MAP = 2
class _NotebookType:
JUPYTER_NOTEBOOK = "jupyter_notebook"
JUPYTER_LAB = "jupyter_lab"
NTERACT = "nteract"
ZEPPELIN = "zeppelin"
class _OnlineHost:
DEFAULT_HOST = "https://assets.pyecharts.org/assets/"
NOTEBOOK_HOST = "http://localhost:8888/nbextensions/assets/"
RenderType = _RenderType()
FileType = _FileType()
SymbolType = _SymbolType()
ChartType = _ChartType
ThemeType = _ThemeType()
GeoType = _GeoType()
BMapType = _BMapType
NotebookType = _NotebookType()
OnlineHostType = _OnlineHost()
class _CurrentConfig:
PAGE_TITLE = "Awesome-pyecharts"
ONLINE_HOST = OnlineHostType.DEFAULT_HOST
NOTEBOOK_TYPE = NotebookType.JUPYTER_NOTEBOOK
GLOBAL_ENV = Environment(
keep_trailing_newline=True,
trim_blocks=True,
lstrip_blocks=True,
loader=FileSystemLoader(
os.path.join(
os.path.abspath(os.path.dirname(__file__)), "render", "templates"
)
),
)
CurrentConfig = _CurrentConfig()