react-msaview 3.1.9 → 3.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,6 +9,7 @@ import Checkbox2 from './Checkbox2'
9
9
  const useStyles = makeStyles()({
10
10
  textAreaFont: {
11
11
  fontFamily: 'Courier New',
12
+ wordWrap: 'break-word',
12
13
  },
13
14
  dialogContent: {
14
15
  background: 'lightgrey',
@@ -82,7 +82,7 @@ const TreeSettings = observer(function TreeSettings({
82
82
  onChange={() => model.setDrawLabels(!drawLabels)}
83
83
  label="Draw labels"
84
84
  />
85
- {!noTree ? (
85
+ {noTree ? null : (
86
86
  <div>
87
87
  <Checkbox2
88
88
  checked={treeWidthMatchesArea}
@@ -91,7 +91,7 @@ const TreeSettings = observer(function TreeSettings({
91
91
  }
92
92
  label="Make tree width fit to tree area?"
93
93
  />
94
- {!treeWidthMatchesArea ? (
94
+ {treeWidthMatchesArea ? null : (
95
95
  <div className={classes.flex}>
96
96
  <Typography>Tree width ({treeWidth}px)</Typography>
97
97
  <Slider
@@ -102,9 +102,9 @@ const TreeSettings = observer(function TreeSettings({
102
102
  onChange={(_, val) => model.setTreeWidth(val as number)}
103
103
  />
104
104
  </div>
105
- ) : null}
105
+ )}
106
106
  </div>
107
- ) : null}
107
+ )}
108
108
  </div>
109
109
  )
110
110
  })
@@ -1,6 +1,5 @@
1
1
  import React, { useEffect, useState, useRef } from 'react'
2
2
  import { observer } from 'mobx-react'
3
- import normalizeWheel from 'normalize-wheel'
4
3
 
5
4
  // locals
6
5
  import { MsaViewModel } from '../../model'
@@ -23,10 +22,9 @@ const MSACanvas = observer(function ({ model }: { model: MsaViewModel }) {
23
22
  if (!curr) {
24
23
  return
25
24
  }
26
- function onWheel(origEvent: WheelEvent) {
27
- const event = normalizeWheel(origEvent)
28
- deltaX.current += event.pixelX
29
- deltaY.current += event.pixelY
25
+ function onWheel(event: WheelEvent) {
26
+ deltaX.current += event.deltaX
27
+ deltaY.current += event.deltaY
30
28
 
31
29
  if (!scheduled.current) {
32
30
  scheduled.current = true
@@ -38,8 +36,8 @@ const MSACanvas = observer(function ({ model }: { model: MsaViewModel }) {
38
36
  scheduled.current = false
39
37
  })
40
38
  }
41
- origEvent.preventDefault()
42
- origEvent.stopPropagation()
39
+ event.preventDefault()
40
+ event.stopPropagation()
43
41
  }
44
42
  curr.addEventListener('wheel', onWheel)
45
43
  return () => {
@@ -121,9 +119,7 @@ const MSACanvas = observer(function ({ model }: { model: MsaViewModel }) {
121
119
  overflow: 'hidden',
122
120
  }}
123
121
  >
124
- {!MSA && !msaFilehandle ? null : !MSA ? (
125
- <Loading />
126
- ) : (
122
+ {!MSA && !msaFilehandle ? null : MSA ? (
127
123
  blocks2d.map(([bx, by]) => (
128
124
  <MSACanvasBlock
129
125
  key={`${bx}_${by}`}
@@ -132,6 +128,8 @@ const MSACanvas = observer(function ({ model }: { model: MsaViewModel }) {
132
128
  offsetY={by}
133
129
  />
134
130
  ))
131
+ ) : (
132
+ <Loading />
135
133
  )}
136
134
  </div>
137
135
  )
@@ -1,5 +1,4 @@
1
1
  import React, { useEffect, useRef, useState } from 'react'
2
- import normalizeWheel from 'normalize-wheel'
3
2
  import { observer } from 'mobx-react'
4
3
 
5
4
  // locals
@@ -20,9 +19,8 @@ const TreeCanvas = observer(function ({ model }: { model: MsaViewModel }) {
20
19
  if (!curr) {
21
20
  return
22
21
  }
23
- function onWheel(origEvent: WheelEvent) {
24
- const event = normalizeWheel(origEvent)
25
- deltaY.current += event.pixelY
22
+ function onWheel(event: WheelEvent) {
23
+ deltaY.current += event.deltaY
26
24
 
27
25
  if (!scheduled.current) {
28
26
  scheduled.current = true
@@ -32,8 +30,8 @@ const TreeCanvas = observer(function ({ model }: { model: MsaViewModel }) {
32
30
  scheduled.current = false
33
31
  })
34
32
  }
35
- origEvent.preventDefault()
36
- origEvent.stopPropagation()
33
+ event.preventDefault()
34
+ event.stopPropagation()
37
35
  }
38
36
  curr.addEventListener('wheel', onWheel)
39
37
  return () => {
package/src/model.ts CHANGED
@@ -58,7 +58,7 @@ import {
58
58
  loadInterProScanResults,
59
59
  } from './launchInterProScan'
60
60
 
61
- interface Accession {
61
+ export interface Accession {
62
62
  accession: string
63
63
  name: string
64
64
  description: string
@@ -580,7 +580,7 @@ function stateModelFactory() {
580
580
  */
581
581
  get mouseOverRowName() {
582
582
  const { mouseRow } = self
583
- return mouseRow !== undefined ? this.rowNames[mouseRow] : undefined
583
+ return mouseRow === undefined ? undefined : this.rowNames[mouseRow]
584
584
  },
585
585
 
586
586
  /**
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '3.1.9'
1
+ export const version = '3.1.11'