pristine-charts 0.1.0 → 0.1.2
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/funnel-chart/index.cjs +1725 -0
- package/dist/funnel-chart/index.cjs.map +1 -0
- package/dist/funnel-chart/index.d.cts +62 -0
- package/dist/funnel-chart/index.d.ts +62 -0
- package/dist/funnel-chart/index.js +1718 -0
- package/dist/funnel-chart/index.js.map +1 -0
- package/dist/gauge-chart/index.cjs +1675 -0
- package/dist/gauge-chart/index.cjs.map +1 -0
- package/dist/gauge-chart/index.d.cts +74 -0
- package/dist/gauge-chart/index.d.ts +74 -0
- package/dist/gauge-chart/index.js +1669 -0
- package/dist/gauge-chart/index.js.map +1 -0
- package/dist/index.cjs +4855 -3086
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +4836 -3088
- package/dist/index.js.map +1 -1
- package/dist/variance-chart/index.cjs +1855 -0
- package/dist/variance-chart/index.cjs.map +1 -0
- package/dist/variance-chart/index.d.cts +80 -0
- package/dist/variance-chart/index.d.ts +80 -0
- package/dist/variance-chart/index.js +1844 -0
- package/dist/variance-chart/index.js.map +1 -0
- package/package.json +16 -1
|
@@ -0,0 +1,1725 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var react = require('react');
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var d3 = require('d3');
|
|
6
|
+
|
|
7
|
+
// src/funnel-chart/FunnelChart.tsx
|
|
8
|
+
|
|
9
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_isPlaceholder.js
|
|
10
|
+
function _isPlaceholder(a) {
|
|
11
|
+
return a != null && typeof a === "object" && a["@@functional/placeholder"] === true;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_curry1.js
|
|
15
|
+
function _curry1(fn) {
|
|
16
|
+
return function f1(a) {
|
|
17
|
+
if (arguments.length === 0 || _isPlaceholder(a)) {
|
|
18
|
+
return f1;
|
|
19
|
+
} else {
|
|
20
|
+
return fn.apply(this, arguments);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_curry2.js
|
|
26
|
+
function _curry2(fn) {
|
|
27
|
+
return function f2(a, b) {
|
|
28
|
+
switch (arguments.length) {
|
|
29
|
+
case 0:
|
|
30
|
+
return f2;
|
|
31
|
+
case 1:
|
|
32
|
+
return _isPlaceholder(a) ? f2 : _curry1(function(_b) {
|
|
33
|
+
return fn(a, _b);
|
|
34
|
+
});
|
|
35
|
+
default:
|
|
36
|
+
return _isPlaceholder(a) && _isPlaceholder(b) ? f2 : _isPlaceholder(a) ? _curry1(function(_a) {
|
|
37
|
+
return fn(_a, b);
|
|
38
|
+
}) : _isPlaceholder(b) ? _curry1(function(_b) {
|
|
39
|
+
return fn(a, _b);
|
|
40
|
+
}) : fn(a, b);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_isArray.js
|
|
46
|
+
var isArray_default = Array.isArray || function _isArray(val) {
|
|
47
|
+
return val != null && val.length >= 0 && Object.prototype.toString.call(val) === "[object Array]";
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_isTransformer.js
|
|
51
|
+
function _isTransformer(obj) {
|
|
52
|
+
return obj != null && typeof obj["@@transducer/step"] === "function";
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_dispatchable.js
|
|
56
|
+
function _dispatchable(methodNames, transducerCreator, fn) {
|
|
57
|
+
return function() {
|
|
58
|
+
if (arguments.length === 0) {
|
|
59
|
+
return fn();
|
|
60
|
+
}
|
|
61
|
+
var obj = arguments[arguments.length - 1];
|
|
62
|
+
if (!isArray_default(obj)) {
|
|
63
|
+
var idx = 0;
|
|
64
|
+
while (idx < methodNames.length) {
|
|
65
|
+
if (typeof obj[methodNames[idx]] === "function") {
|
|
66
|
+
return obj[methodNames[idx]].apply(obj, Array.prototype.slice.call(arguments, 0, -1));
|
|
67
|
+
}
|
|
68
|
+
idx += 1;
|
|
69
|
+
}
|
|
70
|
+
if (_isTransformer(obj)) {
|
|
71
|
+
var transducer = transducerCreator.apply(null, Array.prototype.slice.call(arguments, 0, -1));
|
|
72
|
+
return transducer(obj);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return fn.apply(this, arguments);
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_reduced.js
|
|
80
|
+
function _reduced(x) {
|
|
81
|
+
return x && x["@@transducer/reduced"] ? x : {
|
|
82
|
+
"@@transducer/value": x,
|
|
83
|
+
"@@transducer/reduced": true
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_xfBase.js
|
|
88
|
+
var xfBase_default = {
|
|
89
|
+
init: function() {
|
|
90
|
+
return this.xf["@@transducer/init"]();
|
|
91
|
+
},
|
|
92
|
+
result: function(result) {
|
|
93
|
+
return this.xf["@@transducer/result"](result);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_xall.js
|
|
98
|
+
var XAll = /* @__PURE__ */ (function() {
|
|
99
|
+
function XAll2(f, xf) {
|
|
100
|
+
this.xf = xf;
|
|
101
|
+
this.f = f;
|
|
102
|
+
this.all = true;
|
|
103
|
+
}
|
|
104
|
+
XAll2.prototype["@@transducer/init"] = xfBase_default.init;
|
|
105
|
+
XAll2.prototype["@@transducer/result"] = function(result) {
|
|
106
|
+
if (this.all) {
|
|
107
|
+
result = this.xf["@@transducer/step"](result, true);
|
|
108
|
+
}
|
|
109
|
+
return this.xf["@@transducer/result"](result);
|
|
110
|
+
};
|
|
111
|
+
XAll2.prototype["@@transducer/step"] = function(result, input) {
|
|
112
|
+
if (!this.f(input)) {
|
|
113
|
+
this.all = false;
|
|
114
|
+
result = _reduced(this.xf["@@transducer/step"](result, false));
|
|
115
|
+
}
|
|
116
|
+
return result;
|
|
117
|
+
};
|
|
118
|
+
return XAll2;
|
|
119
|
+
})();
|
|
120
|
+
function _xall(f) {
|
|
121
|
+
return function(xf) {
|
|
122
|
+
return new XAll(f, xf);
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/all.js
|
|
127
|
+
var all = /* @__PURE__ */ _curry2(/* @__PURE__ */ _dispatchable(["all"], _xall, function all2(fn, list) {
|
|
128
|
+
var idx = 0;
|
|
129
|
+
while (idx < list.length) {
|
|
130
|
+
if (!fn(list[idx])) {
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
idx += 1;
|
|
134
|
+
}
|
|
135
|
+
return true;
|
|
136
|
+
}));
|
|
137
|
+
var all_default = all;
|
|
138
|
+
|
|
139
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_arity.js
|
|
140
|
+
function _arity(n, fn) {
|
|
141
|
+
switch (n) {
|
|
142
|
+
case 0:
|
|
143
|
+
return function() {
|
|
144
|
+
return fn.apply(this, arguments);
|
|
145
|
+
};
|
|
146
|
+
case 1:
|
|
147
|
+
return function(a0) {
|
|
148
|
+
return fn.apply(this, arguments);
|
|
149
|
+
};
|
|
150
|
+
case 2:
|
|
151
|
+
return function(a0, a1) {
|
|
152
|
+
return fn.apply(this, arguments);
|
|
153
|
+
};
|
|
154
|
+
case 3:
|
|
155
|
+
return function(a0, a1, a2) {
|
|
156
|
+
return fn.apply(this, arguments);
|
|
157
|
+
};
|
|
158
|
+
case 4:
|
|
159
|
+
return function(a0, a1, a2, a3) {
|
|
160
|
+
return fn.apply(this, arguments);
|
|
161
|
+
};
|
|
162
|
+
case 5:
|
|
163
|
+
return function(a0, a1, a2, a3, a4) {
|
|
164
|
+
return fn.apply(this, arguments);
|
|
165
|
+
};
|
|
166
|
+
case 6:
|
|
167
|
+
return function(a0, a1, a2, a3, a4, a5) {
|
|
168
|
+
return fn.apply(this, arguments);
|
|
169
|
+
};
|
|
170
|
+
case 7:
|
|
171
|
+
return function(a0, a1, a2, a3, a4, a5, a6) {
|
|
172
|
+
return fn.apply(this, arguments);
|
|
173
|
+
};
|
|
174
|
+
case 8:
|
|
175
|
+
return function(a0, a1, a2, a3, a4, a5, a6, a7) {
|
|
176
|
+
return fn.apply(this, arguments);
|
|
177
|
+
};
|
|
178
|
+
case 9:
|
|
179
|
+
return function(a0, a1, a2, a3, a4, a5, a6, a7, a8) {
|
|
180
|
+
return fn.apply(this, arguments);
|
|
181
|
+
};
|
|
182
|
+
case 10:
|
|
183
|
+
return function(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) {
|
|
184
|
+
return fn.apply(this, arguments);
|
|
185
|
+
};
|
|
186
|
+
default:
|
|
187
|
+
throw new Error("First argument to _arity must be a non-negative integer no greater than ten");
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_curryN.js
|
|
192
|
+
function _curryN(length, received, fn) {
|
|
193
|
+
return function() {
|
|
194
|
+
var combined = [];
|
|
195
|
+
var argsIdx = 0;
|
|
196
|
+
var left = length;
|
|
197
|
+
var combinedIdx = 0;
|
|
198
|
+
var hasPlaceholder = false;
|
|
199
|
+
while (combinedIdx < received.length || argsIdx < arguments.length) {
|
|
200
|
+
var result;
|
|
201
|
+
if (combinedIdx < received.length && (!_isPlaceholder(received[combinedIdx]) || argsIdx >= arguments.length)) {
|
|
202
|
+
result = received[combinedIdx];
|
|
203
|
+
} else {
|
|
204
|
+
result = arguments[argsIdx];
|
|
205
|
+
argsIdx += 1;
|
|
206
|
+
}
|
|
207
|
+
combined[combinedIdx] = result;
|
|
208
|
+
if (!_isPlaceholder(result)) {
|
|
209
|
+
left -= 1;
|
|
210
|
+
} else {
|
|
211
|
+
hasPlaceholder = true;
|
|
212
|
+
}
|
|
213
|
+
combinedIdx += 1;
|
|
214
|
+
}
|
|
215
|
+
return !hasPlaceholder && left <= 0 ? fn.apply(this, combined) : _arity(Math.max(0, left), _curryN(length, combined, fn));
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/curryN.js
|
|
220
|
+
var curryN = /* @__PURE__ */ _curry2(function curryN2(length, fn) {
|
|
221
|
+
if (length === 1) {
|
|
222
|
+
return _curry1(fn);
|
|
223
|
+
}
|
|
224
|
+
return _arity(length, _curryN(length, [], fn));
|
|
225
|
+
});
|
|
226
|
+
var curryN_default = curryN;
|
|
227
|
+
|
|
228
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_arrayFromIterator.js
|
|
229
|
+
function _arrayFromIterator(iter) {
|
|
230
|
+
var list = [];
|
|
231
|
+
var next;
|
|
232
|
+
while (!(next = iter.next()).done) {
|
|
233
|
+
list.push(next.value);
|
|
234
|
+
}
|
|
235
|
+
return list;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_includesWith.js
|
|
239
|
+
function _includesWith(pred, x, list) {
|
|
240
|
+
var idx = 0;
|
|
241
|
+
var len = list.length;
|
|
242
|
+
while (idx < len) {
|
|
243
|
+
if (pred(x, list[idx])) {
|
|
244
|
+
return true;
|
|
245
|
+
}
|
|
246
|
+
idx += 1;
|
|
247
|
+
}
|
|
248
|
+
return false;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_functionName.js
|
|
252
|
+
function _functionName(f) {
|
|
253
|
+
var match = String(f).match(/^function (\w*)/);
|
|
254
|
+
return match == null ? "" : match[1];
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_has.js
|
|
258
|
+
function _has(prop3, obj) {
|
|
259
|
+
return Object.prototype.hasOwnProperty.call(obj, prop3);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_objectIs.js
|
|
263
|
+
function _objectIs(a, b) {
|
|
264
|
+
if (a === b) {
|
|
265
|
+
return a !== 0 || 1 / a === 1 / b;
|
|
266
|
+
} else {
|
|
267
|
+
return a !== a && b !== b;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
var objectIs_default = typeof Object.is === "function" ? Object.is : _objectIs;
|
|
271
|
+
|
|
272
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_isArguments.js
|
|
273
|
+
var toString = Object.prototype.toString;
|
|
274
|
+
var _isArguments = /* @__PURE__ */ (function() {
|
|
275
|
+
return toString.call(arguments) === "[object Arguments]" ? function _isArguments2(x) {
|
|
276
|
+
return toString.call(x) === "[object Arguments]";
|
|
277
|
+
} : function _isArguments2(x) {
|
|
278
|
+
return _has("callee", x);
|
|
279
|
+
};
|
|
280
|
+
})();
|
|
281
|
+
var isArguments_default = _isArguments;
|
|
282
|
+
|
|
283
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/keys.js
|
|
284
|
+
var hasEnumBug = !/* @__PURE__ */ {
|
|
285
|
+
toString: null
|
|
286
|
+
}.propertyIsEnumerable("toString");
|
|
287
|
+
var nonEnumerableProps = ["constructor", "valueOf", "isPrototypeOf", "toString", "propertyIsEnumerable", "hasOwnProperty", "toLocaleString"];
|
|
288
|
+
var hasArgsEnumBug = /* @__PURE__ */ (function() {
|
|
289
|
+
return arguments.propertyIsEnumerable("length");
|
|
290
|
+
})();
|
|
291
|
+
var contains = function contains2(list, item) {
|
|
292
|
+
var idx = 0;
|
|
293
|
+
while (idx < list.length) {
|
|
294
|
+
if (list[idx] === item) {
|
|
295
|
+
return true;
|
|
296
|
+
}
|
|
297
|
+
idx += 1;
|
|
298
|
+
}
|
|
299
|
+
return false;
|
|
300
|
+
};
|
|
301
|
+
var keys = typeof Object.keys === "function" && !hasArgsEnumBug ? /* @__PURE__ */ _curry1(function keys2(obj) {
|
|
302
|
+
return Object(obj) !== obj ? [] : Object.keys(obj);
|
|
303
|
+
}) : /* @__PURE__ */ _curry1(function keys3(obj) {
|
|
304
|
+
if (Object(obj) !== obj) {
|
|
305
|
+
return [];
|
|
306
|
+
}
|
|
307
|
+
var prop3, nIdx;
|
|
308
|
+
var ks = [];
|
|
309
|
+
var checkArgsLength = hasArgsEnumBug && isArguments_default(obj);
|
|
310
|
+
for (prop3 in obj) {
|
|
311
|
+
if (_has(prop3, obj) && (!checkArgsLength || prop3 !== "length")) {
|
|
312
|
+
ks[ks.length] = prop3;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
if (hasEnumBug) {
|
|
316
|
+
nIdx = nonEnumerableProps.length - 1;
|
|
317
|
+
while (nIdx >= 0) {
|
|
318
|
+
prop3 = nonEnumerableProps[nIdx];
|
|
319
|
+
if (_has(prop3, obj) && !contains(ks, prop3)) {
|
|
320
|
+
ks[ks.length] = prop3;
|
|
321
|
+
}
|
|
322
|
+
nIdx -= 1;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
return ks;
|
|
326
|
+
});
|
|
327
|
+
var keys_default = keys;
|
|
328
|
+
|
|
329
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/type.js
|
|
330
|
+
var type = /* @__PURE__ */ _curry1(function type2(val) {
|
|
331
|
+
return val === null ? "Null" : val === void 0 ? "Undefined" : Object.prototype.toString.call(val).slice(8, -1);
|
|
332
|
+
});
|
|
333
|
+
var type_default = type;
|
|
334
|
+
|
|
335
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_equals.js
|
|
336
|
+
function _uniqContentEquals(aIterator, bIterator, stackA, stackB) {
|
|
337
|
+
var a = _arrayFromIterator(aIterator);
|
|
338
|
+
var b = _arrayFromIterator(bIterator);
|
|
339
|
+
function eq(_a, _b) {
|
|
340
|
+
return _equals(_a, _b, stackA.slice(), stackB.slice());
|
|
341
|
+
}
|
|
342
|
+
return !_includesWith(function(b2, aItem) {
|
|
343
|
+
return !_includesWith(eq, aItem, b2);
|
|
344
|
+
}, b, a);
|
|
345
|
+
}
|
|
346
|
+
function _equals(a, b, stackA, stackB) {
|
|
347
|
+
if (objectIs_default(a, b)) {
|
|
348
|
+
return true;
|
|
349
|
+
}
|
|
350
|
+
var typeA = type_default(a);
|
|
351
|
+
if (typeA !== type_default(b)) {
|
|
352
|
+
return false;
|
|
353
|
+
}
|
|
354
|
+
if (typeof a["fantasy-land/equals"] === "function" || typeof b["fantasy-land/equals"] === "function") {
|
|
355
|
+
return typeof a["fantasy-land/equals"] === "function" && a["fantasy-land/equals"](b) && typeof b["fantasy-land/equals"] === "function" && b["fantasy-land/equals"](a);
|
|
356
|
+
}
|
|
357
|
+
if (typeof a.equals === "function" || typeof b.equals === "function") {
|
|
358
|
+
return typeof a.equals === "function" && a.equals(b) && typeof b.equals === "function" && b.equals(a);
|
|
359
|
+
}
|
|
360
|
+
switch (typeA) {
|
|
361
|
+
case "Arguments":
|
|
362
|
+
case "Array":
|
|
363
|
+
case "Object":
|
|
364
|
+
if (typeof a.constructor === "function" && _functionName(a.constructor) === "Promise") {
|
|
365
|
+
return a === b;
|
|
366
|
+
}
|
|
367
|
+
break;
|
|
368
|
+
case "Boolean":
|
|
369
|
+
case "Number":
|
|
370
|
+
case "String":
|
|
371
|
+
if (!(typeof a === typeof b && objectIs_default(a.valueOf(), b.valueOf()))) {
|
|
372
|
+
return false;
|
|
373
|
+
}
|
|
374
|
+
break;
|
|
375
|
+
case "Date":
|
|
376
|
+
if (!objectIs_default(a.valueOf(), b.valueOf())) {
|
|
377
|
+
return false;
|
|
378
|
+
}
|
|
379
|
+
break;
|
|
380
|
+
case "Error":
|
|
381
|
+
return a.name === b.name && a.message === b.message;
|
|
382
|
+
case "RegExp":
|
|
383
|
+
if (!(a.source === b.source && a.global === b.global && a.ignoreCase === b.ignoreCase && a.multiline === b.multiline && a.sticky === b.sticky && a.unicode === b.unicode)) {
|
|
384
|
+
return false;
|
|
385
|
+
}
|
|
386
|
+
break;
|
|
387
|
+
}
|
|
388
|
+
var idx = stackA.length - 1;
|
|
389
|
+
while (idx >= 0) {
|
|
390
|
+
if (stackA[idx] === a) {
|
|
391
|
+
return stackB[idx] === b;
|
|
392
|
+
}
|
|
393
|
+
idx -= 1;
|
|
394
|
+
}
|
|
395
|
+
switch (typeA) {
|
|
396
|
+
case "Map":
|
|
397
|
+
if (a.size !== b.size) {
|
|
398
|
+
return false;
|
|
399
|
+
}
|
|
400
|
+
return _uniqContentEquals(a.entries(), b.entries(), stackA.concat([a]), stackB.concat([b]));
|
|
401
|
+
case "Set":
|
|
402
|
+
if (a.size !== b.size) {
|
|
403
|
+
return false;
|
|
404
|
+
}
|
|
405
|
+
return _uniqContentEquals(a.values(), b.values(), stackA.concat([a]), stackB.concat([b]));
|
|
406
|
+
case "Arguments":
|
|
407
|
+
case "Array":
|
|
408
|
+
case "Object":
|
|
409
|
+
case "Boolean":
|
|
410
|
+
case "Number":
|
|
411
|
+
case "String":
|
|
412
|
+
case "Date":
|
|
413
|
+
case "Error":
|
|
414
|
+
case "RegExp":
|
|
415
|
+
case "Int8Array":
|
|
416
|
+
case "Uint8Array":
|
|
417
|
+
case "Uint8ClampedArray":
|
|
418
|
+
case "Int16Array":
|
|
419
|
+
case "Uint16Array":
|
|
420
|
+
case "Int32Array":
|
|
421
|
+
case "Uint32Array":
|
|
422
|
+
case "Float32Array":
|
|
423
|
+
case "Float64Array":
|
|
424
|
+
case "ArrayBuffer":
|
|
425
|
+
break;
|
|
426
|
+
default:
|
|
427
|
+
return false;
|
|
428
|
+
}
|
|
429
|
+
var keysA = keys_default(a);
|
|
430
|
+
if (keysA.length !== keys_default(b).length) {
|
|
431
|
+
return false;
|
|
432
|
+
}
|
|
433
|
+
var extendedStackA = stackA.concat([a]);
|
|
434
|
+
var extendedStackB = stackB.concat([b]);
|
|
435
|
+
idx = keysA.length - 1;
|
|
436
|
+
while (idx >= 0) {
|
|
437
|
+
var key = keysA[idx];
|
|
438
|
+
if (!(_has(key, b) && _equals(b[key], a[key], extendedStackA, extendedStackB))) {
|
|
439
|
+
return false;
|
|
440
|
+
}
|
|
441
|
+
idx -= 1;
|
|
442
|
+
}
|
|
443
|
+
return true;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/equals.js
|
|
447
|
+
var equals = /* @__PURE__ */ _curry2(function equals2(a, b) {
|
|
448
|
+
return _equals(a, b, [], []);
|
|
449
|
+
});
|
|
450
|
+
var equals_default = equals;
|
|
451
|
+
|
|
452
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_indexOf.js
|
|
453
|
+
function _indexOf(list, a, idx) {
|
|
454
|
+
var inf, item;
|
|
455
|
+
if (typeof list.indexOf === "function") {
|
|
456
|
+
switch (typeof a) {
|
|
457
|
+
case "number":
|
|
458
|
+
if (a === 0) {
|
|
459
|
+
inf = 1 / a;
|
|
460
|
+
while (idx < list.length) {
|
|
461
|
+
item = list[idx];
|
|
462
|
+
if (item === 0 && 1 / item === inf) {
|
|
463
|
+
return idx;
|
|
464
|
+
}
|
|
465
|
+
idx += 1;
|
|
466
|
+
}
|
|
467
|
+
return -1;
|
|
468
|
+
} else if (a !== a) {
|
|
469
|
+
while (idx < list.length) {
|
|
470
|
+
item = list[idx];
|
|
471
|
+
if (typeof item === "number" && item !== item) {
|
|
472
|
+
return idx;
|
|
473
|
+
}
|
|
474
|
+
idx += 1;
|
|
475
|
+
}
|
|
476
|
+
return -1;
|
|
477
|
+
}
|
|
478
|
+
return list.indexOf(a, idx);
|
|
479
|
+
// all these types can utilise Set
|
|
480
|
+
case "string":
|
|
481
|
+
case "boolean":
|
|
482
|
+
case "function":
|
|
483
|
+
case "undefined":
|
|
484
|
+
return list.indexOf(a, idx);
|
|
485
|
+
case "object":
|
|
486
|
+
if (a === null) {
|
|
487
|
+
return list.indexOf(a, idx);
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
while (idx < list.length) {
|
|
492
|
+
if (equals_default(list[idx], a)) {
|
|
493
|
+
return idx;
|
|
494
|
+
}
|
|
495
|
+
idx += 1;
|
|
496
|
+
}
|
|
497
|
+
return -1;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_includes.js
|
|
501
|
+
function _includes(a, list) {
|
|
502
|
+
return _indexOf(list, a, 0) >= 0;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_map.js
|
|
506
|
+
function _map(fn, functor) {
|
|
507
|
+
var idx = 0;
|
|
508
|
+
var len = functor.length;
|
|
509
|
+
var result = Array(len);
|
|
510
|
+
while (idx < len) {
|
|
511
|
+
result[idx] = fn(functor[idx]);
|
|
512
|
+
idx += 1;
|
|
513
|
+
}
|
|
514
|
+
return result;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_quote.js
|
|
518
|
+
function _quote(s) {
|
|
519
|
+
var escaped = s.replace(/\\/g, "\\\\").replace(/[\b]/g, "\\b").replace(/\f/g, "\\f").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\t/g, "\\t").replace(/\v/g, "\\v").replace(/\0/g, "\\0");
|
|
520
|
+
return '"' + escaped.replace(/"/g, '\\"') + '"';
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_toISOString.js
|
|
524
|
+
var pad = function pad2(n) {
|
|
525
|
+
return (n < 10 ? "0" : "") + n;
|
|
526
|
+
};
|
|
527
|
+
var _toISOString = typeof Date.prototype.toISOString === "function" ? function _toISOString2(d) {
|
|
528
|
+
return d.toISOString();
|
|
529
|
+
} : function _toISOString3(d) {
|
|
530
|
+
return d.getUTCFullYear() + "-" + pad(d.getUTCMonth() + 1) + "-" + pad(d.getUTCDate()) + "T" + pad(d.getUTCHours()) + ":" + pad(d.getUTCMinutes()) + ":" + pad(d.getUTCSeconds()) + "." + (d.getUTCMilliseconds() / 1e3).toFixed(3).slice(2, 5) + "Z";
|
|
531
|
+
};
|
|
532
|
+
var toISOString_default = _toISOString;
|
|
533
|
+
|
|
534
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_complement.js
|
|
535
|
+
function _complement(f) {
|
|
536
|
+
return function() {
|
|
537
|
+
return !f.apply(this, arguments);
|
|
538
|
+
};
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_arrayReduce.js
|
|
542
|
+
function _arrayReduce(reducer, acc, list) {
|
|
543
|
+
var index = 0;
|
|
544
|
+
var length = list.length;
|
|
545
|
+
while (index < length) {
|
|
546
|
+
acc = reducer(acc, list[index]);
|
|
547
|
+
index += 1;
|
|
548
|
+
}
|
|
549
|
+
return acc;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_filter.js
|
|
553
|
+
function _filter(fn, list) {
|
|
554
|
+
var idx = 0;
|
|
555
|
+
var len = list.length;
|
|
556
|
+
var result = [];
|
|
557
|
+
while (idx < len) {
|
|
558
|
+
if (fn(list[idx])) {
|
|
559
|
+
result[result.length] = list[idx];
|
|
560
|
+
}
|
|
561
|
+
idx += 1;
|
|
562
|
+
}
|
|
563
|
+
return result;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_isObject.js
|
|
567
|
+
function _isObject(x) {
|
|
568
|
+
return Object.prototype.toString.call(x) === "[object Object]";
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_xfilter.js
|
|
572
|
+
var XFilter = /* @__PURE__ */ (function() {
|
|
573
|
+
function XFilter2(f, xf) {
|
|
574
|
+
this.xf = xf;
|
|
575
|
+
this.f = f;
|
|
576
|
+
}
|
|
577
|
+
XFilter2.prototype["@@transducer/init"] = xfBase_default.init;
|
|
578
|
+
XFilter2.prototype["@@transducer/result"] = xfBase_default.result;
|
|
579
|
+
XFilter2.prototype["@@transducer/step"] = function(result, input) {
|
|
580
|
+
return this.f(input) ? this.xf["@@transducer/step"](result, input) : result;
|
|
581
|
+
};
|
|
582
|
+
return XFilter2;
|
|
583
|
+
})();
|
|
584
|
+
function _xfilter(f) {
|
|
585
|
+
return function(xf) {
|
|
586
|
+
return new XFilter(f, xf);
|
|
587
|
+
};
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/filter.js
|
|
591
|
+
var filter = /* @__PURE__ */ _curry2(/* @__PURE__ */ _dispatchable(["fantasy-land/filter", "filter"], _xfilter, function(pred, filterable) {
|
|
592
|
+
return _isObject(filterable) ? _arrayReduce(function(acc, key) {
|
|
593
|
+
if (pred(filterable[key])) {
|
|
594
|
+
acc[key] = filterable[key];
|
|
595
|
+
}
|
|
596
|
+
return acc;
|
|
597
|
+
}, {}, keys_default(filterable)) : (
|
|
598
|
+
// else
|
|
599
|
+
_filter(pred, filterable)
|
|
600
|
+
);
|
|
601
|
+
}));
|
|
602
|
+
var filter_default = filter;
|
|
603
|
+
|
|
604
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/reject.js
|
|
605
|
+
var reject = /* @__PURE__ */ _curry2(function reject2(pred, filterable) {
|
|
606
|
+
return filter_default(_complement(pred), filterable);
|
|
607
|
+
});
|
|
608
|
+
var reject_default = reject;
|
|
609
|
+
|
|
610
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_toString.js
|
|
611
|
+
function _toString(x, seen) {
|
|
612
|
+
var recur = function recur2(y) {
|
|
613
|
+
var xs = seen.concat([x]);
|
|
614
|
+
return _includes(y, xs) ? "<Circular>" : _toString(y, xs);
|
|
615
|
+
};
|
|
616
|
+
var mapPairs = function(obj, keys4) {
|
|
617
|
+
return _map(function(k) {
|
|
618
|
+
return _quote(k) + ": " + recur(obj[k]);
|
|
619
|
+
}, keys4.slice().sort());
|
|
620
|
+
};
|
|
621
|
+
switch (Object.prototype.toString.call(x)) {
|
|
622
|
+
case "[object Arguments]":
|
|
623
|
+
return "(function() { return arguments; }(" + _map(recur, x).join(", ") + "))";
|
|
624
|
+
case "[object Array]":
|
|
625
|
+
return "[" + _map(recur, x).concat(mapPairs(x, reject_default(function(k) {
|
|
626
|
+
return /^\d+$/.test(k);
|
|
627
|
+
}, keys_default(x)))).join(", ") + "]";
|
|
628
|
+
case "[object Boolean]":
|
|
629
|
+
return typeof x === "object" ? "new Boolean(" + recur(x.valueOf()) + ")" : x.toString();
|
|
630
|
+
case "[object Date]":
|
|
631
|
+
return "new Date(" + (isNaN(x.valueOf()) ? recur(NaN) : _quote(toISOString_default(x))) + ")";
|
|
632
|
+
case "[object Map]":
|
|
633
|
+
return "new Map(" + recur(Array.from(x)) + ")";
|
|
634
|
+
case "[object Null]":
|
|
635
|
+
return "null";
|
|
636
|
+
case "[object Number]":
|
|
637
|
+
return typeof x === "object" ? "new Number(" + recur(x.valueOf()) + ")" : 1 / x === -Infinity ? "-0" : x.toString(10);
|
|
638
|
+
case "[object Set]":
|
|
639
|
+
return "new Set(" + recur(Array.from(x).sort()) + ")";
|
|
640
|
+
case "[object String]":
|
|
641
|
+
return typeof x === "object" ? "new String(" + recur(x.valueOf()) + ")" : _quote(x);
|
|
642
|
+
case "[object Undefined]":
|
|
643
|
+
return "undefined";
|
|
644
|
+
default:
|
|
645
|
+
if (typeof x.toString === "function") {
|
|
646
|
+
var repr = x.toString();
|
|
647
|
+
if (repr !== "[object Object]") {
|
|
648
|
+
return repr;
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
return "{" + mapPairs(x, keys_default(x)).join(", ") + "}";
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/toString.js
|
|
656
|
+
var toString2 = /* @__PURE__ */ _curry1(function toString3(val) {
|
|
657
|
+
return _toString(val, []);
|
|
658
|
+
});
|
|
659
|
+
var toString_default = toString2;
|
|
660
|
+
|
|
661
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/max.js
|
|
662
|
+
var max = /* @__PURE__ */ _curry2(function max2(a, b) {
|
|
663
|
+
if (a === b) {
|
|
664
|
+
return b;
|
|
665
|
+
}
|
|
666
|
+
function safeMax(x, y) {
|
|
667
|
+
if (x > y !== y > x) {
|
|
668
|
+
return y > x ? y : x;
|
|
669
|
+
}
|
|
670
|
+
return void 0;
|
|
671
|
+
}
|
|
672
|
+
var maxByValue = safeMax(a, b);
|
|
673
|
+
if (maxByValue !== void 0) {
|
|
674
|
+
return maxByValue;
|
|
675
|
+
}
|
|
676
|
+
var maxByType = safeMax(typeof a, typeof b);
|
|
677
|
+
if (maxByType !== void 0) {
|
|
678
|
+
return maxByType === typeof a ? a : b;
|
|
679
|
+
}
|
|
680
|
+
var stringA = toString_default(a);
|
|
681
|
+
var maxByStringValue = safeMax(stringA, toString_default(b));
|
|
682
|
+
if (maxByStringValue !== void 0) {
|
|
683
|
+
return maxByStringValue === stringA ? a : b;
|
|
684
|
+
}
|
|
685
|
+
return b;
|
|
686
|
+
});
|
|
687
|
+
var max_default = max;
|
|
688
|
+
|
|
689
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_xmap.js
|
|
690
|
+
var XMap = /* @__PURE__ */ (function() {
|
|
691
|
+
function XMap2(f, xf) {
|
|
692
|
+
this.xf = xf;
|
|
693
|
+
this.f = f;
|
|
694
|
+
}
|
|
695
|
+
XMap2.prototype["@@transducer/init"] = xfBase_default.init;
|
|
696
|
+
XMap2.prototype["@@transducer/result"] = xfBase_default.result;
|
|
697
|
+
XMap2.prototype["@@transducer/step"] = function(result, input) {
|
|
698
|
+
return this.xf["@@transducer/step"](result, this.f(input));
|
|
699
|
+
};
|
|
700
|
+
return XMap2;
|
|
701
|
+
})();
|
|
702
|
+
var _xmap = function _xmap2(f) {
|
|
703
|
+
return function(xf) {
|
|
704
|
+
return new XMap(f, xf);
|
|
705
|
+
};
|
|
706
|
+
};
|
|
707
|
+
var xmap_default = _xmap;
|
|
708
|
+
|
|
709
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/map.js
|
|
710
|
+
var map = /* @__PURE__ */ _curry2(/* @__PURE__ */ _dispatchable(["fantasy-land/map", "map"], xmap_default, function map2(fn, functor) {
|
|
711
|
+
switch (Object.prototype.toString.call(functor)) {
|
|
712
|
+
case "[object Function]":
|
|
713
|
+
return curryN_default(functor.length, function() {
|
|
714
|
+
return fn.call(this, functor.apply(this, arguments));
|
|
715
|
+
});
|
|
716
|
+
case "[object Object]":
|
|
717
|
+
return _arrayReduce(function(acc, key) {
|
|
718
|
+
acc[key] = fn(functor[key]);
|
|
719
|
+
return acc;
|
|
720
|
+
}, {}, keys_default(functor));
|
|
721
|
+
default:
|
|
722
|
+
return _map(fn, functor);
|
|
723
|
+
}
|
|
724
|
+
}));
|
|
725
|
+
var map_default = map;
|
|
726
|
+
|
|
727
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_isInteger.js
|
|
728
|
+
var isInteger_default = Number.isInteger || function _isInteger(n) {
|
|
729
|
+
return n << 0 === n;
|
|
730
|
+
};
|
|
731
|
+
|
|
732
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_isString.js
|
|
733
|
+
function _isString(x) {
|
|
734
|
+
return Object.prototype.toString.call(x) === "[object String]";
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_nth.js
|
|
738
|
+
function _nth(offset, list) {
|
|
739
|
+
var idx = offset < 0 ? list.length + offset : offset;
|
|
740
|
+
return _isString(list) ? list.charAt(idx) : list[idx];
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/prop.js
|
|
744
|
+
var prop = /* @__PURE__ */ _curry2(function prop2(p, obj) {
|
|
745
|
+
if (obj == null) {
|
|
746
|
+
return;
|
|
747
|
+
}
|
|
748
|
+
return isInteger_default(p) ? _nth(p, obj) : obj[p];
|
|
749
|
+
});
|
|
750
|
+
var prop_default = prop;
|
|
751
|
+
|
|
752
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/pluck.js
|
|
753
|
+
var pluck = /* @__PURE__ */ _curry2(function pluck2(p, list) {
|
|
754
|
+
return map_default(prop_default(p), list);
|
|
755
|
+
});
|
|
756
|
+
var pluck_default = pluck;
|
|
757
|
+
|
|
758
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_curry3.js
|
|
759
|
+
function _curry3(fn) {
|
|
760
|
+
return function f3(a, b, c) {
|
|
761
|
+
switch (arguments.length) {
|
|
762
|
+
case 0:
|
|
763
|
+
return f3;
|
|
764
|
+
case 1:
|
|
765
|
+
return _isPlaceholder(a) ? f3 : _curry2(function(_b, _c) {
|
|
766
|
+
return fn(a, _b, _c);
|
|
767
|
+
});
|
|
768
|
+
case 2:
|
|
769
|
+
return _isPlaceholder(a) && _isPlaceholder(b) ? f3 : _isPlaceholder(a) ? _curry2(function(_a, _c) {
|
|
770
|
+
return fn(_a, b, _c);
|
|
771
|
+
}) : _isPlaceholder(b) ? _curry2(function(_b, _c) {
|
|
772
|
+
return fn(a, _b, _c);
|
|
773
|
+
}) : _curry1(function(_c) {
|
|
774
|
+
return fn(a, b, _c);
|
|
775
|
+
});
|
|
776
|
+
default:
|
|
777
|
+
return _isPlaceholder(a) && _isPlaceholder(b) && _isPlaceholder(c) ? f3 : _isPlaceholder(a) && _isPlaceholder(b) ? _curry2(function(_a, _b) {
|
|
778
|
+
return fn(_a, _b, c);
|
|
779
|
+
}) : _isPlaceholder(a) && _isPlaceholder(c) ? _curry2(function(_a, _c) {
|
|
780
|
+
return fn(_a, b, _c);
|
|
781
|
+
}) : _isPlaceholder(b) && _isPlaceholder(c) ? _curry2(function(_b, _c) {
|
|
782
|
+
return fn(a, _b, _c);
|
|
783
|
+
}) : _isPlaceholder(a) ? _curry1(function(_a) {
|
|
784
|
+
return fn(_a, b, c);
|
|
785
|
+
}) : _isPlaceholder(b) ? _curry1(function(_b) {
|
|
786
|
+
return fn(a, _b, c);
|
|
787
|
+
}) : _isPlaceholder(c) ? _curry1(function(_c) {
|
|
788
|
+
return fn(a, b, _c);
|
|
789
|
+
}) : fn(a, b, c);
|
|
790
|
+
}
|
|
791
|
+
};
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_isArrayLike.js
|
|
795
|
+
var _isArrayLike = /* @__PURE__ */ _curry1(function isArrayLike(x) {
|
|
796
|
+
if (isArray_default(x)) {
|
|
797
|
+
return true;
|
|
798
|
+
}
|
|
799
|
+
if (!x) {
|
|
800
|
+
return false;
|
|
801
|
+
}
|
|
802
|
+
if (typeof x !== "object") {
|
|
803
|
+
return false;
|
|
804
|
+
}
|
|
805
|
+
if (_isString(x)) {
|
|
806
|
+
return false;
|
|
807
|
+
}
|
|
808
|
+
if (x.length === 0) {
|
|
809
|
+
return true;
|
|
810
|
+
}
|
|
811
|
+
if (x.length > 0) {
|
|
812
|
+
return x.hasOwnProperty(0) && x.hasOwnProperty(x.length - 1);
|
|
813
|
+
}
|
|
814
|
+
return false;
|
|
815
|
+
});
|
|
816
|
+
var isArrayLike_default = _isArrayLike;
|
|
817
|
+
|
|
818
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_createReduce.js
|
|
819
|
+
var symIterator = typeof Symbol !== "undefined" ? Symbol.iterator : "@@iterator";
|
|
820
|
+
function _createReduce(arrayReduce, methodReduce, iterableReduce) {
|
|
821
|
+
return function _reduce2(xf, acc, list) {
|
|
822
|
+
if (isArrayLike_default(list)) {
|
|
823
|
+
return arrayReduce(xf, acc, list);
|
|
824
|
+
}
|
|
825
|
+
if (list == null) {
|
|
826
|
+
return acc;
|
|
827
|
+
}
|
|
828
|
+
if (typeof list["fantasy-land/reduce"] === "function") {
|
|
829
|
+
return methodReduce(xf, acc, list, "fantasy-land/reduce");
|
|
830
|
+
}
|
|
831
|
+
if (list[symIterator] != null) {
|
|
832
|
+
return iterableReduce(xf, acc, list[symIterator]());
|
|
833
|
+
}
|
|
834
|
+
if (typeof list.next === "function") {
|
|
835
|
+
return iterableReduce(xf, acc, list);
|
|
836
|
+
}
|
|
837
|
+
if (typeof list.reduce === "function") {
|
|
838
|
+
return methodReduce(xf, acc, list, "reduce");
|
|
839
|
+
}
|
|
840
|
+
throw new TypeError("reduce: list must be array or iterable");
|
|
841
|
+
};
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_xArrayReduce.js
|
|
845
|
+
function _xArrayReduce(xf, acc, list) {
|
|
846
|
+
var idx = 0;
|
|
847
|
+
var len = list.length;
|
|
848
|
+
while (idx < len) {
|
|
849
|
+
acc = xf["@@transducer/step"](acc, list[idx]);
|
|
850
|
+
if (acc && acc["@@transducer/reduced"]) {
|
|
851
|
+
acc = acc["@@transducer/value"];
|
|
852
|
+
break;
|
|
853
|
+
}
|
|
854
|
+
idx += 1;
|
|
855
|
+
}
|
|
856
|
+
return xf["@@transducer/result"](acc);
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/bind.js
|
|
860
|
+
var bind = /* @__PURE__ */ _curry2(function bind2(fn, thisObj) {
|
|
861
|
+
return _arity(fn.length, function() {
|
|
862
|
+
return fn.apply(thisObj, arguments);
|
|
863
|
+
});
|
|
864
|
+
});
|
|
865
|
+
var bind_default = bind;
|
|
866
|
+
|
|
867
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_xReduce.js
|
|
868
|
+
function _xIterableReduce(xf, acc, iter) {
|
|
869
|
+
var step = iter.next();
|
|
870
|
+
while (!step.done) {
|
|
871
|
+
acc = xf["@@transducer/step"](acc, step.value);
|
|
872
|
+
if (acc && acc["@@transducer/reduced"]) {
|
|
873
|
+
acc = acc["@@transducer/value"];
|
|
874
|
+
break;
|
|
875
|
+
}
|
|
876
|
+
step = iter.next();
|
|
877
|
+
}
|
|
878
|
+
return xf["@@transducer/result"](acc);
|
|
879
|
+
}
|
|
880
|
+
function _xMethodReduce(xf, acc, obj, methodName) {
|
|
881
|
+
return xf["@@transducer/result"](obj[methodName](bind_default(xf["@@transducer/step"], xf), acc));
|
|
882
|
+
}
|
|
883
|
+
var _xReduce = /* @__PURE__ */ _createReduce(_xArrayReduce, _xMethodReduce, _xIterableReduce);
|
|
884
|
+
var xReduce_default = _xReduce;
|
|
885
|
+
|
|
886
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_xwrap.js
|
|
887
|
+
var XWrap = /* @__PURE__ */ (function() {
|
|
888
|
+
function XWrap2(fn) {
|
|
889
|
+
this.f = fn;
|
|
890
|
+
}
|
|
891
|
+
XWrap2.prototype["@@transducer/init"] = function() {
|
|
892
|
+
throw new Error("init not implemented on XWrap");
|
|
893
|
+
};
|
|
894
|
+
XWrap2.prototype["@@transducer/result"] = function(acc) {
|
|
895
|
+
return acc;
|
|
896
|
+
};
|
|
897
|
+
XWrap2.prototype["@@transducer/step"] = function(acc, x) {
|
|
898
|
+
return this.f(acc, x);
|
|
899
|
+
};
|
|
900
|
+
return XWrap2;
|
|
901
|
+
})();
|
|
902
|
+
function _xwrap(fn) {
|
|
903
|
+
return new XWrap(fn);
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/reduce.js
|
|
907
|
+
var reduce = /* @__PURE__ */ _curry3(function(xf, acc, list) {
|
|
908
|
+
return xReduce_default(typeof xf === "function" ? _xwrap(xf) : xf, acc, list);
|
|
909
|
+
});
|
|
910
|
+
var reduce_default = reduce;
|
|
911
|
+
|
|
912
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/allPass.js
|
|
913
|
+
var allPass = /* @__PURE__ */ _curry1(function allPass2(preds) {
|
|
914
|
+
return curryN_default(reduce_default(max_default, 0, pluck_default("length", preds)), function() {
|
|
915
|
+
var idx = 0;
|
|
916
|
+
var len = preds.length;
|
|
917
|
+
while (idx < len) {
|
|
918
|
+
if (!preds[idx].apply(this, arguments)) {
|
|
919
|
+
return false;
|
|
920
|
+
}
|
|
921
|
+
idx += 1;
|
|
922
|
+
}
|
|
923
|
+
return true;
|
|
924
|
+
});
|
|
925
|
+
});
|
|
926
|
+
var allPass_default = allPass;
|
|
927
|
+
|
|
928
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/always.js
|
|
929
|
+
var always = /* @__PURE__ */ _curry1(function always2(val) {
|
|
930
|
+
return function() {
|
|
931
|
+
return val;
|
|
932
|
+
};
|
|
933
|
+
});
|
|
934
|
+
var always_default = always;
|
|
935
|
+
|
|
936
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_concat.js
|
|
937
|
+
function _concat(set1, set2) {
|
|
938
|
+
set1 = set1 || [];
|
|
939
|
+
set2 = set2 || [];
|
|
940
|
+
var idx;
|
|
941
|
+
var len1 = set1.length;
|
|
942
|
+
var len2 = set2.length;
|
|
943
|
+
var result = [];
|
|
944
|
+
idx = 0;
|
|
945
|
+
while (idx < len1) {
|
|
946
|
+
result[result.length] = set1[idx];
|
|
947
|
+
idx += 1;
|
|
948
|
+
}
|
|
949
|
+
idx = 0;
|
|
950
|
+
while (idx < len2) {
|
|
951
|
+
result[result.length] = set2[idx];
|
|
952
|
+
idx += 1;
|
|
953
|
+
}
|
|
954
|
+
return result;
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_reduce.js
|
|
958
|
+
function _iterableReduce(reducer, acc, iter) {
|
|
959
|
+
var step = iter.next();
|
|
960
|
+
while (!step.done) {
|
|
961
|
+
acc = reducer(acc, step.value);
|
|
962
|
+
step = iter.next();
|
|
963
|
+
}
|
|
964
|
+
return acc;
|
|
965
|
+
}
|
|
966
|
+
function _methodReduce(reducer, acc, obj, methodName) {
|
|
967
|
+
return obj[methodName](reducer, acc);
|
|
968
|
+
}
|
|
969
|
+
var _reduce = /* @__PURE__ */ _createReduce(_arrayReduce, _methodReduce, _iterableReduce);
|
|
970
|
+
var reduce_default2 = _reduce;
|
|
971
|
+
|
|
972
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/ap.js
|
|
973
|
+
var ap = /* @__PURE__ */ _curry2(function ap2(applyF, applyX) {
|
|
974
|
+
return typeof applyX["fantasy-land/ap"] === "function" ? applyX["fantasy-land/ap"](applyF) : typeof applyF.ap === "function" ? applyF.ap(applyX) : typeof applyF === "function" ? function(x) {
|
|
975
|
+
return applyF(x)(applyX(x));
|
|
976
|
+
} : reduce_default2(function(acc, f) {
|
|
977
|
+
return _concat(acc, map_default(f, applyX));
|
|
978
|
+
}, [], applyF);
|
|
979
|
+
});
|
|
980
|
+
var ap_default = ap;
|
|
981
|
+
|
|
982
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/liftN.js
|
|
983
|
+
var liftN = /* @__PURE__ */ _curry2(function liftN2(arity, fn) {
|
|
984
|
+
var lifted = curryN_default(arity, fn);
|
|
985
|
+
return curryN_default(arity, function() {
|
|
986
|
+
return _arrayReduce(ap_default, map_default(lifted, arguments[0]), Array.prototype.slice.call(arguments, 1));
|
|
987
|
+
});
|
|
988
|
+
});
|
|
989
|
+
var liftN_default = liftN;
|
|
990
|
+
|
|
991
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/lift.js
|
|
992
|
+
var lift = /* @__PURE__ */ _curry1(function lift2(fn) {
|
|
993
|
+
return liftN_default(fn.length, fn);
|
|
994
|
+
});
|
|
995
|
+
var lift_default = lift;
|
|
996
|
+
|
|
997
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/not.js
|
|
998
|
+
var not = /* @__PURE__ */ _curry1(function not2(a) {
|
|
999
|
+
return !a;
|
|
1000
|
+
});
|
|
1001
|
+
var not_default = not;
|
|
1002
|
+
|
|
1003
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/complement.js
|
|
1004
|
+
var complement = /* @__PURE__ */ lift_default(not_default);
|
|
1005
|
+
var complement_default = complement;
|
|
1006
|
+
|
|
1007
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/cond.js
|
|
1008
|
+
var cond = /* @__PURE__ */ _curry1(function cond2(pairs) {
|
|
1009
|
+
var arity = reduce_default(max_default, 0, map_default(function(pair) {
|
|
1010
|
+
return pair[0].length;
|
|
1011
|
+
}, pairs));
|
|
1012
|
+
return _arity(arity, function() {
|
|
1013
|
+
var idx = 0;
|
|
1014
|
+
while (idx < pairs.length) {
|
|
1015
|
+
if (pairs[idx][0].apply(this, arguments)) {
|
|
1016
|
+
return pairs[idx][1].apply(this, arguments);
|
|
1017
|
+
}
|
|
1018
|
+
idx += 1;
|
|
1019
|
+
}
|
|
1020
|
+
});
|
|
1021
|
+
});
|
|
1022
|
+
var cond_default = cond;
|
|
1023
|
+
|
|
1024
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/defaultTo.js
|
|
1025
|
+
var defaultTo = /* @__PURE__ */ _curry2(function defaultTo2(d, v) {
|
|
1026
|
+
return v == null || v !== v ? d : v;
|
|
1027
|
+
});
|
|
1028
|
+
var defaultTo_default = defaultTo;
|
|
1029
|
+
|
|
1030
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_xfindIndex.js
|
|
1031
|
+
var XFindIndex = /* @__PURE__ */ (function() {
|
|
1032
|
+
function XFindIndex2(f, xf) {
|
|
1033
|
+
this.xf = xf;
|
|
1034
|
+
this.f = f;
|
|
1035
|
+
this.idx = -1;
|
|
1036
|
+
this.found = false;
|
|
1037
|
+
}
|
|
1038
|
+
XFindIndex2.prototype["@@transducer/init"] = xfBase_default.init;
|
|
1039
|
+
XFindIndex2.prototype["@@transducer/result"] = function(result) {
|
|
1040
|
+
if (!this.found) {
|
|
1041
|
+
result = this.xf["@@transducer/step"](result, -1);
|
|
1042
|
+
}
|
|
1043
|
+
return this.xf["@@transducer/result"](result);
|
|
1044
|
+
};
|
|
1045
|
+
XFindIndex2.prototype["@@transducer/step"] = function(result, input) {
|
|
1046
|
+
this.idx += 1;
|
|
1047
|
+
if (this.f(input)) {
|
|
1048
|
+
this.found = true;
|
|
1049
|
+
result = _reduced(this.xf["@@transducer/step"](result, this.idx));
|
|
1050
|
+
}
|
|
1051
|
+
return result;
|
|
1052
|
+
};
|
|
1053
|
+
return XFindIndex2;
|
|
1054
|
+
})();
|
|
1055
|
+
function _xfindIndex(f) {
|
|
1056
|
+
return function(xf) {
|
|
1057
|
+
return new XFindIndex(f, xf);
|
|
1058
|
+
};
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/findIndex.js
|
|
1062
|
+
var findIndex = /* @__PURE__ */ _curry2(/* @__PURE__ */ _dispatchable([], _xfindIndex, function findIndex2(fn, list) {
|
|
1063
|
+
var idx = 0;
|
|
1064
|
+
var len = list.length;
|
|
1065
|
+
while (idx < len) {
|
|
1066
|
+
if (fn(list[idx])) {
|
|
1067
|
+
return idx;
|
|
1068
|
+
}
|
|
1069
|
+
idx += 1;
|
|
1070
|
+
}
|
|
1071
|
+
return -1;
|
|
1072
|
+
}));
|
|
1073
|
+
var findIndex_default = findIndex;
|
|
1074
|
+
|
|
1075
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/ifElse.js
|
|
1076
|
+
var ifElse = /* @__PURE__ */ _curry3(function ifElse2(condition, onTrue, onFalse) {
|
|
1077
|
+
return curryN_default(Math.max(condition.length, onTrue.length, onFalse.length), function _ifElse() {
|
|
1078
|
+
return condition.apply(this, arguments) ? onTrue.apply(this, arguments) : onFalse.apply(this, arguments);
|
|
1079
|
+
});
|
|
1080
|
+
});
|
|
1081
|
+
var ifElse_default = ifElse;
|
|
1082
|
+
|
|
1083
|
+
// node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/isNil.js
|
|
1084
|
+
var isNil = /* @__PURE__ */ _curry1(function isNil2(x) {
|
|
1085
|
+
return x == null;
|
|
1086
|
+
});
|
|
1087
|
+
var isNil_default = isNil;
|
|
1088
|
+
|
|
1089
|
+
// src/shared/className.ts
|
|
1090
|
+
var isPresentClassName = (value) => value.trim().length > 0;
|
|
1091
|
+
var classNames = (values) => filter_default(isPresentClassName, [...values]).join(" ");
|
|
1092
|
+
|
|
1093
|
+
// src/shared/option.ts
|
|
1094
|
+
var none = { status: "none" };
|
|
1095
|
+
function some(value) {
|
|
1096
|
+
return { status: "some", value };
|
|
1097
|
+
}
|
|
1098
|
+
var isSome = (option) => option.status === "some";
|
|
1099
|
+
var fromNullable = (value) => ifElse_default(
|
|
1100
|
+
isNil_default,
|
|
1101
|
+
always_default(none),
|
|
1102
|
+
some
|
|
1103
|
+
)(value);
|
|
1104
|
+
function matchOption(option, matcher) {
|
|
1105
|
+
return ifElse_default(
|
|
1106
|
+
isSome,
|
|
1107
|
+
(someOption) => matcher.some(someOption.value),
|
|
1108
|
+
matcher.none
|
|
1109
|
+
)(option);
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
// src/shared/number.ts
|
|
1113
|
+
var isNumber = (value) => typeof value === "number";
|
|
1114
|
+
var withNumberDefault = (fallback) => (value) => matchOption(fromNullable(value), {
|
|
1115
|
+
none: () => fallback,
|
|
1116
|
+
some: (resolvedValue) => ifElse_default(
|
|
1117
|
+
isNumber,
|
|
1118
|
+
(numberValue) => defaultTo_default(fallback, numberValue),
|
|
1119
|
+
always_default(fallback)
|
|
1120
|
+
)(resolvedValue)
|
|
1121
|
+
});
|
|
1122
|
+
|
|
1123
|
+
// src/shared/result.ts
|
|
1124
|
+
function ok(value) {
|
|
1125
|
+
return { status: "ok", value };
|
|
1126
|
+
}
|
|
1127
|
+
function err(error) {
|
|
1128
|
+
return { status: "error", error };
|
|
1129
|
+
}
|
|
1130
|
+
var isOk = (result) => result.status === "ok";
|
|
1131
|
+
var andThenResult = (transform) => (result) => matchResult(result, {
|
|
1132
|
+
error: err,
|
|
1133
|
+
ok: transform
|
|
1134
|
+
});
|
|
1135
|
+
var mapResult = (transform) => (result) => andThenResult((value) => ok(transform(value)))(result);
|
|
1136
|
+
function matchResult(result, matcher) {
|
|
1137
|
+
return ifElse_default(
|
|
1138
|
+
isOk,
|
|
1139
|
+
(okResult) => matcher.ok(okResult.value),
|
|
1140
|
+
(errorResult) => matcher.error(errorResult.error)
|
|
1141
|
+
)(result);
|
|
1142
|
+
}
|
|
1143
|
+
var renderDetails = (details) => matchOption(details, {
|
|
1144
|
+
none: () => null,
|
|
1145
|
+
some: (value) => /* @__PURE__ */ jsxRuntime.jsx("p", { className: "pristine-chart-error__details", children: value })
|
|
1146
|
+
});
|
|
1147
|
+
function ChartError({
|
|
1148
|
+
title,
|
|
1149
|
+
message,
|
|
1150
|
+
details,
|
|
1151
|
+
className,
|
|
1152
|
+
role
|
|
1153
|
+
}) {
|
|
1154
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classNames(["pristine-chart-error", className]), role, children: [
|
|
1155
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "pristine-chart-error__title", children: title }),
|
|
1156
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "pristine-chart-error__message", children: message }),
|
|
1157
|
+
renderDetails(details)
|
|
1158
|
+
] });
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
// src/funnel-chart/FunnelChart.domain.ts
|
|
1162
|
+
var MINIMUM_STAGE_COUNT = 2;
|
|
1163
|
+
var funnelChartRules = {
|
|
1164
|
+
insufficientStages: () => ({
|
|
1165
|
+
type: "InsufficientStages",
|
|
1166
|
+
message: "A funnel chart needs at least two stages.",
|
|
1167
|
+
details: none
|
|
1168
|
+
}),
|
|
1169
|
+
invalidStageValue: (stage, value) => ({
|
|
1170
|
+
type: "InvalidStageValue",
|
|
1171
|
+
message: "Every funnel chart stage value must be a non-negative finite number.",
|
|
1172
|
+
details: some(`Invalid value for stage ${stage}: ${String(value)}.`)
|
|
1173
|
+
}),
|
|
1174
|
+
monotonicDecreaseViolation: (stage, previousStage) => ({
|
|
1175
|
+
type: "MonotonicDecreaseViolation",
|
|
1176
|
+
message: "Funnel chart stage values must not increase as the funnel progresses.",
|
|
1177
|
+
details: some(`${stage} is greater than previous stage ${previousStage}.`)
|
|
1178
|
+
}),
|
|
1179
|
+
emptyStageName: (index) => ({
|
|
1180
|
+
type: "EmptyStageName",
|
|
1181
|
+
message: "Every funnel chart stage needs a non-empty name.",
|
|
1182
|
+
details: some(`Empty stage at index ${String(index)}.`)
|
|
1183
|
+
}),
|
|
1184
|
+
duplicateStageName: (stage) => ({
|
|
1185
|
+
type: "DuplicateStageName",
|
|
1186
|
+
message: "Funnel chart stage names must be unique.",
|
|
1187
|
+
details: some(`Duplicate stage: ${stage}.`)
|
|
1188
|
+
}),
|
|
1189
|
+
zeroInitialValue: () => ({
|
|
1190
|
+
type: "ZeroInitialValue",
|
|
1191
|
+
message: "A funnel chart must start with a value greater than zero.",
|
|
1192
|
+
details: none
|
|
1193
|
+
})
|
|
1194
|
+
};
|
|
1195
|
+
var isFiniteNumber = (value) => allPass_default([
|
|
1196
|
+
(candidate) => typeof candidate === "number",
|
|
1197
|
+
(candidate) => Number.isFinite(candidate)
|
|
1198
|
+
])(value);
|
|
1199
|
+
var isNonNegativeFiniteNumber = (value) => allPass_default([
|
|
1200
|
+
isFiniteNumber,
|
|
1201
|
+
(candidate) => Number(candidate) >= 0
|
|
1202
|
+
])(value);
|
|
1203
|
+
var isNonEmptyString = (value) => value.trim().length > 0;
|
|
1204
|
+
var hasEnoughStages = (data) => data.length >= MINIMUM_STAGE_COUNT;
|
|
1205
|
+
var getStages = (data) => map_default(prop_default("stage"), [...data]);
|
|
1206
|
+
var getValues = (data) => map_default(prop_default("value"), [...data]);
|
|
1207
|
+
var hasOnlyNamedStages = (data) => all_default(isNonEmptyString, getStages(data));
|
|
1208
|
+
var findEmptyStageIndex = (data) => findIndex_default(complement_default(isNonEmptyString), getStages(data));
|
|
1209
|
+
var hasOnlyValidValues = (data) => all_default(isNonNegativeFiniteNumber, getValues(data));
|
|
1210
|
+
var findInvalidValueStage = (data) => defaultTo_default(
|
|
1211
|
+
{ stage: "unknown stage", value: void 0 },
|
|
1212
|
+
data.find((datum) => complement_default(isNonNegativeFiniteNumber)(datum.value))
|
|
1213
|
+
);
|
|
1214
|
+
var hasUniqueStages = (data) => {
|
|
1215
|
+
const stages = getStages(data);
|
|
1216
|
+
return stages.length === new Set(stages).size;
|
|
1217
|
+
};
|
|
1218
|
+
var findDuplicateStage = (data) => {
|
|
1219
|
+
const stages = getStages(data);
|
|
1220
|
+
return defaultTo_default(
|
|
1221
|
+
"unknown stage",
|
|
1222
|
+
stages.find((stage, index) => stages.indexOf(stage) !== index)
|
|
1223
|
+
);
|
|
1224
|
+
};
|
|
1225
|
+
var firstStageValueIsPositive = (data) => data[0].value > 0;
|
|
1226
|
+
var toStagePair = (data) => (rightStage, index) => [data[index], rightStage];
|
|
1227
|
+
var getStagePairs = (data) => data.slice(1).map(toStagePair(data));
|
|
1228
|
+
var isMonotonicallyNonIncreasing = ([previous, current]) => current.value <= previous.value;
|
|
1229
|
+
var hasMonotonicDecrease = (data) => all_default(isMonotonicallyNonIncreasing, getStagePairs(data));
|
|
1230
|
+
var firstStagePair = (data) => [data[0], data[1]];
|
|
1231
|
+
var findMonotonicViolation = (data) => defaultTo_default(
|
|
1232
|
+
firstStagePair(data),
|
|
1233
|
+
getStagePairs(data).find(complement_default(isMonotonicallyNonIncreasing))
|
|
1234
|
+
);
|
|
1235
|
+
var datasetValidators = [
|
|
1236
|
+
[complement_default(hasEnoughStages), () => err(funnelChartRules.insufficientStages())],
|
|
1237
|
+
[
|
|
1238
|
+
complement_default(hasOnlyNamedStages),
|
|
1239
|
+
(candidate) => err(funnelChartRules.emptyStageName(findEmptyStageIndex(candidate)))
|
|
1240
|
+
],
|
|
1241
|
+
[
|
|
1242
|
+
complement_default(hasOnlyValidValues),
|
|
1243
|
+
(candidate) => {
|
|
1244
|
+
const invalidStage = findInvalidValueStage(candidate);
|
|
1245
|
+
return err(funnelChartRules.invalidStageValue(invalidStage.stage, invalidStage.value));
|
|
1246
|
+
}
|
|
1247
|
+
],
|
|
1248
|
+
[
|
|
1249
|
+
complement_default(hasUniqueStages),
|
|
1250
|
+
(candidate) => err(funnelChartRules.duplicateStageName(findDuplicateStage(candidate)))
|
|
1251
|
+
],
|
|
1252
|
+
[complement_default(firstStageValueIsPositive), () => err(funnelChartRules.zeroInitialValue())],
|
|
1253
|
+
[
|
|
1254
|
+
complement_default(hasMonotonicDecrease),
|
|
1255
|
+
(candidate) => {
|
|
1256
|
+
const [previousStage, stage] = findMonotonicViolation(candidate);
|
|
1257
|
+
return err(funnelChartRules.monotonicDecreaseViolation(stage.stage, previousStage.stage));
|
|
1258
|
+
}
|
|
1259
|
+
],
|
|
1260
|
+
[always_default(true), (candidate) => ok(candidate)]
|
|
1261
|
+
];
|
|
1262
|
+
var validateFunnelChartInput = (input) => cond_default(datasetValidators)(input.data);
|
|
1263
|
+
var toDropOff = (previous, current) => previous.value - current.value;
|
|
1264
|
+
var previousStageIsZero = (previous) => previous.value === 0;
|
|
1265
|
+
var toDropOffRate = (previous, dropOff) => ifElse_default(
|
|
1266
|
+
previousStageIsZero,
|
|
1267
|
+
always_default(0),
|
|
1268
|
+
(candidate) => dropOff / candidate.value
|
|
1269
|
+
)(previous);
|
|
1270
|
+
var toConversionRate = (previous, current) => ifElse_default(
|
|
1271
|
+
previousStageIsZero,
|
|
1272
|
+
always_default(1),
|
|
1273
|
+
(candidate) => current.value / candidate.value
|
|
1274
|
+
)(previous);
|
|
1275
|
+
var toFunnelStage = (data) => (datum, index) => {
|
|
1276
|
+
return matchOption(fromNullable(data[index - 1]), {
|
|
1277
|
+
none: () => ({
|
|
1278
|
+
...datum,
|
|
1279
|
+
index,
|
|
1280
|
+
dropOff: none,
|
|
1281
|
+
dropOffRate: none,
|
|
1282
|
+
conversionRate: none
|
|
1283
|
+
}),
|
|
1284
|
+
some: (previousStage) => {
|
|
1285
|
+
const dropOff = toDropOff(previousStage, datum);
|
|
1286
|
+
return {
|
|
1287
|
+
...datum,
|
|
1288
|
+
index,
|
|
1289
|
+
dropOff: some(dropOff),
|
|
1290
|
+
dropOffRate: some(toDropOffRate(previousStage, dropOff)),
|
|
1291
|
+
conversionRate: some(toConversionRate(previousStage, datum))
|
|
1292
|
+
};
|
|
1293
|
+
}
|
|
1294
|
+
});
|
|
1295
|
+
};
|
|
1296
|
+
var computeFunnelStages = (data) => data.map(toFunnelStage(data));
|
|
1297
|
+
function computeFunnelChart(input) {
|
|
1298
|
+
return mapResult(
|
|
1299
|
+
computeFunnelStages
|
|
1300
|
+
)(validateFunnelChartInput(input));
|
|
1301
|
+
}
|
|
1302
|
+
var FUNNEL_CHART_MARGIN = {
|
|
1303
|
+
top: 22,
|
|
1304
|
+
right: 132,
|
|
1305
|
+
bottom: 22,
|
|
1306
|
+
left: 120
|
|
1307
|
+
};
|
|
1308
|
+
var STAGE_GAP = 4;
|
|
1309
|
+
var getMaximumValue = (stages) => withNumberDefault(0)(d3.max(map_default(prop_default("value"), [...stages])));
|
|
1310
|
+
var isZero = (value) => value === 0;
|
|
1311
|
+
var toScaledWidth = (plotWidth, maximumValue) => (value) => ifElse_default(
|
|
1312
|
+
isZero,
|
|
1313
|
+
always_default(0),
|
|
1314
|
+
(candidate) => value / candidate * plotWidth
|
|
1315
|
+
)(maximumValue);
|
|
1316
|
+
var toPath = (centerX, y, height, topWidth, bottomWidth) => {
|
|
1317
|
+
const topLeft = centerX - topWidth / 2;
|
|
1318
|
+
const topRight = centerX + topWidth / 2;
|
|
1319
|
+
const bottomLeft = centerX - bottomWidth / 2;
|
|
1320
|
+
const bottomRight = centerX + bottomWidth / 2;
|
|
1321
|
+
return `M ${topLeft} ${y} L ${topRight} ${y} L ${bottomRight} ${y + height} L ${bottomLeft} ${y + height} Z`;
|
|
1322
|
+
};
|
|
1323
|
+
var getNextStageValue = (stages, stage) => matchOption(fromNullable(stages[stage.index + 1]), {
|
|
1324
|
+
none: () => stage.value,
|
|
1325
|
+
some: (nextStage) => nextStage.value
|
|
1326
|
+
});
|
|
1327
|
+
var buildFunnelChartModel = (stages, width, height) => {
|
|
1328
|
+
const plotLeft = FUNNEL_CHART_MARGIN.left;
|
|
1329
|
+
const plotRight = width - FUNNEL_CHART_MARGIN.right;
|
|
1330
|
+
const plotTop = FUNNEL_CHART_MARGIN.top;
|
|
1331
|
+
const plotBottom = height - FUNNEL_CHART_MARGIN.bottom;
|
|
1332
|
+
const plotWidth = plotRight - plotLeft;
|
|
1333
|
+
const centerX = plotLeft + plotWidth / 2;
|
|
1334
|
+
const totalGap = Math.max(0, stages.length - 1) * STAGE_GAP;
|
|
1335
|
+
const stageHeight = (plotBottom - plotTop - totalGap) / stages.length;
|
|
1336
|
+
const maximumValue = getMaximumValue(stages);
|
|
1337
|
+
const scaledWidth = toScaledWidth(plotWidth, maximumValue);
|
|
1338
|
+
const toRenderedStage = (stage) => {
|
|
1339
|
+
const y = plotTop + stage.index * (stageHeight + STAGE_GAP);
|
|
1340
|
+
const topWidth = scaledWidth(stage.value);
|
|
1341
|
+
const bottomWidth = scaledWidth(getNextStageValue(stages, stage));
|
|
1342
|
+
const stageWidth = Math.max(topWidth, bottomWidth);
|
|
1343
|
+
return {
|
|
1344
|
+
...stage,
|
|
1345
|
+
x: centerX - stageWidth / 2,
|
|
1346
|
+
y,
|
|
1347
|
+
width: stageWidth,
|
|
1348
|
+
height: stageHeight,
|
|
1349
|
+
centerX,
|
|
1350
|
+
centerY: y + stageHeight / 2,
|
|
1351
|
+
path: toPath(centerX, y, stageHeight, topWidth, bottomWidth),
|
|
1352
|
+
hitAreaX: plotLeft,
|
|
1353
|
+
hitAreaWidth: plotWidth,
|
|
1354
|
+
labelX: plotLeft - 12,
|
|
1355
|
+
valueX: plotRight + 12
|
|
1356
|
+
};
|
|
1357
|
+
};
|
|
1358
|
+
return {
|
|
1359
|
+
stages: map_default(toRenderedStage, [...stages]),
|
|
1360
|
+
plotLeft,
|
|
1361
|
+
plotRight,
|
|
1362
|
+
plotTop,
|
|
1363
|
+
plotBottom
|
|
1364
|
+
};
|
|
1365
|
+
};
|
|
1366
|
+
function FunnelChartCaption({ caption }) {
|
|
1367
|
+
return matchOption(caption, {
|
|
1368
|
+
none: () => null,
|
|
1369
|
+
some: (text) => /* @__PURE__ */ jsxRuntime.jsx("figcaption", { className: "pristine-funnel-chart__caption", children: text })
|
|
1370
|
+
});
|
|
1371
|
+
}
|
|
1372
|
+
function FunnelChartSegment({ stage }) {
|
|
1373
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1374
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { className: "pristine-funnel-chart__segment", d: stage.path }),
|
|
1375
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1376
|
+
"rect",
|
|
1377
|
+
{
|
|
1378
|
+
className: "pristine-funnel-chart__hit-area",
|
|
1379
|
+
x: stage.hitAreaX,
|
|
1380
|
+
y: stage.y,
|
|
1381
|
+
width: stage.hitAreaWidth,
|
|
1382
|
+
height: stage.height
|
|
1383
|
+
}
|
|
1384
|
+
)
|
|
1385
|
+
] });
|
|
1386
|
+
}
|
|
1387
|
+
function FunnelChartStageLabel({ stage }) {
|
|
1388
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1389
|
+
"text",
|
|
1390
|
+
{
|
|
1391
|
+
className: "pristine-funnel-chart__label",
|
|
1392
|
+
x: stage.labelX,
|
|
1393
|
+
y: stage.centerY,
|
|
1394
|
+
textAnchor: "end",
|
|
1395
|
+
children: stage.stage
|
|
1396
|
+
}
|
|
1397
|
+
);
|
|
1398
|
+
}
|
|
1399
|
+
function FunnelChartValueLabel({
|
|
1400
|
+
stage,
|
|
1401
|
+
formatValue,
|
|
1402
|
+
formatPercentage
|
|
1403
|
+
}) {
|
|
1404
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1405
|
+
"text",
|
|
1406
|
+
{
|
|
1407
|
+
className: "pristine-funnel-chart__value",
|
|
1408
|
+
x: stage.valueX,
|
|
1409
|
+
y: stage.centerY - 5,
|
|
1410
|
+
textAnchor: "start",
|
|
1411
|
+
children: [
|
|
1412
|
+
/* @__PURE__ */ jsxRuntime.jsx("tspan", { x: stage.valueX, children: formatValue(stage.value) }),
|
|
1413
|
+
matchOption(stage.conversionRate, {
|
|
1414
|
+
none: () => null,
|
|
1415
|
+
some: (conversionRate) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1416
|
+
"tspan",
|
|
1417
|
+
{
|
|
1418
|
+
className: "pristine-funnel-chart__conversion",
|
|
1419
|
+
x: stage.valueX,
|
|
1420
|
+
dy: 14,
|
|
1421
|
+
children: formatPercentage(conversionRate)
|
|
1422
|
+
}
|
|
1423
|
+
)
|
|
1424
|
+
})
|
|
1425
|
+
]
|
|
1426
|
+
}
|
|
1427
|
+
);
|
|
1428
|
+
}
|
|
1429
|
+
var getAccessibleLabel = (stage, formatValue, formatPercentage) => matchOption(stage.dropOff, {
|
|
1430
|
+
none: () => `${stage.stage}: ${formatValue(stage.value)}`,
|
|
1431
|
+
some: (dropOff) => `${stage.stage}: ${formatValue(stage.value)}, drop-off ${formatValue(dropOff)}, conversion ${matchOption(
|
|
1432
|
+
stage.conversionRate,
|
|
1433
|
+
{
|
|
1434
|
+
none: () => "not available",
|
|
1435
|
+
some: formatPercentage
|
|
1436
|
+
}
|
|
1437
|
+
)}`
|
|
1438
|
+
});
|
|
1439
|
+
function FunnelChartStage({
|
|
1440
|
+
active,
|
|
1441
|
+
stage,
|
|
1442
|
+
formatValue,
|
|
1443
|
+
formatPercentage,
|
|
1444
|
+
onActivate,
|
|
1445
|
+
onDeactivate,
|
|
1446
|
+
showValues
|
|
1447
|
+
}) {
|
|
1448
|
+
const activeClassName = ifElse_default(
|
|
1449
|
+
always_default(active),
|
|
1450
|
+
always_default("pristine-funnel-chart__stage--active"),
|
|
1451
|
+
always_default("")
|
|
1452
|
+
)(active);
|
|
1453
|
+
const renderValueLabel = ifElse_default(
|
|
1454
|
+
always_default(showValues),
|
|
1455
|
+
() => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1456
|
+
FunnelChartValueLabel,
|
|
1457
|
+
{
|
|
1458
|
+
formatPercentage,
|
|
1459
|
+
formatValue,
|
|
1460
|
+
stage
|
|
1461
|
+
}
|
|
1462
|
+
),
|
|
1463
|
+
always_default(null)
|
|
1464
|
+
);
|
|
1465
|
+
const handleKeyDown = (event) => ifElse_default(
|
|
1466
|
+
(candidate) => candidate.key === "Escape",
|
|
1467
|
+
() => onDeactivate(),
|
|
1468
|
+
always_default(void 0)
|
|
1469
|
+
)(event);
|
|
1470
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1471
|
+
"g",
|
|
1472
|
+
{
|
|
1473
|
+
className: classNames([
|
|
1474
|
+
"pristine-funnel-chart__stage",
|
|
1475
|
+
`pristine-funnel-chart__stage--tone-${String(stage.index % 5 + 1)}`,
|
|
1476
|
+
activeClassName
|
|
1477
|
+
]),
|
|
1478
|
+
role: "img",
|
|
1479
|
+
"aria-label": getAccessibleLabel(stage, formatValue, formatPercentage),
|
|
1480
|
+
tabIndex: 0,
|
|
1481
|
+
onBlur: onDeactivate,
|
|
1482
|
+
onClick: onActivate,
|
|
1483
|
+
onFocus: onActivate,
|
|
1484
|
+
onKeyDown: handleKeyDown,
|
|
1485
|
+
onMouseEnter: onActivate,
|
|
1486
|
+
onMouseLeave: onDeactivate,
|
|
1487
|
+
children: [
|
|
1488
|
+
/* @__PURE__ */ jsxRuntime.jsx(FunnelChartSegment, { stage }),
|
|
1489
|
+
/* @__PURE__ */ jsxRuntime.jsx(FunnelChartStageLabel, { stage }),
|
|
1490
|
+
renderValueLabel()
|
|
1491
|
+
]
|
|
1492
|
+
}
|
|
1493
|
+
);
|
|
1494
|
+
}
|
|
1495
|
+
function FunnelChartStages({
|
|
1496
|
+
activeStage,
|
|
1497
|
+
chart,
|
|
1498
|
+
formatPercentage,
|
|
1499
|
+
formatValue,
|
|
1500
|
+
onActivate,
|
|
1501
|
+
onDeactivate,
|
|
1502
|
+
showValues
|
|
1503
|
+
}) {
|
|
1504
|
+
return /* @__PURE__ */ jsxRuntime.jsx("g", { className: "pristine-funnel-chart__stages", children: chart.stages.map((stage) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1505
|
+
FunnelChartStage,
|
|
1506
|
+
{
|
|
1507
|
+
active: stage.stage === activeStage,
|
|
1508
|
+
formatPercentage,
|
|
1509
|
+
formatValue,
|
|
1510
|
+
onActivate: () => onActivate(stage.stage),
|
|
1511
|
+
onDeactivate,
|
|
1512
|
+
showValues,
|
|
1513
|
+
stage
|
|
1514
|
+
},
|
|
1515
|
+
stage.stage
|
|
1516
|
+
)) });
|
|
1517
|
+
}
|
|
1518
|
+
var TOOLTIP_HEIGHT = 22;
|
|
1519
|
+
var TOOLTIP_MIN_WIDTH = 64;
|
|
1520
|
+
var TOOLTIP_PADDING_X = 8;
|
|
1521
|
+
var TOOLTIP_CHAR_WIDTH = 7;
|
|
1522
|
+
var VIEWBOX_PADDING = 4;
|
|
1523
|
+
var getTooltipWidth = (label) => Math.max(TOOLTIP_MIN_WIDTH, label.length * TOOLTIP_CHAR_WIDTH + TOOLTIP_PADDING_X * 2);
|
|
1524
|
+
var clamp = (minimum, maximum, value) => Math.min(Math.max(value, minimum), maximum);
|
|
1525
|
+
var getTooltipLabel = (stage, formatValue, formatPercentage) => matchOption(stage.dropOff, {
|
|
1526
|
+
none: () => `${stage.stage}: ${formatValue(stage.value)}`,
|
|
1527
|
+
some: (dropOff) => `${stage.stage}: ${formatValue(stage.value)} | Drop-off ${formatValue(dropOff)} | ${matchOption(
|
|
1528
|
+
stage.dropOffRate,
|
|
1529
|
+
{
|
|
1530
|
+
none: () => "0%",
|
|
1531
|
+
some: formatPercentage
|
|
1532
|
+
}
|
|
1533
|
+
)} lost`
|
|
1534
|
+
});
|
|
1535
|
+
function FunnelChartTooltip({
|
|
1536
|
+
stage,
|
|
1537
|
+
formatValue,
|
|
1538
|
+
formatPercentage,
|
|
1539
|
+
height,
|
|
1540
|
+
width
|
|
1541
|
+
}) {
|
|
1542
|
+
const label = getTooltipLabel(stage, formatValue, formatPercentage);
|
|
1543
|
+
const tooltipWidth = getTooltipWidth(label);
|
|
1544
|
+
const x = clamp(
|
|
1545
|
+
VIEWBOX_PADDING,
|
|
1546
|
+
width - tooltipWidth - VIEWBOX_PADDING,
|
|
1547
|
+
stage.centerX - tooltipWidth / 2
|
|
1548
|
+
);
|
|
1549
|
+
const y = clamp(
|
|
1550
|
+
VIEWBOX_PADDING,
|
|
1551
|
+
height - TOOLTIP_HEIGHT - VIEWBOX_PADDING,
|
|
1552
|
+
stage.centerY - TOOLTIP_HEIGHT / 2
|
|
1553
|
+
);
|
|
1554
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { className: "pristine-funnel-chart__tooltip", "aria-hidden": "true", children: [
|
|
1555
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1556
|
+
"rect",
|
|
1557
|
+
{
|
|
1558
|
+
className: "pristine-funnel-chart__tooltip-background",
|
|
1559
|
+
x,
|
|
1560
|
+
y,
|
|
1561
|
+
width: tooltipWidth,
|
|
1562
|
+
height: TOOLTIP_HEIGHT,
|
|
1563
|
+
rx: 4
|
|
1564
|
+
}
|
|
1565
|
+
),
|
|
1566
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1567
|
+
"text",
|
|
1568
|
+
{
|
|
1569
|
+
className: "pristine-funnel-chart__tooltip-text",
|
|
1570
|
+
x: x + tooltipWidth / 2,
|
|
1571
|
+
y: y + TOOLTIP_HEIGHT / 2,
|
|
1572
|
+
textAnchor: "middle",
|
|
1573
|
+
children: label
|
|
1574
|
+
}
|
|
1575
|
+
)
|
|
1576
|
+
] });
|
|
1577
|
+
}
|
|
1578
|
+
function FunnelChartSvg({
|
|
1579
|
+
ariaLabel,
|
|
1580
|
+
chart,
|
|
1581
|
+
formatPercentage,
|
|
1582
|
+
formatValue,
|
|
1583
|
+
height,
|
|
1584
|
+
showValues,
|
|
1585
|
+
width
|
|
1586
|
+
}) {
|
|
1587
|
+
const [activeStage, setActiveStage] = react.useState(null);
|
|
1588
|
+
const activeStages = chart.stages.filter((stage) => stage.stage === activeStage);
|
|
1589
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1590
|
+
"svg",
|
|
1591
|
+
{
|
|
1592
|
+
className: "pristine-funnel-chart__svg",
|
|
1593
|
+
viewBox: `0 0 ${width} ${height}`,
|
|
1594
|
+
role: "img",
|
|
1595
|
+
"aria-label": ariaLabel,
|
|
1596
|
+
children: [
|
|
1597
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1598
|
+
"rect",
|
|
1599
|
+
{
|
|
1600
|
+
className: "pristine-funnel-chart__plot",
|
|
1601
|
+
x: chart.plotLeft,
|
|
1602
|
+
y: chart.plotTop,
|
|
1603
|
+
width: chart.plotRight - chart.plotLeft,
|
|
1604
|
+
height: chart.plotBottom - chart.plotTop
|
|
1605
|
+
}
|
|
1606
|
+
),
|
|
1607
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1608
|
+
FunnelChartStages,
|
|
1609
|
+
{
|
|
1610
|
+
activeStage,
|
|
1611
|
+
chart,
|
|
1612
|
+
formatPercentage,
|
|
1613
|
+
formatValue,
|
|
1614
|
+
onActivate: setActiveStage,
|
|
1615
|
+
onDeactivate: () => setActiveStage(null),
|
|
1616
|
+
showValues
|
|
1617
|
+
}
|
|
1618
|
+
),
|
|
1619
|
+
activeStages.map((stage) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1620
|
+
FunnelChartTooltip,
|
|
1621
|
+
{
|
|
1622
|
+
formatPercentage,
|
|
1623
|
+
formatValue,
|
|
1624
|
+
height,
|
|
1625
|
+
stage,
|
|
1626
|
+
width
|
|
1627
|
+
},
|
|
1628
|
+
stage.stage
|
|
1629
|
+
))
|
|
1630
|
+
]
|
|
1631
|
+
}
|
|
1632
|
+
);
|
|
1633
|
+
}
|
|
1634
|
+
function FunnelChartFigure({
|
|
1635
|
+
ariaLabel,
|
|
1636
|
+
caption,
|
|
1637
|
+
chart,
|
|
1638
|
+
className,
|
|
1639
|
+
formatPercentage,
|
|
1640
|
+
formatValue,
|
|
1641
|
+
height,
|
|
1642
|
+
showValues,
|
|
1643
|
+
width
|
|
1644
|
+
}) {
|
|
1645
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("figure", { className: classNames(["pristine-funnel-chart", className]), "aria-label": ariaLabel, children: [
|
|
1646
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1647
|
+
FunnelChartSvg,
|
|
1648
|
+
{
|
|
1649
|
+
ariaLabel,
|
|
1650
|
+
chart,
|
|
1651
|
+
formatPercentage,
|
|
1652
|
+
formatValue,
|
|
1653
|
+
height,
|
|
1654
|
+
showValues,
|
|
1655
|
+
width
|
|
1656
|
+
}
|
|
1657
|
+
),
|
|
1658
|
+
/* @__PURE__ */ jsxRuntime.jsx(FunnelChartCaption, { caption })
|
|
1659
|
+
] });
|
|
1660
|
+
}
|
|
1661
|
+
function FunnelChart({
|
|
1662
|
+
data,
|
|
1663
|
+
width,
|
|
1664
|
+
height,
|
|
1665
|
+
ariaLabel,
|
|
1666
|
+
className,
|
|
1667
|
+
caption,
|
|
1668
|
+
showValues,
|
|
1669
|
+
formatValue,
|
|
1670
|
+
formatPercentage
|
|
1671
|
+
}) {
|
|
1672
|
+
const result = react.useMemo(() => computeFunnelChart({ data }), [data]);
|
|
1673
|
+
return matchResult(result, {
|
|
1674
|
+
error: (error) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1675
|
+
ChartError,
|
|
1676
|
+
{
|
|
1677
|
+
className: classNames(["pristine-funnel-chart__error", className]),
|
|
1678
|
+
title: "Chart unavailable",
|
|
1679
|
+
message: error.message,
|
|
1680
|
+
details: error.details,
|
|
1681
|
+
role: "alert"
|
|
1682
|
+
}
|
|
1683
|
+
),
|
|
1684
|
+
ok: (stages) => {
|
|
1685
|
+
const chart = buildFunnelChartModel(stages, width, height);
|
|
1686
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1687
|
+
FunnelChartFigure,
|
|
1688
|
+
{
|
|
1689
|
+
ariaLabel,
|
|
1690
|
+
caption,
|
|
1691
|
+
chart,
|
|
1692
|
+
className,
|
|
1693
|
+
formatPercentage,
|
|
1694
|
+
formatValue,
|
|
1695
|
+
height,
|
|
1696
|
+
showValues,
|
|
1697
|
+
width
|
|
1698
|
+
}
|
|
1699
|
+
);
|
|
1700
|
+
}
|
|
1701
|
+
});
|
|
1702
|
+
}
|
|
1703
|
+
|
|
1704
|
+
// src/funnel-chart/FunnelChart.defaults.ts
|
|
1705
|
+
var formatFunnelChartNumber = (value) => String(value);
|
|
1706
|
+
var formatFunnelChartPercentage = (rate) => `${(rate * 100).toFixed(0)}%`;
|
|
1707
|
+
var DEFAULT_FUNNEL_CHART_VIEW_PROPS = {
|
|
1708
|
+
width: 480,
|
|
1709
|
+
height: 280,
|
|
1710
|
+
ariaLabel: "Funnel chart",
|
|
1711
|
+
className: "",
|
|
1712
|
+
caption: none,
|
|
1713
|
+
showValues: true,
|
|
1714
|
+
formatValue: formatFunnelChartNumber,
|
|
1715
|
+
formatPercentage: formatFunnelChartPercentage
|
|
1716
|
+
};
|
|
1717
|
+
|
|
1718
|
+
exports.DEFAULT_FUNNEL_CHART_VIEW_PROPS = DEFAULT_FUNNEL_CHART_VIEW_PROPS;
|
|
1719
|
+
exports.FunnelChart = FunnelChart;
|
|
1720
|
+
exports.computeFunnelChart = computeFunnelChart;
|
|
1721
|
+
exports.formatFunnelChartNumber = formatFunnelChartNumber;
|
|
1722
|
+
exports.formatFunnelChartPercentage = formatFunnelChartPercentage;
|
|
1723
|
+
exports.validateFunnelChartInput = validateFunnelChartInput;
|
|
1724
|
+
//# sourceMappingURL=index.cjs.map
|
|
1725
|
+
//# sourceMappingURL=index.cjs.map
|