-
Notifications
You must be signed in to change notification settings - Fork 4
/
aux_functions.py
55 lines (50 loc) · 1.36 KB
/
aux_functions.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
# Author: aqeelanwar
# Created: 15 May,2020, 7:03 PM
# Email: [email protected]
import plotly.graph_objects as go
import chart_studio.plotly as py
from plotly.subplots import make_subplots
ORANGE = "#DD8047"
BLUE = "94B6D2"
GREEN = "#A5AB81"
YELLOW = "#D8B25C"
def plot_stat(x, y1, y2, repo_name, type="offline"):
fig = make_subplots(specs=[[{"secondary_y": True}]])
fig.add_trace(
go.Scatter(
x=x,
y=y1,
mode="lines",
name="Clones",
line=dict(color=ORANGE, width=3),
marker=dict(size=10, color=ORANGE),
),
secondary_y=False,
)
fig.add_trace(
go.Scatter(
x=x,
y=y2,
mode="lines",
name="Views",
line=dict(color=GREEN, width=3),
marker=dict(size=10, color=GREEN),
),
secondary_y=True,
)
fig.update_layout(
title=repo_name,
font=dict(color="#7f7f7f"),
autosize=True,
legend=dict(x=0, y=1, orientation="v"),
margin=dict(l=0, r=0, t=40, b=30),
)
if type == "offline":
fig.show()
elif type == "online":
url = py.plot(fig, filename=repo_name, sharing="public")
print(url)
def display_StatTheGit():
with open("display.txt", "r") as file:
for line in file:
print(line, end="")