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

Pak 3984 #20

Merged
merged 3 commits into from
Sep 30, 2024
Merged

Pak 3984 #20

merged 3 commits into from
Sep 30, 2024

Conversation

Jonifmi
Copy link
Contributor

@Jonifmi Jonifmi commented Sep 26, 2024

  • Refactored code for adding warning symbols to make it easier to add new symbols.
  • Added placeholder icons for newly introduced icons.
  • General refactoring for better maintainability and easier future development.

];

// Create table rows for the legend
for (let i = 0; i < levels.length; i += 2) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(With my not-so-up-to-date skills), is it this syntax for incrementing OK, and is it incremented by 2 on purpose?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad. Yes it is on purpose. After reading the code :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, in this case, however, +1 would give the same result

: symbolPath + 'surf-height.png';
} else {
// Handle events based on eventRaw or eventSelector
let eventMapping = [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe consider sorting alphabetically by match, or perhaps by icon. Or maybe if there is some more generic event type to be used here. E.g. sort wave and tsunami and high tide and other "watery evens" close to each other.

Copy link
Contributor Author

@Jonifmi Jonifmi Sep 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some sort of manual arrangement would be practical and i'll think about a good solution. Alphabetical order doesn't work because, for example, in cases of flooding, the "flash flood" warning would be before more exact warning types, and the function would pick it instead of checking for exact warning types after that.

@Jonifmi Jonifmi merged commit 806448b into master Sep 30, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants