gifted-charts-core 0.1.66 → 0.1.67

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.
@@ -167,6 +167,8 @@ export interface LineChartPropsType {
167
167
  roundToDigits?: number;
168
168
  yAxisLabelWidth?: number;
169
169
  hideYAxisText?: boolean;
170
+ floatingYAxisLabels?: boolean;
171
+ allowFontScaling?: boolean;
170
172
  backgroundColor?: ColorValue;
171
173
  customBackground?: CustomBackground;
172
174
  curved?: boolean;
@@ -595,6 +597,8 @@ export interface LineChartBicolorPropsType {
595
597
  parentWidth?: number;
596
598
  yAxisExtraHeight?: number;
597
599
  trimYAxisAtTop?: boolean;
600
+ floatingYAxisLabels?: boolean;
601
+ allowFontScaling?: boolean;
598
602
  }
599
603
  export interface LineChartPropsTypeForWeb extends LineChartPropsType {
600
604
  onContextMenu?: Function;
@@ -39,7 +39,7 @@ import { AxesAndRulesDefaults, BarDefaults, chartTypes } from '../../utils/const
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, highlightEnabled = props.highlightEnabled, lowlightOpacity = props.lowlightOpacity, xAxisLabelsAtBottom = props.xAxisLabelsAtBottom;
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, xAxisLabelsAtBottom = props.xAxisLabelsAtBottom, floatingYAxisLabels = props.floatingYAxisLabels, allowFontScaling = props.allowFontScaling;
43
43
  var _20 = axesAndRulesProps.secondaryYAxisConfig, secondaryStepValue = _20.stepValue, secondaryNegativeStepValue = _20.negativeStepValue, secondaryNoOfSectionsBelowXAxis = _20.noOfSectionsBelowXAxis, showSecondaryFractionalValues = _20.showFractionalValues, secondaryRoundToDigits = _20.roundToDigits, secondaryStepHeight = _20.stepHeight, secondaryNegativeStepHeight = _20.negativeStepHeight;
44
44
  var primaryYAxisHeightBelowOrigin = noOfSectionsBelowXAxis * negativeStepHeight;
45
45
  var secondaryYAxisHeightBelowOrigin = secondaryNoOfSectionsBelowXAxis * secondaryNegativeStepHeight;
@@ -182,7 +182,9 @@ export var useBarAndLineChartsWrapper = function (props) {
182
182
  secondaryStepHeight: secondaryStepHeight,
183
183
  secondaryNegativeStepHeight: secondaryNegativeStepHeight,
184
184
  customBackground: props.customBackground,
185
- onlyPositive: onlyPositive
185
+ onlyPositive: onlyPositive,
186
+ floatingYAxisLabels: floatingYAxisLabels,
187
+ allowFontScaling: allowFontScaling
186
188
  };
187
189
  var lineInBarChartProps = {
188
190
  yAxisLabelWidth: yAxisLabelWidth,
@@ -75,6 +75,7 @@ export declare const AxesAndRulesDefaults: {
75
75
  showFractionalValues: boolean;
76
76
  roundToDigits: number;
77
77
  referenceLinesOverChartContent: boolean;
78
+ allowFontScaling: boolean;
78
79
  };
79
80
  export declare const defaultArrowConfig: {
80
81
  length: number;
@@ -84,7 +84,8 @@ export var AxesAndRulesDefaults = {
84
84
  yAxisEmptyLabelWidth: 10,
85
85
  showFractionalValues: false,
86
86
  roundToDigits: 1,
87
- referenceLinesOverChartContent: true
87
+ referenceLinesOverChartContent: true,
88
+ allowFontScaling: true
88
89
  };
89
90
  export var defaultArrowConfig = {
90
91
  length: 10,
@@ -104,6 +104,7 @@ export declare const getBarWidth: (isFocused?: boolean, focusedBarConfig?: Focus
104
104
  export declare const getInterpolatedData: (dataParam: lineDataItem[], showDataPointsForMissingValues?: boolean, interpolateMissingValues?: boolean, onlyPositive?: boolean) => lineDataItemNullSafe[];
105
105
  export declare const getLineSegmentsDueToNoExtrapolation: (data?: lineDataItem[]) => LineSegment[] | undefined;
106
106
  export declare const getLineSegmentsForMissingValues: (data?: lineDataItem[]) => LineSegment[] | undefined;
107
+ export declare const colorsToLowerCase: (lineSegments?: LineSegment[]) => LineSegment[] | undefined;
107
108
  export declare const getTextSizeForPieLabels: (textSize: number, radius: number) => number;
108
109
  export declare const adjustToOffset: (data: lineDataItemNullSafe[], yAxisOffset?: number) => lineDataItemNullSafe[];
109
110
  export declare const getSanitisedData: (data: lineDataItem[] | undefined, dataSanitisationProps: IDataSanitisationProps) => lineDataItemNullSafe[];
@@ -1037,6 +1037,14 @@ export var getLineSegmentsForMissingValues = function (data) {
1037
1037
  }
1038
1038
  return segments;
1039
1039
  };
1040
+ export var colorsToLowerCase = function (lineSegments) {
1041
+ return lineSegments === null || lineSegments === void 0 ? void 0 : lineSegments.map(function (segment) {
1042
+ if (segment.color && segment.color.toString().startsWith('#')) {
1043
+ segment.color = segment.color.toString().toLowerCase();
1044
+ }
1045
+ return segment;
1046
+ });
1047
+ };
1040
1048
  export var getTextSizeForPieLabels = function (textSize, radius) { return (textSize ? Math.min(textSize, radius / 5) : 16); };
1041
1049
  export var adjustToOffset = function (data, yAxisOffset) {
1042
1050
  return data.map(function (item) { return (__assign(__assign({}, item), { value: item.value - (yAxisOffset !== null && yAxisOffset !== void 0 ? yAxisOffset : 0) })); });
@@ -249,6 +249,7 @@ export interface horizSectionPropTypes {
249
249
  secondaryYAxis: secondaryYAxisType | null;
250
250
  formatYLabel?: (label: string) => string;
251
251
  onlyReferenceLines?: boolean;
252
+ onlyLabels?: boolean;
252
253
  renderReferenceLines?: boolean;
253
254
  secondaryXAxis?: XAxisConfig;
254
255
  secondaryMaxItem: number;
@@ -262,6 +263,8 @@ export interface horizSectionPropTypes {
262
263
  secondaryNegativeStepHeight: number;
263
264
  customBackground?: CustomBackground;
264
265
  onlyPositive?: boolean;
266
+ floatingYAxisLabels?: boolean;
267
+ allowFontScaling: boolean;
265
268
  }
266
269
  interface HorizSectionObject {
267
270
  value: string;
@@ -276,6 +279,8 @@ export interface BarAndLineChartsWrapperTypes {
276
279
  negativeStepHeight: number;
277
280
  labelsExtraHeight: number;
278
281
  yAxisLabelWidth: number;
282
+ floatingYAxisLabels?: boolean;
283
+ allowFontScaling: boolean;
279
284
  horizontal: boolean;
280
285
  rtl: boolean;
281
286
  shiftX: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gifted-charts-core",
3
- "version": "0.1.66",
3
+ "version": "0.1.67",
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": [