react-mutation-mapper 0.8.50 → 0.8.51

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.
@@ -11,7 +11,6 @@ export default class OncoKbHelper {
11
11
  static get LEVEL_DESC(): {
12
12
  [level: string]: JSX.Element;
13
13
  };
14
- static levelTooltipContent: (level: string) => JSX.Element;
15
14
  static getDefaultColumnDefinition(columnKey: 'level' | 'alterations'): {
16
15
  id: string;
17
16
  Header: JSX.Element;
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ declare const LevelIcon: React.FunctionComponent<{
3
+ level: string;
4
+ showDescription?: boolean;
5
+ }>;
6
+ export default LevelIcon;
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ declare const OncogenicIcon: React.FunctionComponent<{
3
+ oncogenicity: string;
4
+ showDescription?: boolean;
5
+ }>;
6
+ export default OncogenicIcon;
package/dist/index.es.js CHANGED
@@ -806,6 +806,14 @@ var OncoKBSuggestAnnotationLinkout = /** @class */ (function (_super) {
806
806
  return OncoKBSuggestAnnotationLinkout;
807
807
  }(React.Component));
808
808
 
809
+ var levelTooltipContent = function (level) {
810
+ return (React.createElement("div", { style: { maxWidth: '200px' } }, OncoKbHelper.LEVEL_DESC[level]));
811
+ };
812
+ var LevelIcon = function (props) {
813
+ return (React.createElement(DefaultTooltip, { overlay: levelTooltipContent(props.level), placement: "left", disabled: !props.showDescription, trigger: ['hover', 'focus'], destroyTooltipOnHide: true },
814
+ React.createElement("i", { className: levelIconClassNames(props.level) })));
815
+ };
816
+
809
817
  var OncoKbHelper = /** @class */ (function () {
810
818
  function OncoKbHelper() {
811
819
  }
@@ -944,7 +952,6 @@ var OncoKbHelper = /** @class */ (function () {
944
952
  configurable: true,
945
953
  writable: true,
946
954
  value: function (columnKey) {
947
- var _this = this;
948
955
  switch (columnKey) {
949
956
  case 'level':
950
957
  return {
@@ -957,8 +964,7 @@ var OncoKbHelper = /** @class */ (function () {
957
964
  },
958
965
  Cell: function (props) {
959
966
  var normalizedLevel = normalizeLevel(props.value) || '';
960
- return (React.createElement(DefaultTooltip, { overlay: _this.levelTooltipContent(normalizedLevel), placement: "left", trigger: ['hover', 'focus'], destroyTooltipOnHide: true },
961
- React.createElement("i", { className: levelIconClassNames(normalizedLevel), style: { margin: 'auto' } })));
967
+ return (React.createElement(LevelIcon, { level: normalizedLevel, showDescription: true }));
962
968
  },
963
969
  };
964
970
  case 'alterations':
@@ -974,14 +980,6 @@ var OncoKbHelper = /** @class */ (function () {
974
980
  }
975
981
  }
976
982
  });
977
- Object.defineProperty(OncoKbHelper, "levelTooltipContent", {
978
- enumerable: true,
979
- configurable: true,
980
- writable: true,
981
- value: function (level) {
982
- return (React.createElement("div", { style: { maxWidth: '200px' } }, OncoKbHelper.LEVEL_DESC[level]));
983
- }
984
- });
985
983
  Object.defineProperty(OncoKbHelper, "getAlterationsColumnCell", {
986
984
  enumerable: true,
987
985
  configurable: true,
@@ -1347,6 +1345,11 @@ var ImplicationContent = function (props) {
1347
1345
 
1348
1346
  var tabsStyles = {"tabs-wrapper":"tabs-module_tabs-wrapper__XKjzo","tabs":"tabs-module_tabs__2I3mz","tab":"tabs-module_tab__3MoDA","tab-pane":"tabs-module_tab-pane__sGd85","tab-title-a":"tabs-module_tab-title-a__2WTNA","tab-title":"tabs-module_tab-title__2z9-D","tab-subtitle":"tabs-module_tab-subtitle__1P8B_"};
1349
1347
 
1348
+ var OncogenicIcon = function (props) {
1349
+ return (React.createElement(DefaultTooltip, { overlay: React.createElement("span", null, props.oncogenicity), placement: "left", trigger: ['hover', 'focus'], destroyTooltipOnHide: true },
1350
+ React.createElement("i", { className: oncogenicityIconClassNames(props.oncogenicity) })));
1351
+ };
1352
+
1350
1353
  var _a$3;
1351
1354
  var OncoKbMedicalDisclaimer = (React__default.createElement("p", { className: mainStyles.disclaimer }, "The information above is intended for research purposes only and should not be used as a substitute for professional diagnosis and treatment."));
1352
1355
  var ONCOKB_DATA_ACCESS_PAGE_LINK = 'https://docs.cbioportal.org/2.4-integration-with-other-webservices/oncokb-data-access';
@@ -1368,8 +1371,9 @@ var TabContentWrapper = function (props) {
1368
1371
  return React__default.createElement("div", { className: mainStyles['tab-content'] }, props.children);
1369
1372
  };
1370
1373
  var TabTitle = function (props) {
1374
+ var _a;
1371
1375
  var title = DATA_TYPE_TO_TITLE[props.type];
1372
- var icon = props.displayHighestLevelInTabTitle ? (React__default.createElement("i", { className: annotationIconClassNames(props.type, calcHighestIndicatorLevel(props.type, props.indicator), props.indicator) })) : null;
1376
+ var icon = props.displayHighestLevelInTabTitle ? (props.type === OncoKbCardDataType.BIOLOGICAL ? (React__default.createElement(OncogenicIcon, { oncogenicity: ((_a = props.indicator) === null || _a === void 0 ? void 0 : _a.oncogenic) || '', showDescription: true })) : (React__default.createElement(LevelIcon, { level: normalizeLevel(calcHighestIndicatorLevel(props.type, props.indicator)) || '', showDescription: true }))) : null;
1373
1377
  return icon ? (React__default.createElement("span", { style: { display: 'flex' } },
1374
1378
  icon,
1375
1379
  " ",
@@ -2100,7 +2104,7 @@ function getDefaultEntrezGeneId(mutation) {
2100
2104
  return (mutation.gene && mutation.gene.entrezGeneId) || 0;
2101
2105
  }
2102
2106
  function getDefaultTumorType() {
2103
- return 'Unknown';
2107
+ return '';
2104
2108
  }
2105
2109
  var memoized = new Map();
2106
2110
  function getAnnotationData(mutation, oncoKbCancerGenes, hotspotData, myCancerGenomeData, oncoKbData, usingPublicOncoKbInstance, civicGenes, civicVariants, resolveTumorType, resolveEntrezGeneId) {
@@ -8176,9 +8180,7 @@ var OncoKbSummaryTable = /** @class */ (function (_super) {
8176
8180
  overflow: 'hidden',
8177
8181
  textOverflow: 'ellipsis',
8178
8182
  } },
8179
- React.createElement("i", { className: levelIconClassNames(level.level), style: {
8180
- verticalAlign: 'text-bottom',
8181
- } }),
8183
+ React.createElement(LevelIcon, { level: level.level, showDescription: true }),
8182
8184
  React.createElement("span", { style: {
8183
8185
  paddingRight: 3,
8184
8186
  } }, ":"),
@@ -8298,7 +8300,7 @@ function generateLevelData(indicatorData) {
8298
8300
  var parts = treatment.level.split('_');
8299
8301
  var level = parts.length === 2 ? parts[1] : treatment.level;
8300
8302
  levels[level] = levels[level] || [];
8301
- levels[level].push(indicator.query.tumorType);
8303
+ levels[level].push(getTumorTypeName(treatment.levelAssociatedCancerType));
8302
8304
  });
8303
8305
  });
8304
8306
  return ___default.keys(levels)
@@ -10606,7 +10608,7 @@ var DefaultMutationMapperDataFetcher = /** @class */ (function () {
10606
10608
  writable: true,
10607
10609
  value: function (mutations, fields, isoformOverrideSource, client) {
10608
10610
  if (fields === void 0) { fields = ['annotation_summary']; }
10609
- if (isoformOverrideSource === void 0) { isoformOverrideSource = 'uniprot'; }
10611
+ if (isoformOverrideSource === void 0) { isoformOverrideSource = 'mskcc'; }
10610
10612
  if (client === void 0) { client = this.genomeNexusClient; }
10611
10613
  return __awaiter(this, void 0, void 0, function () {
10612
10614
  return __generator(this, function (_a) {
@@ -12032,7 +12034,7 @@ var DefaultMutationMapperStore = /** @class */ (function () {
12032
12034
  value: function (mutation) {
12033
12035
  return this.config.getTumorType
12034
12036
  ? this.config.getTumorType(mutation)
12035
- : 'Unknown';
12037
+ : '';
12036
12038
  }
12037
12039
  });
12038
12040
  Object.defineProperty(DefaultMutationMapperStore.prototype, "getDefaultEntrezGeneId", {