Black&white effect on hover node

This commit is contained in:
ziajka 2018-03-12 15:13:41 +01:00
parent fd5a5c2079
commit f5f5cd172a
3 changed files with 14 additions and 8 deletions

View File

@ -1 +1,2 @@
<svg preserveAspectRatio="none"></svg>
<svg preserveAspectRatio="none">
</svg>

Before

Width:  |  Height:  |  Size: 39 B

After

Width:  |  Height:  |  Size: 40 B

View File

@ -105,16 +105,17 @@ export class NodesWidget implements Widget {
.attr('width', (n: Node) => n.width)
.attr('height', (n: Node) => n.height)
.attr('x', (n: Node) => -n.width / 2.)
.attr('y', (n: Node) => -n.height / 2.);
.attr('y', (n: Node) => -n.height / 2.)
.on('mouseover', function (this, n: Node) {
select(this).attr("class", "over");
})
.on('mouseout', function (this, n: Node) {
select(this).attr("class", "");
});
// .attr('width', (n: Node) => n.width)
// .attr('height', (n: Node) => n.height);
// .on('mouseover', function (this, n: Node) {
// select(this).attr("class", "over");
// })
// .on('mouseout', function (this, n: Node) {
// select(this).attr("class", "");
// });
node_enter
.append<SVGTextElement>('text')

View File

@ -42,3 +42,7 @@ g.node text {
font-family: Roboto !important;
}
svg image:hover, svg image.chosen {
filter: grayscale(100%);
}