Skip to content

Commit

Permalink
Design improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
aryadas98 committed Jun 9, 2018
1 parent b494c61 commit d25a93b
Show file tree
Hide file tree
Showing 3 changed files with 160 additions and 30 deletions.
114 changes: 114 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
65 changes: 37 additions & 28 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.''')

Expand Down
11 changes: 9 additions & 2 deletions static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit d25a93b

Please sign in to comment.