gifted-charts-core 0.1.26 → 0.1.27

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.
@@ -48,8 +48,12 @@ export declare const useLineChart: (props: extendedLineChartPropsType) => {
48
48
  setPointerItem5: import("react").Dispatch<import("react").SetStateAction<lineDataItem | undefined>>;
49
49
  secondaryPointerY: number;
50
50
  setSecondaryPointerY: import("react").Dispatch<import("react").SetStateAction<number>>;
51
- secondaryPointerItem: undefined;
52
- setSecondaryPointerItem: import("react").Dispatch<import("react").SetStateAction<undefined>>;
51
+ secondaryPointerItem: lineDataItem | undefined;
52
+ setSecondaryPointerItem: import("react").Dispatch<import("react").SetStateAction<lineDataItem | undefined>>;
53
+ pointerItemsForSet: lineDataItem[];
54
+ setPointerItemsForSet: import("react").Dispatch<import("react").SetStateAction<lineDataItem[]>>;
55
+ secondaryPointerItemsForSet: lineDataItem[];
56
+ setSecondaryPointerItemsForSet: import("react").Dispatch<import("react").SetStateAction<lineDataItem[]>>;
53
57
  responderStartTime: number;
54
58
  setResponderStartTime: import("react").Dispatch<import("react").SetStateAction<number>>;
55
59
  responderActive: boolean;
@@ -65,24 +65,26 @@ export var useLineChart = function (props) {
65
65
  var _318 = __read(useState(), 2), pointerItem5 = _318[0], setPointerItem5 = _318[1];
66
66
  var _319 = __read(useState(0), 2), secondaryPointerY = _319[0], setSecondaryPointerY = _319[1];
67
67
  var _320 = __read(useState(), 2), secondaryPointerItem = _320[0], setSecondaryPointerItem = _320[1];
68
- var _321 = __read(useState(0), 2), responderStartTime = _321[0], setResponderStartTime = _321[1];
69
- var _322 = __read(useState(false), 2), responderActive = _322[0], setResponderActive = _322[1];
70
- var _323 = __read(useState(''), 2), points = _323[0], setPoints = _323[1];
71
- var _324 = __read(useState(''), 2), points2 = _324[0], setPoints2 = _324[1];
72
- var _325 = __read(useState(''), 2), points3 = _325[0], setPoints3 = _325[1];
73
- var _326 = __read(useState(''), 2), points4 = _326[0], setPoints4 = _326[1];
74
- var _327 = __read(useState(''), 2), points5 = _327[0], setPoints5 = _327[1];
75
- var _328 = __read(useState(''), 2), secondaryPoints = _328[0], setSecondaryPoints = _328[1];
76
- var _329 = __read(useState(''), 2), fillPoints = _329[0], setFillPoints = _329[1];
77
- var _330 = __read(useState(''), 2), fillPoints2 = _330[0], setFillPoints2 = _330[1];
78
- var _331 = __read(useState(''), 2), fillPoints3 = _331[0], setFillPoints3 = _331[1];
79
- var _332 = __read(useState(''), 2), fillPoints4 = _332[0], setFillPoints4 = _332[1];
80
- var _333 = __read(useState(''), 2), fillPoints5 = _333[0], setFillPoints5 = _333[1];
81
- var _334 = __read(useState(''), 2), secondaryFillPoints = _334[0], setSecondaryFillPoints = _334[1];
82
- var _335 = __read(useState([]), 2), pointsFromSet = _335[0], setPointsFromSet = _335[1];
83
- var _336 = __read(useState([]), 2), fillPointsFromSet = _336[0], setFillPointsFromSet = _336[1];
84
- var _337 = __read(useState([]), 2), arrowPointsFromSet = _337[0], setArrowPointsFromSet = _337[1];
85
- var _338 = __read(useState((_c = props.focusedDataPointIndex) !== null && _c !== void 0 ? _c : -1), 2), selectedIndex = _338[0], setSelectedIndex = _338[1];
68
+ var _321 = __read(useState([]), 2), pointerItemsForSet = _321[0], setPointerItemsForSet = _321[1];
69
+ var _322 = __read(useState([]), 2), secondaryPointerItemsForSet = _322[0], setSecondaryPointerItemsForSet = _322[1];
70
+ var _323 = __read(useState(0), 2), responderStartTime = _323[0], setResponderStartTime = _323[1];
71
+ var _324 = __read(useState(false), 2), responderActive = _324[0], setResponderActive = _324[1];
72
+ var _325 = __read(useState(''), 2), points = _325[0], setPoints = _325[1];
73
+ var _326 = __read(useState(''), 2), points2 = _326[0], setPoints2 = _326[1];
74
+ var _327 = __read(useState(''), 2), points3 = _327[0], setPoints3 = _327[1];
75
+ var _328 = __read(useState(''), 2), points4 = _328[0], setPoints4 = _328[1];
76
+ var _329 = __read(useState(''), 2), points5 = _329[0], setPoints5 = _329[1];
77
+ var _330 = __read(useState(''), 2), secondaryPoints = _330[0], setSecondaryPoints = _330[1];
78
+ var _331 = __read(useState(''), 2), fillPoints = _331[0], setFillPoints = _331[1];
79
+ var _332 = __read(useState(''), 2), fillPoints2 = _332[0], setFillPoints2 = _332[1];
80
+ var _333 = __read(useState(''), 2), fillPoints3 = _333[0], setFillPoints3 = _333[1];
81
+ var _334 = __read(useState(''), 2), fillPoints4 = _334[0], setFillPoints4 = _334[1];
82
+ var _335 = __read(useState(''), 2), fillPoints5 = _335[0], setFillPoints5 = _335[1];
83
+ var _336 = __read(useState(''), 2), secondaryFillPoints = _336[0], setSecondaryFillPoints = _336[1];
84
+ var _337 = __read(useState([]), 2), pointsFromSet = _337[0], setPointsFromSet = _337[1];
85
+ var _338 = __read(useState([]), 2), fillPointsFromSet = _338[0], setFillPointsFromSet = _338[1];
86
+ var _339 = __read(useState([]), 2), arrowPointsFromSet = _339[0], setArrowPointsFromSet = _339[1];
87
+ var _340 = __read(useState((_c = props.focusedDataPointIndex) !== null && _c !== void 0 ? _c : -1), 2), selectedIndex = _340[0], setSelectedIndex = _340[1];
86
88
  useEffect(function () {
87
89
  var _a;
88
90
  setSelectedIndex((_a = props.focusedDataPointIndex) !== null && _a !== void 0 ? _a : -1);
@@ -243,7 +245,7 @@ export var useLineChart = function (props) {
243
245
  var textColor4 = (_95 = (_94 = props.textColor4) !== null && _94 !== void 0 ? _94 : props.textColor) !== null && _95 !== void 0 ? _95 : LineDefaults.textColor;
244
246
  var textColor5 = (_97 = (_96 = props.textColor5) !== null && _96 !== void 0 ? _96 : props.textColor) !== null && _97 !== void 0 ? _97 : LineDefaults.textColor;
245
247
  var totalWidth = initialSpacing + spacing * maxLengthOfDataOrSet - 1 + endSpacing;
246
- var _339 = computeMaxAndMinItems(data0 !== null && data0 !== void 0 ? data0 : data, props.roundToDigits, props.showFractionalValues), maxItem = _339.maxItem, minItem = _339.minItem;
248
+ var _341 = computeMaxAndMinItems(data0 !== null && data0 !== void 0 ? data0 : data, props.roundToDigits, props.showFractionalValues), maxItem = _341.maxItem, minItem = _341.minItem;
247
249
  var maxValue = getMaxValue(props.maxValue, props.stepValue, noOfSections, maxItem);
248
250
  var mostNegativeValue = (_98 = props.mostNegativeValue) !== null && _98 !== void 0 ? _98 : minItem;
249
251
  var overflowTop = ((_99 = props.overflowTop) !== null && _99 !== void 0 ? _99 : props.secondaryXAxis)
@@ -312,7 +314,7 @@ export var useLineChart = function (props) {
312
314
  var endOpacity5 = (_178 = props.endOpacity5) !== null && _178 !== void 0 ? _178 : endOpacity;
313
315
  defaultArrowConfig.strokeWidth = (_180 = (_179 = dataSet === null || dataSet === void 0 ? void 0 : dataSet[0]) === null || _179 === void 0 ? void 0 : _179.thickness) !== null && _180 !== void 0 ? _180 : thickness1;
314
316
  defaultArrowConfig.strokeColor = (_182 = (_181 = dataSet === null || dataSet === void 0 ? void 0 : dataSet[0]) === null || _181 === void 0 ? void 0 : _181.color) !== null && _182 !== void 0 ? _182 : color1;
315
- var _340 = getAllArrowProperties(props, defaultArrowConfig), arrowLength1 = _340.arrowLength1, arrowWidth1 = _340.arrowWidth1, arrowStrokeWidth1 = _340.arrowStrokeWidth1, arrowStrokeColor1 = _340.arrowStrokeColor1, arrowFillColor1 = _340.arrowFillColor1, showArrowBase1 = _340.showArrowBase1, arrowLength2 = _340.arrowLength2, arrowWidth2 = _340.arrowWidth2, arrowStrokeWidth2 = _340.arrowStrokeWidth2, arrowStrokeColor2 = _340.arrowStrokeColor2, arrowFillColor2 = _340.arrowFillColor2, showArrowBase2 = _340.showArrowBase2, arrowLength3 = _340.arrowLength3, arrowWidth3 = _340.arrowWidth3, arrowStrokeWidth3 = _340.arrowStrokeWidth3, arrowStrokeColor3 = _340.arrowStrokeColor3, arrowFillColor3 = _340.arrowFillColor3, showArrowBase3 = _340.showArrowBase3, arrowLength4 = _340.arrowLength4, arrowWidth4 = _340.arrowWidth4, arrowStrokeWidth4 = _340.arrowStrokeWidth4, arrowStrokeColor4 = _340.arrowStrokeColor4, arrowFillColor4 = _340.arrowFillColor4, showArrowBase4 = _340.showArrowBase4, arrowLength5 = _340.arrowLength5, arrowWidth5 = _340.arrowWidth5, arrowStrokeWidth5 = _340.arrowStrokeWidth5, arrowStrokeColor5 = _340.arrowStrokeColor5, arrowFillColor5 = _340.arrowFillColor5, showArrowBase5 = _340.showArrowBase5, arrowLengthsFromSet = _340.arrowLengthsFromSet, arrowWidthsFromSet = _340.arrowWidthsFromSet, arrowStrokeWidthsFromSet = _340.arrowStrokeWidthsFromSet, arrowStrokeColorsFromSet = _340.arrowStrokeColorsFromSet, arrowFillColorsFromSet = _340.arrowFillColorsFromSet, showArrowBasesFromSet = _340.showArrowBasesFromSet;
317
+ var _342 = getAllArrowProperties(props, defaultArrowConfig), arrowLength1 = _342.arrowLength1, arrowWidth1 = _342.arrowWidth1, arrowStrokeWidth1 = _342.arrowStrokeWidth1, arrowStrokeColor1 = _342.arrowStrokeColor1, arrowFillColor1 = _342.arrowFillColor1, showArrowBase1 = _342.showArrowBase1, arrowLength2 = _342.arrowLength2, arrowWidth2 = _342.arrowWidth2, arrowStrokeWidth2 = _342.arrowStrokeWidth2, arrowStrokeColor2 = _342.arrowStrokeColor2, arrowFillColor2 = _342.arrowFillColor2, showArrowBase2 = _342.showArrowBase2, arrowLength3 = _342.arrowLength3, arrowWidth3 = _342.arrowWidth3, arrowStrokeWidth3 = _342.arrowStrokeWidth3, arrowStrokeColor3 = _342.arrowStrokeColor3, arrowFillColor3 = _342.arrowFillColor3, showArrowBase3 = _342.showArrowBase3, arrowLength4 = _342.arrowLength4, arrowWidth4 = _342.arrowWidth4, arrowStrokeWidth4 = _342.arrowStrokeWidth4, arrowStrokeColor4 = _342.arrowStrokeColor4, arrowFillColor4 = _342.arrowFillColor4, showArrowBase4 = _342.showArrowBase4, arrowLength5 = _342.arrowLength5, arrowWidth5 = _342.arrowWidth5, arrowStrokeWidth5 = _342.arrowStrokeWidth5, arrowStrokeColor5 = _342.arrowStrokeColor5, arrowFillColor5 = _342.arrowFillColor5, showArrowBase5 = _342.showArrowBase5, arrowLengthsFromSet = _342.arrowLengthsFromSet, arrowWidthsFromSet = _342.arrowWidthsFromSet, arrowStrokeWidthsFromSet = _342.arrowStrokeWidthsFromSet, arrowStrokeColorsFromSet = _342.arrowStrokeColorsFromSet, arrowFillColorsFromSet = _342.arrowFillColorsFromSet, showArrowBasesFromSet = _342.showArrowBasesFromSet;
316
318
  var secondaryLineConfig = {
317
319
  zIndex: (_184 = (_183 = props.secondaryLineConfig) === null || _183 === void 0 ? void 0 : _183.zIndex) !== null && _184 !== void 0 ? _184 : zIndex1,
318
320
  curved: (_186 = (_185 = props.secondaryLineConfig) === null || _185 === void 0 ? void 0 : _185.curved) !== null && _186 !== void 0 ? _186 : props.curved,
@@ -1130,6 +1132,10 @@ export var useLineChart = function (props) {
1130
1132
  setSecondaryPointerY: setSecondaryPointerY,
1131
1133
  secondaryPointerItem: secondaryPointerItem,
1132
1134
  setSecondaryPointerItem: setSecondaryPointerItem,
1135
+ pointerItemsForSet: pointerItemsForSet,
1136
+ setPointerItemsForSet: setPointerItemsForSet,
1137
+ secondaryPointerItemsForSet: secondaryPointerItemsForSet,
1138
+ setSecondaryPointerItemsForSet: setSecondaryPointerItemsForSet,
1133
1139
  responderStartTime: responderStartTime,
1134
1140
  setResponderStartTime: setResponderStartTime,
1135
1141
  responderActive: responderActive,
@@ -1,6 +1,6 @@
1
1
  import { GestureResponderEvent, type ColorValue } from 'react-native';
2
2
  import { type yAxisSides } from '../utils/constants';
3
- import { XAxisConfig, type CurveType, type DataSet, type EdgePosition, type HighlightedRange, type LineSegment, type Pointer, type RuleType, type RulesConfig, type arrowConfigType, type referenceConfigType, type secondaryLineConfigType, type secondaryYAxisType, type Linecap } from '../utils/types';
3
+ import { XAxisConfig, type CurveType, type DataSet, type EdgePosition, type HighlightedRange, type LineSegment, type Pointer, type RuleType, type RulesConfig, type arrowConfigType, type referenceConfigType, type secondaryLineConfigType, type secondaryYAxisType, type Linecap, type IntersectionAreaConfig } from '../utils/types';
4
4
  export interface LineChartPropsType {
5
5
  height?: number;
6
6
  overflowTop?: number;
@@ -302,6 +302,7 @@ export interface LineChartPropsType {
302
302
  onChartAreaPress?: (event: GestureResponderEvent) => void;
303
303
  onBackgroundPress?: (event: GestureResponderEvent) => void;
304
304
  secondaryXAxis?: XAxisConfig;
305
+ intersectionAreaConfig?: IntersectionAreaConfig;
305
306
  }
306
307
  export interface lineDataItem {
307
308
  value: number;
@@ -22,7 +22,10 @@ export interface StripAndLabelProps {
22
22
  pointerStripColor: ColorValue;
23
23
  pointerConfig?: Pointer;
24
24
  pointerLabelComponent: Function | null;
25
- secondaryPointerItem?: any[];
25
+ secondaryPointerItem?: any;
26
+ pointerItemsForSet?: any[];
27
+ secondaryPointerItemsForSet?: any[];
28
+ hasDataSet?: boolean;
26
29
  scrollX: number;
27
30
  pointerEvents?: PointerEvents;
28
31
  width: number;
package/dist/index.d.ts CHANGED
@@ -36,4 +36,4 @@ export { type StripAndLabelProps } from './components/common/types';
36
36
  /***********************************************************************************************************************/
37
37
  export { getCumulativeWidth, getLighterColor, svgQuadraticCurvePath, svgPath, bezierCommand, getSegmentString, getCurvePathWithSegments, getPreviousSegmentsLastPoint, getPathWithHighlight, getRegionPathObjects, getSegmentedPathObjects, getArrowPoints, getAxesAndRulesProps, getExtendedContainerHeightWithPadding, getSecondaryDataWithOffsetIncluded, getArrowProperty, getAllArrowProperties, maxAndMinUtil, computeMaxAndMinItems, getLabelTextUtil, getXForLineInBar, getYForLineInBar, clone, getLineConfigForBarChart, adjustToOffset } from './utils';
38
38
  export { chartTypes, yAxisSides, loc, SEGMENT_START, SEGMENT_END, RANGE_ENTER, RANGE_EXIT, STOP, ruleTypes, AxesAndRulesDefaults, defaultArrowConfig, BarDefaults, defaultLineConfig, LineDefaults, defaultPointerConfig, pieColors, populationDefaults, defaultAnimationDuration } from './utils/constants';
39
- export { type RuleType, type RuleTypes, type RulesConfig, CurveType, EdgePosition, type LabelsPosition, type PointerEvents, type secondaryYAxisType, type secondaryLineConfigType, type referenceConfigType, type arrowConfigType, type horizSectionPropTypes, type HorizSectionsType, type BarAndLineChartsWrapperTypes, type Pointer, type HighlightedRange, type LineSegment, type LineSvgProps, type LineProperties, type DataSet, Framework, type XAxisConfig, type LineInBarChartPropsType, type DataPointProps, type Linecap } from './utils/types';
39
+ export { type RuleType, type RuleTypes, type RulesConfig, CurveType, EdgePosition, type LabelsPosition, type PointerEvents, type secondaryYAxisType, type secondaryLineConfigType, type referenceConfigType, type arrowConfigType, type horizSectionPropTypes, type HorizSectionsType, type BarAndLineChartsWrapperTypes, type Pointer, type HighlightedRange, type LineSegment, type LineSvgProps, type LineProperties, type DataSet, Framework, type XAxisConfig, type LineInBarChartPropsType, type DataPointProps, type Linecap, type IntersectionAreaConfig } from './utils/types';
@@ -357,6 +357,7 @@ export interface LineSvgProps {
357
357
  stroke: string | ColorValue;
358
358
  strokeWidth: number;
359
359
  strokeDasharray?: number[];
360
+ clipPath?: string;
360
361
  }
361
362
  export interface LineProperties {
362
363
  d: string;
@@ -394,4 +395,7 @@ export interface DataSet {
394
395
  lineSegments?: LineSegment[];
395
396
  isSecondary?: boolean;
396
397
  }
398
+ export interface IntersectionAreaConfig {
399
+ fillColor?: ColorValue;
400
+ }
397
401
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gifted-charts-core",
3
- "version": "0.1.26",
3
+ "version": "0.1.27",
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": [