gifted-charts-core 0.1.57 → 0.1.58

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.
@@ -39,7 +39,7 @@ import { AxesAndRulesDefaults, BarDefaults } from '../../utils/constants';
39
39
  import { computeMaxAndMinItems } from '../../utils';
40
40
  export var useBarAndLineChartsWrapper = function (props) {
41
41
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19;
42
- var chartType = props.chartType, containerHeight = props.containerHeight, noOfSectionsBelowXAxis = props.noOfSectionsBelowXAxis, sectionColors = props.sectionColors, stepHeight = props.stepHeight, negativeStepHeight = props.negativeStepHeight, labelsExtraHeight = props.labelsExtraHeight, yAxisLabelWidth = props.yAxisLabelWidth, horizontal = props.horizontal, rtl = props.rtl, shiftX = props.shiftX, shiftY = props.shiftY, initialSpacing = props.initialSpacing, data = props.data, dataSet = props.dataSet, stackData = props.stackData, secondaryData = props.secondaryData, barWidth = props.barWidth, xAxisThickness = props.xAxisThickness, totalWidth = props.totalWidth, spacing = props.spacing, lineConfig = props.lineConfig, lineConfig2 = props.lineConfig2, maxValue = props.maxValue, lineData = props.lineData, lineData2 = props.lineData2, animatedWidth = props.animatedWidth, lineBehindBars = props.lineBehindBars, points = props.points, points2 = props.points2, arrowPoints = props.arrowPoints, width = props.width, horizSections = props.horizSections, endSpacing = props.endSpacing, horizontalRulesStyle = props.horizontalRulesStyle, noOfSections = props.noOfSections, showFractionalValues = props.showFractionalValues, axesAndRulesProps = props.axesAndRulesProps, yAxisLabelTexts = props.yAxisLabelTexts, yAxisOffset = props.yAxisOffset, rotateYAxisTexts = props.rotateYAxisTexts, pointerConfig = props.pointerConfig, getPointerProps = props.getPointerProps, pointerIndex = props.pointerIndex, pointerX = props.pointerX, pointerY = props.pointerY, scrollEventThrottle = props.scrollEventThrottle, endReachedOffset = props.endReachedOffset, isRTL = props.isRTL, selectedIndex = props.selectedIndex, onlyPositive = props.onlyPositive;
42
+ var chartType = props.chartType, containerHeight = props.containerHeight, noOfSectionsBelowXAxis = props.noOfSectionsBelowXAxis, sectionColors = props.sectionColors, stepHeight = props.stepHeight, negativeStepHeight = props.negativeStepHeight, labelsExtraHeight = props.labelsExtraHeight, yAxisLabelWidth = props.yAxisLabelWidth, horizontal = props.horizontal, rtl = props.rtl, shiftX = props.shiftX, shiftY = props.shiftY, initialSpacing = props.initialSpacing, data = props.data, dataSet = props.dataSet, stackData = props.stackData, secondaryData = props.secondaryData, barWidth = props.barWidth, xAxisThickness = props.xAxisThickness, totalWidth = props.totalWidth, spacing = props.spacing, lineConfig = props.lineConfig, lineConfig2 = props.lineConfig2, maxValue = props.maxValue, lineData = props.lineData, lineData2 = props.lineData2, animatedWidth = props.animatedWidth, lineBehindBars = props.lineBehindBars, points = props.points, points2 = props.points2, arrowPoints = props.arrowPoints, width = props.width, horizSections = props.horizSections, endSpacing = props.endSpacing, horizontalRulesStyle = props.horizontalRulesStyle, noOfSections = props.noOfSections, showFractionalValues = props.showFractionalValues, axesAndRulesProps = props.axesAndRulesProps, yAxisLabelTexts = props.yAxisLabelTexts, yAxisOffset = props.yAxisOffset, rotateYAxisTexts = props.rotateYAxisTexts, pointerConfig = props.pointerConfig, getPointerProps = props.getPointerProps, pointerIndex = props.pointerIndex, pointerX = props.pointerX, pointerY = props.pointerY, scrollEventThrottle = props.scrollEventThrottle, endReachedOffset = props.endReachedOffset, isRTL = props.isRTL, selectedIndex = props.selectedIndex, onlyPositive = props.onlyPositive, highlightEnabled = props.highlightEnabled, lowlightOpacity = props.lowlightOpacity;
43
43
  var yAxisAtTop = rtl ? !props.yAxisAtTop : props.yAxisAtTop;
44
44
  var hideOrigin = (_a = axesAndRulesProps.hideOrigin) !== null && _a !== void 0 ? _a : AxesAndRulesDefaults.hideOrigin;
45
45
  var yAxisSide = (_b = axesAndRulesProps.yAxisSide) !== null && _b !== void 0 ? _b : AxesAndRulesDefaults.yAxisSide;
@@ -204,7 +204,9 @@ export var useBarAndLineChartsWrapper = function (props) {
204
204
  yAxisOffset: (lineConfig === null || lineConfig === void 0 ? void 0 : lineConfig.isSecondary)
205
205
  ? (_16 = secondaryYAxis === null || secondaryYAxis === void 0 ? void 0 : secondaryYAxis.yAxisOffset) !== null && _16 !== void 0 ? _16 : 0
206
206
  : yAxisOffset !== null && yAxisOffset !== void 0 ? yAxisOffset : 0,
207
- strokeDashArray: (_17 = lineConfig === null || lineConfig === void 0 ? void 0 : lineConfig.strokeDashArray) !== null && _17 !== void 0 ? _17 : [0, 0]
207
+ strokeDashArray: (_17 = lineConfig === null || lineConfig === void 0 ? void 0 : lineConfig.strokeDashArray) !== null && _17 !== void 0 ? _17 : [0, 0],
208
+ highlightEnabled: highlightEnabled,
209
+ lowlightOpacity: lowlightOpacity
208
210
  };
209
211
  var lineInBarChartProps2 = __assign(__assign({}, lineInBarChartProps), { lineConfig: lineConfig2, points: points2, data: lineData2 !== null && lineData2 !== void 0 ? lineData2 : [], yAxisOffset: (lineConfig2 === null || lineConfig2 === void 0 ? void 0 : lineConfig2.isSecondary)
210
212
  ? (_18 = secondaryYAxis === null || secondaryYAxis === void 0 ? void 0 : secondaryYAxis.yAxisOffset) !== null && _18 !== void 0 ? _18 : 0
@@ -120,6 +120,9 @@ export declare const BarDefaults: {
120
120
  focusedBarSideColor: string;
121
121
  focusedBarTopColor: string;
122
122
  renderTooltipConditions: string[];
123
+ highlightEnabled: boolean;
124
+ lowlightOpacity: number;
125
+ stackHighlightEnabled: boolean;
123
126
  };
124
127
  export declare const LineDefaults: {
125
128
  color: string;
@@ -168,6 +171,8 @@ export declare const LineDefaults: {
168
171
  edgePosition: EdgePosition;
169
172
  endReachedOffset: number;
170
173
  strokeLinecap: Linecap;
174
+ highlightEnabled: boolean;
175
+ lowlightOpacity: number;
171
176
  };
172
177
  export declare const defaultLineConfig: defaultLineConfigType;
173
178
  export declare const defaultPointerConfig: {
@@ -130,7 +130,10 @@ export var BarDefaults = {
130
130
  focusedThreeDBarFrontColor: '#B0B929',
131
131
  focusedBarSideColor: '#776913',
132
132
  focusedBarTopColor: '#C8D565',
133
- renderTooltipConditions: ['onClick', 'onHover']
133
+ renderTooltipConditions: ['onClick', 'onHover'],
134
+ highlightEnabled: false,
135
+ lowlightOpacity: 0.3,
136
+ stackHighlightEnabled: false
134
137
  };
135
138
  // Line chart specific
136
139
  export var LineDefaults = {
@@ -179,7 +182,9 @@ export var LineDefaults = {
179
182
  delayBeforeUnFocus: 300,
180
183
  edgePosition: EdgePosition.AFTER_DATA_POINT,
181
184
  endReachedOffset: defaultEndReachedOffset,
182
- strokeLinecap: 'butt'
185
+ strokeLinecap: 'butt',
186
+ highlightEnabled: false,
187
+ lowlightOpacity: 0.3
183
188
  };
184
189
  export var defaultLineConfig = {
185
190
  initialSpacing: BarDefaults.spacing, // gets updated to spacing before being used
@@ -150,6 +150,8 @@ export interface LineInBarChartPropsType {
150
150
  selectedIndex: number;
151
151
  yAxisOffset: number;
152
152
  strokeDashArray: number[];
153
+ highlightEnabled: boolean;
154
+ lowlightOpacity: number;
153
155
  }
154
156
  export interface DataPointProps {
155
157
  data: any[];
@@ -162,6 +164,7 @@ export interface DataPointProps {
162
164
  spacing: number;
163
165
  selectedIndex: number;
164
166
  yAxisOffset: number;
167
+ opacity: number;
165
168
  }
166
169
  export interface referenceConfigType {
167
170
  thickness?: number;
@@ -335,6 +338,8 @@ export interface BarAndLineChartsWrapperTypes {
335
338
  dataSet?: DataSetNullSafe[];
336
339
  customBackground?: CustomBackground;
337
340
  onlyPositive?: boolean;
341
+ highlightEnabled: boolean;
342
+ lowlightOpacity: number;
338
343
  }
339
344
  export interface HorizontalStripConfig {
340
345
  thickness?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gifted-charts-core",
3
- "version": "0.1.57",
3
+ "version": "0.1.58",
4
4
  "description": "Mathematical and logical utilities used by react-gifted-charts and react-native-gifted-charts",
5
5
  "main": "./dist/index.js",
6
6
  "files": [