@@ -109,4 +109,8 @@ Toolbar.propTypes = {
hasSelection: React.PropTypes.bool.isRequired,
};
+Toolbar.defaultProps = {
+ ntSequence: null,
+};
+
export default Toolbar;
diff --git a/app/components/Visualizer/Help.jsx b/app/components/Visualizer/Help.jsx
index b54e252..57da0b4 100644
--- a/app/components/Visualizer/Help.jsx
+++ b/app/components/Visualizer/Help.jsx
@@ -30,7 +30,7 @@ const Help = ({ onFileSelectClick }) =>
- >gi|671162122:c7086083-7083225 Drosophila melanogaster chromosome 3R{'\n'}
+ >gi|671162122:c7086083-7083225 Drosophila melanogaster chromosome 3R{'\n'}
ATGGTCACTCTAATCGCAGTCTGCAATTTACGTGTTTCCAACTTAACGCCCCCAAGTTAATAGCCGTAAT{'\n'}
CATTTGAAAAGAAAGGCACGCACGCACAACGCCATGCGGATCGAACCTGGGGACTCCTTTTGGACGAAAA{'\n'}
AGGCGATGTTTTCCAACGCAGAAAGGCAGTACTTTGAGACGGTCCGTCCGCGGAAGACCAGTGTGAGTAA{'\n'}
diff --git a/app/components/Visualizer/index.js b/app/components/Visualizer/index.js
index 5447fae..b44ca0b 100644
--- a/app/components/Visualizer/index.js
+++ b/app/components/Visualizer/index.js
@@ -20,7 +20,7 @@ const mapStateToProps = (state) => {
};
};
-const mapDispatchToProps = (dispatch) => ({
+const mapDispatchToProps = dispatch => ({
onNucleotideClick: (newIndex) => {
dispatch(actions.clearSelectedAnnotation());
dispatch(updateSelection(newIndex));
@@ -28,10 +28,10 @@ const mapDispatchToProps = (dispatch) => ({
onAnnotationClick: (labelId, annotation, positionFrom) => {
dispatch(actions.selectAnnotation(labelId, annotation));
dispatch(updateSelectionFrom(
- annotation.positionFrom - positionFrom
+ annotation.positionFrom - positionFrom,
));
dispatch(updateSelectionTo(
- annotation.positionTo - positionFrom
+ annotation.positionTo - positionFrom,
));
},
});
diff --git a/app/components/Visualizer/presenter.jsx b/app/components/Visualizer/presenter.jsx
index 7203f95..adb33bb 100644
--- a/app/components/Visualizer/presenter.jsx
+++ b/app/components/Visualizer/presenter.jsx
@@ -9,7 +9,7 @@ import Help from './Help';
const { number, object, instanceOf, func } = PropTypes;
-export default class Visualizer extends Component {
+class Visualizer extends Component {
constructor(props, context) {
super(props, context);
@@ -40,7 +40,7 @@ export default class Visualizer extends Component {
window.addEventListener(
'resize',
this.resizeListener,
- false
+ false,
);
}
@@ -52,7 +52,7 @@ export default class Visualizer extends Component {
window.removeEventListener(
'resize',
this.resizeListener,
- false
+ false,
);
}
@@ -132,3 +132,9 @@ Visualizer.propTypes = {
onAnnotationClick: func.isRequired,
selectedAnnotation: object,
};
+
+Visualizer.defaultProps = {
+ selectedAnnotation: null,
+};
+
+export default Visualizer;
diff --git a/app/defaults.js b/app/defaults.js
index 9658ae4..ce3d7ed 100644
--- a/app/defaults.js
+++ b/app/defaults.js
@@ -9,7 +9,7 @@ export const defaultSequence = new Immutable.List(
'AAGTTGACCGTCGATGGCGATTTCACAAGTGACGTTTAAGTGGCGGGAACTTCTACTCACAAATCCCTGA',
'GCCCTGTGATATGATTTATTTTATGGAGCCGTGATCCGGACGAAAAATGCACACACATTTCTACAAAAAT',
'ATGTACATCGCGGTGCGATTGTGTCGCTTAAAGCACACGTACACCCACTGTCACACTCACACTCACATGC',
- ].join('').split('')
+ ].join('').split(''),
);
export const defaultLabels = new Immutable.List([
@@ -80,7 +80,7 @@ export const defaultLabels = new Immutable.List([
comment: 'rs115543127',
displayTick: true,
},
- ]
+ ],
),
},
]);
diff --git a/app/modules/franklin.js b/app/modules/franklin.js
index 415c29b..e9039aa 100644
--- a/app/modules/franklin.js
+++ b/app/modules/franklin.js
@@ -17,7 +17,7 @@ import { clear as clearSearch } from './search';
// Actions
export function loadDefault() {
- return (dispatch) => Promise.all([
+ return dispatch => Promise.all([
dispatch(loadDefaultSequence()),
dispatch(loadDefaultLabels()),
dispatch(loadDefaultExons()),
diff --git a/app/modules/label.js b/app/modules/label.js
index 2837c09..de45917 100644
--- a/app/modules/label.js
+++ b/app/modules/label.js
@@ -65,7 +65,7 @@ function doCreateAnnotation(state, action) {
}
return {
- labels: state.labels.update(action.labelId, (v) => (
+ labels: state.labels.update(action.labelId, v => (
{
name: v.name,
color: v.color,
@@ -91,7 +91,7 @@ function doUpdateAnnotation(state, action) {
}
return {
- labels: state.labels.update(labelId, (v) => (
+ labels: state.labels.update(labelId, v => (
{
name: v.name,
color: v.color,
@@ -116,7 +116,7 @@ function doRemoveAnnotation(state, action) {
}
return {
- labels: state.labels.update(labelId, (v) => (
+ labels: state.labels.update(labelId, v => (
{
name: v.name,
color: v.color,
@@ -136,7 +136,7 @@ function doSelectAnnotation(state, action) {
return state;
}
- const annotationId = state.labels.get(labelId).annotations.findKey((v) => (
+ const annotationId = state.labels.get(labelId).annotations.findKey(v => (
v.positionFrom === annotation.positionFrom && v.positionTo === annotation.positionTo
));
@@ -197,7 +197,7 @@ export default function reducer(state = initialState, action = {}) {
case TOGGLE_AT:
return Object.assign({}, state, {
- labels: state.labels.update(action.index, (label) => (
+ labels: state.labels.update(action.index, label => (
{
name: label.name,
color: label.color,
diff --git a/app/modules/notification.js b/app/modules/notification.js
index 28463df..a89a516 100644
--- a/app/modules/notification.js
+++ b/app/modules/notification.js
@@ -40,7 +40,7 @@ const initialState = {
function doNotify(state, action) {
const idx = state.messages.findIndex(
- m => action.message === m.content && action.level === m.level && action.category === m.category
+ m => action.message === m.content && action.level === m.level && action.category === m.category,
);
if (-1 !== idx) {
@@ -76,7 +76,7 @@ function doClose(state, action) {
function doCloseCategory(state, action) {
return {
- messages: state.messages.filter((message) => message.category !== action.category),
+ messages: state.messages.filter(message => message.category !== action.category),
};
}
diff --git a/app/modules/sequence.js b/app/modules/sequence.js
index 80468fe..2b99f2b 100644
--- a/app/modules/sequence.js
+++ b/app/modules/sequence.js
@@ -40,7 +40,7 @@ export function checkUploadedFile(dispatch, { header, sequence }) {
}
export function loadFile(file) {
- return dispatch => {
+ return (dispatch) => {
dispatch({ type: LOAD_FILE });
const reader = new FileReader();
@@ -48,7 +48,7 @@ export function loadFile(file) {
reader.onload = (event) => {
const { header, sequence } = checkUploadedFile(
dispatch,
- Fasta.parseString(event.target.result)
+ Fasta.parseString(event.target.result),
);
// Customize page title with the current sequence header
diff --git a/app/store/configureStore.js b/app/store/configureStore.js
index 4110347..cd17485 100644
--- a/app/store/configureStore.js
+++ b/app/store/configureStore.js
@@ -14,13 +14,13 @@ if ('production' !== process.env.NODE_ENV) {
stateTransformer: (state) => {
const newState = {};
- for (const i of Object.keys(state)) {
- if (Immutable.Iterable.isIterable(state[i])) {
- newState[i] = state[i].toJS();
- } else {
- newState[i] = state[i];
+ for (const i of Object.keys(state)) { // eslint-disable-line
+ if (Immutable.Iterable.isIterable(state[i])) {
+ newState[i] = state[i].toJS();
+ } else {
+ newState[i] = state[i];
+ }
}
- }
return newState;
},
@@ -34,7 +34,7 @@ export default function configureStore(initialState) {
return createStoreWithMiddleware(
rootReducer,
initialState,
- 'production' !== process.env.NODE_ENV && typeof 'undefined' !== window &&
- window.devToolsExtension ? window.devToolsExtension() : f => f
+ 'production' !== process.env.NODE_ENV && 'undefined' !== typeof window &&
+ window.devToolsExtension ? window.devToolsExtension() : f => f,
);
}
diff --git a/app/utils/positionning.js b/app/utils/positionning.js
index 2f4e6af..bf912ca 100644
--- a/app/utils/positionning.js
+++ b/app/utils/positionning.js
@@ -1,3 +1,4 @@
+/* eslint no-plusplus: 0 */
/*
* Positionning utils
*/
@@ -14,7 +15,7 @@
* @return {Object} coordinates - nucleotide coordinates {x: 0, y: 0}
*/
export const getNucleotideCoordinates = (
- index, visualizerMargin, nucleotidesPerRow, nucleotideWidth, rowHeight
+ index, visualizerMargin, nucleotidesPerRow, nucleotideWidth, rowHeight,
) => {
const x = visualizerMargin.x + (nucleotideWidth * (index % nucleotidesPerRow));
@@ -41,7 +42,7 @@ export const getNucleotideCoordinates = (
*/
export const getAnnotationSegmentCoordinates = (
indexFrom, indexTo, currentTrack, visualizerMargin, nucleotidesPerRow,
- nucleotideWidth, rowHeight, nucleotidesRowHeight, trackHeight
+ nucleotideWidth, rowHeight, nucleotidesRowHeight, trackHeight,
) => {
const { from, to } = indexFrom < indexTo ?
{ from: indexFrom, to: indexTo } : { from: indexTo, to: indexFrom };
@@ -51,14 +52,14 @@ export const getAnnotationSegmentCoordinates = (
visualizerMargin,
nucleotidesPerRow,
nucleotideWidth,
- rowHeight
+ rowHeight,
);
const nucleotideToCoordinates = getNucleotideCoordinates(
to,
visualizerMargin,
nucleotidesPerRow,
nucleotideWidth,
- rowHeight
+ rowHeight,
);
const x1 = (nucleotideWidth / 2) + nucleotideFromCoordinates.x;
@@ -73,7 +74,7 @@ export const getAnnotationSegmentCoordinates = (
*/
export const getAnnotationSegments = (
indexFrom, indexTo, currentTrack, visualizerMargin, nucleotidesPerRow,
- nucleotideWidth, rowHeight, nucleotidesRowHeight, trackHeight
+ nucleotideWidth, rowHeight, nucleotidesRowHeight, trackHeight,
) => {
const segments = [];
const { from, to } = indexFrom < indexTo ?
@@ -88,7 +89,7 @@ export const getAnnotationSegments = (
}
segments.push([start, to]);
- return segments.map((segment) =>
+ return segments.map(segment =>
getAnnotationSegmentCoordinates(
segment[0],
segment[1],
@@ -98,7 +99,7 @@ export const getAnnotationSegments = (
nucleotideWidth,
rowHeight,
nucleotidesRowHeight,
- trackHeight
- )
+ trackHeight,
+ ),
);
};
diff --git a/package.json b/package.json
index 7e4f1d0..0ef8808 100644
--- a/package.json
+++ b/package.json
@@ -27,34 +27,34 @@
"babel-preset-airbnb": "^2.0.0",
"babel-register": "^6.14.0",
"chai": "^3.5.0",
- "clean-webpack-plugin": "^0.1.9",
+ "clean-webpack-plugin": "^0.1.15",
"css-loader": "^0.23.1",
"enzyme": "^2.3.0",
- "eslint": "^3.5.0",
- "eslint-config-airbnb": "^10.0.1",
+ "eslint": "^3.13.1",
+ "eslint-config-airbnb": "^14.0.0",
"eslint-loader": "^1.6.1",
- "eslint-plugin-import": "^1.16.0",
- "eslint-plugin-jsx-a11y": "^2.2.3",
- "eslint-plugin-react": "^6.7.1",
+ "eslint-plugin-import": "^2.2.0",
+ "eslint-plugin-jsx-a11y": "^3.0.2",
+ "eslint-plugin-react": "^6.9.0",
"extract-text-webpack-plugin": "^1.0.1",
"file-loader": "^0.9.0",
"font-awesome": "^4.6.3",
"foundation-sites": "^6.2.1",
- "html-webpack-plugin": "^2.16.2",
+ "html-webpack-plugin": "^2.26.0",
"immutable": "^3.7.6",
- "jsdom": "^9.5.0",
+ "jsdom": "^9.9.0",
"lodash.debounce": "^4.0.6",
"mocha": "^3.0.0",
"mocha-circleci-reporter": "0.0.2",
- "node-sass": "^3.9.3",
+ "node-sass": "^4.3.0",
"nyc": "^9.0.1",
- "react": "^15.2.1",
- "react-addons-perf": "^15.2.1",
- "react-addons-test-utils": "^15.2.1",
+ "react": "^15.4.2",
+ "react-addons-perf": "^15.4.2",
+ "react-addons-test-utils": "^15.4.2",
"react-color": "^2.2.7",
"react-dom": "^15.2.0",
"react-dropzone": "^3.6.0",
- "react-hot-loader": "^3.0.0-beta.3",
+ "react-hot-loader": "^3.0.0-beta.6",
"react-hotkeys": "^0.9.0",
"react-modal": "^1.3.0",
"react-redux": "^4.4.5",
@@ -69,7 +69,7 @@
"url-loader": "^0.5.7",
"webpack": "^1.12.2",
"webpack-dev-server": "^1.15.1",
- "webpack-merge": "^0.17.0"
+ "webpack-merge": "^2.1.0"
},
"dependencies": {
"compression": "^1.6.1",