Skip to content

Commit

Permalink
Bump deps
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Sep 20, 2024
1 parent c38308f commit b71c4a6
Show file tree
Hide file tree
Showing 3 changed files with 194 additions and 177 deletions.
14 changes: 8 additions & 6 deletions lib/src/components/msa/renderMSABlock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ function drawTiles({
bgColor,
colorSchemeName,
colorScheme,
colStats,
colStatsSums,
columns,
colWidth,
rowHeight,
Expand All @@ -117,16 +115,20 @@ function drawTiles({
const color =
colorSchemeName === 'clustalx_protein_dynamic'
? getClustalXColor(
colStats[xStart + i]!,
colStatsSums[xStart + i]!,
// use model.colStats dot notation here: delay use of colStats
// until absolutely needed
model.colStats[xStart + i]!,
model.colStatsSums[xStart + i]!,
model,
name,
xStart + i,
)
: colorSchemeName === 'percent_identity_dynamic'
? getPercentIdentityColor(
colStats[xStart + i]!,
colStatsSums[xStart + i]!,
// use model.colStats dot notation here: delay use of
// colStats until absolutely needed
model.colStats[xStart + i]!,
model.colStatsSums[xStart + i]!,
model,
name,
xStart + i,
Expand Down
28 changes: 19 additions & 9 deletions lib/src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ function stateModelFactory() {
/**
* #property
*/
hideGaps: true,
hideGaps: false,

/**
* #property
Expand Down Expand Up @@ -770,7 +770,10 @@ function stateModelFactory() {
* #getter
*/
get columns2d() {
return this.rows.map(r => r[1]).map(str => skipBlanks(this.blanks, str))
const { hideGaps } = self
return this.rows
.map(r => r[1])
.map(str => (hideGaps ? skipBlanks(this.blanks, str) : str))
},
/**
* #getter
Expand Down Expand Up @@ -1067,12 +1070,17 @@ function stateModelFactory() {
* #getter
*/
get adapterTrackModels(): BasicTrack[] {
const { rowHeight, MSA, hideGaps, blanks } = self
return (
self.MSA?.tracks.map(t => ({
MSA?.tracks.map(t => ({
model: {
...t,
data: t.data ? skipBlanks(self.blanks, t.data) : undefined,
height: self.rowHeight,
data: t.data
? hideGaps
? skipBlanks(blanks, t.data)
: t.data
: undefined,
height: rowHeight,
} as TextTrackModel,
ReactComponent: TextTrack,
})) || []
Expand Down Expand Up @@ -1426,10 +1434,12 @@ function stateModelFactory() {
addDisposer(
self,
autorun(() => {
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
self.colStats
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
self.colStatsSums
if (self.colorSchemeName.includes('dynamic')) {
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
self.colStats
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
self.colStatsSums
}
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
self.columns
}),
Expand Down
Loading

0 comments on commit b71c4a6

Please sign in to comment.