From bfee6975a6276b546d497c571781e0bc9710731f Mon Sep 17 00:00:00 2001 From: Nick Rosenau Date: Wed, 22 Nov 2023 17:16:20 -0500 Subject: [PATCH 1/6] Added shift select for amino acids, added copy feature for amino acid selection. --- src/EventHandler.tsx | 4 +++- src/SelectionHandler.tsx | 19 ++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/EventHandler.tsx b/src/EventHandler.tsx index aff47a38f..8f258f2b1 100644 --- a/src/EventHandler.tsx +++ b/src/EventHandler.tsx @@ -223,7 +223,9 @@ export class EventHandler extends React.PureComponent { */ handleMouseEvent = (e: React.MouseEvent) => { const { handleMouseEvent } = this.props; - + if(e.shiftKey){ + this.handleCopy(); + } if (e.type === "mouseup") { this.resetClicked(); if (this.clickedOnce === e.target && this.clickedTwice === e.target) { diff --git a/src/SelectionHandler.tsx b/src/SelectionHandler.tsx index 938d0210c..2621f1e50 100644 --- a/src/SelectionHandler.tsx +++ b/src/SelectionHandler.tsx @@ -39,7 +39,7 @@ export default class SelectionHandler extends React.PureComponent; /** Only state is the selection range */ - state = { ...defaultSelection }; + state = { ...defaultSelection, aminoAcidShiftStart: null }; /* previous base cursor is over, used in circular drag select */ previousBase: null | number = null; @@ -65,6 +65,7 @@ export default class SelectionHandler extends React.PureComponent(); + componentDidMount = () => { if (!document) return; document.addEventListener("mouseup", this.stopDrag); @@ -173,6 +174,20 @@ export default class SelectionHandler extends React.PureComponent Date: Wed, 22 Nov 2023 17:20:58 -0500 Subject: [PATCH 2/6] formatting. --- src/EventHandler.tsx | 2 +- src/SelectionHandler.tsx | 22 +++++++++------------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/EventHandler.tsx b/src/EventHandler.tsx index 8f258f2b1..e7afeca59 100644 --- a/src/EventHandler.tsx +++ b/src/EventHandler.tsx @@ -223,7 +223,7 @@ export class EventHandler extends React.PureComponent { */ handleMouseEvent = (e: React.MouseEvent) => { const { handleMouseEvent } = this.props; - if(e.shiftKey){ + if (e.shiftKey) { this.handleCopy(); } if (e.type === "mouseup") { diff --git a/src/SelectionHandler.tsx b/src/SelectionHandler.tsx index 2621f1e50..9e40369ea 100644 --- a/src/SelectionHandler.tsx +++ b/src/SelectionHandler.tsx @@ -65,7 +65,6 @@ export default class SelectionHandler extends React.PureComponent(); - componentDidMount = () => { if (!document) return; document.addEventListener("mouseup", this.stopDrag); @@ -174,18 +173,15 @@ export default class SelectionHandler extends React.PureComponent Date: Wed, 22 Nov 2023 17:24:39 -0500 Subject: [PATCH 3/6] remove var. --- src/SelectionHandler.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/SelectionHandler.tsx b/src/SelectionHandler.tsx index 9e40369ea..6af882233 100644 --- a/src/SelectionHandler.tsx +++ b/src/SelectionHandler.tsx @@ -176,7 +176,6 @@ export default class SelectionHandler extends React.PureComponent Date: Fri, 1 Dec 2023 18:24:48 -0500 Subject: [PATCH 4/6] click then shift to highlight aa. --- src/SelectionHandler.tsx | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/SelectionHandler.tsx b/src/SelectionHandler.tsx index 6af882233..0e49a7e48 100644 --- a/src/SelectionHandler.tsx +++ b/src/SelectionHandler.tsx @@ -39,7 +39,7 @@ export default class SelectionHandler extends React.PureComponent; /** Only state is the selection range */ - state = { ...defaultSelection, aminoAcidShiftStart: null }; + state = { ...defaultSelection, aminoAcidShiftStart: null, prevAA: null }; /* previous base cursor is over, used in circular drag select */ previousBase: null | number = null; @@ -128,7 +128,7 @@ export default class SelectionHandler extends React.PureComponent Date: Fri, 1 Dec 2023 18:33:11 -0500 Subject: [PATCH 5/6] format. --- src/SelectionHandler.tsx | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/SelectionHandler.tsx b/src/SelectionHandler.tsx index 0e49a7e48..db7a2a6e3 100644 --- a/src/SelectionHandler.tsx +++ b/src/SelectionHandler.tsx @@ -128,7 +128,7 @@ export default class SelectionHandler extends React.PureComponent Date: Fri, 1 Dec 2023 18:34:56 -0500 Subject: [PATCH 6/6] format. --- src/SelectionHandler.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/SelectionHandler.tsx b/src/SelectionHandler.tsx index db7a2a6e3..2c33269e9 100644 --- a/src/SelectionHandler.tsx +++ b/src/SelectionHandler.tsx @@ -179,7 +179,6 @@ export default class SelectionHandler extends React.PureComponent