Skip to content

Commit

Permalink
Update to Flow 0.20
Browse files Browse the repository at this point in the history
  • Loading branch information
danvk committed Dec 18, 2015
1 parent 9a246cc commit 3344ee1
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"coveralls": "2.10.x",
"envify": "^3.4.0",
"exorcist": "^0.4.0",
"flow-bin": "^0.19.0",
"flow-bin": "^0.20.0",
"http-server": "^0.8.0",
"istanbul": "^0.3.17",
"jsxhint": "git://github.com/strml/JSXHint.git",
Expand Down
2 changes: 1 addition & 1 deletion src/main/GA4GHAlignment.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class GA4GHAlignment /* implements Alignment */ {
var start1 = this._interval.start(),
stop1 = this._interval.stop(),
start2 = m.pos,
stop2 = start2 + this.getSequence.length();
stop2 = start2 + this.getSequence().length;
return Math.max(stop1, stop2) - Math.min(start1, start2);
} else {
return 0;
Expand Down
4 changes: 2 additions & 2 deletions src/main/VisualizationWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ class VisualizationWrapper extends React.Component {
VisualizationWrapper.displayName = 'VisualizationWrapper';


class EmptyTrack extends React.Component {
props: {className: string};
type EmptyTrackProps = {className: string};
class EmptyTrack extends React.Component<void, EmptyTrackProps, void> {
render() {
var className = this.props.className + ' empty';
return <div className={className}></div>;
Expand Down
2 changes: 1 addition & 1 deletion src/main/data/formats/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import jBinary from 'jbinary';

// Read a jBinary type at an offset in the buffer specified by another field.
function typeAtOffset(baseType: any, offsetFieldName: string) {
function typeAtOffset(baseType: any, offsetFieldName: string): any {
return jBinary.Template({
baseType: baseType,
read: function(context) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/viz/CoverageCache.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class CoverageCache {
}

// Returns whichever form of the ref ("chr17", "17") has been seen.
_canonicalRef(ref: string) {
_canonicalRef(ref: string): string {
if (this.refToCounts[ref]) return ref;
var alt = utils.altContigName(ref);
if (this.refToCounts[alt]) return alt;
Expand Down
3 changes: 2 additions & 1 deletion src/main/viz/CoverageTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import type Interval from '../Interval';
import type {TwoBitSource} from '../sources/TwoBitDataSource';
import type {DataCanvasRenderingContext2D} from 'data-canvas';
import type {BinSummary} from './CoverageCache';
import type {Scale} from './d3utils';

import React from 'react';
import scale from '../scale';
Expand Down Expand Up @@ -195,7 +196,7 @@ class CoverageTrack extends React.Component {
return <canvas ref='canvas' onClick={this.handleClick.bind(this)} />;
}

getScale() {
getScale(): Scale {
return d3utils.getTrackScale(this.props.range, this.props.width);
}

Expand Down
3 changes: 2 additions & 1 deletion src/main/viz/GeneTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import type {Strand} from '../Alignment';
import type {Gene, BigBedSource} from '../sources/BigBedDataSource';
import type {VizProps} from '../VisualizationWrapper';
import type {Scale} from './d3utils';

import React from 'react';
import ReactDOM from 'react-dom';
Expand Down Expand Up @@ -95,7 +96,7 @@ class GeneTrack extends React.Component {
this.updateVisualization();
}

getScale() {
getScale(): Scale {
return d3utils.getTrackScale(this.props.range, this.props.width);
}

Expand Down
3 changes: 2 additions & 1 deletion src/main/viz/GenomeTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import type {VizProps} from '../VisualizationWrapper';
import type {TwoBitSource} from '../sources/TwoBitDataSource';
import type {DataCanvasRenderingContext2D} from 'data-canvas';
import type {Scale} from './d3utils';

import React from 'react';
import ReactDOM from 'react-dom';
Expand Down Expand Up @@ -131,7 +132,7 @@ class GenomeTrack extends React.Component {
this.updateVisualization();
}

getScale() {
getScale(): Scale {
return d3utils.getTrackScale(this.props.range, this.props.width);
}

Expand Down
3 changes: 2 additions & 1 deletion src/main/viz/LocationTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
'use strict';

import type {VizProps} from '../VisualizationWrapper';
import type {Scale} from './d3utils';

import React from 'react';
import ReactDOM from 'react-dom';
Expand All @@ -23,7 +24,7 @@ class LocationTrack extends React.Component {
super(props);
}

getScale() {
getScale(): Scale {
return d3utils.getTrackScale(this.props.range, this.props.width);
}

Expand Down
3 changes: 2 additions & 1 deletion src/main/viz/PileupTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import type {VisualAlignment, VisualGroup, InsertStats} from './PileupCache';
import type {DataCanvasRenderingContext2D} from 'data-canvas';
import type Interval from '../Interval';
import type {VizProps} from '../VisualizationWrapper';
import type {Scale} from './d3utils';

import React from 'react';
import shallowEquals from 'shallow-equals';
Expand Down Expand Up @@ -322,7 +323,7 @@ class PileupTrack extends React.Component {
this.updateVisualization();
}

getScale() {
getScale(): Scale {
return d3utils.getTrackScale(this.props.range, this.props.width);
}

Expand Down
3 changes: 2 additions & 1 deletion src/main/viz/ScaleTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
'use strict';

import type {VizProps} from '../VisualizationWrapper';
import type {Scale} from './d3utils';

import React from 'react';
import ReactDOM from 'react-dom';
Expand All @@ -29,7 +30,7 @@ class ScaleTrack extends React.Component {
super(props);
}

getScale() {
getScale(): Scale {
return d3utils.getTrackScale(this.props.range, this.props.width);
}

Expand Down
3 changes: 2 additions & 1 deletion src/main/viz/VariantTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import type {VcfDataSource} from '../sources/VcfDataSource';
import type {Variant} from '../data/vcf';
import type {DataCanvasRenderingContext2D} from 'data-canvas';
import type {VizProps} from '../VisualizationWrapper';
import type {Scale} from './d3utils';

import React from 'react';
import ReactDOM from 'react-dom';
Expand Down Expand Up @@ -40,7 +41,7 @@ class VariantTrack extends React.Component {
});
}

getScale() {
getScale(): Scale {
return d3utils.getTrackScale(this.props.range, this.props.width);
}

Expand Down
2 changes: 2 additions & 0 deletions src/main/viz/d3utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ type Range = {
stop: number;
};

export type Scale = (num: number) => number;

/**
* Shared x-axis scaling logic for tracks
*/
Expand Down

0 comments on commit 3344ee1

Please sign in to comment.