diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d13c57b --- /dev/null +++ b/.gitignore @@ -0,0 +1,114 @@ +# This file is taken from: +# https://github.com/github/gitignore/blob/master/Python.gitignore + +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +.static_storage/ +.media/ +local_settings.py + +# Pycharm: +.idea + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# pyenv +.python-version + +# celery beat schedule file +celerybeat-schedule + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ + +# custom +.cache diff --git a/app.py b/app.py index e882e71..c5de028 100644 --- a/app.py +++ b/app.py @@ -72,37 +72,46 @@ def display_file(file_content, file_name): data_dict = [{'No.':'{:03d}'.format(i+1), 't':data[i][0], 'x':data[i][1], 'y':data[i][2], 'z':data[i][3]} for i in range(data.shape[0])] kep, res = e_fit.determine_kep(data[:,1:]) - return [html.Div(children=file_name, className='section-titles'), - - dt.DataTable(rows=data_dict,editable=False), + return [ + dcc.Markdown('''File Name: **'''+file_name+'''**'''), + + html.Details([ + html.Summary('''File Contents'''), + dt.DataTable(rows=data_dict,editable=False) + ]), - html.Div(children='Computed Keplerian Elements', className='section-titles'), - - dt.DataTable(rows=[ - {'Element':'Semi-major Axis', - 'Value' :str(kep[0][0])}, - {'Element':'Eccentricity', - 'Value' :str(kep[1][0])}, - {'Element':'Inclination', - 'Value' :str(kep[2][0])}, - {'Element':'Argument of Periapsis', - 'Value' :str(kep[3][0])}, - {'Element':'Right Ascension of Ascending Node', - 'Value' :str(kep[4][0])}, - {'Element':'True Anomaly', - 'Value' :str(kep[5][0])}, - ],editable=False), + html.Details([ + html.Summary('''Computed Keplerian Elements'''), + dt.DataTable(rows=[ + {'Element':'Semi-major Axis', + 'Value' :str(kep[0][0])}, + {'Element':'Eccentricity', + 'Value' :str(kep[1][0])}, + {'Element':'Inclination', + 'Value' :str(kep[2][0])}, + {'Element':'Argument of Periapsis', + 'Value' :str(kep[3][0])}, + {'Element':'Right Ascension of Ascending Node', + 'Value' :str(kep[4][0])}, + {'Element':'True Anomaly', + 'Value' :str(kep[5][0])}, + ],editable=False) + ],open=True), - dcc.Graph(id='orbit-plot', - figure={ - 'data':[{'x':data[:,1],'y':data[:,2],'z':data[:,3],'mode':'markers','type':'scatter3d','marker':{ - 'size':2, - 'opacity':0.8 - }}], - 'layout':{ - 'height': 600 + html.Details([ + html.Summary('''3D Plot'''), + dcc.Graph(id='orbit-plot', + figure={ + 'data':[{'x':data[:,1],'y':data[:,2],'z':data[:,3],'mode':'lines','type':'scatter3d','line':{ + 'width':5, + }}], + 'layout':{ + 'height': 500, } - })] + } + ) + ],open=True) + ] else: return html.Div('''There was an error processing this file.''') diff --git a/static/style.css b/static/style.css index b449498..36d70ab 100644 --- a/static/style.css +++ b/static/style.css @@ -24,7 +24,14 @@ html { text-align: center; } -.section-titles { +summary { + border-bottom: solid 1px #ddd; + padding: 0.1em 0.3em; + outline: none; font-weight: bold; - padding: 0.5em; +} + +details { + margin: 0.3em 0; + border: solid 1px #ddd; }