-
Notifications
You must be signed in to change notification settings - Fork 1
Conversation
463791f
to
022d1c9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't compile, due to apparent rebase against develop
. See note on extending interface (must now list properties of parent's params
).
src/app/charts/chart.component.ts
Outdated
const thresholdParams = $event.data as ThresholdIndicatorQueryOpts; | ||
this.extraParams = thresholdParams; | ||
this.onExtraParamsChanged.emit(this.extraParams); | ||
this.updateChart(this.extraParams); | ||
} | ||
|
||
public onPercentileSelected($event) { | ||
const percentileParams = $event.data; | ||
console.log(percentileParams); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stray console log in here
'percentile_low_temperature', | ||
'percentile_precipitation' | ||
]; | ||
|
||
// TODO: concat additional extra parameter names to this array for #203, #204, and #205 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can remove #204 from TODO comment, which this closes
<form [formGroup]="percentileForm" novalidate> | ||
<div class="chart-options-body form-group"> | ||
<span class="optional-parameters-label">Show {{indicator.label | lowercase}} at percentile | ||
<input type="number" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could validate this to be in 0 to 100 range
* Chart component | ||
* Container for each individual chart plus controls | ||
* Threshold params component | ||
* Multi-field form to allow user to specify threshold params |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
import { IndicatorQueryOpts } from './indicator-query-opts.model'; | ||
|
||
export interface PercentileIndicatorQueryOpts extends IndicatorQueryOpts { | ||
params: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will need to list all the properties of the extended params
object here after having rebased against develop, due to library updates
Still not compiling, but closer. Needs |
0e8a1b2
to
1815c8a
Compare
Technically this build succeeded, but a repeat build died due to a connection error |
You can restart the build manually in the Jenkins interface. |
1815c8a
to
c8bd5b6
Compare
Rebased against Andrew's merge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! One more thing: could use some more error handling. It's still possible to type invalid text (such as a decimal), which will result in an infinitely loading chart.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Glad the rebase wasn't too bad!
@@ -26,3 +31,12 @@ export function hasExtraParams(indicatorName: string): boolean { | |||
} | |||
return false; | |||
} | |||
|
|||
export function isPercentileIndicator(indicatorName: string): boolean { | |||
for (const percentileName of percentileIndicatorNames) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly trivial comment, but is there a reason these functions can't all be compressed down to the more commonly used:
export function isPercentileIndicator(indicatorName: string): boolean {
return percentileIndicatorNames.indexOf(indicatorName) !== -1;
}
c8bd5b6
to
5906d6d
Compare
const pctl = form.percentileCtl; | ||
if (pctl > 100 || pctl < 1) { return; } | ||
this.percentileParamSelected.emit({ | ||
'percentile': Math.round(pctl) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using ng-pattern would be better, to enforce input restrictions rather than implicitly rounding what the user enters. ng-pattern="/^-?[0-9][^\.]*$/"
should do the trick.
Although there are restrictions on the input now, there's no feedback to the user to indicate that the input is invalid; the chart simply fails to reload. It would be good to maybe highlight the field red or give some other error feedback.
1ef7c11
to
0b9192f
Compare
Peh. I managed to rebase onto the basetemp merge, but didn't succeed at better validation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 on tests passing and an issue made for form validation feedback (if it doesn't go in this PR).
Looks like there's a comma missing in the login component test. Maybe we should just remove that test, since it seems to be a hassle to maintain. It is the only component test we have, though.
If the form validation is too pesky, maybe can just make an issue for form feedback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@flibbertigibbet since we've both approved this and @fungjj92 is out, can you create the referenced issue and get this merged?
There is a small issue causing tests to fail, which could be fixed up by a subsequent rebase in #242. So yes, I'll do that. |
Created #243 |
0b9192f
to
26c02f3
Compare
Just rebased in a fixup to the test commit, will merge on test pass |
26c02f3
to
f35712f
Compare
Had to do some significant rebasing; hopefully all sorted now |
Overview
Adding the percentile params part of the extra params feature set.
Demo
Notes
I struggled with the copy.. Alternative ideas:
_ percentile of percentile low temperature
Low temperature projections at percentile: __
Eh none of them are very good. @jcahail @CloudNiner
Testing Instructions
The usual
npm run serve
Closes #204