From 4b314f9d589396464b3b5e7985177f8264f9e7e0 Mon Sep 17 00:00:00 2001 From: Adam Abeshouse Date: Wed, 9 Sep 2020 16:38:53 -0400 Subject: [PATCH] Small typescript changes, and expose more to import Signed-off-by: Adam Abeshouse --- src/js/oncoprintruleset.ts | 6 +++--- src/js/oncoprintshapetosvg.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/js/oncoprintruleset.ts b/src/js/oncoprintruleset.ts index ff178ac..f4ed917 100644 --- a/src/js/oncoprintruleset.ts +++ b/src/js/oncoprintruleset.ts @@ -403,14 +403,14 @@ export class RuleSet { throw "Not implemented on base class"; } - public apply(data:Datum[], cell_width:number, cell_height:number, out_active_rules:ActiveRules|undefined, data_id_key:string&keyof Datum, important_ids?:ColumnProp) { + public apply(data:Datum[], cell_width:number, cell_height:number, out_active_rules?:ActiveRules|undefined, data_id_key?:string&keyof Datum, important_ids?:ColumnProp) { // Returns a list of lists of concrete shapes, in the same order as data // optional parameter important_ids determines which ids count towards active rules (optional parameter data_id_key // is used for this too) var ret = []; for (var i = 0; i < data.length; i++) { var datum = data[i]; - var should_mark_active = !important_ids || !!important_ids[datum[data_id_key]]; + var should_mark_active = !important_ids || !!important_ids[datum[data_id_key!]]; var rules = this.getRulesWithId(datum); if (typeof out_active_rules !== 'undefined' && should_mark_active) { for (let j = 0; j < rules.length; j++) { @@ -968,7 +968,7 @@ class StackedBarRuleSet extends ConditionRuleSet { } } -class GeneticAlterationRuleSet extends LookupRuleSet { +export class GeneticAlterationRuleSet extends LookupRuleSet { constructor(params:IGeneticAlterationRuleSetParams) { super(params); this.addRulesFromParams(params); diff --git a/src/js/oncoprintshapetosvg.ts b/src/js/oncoprintshapetosvg.ts index 7868534..d930513 100644 --- a/src/js/oncoprintshapetosvg.ts +++ b/src/js/oncoprintshapetosvg.ts @@ -81,7 +81,7 @@ function lineToSVG(params:ComputedLineParams, offset_x:number, offset_y:number) }); } -export default function(oncoprint_shape_computed_params:ComputedShapeParams, offset_x:number, offset_y:number) { +export default function shapeToSVG(oncoprint_shape_computed_params:ComputedShapeParams, offset_x:number, offset_y:number) { var type = oncoprint_shape_computed_params.type; if (type === 'rectangle') { return rectangleToSVG(oncoprint_shape_computed_params as ComputedRectangleParams, offset_x, offset_y);