Skip to content

Commit edf4fb3

Browse files
committed
Extend legend: Kinase Activities
1 parent 8979feb commit edf4fb3

File tree

2 files changed

+79
-3
lines changed

2 files changed

+79
-3
lines changed

src/BiowcPathwaygraph.ts

Lines changed: 78 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2698,7 +2698,7 @@ export class BiowcPathwaygraph extends LitElement {
26982698
// Determine width and height of the legend.
26992699
// Width is constant, height is larger if the legend contains a color scale
27002700
const legendWidth = 265;
2701-
const legendHeight = drawColorLegend ? 285 : 210;
2701+
const legendHeight = drawColorLegend ? 357 : 277;
27022702

27032703
// Draw the frame
27042704
legendSvg
@@ -3039,10 +3039,86 @@ export class BiowcPathwaygraph extends LitElement {
30393039
yOffset * scalingFactor + lineHeight * 7 + paragraphMargin * 1
30403040
);
30413041

3042+
legendSvg
3043+
.append('text')
3044+
.attr('class', 'legend')
3045+
.text('Protein Activity:')
3046+
.attr('x', xOffset)
3047+
.attr(
3048+
'y',
3049+
yOffset * scalingFactor + lineHeight * 8 + paragraphMargin * 1
3050+
);
3051+
3052+
legendSvg
3053+
.append('rect')
3054+
.attr('class', 'node-rect gene_protein legend')
3055+
.attr('x', xOffset)
3056+
.attr('y', yOffset + lineHeight * 9 + paragraphMargin * 0)
3057+
.attr('transform', 'translate(0,-15)')
3058+
.attr('rx', 10 * scalingFactor)
3059+
.attr('ry', 30 * scalingFactor)
3060+
.attr('width', 35 * scalingFactor)
3061+
.attr('height', 25 * scalingFactor)
3062+
.style('stroke', '#c20000')
3063+
.style('stroke-width', 4);
3064+
legendSvg
3065+
.append('text')
3066+
.attr('class', 'legend')
3067+
.text('Increased')
3068+
.attr('x', xOffset + 22)
3069+
.attr(
3070+
'y',
3071+
yOffset * scalingFactor + 3 + lineHeight * 9 + paragraphMargin * 0
3072+
);
3073+
3074+
legendSvg
3075+
.append('rect')
3076+
.attr('class', 'node-rect gene_protein legend')
3077+
.attr('x', xOffset + 100)
3078+
.attr('y', yOffset + lineHeight * 9 + paragraphMargin * 0)
3079+
.attr('transform', 'translate(0,-15)')
3080+
.attr('rx', 10 * scalingFactor)
3081+
.attr('ry', 30 * scalingFactor)
3082+
.attr('width', 35 * scalingFactor)
3083+
.attr('height', 25 * scalingFactor)
3084+
.style('stroke', '#0043c2')
3085+
.style('stroke-width', 4);
3086+
legendSvg
3087+
.append('text')
3088+
.attr('class', 'legend')
3089+
.text('Decreased')
3090+
.attr('x', xOffset + 122)
3091+
.attr(
3092+
'y',
3093+
yOffset * scalingFactor + 3 + lineHeight * 9 + paragraphMargin * 0
3094+
);
3095+
3096+
legendSvg
3097+
.append('rect')
3098+
.attr('class', 'node-rect gene_protein legend')
3099+
.attr('x', xOffset)
3100+
.attr('y', yOffset + lineHeight * 10 + paragraphMargin * 0)
3101+
.attr('transform', 'translate(0,-15)')
3102+
.attr('rx', 10 * scalingFactor)
3103+
.attr('ry', 30 * scalingFactor)
3104+
.attr('width', 35 * scalingFactor)
3105+
.attr('height', 25 * scalingFactor)
3106+
.style('stroke', '#8100c2')
3107+
.style('stroke-width', 4);
3108+
legendSvg
3109+
.append('text')
3110+
.attr('class', 'legend')
3111+
.text('Unknown Direction')
3112+
.attr('x', xOffset + 22)
3113+
.attr(
3114+
'y',
3115+
yOffset * scalingFactor + 3 + lineHeight * 10 + paragraphMargin * 0
3116+
);
3117+
30423118
if (drawColorLegend) {
30433119
const colorLegendGroupPosition = [
30443120
xOffset + 5,
3045-
yOffset * scalingFactor + lineHeight * 8 + paragraphMargin * 2 + 10,
3121+
yOffset * scalingFactor + lineHeight * 11 + paragraphMargin * 2 + 10,
30463122
];
30473123
const colorLegendGroup = legendSvg
30483124
.append('g')

src/biowc-pathwaygraph.css.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ export default css`
244244
245245
#potencyRangeSlider {
246246
position: absolute;
247-
top: 220px;
247+
top: 290px;
248248
left: 20px;
249249
font-size: 11pt;
250250
font-family: var(--font-stack);

0 commit comments

Comments
 (0)