Skip to content

Commit

Permalink
first accessibility pass
Browse files Browse the repository at this point in the history
  • Loading branch information
ndittren committed Aug 14, 2023
1 parent b91fdf0 commit 88961c6
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 35 deletions.
6 changes: 3 additions & 3 deletions src/assignments/assignment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,16 @@ export const Assignment: React.FC<AssignmentProps> = (

<>
<div className='col-md-9'>
<h2>Questions</h2>
<h3>Questions</h3>
{questions.map((question, index) => {
return (
<div key={index}>
<p>
{index + 1}. {question}
</p>
<h2>
<h3>
Answer
</h2>
</h3>
<Answer
questionId={index}
answers={answers}
Expand Down
17 changes: 11 additions & 6 deletions src/graphForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -272,12 +272,13 @@ export const GraphForm: React.FC<GraphFormProps> = (
>
{genre1Field && (
<div className='mb-3'>
<label htmlFor='genre1'
<label htmlFor='first genre'
className='form-label'>Genre 1</label>
<select name='genre1' id='genre1'
<select name='first genre' id='first genre'
className='form-select'
defaultValue={'Select one'}
defaultValue={'Select One'}
onChange={handleGenre1Select}
aria-required={'true'}
required>
<option value={''}>Select one</option>
{genresText.map((genre, index) => {
Expand All @@ -292,12 +293,13 @@ export const GraphForm: React.FC<GraphFormProps> = (
)}
{genre2Field && (
<div className='mb-3'>
<label htmlFor='genre2'
<label htmlFor='second genre'
className='form-label'>Genre 2</label>
<select name='genre2' id='genre2'
<select name='second genre' id='second genre'
className='form-select'
defaultValue={'Select one'}
defaultValue={'Select One'}
onChange={handleGenre2Select}
aria-required={'true'}
required>
<option value={''}>Select one</option>
{genresText.map((genre, index) => {
Expand All @@ -318,6 +320,7 @@ export const GraphForm: React.FC<GraphFormProps> = (
className='form-select'
defaultValue={'Select one'}
onChange={handleAudioFeatureSelect}
aria-required={'true'}
required>
<option value={''}>Select one</option>
{audioFeatures.map((
Expand All @@ -342,6 +345,7 @@ export const GraphForm: React.FC<GraphFormProps> = (
className='form-select'
defaultValue={'Select one'}
onChange={handleDataPointsSelect}
aria-required={'true'}
required>
<option value={''}>Select one</option>
{dataPointOptions.map((points, index) => {
Expand All @@ -365,6 +369,7 @@ export const GraphForm: React.FC<GraphFormProps> = (
className='form-input'
defaultValue={initialSeed}
onChange={handleSeed}
aria-required={'true'}
required>
</input>
</div>
Expand Down
8 changes: 4 additions & 4 deletions src/graphs/histogram.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export const Histogram: React.FC<HistogramProps> = (
{color, data1, data2, genre1, genre2, audioFeature='tempo', n}
) => {
const svgRef = useRef(null);
const whichHisto = n ? 'DistributionHistogram' : 'SampleDataHistogram';

const [selection, setSelection] = useState<null | Selection<
null,
Expand Down Expand Up @@ -125,14 +126,13 @@ export const Histogram: React.FC<HistogramProps> = (
selection.append('rect')
.attr('fill', GRAPH_BG)
.attr('height', height-MARGIN)
.attr('id', 'graph-background')
.attr('width', gWidth-MARGIN-Y_LABEL)
.attr('x', MARGIN + Y_LABEL)
.attr('y', MARGIN);

// Construct graph bars
selection.append('g')
.attr('id', 'genre1')
.attr('id', `genre1-${whichHisto}-${color}`)
.attr('fill', color)
.selectAll()
.data(bins1)
Expand All @@ -155,7 +155,7 @@ export const Histogram: React.FC<HistogramProps> = (
if (data2) {
const id2 = 'detail-2';
selection.append('g')
.attr('id', 'genre2')
.attr('id', `genre2-${whichHisto}`)
.attr('fill', SECONDARY)
.selectAll()
.data(bins2)
Expand Down Expand Up @@ -280,7 +280,7 @@ export const Histogram: React.FC<HistogramProps> = (
return (
<div className='col-sm-12'>
<svg
id='bins'
id={`${whichHisto}-${color}`}
ref={svgRef}
width='100%'
height='20rem'
Expand Down
22 changes: 0 additions & 22 deletions src/graphs/sampleDataHistogram.tsx

This file was deleted.

0 comments on commit 88961c6

Please sign in to comment.