@papernote/ui 1.11.2 → 1.11.3
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/components/FunnelChart.d.ts.map +1 -1
- package/dist/index.esm.js +49 -39
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +49 -39
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/FunnelChart.tsx +5 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FunnelChart.d.ts","sourceRoot":"","sources":["../../src/components/FunnelChart.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,WAAW;IAC1B,iBAAiB;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,mDAAmD;IACnD,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,6BAA6B;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sDAAsD;IACtD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,gCAAgC;IAChC,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAoBD;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,MAAM,EACN,MAAY,EACZ,cAAqB,EACrB,YAAY,EACZ,SAAc,GACf,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"FunnelChart.d.ts","sourceRoot":"","sources":["../../src/components/FunnelChart.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,WAAW;IAC1B,iBAAiB;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,mDAAmD;IACnD,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,6BAA6B;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sDAAsD;IACtD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,gCAAgC;IAChC,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAoBD;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,MAAM,EACN,MAAY,EACZ,cAAqB,EACrB,YAAY,EACZ,SAAc,GACf,EAAE,gBAAgB,kDAsGlB"}
|
package/dist/index.esm.js
CHANGED
|
@@ -12310,16 +12310,18 @@ function FunnelChart({ stages, height = 300, showConversion = true, onStageClick
|
|
|
12310
12310
|
return null;
|
|
12311
12311
|
const maxCount = Math.max(...stages.map(s => s.count), 1);
|
|
12312
12312
|
const stageHeight = height / stages.length;
|
|
12313
|
-
const svgWidth =
|
|
12313
|
+
const svgWidth = 440;
|
|
12314
12314
|
const padding = 20;
|
|
12315
|
-
const
|
|
12315
|
+
const leftLabelSpace = 40; // Space for conversion rate labels on left
|
|
12316
|
+
const rightLabelSpace = 160; // Space for stage name + value labels on right
|
|
12317
|
+
const funnelWidth = svgWidth - padding * 2 - leftLabelSpace - rightLabelSpace;
|
|
12316
12318
|
return (jsx("div", { className: className, children: jsx("svg", { width: "100%", viewBox: `0 0 ${svgWidth} ${height}`, preserveAspectRatio: "xMidYMid meet", children: stages.map((stage, idx) => {
|
|
12317
12319
|
const ratio = stage.count / maxCount;
|
|
12318
12320
|
const nextRatio = idx < stages.length - 1 ? stages[idx + 1].count / maxCount : ratio;
|
|
12319
12321
|
const y = idx * stageHeight;
|
|
12320
12322
|
const topWidth = funnelWidth * ratio;
|
|
12321
12323
|
const bottomWidth = funnelWidth * nextRatio;
|
|
12322
|
-
const centerX = padding + funnelWidth / 2;
|
|
12324
|
+
const centerX = padding + leftLabelSpace + funnelWidth / 2;
|
|
12323
12325
|
const color = stage.color || defaultColors[idx % defaultColors.length];
|
|
12324
12326
|
// Conversion rate
|
|
12325
12327
|
const conversionRate = idx > 0 && stages[idx - 1].count > 0
|
|
@@ -15670,44 +15672,52 @@ function getAugmentedNamespace(n) {
|
|
|
15670
15672
|
* (A1, A1:C5, ...)
|
|
15671
15673
|
*/
|
|
15672
15674
|
|
|
15673
|
-
|
|
15675
|
+
var collection;
|
|
15676
|
+
var hasRequiredCollection;
|
|
15677
|
+
|
|
15678
|
+
function requireCollection () {
|
|
15679
|
+
if (hasRequiredCollection) return collection;
|
|
15680
|
+
hasRequiredCollection = 1;
|
|
15681
|
+
class Collection {
|
|
15674
15682
|
|
|
15675
|
-
|
|
15676
|
-
|
|
15677
|
-
|
|
15678
|
-
|
|
15679
|
-
|
|
15680
|
-
|
|
15681
|
-
|
|
15682
|
-
|
|
15683
|
-
|
|
15684
|
-
|
|
15685
|
-
|
|
15683
|
+
constructor(data, refs) {
|
|
15684
|
+
if (data == null && refs == null) {
|
|
15685
|
+
this._data = [];
|
|
15686
|
+
this._refs = [];
|
|
15687
|
+
} else {
|
|
15688
|
+
if (data.length !== refs.length)
|
|
15689
|
+
throw Error('Collection: data length should match references length.');
|
|
15690
|
+
this._data = data;
|
|
15691
|
+
this._refs = refs;
|
|
15692
|
+
}
|
|
15693
|
+
}
|
|
15686
15694
|
|
|
15687
|
-
|
|
15688
|
-
|
|
15689
|
-
|
|
15695
|
+
get data() {
|
|
15696
|
+
return this._data;
|
|
15697
|
+
}
|
|
15690
15698
|
|
|
15691
|
-
|
|
15692
|
-
|
|
15693
|
-
|
|
15699
|
+
get refs() {
|
|
15700
|
+
return this._refs;
|
|
15701
|
+
}
|
|
15694
15702
|
|
|
15695
|
-
|
|
15696
|
-
|
|
15697
|
-
|
|
15703
|
+
get length() {
|
|
15704
|
+
return this._data.length;
|
|
15705
|
+
}
|
|
15698
15706
|
|
|
15699
|
-
|
|
15700
|
-
|
|
15701
|
-
|
|
15702
|
-
|
|
15703
|
-
|
|
15704
|
-
|
|
15705
|
-
|
|
15706
|
-
|
|
15707
|
-
|
|
15708
|
-
}
|
|
15707
|
+
/**
|
|
15708
|
+
* Add data and references to this collection.
|
|
15709
|
+
* @param {{}} obj - data
|
|
15710
|
+
* @param {{}} ref - reference
|
|
15711
|
+
*/
|
|
15712
|
+
add(obj, ref) {
|
|
15713
|
+
this._data.push(obj);
|
|
15714
|
+
this._refs.push(ref);
|
|
15715
|
+
}
|
|
15716
|
+
}
|
|
15709
15717
|
|
|
15710
|
-
|
|
15718
|
+
collection = Collection;
|
|
15719
|
+
return collection;
|
|
15720
|
+
}
|
|
15711
15721
|
|
|
15712
15722
|
var helpers;
|
|
15713
15723
|
var hasRequiredHelpers;
|
|
@@ -15716,7 +15726,7 @@ function requireHelpers () {
|
|
|
15716
15726
|
if (hasRequiredHelpers) return helpers;
|
|
15717
15727
|
hasRequiredHelpers = 1;
|
|
15718
15728
|
const FormulaError = requireError();
|
|
15719
|
-
const Collection =
|
|
15729
|
+
const Collection = requireCollection();
|
|
15720
15730
|
|
|
15721
15731
|
const Types = {
|
|
15722
15732
|
NUMBER: 0,
|
|
@@ -25370,7 +25380,7 @@ var engineering = EngineeringFunctions;
|
|
|
25370
25380
|
|
|
25371
25381
|
const FormulaError$b = requireError();
|
|
25372
25382
|
const {FormulaHelpers: FormulaHelpers$8, Types: Types$6, WildCard, Address: Address$3} = requireHelpers();
|
|
25373
|
-
const Collection$2 =
|
|
25383
|
+
const Collection$2 = requireCollection();
|
|
25374
25384
|
const H$5 = FormulaHelpers$8;
|
|
25375
25385
|
|
|
25376
25386
|
const ReferenceFunctions$1 = {
|
|
@@ -36998,7 +37008,7 @@ var parsing = {
|
|
|
36998
37008
|
const FormulaError$4 = requireError();
|
|
36999
37009
|
const {Address: Address$1} = requireHelpers();
|
|
37000
37010
|
const {Prefix: Prefix$1, Postfix: Postfix$1, Infix: Infix$1, Operators: Operators$1} = operators;
|
|
37001
|
-
const Collection$1 =
|
|
37011
|
+
const Collection$1 = requireCollection();
|
|
37002
37012
|
const MAX_ROW$1 = 1048576, MAX_COLUMN$1 = 16384;
|
|
37003
37013
|
const {NotAllInputParsedException} = require$$4;
|
|
37004
37014
|
|
|
@@ -37760,7 +37770,7 @@ var hooks$1 = {
|
|
|
37760
37770
|
const FormulaError$2 = requireError();
|
|
37761
37771
|
const {FormulaHelpers: FormulaHelpers$1, Types, Address} = requireHelpers();
|
|
37762
37772
|
const {Prefix, Postfix, Infix, Operators} = operators;
|
|
37763
|
-
const Collection =
|
|
37773
|
+
const Collection = requireCollection();
|
|
37764
37774
|
const MAX_ROW = 1048576, MAX_COLUMN = 16384;
|
|
37765
37775
|
|
|
37766
37776
|
let Utils$1 = class Utils {
|