-
Notifications
You must be signed in to change notification settings - Fork 383
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Accessibility] Data analysis scatter chart - use symbol and color to…
… differentiate data series (#1667) * error analysis screen reader Signed-off-by: Ruby Zhu <zhenzhu@microsoft.com> * fix lint Signed-off-by: Ruby Zhu <zhenzhu@microsoft.com> * scatter chart Signed-off-by: Ruby Zhu <zhenzhu@microsoft.com> * lint fix Signed-off-by: Ruby Zhu <zhenzhu@microsoft.com> * add unit test Signed-off-by: Ruby Zhu <zhenzhu@microsoft.com> * update test file name Signed-off-by: Ruby Zhu <zhenzhu@microsoft.com> * fix unit test lint and switch case Signed-off-by: Ruby Zhu <zhenzhu@microsoft.com> * update color Signed-off-by: Ruby Zhu <zhenzhu@microsoft.com> * lint Signed-off-by: Ruby Zhu <zhenzhu@microsoft.com> * fix e2e Signed-off-by: Ruby Zhu <zhenzhu@microsoft.com> * fix lint Signed-off-by: Ruby Zhu <zhenzhu@microsoft.com> Signed-off-by: Ruby Zhu <zhenzhu@microsoft.com>
- Loading branch information
Showing
14 changed files
with
260 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
libs/core-ui/src/lib/components/InteractiveLegendUtils.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
import { interactiveLegendStyles } from "./InteractiveLegend.styles"; | ||
import { getColorBoxClassName } from "./InteractiveLegendUtils"; | ||
|
||
describe("InteractiveLegend", () => { | ||
it("should get the correct colorBox className", () => { | ||
const classes = interactiveLegendStyles(); | ||
const classNames = [ | ||
classes.circleColorBox, | ||
classes.squareColorBox, | ||
classes.diamondColorBox, | ||
classes.triangleColorBox, | ||
classes.triangleDownColorBox | ||
]; | ||
classNames.forEach((className, index) => { | ||
expect(getColorBoxClassName(index)).toEqual(className); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
import { interactiveLegendStyles } from "./InteractiveLegend.styles"; | ||
|
||
export function getColorBoxClassName( | ||
index: number, | ||
color?: string, | ||
activated?: boolean | ||
): string { | ||
const classes = interactiveLegendStyles(activated, color); | ||
// this is used as data series symbol in the side panel, the sequence needs to be consist with the sequence of symbols in ScatterUtils getScatterSymbols() | ||
const modIndex = index % 5; | ||
switch (modIndex) { | ||
case 1: | ||
return classes.squareColorBox; | ||
case 2: | ||
return classes.diamondColorBox; | ||
case 3: | ||
return classes.triangleColorBox; | ||
case 4: | ||
return classes.triangleDownColorBox; | ||
default: | ||
return classes.circleColorBox; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.