Skip to content

Commit

Permalink
Remove outline on non-keyboard focus. Fix stream focus order. (#72)
Browse files Browse the repository at this point in the history
* Remove outline on non-keyboard focus. Fix focus order

* Remove tslint.json and specify Chromium path for karma tests

* Fix focus order: goes from down to up

* Fix version to use 4 digits
  • Loading branch information
adiletelf authored Dec 7, 2023
1 parent 6b8d019 commit 03ff787
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 101 deletions.
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.

0 comments on commit 03ff787

Please sign in to comment.