Skip to content

Commit

Permalink
fix(heatmap): support graceful failure in braille mode (#409)
Browse files Browse the repository at this point in the history
# Pull Request

## Description
<!-- Provide a brief description of the changes made in this pull
request. -->
This PR fixes the heatmap's graceful failure bug by changing the braille
input based on the maidr data instead of the visual SVGs

## Related Issues
<!-- Specify any related issues or tickets that this pull request
addresses. -->
Closes #408 

## Changes Made
<!-- Describe the specific changes made in this pull request. -->
Modified the input to fetch values based on the consistent Maidr data
instead of the inconsistent SVG coordinates

## Screenshots (if applicable)
<!-- Include any relevant screenshots or images to help visualize the
changes. -->
<!-- You can take a gif animation screenshot very easily without any
additional installation by using this browser-based tool: -->
<!-- https://gifcap.dev -->

## Checklist
<!-- Please select all applicable options. -->
<!-- To select your options, please put an 'x' in the all boxes that
apply. -->

- [x] I have read the [Contributor Guidelines](../CONTRIBUTING.md).
- [x] I have performed a self-review of my own code and ensured it
follows the project's coding standards.
- [x] I have tested the changes locally following
`ManualTestingProcess.md`, and all tests related to this pull request
pass.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation, if applicable.
- [x] I have added appropriate unit tests, if applicable.

## Additional Notes
<!-- Add any additional notes or comments here. -->
<!-- Template credit: This pull request template is based on Embedded
Artistry
{https://github.com/embeddedartistry/templates/blob/master/.github/PULL_REQUEST_TEMPLATE.md},
Clowder
{https://github.com/clowder-framework/clowder/blob/develop/.github/PULL_REQUEST_TEMPLATE.md},
and TalAter {https://github.com/TalAter/open-source-templates}
templates. -->
  • Loading branch information
SaaiVenkat authored Feb 21, 2024
1 parent d08010b commit 93e12d2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/js/display.js
Original file line number Diff line number Diff line change
Expand Up @@ -666,13 +666,13 @@ class Display {
let low = constants.minY + range;
let medium = low + range;
let high = medium + range;
for (let i = 0; i < plot.y_coord.length; i++) {
for (let j = 0; j < plot.x_coord.length; j++) {
if (plot.values[i][j] == 0) {
for (let i = 0; i < plot.data.length; i++) {
for (let j = 0; j < plot.data[i].length; j++) {
if (plot.data[i][j] == 0) {
brailleArray.push('⠀');
} else if (plot.values[i][j] <= low) {
} else if (plot.data[i][j] <= low) {
brailleArray.push('⠤');
} else if (plot.values[i][j] <= medium) {
} else if (plot.data[i][j] <= medium) {
brailleArray.push('⠒');
} else {
brailleArray.push('⠉');
Expand Down

0 comments on commit 93e12d2

Please sign in to comment.