gifted-charts-core 0.1.60 → 0.1.61
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.
- package/dist/BarChart/types.d.ts +2 -0
- package/dist/utils/index.js +37 -6
- package/package.json +1 -1
package/dist/BarChart/types.d.ts
CHANGED
|
@@ -144,6 +144,7 @@ export interface StackedBarChartPropsType {
|
|
|
144
144
|
stackHighlightEnabled?: boolean;
|
|
145
145
|
selectedStackIndex: number;
|
|
146
146
|
setSelectedStackIndex: Function;
|
|
147
|
+
onBackgroundPress?: Function;
|
|
147
148
|
}
|
|
148
149
|
export interface StackedBarChartPropsTypeForWeb extends StackedBarChartPropsType {
|
|
149
150
|
onContextMenu?: Function;
|
|
@@ -334,6 +335,7 @@ export interface BarChartPropsType {
|
|
|
334
335
|
adjustToWidth?: boolean;
|
|
335
336
|
parentWidth?: number;
|
|
336
337
|
secondaryXAxis?: XAxisConfig;
|
|
338
|
+
onBackgroundPress?: Function;
|
|
337
339
|
}
|
|
338
340
|
export interface FocusedBarConfig {
|
|
339
341
|
color?: ColorValue;
|
package/dist/utils/index.js
CHANGED
|
@@ -1138,13 +1138,24 @@ export var pointsWithPaddedRepititions = function (oldPoints, newPoints) {
|
|
|
1138
1138
|
** Handles these cases-
|
|
1139
1139
|
**
|
|
1140
1140
|
** 1. Straight line chart
|
|
1141
|
-
** 2. Curved Line chart
|
|
1142
|
-
** 3.
|
|
1143
|
-
** 4.
|
|
1141
|
+
** 2. Curved Line chart with Cubic curve
|
|
1142
|
+
** 3. Curved Line Chart with Quadratic curve
|
|
1143
|
+
** 4. Straight Area chart -> we need to repeatedly add the 3rd last substring from the points array which represents the last point
|
|
1144
|
+
** 5. Curved Area chart with Cubic curve -> we need to repeatedly add the 3nd last substring (the 2 last substrings start with L while the 3rd last will start with C) from the points array which represents the last point
|
|
1145
|
+
** 6. Curved Area chart with Quadratic curve -> we need to repeatedly add the 3nd last substring (the 2 last substrings start with L while the 3rd last will start with Q) from the points array which represents the last point
|
|
1144
1146
|
*/
|
|
1145
1147
|
var oldPointsCopy = oldPoints.trim();
|
|
1146
1148
|
var newPointsCopy = newPoints.trim();
|
|
1147
|
-
var char
|
|
1149
|
+
var char;
|
|
1150
|
+
if (oldPointsCopy.includes('C')) {
|
|
1151
|
+
char = 'C';
|
|
1152
|
+
}
|
|
1153
|
+
else if (oldPointsCopy.includes('Q ')) {
|
|
1154
|
+
char = 'Q ';
|
|
1155
|
+
}
|
|
1156
|
+
else {
|
|
1157
|
+
char = 'L';
|
|
1158
|
+
}
|
|
1148
1159
|
var oldPointsCopyAr = oldPointsCopy.split(char);
|
|
1149
1160
|
var newPointsCopyAr = newPointsCopy.split(char);
|
|
1150
1161
|
var oldPointsCopyLen = oldPointsCopyAr.length - 1;
|
|
@@ -1154,7 +1165,7 @@ export var pointsWithPaddedRepititions = function (oldPoints, newPoints) {
|
|
|
1154
1165
|
? oldPointsCopyAr[oldPointsCopyLen].trim()
|
|
1155
1166
|
: newPointsCopyAr[newPointsCopyLen].trim();
|
|
1156
1167
|
var indexOfL = lastSequence.indexOf('L');
|
|
1157
|
-
var isCurvedAreaChart = char === 'C' && indexOfL !== -1;
|
|
1168
|
+
var isCurvedAreaChart = (char === 'C' || char === 'Q ') && indexOfL !== -1;
|
|
1158
1169
|
var isStraightAreaChart = !isCurvedAreaChart &&
|
|
1159
1170
|
oldPointsCopyAr[0].substring(1).trim() ===
|
|
1160
1171
|
oldPointsCopyAr[oldPointsCopyLen].trim();
|
|
@@ -1165,7 +1176,27 @@ export var pointsWithPaddedRepititions = function (oldPoints, newPoints) {
|
|
|
1165
1176
|
? oldPointsCopyAr[oldPointsCopyLen - 2]
|
|
1166
1177
|
: newPointsCopyAr[newPointsCopyLen - 2]
|
|
1167
1178
|
: lastSequence;
|
|
1168
|
-
|
|
1179
|
+
if (!isCurvedAreaChart && char === 'Q ') {
|
|
1180
|
+
// redrawing the last curve segment is a bit complicated in case of quadratic curves as evident below-
|
|
1181
|
+
var repeatsAr = repeats.split('Q');
|
|
1182
|
+
var r1 = repeatsAr[0];
|
|
1183
|
+
var r2 = repeatsAr[1];
|
|
1184
|
+
var r1LastPoint = r1.split(' ')[1];
|
|
1185
|
+
var r2LastPoint = r2.split(' ')[1];
|
|
1186
|
+
var r2FirstPoint = r2.split(' ')[0];
|
|
1187
|
+
repeats =
|
|
1188
|
+
'Q ' +
|
|
1189
|
+
r2FirstPoint +
|
|
1190
|
+
' ' +
|
|
1191
|
+
r1LastPoint +
|
|
1192
|
+
' Q' +
|
|
1193
|
+
r2FirstPoint +
|
|
1194
|
+
' ' +
|
|
1195
|
+
r2LastPoint;
|
|
1196
|
+
}
|
|
1197
|
+
else {
|
|
1198
|
+
repeats = char + (repeats === null || repeats === void 0 ? void 0 : repeats.trim());
|
|
1199
|
+
}
|
|
1169
1200
|
if (isCurvedAreaChart) {
|
|
1170
1201
|
if (oldPointsCopyLen < newPointsCopyLen) {
|
|
1171
1202
|
oldPointsCopy = oldPointsCopy
|