From bb735e5d886248173c7962be2ad05f033ef8b0a5 Mon Sep 17 00:00:00 2001 From: Rodrigo Pinto Date: Tue, 22 Feb 2022 10:42:17 -0500 Subject: [PATCH] Change cursor on context clicks on XY-charts Change the cursor when dragging with the left button (crosshair cursor) and with the right button (ew-resize cursor). The behavior of the xy-charts now is the same as on time-graph charts. Fixes #636. Signed-off-by: Rodrigo Pinto --- .../src/components/xy-output-component.tsx | 30 +++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/packages/react-components/src/components/xy-output-component.tsx b/packages/react-components/src/components/xy-output-component.tsx index 4132fddc6..f11014298 100644 --- a/packages/react-components/src/components/xy-output-component.tsx +++ b/packages/react-components/src/components/xy-output-component.tsx @@ -30,6 +30,8 @@ type XYOuputState = AbstractOutputState & { columns: ColumnHeader[]; allMax: number; allMin: number; + cursor?: string; + shiftKey: boolean; }; const RIGHT_CLICK_NUMBER = 2; const ZOOM_IN = true; @@ -71,6 +73,9 @@ export class XYOutputComponent extends AbstractTreeOutputComponent this.onKeyDown(event)} + onKeyUp={event => this.onKeyUp(event)} onWheel={event => this.onWheel(event)} onMouseMove={event => this.onMouseMove(event)} onContextMenu={event => event.preventDefault()} onMouseLeave={event => this.onMouseLeave(event)} onMouseDown={event => this.onMouseDown(event)} - style={{ height: this.props.style.height, position: 'relative' }} + style={{ height: this.props.style.height, position: 'relative', cursor: this.state.cursor }} ref={this.divRef} > {this.chooseChart()} @@ -476,9 +484,11 @@ export class XYOutputComponent extends AbstractTreeOutputComponent