1- import React , { PropTypes , Component } from 'react' ;
1+ import React , { Component } from 'react' ;
2+ import PropTypes from 'prop-types' ;
23import { v4 } from 'uuid' ;
34
45import Sequence from 'sequence-viewer' ;
56
6- export default class ReactSequenceViewer extends Component {
7+ export default class ReactSequenceViewer extends Component {
78 constructor ( props ) {
89 super ( props ) ;
910 this . handleChange = this . handleChange . bind ( this ) ;
@@ -38,8 +39,8 @@ export default class ReactSequenceViewer extends Component {
3839 }
3940 }
4041
41- // When the component mounts, add a change listenver to the document
42- // and call render. We attach the change listener here becuase
42+ // When the component mounts, add a change listener to the document
43+ // and call render. We attach the change listener here because
4344 // jQuery events don't bubble up through React due to its synthetic event
4445 // handling. Thus, when a user toggles the charsPerLine drop down menu.
4546 // the event is handled by jQuery, but not seen by React when the
@@ -53,7 +54,7 @@ export default class ReactSequenceViewer extends Component {
5354 }
5455
5556 // Update the sequence-viewer object if we get a new DNA sequence.
56- componentWillReceiveProps ( nextProps ) {
57+ componentWillReceiveProps ( nextProps ) {
5758 if ( this . props . sequence !== nextProps . sequence ) {
5859 this . _seqObj = new Sequence ( nextProps . sequence ) ;
5960 }
@@ -110,20 +111,20 @@ ReactSequenceViewer.propTypes = {
110111 } ) ,
111112 coverage : PropTypes . arrayOf (
112113 PropTypes . shape ( {
113- start : PropTypes . number . isRequired ,
114- end : PropTypes . number . isRequired ,
115- color : PropTypes . string ,
116- bgcolor : PropTypes . string ,
117- underscore : PropTypes . bool ,
118- tooltip : PropTypes . string ,
119- onclick : PropTypes . func ,
120- } ) ) ,
114+ start : PropTypes . number . isRequired ,
115+ end : PropTypes . number . isRequired ,
116+ color : PropTypes . string ,
117+ bgcolor : PropTypes . string ,
118+ underscore : PropTypes . bool ,
119+ tooltip : PropTypes . string ,
120+ onclick : PropTypes . func ,
121+ } ) ) ,
121122 legend : PropTypes . arrayOf (
122123 PropTypes . shape ( {
123- name : PropTypes . string ,
124- color : PropTypes . string ,
125- underscore : PropTypes . bool ,
126- } ) ) ,
124+ name : PropTypes . string ,
125+ color : PropTypes . string ,
126+ underscore : PropTypes . bool ,
127+ } ) ) ,
127128 seqLenClass : PropTypes . string ,
128129 onMouseSelection : PropTypes . func ,
129130 onSubpartSelected : PropTypes . func ,
@@ -133,7 +134,7 @@ ReactSequenceViewer.defaultProps = {
133134 id : v4 ( ) ,
134135 coverage : [ ] ,
135136 legend : [ ] ,
136- selection : [ ] ,
137+ selection : [ ] ,
137138 seqLenClass : "CPLChoice" ,
138139 onMouseSelection : ( elem ) => { } ,
139140 onSubpartSelected : ( elem ) => { } ,
0 commit comments