gifted-charts-core 0.1.56 → 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.
@@ -322,6 +322,13 @@ export interface LineChartPropsType {
322
322
  onBackgroundPress?: (event: GestureResponderEvent) => void;
323
323
  secondaryXAxis?: XAxisConfig;
324
324
  intersectionAreaConfig?: IntersectionAreaConfig;
325
+ renderTooltip?: Function;
326
+ renderTooltip1?: Function;
327
+ renderTooltip2?: Function;
328
+ renderTooltip3?: Function;
329
+ renderTooltip4?: Function;
330
+ renderTooltip5?: Function;
331
+ renderTooltipSecondary?: Function;
325
332
  }
326
333
  export interface lineDataItem {
327
334
  value?: number;
@@ -370,6 +377,9 @@ export interface lineDataItem {
370
377
  pointerShiftX?: number;
371
378
  pointerShiftY?: number;
372
379
  onPress?: Function;
380
+ onContextMenu?: Function;
381
+ onMouseEnter?: Function;
382
+ onMouseLeave?: Function;
373
383
  showXAxisIndex?: boolean;
374
384
  hidePointer?: boolean;
375
385
  }
@@ -419,6 +429,9 @@ export interface bicolorLineDataItem {
419
429
  pointerShiftX?: number;
420
430
  pointerShiftY?: number;
421
431
  onPress?: Function;
432
+ onContextMenu?: Function;
433
+ onMouseEnter?: Function;
434
+ onMouseLeave?: Function;
422
435
  }
423
436
  export interface LineChartBicolorPropsType {
424
437
  height?: number;
@@ -566,6 +579,16 @@ export interface LineChartBicolorPropsType {
566
579
  endReachedOffset?: number;
567
580
  parentWidth?: number;
568
581
  }
582
+ export interface LineChartPropsTypeForWeb extends LineChartPropsType {
583
+ onContextMenu?: Function;
584
+ onMouseEnter?: Function;
585
+ onMouseLeave?: Function;
586
+ }
587
+ export interface LineChartBicolorPropsTypeForWeb extends LineChartBicolorPropsType {
588
+ onContextMenu?: Function;
589
+ onMouseEnter?: Function;
590
+ onMouseLeave?: Function;
591
+ }
569
592
  export interface IDataSanitisationProps {
570
593
  showDataPointsForMissingValues: boolean | undefined;
571
594
  interpolateMissingValues: boolean;
@@ -69,6 +69,7 @@ export declare const useRadarChart: (props: RadarChartProps) => {
69
69
  angleStep: number;
70
70
  circular: boolean;
71
71
  hideGrid: boolean;
72
+ hideLabels: boolean;
72
73
  hideAsterLines: boolean;
73
74
  getGridLevelProps: (gridItem: GridConfig, ind: number) => {
74
75
  level: number;
@@ -37,7 +37,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
37
37
  import { radarChartDefaults } from '../utils/constants';
38
38
  export var useRadarChart = function (props) {
39
39
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
40
- var _u = props.circular, circular = _u === void 0 ? false : _u, _v = props.gridConfig, gridConfig = _v === void 0 ? {} : _v, _w = props.polygonConfig, polygonConfig = _w === void 0 ? {} : _w, _x = props.data, data = _x === void 0 ? [] : _x, dataSet = props.dataSet, _y = props.noOfSections, noOfSections = _y === void 0 ? radarChartDefaults.noOfSections : _y, _z = props.chartSize, chartSize = _z === void 0 ? radarChartDefaults.chartSize : _z, _0 = props.labelConfig, labelConfig = _0 === void 0 ? {} : _0, labelConfigArray = props.labelConfigArray, _1 = props.asterLinesConfig, asterLinesConfig = _1 === void 0 ? {} : _1, _2 = props.hideGrid, hideGrid = _2 === void 0 ? radarChartDefaults.hideGrid : _2, _3 = props.hideAsterLines, hideAsterLines = _3 === void 0 ? (_a = props.hideGrid) !== null && _a !== void 0 ? _a : radarChartDefaults.hideAsterLines : _3, _4 = props.dataLabelsConfig, dataLabelsConfig = _4 === void 0 ? {} : _4, _5 = props.labelsPositionOffset, labelsPositionOffset = _5 === void 0 ? radarChartDefaults.labelsPositionOffset : _5, _6 = props.dataLabelsPositionOffset, dataLabelsPositionOffset = _6 === void 0 ? radarChartDefaults.dataLabelsPositionOffset : _6, _7 = props.isAnimated, isAnimated = _7 === void 0 ? radarChartDefaults.isAnimated : _7, _8 = props.animationDuration, animationDuration = _8 === void 0 ? radarChartDefaults.animationDuration : _8, _9 = props.animateTogether, animateTogether = _9 === void 0 ? radarChartDefaults.animateTogether : _9;
40
+ var _u = props.circular, circular = _u === void 0 ? false : _u, _v = props.gridConfig, gridConfig = _v === void 0 ? {} : _v, _w = props.polygonConfig, polygonConfig = _w === void 0 ? {} : _w, _x = props.data, data = _x === void 0 ? [] : _x, dataSet = props.dataSet, _y = props.noOfSections, noOfSections = _y === void 0 ? radarChartDefaults.noOfSections : _y, _z = props.chartSize, chartSize = _z === void 0 ? radarChartDefaults.chartSize : _z, _0 = props.labelConfig, labelConfig = _0 === void 0 ? {} : _0, labelConfigArray = props.labelConfigArray, _1 = props.asterLinesConfig, asterLinesConfig = _1 === void 0 ? {} : _1, _2 = props.hideGrid, hideGrid = _2 === void 0 ? radarChartDefaults.hideGrid : _2, _3 = props.hideLabels, hideLabels = _3 === void 0 ? radarChartDefaults.hideLabels : _3, _4 = props.hideAsterLines, hideAsterLines = _4 === void 0 ? (_a = props.hideGrid) !== null && _a !== void 0 ? _a : radarChartDefaults.hideAsterLines : _4, _5 = props.dataLabelsConfig, dataLabelsConfig = _5 === void 0 ? {} : _5, _6 = props.labelsPositionOffset, labelsPositionOffset = _6 === void 0 ? radarChartDefaults.labelsPositionOffset : _6, _7 = props.dataLabelsPositionOffset, dataLabelsPositionOffset = _7 === void 0 ? radarChartDefaults.dataLabelsPositionOffset : _7, _8 = props.isAnimated, isAnimated = _8 === void 0 ? radarChartDefaults.isAnimated : _8, _9 = props.animationDuration, animationDuration = _9 === void 0 ? radarChartDefaults.animationDuration : _9, _10 = props.animateTogether, animateTogether = _10 === void 0 ? radarChartDefaults.animateTogether : _10;
41
41
  var labels = (_e = (_b = props.labels) !== null && _b !== void 0 ? _b : (_d = ((_c = dataSet === null || dataSet === void 0 ? void 0 : dataSet[0]) !== null && _c !== void 0 ? _c : data)) === null || _d === void 0 ? void 0 : _d.map(function (_, index) { return "Label".concat(index + 1); })) !== null && _e !== void 0 ? _e : [];
42
42
  var getMax = function (dataSet) {
43
43
  return dataSet.reduce(function (acc, set) {
@@ -58,31 +58,31 @@ export var useRadarChart = function (props) {
58
58
  };
59
59
  var center = chartSize / 2;
60
60
  var radius = center * 0.8;
61
- var _10 = gridConfig.stroke, gridStroke = _10 === void 0 ? radarChartDefaults.gridSection.stroke : _10, _11 = gridConfig.strokeWidth, gridStrokeWidth = _11 === void 0 ? radarChartDefaults.gridSection.strokeWidth : _11, _12 = gridConfig.strokeDashArray, gridStrokeDashArray = _12 === void 0 ? radarChartDefaults.gridSection
62
- .strokeDashArray : _12, _13 = gridConfig.fill, gridFill = _13 === void 0 ? radarChartDefaults.gridSection.fill : _13, _14 = gridConfig.gradientColor, gridGradientColor = _14 === void 0 ? radarChartDefaults.gridSection
63
- .gradientColor : _14, _15 = gridConfig.showGradient, gridShowGradient = _15 === void 0 ? radarChartDefaults.gridSection
64
- .showGradient : _15, _16 = gridConfig.opacity, gridOpacity = _16 === void 0 ? radarChartDefaults.gridSection.opacity : _16, _17 = gridConfig.gradientOpacity, gridGradientOpacity = _17 === void 0 ? radarChartDefaults.gridSection
65
- .gradientOpacity : _17;
61
+ var _11 = gridConfig.stroke, gridStroke = _11 === void 0 ? radarChartDefaults.gridSection.stroke : _11, _12 = gridConfig.strokeWidth, gridStrokeWidth = _12 === void 0 ? radarChartDefaults.gridSection.strokeWidth : _12, _13 = gridConfig.strokeDashArray, gridStrokeDashArray = _13 === void 0 ? radarChartDefaults.gridSection
62
+ .strokeDashArray : _13, _14 = gridConfig.fill, gridFill = _14 === void 0 ? radarChartDefaults.gridSection.fill : _14, _15 = gridConfig.gradientColor, gridGradientColor = _15 === void 0 ? radarChartDefaults.gridSection
63
+ .gradientColor : _15, _16 = gridConfig.showGradient, gridShowGradient = _16 === void 0 ? radarChartDefaults.gridSection
64
+ .showGradient : _16, _17 = gridConfig.opacity, gridOpacity = _17 === void 0 ? radarChartDefaults.gridSection.opacity : _17, _18 = gridConfig.gradientOpacity, gridGradientOpacity = _18 === void 0 ? radarChartDefaults.gridSection
65
+ .gradientOpacity : _18;
66
66
  var gridSections = (_j = (_h = gridConfig.gridSections) === null || _h === void 0 ? void 0 : _h.map(function (i) { return (__assign(__assign({}, radarChartDefaults.gridSection), i)); })) !== null && _j !== void 0 ? _j : Array(noOfSections).fill({});
67
- var _18 = labelConfig.fontSize, fontSize = _18 === void 0 ? radarChartDefaults.labelConfig.fontSize : _18, _19 = labelConfig.stroke, stroke = _19 === void 0 ? radarChartDefaults.labelConfig.stroke : _19, _20 = labelConfig.textAnchor, textAnchor = _20 === void 0 ? radarChartDefaults.labelConfig.textAnchor : _20, _21 = labelConfig.alignmentBaseline, alignmentBaseline = _21 === void 0 ? radarChartDefaults.labelConfig.alignmentBaseline : _21, _22 = labelConfig.fontWeight, fontWeight = _22 === void 0 ? radarChartDefaults.labelConfig.fontWeight : _22, _23 = labelConfig.fontFamily, fontFamily = _23 === void 0 ? radarChartDefaults.labelConfig.fontFamily : _23;
68
- var _24 = dataLabelsConfig.fontSize, dataLabelsFontSize = _24 === void 0 ? fontSize : _24, // defaults to labelConfig (from above)
69
- _25 = dataLabelsConfig.stroke, // defaults to labelConfig (from above)
70
- dataLabelsColor = _25 === void 0 ? stroke : _25, // defaults to labelConfig (from above)
71
- _26 = dataLabelsConfig.textAnchor, // defaults to labelConfig (from above)
72
- dataLabelsTextAnchor = _26 === void 0 ? textAnchor : _26, // defaults to labelConfig (from above)
73
- _27 = dataLabelsConfig.alignmentBaseline, // defaults to labelConfig (from above)
74
- dataLabelsAlignmentBaseline = _27 === void 0 ? alignmentBaseline : _27, // defaults to labelConfig (from above)
75
- _28 = dataLabelsConfig.fontWeight, // defaults to labelConfig (from above)
76
- dataLabelsFontWeight = _28 === void 0 ? fontWeight : _28, // defaults to labelConfig (from above)
77
- _29 = dataLabelsConfig.fontFamily // defaults to labelConfig (from above)
67
+ var _19 = labelConfig.fontSize, fontSize = _19 === void 0 ? radarChartDefaults.labelConfig.fontSize : _19, _20 = labelConfig.stroke, stroke = _20 === void 0 ? radarChartDefaults.labelConfig.stroke : _20, _21 = labelConfig.textAnchor, textAnchor = _21 === void 0 ? radarChartDefaults.labelConfig.textAnchor : _21, _22 = labelConfig.alignmentBaseline, alignmentBaseline = _22 === void 0 ? radarChartDefaults.labelConfig.alignmentBaseline : _22, _23 = labelConfig.fontWeight, fontWeight = _23 === void 0 ? radarChartDefaults.labelConfig.fontWeight : _23, _24 = labelConfig.fontFamily, fontFamily = _24 === void 0 ? radarChartDefaults.labelConfig.fontFamily : _24;
68
+ var _25 = dataLabelsConfig.fontSize, dataLabelsFontSize = _25 === void 0 ? fontSize : _25, // defaults to labelConfig (from above)
69
+ _26 = dataLabelsConfig.stroke, // defaults to labelConfig (from above)
70
+ dataLabelsColor = _26 === void 0 ? stroke : _26, // defaults to labelConfig (from above)
71
+ _27 = dataLabelsConfig.textAnchor, // defaults to labelConfig (from above)
72
+ dataLabelsTextAnchor = _27 === void 0 ? textAnchor : _27, // defaults to labelConfig (from above)
73
+ _28 = dataLabelsConfig.alignmentBaseline, // defaults to labelConfig (from above)
74
+ dataLabelsAlignmentBaseline = _28 === void 0 ? alignmentBaseline : _28, // defaults to labelConfig (from above)
75
+ _29 = dataLabelsConfig.fontWeight, // defaults to labelConfig (from above)
76
+ dataLabelsFontWeight = _29 === void 0 ? fontWeight : _29, // defaults to labelConfig (from above)
77
+ _30 = dataLabelsConfig.fontFamily // defaults to labelConfig (from above)
78
78
  , // defaults to labelConfig (from above)
79
- dataLabelsFontFamily = _29 === void 0 ? fontFamily : _29 // defaults to labelConfig (from above)
79
+ dataLabelsFontFamily = _30 === void 0 ? fontFamily : _30 // defaults to labelConfig (from above)
80
80
  ;
81
- var _30 = polygonConfig.stroke, polygonStroke = _30 === void 0 ? radarChartDefaults.polygonConfig.stroke : _30, _31 = polygonConfig.strokeWidth, polygonStrokeWidth = _31 === void 0 ? radarChartDefaults.polygonConfig
82
- .strokeWidth : _31, _32 = polygonConfig.strokeDashArray, polygonStrokeDashArray = _32 === void 0 ? radarChartDefaults.polygonConfig
83
- .strokeDashArray : _32, _33 = polygonConfig.fill, polygonFill = _33 === void 0 ? radarChartDefaults.polygonConfig.fill : _33, _34 = polygonConfig.gradientColor, polygonGradientColor = _34 === void 0 ? radarChartDefaults.polygonConfig
84
- .gradientColor : _34, _35 = polygonConfig.showGradient, polygonShowGradient = _35 === void 0 ? radarChartDefaults.polygonConfig
85
- .showGradient : _35, _36 = polygonConfig.opacity, polygonOpacity = _36 === void 0 ? radarChartDefaults.polygonConfig.opacity : _36, _37 = polygonConfig.gradientOpacity, polygonGradientOpacity = _37 === void 0 ? polygonOpacity : _37, showDataValuesAsLabels = polygonConfig.showDataValuesAsLabels, _38 = polygonConfig.isAnimated, polygonIsAnimated = _38 === void 0 ? isAnimated : _38, _39 = polygonConfig.animationDuration, polygonAnimationDuration = _39 === void 0 ? animationDuration : _39;
81
+ var _31 = polygonConfig.stroke, polygonStroke = _31 === void 0 ? radarChartDefaults.polygonConfig.stroke : _31, _32 = polygonConfig.strokeWidth, polygonStrokeWidth = _32 === void 0 ? radarChartDefaults.polygonConfig
82
+ .strokeWidth : _32, _33 = polygonConfig.strokeDashArray, polygonStrokeDashArray = _33 === void 0 ? radarChartDefaults.polygonConfig
83
+ .strokeDashArray : _33, _34 = polygonConfig.fill, polygonFill = _34 === void 0 ? radarChartDefaults.polygonConfig.fill : _34, _35 = polygonConfig.gradientColor, polygonGradientColor = _35 === void 0 ? radarChartDefaults.polygonConfig
84
+ .gradientColor : _35, _36 = polygonConfig.showGradient, polygonShowGradient = _36 === void 0 ? radarChartDefaults.polygonConfig
85
+ .showGradient : _36, _37 = polygonConfig.opacity, polygonOpacity = _37 === void 0 ? radarChartDefaults.polygonConfig.opacity : _37, _38 = polygonConfig.gradientOpacity, polygonGradientOpacity = _38 === void 0 ? polygonOpacity : _38, showDataValuesAsLabels = polygonConfig.showDataValuesAsLabels, _39 = polygonConfig.isAnimated, polygonIsAnimated = _39 === void 0 ? isAnimated : _39, _40 = polygonConfig.animationDuration, polygonAnimationDuration = _40 === void 0 ? animationDuration : _40;
86
86
  var polygonConfigArray = (_l = (_k = props.polygonConfigArray) === null || _k === void 0 ? void 0 : _k.map(function (set) {
87
87
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
88
88
  return ({
@@ -147,7 +147,7 @@ export var useRadarChart = function (props) {
147
147
  });
148
148
  });
149
149
  })) !== null && _r !== void 0 ? _r : (dataSet ? Array(dataSet.length).fill(dataLabelsConfigArray) : null);
150
- var _40 = asterLinesConfig.stroke, asterLinesStroke = _40 === void 0 ? gridStroke : _40, _41 = asterLinesConfig.strokeWidth, asterLinesStrokeWidth = _41 === void 0 ? gridStrokeWidth : _41, _42 = asterLinesConfig.strokeDashArray, asterLinesStrokeDashArray = _42 === void 0 ? radarChartDefaults.asterLineStrokeDashArray : _42;
150
+ var _41 = asterLinesConfig.stroke, asterLinesStroke = _41 === void 0 ? gridStroke : _41, _42 = asterLinesConfig.strokeWidth, asterLinesStrokeWidth = _42 === void 0 ? gridStrokeWidth : _42, _43 = asterLinesConfig.strokeDashArray, asterLinesStrokeDashArray = _43 === void 0 ? radarChartDefaults.asterLineStrokeDashArray : _43;
151
151
  // Calculate angles for each category
152
152
  var angleStep = 360 / labels.length;
153
153
  // Generate coordinates for the data points
@@ -276,6 +276,7 @@ export var useRadarChart = function (props) {
276
276
  angleStep: angleStep,
277
277
  circular: circular,
278
278
  hideGrid: hideGrid,
279
+ hideLabels: hideLabels,
279
280
  hideAsterLines: hideAsterLines,
280
281
  getGridLevelProps: getGridLevelProps,
281
282
  animateTogether: animateTogether
@@ -22,7 +22,6 @@ export interface RadarChartProps {
22
22
  labels?: string[];
23
23
  dataLabels?: string[];
24
24
  dataLabelsArray?: string[][];
25
- dataLabelConfig?: LabelConfig;
26
25
  dataLabelsConfigArray?: LabelConfig[];
27
26
  polygonConfig?: PolygonConfig;
28
27
  polygonConfigArray?: PolygonConfig[];
@@ -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
package/dist/index.d.ts CHANGED
@@ -5,13 +5,13 @@ export { useBarChart } from './BarChart';
5
5
  export { getPropsForAnimated2DWithGradient } from './BarChart/Animated2DWithGradient';
6
6
  export { useRenderStackBars } from './BarChart/RenderStackBars';
7
7
  export { useRenderBars } from './BarChart/RenderBars';
8
- export { type stackDataItem, type StackedBarChartPropsType, type BarChartPropsType, type defaultLineConfigType, type barDataItem, type barDataItemNullSafe, type Animated2DWithGradientPropsType, type RenderBarsPropsType, type trianglePropTypes, type animatedBarPropTypes, type FocusedBarConfig, type CommonPropsFor2dand3dBarsType } from './BarChart/types';
8
+ export { type stackDataItem, type StackedBarChartPropsType, type StackedBarChartPropsTypeForWeb, type BarChartPropsType, type defaultLineConfigType, type barDataItem, type barDataItemNullSafe, type Animated2DWithGradientPropsType, type RenderBarsPropsType, type trianglePropTypes, type animatedBarPropTypes, type FocusedBarConfig, type CommonPropsFor2dand3dBarsType } from './BarChart/types';
9
9
  /************************************************************************************************************************
10
10
  /***************************************** Line Chart *****************************************
11
11
  /************************************************************************************************************************/
12
12
  export { useLineChart } from './LineChart';
13
13
  export { useLineChartBiColor } from './LineChart/LineChartBiColor';
14
- export { type LineChartPropsType, type lineDataItem, type lineDataItemNullSafe, type bicolorLineDataItem, type LineChartBicolorPropsType } from './LineChart/types';
14
+ export { type LineChartPropsType, type LineChartPropsTypeForWeb, type lineDataItem, type lineDataItemNullSafe, type bicolorLineDataItem, type LineChartBicolorPropsType, type LineChartBicolorPropsTypeForWeb } from './LineChart/types';
15
15
  /***********************************************************************************************************************
16
16
  /***************************************** Pie Chart *****************************************
17
17
  /***********************************************************************************************************************/
@@ -119,6 +119,10 @@ export declare const BarDefaults: {
119
119
  focusedThreeDBarFrontColor: string;
120
120
  focusedBarSideColor: string;
121
121
  focusedBarTopColor: string;
122
+ renderTooltipConditions: string[];
123
+ highlightEnabled: boolean;
124
+ lowlightOpacity: number;
125
+ stackHighlightEnabled: boolean;
122
126
  };
123
127
  export declare const LineDefaults: {
124
128
  color: string;
@@ -167,6 +171,8 @@ export declare const LineDefaults: {
167
171
  edgePosition: EdgePosition;
168
172
  endReachedOffset: number;
169
173
  strokeLinecap: Linecap;
174
+ highlightEnabled: boolean;
175
+ lowlightOpacity: number;
170
176
  };
171
177
  export declare const defaultLineConfig: defaultLineConfigType;
172
178
  export declare const defaultPointerConfig: {
@@ -272,6 +278,7 @@ export declare const radarChartDefaults: {
272
278
  chartSize: number;
273
279
  hideAsterLines: boolean;
274
280
  hideGrid: boolean;
281
+ hideLabels: boolean;
275
282
  labelsPositionOffset: number;
276
283
  dataLabelsPositionOffset: number;
277
284
  gridSection: {
@@ -129,7 +129,11 @@ export var BarDefaults = {
129
129
  focusedBarFrontColor: 'lightgreen',
130
130
  focusedThreeDBarFrontColor: '#B0B929',
131
131
  focusedBarSideColor: '#776913',
132
- focusedBarTopColor: '#C8D565'
132
+ focusedBarTopColor: '#C8D565',
133
+ renderTooltipConditions: ['onClick', 'onHover'],
134
+ highlightEnabled: false,
135
+ lowlightOpacity: 0.3,
136
+ stackHighlightEnabled: false
133
137
  };
134
138
  // Line chart specific
135
139
  export var LineDefaults = {
@@ -178,7 +182,9 @@ export var LineDefaults = {
178
182
  delayBeforeUnFocus: 300,
179
183
  edgePosition: EdgePosition.AFTER_DATA_POINT,
180
184
  endReachedOffset: defaultEndReachedOffset,
181
- strokeLinecap: 'butt'
185
+ strokeLinecap: 'butt',
186
+ highlightEnabled: false,
187
+ lowlightOpacity: 0.3
182
188
  };
183
189
  export var defaultLineConfig = {
184
190
  initialSpacing: BarDefaults.spacing, // gets updated to spacing before being used
@@ -325,6 +331,7 @@ export var radarChartDefaults = {
325
331
  chartSize: 300,
326
332
  hideAsterLines: false,
327
333
  hideGrid: false,
334
+ hideLabels: false,
328
335
  labelsPositionOffset: 5,
329
336
  dataLabelsPositionOffset: 5,
330
337
  gridSection: {
@@ -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;
@@ -396,6 +401,13 @@ export interface Pointer {
396
401
  pointerEvents?: PointerEvents;
397
402
  stripBehindBars?: boolean;
398
403
  resetPointerOnDataChange?: boolean;
404
+ onTouchStart?: Function;
405
+ onTouchEnd?: Function;
406
+ onResponderGrant?: Function;
407
+ onResponderMove?: Function;
408
+ onResponderEnd?: Function;
409
+ onPointerEnter?: Function;
410
+ onPointerLeave?: Function;
399
411
  }
400
412
  export interface HighlightedRange {
401
413
  from: number;
@@ -458,6 +470,7 @@ export interface DataSet {
458
470
  isSecondary?: boolean;
459
471
  hidePointers?: boolean;
460
472
  spacing?: number;
473
+ renderTooltip?: Function;
461
474
  }
462
475
  export interface DataSetNullSafe extends DataSet {
463
476
  data: lineDataItemNullSafe[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gifted-charts-core",
3
- "version": "0.1.56",
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": [