Skip to content

Commit

Permalink
Fix lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettjstevens committed Aug 14, 2019
1 parent 8abbd29 commit 371de40
Show file tree
Hide file tree
Showing 13 changed files with 37 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export function viewportVisibleSection(viewSides, circleCenter, circleRadius) {
vertices.push([0, viewB])
}

const verticesOriginal = vertices.map(([x, y]) => [x + cx, y + cy])
// const verticesOriginal = vertices.map(([x, y]) => [x + cx, y + cy])

// now convert them all to polar and take the max and min of rho and theta

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ describe('viewportVisibleSection', () => {
test('viewport on upper center 2', () => {
// [180.48708681644143, 359.3411680673888] [4.6042679453532855, 541.6042679453533]
// see '~/Desktop/Screen Shot 2019-06-28 at 3.01.22 PM.png'
const { theta, rho } = viewportVisibleSection(
const { theta } = viewportVisibleSection(
[0, 962, 157, 557],
[561.6042679453533, 561.6042679453533],
541.6042679453533,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
export default ({ jbrequire }) => {
const React = jbrequire('react')
const { observer } = jbrequire('mobx-react')
const { observer, PropTypes: MobxPropTypes } = jbrequire('mobx-react')
const { polarToCartesian } = jbrequire('@gmod/jbrowse-core/util')
const { readConfObject } = jbrequire('@gmod/jbrowse-core/configuration')
const { PropTypes: CommonPropTypes } = jbrequire(
'@gmod/jbrowse-core/mst-types',
)
const PropTypes = jbrequire('prop-types')

function bpToRadians(block, pos) {
const blockStart = block.region.elided ? 0 : block.region.start
Expand Down Expand Up @@ -94,5 +98,19 @@ export default ({ jbrequire }) => {
return <>{chords}</>
}

StructuralVariantChords.propTypes = {
features: PropTypes.instanceOf(Map).isRequired,
config: CommonPropTypes.ConfigSchema.isRequired,
trackModel: MobxPropTypes.objectOrObservableObject,
blockDefinitions: PropTypes.arrayOf(MobxPropTypes.objectOrObservableObject)
.isRequired,
radius: PropTypes.number.isRequired,
bezierRadius: PropTypes.number.isRequired,
}

StructuralVariantChords.defaultProps = {
trackModel: undefined,
}

return observer(StructuralVariantChords)
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ export default ({ jbrequire }) => {
const { isAlive } = jbrequire('mobx-state-tree')
const { useEffect, useRef } = React
const { observer } = jbrequire('mobx-react-lite')
const { PropTypes: MobxPropTypes } = jbrequire('mobx-react')
const { unmountComponentAtNode, hydrate } = jbrequire('react-dom')

function RpcRenderedSvgGroup({ model }) {
const { id, data, html, filled, renderProps, renderingComponent } = model
const { data, html, filled, renderProps, renderingComponent } = model

const ssrContainerNode = useRef(null)

Expand Down Expand Up @@ -46,5 +47,9 @@ export default ({ jbrequire }) => {
return <g ref={ssrContainerNode} />
}

RpcRenderedSvgGroup.propTypes = {
model: MobxPropTypes.observableObject.isRequired,
}

return observer(RpcRenderedSvgGroup)
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
export default ({ jbrequire }) => {
const React = jbrequire('react')
const { observer } = jbrequire('mobx-react')
const { observer, PropTypes: MobxPropTypes } = jbrequire('mobx-react')

const Loading = jbrequire(require('../../ChordTrack/components/Loading'))
const TrackError = jbrequire(
require('../../ChordTrack/components/TrackError'),
)
const RpcRenderedSvgGroup = jbrequire(require('./RpcRenderedSvgGroup'))

function StructuralVariantChordTrack({ track, view }) {
function StructuralVariantChordTrack({ track }) {
if (track.error) return <TrackError model={track} />
if (!track.filled) return <Loading model={track} />
return <RpcRenderedSvgGroup model={track} />
}
StructuralVariantChordTrack.propTypes = {
track: MobxPropTypes.observableObject.isRequired,
}
return observer(StructuralVariantChordTrack)
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
export default pluginManager => {
const { jbrequire } = pluginManager
const { reaction } = jbrequire('mobx')

const { types, addDisposer } = jbrequire('mobx-state-tree')
const { types } = jbrequire('mobx-state-tree')
const { ConfigurationSchema, ConfigurationReference } = jbrequire(
'@gmod/jbrowse-core/configuration',
)
Expand Down
2 changes: 1 addition & 1 deletion packages/core/BaseAdapter.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Observer, Observable, merge } from 'rxjs'
import { tap, takeUntil } from 'rxjs/operators'
import { takeUntil } from 'rxjs/operators'
import { IRegion as Region } from './mst-types'
import { ObservableCreate } from './util/rxjs'
import { checkAbortSignal, observeAbortSignal } from './util'
Expand Down
1 change: 1 addition & 0 deletions packages/core/components/ResizeHandleHorizontal.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const styles = {
class ResizeHandleHorizontal extends Component {
static propTypes = {
classes: ReactPropTypes.objectOf(ReactPropTypes.string).isRequired,
style: ReactPropTypes.shape().isRequired,
objectId: ReactPropTypes.string.isRequired,
onVerticalDrag: ReactPropTypes.func.isRequired,
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { renderToString } from 'react-dom/server'
import { filter, ignoreElements, tap } from 'rxjs/operators'
import { getSnapshot } from 'mobx-state-tree'
import { readConfObject } from '../../configuration'
import { checkAbortSignal, iterMap } from '../../util'
import SimpleFeature from '../../util/simpleFeature'
Expand Down
1 change: 0 additions & 1 deletion packages/core/rpc/RpcManager.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { decorate, observable } from 'mobx'
import { getSnapshot, isStateTreeNode, isAlive } from 'mobx-state-tree'
import { readConfObject } from '../configuration'

Expand Down
1 change: 0 additions & 1 deletion packages/core/util/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import fromEntries from 'object.fromentries'
import { useEffect, useState } from 'react'
import { Feature } from './simpleFeature'
import { IRegion, INoAssemblyRegion } from '../mst-types'
import { ObservableCreate } from './rxjs'

// @ts-ignore
if (!Object.fromEntries) {
Expand Down
2 changes: 1 addition & 1 deletion packages/jbrowse-web/src/rpc.worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ const logBuffer = []
function flushLog() {
if (logBuffer.length) {
for (const l of logBuffer) {
// eslint-disable-next-line no-console
const [head, ...rest] = l
if (head === 'rpc-error') {
console.error(head, ...rest)
} else {
// eslint-disable-next-line no-console
console.log(head, ...rest)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { types, getParent, isAlive, addDisposer } from 'mobx-state-tree'

import { reaction } from 'mobx'
import { getConf, readConfObject } from '@gmod/jbrowse-core/configuration'
import { getConf } from '@gmod/jbrowse-core/configuration'

import { Region } from '@gmod/jbrowse-core/mst-types'

Expand Down

0 comments on commit 371de40

Please sign in to comment.