Skip to content

Commit

Permalink
27292 Add title text to images in high contrast mode [Update Force Gr…
Browse files Browse the repository at this point in the history
…aph to support high contrast mode] (#36)
  • Loading branch information
ignatvilesov authored Jul 23, 2018
1 parent a0c0fdb commit 42a6dd0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/visual.ts
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,8 @@ module powerbi.extensibility.visual {
}

return ForceGraph.DefaultImage;
}
},
title: (node: ForceGraphNode) => node.name,
});
} else {
this.nodes
Expand Down
4 changes: 4 additions & 0 deletions test/visualBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ module powerbi.extensibility.visual.test {
return this.mainElement.children("g.node");
}

public get images() {
return this.nodes.children("image");
}

public get circles() {
return this.nodes.children("circle");
}
Expand Down
17 changes: 17 additions & 0 deletions test/visualTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,23 @@ module powerbi.extensibility.visual.test {
});

describe("Accessibility", () => {
it("title should be filled for all of images", () => {
dataView.metadata.objects = {
nodes: {
displayImage: true,
},
};

visualBuilder.updateFlushAllD3Transitions(dataView);

visualBuilder.images
.toArray()
.map($)
.forEach((image: JQuery) => {
expect(image.attr("title")).toBeDefined();
});
});

describe("High contrast mode", () => {
const backgroundColor: string = "#000000";
const foregroundColor: string = "#ffff00";
Expand Down

0 comments on commit 42a6dd0

Please sign in to comment.