Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong line color on Probabilistic FSA Exceedance Curve #121

Closed
tieganh opened this issue Nov 7, 2023 · 6 comments
Closed

Wrong line color on Probabilistic FSA Exceedance Curve #121

tieganh opened this issue Nov 7, 2023 · 6 comments
Assignees
Labels
Bug Something isn't working Priority: Must Have

Comments

@tieganh
Copy link
Contributor

tieganh commented Nov 7, 2023

Describe the bug
In the screenshot it says it’s showing the exceedance probability curve for forward sortation area V8M, as outlined in “red”, but V8M is actually the thing outlined in black. The way I got to this screen was by selecting the red outlined area (SA) and then clicking the dropdown for the EP curve.

Screenshots
Screen Shot 2023-11-06 at 4 19 14 PM

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Collapse Probabilistic Risk'
  2. Click on 'Victoria' and then select any Settled Area (neighbourhood polygon)
  3. Click 'View Details'
  4. Select 'Loss Exceedance Curve'
  5. You'll see that the first area you selected is outlined in red whereas the larger area (forward sortation area (FSA) / first three digits of postal code) is now outlined in black.

Expected behavior
As described in the text under 'Loss Exceedance Curve', the red line should be for the FSA.

Desktop (please complete the following information):

  • OS: iOS
  • Browser: Chrome
  • Version: Version 117.0.5938.149 (Official Build) (x86_64)

Additional context
You can confirm that the black line is for the FSA and not the SA by selecting another SA within the black line to see that it shares the same FSA.

@tieganh tieganh added Bug Something isn't working Priority: Must Have labels Nov 7, 2023
@drotheram drotheram transferred this issue from OpenDRR/seismic-risk-model Nov 8, 2023
@anthonyfok anthonyfok added this to Backlog in RiskProfiler via automation Nov 17, 2023
@anthonyfok
Copy link
Member

Great catch @tieganh! And thank you @drotheram for the encouragement!

Fortunately, the fix is relatively easy, thanks to the clean code and documentation by @phil-evans. Many thanks, Phil!

The proposed changes are:

  • fw-child/resources/js/rp_risks.js: Search for plugin_settings.map.layers.fsa = new and edit the style accordingly, i.e. changing the black line to red, and I took the liberty of increasing the weight (or thickness) too.
  • fw-child/template/risks/detail.php: Change "as outlined in red on the map" to "as enclosed in the thick red outline on the map". Better wording is welcome!

Here is the proposed code change:

diff --git a/site/assets/themes/fw-child/resources/js/rp_risks.js b/site/assets/themes/fw-child/resources/js/rp_risks.js
index 166f1e4..99887c9 100644
--- a/site/assets/themes/fw-child/resources/js/rp_risks.js
+++ b/site/assets/themes/fw-child/resources/js/rp_risks.js
@@ -1855,8 +1855,8 @@ var color_ramp = [
 										plugin_settings.map.layers.fsa = new L.GeoJSON(source, {
 											style: {
 												fill: false,
-												color: '#000000',
-												weight: 2,
+												color: '#FF0000',
+												weight: 4,
 												opacity: 0.6
 											},
 											pane: 'fsa'
diff --git a/site/assets/themes/fw-child/template/risks/detail.php b/site/assets/themes/fw-child/template/risks/detail.php
index 43de8ea..753ceac 100644
--- a/site/assets/themes/fw-child/template/risks/detail.php
+++ b/site/assets/themes/fw-child/template/risks/detail.php
@@ -119,7 +119,7 @@
 					<div id="detail-exceedance-collapse" class="collapse" data-parent="#scenario-detail-indicators" aria-labelledby="detail-exceedance-head">
 						<div class="card-body">
 
-							<p>Loss exceedance curve data for postal code <strong data-indicator="fsauid"></strong>, as outlined in <span class="text-primary">red</span> on the map.</p>
+							<p>Loss exceedance curve data for postal code <strong data-indicator="fsauid"></strong>, as enclosed in the <span class="text-primary">thick red outline</span> on the map.</p>
 
 							<div id="risk-detail-chart" class="chart"></div>
 
@@ -131,4 +131,4 @@
 		</div>
 
 	</div>
-</div>
\ No newline at end of file
+</div>

I have uploaded these changes to https://www.riskprofiler.ca/risks/index.html#eDt_Collapse. Please take a look and comment! For example, if you find the red outline is now too thick, I'd be happy to reduce its weight to 3 or back to 2.

@drotheram
Copy link
Contributor

Looks good to me. Please wait for @tieganh to review before closing

@wkhchow
Copy link
Contributor

wkhchow commented Nov 23, 2023

Looks good. Thanks for fixing it!

@anthonyfok anthonyfok moved this from Backlog to In progress in RiskProfiler Dec 28, 2023
RiskProfiler automation moved this from In progress to Done Mar 12, 2024
@anthonyfok anthonyfok reopened this Mar 12, 2024
RiskProfiler automation moved this from Done to In progress Mar 12, 2024
@anthonyfok
Copy link
Member

This is how it looks after fixing this issue (#121) in OpenDRR/h7-riskprofiler@1e5e61b and Issue #125 in OpenDRR/h7-riskprofiler@6e5fdcf:
image

RiskProfiler automation moved this from In progress to Done Mar 12, 2024
@anthonyfok anthonyfok reopened this Mar 12, 2024
RiskProfiler automation moved this from Done to In progress Mar 12, 2024
@tieganh
Copy link
Contributor Author

tieganh commented May 15, 2024

The new version looks great, thanks @anthonyfok !

@anthonyfok
Copy link
Member

Thanks for your review, @tieganh!

With the fix propagated into our source code in OpenDRR/h7-riskprofiler@1e5e61b, we can close this issue now.
Cheers!

RiskProfiler automation moved this from In progress to Done May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Priority: Must Have
Projects
Development

No branches or pull requests

4 participants