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

Ensure there's enough contrast on the grid axis lines #1199

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

SonicScrewdriver
Copy link
Contributor

@SonicScrewdriver SonicScrewdriver commented Apr 22, 2024

Summary:

During the playtest we discovered that the axis tick grid lines are far too light on several different devices. This PR updates the gridlines to use a close approximation to OffBlack32.

As a result of increasing the contrast of these grid lines, I felt the axis tick labels were getting a little harder to read. After checking with design, I've added a white stroke to these labels. This greatly increases readability of our graphs.

Example of old graph contrast:
Screenshot 2024-04-23 at 11 07 03 AM

Issue: LEMS-1925

Test plan:

  • manual testing

Screenshots:

Screenshot 2024-04-23 at 11 02 05 AM

Screenshot 2024-04-23 at 11 04 25 AM

Contrast Comparison:

We don't pass the WCAG rules for text, but I don't think we actually have to for the grid lines. I will confirm with design that the new contrast level is sufficient. The previous grid line color is above with a ratio of 1.12. The contrast ratio after the changes is 1.84, and appears far more legible.
Screenshot 2024-04-23 at 11 17 47 AM

@SonicScrewdriver SonicScrewdriver self-assigned this Apr 22, 2024
@khan-actions-bot khan-actions-bot requested a review from a team April 22, 2024 22:28
@khan-actions-bot
Copy link
Contributor

khan-actions-bot commented Apr 22, 2024

Gerald

Required Reviewers
  • @Khan/perseus for changes to .changeset/happy-months-agree.md, packages/perseus/src/widgets/interactive-graphs/axis-ticks.tsx, packages/perseus/src/widgets/interactive-graphs/mafs-styles.css, packages/perseus/src/widgets/__tests__/__snapshots__/interactive-graph.test.ts.snap

Don't want to be involved in this pull request? Comment #removeme and we won't notify you of further changes.

Copy link
Contributor

github-actions bot commented Apr 22, 2024

npm Snapshot: Published

Good news!! We've packaged up the latest commit from this PR (f41a938) and published it to npm. You
can install it using the tag PR1199.

Example:

yarn add @khanacademy/perseus@PR1199

If you are working in Khan Academy's webapp, you can run:

./dev/tools/bump_perseus_version.sh -t PR1199

@SonicScrewdriver SonicScrewdriver marked this pull request as draft April 22, 2024 22:30
Copy link
Contributor

github-actions bot commented Apr 22, 2024

Size Change: +6.56 kB (+1%)

Total Size: 833 kB

Filename Size Change
packages/math-input/dist/es/index.js 80.5 kB -2 B (0%)
packages/perseus-editor/dist/es/index.js 267 kB +619 B (0%)
packages/perseus/dist/es/index.js 398 kB +1 kB (0%)
packages/math-input/dist/es/strings.js 1.73 kB +1.73 kB (new file) 🆕
packages/perseus/dist/es/strings.js 3.22 kB +3.22 kB (new file) 🆕
ℹ️ View Unchanged
Filename Size
packages/kas/dist/es/index.js 38.1 kB
packages/kmath/dist/es/index.js 4.27 kB
packages/perseus-core/dist/es/index.js 908 B
packages/perseus-error/dist/es/index.js 878 B
packages/perseus-linter/dist/es/index.js 21.8 kB
packages/pure-markdown/dist/es/index.js 3.68 kB
packages/simple-markdown/dist/es/index.js 12.4 kB

compressed-size-action

@SonicScrewdriver SonicScrewdriver changed the title Testing stroke on the text Ensure there's enough contrast on the grid axis lines Apr 23, 2024
Copy link

codecov bot commented Apr 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.89%. Comparing base (75ccd46) to head (f41a938).
Report is 43 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1199      +/-   ##
==========================================
+ Coverage   68.45%   72.89%   +4.43%     
==========================================
  Files         464      476      +12     
  Lines       99389   101116    +1727     
  Branches     7047    13091    +6044     
==========================================
+ Hits        68040    73705    +5665     
+ Misses      31234    27411    -3823     
+ Partials      115        0     -115     

Impacted file tree graph

Files Coverage Δ
...seus/src/widgets/interactive-graphs/axis-ticks.tsx 100.00% <100.00%> (ø)

... and 182 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 75ccd46...f41a938. Read the comment docs.

@SonicScrewdriver SonicScrewdriver marked this pull request as ready for review May 6, 2024 23:36
Copy link
Contributor

@nishasy nishasy left a comment

Choose a reason for hiding this comment

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

Cool!

My only concern is the continuing line looking like a negative symbol if the y axis is close to the edge, like in one of the screenshots.

image

Copy link
Member

@benchristel benchristel left a comment

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants