react-mutation-mapper 0.8.70 → 0.8.72

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.
package/dist/index.js CHANGED
@@ -22,9 +22,9 @@ var reactCollapse = require('react-collapse');
22
22
  var numeral = require('numeral');
23
23
  var Slider = require('react-rangeslider');
24
24
  require('react-rangeslider/lib/index.css');
25
+ var reactBootstrap = require('react-bootstrap');
25
26
  var oncoKbImg = require('oncokb-styles/dist/images/oncogenic.svg');
26
27
  require('oncokb-frontend-commons/dist/styles.css');
27
- var reactBootstrap = require('react-bootstrap');
28
28
  var request = require('superagent');
29
29
  var memoize = require('memoize-weak-decorator');
30
30
  var mobxpromise = require('mobxpromise');
@@ -5812,6 +5812,124 @@ var LollipopPlot = /** @class */ (function (_super) {
5812
5812
 
5813
5813
  var styles$5 = {"fade-out":"lollipopMutationPlot-module_fade-out__3PbXO","fade-in":"lollipopMutationPlot-module_fade-in__8bsOR","input-addon":"lollipopMutationPlot-module_input-addon__1P_lA","ymax-number-input":"lollipopMutationPlot-module_ymax-number-input__3oJoA"};
5814
5814
 
5815
+ exports.AxisScale = void 0;
5816
+ (function (AxisScale) {
5817
+ AxisScale["PERCENT"] = "%";
5818
+ AxisScale["COUNT"] = "#";
5819
+ })(exports.AxisScale || (exports.AxisScale = {}));
5820
+ var AxisScaleSwitch = /** @class */ (function (_super) {
5821
+ tslib.__extends(AxisScaleSwitch, _super);
5822
+ function AxisScaleSwitch(props) {
5823
+ var _this = _super.call(this, props) || this;
5824
+ Object.defineProperty(_this, "selectedScale", {
5825
+ enumerable: true,
5826
+ configurable: true,
5827
+ writable: true,
5828
+ value: void 0
5829
+ });
5830
+ _this.selectedScale = props.selectedScale;
5831
+ mobx.makeObservable(_this);
5832
+ return _this;
5833
+ }
5834
+ Object.defineProperty(AxisScaleSwitch.prototype, "toggleButton", {
5835
+ enumerable: false,
5836
+ configurable: true,
5837
+ writable: true,
5838
+ value: function (scale, onClick) {
5839
+ return (React__namespace.createElement("button", { className: classNames__default["default"]({
5840
+ 'btn-secondary': this.props.selectedScale === scale,
5841
+ 'btn-outline-secondary': this.props.selectedScale !== scale,
5842
+ }, 'btn', 'btn-sm', 'btn-axis-switch'), style: {
5843
+ lineHeight: 1,
5844
+ cursor: this.props.selectedScale === scale
5845
+ ? 'default'
5846
+ : 'pointer',
5847
+ fontWeight: this.props.selectedScale === scale
5848
+ ? 'bolder'
5849
+ : 'normal',
5850
+ color: this.props.selectedScale === scale ? '#fff' : '#6c757d',
5851
+ backgroundColor: this.props.selectedScale === scale ? '#6c757d' : '#fff',
5852
+ borderColor: '#6c757d',
5853
+ }, onClick: onClick }, scale));
5854
+ }
5855
+ });
5856
+ Object.defineProperty(AxisScaleSwitch.prototype, "render", {
5857
+ enumerable: false,
5858
+ configurable: true,
5859
+ writable: true,
5860
+ value: function () {
5861
+ return (React__namespace.createElement(reactBootstrap.ButtonGroup, { "aria-label": "" },
5862
+ this.toggleButton(exports.AxisScale.PERCENT, this.handlePercentClick),
5863
+ this.toggleButton(exports.AxisScale.COUNT, this.handleCountClick)));
5864
+ }
5865
+ });
5866
+ Object.defineProperty(AxisScaleSwitch.prototype, "handlePercentClick", {
5867
+ enumerable: false,
5868
+ configurable: true,
5869
+ writable: true,
5870
+ value: function () {
5871
+ this.selectedScale = exports.AxisScale.PERCENT;
5872
+ this.props.onChange(this.selectedScale);
5873
+ }
5874
+ });
5875
+ Object.defineProperty(AxisScaleSwitch.prototype, "handleCountClick", {
5876
+ enumerable: false,
5877
+ configurable: true,
5878
+ writable: true,
5879
+ value: function () {
5880
+ this.selectedScale = exports.AxisScale.COUNT;
5881
+ this.props.onChange(this.selectedScale);
5882
+ }
5883
+ });
5884
+ Object.defineProperty(AxisScaleSwitch, "defaultProps", {
5885
+ enumerable: true,
5886
+ configurable: true,
5887
+ writable: true,
5888
+ value: {
5889
+ selectedScale: exports.AxisScale.COUNT,
5890
+ }
5891
+ });
5892
+ tslib.__decorate([
5893
+ mobx.observable
5894
+ ], AxisScaleSwitch.prototype, "selectedScale", void 0);
5895
+ tslib.__decorate([
5896
+ mobx.action.bound
5897
+ ], AxisScaleSwitch.prototype, "handlePercentClick", null);
5898
+ tslib.__decorate([
5899
+ mobx.action.bound
5900
+ ], AxisScaleSwitch.prototype, "handleCountClick", null);
5901
+ AxisScaleSwitch = tslib.__decorate([
5902
+ mobxReact.observer
5903
+ ], AxisScaleSwitch);
5904
+ return AxisScaleSwitch;
5905
+ }(React__namespace.Component));
5906
+
5907
+ var PercentToggle = /** @class */ (function (_super) {
5908
+ tslib.__extends(PercentToggle, _super);
5909
+ function PercentToggle(props) {
5910
+ return _super.call(this, props) || this;
5911
+ }
5912
+ Object.defineProperty(PercentToggle.prototype, "render", {
5913
+ enumerable: false,
5914
+ configurable: true,
5915
+ writable: true,
5916
+ value: function () {
5917
+ return (React__namespace.createElement("div", { className: "small", style: {
5918
+ display: 'flex',
5919
+ alignItems: 'center',
5920
+ marginLeft: 10,
5921
+ } },
5922
+ React__namespace.createElement("div", { style: {
5923
+ marginLeft: 10,
5924
+ marginRight: 10,
5925
+ } },
5926
+ React__namespace.createElement("div", { style: { textAlign: 'center' } }, "Y-Axis:"),
5927
+ React__namespace.createElement(AxisScaleSwitch, { selectedScale: this.props.axisMode, onChange: this.props.onScaleToggle }))));
5928
+ }
5929
+ });
5930
+ return PercentToggle;
5931
+ }(React__namespace.Component));
5932
+
5815
5933
  function formatInputValue(value, step) {
5816
5934
  if (step === void 0) { step = 1; }
5817
5935
  var decimalZeros = cbioportalUtils.numberOfLeadingDecimalZeros(step);
@@ -5851,14 +5969,14 @@ var LollipopMutationPlotControls = /** @class */ (function (_super) {
5851
5969
  alignItems: 'center',
5852
5970
  marginLeft: 10,
5853
5971
  } },
5854
- React__namespace.createElement("span", null,
5855
- label,
5856
- ":"),
5857
5972
  React__namespace.createElement("div", { style: {
5858
5973
  width: width,
5859
5974
  marginLeft: 10,
5860
5975
  marginRight: 10,
5861
5976
  } },
5977
+ React__namespace.createElement("div", { style: { textAlign: 'center' } },
5978
+ label,
5979
+ ":"),
5862
5980
  React__namespace.createElement(Slider__default["default"], { min: yMaxSliderStep, max: calcYMaxInput(undefined, yMaxSliderStep, countRange, oppositeCountRange, yAxisSameScale), tooltip: false, step: yMaxSliderStep, onChange: onYAxisMaxSliderChange, value: yMaxSlider })),
5863
5981
  React__namespace.createElement(cbioportalFrontendCommons.EditableSpan, { className: styles$5['ymax-number-input'], value: formatInputValue(yMaxInput, yMaxSliderStep), setValue: onYAxisMaxChange, numericOnly: yMaxSliderStep >= 1, onFocus: this.props.onYMaxInputFocused, onBlur: this.props.onYMaxInputBlurred })));
5864
5982
  }
@@ -5873,7 +5991,7 @@ var LollipopMutationPlotControls = /** @class */ (function (_super) {
5873
5991
  Object.defineProperty(LollipopMutationPlotControls.prototype, "bottomYMaxSlider", {
5874
5992
  get: function () {
5875
5993
  if (this.showBottomYAxisSlider) {
5876
- return this.maxValueSlider(this.props.bottomCountRange, this.props.countRange, this.props.onBottomYAxisMaxSliderChange, this.props.onBottomYAxisMaxChange, this.props.bottomYMaxSlider, this.props.bottomYMaxInput, this.props.yAxisSameScale, 'Bottom Y-Axis Max', 100, this.props.bottomYMaxSliderStep);
5994
+ return this.maxValueSlider(this.props.bottomCountRange, this.props.countRange, this.props.onBottomYAxisMaxSliderChange, this.props.onBottomYAxisMaxChange, this.props.bottomYMaxSlider, this.props.bottomYMaxInput, this.props.yAxisSameScale, 'Bottom Y-Axis Max', this.props.yMaxSliderWidth, this.props.bottomYMaxSliderStep);
5877
5995
  }
5878
5996
  else {
5879
5997
  return null;
@@ -5906,6 +6024,13 @@ var LollipopMutationPlotControls = /** @class */ (function (_super) {
5906
6024
  enumerable: false,
5907
6025
  configurable: true
5908
6026
  });
6027
+ Object.defineProperty(LollipopMutationPlotControls.prototype, "percentToggle", {
6028
+ get: function () {
6029
+ return (React__namespace.createElement(PercentToggle, { axisMode: this.props.axisMode, onScaleToggle: this.props.onScaleToggle }));
6030
+ },
6031
+ enumerable: false,
6032
+ configurable: true
6033
+ });
5909
6034
  Object.defineProperty(LollipopMutationPlotControls.prototype, "render", {
5910
6035
  enumerable: false,
5911
6036
  configurable: true,
@@ -5921,6 +6046,7 @@ var LollipopMutationPlotControls = /** @class */ (function (_super) {
5921
6046
  this.trackSelector,
5922
6047
  this.props.showYMaxSlider && this.yMaxSlider,
5923
6048
  this.props.showYMaxSlider && this.bottomYMaxSlider,
6049
+ this.props.showPercentToggle && this.percentToggle,
5924
6050
  this.props.filterResetPanel,
5925
6051
  this.props.customControls,
5926
6052
  React__namespace.createElement("div", { style: { display: 'flex', marginLeft: 'auto' } },
@@ -5939,12 +6065,15 @@ var LollipopMutationPlotControls = /** @class */ (function (_super) {
5939
6065
  showYMaxSlider: true,
5940
6066
  showLegendToggle: true,
5941
6067
  showDownloadControls: true,
5942
- yMaxSliderWidth: 100,
6068
+ yMaxSliderWidth: 110,
5943
6069
  }
5944
6070
  });
5945
6071
  tslib.__decorate([
5946
6072
  mobx.computed
5947
6073
  ], LollipopMutationPlotControls.prototype, "showBottomYAxisSlider", null);
6074
+ tslib.__decorate([
6075
+ mobx.computed
6076
+ ], LollipopMutationPlotControls.prototype, "percentToggle", null);
5948
6077
  LollipopMutationPlotControls = tslib.__decorate([
5949
6078
  mobxReact.observer
5950
6079
  ], LollipopMutationPlotControls);
@@ -8418,7 +8547,7 @@ var LollipopMutationPlot = /** @class */ (function (_super) {
8418
8547
  if (this.props.store.pfamDomainData.isComplete &&
8419
8548
  this.props.store.pfamDomainData.result) {
8420
8549
  return (React__namespace.createElement("div", { style: { display: 'inline-block' }, ref: function (div) { return (_this.divContainer = div); }, onMouseEnter: this.handlers.onMouseEnterPlot, onMouseLeave: this.handlers.onMouseLeavePlot },
8421
- React__namespace.createElement(LollipopMutationPlotControls, { showControls: this.showControls, showYMaxSlider: this.props.showYMaxSlider, showLegendToggle: this.props.showLegendToggle, showDownloadControls: this.props.showDownloadControls, hugoGeneSymbol: this.hugoGeneSymbol, countRange: this.countRange, bottomCountRange: this.bottomCountRange, onYAxisMaxSliderChange: this.handlers.handleYAxisMaxSliderChange, onYAxisMaxChange: this.handlers.handleYAxisMaxChange, onBottomYAxisMaxSliderChange: this.handlers.handleBottomYAxisMaxSliderChange, onBottomYAxisMaxChange: this.handlers.handleBottomYAxisMaxChange, onYMaxInputFocused: this.handlers.onYMaxInputFocused, onYMaxInputBlurred: this.handlers.onYMaxInputBlurred, onToggleLegend: this.handlers.handleToggleLegend, yMaxSlider: this.yMaxSlider, yMaxSliderStep: this.yMaxSliderStep, yMaxInput: this.yMaxInput, yAxisSameScale: this.props.yAxisSameScale, bottomYMaxSlider: this.bottomYMaxSlider, bottomYMaxSliderStep: this.bottomYMaxSliderStep, bottomYMaxInput: this.bottomYMaxInput, customControls: this.props.customControls, filterResetPanel: this.props.filterResetPanel, trackVisibility: this.trackVisibility, tracks: this.props.tracks, trackDataStatus: this.props.trackDataStatus, showTrackSelector: this.props.showTrackSelector, onTrackVisibilityChange: this.onTrackVisibilityChange, getSVG: this.getSVG }),
8550
+ React__namespace.createElement(LollipopMutationPlotControls, { showControls: this.showControls, showYMaxSlider: this.props.showYMaxSlider, showLegendToggle: this.props.showLegendToggle, showDownloadControls: this.props.showDownloadControls, hugoGeneSymbol: this.hugoGeneSymbol, countRange: this.countRange, bottomCountRange: this.bottomCountRange, onYAxisMaxSliderChange: this.handlers.handleYAxisMaxSliderChange, onYAxisMaxChange: this.handlers.handleYAxisMaxChange, onBottomYAxisMaxSliderChange: this.handlers.handleBottomYAxisMaxSliderChange, onBottomYAxisMaxChange: this.handlers.handleBottomYAxisMaxChange, onYMaxInputFocused: this.handlers.onYMaxInputFocused, onYMaxInputBlurred: this.handlers.onYMaxInputBlurred, onToggleLegend: this.handlers.handleToggleLegend, yMaxSlider: this.yMaxSlider, yMaxSliderStep: this.yMaxSliderStep, yMaxInput: this.yMaxInput, yAxisSameScale: this.props.yAxisSameScale, bottomYMaxSlider: this.bottomYMaxSlider, bottomYMaxSliderStep: this.bottomYMaxSliderStep, bottomYMaxInput: this.bottomYMaxInput, customControls: this.props.customControls, filterResetPanel: this.props.filterResetPanel, trackVisibility: this.trackVisibility, tracks: this.props.tracks, trackDataStatus: this.props.trackDataStatus, showTrackSelector: this.props.showTrackSelector, onTrackVisibilityChange: this.onTrackVisibilityChange, getSVG: this.getSVG, axisMode: this.props.axisMode, onScaleToggle: this.props.onScaleToggle, showPercentToggle: this.props.showPercentToggle }),
8422
8551
  React__namespace.createElement(reactCollapse.Collapse, { isOpened: this.controlsConfig.legendShown }, this.props.legend || React__namespace.createElement(DefaultLollipopPlotLegend, null)),
8423
8552
  React__namespace.createElement(LollipopPlot, { sequence: this.sequence, lollipops: this.lollipops, domains: this.domains, dataStore: this.props.store.dataStore, vizWidth: this.props.geneWidth, vizHeight: this.props.vizHeight, hugoGeneSymbol: this.hugoGeneSymbol, xMax: this.proteinLength, yMax: this.yMaxInput, yMaxFractionDigits: this.yMaxSliderStep < 1
8424
8553
  ? this.props.yMaxFractionDigits
@@ -8530,118 +8659,6 @@ var LollipopMutationPlot = /** @class */ (function (_super) {
8530
8659
  return LollipopMutationPlot;
8531
8660
  }(React__namespace.Component));
8532
8661
 
8533
- exports.AxisScale = void 0;
8534
- (function (AxisScale) {
8535
- AxisScale["PERCENT"] = "%";
8536
- AxisScale["COUNT"] = "#";
8537
- })(exports.AxisScale || (exports.AxisScale = {}));
8538
- var AxisScaleSwitch = /** @class */ (function (_super) {
8539
- tslib.__extends(AxisScaleSwitch, _super);
8540
- function AxisScaleSwitch(props) {
8541
- var _this = _super.call(this, props) || this;
8542
- Object.defineProperty(_this, "selectedScale", {
8543
- enumerable: true,
8544
- configurable: true,
8545
- writable: true,
8546
- value: void 0
8547
- });
8548
- _this.selectedScale = props.selectedScale;
8549
- mobx.makeObservable(_this);
8550
- return _this;
8551
- }
8552
- Object.defineProperty(AxisScaleSwitch.prototype, "toggleButton", {
8553
- enumerable: false,
8554
- configurable: true,
8555
- writable: true,
8556
- value: function (scale, onClick) {
8557
- return (React__namespace.createElement("button", { className: classNames__default["default"]({
8558
- 'btn-secondary': this.props.selectedScale === scale,
8559
- 'btn-outline-secondary': this.props.selectedScale !== scale,
8560
- }, 'btn', 'btn-sm', 'btn-axis-switch'), style: {
8561
- lineHeight: 1,
8562
- cursor: this.props.selectedScale === scale
8563
- ? 'default'
8564
- : 'pointer',
8565
- fontWeight: this.props.selectedScale === scale
8566
- ? 'bolder'
8567
- : 'normal',
8568
- color: this.props.selectedScale === scale ? '#fff' : '#6c757d',
8569
- backgroundColor: this.props.selectedScale === scale ? '#6c757d' : '#fff',
8570
- borderColor: '#6c757d',
8571
- }, onClick: onClick }, scale));
8572
- }
8573
- });
8574
- Object.defineProperty(AxisScaleSwitch.prototype, "render", {
8575
- enumerable: false,
8576
- configurable: true,
8577
- writable: true,
8578
- value: function () {
8579
- return (React__namespace.createElement(reactBootstrap.ButtonGroup, { "aria-label": "" },
8580
- this.toggleButton(exports.AxisScale.PERCENT, this.handlePercentClick),
8581
- this.toggleButton(exports.AxisScale.COUNT, this.handleCountClick)));
8582
- }
8583
- });
8584
- Object.defineProperty(AxisScaleSwitch.prototype, "handlePercentClick", {
8585
- enumerable: false,
8586
- configurable: true,
8587
- writable: true,
8588
- value: function () {
8589
- this.selectedScale = exports.AxisScale.PERCENT;
8590
- this.props.onChange(this.selectedScale);
8591
- }
8592
- });
8593
- Object.defineProperty(AxisScaleSwitch.prototype, "handleCountClick", {
8594
- enumerable: false,
8595
- configurable: true,
8596
- writable: true,
8597
- value: function () {
8598
- this.selectedScale = exports.AxisScale.COUNT;
8599
- this.props.onChange(this.selectedScale);
8600
- }
8601
- });
8602
- Object.defineProperty(AxisScaleSwitch, "defaultProps", {
8603
- enumerable: true,
8604
- configurable: true,
8605
- writable: true,
8606
- value: {
8607
- selectedScale: exports.AxisScale.COUNT,
8608
- }
8609
- });
8610
- tslib.__decorate([
8611
- mobx.observable
8612
- ], AxisScaleSwitch.prototype, "selectedScale", void 0);
8613
- tslib.__decorate([
8614
- mobx.action.bound
8615
- ], AxisScaleSwitch.prototype, "handlePercentClick", null);
8616
- tslib.__decorate([
8617
- mobx.action.bound
8618
- ], AxisScaleSwitch.prototype, "handleCountClick", null);
8619
- AxisScaleSwitch = tslib.__decorate([
8620
- mobxReact.observer
8621
- ], AxisScaleSwitch);
8622
- return AxisScaleSwitch;
8623
- }(React__namespace.Component));
8624
-
8625
- var PercentToggle = /** @class */ (function (_super) {
8626
- tslib.__extends(PercentToggle, _super);
8627
- function PercentToggle(props) {
8628
- return _super.call(this, props) || this;
8629
- }
8630
- Object.defineProperty(PercentToggle.prototype, "render", {
8631
- enumerable: false,
8632
- configurable: true,
8633
- writable: true,
8634
- value: function () {
8635
- return (React__namespace.createElement("div", { className: "small", style: { display: 'flex', alignItems: 'center' } },
8636
- React__namespace.createElement("span", { style: { marginLeft: 10, marginRight: 10 } },
8637
- "Y-Axis:",
8638
- ' '),
8639
- React__namespace.createElement(AxisScaleSwitch, { selectedScale: this.props.axisMode, onChange: this.props.onScaleToggle })));
8640
- }
8641
- });
8642
- return PercentToggle;
8643
- }(React__namespace.Component));
8644
-
8645
8662
  var LollipopTooltipCountInfo = function (_a) {
8646
8663
  var count = _a.count, mutations = _a.mutations, axisMode = _a.axisMode;
8647
8664
  var decimalZeros = cbioportalUtils.numberOfLeadingDecimalZeros(count);