Skip to content

Commit

Permalink
Add outline variable
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Mar 1, 2022
1 parent 41440d3 commit 5c746b2
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 8 deletions.
14 changes: 6 additions & 8 deletions plugins/svg/src/SvgFeatureRenderer/components/Box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ function Box(props: {
const { feature, region, config, featureLayout, bpPerPx, topLevel } = props
const { start, end } = region
const screenWidth = (end - start) / bpPerPx
const color2 = readConfObject(config, 'color2', { feature }) as string

const color = isUTR(feature)
? readConfObject(config, 'color3', { feature })
: readConfObject(config, 'color1', { feature })

const { left = 0, width = 0 } = featureLayout.absolute
let { top = 0, height = 0 } = featureLayout.absolute

Expand All @@ -54,8 +48,12 @@ function Box(props: {
y={top}
width={widthWithinBlock}
height={height}
fill={color}
stroke={color2}
fill={
isUTR(feature)
? readConfObject(config, 'color3', { feature })
: readConfObject(config, 'color1', { feature })
}
stroke={readConfObject(config, 'outline', { feature }) as string}
/>
{topLevel ? <Arrow {...props} /> : null}
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ exports[`one feature (compact mode) 1`] = `
data-testid="box-one-0"
fill="#357089"
height="3.25"
stroke=""
width="44.666666666666664"
x="1991.7"
y="0.875"
Expand All @@ -37,6 +38,7 @@ exports[`one feature (compact mode) 1`] = `
data-testid="box-one-2"
fill="goldenrod"
height="5"
stroke=""
width="12.666666666666666"
x="2036.7"
y="0"
Expand All @@ -45,6 +47,7 @@ exports[`one feature (compact mode) 1`] = `
data-testid="box-one-3"
fill="goldenrod"
height="5"
stroke=""
width="22.666666666666668"
x="2205.0333333333333"
y="0"
Expand All @@ -53,6 +56,7 @@ exports[`one feature (compact mode) 1`] = `
data-testid="box-one-4"
fill="goldenrod"
height="5"
stroke=""
width="94"
x="2252.7"
y="0"
Expand All @@ -61,6 +65,7 @@ exports[`one feature (compact mode) 1`] = `
data-testid="box-one-5"
fill="goldenrod"
height="5"
stroke=""
width="59"
x="2380.7"
y="0"
Expand All @@ -69,6 +74,7 @@ exports[`one feature (compact mode) 1`] = `
data-testid="box-one-6"
fill="goldenrod"
height="5"
stroke=""
width="92"
x="2470.366666666667"
y="0"
Expand All @@ -77,6 +83,7 @@ exports[`one feature (compact mode) 1`] = `
data-testid="box-one-7"
fill="goldenrod"
height="5"
stroke=""
width="34"
x="2582.7"
y="0"
Expand All @@ -85,6 +92,7 @@ exports[`one feature (compact mode) 1`] = `
data-testid="box-one-8"
fill="goldenrod"
height="5"
stroke=""
width="48.333333333333336"
x="2651.0333333333333"
y="0"
Expand All @@ -93,6 +101,7 @@ exports[`one feature (compact mode) 1`] = `
data-testid="box-one-9"
fill="goldenrod"
height="5"
stroke=""
width="51.333333333333336"
x="2722.0333333333333"
y="0"
Expand All @@ -101,6 +110,7 @@ exports[`one feature (compact mode) 1`] = `
data-testid="box-one-10"
fill="goldenrod"
height="5"
stroke=""
width="65"
x="2806.366666666667"
y="0"
Expand All @@ -109,6 +119,7 @@ exports[`one feature (compact mode) 1`] = `
data-testid="box-one-11"
fill="goldenrod"
height="5"
stroke=""
width="34.333333333333336"
x="2902.7"
y="0"
Expand All @@ -117,6 +128,7 @@ exports[`one feature (compact mode) 1`] = `
data-testid="box-one-12"
fill="goldenrod"
height="5"
stroke=""
width="104"
x="2975.7"
y="0"
Expand All @@ -125,6 +137,7 @@ exports[`one feature (compact mode) 1`] = `
data-testid="box-one-13"
fill="goldenrod"
height="5"
stroke=""
width="26.666666666666668"
x="3138.0333333333333"
y="0"
Expand All @@ -133,6 +146,7 @@ exports[`one feature (compact mode) 1`] = `
data-testid="box-one-15"
fill="#357089"
height="3.25"
stroke=""
width="83"
x="3165.0333333333333"
y="0.875"
Expand Down Expand Up @@ -164,6 +178,7 @@ exports[`one feature 1`] = `
data-testid="box-one"
fill="goldenrod"
height="10"
stroke=""
width="1"
x="0.3"
y="0"
Expand Down Expand Up @@ -192,6 +207,7 @@ exports[`processed transcript (exons + impliedUTR) 1`] = `
data-testid="box-type-Gff3TabixAdapter;type-Gff3TabixAdapter;uri-https://s3.amazonaws.com/jbrowse.org/genomes/hg19/nc-offset-107608116-0-1"
fill="goldenrod"
height="10"
stroke=""
width="327.3333333333333"
x="7759845"
y="0"
Expand All @@ -200,6 +216,7 @@ exports[`processed transcript (exons + impliedUTR) 1`] = `
data-testid="box-type-Gff3TabixAdapter;type-Gff3TabixAdapter;uri-https://s3.amazonaws.com/jbrowse.org/genomes/hg19/nc-offset-107608116-0-2"
fill="goldenrod"
height="10"
stroke=""
width="35.333333333333336"
x="7760604.333333333"
y="0"
Expand All @@ -208,6 +225,7 @@ exports[`processed transcript (exons + impliedUTR) 1`] = `
data-testid="box-type-Gff3TabixAdapter;type-Gff3TabixAdapter;uri-https://s3.amazonaws.com/jbrowse.org/genomes/hg19/nc-offset-107608116-0-3"
fill="goldenrod"
height="10"
stroke=""
width="78.66666666666667"
x="7761725.666666667"
y="0"
Expand All @@ -216,6 +234,7 @@ exports[`processed transcript (exons + impliedUTR) 1`] = `
data-testid="box-type-Gff3TabixAdapter;type-Gff3TabixAdapter;uri-https://s3.amazonaws.com/jbrowse.org/genomes/hg19/nc-offset-107608116-0-4"
fill="goldenrod"
height="10"
stroke=""
width="52.666666666666664"
x="7762144.666666667"
y="0"
Expand All @@ -224,6 +243,7 @@ exports[`processed transcript (exons + impliedUTR) 1`] = `
data-testid="box-type-Gff3TabixAdapter;type-Gff3TabixAdapter;uri-https://s3.amazonaws.com/jbrowse.org/genomes/hg19/nc-offset-107608116-0-5"
fill="goldenrod"
height="10"
stroke=""
width="36.666666666666664"
x="7763199.666666667"
y="0"
Expand All @@ -232,6 +252,7 @@ exports[`processed transcript (exons + impliedUTR) 1`] = `
data-testid="box-type-Gff3TabixAdapter;type-Gff3TabixAdapter;uri-https://s3.amazonaws.com/jbrowse.org/genomes/hg19/nc-offset-107608116-0-6"
fill="goldenrod"
height="10"
stroke=""
width="45.333333333333336"
x="7763927.333333333"
y="0"
Expand All @@ -240,6 +261,7 @@ exports[`processed transcript (exons + impliedUTR) 1`] = `
data-testid="box-type-Gff3TabixAdapter;type-Gff3TabixAdapter;uri-https://s3.amazonaws.com/jbrowse.org/genomes/hg19/nc-offset-107608116-0-7"
fill="goldenrod"
height="10"
stroke=""
width="4"
x="7766265.666666667"
y="0"
Expand All @@ -248,6 +270,7 @@ exports[`processed transcript (exons + impliedUTR) 1`] = `
data-testid="box-type-Gff3TabixAdapter;type-Gff3TabixAdapter;uri-https://s3.amazonaws.com/jbrowse.org/genomes/hg19/nc-offset-107608116-0-8"
fill="goldenrod"
height="10"
stroke=""
width="327.3333333333333"
x="7759845"
y="0"
Expand All @@ -256,6 +279,7 @@ exports[`processed transcript (exons + impliedUTR) 1`] = `
data-testid="box-type-Gff3TabixAdapter;type-Gff3TabixAdapter;uri-https://s3.amazonaws.com/jbrowse.org/genomes/hg19/nc-offset-107608116-0-9"
fill="goldenrod"
height="10"
stroke=""
width="35.333333333333336"
x="7760604.333333333"
y="0"
Expand All @@ -264,6 +288,7 @@ exports[`processed transcript (exons + impliedUTR) 1`] = `
data-testid="box-type-Gff3TabixAdapter;type-Gff3TabixAdapter;uri-https://s3.amazonaws.com/jbrowse.org/genomes/hg19/nc-offset-107608116-0-10"
fill="goldenrod"
height="10"
stroke=""
width="78.66666666666667"
x="7761725.666666667"
y="0"
Expand All @@ -272,6 +297,7 @@ exports[`processed transcript (exons + impliedUTR) 1`] = `
data-testid="box-type-Gff3TabixAdapter;type-Gff3TabixAdapter;uri-https://s3.amazonaws.com/jbrowse.org/genomes/hg19/nc-offset-107608116-0-11"
fill="goldenrod"
height="10"
stroke=""
width="52.666666666666664"
x="7762144.666666667"
y="0"
Expand All @@ -280,6 +306,7 @@ exports[`processed transcript (exons + impliedUTR) 1`] = `
data-testid="box-type-Gff3TabixAdapter;type-Gff3TabixAdapter;uri-https://s3.amazonaws.com/jbrowse.org/genomes/hg19/nc-offset-107608116-0-12"
fill="goldenrod"
height="10"
stroke=""
width="36.666666666666664"
x="7763199.666666667"
y="0"
Expand All @@ -288,6 +315,7 @@ exports[`processed transcript (exons + impliedUTR) 1`] = `
data-testid="box-type-Gff3TabixAdapter;type-Gff3TabixAdapter;uri-https://s3.amazonaws.com/jbrowse.org/genomes/hg19/nc-offset-107608116-0-13"
fill="goldenrod"
height="10"
stroke=""
width="45.333333333333336"
x="7763927.333333333"
y="0"
Expand All @@ -296,6 +324,7 @@ exports[`processed transcript (exons + impliedUTR) 1`] = `
data-testid="box-type-Gff3TabixAdapter;type-Gff3TabixAdapter;uri-https://s3.amazonaws.com/jbrowse.org/genomes/hg19/nc-offset-107608116-0-14"
fill="goldenrod"
height="10"
stroke=""
width="4"
x="7766265.666666667"
y="0"
Expand All @@ -304,6 +333,7 @@ exports[`processed transcript (exons + impliedUTR) 1`] = `
data-testid="box-type-Gff3TabixAdapter;type-Gff3TabixAdapter;uri-https://s3.amazonaws.com/jbrowse.org/genomes/hg19/nc-offset-107608116-0_five_prime_UTR_7"
fill="#357089"
height="6.5"
stroke=""
width="31.666666666666668"
x="7766421.333333333"
y="1.75"
Expand All @@ -312,6 +342,7 @@ exports[`processed transcript (exons + impliedUTR) 1`] = `
data-testid="box-type-Gff3TabixAdapter;type-Gff3TabixAdapter;uri-https://s3.amazonaws.com/jbrowse.org/genomes/hg19/nc-offset-107608116-0_five_prime_UTR_6"
fill="#357089"
height="6.5"
stroke=""
width="38.333333333333336"
x="7766269.666666667"
y="1.75"
Expand Down Expand Up @@ -357,6 +388,7 @@ exports[`processed transcript (reducedRepresentation mode) 1`] = `
data-testid="box-one"
fill="goldenrod"
height="10"
stroke=""
width="1"
x="0.3"
y="0"
Expand Down Expand Up @@ -385,6 +417,7 @@ exports[`processed transcript 1`] = `
data-testid="box-one-0"
fill="#357089"
height="6.5"
stroke=""
width="44.666666666666664"
x="1991.7"
y="1.75"
Expand All @@ -393,6 +426,7 @@ exports[`processed transcript 1`] = `
data-testid="box-one-2"
fill="goldenrod"
height="10"
stroke=""
width="12.666666666666666"
x="2036.7"
y="0"
Expand All @@ -401,6 +435,7 @@ exports[`processed transcript 1`] = `
data-testid="box-one-3"
fill="goldenrod"
height="10"
stroke=""
width="22.666666666666668"
x="2205.0333333333333"
y="0"
Expand All @@ -409,6 +444,7 @@ exports[`processed transcript 1`] = `
data-testid="box-one-4"
fill="goldenrod"
height="10"
stroke=""
width="94"
x="2252.7"
y="0"
Expand All @@ -417,6 +453,7 @@ exports[`processed transcript 1`] = `
data-testid="box-one-5"
fill="goldenrod"
height="10"
stroke=""
width="59"
x="2380.7"
y="0"
Expand All @@ -425,6 +462,7 @@ exports[`processed transcript 1`] = `
data-testid="box-one-6"
fill="goldenrod"
height="10"
stroke=""
width="92"
x="2470.366666666667"
y="0"
Expand All @@ -433,6 +471,7 @@ exports[`processed transcript 1`] = `
data-testid="box-one-7"
fill="goldenrod"
height="10"
stroke=""
width="34"
x="2582.7"
y="0"
Expand All @@ -441,6 +480,7 @@ exports[`processed transcript 1`] = `
data-testid="box-one-8"
fill="goldenrod"
height="10"
stroke=""
width="48.333333333333336"
x="2651.0333333333333"
y="0"
Expand All @@ -449,6 +489,7 @@ exports[`processed transcript 1`] = `
data-testid="box-one-9"
fill="goldenrod"
height="10"
stroke=""
width="51.333333333333336"
x="2722.0333333333333"
y="0"
Expand All @@ -457,6 +498,7 @@ exports[`processed transcript 1`] = `
data-testid="box-one-10"
fill="goldenrod"
height="10"
stroke=""
width="65"
x="2806.366666666667"
y="0"
Expand All @@ -465,6 +507,7 @@ exports[`processed transcript 1`] = `
data-testid="box-one-11"
fill="goldenrod"
height="10"
stroke=""
width="34.333333333333336"
x="2902.7"
y="0"
Expand All @@ -473,6 +516,7 @@ exports[`processed transcript 1`] = `
data-testid="box-one-12"
fill="goldenrod"
height="10"
stroke=""
width="104"
x="2975.7"
y="0"
Expand All @@ -481,6 +525,7 @@ exports[`processed transcript 1`] = `
data-testid="box-one-13"
fill="goldenrod"
height="10"
stroke=""
width="26.666666666666668"
x="3138.0333333333333"
y="0"
Expand All @@ -489,6 +534,7 @@ exports[`processed transcript 1`] = `
data-testid="box-one-15"
fill="#357089"
height="6.5"
stroke=""
width="83"
x="3165.0333333333333"
y="1.75"
Expand Down
Loading

0 comments on commit 5c746b2

Please sign in to comment.