Skip to content

Commit

Permalink
Fix up some lint and tsc
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Jul 1, 2021
1 parent e24c2af commit 7a4a8e9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
1 change: 1 addition & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"load-script2": "^2.0.5",
"object.fromentries": "^2.0.0",
"pako": "^1.0.10",
"rbush": "^3.0.1",
"react-error-boundary": "^3.0.0",
"react-intersection-observer": "^8.31.0",
"react-measure": "^2.3.0",
Expand Down
18 changes: 9 additions & 9 deletions packages/core/util/layouts/GranularRectLayout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ interface RowState<T> {
min: number
max: number
offset: number
bits: (Record<string, T> | boolean | undefined)[]
bits: (Record<string, T> | string | undefined)[]
}
// a single row in the layout
class LayoutRow<T> {
private padding: number

private allFilled?: Record<string, T> | boolean
private allFilled?: Record<string, T> | string

private widthLimit: number

Expand All @@ -60,11 +60,11 @@ class LayoutRow<T> {
// console.log(`r${this.rowNumber}: ${msg}`)
// }

setAllFilled(data: Record<string, T> | boolean): void {
setAllFilled(data: Record<string, T> | string): void {
this.allFilled = data
}

getItemAt(x: number): Record<string, T> | boolean | undefined {
getItemAt(x: number): Record<string, T> | string | undefined {
if (this.allFilled) {
return this.allFilled
}
Expand Down Expand Up @@ -128,7 +128,7 @@ class LayoutRow<T> {
// this.log(`initialize ${this.rowState.min} - ${this.rowState.max} (${this.rowState.bits.length})`)
}

addRect(rect: Rectangle<T>, data: Record<string, T> | boolean): void {
addRect(rect: Rectangle<T>, data: Record<string, T> | string): void {
const left = rect.l
const right = rect.r + this.padding // only padding on the right
if (!this.rowState) {
Expand Down Expand Up @@ -466,7 +466,7 @@ export default class GranularRectLayout<T> implements BaseLayout<T> {
return
}

const data = rect.data || rect.id || true
const data = rect.data || rect.id
const { bitmap } = this
const yEnd = rect.top + rect.h
if (rect.r - rect.l > maxFeaturePitchWidth) {
Expand Down Expand Up @@ -507,7 +507,7 @@ export default class GranularRectLayout<T> implements BaseLayout<T> {
return this.rectangles.has(id)
}

getByCoord(x: number, y: number): Record<string, T> | boolean | undefined {
getByCoord(x: number, y: number): Record<string, T> | string | undefined {
const pY = Math.floor(y / this.pitchY)
const row = this.bitmap[pY]
if (!row) {
Expand All @@ -517,10 +517,10 @@ export default class GranularRectLayout<T> implements BaseLayout<T> {
return row.getItemAt(pX)
}

getByID(id: string): (Record<string, T> | boolean) | undefined {
getByID(id: string): (Record<string, T> | string) | undefined {
const r = this.rectangles.get(id)
if (r) {
return r.data || true
return r.data || r.id
}
return undefined
}
Expand Down
1 change: 0 additions & 1 deletion plugins/linear-genome-view/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"is-object": "^1.0.1",
"json-stable-stringify": "^1.0.1",
"normalize-wheel": "^1.0.1",
"rbush": "^3.0.1",
"react-sizeme": "^2.6.7"
},
"peerDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import Typography from '@material-ui/core/Typography'
import MenuOpenIcon from '@material-ui/icons/MenuOpen'
import { autorun } from 'mobx'
import { addDisposer, Instance, isAlive, types, getEnv } from 'mobx-state-tree'
import RBush from 'rbush'
import React from 'react'
import { Tooltip } from '../components/BaseLinearDisplay'
import BlockState, { renderBlockData } from './serverSideRenderedBlock'
Expand Down

0 comments on commit 7a4a8e9

Please sign in to comment.