enable camera interaction on centroids (#1160)

* pass handleCanvasEvent to graphOverlayLayer

* dont pass handlecanvasevent if not interactive
This commit is contained in:
Severiano Badajoz
2020-03-04 11:31:30 -08:00
committed by GitHub
parent 1547a864c2
commit 62e944796b
2 changed files with 9 additions and 1 deletions

View File

@@ -749,6 +749,11 @@ class Graph extends React.Component {
graphPaddingRightLeft={this.graphPaddingRightLeft}
graphPaddingTop={this.graphPaddingTop}
responsive={responsive}
handleCanvasEvent={
graphInteractionMode === "zoom"
? this.handleCanvasEvent
: undefined
}
>
<CentroidLabels />
</GraphOverlayLayer>

View File

@@ -53,7 +53,8 @@ class GraphOverlayLayer extends PureComponent {
responsive,
graphPaddingRightLeft,
graphPaddingTop,
children
children,
handleCanvasEvent
} = this.props;
if (!cameraTF) return null;
@@ -89,6 +90,8 @@ class GraphOverlayLayer extends PureComponent {
zIndex: 99,
backgroundColor: displaying ? "rgba(255, 255, 255, 0.55)" : ""
}}
onMouseMove={handleCanvasEvent}
onWheel={handleCanvasEvent}
>
<g
id="canvas-transformation-group-x"