Skip to content

Commit

Permalink
Rename "colorbar" route to "legend"
Browse files Browse the repository at this point in the history
  • Loading branch information
mfisher87 committed Oct 2, 2024
1 parent 08645e9 commit 76e5fd1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions usaon_benefit_tool/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def _register_blueprints(app) -> None:
# TODO: Extract function register_blueprints
from usaon_benefit_tool.routes.assessment import assessment_bp
from usaon_benefit_tool.routes.assessments import assessments_bp
from usaon_benefit_tool.routes.colorbar import colorbar_bp
from usaon_benefit_tool.routes.legend import legend_bp
from usaon_benefit_tool.routes.login import google_bp, login_bp
from usaon_benefit_tool.routes.logout import logout_bp
from usaon_benefit_tool.routes.node import node_bp
Expand All @@ -181,7 +181,7 @@ def _register_blueprints(app) -> None:
from usaon_benefit_tool.routes.users import users_bp

app.register_blueprint(root_bp)
app.register_blueprint(colorbar_bp)
app.register_blueprint(legend_bp)

app.register_blueprint(user_bp)
app.register_blueprint(users_bp)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

from usaon_benefit_tool.util.colormap import colormap_png_bytes

colorbar_bp = Blueprint('colorbar', __name__)
legend_bp = Blueprint('legend', __name__)


@colorbar_bp.route('/colorbar.png', methods=['GET'])
def get():
@legend_bp.route('/colorbar.png', methods=['GET'])
def get_colorbar_legend():
return Response(
colormap_png_bytes(),
mimetype="image/png",
Expand Down
2 changes: 1 addition & 1 deletion usaon_benefit_tool/templates/assessment/overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ <h3>Description</h3>

{{ display_sankey(sankey_series, assessment=assessment)}}
<div style="text-align: center;">
<img style="margin: auto" src={{ url_for("colorbar.get") }} />
<img style="margin: auto" src={{ url_for("legend.get_colorbar_legend") }} />
<!-- TODO: this label should be baked in to the legend! But was having trouble with the text getting cut off. -->
<p>Performance rating</p>
</div>
Expand Down

0 comments on commit 76e5fd1

Please sign in to comment.