From 831049ae55394979db6c6cf066f17df473971789 Mon Sep 17 00:00:00 2001 From: mseng10 Date: Tue, 24 Sep 2024 19:28:36 -0500 Subject: [PATCH] MISC: Small changes --- client/.eslintrc.json | 6 +-- client/src/App.css | 83 ++++++++++++++++++++++++++++++++++++++-- docker-compose.yml | 3 +- model/.gitignore | 7 ++++ server/app.py | 17 +++++++++ server/requirements.txt | 85 +++++++++++++++++++++++++++++++++++++++++ 6 files changed, 191 insertions(+), 10 deletions(-) create mode 100644 model/.gitignore diff --git a/client/.eslintrc.json b/client/.eslintrc.json index 29dfeaa..03dd135 100644 --- a/client/.eslintrc.json +++ b/client/.eslintrc.json @@ -29,11 +29,7 @@ "newline-before-return": "error", "space-before-blocks": "error", "no-alert": "error", - "react/prop-types": 0, - "indent": [ - "error", - 2 - ] + "react/prop-types": 0 }, "settings": { "react": { diff --git a/client/src/App.css b/client/src/App.css index 89c522e..0184b70 100644 --- a/client/src/App.css +++ b/client/src/App.css @@ -224,7 +224,82 @@ 100% { transform: translateY(calc(-200vh)) rotate(600deg); } } -.test { - background-color: white!important; - color: white!important; -} \ No newline at end of file +.pieContainer { + height: 150px; + position: relative; +} + +.pieBackground { + position: absolute; + width: 150px; + height: 150px; + border-radius: 100%; + box-shadow: 0px 0px 8px rgba(0,0,0,0.5); +} + +.pie { + transition: all 1s; + position: absolute; + width: 150px; + height: 150px; + border-radius: 100%; + clip: rect(0px, 75px, 150px, 0px); +} + +.hold { + position: absolute; + width: 150px; + height: 150px; + border-radius: 100%; + clip: rect(0px, 150px, 150px, 75px); +} + +#pieSlice1 .pie { + background-color: #1b458b; + transform:rotate(30deg); +} + +#pieSlice2 { + transform: rotate(30deg); +} + +#pieSlice2 .pie { + background-color: #0a0; + transform: rotate(60deg); +} + +#pieSlice3 { + transform: rotate(90deg); +} + +#pieSlice3 .pie { + background-color: #f80; + transform: rotate(120deg); +} + +#pieSlice4 { + transform: rotate(210deg); +} + +#pieSlice4 .pie { + background-color: #08f; + transform: rotate(10deg); +} + +#pieSlice5 { + transform: rotate(220deg); +} + +#pieSlice5 .pie { + background-color: #a04; + transform: rotate(70deg); +} + +#pieSlice6 { + transform: rotate(290deg); +} + +#pieSlice6 .pie { + background-color: #ffd700; + transform: rotate(70deg); +} diff --git a/docker-compose.yml b/docker-compose.yml index 237af92..2fd87b7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,6 +7,8 @@ services: - "5000:5000" environment: - DATABASE_URL=postgresql://postgres:admin@db:5432/plnts + - USE_LOCAL_HARDWARE=true + - ENVIRONMENT=docker depends_on: - db @@ -16,7 +18,6 @@ services: - "3000:3000" depends_on: - backend - db: image: postgres:13 volumes: diff --git a/model/.gitignore b/model/.gitignore new file mode 100644 index 0000000..d7f7bcf --- /dev/null +++ b/model/.gitignore @@ -0,0 +1,7 @@ +venv/ + +.idea/ + +*.log + +*.json \ No newline at end of file diff --git a/server/app.py b/server/app.py index 752c53a..6567d0f 100644 --- a/server/app.py +++ b/server/app.py @@ -78,6 +78,23 @@ def get_meta(): logger.info("Successfully generated meta data.") return jsonify(meta) +@app.route("/notebook/", methods=["GET"]) +def get_notebook(): + """ + Get the jupyter notebook for this. + """ + # Read the notebook + with open("notebook", 'r', encoding='utf-8') as f: + notebook_content = nbformat.read(f, as_version=4) + + # Convert the notebook to HTML + html_exporter = HTMLExporter() + html_exporter.template_name = 'classic' + (body, _) = html_exporter.from_notebook_node(notebook_content) + + # Serve the HTML + return body + if __name__ == "__main__": # Run the Flask app diff --git a/server/requirements.txt b/server/requirements.txt index 72bd62a..5f6bd38 100644 --- a/server/requirements.txt +++ b/server/requirements.txt @@ -6,46 +6,131 @@ adafruit-circuitpython-requests==4.1.6 adafruit-circuitpython-typing==1.11.0 Adafruit-PlatformDetect==3.74.0 Adafruit-PureIO==1.1.11 +anyio==4.4.0 +appnope==0.1.4 +argon2-cffi==23.1.0 +argon2-cffi-bindings==21.2.0 +arrow==1.3.0 +asttokens==2.4.1 +async-lru==2.0.4 +attrs==24.2.0 +babel==2.16.0 beautifulsoup4==4.12.3 binho-host-adapter==0.1.6 +bleach==6.1.0 blinker==1.7.0 certifi==2024.6.2 +cffi==1.17.1 charset-normalizer==3.3.2 click==8.1.7 colorama==0.4.6 +comm==0.2.2 contourpy==1.2.1 cycler==0.12.1 +debugpy==1.8.5 +decorator==5.1.1 +defusedxml==0.7.1 +exceptiongroup==1.2.2 +executing==2.1.0 +fastjsonschema==2.20.0 Flask==3.0.1 Flask-Cors==4.0.1 fonttools==4.53.1 +fqdn==1.5.1 +h11==0.14.0 +httpcore==1.0.5 +httpx==0.27.2 idna==3.7 importlib-metadata==7.0.1 importlib_resources==6.4.0 +ipykernel==6.29.5 +ipython==8.18.1 +ipywidgets==8.1.5 +isoduration==20.11.0 itsdangerous==2.1.2 +jedi==0.19.1 Jinja2==3.1.3 +json5==0.9.25 +jsonpointer==3.0.0 +jsonschema==4.23.0 +jsonschema-specifications==2023.12.1 +jupyter==1.1.1 +jupyter-console==6.6.3 +jupyter-events==0.10.0 +jupyter-lsp==2.2.5 +jupyter_client==8.6.2 +jupyter_core==5.7.2 +jupyter_server==2.14.2 +jupyter_server_terminals==0.5.3 +jupyterlab==4.2.5 +jupyterlab_pygments==0.3.0 +jupyterlab_server==2.27.3 +jupyterlab_widgets==3.0.13 kiwisolver==1.4.5 MarkupSafe==2.1.4 marshmallow==3.22.0 marshmallow-sqlalchemy==1.1.0 matplotlib==3.9.1.post1 +matplotlib-inline==0.1.7 +mistune==3.0.2 +nbclient==0.10.0 +nbconvert==7.16.4 +nbformat==5.10.4 +nest-asyncio==1.6.0 +notebook==7.2.2 +notebook_shim==0.2.4 numpy==2.0.1 opencv-python==4.10.0.84 +overrides==7.7.0 packaging==24.1 pandas==2.2.2 +pandocfilters==1.5.1 +parso==0.8.4 +pexpect==4.9.0 pillow==10.4.0 +platformdirs==4.3.3 +prometheus_client==0.20.0 +prompt_toolkit==3.0.47 +psutil==6.0.0 psycopg2-binary==2.9.9 +ptyprocess==0.7.0 +pure_eval==0.2.3 +pycparser==2.22 pyftdi==0.55.4 +Pygments==2.18.0 pyparsing==3.1.2 pyserial==3.5 python-dateutil==2.9.0.post0 +python-json-logger==2.0.7 pytz==2024.1 pyusb==1.2.1 +PyYAML==6.0.2 +pyzmq==26.2.0 +referencing==0.35.1 requests==2.32.3 +rfc3339-validator==0.1.4 +rfc3986-validator==0.1.1 +rpds-py==0.20.0 +Send2Trash==1.8.3 six==1.16.0 +sniffio==1.3.1 soupsieve==2.5 SQLAlchemy==2.0.30 +stack-data==0.6.3 +terminado==0.18.1 +tinycss2==1.3.0 +tomli==2.0.1 +tornado==6.4.1 +traitlets==5.14.3 +types-python-dateutil==2.9.0.20240906 typing_extensions==4.12.0 tzdata==2024.1 +uri-template==1.3.0 urllib3==2.2.1 +wcwidth==0.2.13 +webcolors==24.8.0 +webencodings==0.5.1 +websocket-client==1.8.0 Werkzeug==3.0.1 +widgetsnbextension==4.0.13 zipp==3.17.0