-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpypl_graph.py
More file actions
57 lines (52 loc) · 1.5 KB
/
Copy pathpypl_graph.py
File metadata and controls
57 lines (52 loc) · 1.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
from src.color import Color
from projects.PYPL.pypl_data_loader import load_data
from src.animated_graph import PygameExtended
from src.graph import GraphConfig
from src.animated_graph import BarChartAnimation
# see projects/PYPL
visualization_data = load_data("./ODE/All.json")
HEADER_TEXT = "Online IDE Popularity (Global)"
RECORD_PATH = "outputs/pypl_ode_all_graph.mp4"
WINDOW_SIZE = (1920, 1080)
app = PygameExtended(WINDOW_SIZE)
# Configure visualization
chart_config = GraphConfig(
header_font="./assets/fonts/Arial.ttf",
header_font_size=69,
header_text=HEADER_TEXT,
bar_height=40,
width_multiplier=100,
colors=[
Color("#f98284"), # Red
Color("#ffc384"), # Orange
Color("#dea38b"), # Coral
Color("#e9f59d"), # Light Green
Color("#fff7a0"), # Yellow
Color("#b0eb93"), # Green
Color("#b3e3da"), # Teal
Color("#accce4"), # Light Blue
Color("#b0a9e4"), # Purple
Color("#feaae4"), # Pink
],
left_gap=250,
text_bar_distance=30,
small_text_size=30,
to_show=10,
fps=60,
animation_speed=0.1,
bg_color=Color("#28282e"),
header_bg_color=Color("#6c5671"),
header_text_color=Color("#ffffff"),
value_gap=10,
record_path=RECORD_PATH,
wait_time_after_completion=3,
value_prepost=("~", "%"),
)
# Create and run visualization
chart = BarChartAnimation(
pygame_app=app,
chart_data=visualization_data,
header_height=100,
chart_config=chart_config,
)
chart.run()