From 29bb8407c7d6fbbe8db60f09f8d37d610d2f0e89 Mon Sep 17 00:00:00 2001 From: Sehi L'Yi Date: Mon, 18 Jul 2022 16:12:43 -0400 Subject: [PATCH] fix(editor): use correct field names in circos example (#772) --- editor/example/json-spec/circos.ts | 4 ++-- src/data-fetchers/utils.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/editor/example/json-spec/circos.ts b/editor/example/json-spec/circos.ts index 5bafed6fb..8bc270b0b 100644 --- a/editor/example/json-spec/circos.ts +++ b/editor/example/json-spec/circos.ts @@ -127,7 +127,7 @@ export const EX_SPEC_CIRCOS: GoslingSpec = { x: { field: 'p1', type: 'genomic' }, xe: { field: 'p1_2', type: 'genomic' }, x1: { field: 'p2', type: 'genomic' }, - x1e: { field: 'P2_2', type: 'genomic' }, + x1e: { field: 'p2_2', type: 'genomic' }, stroke: { value: 'lightgray' }, strokeWidth: { value: 1 } }, @@ -137,7 +137,7 @@ export const EX_SPEC_CIRCOS: GoslingSpec = { x: { field: 'p1', type: 'genomic' }, xe: { field: 'p1_2', type: 'genomic' }, x1: { field: 'p2', type: 'genomic' }, - x1e: { field: 'P2_2', type: 'genomic' }, + x1e: { field: 'p2_2', type: 'genomic' }, stroke: { field: 'chr_2', type: 'nominal', diff --git a/src/data-fetchers/utils.ts b/src/data-fetchers/utils.ts index 407648d78..5023a66be 100644 --- a/src/data-fetchers/utils.ts +++ b/src/data-fetchers/utils.ts @@ -34,9 +34,9 @@ export function filterUsingGenoPos( return minX < value && value <= maxX; } else { // filter based on two genomic positions, i.e., check overlaps - const values = definedXFields.map(f => +d[f]); - const maxValue = Math.max(...values); + const values = definedXFields.map(f => +d[f]).filter(v => +v); const minValue = Math.min(...values); + const maxValue = Math.max(...values); return minX <= maxValue && minValue <= maxX; } });