mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-07 01:58:11 +08:00
enable camera interaction on centroids (#1160)
* pass handleCanvasEvent to graphOverlayLayer * dont pass handlecanvasevent if not interactive
This commit is contained in:
@@ -749,6 +749,11 @@ class Graph extends React.Component {
|
|||||||
graphPaddingRightLeft={this.graphPaddingRightLeft}
|
graphPaddingRightLeft={this.graphPaddingRightLeft}
|
||||||
graphPaddingTop={this.graphPaddingTop}
|
graphPaddingTop={this.graphPaddingTop}
|
||||||
responsive={responsive}
|
responsive={responsive}
|
||||||
|
handleCanvasEvent={
|
||||||
|
graphInteractionMode === "zoom"
|
||||||
|
? this.handleCanvasEvent
|
||||||
|
: undefined
|
||||||
|
}
|
||||||
>
|
>
|
||||||
<CentroidLabels />
|
<CentroidLabels />
|
||||||
</GraphOverlayLayer>
|
</GraphOverlayLayer>
|
||||||
|
|||||||
@@ -53,7 +53,8 @@ class GraphOverlayLayer extends PureComponent {
|
|||||||
responsive,
|
responsive,
|
||||||
graphPaddingRightLeft,
|
graphPaddingRightLeft,
|
||||||
graphPaddingTop,
|
graphPaddingTop,
|
||||||
children
|
children,
|
||||||
|
handleCanvasEvent
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
if (!cameraTF) return null;
|
if (!cameraTF) return null;
|
||||||
@@ -89,6 +90,8 @@ class GraphOverlayLayer extends PureComponent {
|
|||||||
zIndex: 99,
|
zIndex: 99,
|
||||||
backgroundColor: displaying ? "rgba(255, 255, 255, 0.55)" : ""
|
backgroundColor: displaying ? "rgba(255, 255, 255, 0.55)" : ""
|
||||||
}}
|
}}
|
||||||
|
onMouseMove={handleCanvasEvent}
|
||||||
|
onWheel={handleCanvasEvent}
|
||||||
>
|
>
|
||||||
<g
|
<g
|
||||||
id="canvas-transformation-group-x"
|
id="canvas-transformation-group-x"
|
||||||
|
|||||||
Reference in New Issue
Block a user