Skip to content
Snippets Groups Projects
Commit 8277ad23 authored by Suireen's avatar Suireen
Browse files

Beschriftung und seitliche Graphen darstellung angepasst

parent 14ae5870
No related branches found
No related tags found
1 merge request!27Main
No preview for this file type
......@@ -21,7 +21,7 @@ app = dash.Dash(__name__, external_stylesheets=[dbc.themes.SPACELAB]) #SPACELAB
# List of options when inputting data and generating the graph
additional_options = ['Update Automatically','Smart Input']
# Reads the contents of info_box.txt.
# Reads the contents of info_box.txt.
# They can later be displayed by pressing the corresponding button.
f = open('info_box.txt', 'r')
boxcontent = f.read()
......@@ -46,7 +46,7 @@ html.Div(children=[
# Layer 1: For the string input
dbc.Spinner(html.Div([
"Input: ",
# A simple box for inputting a string.
# A simple box for inputting a string.
# Value is transmitted upon pressing return or clicking out of the box.
dcc.Input(id='string-input', value='', type='text',debounce=True,
style={ "width": "400px"},
......@@ -55,12 +55,12 @@ html.Div(children=[
]),size="lg", color="primary", type="border", fullscreen=True,),
# Layer 2: For file input and recursion depths
html.Div([
"Cited-by Depth: ",
"References Depth: ",
# Forward recursion. Values between 1 and 10 can be entered.
dcc.Input(id='forward-depth',value='1',type='number',min='0',max='5',
style={ "width": "50px"},
),
"References Depth: ",
" Cited-by Depth: ",
# Backward recursion. Values between 1 and 10 can be entered.
dcc.Input(id='backward-depth',value='1',type='number',min='0',max='5',
style={"width": "50px"},
......@@ -72,7 +72,7 @@ html.Div(children=[
#Drag and drop or click to select a file to upload
["Drag and drop"]),
style={
"width": "30%",
"width": "400px",
"height": "60px",
"lineHeight": "60px",
"borderWidth": "1px",
......@@ -85,7 +85,7 @@ html.Div(children=[
# Layer 3: For the checklist, Remove-/Start-Buttons and error message
html.Div([
# All input DOIs are collected in this checklist.
# All input DOIs are collected in this checklist.
# It is initialized to avoid error messages.
dcc.Checklist(id='input-checklist',options=[],
labelStyle = dict(display='block'),value=[]),
......@@ -115,7 +115,7 @@ html.Div(children=[
html.Div(id='generate-graph-error',style={'color':'red'}),
html.Iframe(
src="assets/index.html",
style={"height": "600px", "width": "100%"},
style={"height": "650px", "width": "100%"},
),
]),size="lg", color="primary", type="border", fullscreen=True,),
], style={'padding': 10, 'flex': 1.2})
......@@ -176,14 +176,14 @@ def update_input_checklist(input_value,btn1,btn2,filecontents,all_inputs,
# when a new element is added via dcc.Input
if 'string-input' in changed_id:
# Creates a list of previously added inputs to make sure nothing is added twice
currValues = [x['value'] for x in all_inputs]
currValues = [x['value'] for x in all_inputs]
if input_value not in currValues:
# if 'Smart Input' is selected, the input will be checked for validity
# if 'Smart Input' is selected, the input will be checked for validity
# and a more readable string will be returned
if 'Smart Input' in additional_options:
try:
# Attempts to call get_publication. If unsuccesful,
# Attempts to call get_publication. If unsuccesful,
# the DOI is not added and an error message is returned
i = InputInterface()
pub = i.get_pub_light(input_value)
......@@ -231,7 +231,7 @@ def update_input_checklist(input_value,btn1,btn2,filecontents,all_inputs,
all_inputs.append({'label':input_value,'value':input_value})
return all_inputs,selected_inputs,'',''
# when the programm is first started:
# if this is not done, the input_checklist will be generated
# if this is not done, the input_checklist will be generated
# with one element that contains an empty string
if input_value == '':
return list(),list(),'',''
......@@ -264,7 +264,7 @@ def toggle_collapse(n, is_open):
)
def generate_output(n_clicks,all_inputs,forward_depth,backward_depth,additional_options):
'''
Basic structure for a callback that generates an output. This is only a
Basic structure for a callback that generates an output. This is only a
proof of concept and has noting to do with the intended output yet.
:param n_clicks: how often has Generate Graph been clicked
......@@ -283,7 +283,7 @@ def generate_output(n_clicks,all_inputs,forward_depth,backward_depth,additional_
if n_clicks is None:
raise PreventUpdate
elif 'Update Automatically' in additional_options \
or 'start-button' in changed_id:
or 'start-button' in changed_id:
input_links = [x['value'] for x in all_inputs]
errors = Processing(input_links,int(forward_depth),int(backward_depth),'assets/json_text.json')
if errors:
......
English
Show Info: Can be activated and deactivated by clicking on the button.
Input: input by entering a DOI ("Digital Object Identifier")
Drag and drop or click to select a file to upload: entering multiple DOI by txt-file is only possible if every DOI has its own line.
Recursion:
Clear All: clearing all inputs
Clear Selected: clearing all selected inputs
Generate Graph: generates the graph
Update Automatically: automatically updates the graph for every new input
Smart Input: checks the correctness of the entered DOI and shows a nicer depiction: Author, Journal, publication date.
Deutsch
Bei Eingabe eines DOI ("Digital Object Identifier") oder Hyperlinks zu einem wissenschaftlichen Artikel ist es diesem Programm möglich die Zitierungs-Beziehungen zwischen diesen wissenschaftlichen Artikeln, mittels eines Graphen visuell darzustellen.
Smart Input: direkte Überprüfung der Eingabe auf Richtigkeit zudem wird nicht mehr der DOI angezeigt sondern:
Der Autor, Das Journal, Das Veröffentlichungsdatum. (muss vor Hinzufügen aktiviert worden sein)
German
Show Info: Durch wiederholtes klicken kann das Fenster ein und aus geblendet werden.
Input: Die Eingabe erfolgt in Form eines DOI ("Digital Object Identifier")
Drag and drop or click to select a file to upload: Mehrere DOI in einem txt-Dokument müssen untereinander angeordnet sein.
Recursion:
Clear All: alle Eingaben werden gelöscht
Clear Selected: alle markierten Eingaben werden gelöscht
Generate Graph: generiert den zugehörigen Graphen
Update Automatically: automatische Aktualisierung des Graphen nach neuer Eingabe
Smart Input: direkte Überprüfung der Eingabe auf Richtigkeit zudem wird nicht mehr der DOI angezeigt sondern: Der Autor, Das Journal, Das Veröffentlichungsdatum.
English
By entering a DOI ("Digital Object Identifier") or hyperlink to a scientific article, this program is able to visualize the citation relationships between these scientific articles using a graph.
Smart Input: Direct verification for correctness of the input. In addition, the DOI is no longer displayed but:
The Author, The Journal, The Publication Date. (must be activated before adding the DOI)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment