Compare commits

..

No commits in common. "main" and "5faa74daa903c73df5d60272c27c3b294fb04232" have entirely different histories.

5 changed files with 2 additions and 13 deletions

2
.envrc
View File

@ -1,2 +1,2 @@
export FLASK_APP="app:create_app()" export FLASK_APP=app
export FLASK_DEBUG=1 export FLASK_DEBUG=1

View File

@ -1,7 +0,0 @@
yarn
yarn install
yarn build
source .envrc
flask digest clean
flask db upgrade
flask run

View File

@ -58,13 +58,9 @@ def gen_graph_data(numbers):
dots = [absolute_to_percentage_position( dots = [absolute_to_percentage_position(
n, scale_base) for n in numbers] n, scale_base) for n in numbers]
lines = list(zip(dots, dots[1:])) lines = list(zip(dots, dots[1:]))
avg = sum(dots)/len(dots)
print(dots)
print(avg)
return { return {
"dots": dots, "dots": dots,
"lines": lines, "lines": lines,
"scale": scale, "scale": scale,
"avg": avg,
} }

View File

@ -22,6 +22,7 @@ class SettingsForm(FlaskForm):
'Start of day hour', 'Start of day hour',
widget=NumberInput(min=0, max=23), widget=NumberInput(min=0, max=23),
validators=[ validators=[
DataRequired(),
NumberRange(min=0, max=23) NumberRange(min=0, max=23)
] ]
) )

View File

@ -13,7 +13,6 @@
{% for n in scale %} {% for n in scale %}
<line x1="10%" y1="{{ 16.6 * loop.index }}%" x2="96%" y2="{{ 16.6 * loop.index }}%" stroke="#ddd" stroke-width="2px" /> <line x1="10%" y1="{{ 16.6 * loop.index }}%" x2="96%" y2="{{ 16.6 * loop.index }}%" stroke="#ddd" stroke-width="2px" />
{% endfor %} {% endfor %}
<line x1="10%" y1="{{ avg }}%" x2="96%" y2="{{ avg }}%" stroke="#89f393" stroke-width="2px" />
</g> </g>
<g class="legend" style="font-size: 0.9em; text-align:right;"> <g class="legend" style="font-size: 0.9em; text-align:right;">
{% for n in scale | reverse %} {% for n in scale | reverse %}