react-mutation-mapper 0.8.61 → 0.8.63

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.
@@ -25,7 +25,7 @@ export declare type LollipopMutationPlotProps<T extends Mutation> = {
25
25
  bottomYAxisDefaultMax?: number;
26
26
  bottomYAxisDefaultMin?: number;
27
27
  yAxisLabelPadding?: number;
28
- lollipopTooltipCountInfo?: (count: number, mutations?: Partial<T>[], axisMode?: AxisScale) => JSX.Element;
28
+ lollipopTooltipCountInfo?: (count: number, mutations?: Partial<T>[], axisMode?: AxisScale, group?: string) => JSX.Element;
29
29
  yAxisLabelFormatter?: (symbol?: string, groupName?: string) => string;
30
30
  axisMode?: AxisScale;
31
31
  customControls?: JSX.Element;
package/dist/index.es.js CHANGED
@@ -16,6 +16,7 @@ import 'rc-tooltip/assets/bootstrap_white.css';
16
16
  import Select, { components } from 'react-select';
17
17
  import $ from 'jquery';
18
18
  import { Collapse } from 'react-collapse';
19
+ import numeral from 'numeral';
19
20
  import Slider from 'react-rangeslider';
20
21
  import 'react-rangeslider/lib/index.css';
21
22
  import oncoKbImg from 'oncokb-styles/dist/images/oncogenic.svg';
@@ -4171,8 +4172,8 @@ function calcYMaxInput(yMaxInput, yMaxStep, countRange, oppositeCountRange, yAxi
4171
4172
  var input = yMaxInput;
4172
4173
  if (input === undefined) {
4173
4174
  input = yAxisSameScale
4174
- ? getCommonYAxisMaxSliderValue(yMaxStep, countRange, oppositeCountRange)
4175
- : getYAxisMaxSliderValue(yMaxStep, countRange);
4175
+ ? numeral(numeral(getCommonYAxisMaxSliderValue(yMaxStep, countRange, oppositeCountRange)).format(String(yMaxStep))).value()
4176
+ : numeral(numeral(getYAxisMaxSliderValue(yMaxStep, countRange)).format(String(yMaxStep))).value();
4176
4177
  }
4177
4178
  return input;
4178
4179
  }
@@ -4202,7 +4203,9 @@ function calcCountRange(lollipops, defaultMax, defaultMin) {
4202
4203
  for (var _i = 0, lollipops_1 = lollipops; _i < lollipops_1.length; _i++) {
4203
4204
  var lollipop = lollipops_1[_i];
4204
4205
  max = Math.max(max, lollipop.count);
4205
- min = Math.min(min, lollipop.count);
4206
+ min = Number.isInteger(lollipop.count)
4207
+ ? Math.min(min, lollipop.count)
4208
+ : Math.min(0.1, lollipop.count);
4206
4209
  }
4207
4210
  return [min, Math.max(min, max)];
4208
4211
  }
@@ -7851,10 +7854,10 @@ var LollipopMutationPlot = /** @class */ (function (_super) {
7851
7854
  enumerable: false,
7852
7855
  configurable: true,
7853
7856
  writable: true,
7854
- value: function (mutationsAtPosition, countsByPosition) {
7857
+ value: function (mutationsAtPosition, countsByPosition, group) {
7855
7858
  var codon = mutationsAtPosition[0].proteinPosStart;
7856
7859
  var count = countsByPosition[codon];
7857
- var countInfo = this.props.lollipopTooltipCountInfo ? (this.props.lollipopTooltipCountInfo(count, mutationsAtPosition, this.props.axisMode)) : (React.createElement("strong", null,
7860
+ var countInfo = this.props.lollipopTooltipCountInfo ? (this.props.lollipopTooltipCountInfo(count, mutationsAtPosition, this.props.axisMode, group)) : (React.createElement("strong", null,
7858
7861
  count,
7859
7862
  " mutation", "" + (count !== 1 ? 's' : '')));
7860
7863
  var label = lollipopLabelText(mutationsAtPosition);
@@ -7952,7 +7955,7 @@ var LollipopMutationPlot = /** @class */ (function (_super) {
7952
7955
  group: group,
7953
7956
  placement: placement,
7954
7957
  count: mutationCount,
7955
- tooltip: _this.lollipopTooltip(mutations, countsByPosition),
7958
+ tooltip: _this.lollipopTooltip(mutations, countsByPosition, group),
7956
7959
  color: _this.props.getLollipopColor
7957
7960
  ? _this.props.getLollipopColor(mutations)
7958
7961
  : getColorForProteinImpactType(mutations, DEFAULT_PROTEIN_IMPACT_TYPE_COLORS, _this.props.getMutationCount, _this.props.isPutativeDriver),