Skip to content

Tooltip changes #78

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/graphs/control-chart/ControlRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ export class ControlRenderer extends ScatterplotRenderer {
timeScale = 'linear';
connectDots = false;

constructor(data, avgMovingRangeFunc, chartName) {
constructor(data, avgMovingRangeFunc, chartName, workTicketsURL) {
super(data);
this.chartName = chartName;
this.chartType = 'CONTROL';
this.workTicketsURL = workTicketsURL;
this.avgMovingRangeFunc = avgMovingRangeFunc;
this.dotClass = 'control-dot';
this.yAxisLabel = 'Days';
Expand Down Expand Up @@ -50,12 +51,19 @@ export class ControlRenderer extends ScatterplotRenderer {
}

populateTooltip(event) {
console.log('populateTooltip', event);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Console.log?

this.tooltip
.style('pointer-events', 'auto')
.style('opacity', 0.9)
.append('p')
.append('div')
.append('a')
.style('text-decoration', 'underline')
.text(`${event.deliveredDate}`);
.attr('href', `${this.workTicketsURL}/${event.ticketId}`)
.text(event.ticketId)
.attr('target', '_blank')
.on('click', () => {
this.hideTooltip();
});
}

drawScatterplot(chartArea, data, x, y) {
Expand Down
12 changes: 9 additions & 3 deletions src/graphs/moving-range/MovingRangeRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,20 @@ export class MovingRangeRenderer extends ScatterplotRenderer {
.style('text-decoration', 'underline')
.attr('href', `${this.workTicketsURL}/${event.workItem1}`)
.text(event.workItem1)
.attr('target', '_blank');
.attr('target', '_blank')
.on('click', () => {
this.hideTooltip();
});
this.tooltip
.append('div')
.append('a')
.style('text-decoration', 'underline')
.attr('href', `${this.workTicketsURL}/${event.workItem2}`)
.text(event.workItem1)
.attr('target', '_blank');
.text(event.workItem2)
.attr('target', '_blank')
.on('click', () => {
this.hideTooltip();
});
}

drawScatterplot(chartArea, data, x, y) {
Expand Down
6 changes: 5 additions & 1 deletion src/graphs/scatterplot/ScatterplotRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,10 @@ export class ScatterplotRenderer extends UIControlsRenderer {
.style('text-decoration', 'underline')
.attr('href', `${this.workTicketsURL}/${event.ticketId}`)
.text(event.ticketId)
.attr('target', '_blank');
.attr('target', '_blank')
.on('click', () => {
this.hideTooltip();
});
event.observationBody && this.tooltip.append('p').text('Observation: ' + event.observationBody);
}

Expand Down Expand Up @@ -612,6 +615,7 @@ export class ScatterplotRenderer extends UIControlsRenderer {
}
d3.select(svgNode.parentNode).on('mouseleave', (event) => {
if (event.relatedTarget !== this.tooltip?.node()) {
console.log('setup mouse leave to hide tooltip');
this.hideTooltip();
}
});
Expand Down
6 changes: 5 additions & 1 deletion src/graphs/work-item-age/WorkItemAgeRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ export class WorkItemAgeRenderer extends Renderer {
* Hides the tooltip.
*/
hideTooltip() {
console.log('hide tooltip');
this.tooltip?.transition().duration(100).style('opacity', 0).style('pointer-events', 'none');
}

Expand All @@ -232,7 +233,10 @@ export class WorkItemAgeRenderer extends Renderer {
.style('text-decoration', 'underline')
.attr('href', `${this.workTicketsURL}/${item.ticketId}`)
.text(item.ticketId)
.attr('target', '_blank');
.attr('target', '_blank')
.on('click', () => {
this.hideTooltip();
});
});
}

Expand Down