Dashboard/index.py [35:130]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SIDEBAR_STYLE = {
    'position': 'fixed',
    'top': 0,
    'left': 0,
    'bottom': 0,
    'width': '12rem',
    'padding': '2rem 1rem',
    'background-color': 'lightgrey',
    'color': 'black',
}
CONTENT_STYLE = {
    'margin-left': '15rem',
    'margin-right': '2rem',
    'padding': '2rem' '1rem',
    'color': 'black',
}


#Overlapping segments data
fixed_time = df[df["Segment Type"].str.contains("Segment_Type.FIXED_TIME")]
generate = df[df["Segment Type"].str.contains("Segment_Type.GENERATE")]
deadspace = df[df["Segment Type"].str.contains("Segment_Type.DEADSPACE")]

deadspace = deadspace.head()
generate = generate.head()
fixed_time = fixed_time.head()
All = [fixed_time,generate, deadspace]
result = pd.concat(All)

'''Overlapping Segments Graph
This visualization displays segments types that overlap over start and end times '''

fig = px.timeline(result, x_start="Start Time", x_end="End Time", y="Segment Type", color="Segment Type")
fig.update_yaxes(autorange="reversed")
    

#Line Graph
df["timeline"] = df["Start Time"] + df["End Time"]
df['timeline'] = pd.to_datetime(df['timeline']).dt.time
fig_line = px.line(df, x="timeline", y="Number of Logs",title = 'Segments')
fig_line.update_traces(mode='markers+lines')
fig_line.update_xaxes(rangeslider_visible=True)


fig_line.update_layout(
    title = 'Number of Logs by Time'
    ,xaxis_title = 'Timeline'
    ,yaxis_title = 'Number of logs'
    ,font = dict(size = 15)
    ,template = 'plotly_dark' #"plotly", "plotly_white", "plotly_dark", "ggplot2", "seaborn", "simple_white", "none"
)

#Bubble Chart
fig_bubble = px.scatter(df.head(100),x="Start Time", y="End Time",
	         size="Number of Logs", color="Segment Type",
                 hover_name="Generate Matched Values")

#Pie Chart
fig_pie = px.pie(df, values='Number of Logs', names='Segment Type')
#fig_pie.show()

#Bar Chart
fig_bar = px.histogram(df, x="Segment Type", y="Number of Logs",
             color='Segment Type', barmode='group',
             histfunc='avg',
             height=400)
#Area Chart
fig_area = px.area(df, x="Start Time", y="End Time", color="Segment Type", line_group="Number of Logs")


#Time Between Segments Conversion
df["Start Time"] = pd.to_datetime(df["Start Time"])
df["End Time"] = pd.to_datetime(df["End Time"])
# Duration of segments 
lst = []
for i in range(len(df["End Time"])):
    lst.append((df["End Time"][i] - df["Start Time"][i]).total_seconds())
    
#print(lst)
       
df["Duration"] = lst

#Time Between Segments in a Gantt Chart
fig_gantt = px.timeline(df, x_start="Start Time", x_end="End Time", y="Segment Type", color="Duration")
fig.update_yaxes(autorange="reversed")

#Time Between Segments in a Histogram
fig_hist = px.histogram(df, x="Segment Type", y="Number of Logs",
             color='Duration', barmode='group',
             histfunc='avg',
             height=400
            )


child = dbc.Container(
    [
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



Dashboard/pages/home.py [35:131]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SIDEBAR_STYLE = {
    'position': 'fixed',
    'top': 0,
    'left': 0,
    'bottom': 0,
    'width': '12rem',
    'padding': '2rem 1rem',
    'background-color': 'lightgrey',
    'color': 'black',
}
CONTENT_STYLE = {
    'margin-left': '15rem',
    'margin-right': '2rem',
    'padding': '2rem' '1rem',
    'color': 'black',
}


#Overlapping segments data
fixed_time = df[df["Segment Type"].str.contains("Segment_Type.FIXED_TIME")]
generate = df[df["Segment Type"].str.contains("Segment_Type.GENERATE")]
deadspace = df[df["Segment Type"].str.contains("Segment_Type.DEADSPACE")]

deadspace = deadspace.head()
generate = generate.head()
fixed_time = fixed_time.head()
All = [fixed_time,generate, deadspace]
result = pd.concat(All)

'''Overlapping Segments Graph
This visualization displays segments types that overlap over start and end times '''

fig = px.timeline(result, x_start="Start Time", x_end="End Time", y="Segment Type", color="Segment Type")
fig.update_yaxes(autorange="reversed")
    

#Line Graph
df["timeline"] = df["Start Time"] + df["End Time"]
df['timeline'] = pd.to_datetime(df['timeline']).dt.time
fig_line = px.line(df, x="timeline", y="Number of Logs",title = 'Segments')
fig_line.update_traces(mode='markers+lines')
fig_line.update_xaxes(rangeslider_visible=True)


fig_line.update_layout(
    title = 'Number of Logs by Time'
    ,xaxis_title = 'Timeline'
    ,yaxis_title = 'Number of logs'
    ,font = dict(size = 15)
    ,template = 'plotly_dark' #"plotly", "plotly_white", "plotly_dark", "ggplot2", "seaborn", "simple_white", "none"
)

#Bubble Chart
fig_bubble = px.scatter(df.head(100),x="Start Time", y="End Time",
	         size="Number of Logs", color="Segment Type",
                 hover_name="Generate Matched Values")

#Pie Chart
fig_pie = px.pie(df, values='Number of Logs', names='Segment Type')
#fig_pie.show()

#Bar Chart
fig_bar = px.histogram(df, x="Segment Type", y="Number of Logs",
             color='Segment Type', barmode='group',
             histfunc='avg',
             height=400)
#Area Chart
fig_area = px.area(df, x="Start Time", y="End Time", color="Segment Type", line_group="Number of Logs")


#Time Between Segments Conversion
df["Start Time"] = pd.to_datetime(df["Start Time"])
df["End Time"] = pd.to_datetime(df["End Time"])
# Duration of segments 
lst = []
for i in range(len(df["End Time"])):
    lst.append((df["End Time"][i] - df["Start Time"][i]).total_seconds())
    
#print(lst)
       
df["Duration"] = lst

#Time Between Segments in a Gantt Chart
fig_gantt = px.timeline(df, x_start="Start Time", x_end="End Time", y="Segment Type", color="Duration")
fig.update_yaxes(autorange="reversed")

#Time Between Segments in a Histogram
fig_hist = px.histogram(df, x="Segment Type", y="Number of Logs",
             color='Duration', barmode='group',
             histfunc='avg',
             height=400
            )


child = dbc.Container(
    
    [
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



