Skip to content

Commit

Permalink
Fixed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenthoms committed Sep 11, 2023
1 parent 91b6a58 commit f5f5a3d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions frontend/src/lib/components/AdvancedPlot/advancedPlot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,11 @@ export const AdvancedPlot: React.FC<AdvancedPlotProps> = (props) => {
traces.push({
...dataObj,
marker: {
...dataObj.marker,
color: highlightedCurve.color,
},
line: {
...dataObj.line,
color: highlightedCurve.color,
},
showlegend: false,
Expand All @@ -164,6 +166,7 @@ export const AdvancedPlot: React.FC<AdvancedPlotProps> = (props) => {
React.useEffect(function handleMount() {
let interactionDisabled = false;
const graphDiv = divRef.current as unknown as PlotlyHTMLElement;
setIsUnmounting(false);

function handleHover(event: Plotly.PlotHoverEvent) {
if (!interactionDisabled) {
Expand All @@ -174,7 +177,7 @@ export const AdvancedPlot: React.FC<AdvancedPlotProps> = (props) => {
if (props.onHover && event.points[0].data.showlegend !== false) {
props.onHover(event);
}
}, 50);
}, 100);
}
}

Expand All @@ -184,7 +187,7 @@ export const AdvancedPlot: React.FC<AdvancedPlotProps> = (props) => {
clearTimeout(hoverTimeout.current);
}

hoverTimeout.current = setTimeout(() => props.onUnhover && props.onUnhover(), 50);
hoverTimeout.current = setTimeout(() => props.onUnhover && props.onUnhover(), 100);
}
}

Expand Down

0 comments on commit f5f5a3d

Please sign in to comment.