Verbesserungen: Balken und Sankey implementiert
This commit is contained in:
@ -4,6 +4,9 @@ import os
|
|||||||
# Clear the terminal
|
# Clear the terminal
|
||||||
os.system('cls' if os.name == 'nt' else 'clear')
|
os.system('cls' if os.name == 'nt' else 'clear')
|
||||||
|
|
||||||
|
import sys
|
||||||
|
sys.path.append('/Users/jochenhanisch-johannsen/Documents/scripte/ci_template')
|
||||||
|
|
||||||
import bibtexparser
|
import bibtexparser
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
import numpy as np
|
import numpy as np
|
||||||
@ -21,8 +24,16 @@ import math
|
|||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
export_fig_visual = False # Expot der Visualsierungen gesamt
|
||||||
|
theme = "dark" # Optionen: "dark" oder "light"
|
||||||
|
|
||||||
|
# Template
|
||||||
|
from ci_template import plotly_template
|
||||||
|
plotly_template.set_theme(theme)
|
||||||
|
pd.set_option('display.max_columns', None)
|
||||||
|
pd.set_option('future.no_silent_downcasting', True)
|
||||||
|
|
||||||
bib_filename = "Suchergebnisse.bib"
|
bib_filename = "Suchergebnisse.bib"
|
||||||
export_fig_visual = False
|
|
||||||
|
|
||||||
# Optional: slugify-Funktion
|
# Optional: slugify-Funktion
|
||||||
def slugify(value):
|
def slugify(value):
|
||||||
@ -68,19 +79,11 @@ def export_figure(fig, name, flag, bib_filename=None):
|
|||||||
print("❌ Fehler beim Übertragen:")
|
print("❌ Fehler beim Übertragen:")
|
||||||
print(e.stderr)
|
print(e.stderr)
|
||||||
|
|
||||||
# Farben definieren
|
from ci_template.plotly_template import get_colors, get_plot_styles, get_standard_layout
|
||||||
colors = {
|
|
||||||
"background": "#003366", # Hintergrundfarbe
|
# Farben und Plot-Styles zentral aus Template laden
|
||||||
"text": "#333333", # Textfarbe
|
colors = get_colors()
|
||||||
"accent": "#663300", # Akzentfarbe
|
plot_styles = get_plot_styles()
|
||||||
"primaryLine": "#660066", # Bildungswirkfaktor
|
|
||||||
"secondaryLine": "#cc6600", # Bildungswirkindikator
|
|
||||||
"depthArea": "#006666", # Kompetenzmessunsicherheit
|
|
||||||
"brightArea": "#66CCCC", # Kompetenzentwicklungsunsicherheit
|
|
||||||
"positiveHighlight": "#336600", # Positive Hervorhebung
|
|
||||||
"negativeHighlight": "#990000", # Negative Hervorhebung
|
|
||||||
"white": "#ffffff" # Weiß
|
|
||||||
}
|
|
||||||
|
|
||||||
# Liste der Farben, die für die Wörter verwendet werden sollen
|
# Liste der Farben, die für die Wörter verwendet werden sollen
|
||||||
word_colors = [
|
word_colors = [
|
||||||
@ -267,7 +270,7 @@ def visualize_network(bib_database):
|
|||||||
|
|
||||||
edge_trace = go.Scatter(
|
edge_trace = go.Scatter(
|
||||||
x=edge_x, y=edge_y,
|
x=edge_x, y=edge_y,
|
||||||
line=dict(width=0.5, color=colors['white']),
|
line=plot_styles['linie_secondaryLine'],
|
||||||
hoverinfo='none',
|
hoverinfo='none',
|
||||||
mode='lines')
|
mode='lines')
|
||||||
|
|
||||||
@ -290,6 +293,16 @@ def visualize_network(bib_database):
|
|||||||
tertiary_nodes.append(node_data)
|
tertiary_nodes.append(node_data)
|
||||||
|
|
||||||
def create_node_trace(nodes, name, color):
|
def create_node_trace(nodes, name, color):
|
||||||
|
# Wähle Punktstil je nach color
|
||||||
|
if color == colors['primaryLine']:
|
||||||
|
marker_style = plot_styles['punkt_primaryLine'].copy()
|
||||||
|
elif color == colors['secondaryLine']:
|
||||||
|
marker_style = plot_styles['punkt_secondaryLine'].copy()
|
||||||
|
elif color == colors['brightArea']:
|
||||||
|
marker_style = plot_styles['punkt_brightArea'].copy()
|
||||||
|
else:
|
||||||
|
marker_style = dict(color=color)
|
||||||
|
marker_style['size'] = [n['size'] for n in nodes]
|
||||||
return go.Scatter(
|
return go.Scatter(
|
||||||
x=[n['x'] for n in nodes],
|
x=[n['x'] for n in nodes],
|
||||||
y=[n['y'] for n in nodes],
|
y=[n['y'] for n in nodes],
|
||||||
@ -297,13 +310,9 @@ def visualize_network(bib_database):
|
|||||||
text=[n['text'] for n in nodes],
|
text=[n['text'] for n in nodes],
|
||||||
hovertext=[n['hovertext'] for n in nodes],
|
hovertext=[n['hovertext'] for n in nodes],
|
||||||
hoverinfo='text',
|
hoverinfo='text',
|
||||||
marker=dict(
|
marker=marker_style,
|
||||||
size=[n['size'] for n in nodes],
|
|
||||||
color=color,
|
|
||||||
line_width=2
|
|
||||||
),
|
|
||||||
textposition="top center",
|
textposition="top center",
|
||||||
textfont=dict(size=12),
|
textfont=dict(size=10, color=colors['white']),
|
||||||
name=name
|
name=name
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -311,42 +320,15 @@ def visualize_network(bib_database):
|
|||||||
secondary_trace = create_node_trace(secondary_nodes, "Sekundäre Begriffe", colors['secondaryLine'])
|
secondary_trace = create_node_trace(secondary_nodes, "Sekundäre Begriffe", colors['secondaryLine'])
|
||||||
tertiary_trace = create_node_trace(tertiary_nodes, "Tertiäre Begriffe", colors['brightArea'])
|
tertiary_trace = create_node_trace(tertiary_nodes, "Tertiäre Begriffe", colors['brightArea'])
|
||||||
|
|
||||||
fig = go.Figure(data=[edge_trace, primary_trace, secondary_trace, tertiary_trace],
|
fig = go.Figure(data=[edge_trace, primary_trace, secondary_trace, tertiary_trace])
|
||||||
layout=go.Layout(
|
layout = get_standard_layout(
|
||||||
title=f'Suchbegriff-Netzwerk nach Relevanz und Semantik (n={sum(fundzahlen.values())}, Stand: {current_date}) | Quelle: {bib_filename.replace(".bib", "")}',
|
title=f"Suchbegriff-Netzwerk nach Relevanz und Semantik (n={sum(fundzahlen.values())}, Stand: {current_date})",
|
||||||
titlefont_size=16,
|
x_title="Technologische Dimension",
|
||||||
showlegend=True,
|
y_title="Pädagogische Dimension"
|
||||||
legend=dict(
|
)
|
||||||
bgcolor=colors['background'],
|
layout["margin"] = dict(b=20, l=5, r=5, t=40)
|
||||||
bordercolor=colors['white'],
|
layout["hovermode"] = "closest"
|
||||||
borderwidth=1,
|
fig.update_layout(**layout)
|
||||||
font=dict(color=colors['white']),
|
|
||||||
itemsizing='constant'
|
|
||||||
),
|
|
||||||
hovermode='closest',
|
|
||||||
margin=dict(b=20, l=5, r=5, t=40),
|
|
||||||
xaxis=dict(
|
|
||||||
range=[x_scale_min, x_scale_max + 1],
|
|
||||||
showgrid=True,
|
|
||||||
zeroline=True,
|
|
||||||
tickmode='linear',
|
|
||||||
tick0=x_scale_min,
|
|
||||||
dtick=(x_scale_max - x_scale_min) / 4,
|
|
||||||
title='Technologische Dimension'
|
|
||||||
),
|
|
||||||
yaxis=dict(
|
|
||||||
range=[y_scale_min, y_scale_max + 1],
|
|
||||||
showgrid=True,
|
|
||||||
zeroline=True,
|
|
||||||
tickmode='linear',
|
|
||||||
tick0=y_scale_min,
|
|
||||||
dtick=(y_scale_max - y_scale_min) / 4,
|
|
||||||
title='Pädagogische Dimension'
|
|
||||||
),
|
|
||||||
plot_bgcolor=colors['background'],
|
|
||||||
paper_bgcolor=colors['background'],
|
|
||||||
font=dict(color=colors['white'])
|
|
||||||
))
|
|
||||||
|
|
||||||
fig.show()
|
fig.show()
|
||||||
export_figure(fig, "visualize_network", export_fig_visualize_network, bib_filename)
|
export_figure(fig, "visualize_network", export_fig_visualize_network, bib_filename)
|
||||||
@ -434,26 +416,18 @@ def visualize_tags(bib_database):
|
|||||||
data,
|
data,
|
||||||
x='Tag',
|
x='Tag',
|
||||||
y='Count',
|
y='Count',
|
||||||
title=f'Häufigkeit der Suchbegriffe in der Literaturanalyse (n={total_count}, Stand: {current_date}) | Quelle: {bib_filename.replace(".bib", "")}',
|
title=f'Häufigkeit der Suchbegriffe in der Literaturanalyse (n={total_count}, Stand: {current_date})',
|
||||||
labels={'Tag': 'Tag', 'Count': 'Anzahl der Vorkommen'},
|
labels={'Tag': 'Tag', 'Count': 'Anzahl der Vorkommen'},
|
||||||
color='Type',
|
color='Type',
|
||||||
color_discrete_map=color_map,
|
color_discrete_map=color_map,
|
||||||
text_auto=True
|
text_auto=True
|
||||||
)
|
)
|
||||||
|
|
||||||
# Layout anpassen
|
fig.update_layout(**get_standard_layout(
|
||||||
fig.update_layout(
|
title=fig.layout.title.text,
|
||||||
plot_bgcolor=colors['background'],
|
x_title='Tag',
|
||||||
paper_bgcolor=colors['background'],
|
y_title='Anzahl der Vorkommen'
|
||||||
font=dict(color=colors['white']),
|
))
|
||||||
margin=dict(l=0, r=0, t=40, b=40),
|
|
||||||
autosize=True
|
|
||||||
)
|
|
||||||
|
|
||||||
fig.update_traces(
|
|
||||||
marker_line_color=colors['white'],
|
|
||||||
marker_line_width=1.5
|
|
||||||
)
|
|
||||||
|
|
||||||
fig.show(config={"responsive": True})
|
fig.show(config={"responsive": True})
|
||||||
export_figure(fig, "visualize_tags", export_fig_visualize_tags, bib_filename)
|
export_figure(fig, "visualize_tags", export_fig_visualize_tags, bib_filename)
|
||||||
@ -488,18 +462,13 @@ def visualize_index(bib_database):
|
|||||||
print(f"Häufigkeit Indizes (Gesamtanzahl: {total_count}):")
|
print(f"Häufigkeit Indizes (Gesamtanzahl: {total_count}):")
|
||||||
print(tabulate(index_data, headers="keys", tablefmt="grid"))
|
print(tabulate(index_data, headers="keys", tablefmt="grid"))
|
||||||
|
|
||||||
fig = px.bar(index_data, x='Index', y='Count', title=f'Relevanzschlüssel nach Indexkategorien (n={total_count}, Stand: {current_date}) | Quelle: {bib_filename.replace(".bib", "")}', labels={'Index': 'Index', 'Count': 'Anzahl der Vorkommen'}, text_auto=True)
|
fig = px.bar(index_data, x='Index', y='Count', title=f'Relevanzschlüssel nach Indexkategorien (n={total_count}, Stand: {current_date})', labels={'Index': 'Index', 'Count': 'Anzahl der Vorkommen'}, text_auto=True)
|
||||||
|
fig.update_layout(**get_standard_layout(
|
||||||
fig.update_layout(
|
title=fig.layout.title.text,
|
||||||
plot_bgcolor=colors['background'],
|
x_title='Index',
|
||||||
paper_bgcolor=colors['background'],
|
y_title='Anzahl der Vorkommen'
|
||||||
font=dict(color=colors['white']),
|
))
|
||||||
margin=dict(l=0, r=0, t=40, b=40),
|
fig.update_traces(marker=plot_styles['balken_primaryLine'])
|
||||||
autosize=True
|
|
||||||
)
|
|
||||||
|
|
||||||
fig.update_traces(marker_color=colors['primaryLine'], marker_line_color=colors['white'], marker_line_width=1.5)
|
|
||||||
|
|
||||||
fig.show(config={"responsive": True})
|
fig.show(config={"responsive": True})
|
||||||
export_figure(fig, "visualize_index", export_fig_visualize_index, bib_filename)
|
export_figure(fig, "visualize_index", export_fig_visualize_index, bib_filename)
|
||||||
|
|
||||||
@ -534,18 +503,13 @@ def visualize_research_questions(bib_database):
|
|||||||
print(f"Häufigkeit Forschungsunterfragen (Gesamtanzahl: {total_count}):")
|
print(f"Häufigkeit Forschungsunterfragen (Gesamtanzahl: {total_count}):")
|
||||||
print(tabulate(rq_data, headers="keys", tablefmt="grid"))
|
print(tabulate(rq_data, headers="keys", tablefmt="grid"))
|
||||||
|
|
||||||
fig = px.bar(rq_data_df, x='Research_Question', y='Count', title=f'Zuordnung der Literatur zu Forschungsunterfragen (n={total_count}, Stand: {current_date}) | Quelle: {bib_filename.replace(".bib", "")}', labels={'Research_Question': 'Forschungsunterfrage', 'Count': 'Anzahl der Vorkommen'}, text_auto=True)
|
fig = px.bar(rq_data_df, x='Research_Question', y='Count', title=f'Zuordnung der Literatur zu Forschungsunterfragen (n={total_count}, Stand: {current_date})', labels={'Research_Question': 'Forschungsunterfrage', 'Count': 'Anzahl der Vorkommen'}, text_auto=True)
|
||||||
|
fig.update_layout(**get_standard_layout(
|
||||||
fig.update_layout(
|
title=fig.layout.title.text,
|
||||||
plot_bgcolor=colors['background'],
|
x_title='Forschungsunterfrage',
|
||||||
paper_bgcolor=colors['background'],
|
y_title='Anzahl der Vorkommen'
|
||||||
font=dict(color=colors['white']),
|
))
|
||||||
margin=dict(l=0, r=0, t=40, b=40),
|
fig.update_traces(marker=plot_styles['balken_primaryLine'])
|
||||||
autosize=True
|
|
||||||
)
|
|
||||||
|
|
||||||
fig.update_traces(marker_color=colors['primaryLine'], marker_line_color=colors['white'], marker_line_width=1.5)
|
|
||||||
|
|
||||||
fig.show(config={"responsive": True})
|
fig.show(config={"responsive": True})
|
||||||
export_figure(fig, "visualize_research_questions", export_fig_visualize_research_questions, bib_filename)
|
export_figure(fig, "visualize_research_questions", export_fig_visualize_research_questions, bib_filename)
|
||||||
|
|
||||||
@ -575,18 +539,13 @@ def visualize_categories(bib_database):
|
|||||||
print(f"Häufigkeit Kategorien (Gesamtanzahl: {total_count}):")
|
print(f"Häufigkeit Kategorien (Gesamtanzahl: {total_count}):")
|
||||||
print(tabulate(cat_data, headers="keys", tablefmt="grid"))
|
print(tabulate(cat_data, headers="keys", tablefmt="grid"))
|
||||||
|
|
||||||
fig = px.bar(cat_data_df, x='Category', y='Count', title=f'Textsortenzuordnung der analysierten Quellen (n={total_count}, Stand: {current_date}) | Quelle: {bib_filename.replace(".bib", "")}', labels={'Category': 'Kategorie', 'Count': 'Anzahl der Vorkommen'}, text_auto=True)
|
fig = px.bar(cat_data_df, x='Category', y='Count', title=f'Textsortenzuordnung der analysierten Quellen (n={total_count}, Stand: {current_date})', labels={'Category': 'Kategorie', 'Count': 'Anzahl der Vorkommen'}, text_auto=True)
|
||||||
|
fig.update_layout(**get_standard_layout(
|
||||||
fig.update_layout(
|
title=fig.layout.title.text,
|
||||||
plot_bgcolor=colors['background'],
|
x_title='Kategorie',
|
||||||
paper_bgcolor=colors['background'],
|
y_title='Anzahl der Vorkommen'
|
||||||
font=dict(color=colors['white']),
|
))
|
||||||
margin=dict(l=0, r=0, t=40, b=40),
|
fig.update_traces(marker=plot_styles['balken_primaryLine'])
|
||||||
autosize=True
|
|
||||||
)
|
|
||||||
|
|
||||||
fig.update_traces(marker_color=colors['primaryLine'], marker_line_color=colors['white'], marker_line_width=1.5)
|
|
||||||
|
|
||||||
fig.show(config={"responsive": True})
|
fig.show(config={"responsive": True})
|
||||||
export_figure(fig, "visualize_categories", export_fig_visualize_categories, bib_filename)
|
export_figure(fig, "visualize_categories", export_fig_visualize_categories, bib_filename)
|
||||||
|
|
||||||
@ -616,24 +575,21 @@ def visualize_time_series(bib_database):
|
|||||||
df,
|
df,
|
||||||
x='Year',
|
x='Year',
|
||||||
y='Count',
|
y='Count',
|
||||||
title=f'Jährliche Veröffentlichungen in der Literaturanalyse (n={sum(year_counts.values())}, Stand: {current_date}) | Quelle: {bib_filename.replace(".bib", "")}',
|
title=f'Jährliche Veröffentlichungen in der Literaturanalyse (n={sum(year_counts.values())}, Stand: {current_date})',
|
||||||
labels={'Year': 'Jahr', 'Count': 'Anzahl der Veröffentlichungen'}
|
labels={'Year': 'Jahr', 'Count': 'Anzahl der Veröffentlichungen'}
|
||||||
)
|
)
|
||||||
|
layout = get_standard_layout(
|
||||||
fig.update_layout(
|
title=fig.layout.title.text,
|
||||||
plot_bgcolor=colors['background'],
|
x_title='Jahr',
|
||||||
paper_bgcolor=colors['background'],
|
y_title='Anzahl der Veröffentlichungen'
|
||||||
font=dict(color=colors['white']),
|
)
|
||||||
xaxis=dict(
|
layout["xaxis"] = dict(
|
||||||
tickmode='linear',
|
tickmode='linear',
|
||||||
dtick=2,
|
dtick=2,
|
||||||
tick0=min(publication_years)
|
tick0=min(publication_years)
|
||||||
),
|
|
||||||
margin=dict(l=0, r=0, t=40, b=40),
|
|
||||||
autosize=True
|
|
||||||
)
|
)
|
||||||
|
fig.update_layout(**layout)
|
||||||
fig.update_traces(line=dict(color=colors['secondaryLine'], width=3))
|
fig.update_traces(line=plot_styles['linie_secondaryLine'])
|
||||||
fig.show(config={"responsive": True})
|
fig.show(config={"responsive": True})
|
||||||
export_figure(fig, "visualize_time_series", export_fig_visualize_time_series, bib_filename)
|
export_figure(fig, "visualize_time_series", export_fig_visualize_time_series, bib_filename)
|
||||||
else:
|
else:
|
||||||
@ -653,16 +609,13 @@ def visualize_top_authors(bib_database):
|
|||||||
if top_authors:
|
if top_authors:
|
||||||
df = pd.DataFrame(top_authors, columns=['Author', 'Count'])
|
df = pd.DataFrame(top_authors, columns=['Author', 'Count'])
|
||||||
|
|
||||||
fig = px.bar(df, x='Author', y='Count', title=f'Meistgenannte Autor:innen in der Literaturanalyse (Top {top_n}, n={sum(author_counts.values())}, Stand: {current_date}) | Quelle: {bib_filename.replace(".bib", "")}', labels={'Author': 'Autor', 'Count': 'Anzahl der Werke'}, text_auto=True)
|
fig = px.bar(df, x='Author', y='Count', title=f'Meistgenannte Autor:innen in der Literaturanalyse (Top {top_n}, n={sum(author_counts.values())}, Stand: {current_date})', labels={'Author': 'Autor', 'Count': 'Anzahl der Werke'}, text_auto=True)
|
||||||
fig.update_layout(
|
fig.update_layout(**get_standard_layout(
|
||||||
plot_bgcolor=colors['background'],
|
title=fig.layout.title.text,
|
||||||
paper_bgcolor=colors['background'],
|
x_title='Autor',
|
||||||
font=dict(color=colors['white']),
|
y_title='Anzahl der Werke'
|
||||||
margin=dict(l=0, r=0, t=40, b=40),
|
))
|
||||||
autosize=True
|
fig.update_traces(marker=plot_styles['balken_primaryLine'])
|
||||||
)
|
|
||||||
fig.update_traces(marker_color=colors['primaryLine'], marker_line_color=colors['white'], marker_line_width=1.5)
|
|
||||||
|
|
||||||
fig.show(config={"responsive": True})
|
fig.show(config={"responsive": True})
|
||||||
export_figure(fig, "visualize_top_authors", export_fig_visualize_top_authors, bib_filename)
|
export_figure(fig, "visualize_top_authors", export_fig_visualize_top_authors, bib_filename)
|
||||||
else:
|
else:
|
||||||
@ -695,19 +648,16 @@ def visualize_top_publications(bib_database):
|
|||||||
|
|
||||||
df = pd.DataFrame(publication_data)
|
df = pd.DataFrame(publication_data)
|
||||||
|
|
||||||
fig = px.bar(df, x='Title', y='Count', title=f'Häufig zitierte Publikationen in der Analyse (Top {top_n}, n={sum(publication_counts.values())}, Stand: {current_date}) | Quelle: {bib_filename.replace(".bib", "")}', labels={'Title': 'Titel', 'Count': 'Anzahl der Nennungen'})
|
fig = px.bar(df, x='Title', y='Count', title=f'Häufig zitierte Publikationen in der Analyse (Top {top_n}, n={sum(publication_counts.values())}, Stand: {current_date})', labels={'Title': 'Titel', 'Count': 'Anzahl der Nennungen'})
|
||||||
|
layout = get_standard_layout(
|
||||||
fig.update_layout(
|
title=fig.layout.title.text,
|
||||||
plot_bgcolor=colors['background'],
|
x_title='Titel',
|
||||||
paper_bgcolor=colors['background'],
|
y_title='Anzahl der Nennungen'
|
||||||
font=dict(color=colors['white']),
|
|
||||||
xaxis_tickangle=-45,
|
|
||||||
margin=dict(l=0, r=0, t=40, b=40),
|
|
||||||
autosize=True
|
|
||||||
)
|
)
|
||||||
|
layout["xaxis"] = layout.get("xaxis", {})
|
||||||
fig.update_traces(marker_color=colors['primaryLine'], marker_line_color=colors['white'], marker_line_width=1.5)
|
layout["xaxis"]["tickangle"] = -45
|
||||||
|
fig.update_layout(**layout)
|
||||||
|
fig.update_traces(marker=plot_styles['balken_primaryLine'])
|
||||||
fig.show(config={"responsive": True})
|
fig.show(config={"responsive": True})
|
||||||
export_figure(fig, "visualize_top_publications", export_fig_visualize_top_publications, bib_filename)
|
export_figure(fig, "visualize_top_publications", export_fig_visualize_top_publications, bib_filename)
|
||||||
|
|
||||||
@ -823,7 +773,7 @@ def create_path_diagram(data):
|
|||||||
node=dict(
|
node=dict(
|
||||||
pad=15,
|
pad=15,
|
||||||
thickness=20,
|
thickness=20,
|
||||||
line=dict(color=colors['white'], width=0.5),
|
line=dict(color="black", width=0.5),
|
||||||
label=labels,
|
label=labels,
|
||||||
color=node_colors
|
color=node_colors
|
||||||
),
|
),
|
||||||
@ -833,14 +783,13 @@ def create_path_diagram(data):
|
|||||||
value=values
|
value=values
|
||||||
)
|
)
|
||||||
)])
|
)])
|
||||||
|
layout = get_standard_layout(
|
||||||
fig.update_layout(
|
title=f'Kategorischer Analysepfad der Literatur (n={len(data)}, Stand: {current_date})',
|
||||||
title_text=f'Kategorischer Analysepfad der Literatur (n={len(data)}, Stand: {current_date}) | Quelle: {bib_filename.replace(".bib", "")}',
|
x_title='',
|
||||||
font=dict(size=10, color=colors['white']),
|
y_title=''
|
||||||
plot_bgcolor=colors['background'],
|
|
||||||
paper_bgcolor=colors['background']
|
|
||||||
)
|
)
|
||||||
|
layout["font"] = dict(size=10, color=colors['white'])
|
||||||
|
fig.update_layout(**layout)
|
||||||
fig.show()
|
fig.show()
|
||||||
export_figure(fig, "create_path_diagram", export_fig_create_path_diagram, bib_filename)
|
export_figure(fig, "create_path_diagram", export_fig_create_path_diagram, bib_filename)
|
||||||
|
|
||||||
@ -950,30 +899,26 @@ def create_sankey_diagram(bib_database):
|
|||||||
# Sankey-Diagramm erstellen
|
# Sankey-Diagramm erstellen
|
||||||
fig = go.Figure(go.Sankey(
|
fig = go.Figure(go.Sankey(
|
||||||
node=dict(
|
node=dict(
|
||||||
pad=15,
|
**plot_styles["sankey_node"],
|
||||||
thickness=20,
|
|
||||||
line=dict(color="black", width=0.5),
|
|
||||||
label=node_labels,
|
label=node_labels,
|
||||||
color=node_colors
|
color=node_colors
|
||||||
),
|
),
|
||||||
link=dict(
|
link=dict(
|
||||||
|
**plot_styles["sankey_link"],
|
||||||
source=sources,
|
source=sources,
|
||||||
target=targets,
|
target=targets,
|
||||||
value=values,
|
value=values
|
||||||
hoverinfo='all', # Zeigt detaillierte Infos bei Mouseover an
|
|
||||||
color=colors['accent']
|
|
||||||
)
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
# Layout anpassen
|
# Layout anpassen
|
||||||
fig.update_layout(
|
layout = get_standard_layout(
|
||||||
title_text=f"Flussdiagramm der Literaturselektion (Stichprobe: n={sample_size}, Stand: {current_date}) | Quelle: {bib_filename.replace('.bib', '')}",
|
title=f"Flussdiagramm der Literaturselektion (Stichprobe: n={sample_size}, Stand: {current_date})",
|
||||||
font_size=12, # Größere Schriftgröße für bessere Lesbarkeit
|
x_title='',
|
||||||
plot_bgcolor=colors['background'],
|
y_title=''
|
||||||
paper_bgcolor=colors['background'],
|
|
||||||
font=dict(color=colors['white'])
|
|
||||||
)
|
)
|
||||||
|
layout["font"] = layout.get("font", {})
|
||||||
|
layout["font"]["size"] = 12
|
||||||
|
fig.update_layout(**layout)
|
||||||
fig.show()
|
fig.show()
|
||||||
export_figure(fig, "create_sankey_diagram", export_fig_create_sankey_diagram, bib_filename)
|
export_figure(fig, "create_sankey_diagram", export_fig_create_sankey_diagram, bib_filename)
|
||||||
|
|
||||||
@ -1073,35 +1018,29 @@ def visualize_sources_status(bib_database):
|
|||||||
))
|
))
|
||||||
|
|
||||||
fig = go.Figure()
|
fig = go.Figure()
|
||||||
|
|
||||||
fig.add_trace(go.Bar(
|
fig.add_trace(go.Bar(
|
||||||
x=tags,
|
x=tags,
|
||||||
y=analysiert_values,
|
y=analysiert_values,
|
||||||
name='Analysiert',
|
name='Analysiert',
|
||||||
marker=dict(color=analysiert_colors)
|
marker=dict(color=analysiert_colors)
|
||||||
))
|
))
|
||||||
|
|
||||||
fig.add_trace(go.Bar(
|
fig.add_trace(go.Bar(
|
||||||
x=tags,
|
x=tags,
|
||||||
y=nicht_analysiert_values,
|
y=nicht_analysiert_values,
|
||||||
name='Nicht-Analysiert',
|
name='Nicht-Analysiert',
|
||||||
marker=dict(color=colors['primaryLine'])
|
marker=plot_styles['balken_primaryLine']
|
||||||
))
|
))
|
||||||
|
layout = get_standard_layout(
|
||||||
fig.update_layout(
|
title=f'Analyse- und Stichprobenstatus je Suchordner (n={sum(counts["Identifiziert"] for counts in source_data.values())}, Stand: {current_date})',
|
||||||
barmode='stack',
|
x_title='Suchbegriffsordner',
|
||||||
title=f'Analyse- und Stichprobenstatus je Suchordner (n={sum(counts["Identifiziert"] for counts in source_data.values())}, Stand: {current_date}) | Quelle: {bib_filename.replace(".bib", "")}',
|
y_title='Anzahl der Quellen'
|
||||||
xaxis_title='Suchbegriffsordner',
|
)
|
||||||
yaxis_title='Anzahl der Quellen',
|
layout["barmode"] = "stack"
|
||||||
plot_bgcolor=colors['background'],
|
layout["xaxis"] = dict(
|
||||||
paper_bgcolor=colors['background'],
|
|
||||||
font=dict(color=colors['white']),
|
|
||||||
xaxis=dict(
|
|
||||||
categoryorder='array',
|
categoryorder='array',
|
||||||
categoryarray=search_folder_tags
|
categoryarray=search_folder_tags
|
||||||
)
|
)
|
||||||
)
|
fig.update_layout(**layout)
|
||||||
|
|
||||||
fig.show()
|
fig.show()
|
||||||
export_figure(fig, "visualize_sources_status", export_fig_visualize_sources_status, bib_filename)
|
export_figure(fig, "visualize_sources_status", export_fig_visualize_sources_status, bib_filename)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user