add data-cy attr

This commit is contained in:
Tiago 2022-01-24 18:17:04 -03:00 committed by Kia Lam
parent b8674a3f8c
commit 9fc92ccc52

View File

@ -161,11 +161,13 @@ function MeshGraph({ data }) {
const link = svg
.append('g')
.attr('class', `links`)
.attr('data-cy', 'links')
.selectAll('path')
.data(graph.links)
.enter()
.append('path')
.attr('class', (d, i) => `link-${i}`)
.attr('data-cy', (d) => `${d.source}-${d.target}`)
.style('fill', 'none')
.style('stroke', '#ccc')
.style('stroke-width', '2px')
@ -177,6 +179,7 @@ function MeshGraph({ data }) {
const node = svg
.append('g')
.attr('class', 'nodes')
.attr('data-cy', 'nodes')
.selectAll('g')
.data(graph.nodes)
.enter()
@ -225,6 +228,7 @@ function MeshGraph({ data }) {
.append('g')
.selectAll('g')
.attr('class', 'chart-legend')
.attr('data-cy', 'chart-legend')
.data(graph.nodes)
.enter()
.append('circle')
@ -238,6 +242,7 @@ function MeshGraph({ data }) {
svg
.append('g')
.attr('class', 'chart-text')
.attr('data-cy', 'chart-text')
.selectAll('g')
.data(graph.nodes)
.enter()
@ -252,6 +257,7 @@ function MeshGraph({ data }) {
.select('#chart')
.append('div')
.attr('class', 'd3-tooltip')
.attr('data-cy', 'd3-tooltip')
.style('position', 'absolute')
.style('top', '200px')
.style('right', '40px')