react-mutation-mapper 0.8.79 → 0.8.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,8 +18,6 @@ export declare const DEFAULT_BADGE_STYLE: {
18
18
  };
19
19
  export declare class BadgeLabel extends React.Component<BadgeLabelProps, {}> {
20
20
  static defaultProps: Partial<BadgeLabelProps>;
21
- protected isDriverVusBadge(value: string): boolean;
22
- protected isNotDriverVusProteinBadge(value: string): boolean;
23
21
  protected get badge(): JSX.Element | null;
24
22
  protected get badgeFirst(): JSX.Element;
25
23
  protected get badgeLast(): JSX.Element;
@@ -26,7 +26,7 @@ export declare type BadgeSelectorProps = {
26
26
  }, checkBoxType?: CheckBoxType) => JSX.Element;
27
27
  getBadgeLabel?: (option: BadgeSelectorOption, selectedValues: {
28
28
  [optionValue: string]: any;
29
- }, badgeClassName?: string, badgeAlignmentStyle?: CSSProperties, isDriverAnnotated?: boolean, badgeLabelFormat?: (label: JSX.Element | string, badgeFirst?: boolean, value?: string, badge?: JSX.Element | null) => JSX.Element) => JSX.Element;
29
+ }, badgeClassName?: string, badgeAlignmentStyle?: CSSProperties, isDriverAnnotated?: boolean, badgeLabelFormat?: (label: JSX.Element | string, badgeFirst?: boolean, value?: string, badge?: JSX.Element | null) => JSX.Element, badgeFirst?: boolean) => JSX.Element;
30
30
  filter?: DataFilter<string>;
31
31
  options?: BadgeSelectorOption[];
32
32
  badgeClassName?: string;
@@ -47,6 +47,7 @@ export declare type BadgeSelectorProps = {
47
47
  }[]) => void) => void;
48
48
  badgeLabelFormat?: (label: JSX.Element | string, badgeFirst?: boolean, value?: string, badge?: JSX.Element | null) => JSX.Element;
49
49
  useOnlyFeature?: boolean;
50
+ badgeFirst?: boolean;
50
51
  };
51
52
  export declare const DEFAULT_BADGE_CHAR_WIDTH = 10;
52
53
  export declare const DEFAULT_BADGE_CONTENT_PADDING = 7;
@@ -67,7 +68,7 @@ export declare class BadgeSelector extends React.Component<BadgeSelectorProps, {
67
68
  };
68
69
  getBadgeLabel(option: BadgeSelectorOption, selectedValues: {
69
70
  [optionValue: string]: any;
70
- }, badgeClassName?: string, badgeAlignmentStyle?: CSSProperties, isDriverAnnotated?: boolean, badgeLabelFormat?: (label: JSX.Element | string, badgeFirst?: boolean, value?: string, badge?: JSX.Element | null) => JSX.Element): JSX.Element;
71
+ }, badgeClassName?: string, badgeAlignmentStyle?: CSSProperties, isDriverAnnotated?: boolean, badgeLabelFormat?: (label: JSX.Element | string, badgeFirst?: boolean, value?: string, badge?: JSX.Element | null) => JSX.Element, badgeFirst?: boolean): JSX.Element;
71
72
  get badgeAlignmentStyles(): CSSProperties[] | undefined;
72
73
  get options(): Option[];
73
74
  render(): JSX.Element;
@@ -9,11 +9,14 @@ export declare type ProteinImpactTypeBadgeSelectorProps = BadgeSelectorProps & {
9
9
  [proteinImpactType: string]: number;
10
10
  };
11
11
  excludedProteinTypes?: string[];
12
+ groupIndex?: number;
13
+ groupNameWithOrdinal?: string;
14
+ height?: number;
12
15
  };
13
16
  export declare function getProteinImpactTypeOptionLabel(option: Option): JSX.Element;
14
17
  export declare function getProteinImpactTypeBadgeLabel(option: BadgeSelectorOption, selectedValues: {
15
18
  [optionValue: string]: any;
16
- }, badgeClassName?: string, badgeAlignmentStyle?: CSSProperties, isDriverAnnotated?: boolean, badgeLabelFormat?: (label: JSX.Element | string, badgeFirst?: boolean, value?: string, badge?: JSX.Element | null) => JSX.Element): JSX.Element;
19
+ }, badgeClassName?: string, badgeAlignmentStyle?: CSSProperties, isDriverAnnotated?: boolean, badgeLabelFormat?: (label: JSX.Element | string, badgeFirst?: boolean, value?: string, badge?: JSX.Element | null) => JSX.Element, badgeFirst?: boolean): JSX.Element;
17
20
  export declare class ProteinImpactTypeBadgeSelector<P extends ProteinImpactTypeBadgeSelectorProps = ProteinImpactTypeBadgeSelectorProps> extends React.Component<P, {}> {
18
21
  constructor(props: any);
19
22
  static defaultProps: Partial<ProteinImpactTypeBadgeSelectorProps>;
package/dist/index.es.js CHANGED
@@ -4,7 +4,7 @@ import ___default from 'lodash';
4
4
  import { makeObservable, observable, computed, action, reaction } from 'mobx';
5
5
  import { observer } from 'mobx-react';
6
6
  import * as React from 'react';
7
- import { DefaultTooltip, TruncatedText, getNCBIlink, cachePostMethodsOnClient, CanonicalMutationType, MutationTumorTypeFrequencyTable, FREQUENCY_COLUMNS_DEFINITION, FrequencyTableColumnEnum, CheckedSelect, DriverVsVusType, getSelectedValuesMap, BadgeListSelector, MUT_COLOR_MISSENSE, MUT_COLOR_MISSENSE_PASSENGER, MUT_COLOR_INFRAME, MUT_COLOR_INFRAME_PASSENGER, MUT_COLOR_TRUNC, MUT_COLOR_TRUNC_PASSENGER, MUT_COLOR_SPLICE, MUT_COLOR_SPLICE_PASSENGER, STRUCTURAL_VARIANT_COLOR, STRUCTURAL_VARIANT_PASSENGER_COLOR, MUT_COLOR_OTHER, getCanonicalMutationType, getProteinImpactTypeFromCanonical, ProteinImpactType, getProteinImpactType, resolveColumnVisibility, resolveColumnVisibilityByColumnDefinition, longestCommonStartingSubstring, getTextWidth, unhoverAllComponents, SVGAxis, getComponentIndex, defaultHitzoneConfig, initHitZoneFromConfig, EditableSpan, DownloadControls, EllipsisTextTooltip, remoteData, WindowWrapper } from 'cbioportal-frontend-commons';
7
+ import { DefaultTooltip, TruncatedText, getNCBIlink, cachePostMethodsOnClient, CanonicalMutationType, MutationTumorTypeFrequencyTable, FREQUENCY_COLUMNS_DEFINITION, FrequencyTableColumnEnum, CheckedSelect, getSelectedValuesMap, BadgeListSelector, MUT_COLOR_MISSENSE, MUT_COLOR_MISSENSE_PASSENGER, MUT_COLOR_INFRAME, MUT_COLOR_INFRAME_PASSENGER, MUT_COLOR_TRUNC, MUT_COLOR_TRUNC_PASSENGER, MUT_COLOR_SPLICE, MUT_COLOR_SPLICE_PASSENGER, STRUCTURAL_VARIANT_COLOR, STRUCTURAL_VARIANT_PASSENGER_COLOR, MUT_COLOR_OTHER, MUT_COLOR_OTHER_PASSENGER, getCanonicalMutationType, getProteinImpactTypeFromCanonical, ProteinImpactType, getProteinImpactType, resolveColumnVisibility, resolveColumnVisibilityByColumnDefinition, longestCommonStartingSubstring, getTextWidth, unhoverAllComponents, SVGAxis, getComponentIndex, defaultHitzoneConfig, initHitZoneFromConfig, EditableSpan, DownloadControls, EllipsisTextTooltip, remoteData, WindowWrapper } from 'cbioportal-frontend-commons';
8
8
  import classNames from 'classnames';
9
9
  import { CIVIC_NA_VALUE, parseMyCancerGenomeLink, uniqueGenomicLocations, indexAnnotationsByGenomicLocation, getCivicEntry, getRemoteDataGroupStatus, getMyCancerGenomeLinks, isLinearClusterHotspot, is3dHotspot, OncoKbCardDataType, defaultArraySortMethod, getVariantAnnotation, defaultSortMethod, getDbsnpRsId, getMyVariantInfoAnnotation, generateHgvsgByMutation, calcProteinChangeSortValue, Pathogenicity, extendMutations, formatNumberValueInSignificantDigits, generateTumorTypeDecomposition, formatPercentValue, countMutationsByProteinChange, numberOfLeadingDecimalZeros, filterLinearClusterHotspotsByMutations, filter3dHotspotsByMutations, isHotspot, defaultHotspotFilter, extractExonInformation, formatExonLocation, formatExonLength, ptmColor, compareByPtmTypePriority, UniprotTopologyTrackToColor, UniprotTopologyTypeToTitle, PtmSource, PTM_SOURCE_URL, getMyVariantInfoAnnotationsFromIndexedVariantAnnotations, getMyCancerGenomeData, genomicLocationString, convertUniprotFeatureToPtm, convertDbPtmToPtm, UniprotCategory, convertUniprotFeatureToUniprotTopology, groupPtmDataByPosition, groupPtmDataByTypeAndPosition, groupCancerHotspotDataByPosition, indexHotspotsData, fetchCivicGenes, fetchCivicVariants, getMutationsByTranscriptId, groupMutationsByProteinStartPos, groupHotspotsByMutations } from 'cbioportal-utils';
10
10
  import { getIndicatorData, calculateOncoKbAvailableDataType, oncoKbAnnotationSortValue, OncoKB, OncoKbSummaryTable, LEVELS, getTumorTypeNameWithExclusionInfo, ReferenceList, generateProteinChangeQuery, StructuralVariantType, generateAnnotateStructuralVariantQuery, defaultOncoKbFilter, groupOncoKbIndicatorDataByMutations, defaultOncoKbIndicatorFilter } from 'oncokb-frontend-commons';
@@ -1851,24 +1851,6 @@ var BadgeLabel = /** @class */ (function (_super) {
1851
1851
  function BadgeLabel() {
1852
1852
  return _super !== null && _super.apply(this, arguments) || this;
1853
1853
  }
1854
- Object.defineProperty(BadgeLabel.prototype, "isDriverVusBadge", {
1855
- enumerable: false,
1856
- configurable: true,
1857
- writable: true,
1858
- value: function (value) {
1859
- return (!!value &&
1860
- Object.values(DriverVsVusType).includes(value));
1861
- }
1862
- });
1863
- Object.defineProperty(BadgeLabel.prototype, "isNotDriverVusProteinBadge", {
1864
- enumerable: false,
1865
- configurable: true,
1866
- writable: true,
1867
- value: function (value) {
1868
- return (!!value &&
1869
- Object.values(CanonicalMutationType).includes(value));
1870
- }
1871
- });
1872
1854
  Object.defineProperty(BadgeLabel.prototype, "badge", {
1873
1855
  get: function () {
1874
1856
  return (React.createElement("span", { style: this.props.badgeFirst
@@ -2037,8 +2019,8 @@ var BadgeSelector = /** @class */ (function (_super) {
2037
2019
  enumerable: false,
2038
2020
  configurable: true,
2039
2021
  writable: true,
2040
- value: function (option, selectedValues, badgeClassName, badgeAlignmentStyle, isDriverAnnotated, badgeLabelFormat) {
2041
- return this.props.getBadgeLabel ? (this.props.getBadgeLabel(option, selectedValues, badgeClassName, badgeAlignmentStyle, isDriverAnnotated, badgeLabelFormat)) : (React.createElement(BadgeLabel, { label: option.label || option.value, badgeContent: option.badgeContent, badgeStyleOverride: getBadgeStyleOverride(option, selectedValues, badgeAlignmentStyle), badgeClassName: this.props.badgeClassName, isDriverAnnotated: this.props.isDriverAnnotated, badgeLabelFormat: this.props.badgeLabelFormat }));
2022
+ value: function (option, selectedValues, badgeClassName, badgeAlignmentStyle, isDriverAnnotated, badgeLabelFormat, badgeFirst) {
2023
+ return this.props.getBadgeLabel ? (this.props.getBadgeLabel(option, selectedValues, badgeClassName, badgeAlignmentStyle, isDriverAnnotated, badgeLabelFormat, badgeFirst)) : (React.createElement(BadgeLabel, { label: option.label || option.value, badgeContent: option.badgeContent, badgeStyleOverride: getBadgeStyleOverride(option, selectedValues, badgeAlignmentStyle), badgeClassName: this.props.badgeClassName, isDriverAnnotated: this.props.isDriverAnnotated, badgeLabelFormat: this.props.badgeLabelFormat, badgeFirst: this.props.badgeFirst }));
2042
2024
  }
2043
2025
  });
2044
2026
  Object.defineProperty(BadgeSelector.prototype, "badgeAlignmentStyles", {
@@ -2056,7 +2038,7 @@ var BadgeSelector = /** @class */ (function (_super) {
2056
2038
  return (this.props.options || []).map(function (option, index) { return ({
2057
2039
  label: _this.getBadgeLabel(option, _this.selectedValuesMap, _this.props.badgeClassName, _this.badgeAlignmentStyles && _this.props.numberOfColumnsPerRow
2058
2040
  ? _this.badgeAlignmentStyles[index]
2059
- : undefined, _this.props.isDriverAnnotated, _this.props.badgeLabelFormat),
2041
+ : undefined, _this.props.isDriverAnnotated, _this.props.badgeLabelFormat, _this.props.badgeFirst),
2060
2042
  value: option.value,
2061
2043
  }); });
2062
2044
  },
@@ -2126,6 +2108,7 @@ var DEFAULT_PROTEIN_IMPACT_TYPE_COLORS = {
2126
2108
  fusionColor: STRUCTURAL_VARIANT_COLOR,
2127
2109
  fusionVusColor: STRUCTURAL_VARIANT_PASSENGER_COLOR,
2128
2110
  otherColor: MUT_COLOR_OTHER,
2111
+ otherVusColor: MUT_COLOR_OTHER_PASSENGER,
2129
2112
  };
2130
2113
  var MUTATION_TYPE_PRIORITY = {
2131
2114
  missense: 1,
@@ -2211,6 +2194,10 @@ function getColorForProteinImpactType(mutations, colors, getMutationCount, isPut
2211
2194
  return chosenMutation.isPutativeDriver
2212
2195
  ? colors.spliceColor
2213
2196
  : colors.spliceVusColor;
2197
+ case ProteinImpactType.OTHER:
2198
+ return chosenMutation.isPutativeDriver
2199
+ ? colors.otherColor
2200
+ : colors.otherVusColor;
2214
2201
  default:
2215
2202
  return colors.otherColor;
2216
2203
  }
@@ -2329,8 +2316,8 @@ var VALUES = [
2329
2316
  function getProteinImpactTypeOptionLabel(option) {
2330
2317
  return React.createElement("span", null, option.label || option.value);
2331
2318
  }
2332
- function getProteinImpactTypeBadgeLabel(option, selectedValues, badgeClassName, badgeAlignmentStyle, isDriverAnnotated, badgeLabelFormat) {
2333
- return (React.createElement(BadgeLabel, { label: option.label || option.value, badgeContent: option.badgeContent, badgeStyleOverride: getBadgeStyleOverride(option, selectedValues, badgeAlignmentStyle), badgeClassName: badgeClassName, badgeFirst: true, value: option.value, isDriverAnnotated: isDriverAnnotated, badgeLabelFormat: badgeLabelFormat }));
2319
+ function getProteinImpactTypeBadgeLabel(option, selectedValues, badgeClassName, badgeAlignmentStyle, isDriverAnnotated, badgeLabelFormat, badgeFirst) {
2320
+ return (React.createElement(BadgeLabel, { label: option.label || option.value, badgeContent: option.badgeContent, badgeStyleOverride: getBadgeStyleOverride(option, selectedValues, badgeAlignmentStyle), badgeClassName: badgeClassName, badgeFirst: badgeFirst, value: option.value, isDriverAnnotated: isDriverAnnotated, badgeLabelFormat: badgeLabelFormat }));
2334
2321
  }
2335
2322
  var ProteinImpactTypeBadgeSelector = /** @class */ (function (_super) {
2336
2323
  __extends(ProteinImpactTypeBadgeSelector, _super);
@@ -2379,8 +2366,17 @@ var ProteinImpactTypeBadgeSelector = /** @class */ (function (_super) {
2379
2366
  configurable: true,
2380
2367
  writable: true,
2381
2368
  value: function () {
2382
- return (React.createElement("table", null,
2383
- React.createElement(BadgeSelector, __assign({ options: this.options, getOptionLabel: getProteinImpactTypeOptionLabel, getBadgeLabel: getProteinImpactTypeBadgeLabel, useOnlyFeature: true }, this.props))));
2369
+ return (React.createElement("div", { style: { display: 'inline-flex' } },
2370
+ React.createElement("div", null,
2371
+ React.createElement("table", { style: { height: this.props.height } },
2372
+ React.createElement(BadgeSelector, __assign({ options: this.options, getOptionLabel: getProteinImpactTypeOptionLabel, getBadgeLabel: getProteinImpactTypeBadgeLabel, useOnlyFeature: true, badgeFirst: true }, this.props)))),
2373
+ this.props.groupNameWithOrdinal && (React.createElement("div", { style: {
2374
+ fontSize: 12,
2375
+ fontWeight: 'bold',
2376
+ textAlign: 'center',
2377
+ writingMode: 'vertical-lr',
2378
+ transform: 'rotate(180deg)',
2379
+ } }, this.props.groupNameWithOrdinal))));
2384
2380
  }
2385
2381
  });
2386
2382
  Object.defineProperty(ProteinImpactTypeBadgeSelector, "defaultProps", {