Skip to content

Commit

Permalink
🚸 disable opening empty inspect boxes
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAfroOfDoom committed Nov 1, 2024
1 parent 1697ec9 commit 9939feb
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions telemetry/src/renderer/src/components/Instance.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@
.attr('r', 10)
.on('click', function (event, d) {
const eventId = d3.select(this).attr('id')
console.log({ event, d })
// No inspect if this is a root event / the data object is empty
if (!('data' in d) || Object.keys(d.data).length === 0) {
return
}
// Remove inspect if it already exists (toggle)
const inspectSelection = d3.select(`#${eventId}-inspect`)
Expand Down Expand Up @@ -104,13 +108,7 @@
.attr('x', x + 5)
.attr('y', y + 20)
.classed('event-info-text', true)
.text(() => {
// No text if this is a root event / the data object is empty
if (!('data' in d) || Object.keys(d.data).length === 0) {
return ''
}
return JSON5.stringify(d.data)
})
.text(() => JSON5.stringify(d.data))
})
eventPts.each(function (d) {
Expand Down

0 comments on commit 9939feb

Please sign in to comment.