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

Remove outline on non-keyboard focus. Fix stream focus order. #72

Merged
merged 4 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ typings
/coverage
webpack.statistics.html
webpack.statistics.dev.html
webpack.statistics.prod.html
webpack.statistics.prod.html

# JetBrains
.idea
2 changes: 1 addition & 1 deletion karma.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const testRecursivePath = "test/visualTest.ts";
const srcOriginalRecursivePath = "src/**/*.ts";
const coverageFolder = "coverage";

require("playwright").chromium.executablePath();
process.env.CHROME_BIN = require("playwright").chromium.executablePath();

module.exports = (config) => {
config.set({
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "powerbi-visuals-streamgraph",
"version": "3.0.4",
"version": "3.0.4.0",
"description": "A stacked area chart with smooth interpolation. Often used to display values over time.",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion pbiviz.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"visual": {
"name": "StreamGraph",
"displayName": "Stream Graph 3.0.4",
"displayName": "Stream Graph 3.0.4.0",
"guid": "StreamGraph1446659696222",
"visualClassName": "StreamGraph",
"version": "3.0.4.0",
Expand Down
16 changes: 3 additions & 13 deletions src/visual.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1140,8 +1140,6 @@ export class StreamGraph implements IVisual {

const isHighContrast: boolean = this.colorPalette.isHighContrast;

// Reverse the order of the series so that the last series is on top.
// stackedSeries = stackedSeries.reverse();

const selection: Selection<BaseType, any, any, any> = this.dataPointsContainer
.selectAll(StreamGraph.LayerSelector.selectorName)
Expand All @@ -1158,7 +1156,9 @@ export class StreamGraph implements IVisual {
.style("fill", (d, index) => isHighContrast ? null : series[index].color)
.style("stroke", (d, index) => isHighContrast ? series[index].color : null);

this.reverseOrderOfSeries(selectionMerged);
selectionMerged
.attr("tabindex", 0)
.attr("focusable", true);

selectionMerged
.transition()
Expand Down Expand Up @@ -1262,16 +1262,6 @@ export class StreamGraph implements IVisual {
return selectionMerged .attr("focusable", true);
}

/**
* Reverse the order of the series so that the focus goes from up to down.
*/
private reverseOrderOfSeries(selectionMerged: Selection<BaseType, any, any, any>) {
const selectionMergedSize = selectionMerged.size();
selectionMerged
.attr("tabindex", (d, index) => selectionMergedSize > 1 ? selectionMergedSize - index : 0)
.attr("focusable", true);
}

private localizeLegendOrientationDropdown(enableLegendCardSettings : EnableLegendCardSettings)
{
const strToBeLocalized : string = "Visual_LegendPosition_";
Expand Down
6 changes: 5 additions & 1 deletion style/visual.less
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,13 @@
text-anchor: middle;
}

path {
path.layer {
&:focus {
outline: none;
}

&:focus-visible {
outline: none;
stroke: black;
stroke-width: 3px;
}
Expand Down
81 changes: 0 additions & 81 deletions tslint.json

This file was deleted.

Loading