@elliemae/ds-dataviz 3.6.0-next.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.
Files changed (129) hide show
  1. package/dist/cjs/graphs/Chart/Chart.js +61 -0
  2. package/dist/cjs/graphs/Chart/Chart.js.map +7 -0
  3. package/dist/cjs/graphs/Chart/ChartContext.js +67 -0
  4. package/dist/cjs/graphs/Chart/ChartContext.js.map +7 -0
  5. package/dist/cjs/graphs/Chart/Pie.js +49 -0
  6. package/dist/cjs/graphs/Chart/Pie.js.map +7 -0
  7. package/dist/cjs/graphs/Chart/config/useChart.js +109 -0
  8. package/dist/cjs/graphs/Chart/config/useChart.js.map +7 -0
  9. package/dist/cjs/graphs/Chart/config/useKeyboardNavigation.js +119 -0
  10. package/dist/cjs/graphs/Chart/config/useKeyboardNavigation.js.map +7 -0
  11. package/dist/cjs/graphs/Chart/config/useScales.js +107 -0
  12. package/dist/cjs/graphs/Chart/config/useScales.js.map +7 -0
  13. package/dist/cjs/graphs/Chart/helpers/index.js +83 -0
  14. package/dist/cjs/graphs/Chart/helpers/index.js.map +7 -0
  15. package/dist/cjs/graphs/Chart/index.js +26 -0
  16. package/dist/cjs/graphs/Chart/index.js.map +7 -0
  17. package/dist/cjs/graphs/Chart/parts/ActivePoint.js +83 -0
  18. package/dist/cjs/graphs/Chart/parts/ActivePoint.js.map +7 -0
  19. package/dist/cjs/graphs/Chart/parts/AxisBottom.js +86 -0
  20. package/dist/cjs/graphs/Chart/parts/AxisBottom.js.map +7 -0
  21. package/dist/cjs/graphs/Chart/parts/AxisLeft.js +79 -0
  22. package/dist/cjs/graphs/Chart/parts/AxisLeft.js.map +7 -0
  23. package/dist/cjs/graphs/Chart/parts/AxisRight.js +63 -0
  24. package/dist/cjs/graphs/Chart/parts/AxisRight.js.map +7 -0
  25. package/dist/cjs/graphs/Chart/parts/ChartContainer.js +78 -0
  26. package/dist/cjs/graphs/Chart/parts/ChartContainer.js.map +7 -0
  27. package/dist/cjs/graphs/Chart/parts/ColorLegend.js +70 -0
  28. package/dist/cjs/graphs/Chart/parts/ColorLegend.js.map +7 -0
  29. package/dist/cjs/graphs/Chart/parts/FocusableRegion.js +116 -0
  30. package/dist/cjs/graphs/Chart/parts/FocusableRegion.js.map +7 -0
  31. package/dist/cjs/graphs/Chart/parts/Scrapper.js +130 -0
  32. package/dist/cjs/graphs/Chart/parts/Scrapper.js.map +7 -0
  33. package/dist/cjs/graphs/Chart/parts/SeriesFactory.js +82 -0
  34. package/dist/cjs/graphs/Chart/parts/SeriesFactory.js.map +7 -0
  35. package/dist/cjs/graphs/Chart/parts/VerticalScrapper.js +138 -0
  36. package/dist/cjs/graphs/Chart/parts/VerticalScrapper.js.map +7 -0
  37. package/dist/cjs/graphs/Chart/react-desc-prop-types.js +57 -0
  38. package/dist/cjs/graphs/Chart/react-desc-prop-types.js.map +7 -0
  39. package/dist/cjs/graphs/Chart/series/Area.js +73 -0
  40. package/dist/cjs/graphs/Chart/series/Area.js.map +7 -0
  41. package/dist/cjs/graphs/Chart/series/Bars.js +68 -0
  42. package/dist/cjs/graphs/Chart/series/Bars.js.map +7 -0
  43. package/dist/cjs/graphs/Chart/series/Line.js +70 -0
  44. package/dist/cjs/graphs/Chart/series/Line.js.map +7 -0
  45. package/dist/cjs/graphs/Chart/series/Pie.js +46 -0
  46. package/dist/cjs/graphs/Chart/series/Pie.js.map +7 -0
  47. package/dist/cjs/graphs/Chart/series/Point.js +67 -0
  48. package/dist/cjs/graphs/Chart/series/Point.js.map +7 -0
  49. package/dist/cjs/graphs/Chart/series/Points.js +84 -0
  50. package/dist/cjs/graphs/Chart/series/Points.js.map +7 -0
  51. package/dist/cjs/graphs/Chart/series/Rect.js +78 -0
  52. package/dist/cjs/graphs/Chart/series/Rect.js.map +7 -0
  53. package/dist/cjs/graphs/Chart/series/StackedBar.js +66 -0
  54. package/dist/cjs/graphs/Chart/series/StackedBar.js.map +7 -0
  55. package/dist/cjs/graphs/Chart/series/index.js +32 -0
  56. package/dist/cjs/graphs/Chart/series/index.js.map +7 -0
  57. package/dist/cjs/graphs/Chart/styles.js +123 -0
  58. package/dist/cjs/graphs/Chart/styles.js.map +7 -0
  59. package/dist/cjs/graphs/constants.js +37 -0
  60. package/dist/cjs/graphs/constants.js.map +7 -0
  61. package/dist/cjs/graphs/index.js +27 -0
  62. package/dist/cjs/graphs/index.js.map +7 -0
  63. package/dist/cjs/index.js +33 -0
  64. package/dist/cjs/index.js.map +7 -0
  65. package/dist/esm/graphs/Chart/Chart.js +35 -0
  66. package/dist/esm/graphs/Chart/Chart.js.map +7 -0
  67. package/dist/esm/graphs/Chart/ChartContext.js +41 -0
  68. package/dist/esm/graphs/Chart/ChartContext.js.map +7 -0
  69. package/dist/esm/graphs/Chart/Pie.js +23 -0
  70. package/dist/esm/graphs/Chart/Pie.js.map +7 -0
  71. package/dist/esm/graphs/Chart/config/useChart.js +83 -0
  72. package/dist/esm/graphs/Chart/config/useChart.js.map +7 -0
  73. package/dist/esm/graphs/Chart/config/useKeyboardNavigation.js +93 -0
  74. package/dist/esm/graphs/Chart/config/useKeyboardNavigation.js.map +7 -0
  75. package/dist/esm/graphs/Chart/config/useScales.js +81 -0
  76. package/dist/esm/graphs/Chart/config/useScales.js.map +7 -0
  77. package/dist/esm/graphs/Chart/helpers/index.js +57 -0
  78. package/dist/esm/graphs/Chart/helpers/index.js.map +7 -0
  79. package/dist/esm/graphs/Chart/index.js +3 -0
  80. package/dist/esm/graphs/Chart/index.js.map +7 -0
  81. package/dist/esm/graphs/Chart/parts/ActivePoint.js +57 -0
  82. package/dist/esm/graphs/Chart/parts/ActivePoint.js.map +7 -0
  83. package/dist/esm/graphs/Chart/parts/AxisBottom.js +60 -0
  84. package/dist/esm/graphs/Chart/parts/AxisBottom.js.map +7 -0
  85. package/dist/esm/graphs/Chart/parts/AxisLeft.js +53 -0
  86. package/dist/esm/graphs/Chart/parts/AxisLeft.js.map +7 -0
  87. package/dist/esm/graphs/Chart/parts/AxisRight.js +37 -0
  88. package/dist/esm/graphs/Chart/parts/AxisRight.js.map +7 -0
  89. package/dist/esm/graphs/Chart/parts/ChartContainer.js +52 -0
  90. package/dist/esm/graphs/Chart/parts/ChartContainer.js.map +7 -0
  91. package/dist/esm/graphs/Chart/parts/ColorLegend.js +44 -0
  92. package/dist/esm/graphs/Chart/parts/ColorLegend.js.map +7 -0
  93. package/dist/esm/graphs/Chart/parts/FocusableRegion.js +90 -0
  94. package/dist/esm/graphs/Chart/parts/FocusableRegion.js.map +7 -0
  95. package/dist/esm/graphs/Chart/parts/Scrapper.js +104 -0
  96. package/dist/esm/graphs/Chart/parts/Scrapper.js.map +7 -0
  97. package/dist/esm/graphs/Chart/parts/SeriesFactory.js +56 -0
  98. package/dist/esm/graphs/Chart/parts/SeriesFactory.js.map +7 -0
  99. package/dist/esm/graphs/Chart/parts/VerticalScrapper.js +112 -0
  100. package/dist/esm/graphs/Chart/parts/VerticalScrapper.js.map +7 -0
  101. package/dist/esm/graphs/Chart/react-desc-prop-types.js +31 -0
  102. package/dist/esm/graphs/Chart/react-desc-prop-types.js.map +7 -0
  103. package/dist/esm/graphs/Chart/series/Area.js +47 -0
  104. package/dist/esm/graphs/Chart/series/Area.js.map +7 -0
  105. package/dist/esm/graphs/Chart/series/Bars.js +42 -0
  106. package/dist/esm/graphs/Chart/series/Bars.js.map +7 -0
  107. package/dist/esm/graphs/Chart/series/Line.js +44 -0
  108. package/dist/esm/graphs/Chart/series/Line.js.map +7 -0
  109. package/dist/esm/graphs/Chart/series/Pie.js +20 -0
  110. package/dist/esm/graphs/Chart/series/Pie.js.map +7 -0
  111. package/dist/esm/graphs/Chart/series/Point.js +41 -0
  112. package/dist/esm/graphs/Chart/series/Point.js.map +7 -0
  113. package/dist/esm/graphs/Chart/series/Points.js +58 -0
  114. package/dist/esm/graphs/Chart/series/Points.js.map +7 -0
  115. package/dist/esm/graphs/Chart/series/Rect.js +52 -0
  116. package/dist/esm/graphs/Chart/series/Rect.js.map +7 -0
  117. package/dist/esm/graphs/Chart/series/StackedBar.js +40 -0
  118. package/dist/esm/graphs/Chart/series/StackedBar.js.map +7 -0
  119. package/dist/esm/graphs/Chart/series/index.js +9 -0
  120. package/dist/esm/graphs/Chart/series/index.js.map +7 -0
  121. package/dist/esm/graphs/Chart/styles.js +97 -0
  122. package/dist/esm/graphs/Chart/styles.js.map +7 -0
  123. package/dist/esm/graphs/constants.js +11 -0
  124. package/dist/esm/graphs/constants.js.map +7 -0
  125. package/dist/esm/graphs/index.js +4 -0
  126. package/dist/esm/graphs/index.js.map +7 -0
  127. package/dist/esm/index.js +7 -0
  128. package/dist/esm/index.js.map +7 -0
  129. package/package.json +76 -0
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
24
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
+ var StackedBar_exports = {};
26
+ __export(StackedBar_exports, {
27
+ StackedBar: () => StackedBar
28
+ });
29
+ module.exports = __toCommonJS(StackedBar_exports);
30
+ var React = __toESM(require("react"));
31
+ var import_jsx_runtime = require("react/jsx-runtime");
32
+ var import_react = require("react");
33
+ var import_Rect = require("./Rect");
34
+ var import_ChartContext = require("../ChartContext");
35
+ var import_helpers = require("../helpers");
36
+ const StackedBar = ({ serie }) => {
37
+ const {
38
+ props: { xAxis, groups },
39
+ xScale,
40
+ yScale,
41
+ stackedData,
42
+ subGroupScale,
43
+ colorScale
44
+ } = (0, import_react.useContext)(import_ChartContext.ChartContext);
45
+ const serieWithStackedValues = (0, import_helpers.getStackedData)(stackedData, serie);
46
+ const stackIndex = (0, import_helpers.getStackedIndex)(groups, serie.name);
47
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", {
48
+ children: serieWithStackedValues.map((sequence, i) => {
49
+ const width = subGroupScale.bandwidth();
50
+ const height = yScale(sequence[0]) - yScale(sequence[1]);
51
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", {
52
+ fill: colorScale(serie.name),
53
+ transform: `translate(${xScale(xAxis?.cols?.[i] ?? i) + subGroupScale(`stacked-data-${stackIndex}`)},${yScale(sequence[1])})`,
54
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Rect.Rect, {
55
+ width,
56
+ height,
57
+ x: serie.data[i].position,
58
+ y: sequence[1],
59
+ id: serie.data[i].key,
60
+ label: serie.name
61
+ })
62
+ }, serie.data[i].key);
63
+ })
64
+ });
65
+ };
66
+ //# sourceMappingURL=StackedBar.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/graphs/Chart/series/StackedBar.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import React, { useContext } from 'react';\n\nimport { Rect } from './Rect';\nimport { ChartContext } from '../ChartContext';\nimport { getStackedData, getStackedIndex } from '../helpers';\nexport const StackedBar = ({ serie }) => {\n const {\n props: { xAxis, groups },\n xScale,\n yScale,\n stackedData,\n subGroupScale,\n colorScale,\n } = useContext(ChartContext);\n\n const serieWithStackedValues = getStackedData(stackedData, serie);\n const stackIndex = getStackedIndex(groups, serie.name);\n return (\n <g>\n {serieWithStackedValues.map((sequence, i) => {\n const width = subGroupScale.bandwidth();\n const height = yScale(sequence[0]) - yScale(sequence[1]);\n return (\n <g\n key={serie.data[i].key}\n fill={colorScale(serie.name)}\n transform={`translate(${\n xScale(xAxis?.cols?.[i] ?? i) + subGroupScale(`stacked-data-${stackIndex}`)\n },${yScale(sequence[1])})`}\n >\n <Rect\n width={width}\n height={height}\n x={serie.data[i].position}\n y={sequence[1]}\n id={serie.data[i].key}\n label={serie.name}\n />\n </g>\n );\n })}\n </g>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB;AAAA,mBAAkC;AAElC,kBAAqB;AACrB,0BAA6B;AAC7B,qBAAgD;AACzC,MAAM,aAAa,CAAC,EAAE,MAAM,MAAM;AACvC,QAAM;AAAA,IACJ,OAAO,EAAE,OAAO,OAAO;AAAA,IACvB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,yBAAW,gCAAY;AAE3B,QAAM,6BAAyB,+BAAe,aAAa,KAAK;AAChE,QAAM,iBAAa,gCAAgB,QAAQ,MAAM,IAAI;AACrD,SACE,4CAAC;AAAA,IACE,iCAAuB,IAAI,CAAC,UAAU,MAAM;AAC3C,YAAM,QAAQ,cAAc,UAAU;AACtC,YAAM,SAAS,OAAO,SAAS,EAAE,IAAI,OAAO,SAAS,EAAE;AACvD,aACE,4CAAC;AAAA,QAEC,MAAM,WAAW,MAAM,IAAI;AAAA,QAC3B,WAAW,aACT,OAAO,OAAO,OAAO,MAAM,CAAC,IAAI,cAAc,gBAAgB,YAAY,KACxE,OAAO,SAAS,EAAE;AAAA,QAEtB,sDAAC;AAAA,UACC;AAAA,UACA;AAAA,UACA,GAAG,MAAM,KAAK,GAAG;AAAA,UACjB,GAAG,SAAS;AAAA,UACZ,IAAI,MAAM,KAAK,GAAG;AAAA,UAClB,OAAO,MAAM;AAAA,SACf;AAAA,SAbK,MAAM,KAAK,GAAG,GAcrB;AAAA,IAEJ,CAAC;AAAA,GACH;AAEJ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (let key of __getOwnPropNames(from))
11
+ if (!__hasOwnProp.call(to, key) && key !== except)
12
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ }
14
+ return to;
15
+ };
16
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
17
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
18
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
19
+ mod
20
+ ));
21
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
22
+ var series_exports = {};
23
+ module.exports = __toCommonJS(series_exports);
24
+ var React = __toESM(require("react"));
25
+ __reExport(series_exports, require("./Rect"), module.exports);
26
+ __reExport(series_exports, require("./Bars"), module.exports);
27
+ __reExport(series_exports, require("./StackedBar"), module.exports);
28
+ __reExport(series_exports, require("./Points"), module.exports);
29
+ __reExport(series_exports, require("./Line"), module.exports);
30
+ __reExport(series_exports, require("./Area"), module.exports);
31
+ __reExport(series_exports, require("./Pie"), module.exports);
32
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/graphs/Chart/series/index.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["export * from './Rect';\nexport * from './Bars';\nexport * from './StackedBar';\nexport * from './Points';\nexport * from './Line';\nexport * from './Area';\nexport * from './Pie';\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;ADAvB,2BAAc,mBAAd;AACA,2BAAc,mBADd;AAEA,2BAAc,yBAFd;AAGA,2BAAc,qBAHd;AAIA,2BAAc,mBAJd;AAKA,2BAAc,mBALd;AAMA,2BAAc,kBANd;",
6
+ "names": []
7
+ }
@@ -0,0 +1,123 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
24
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
+ var styles_exports = {};
26
+ __export(styles_exports, {
27
+ StyleFocusableRegion: () => StyleFocusableRegion,
28
+ StyledArea: () => StyledArea,
29
+ StyledAxis: () => StyledAxis,
30
+ StyledGrid: () => StyledGrid,
31
+ StyledLine: () => StyledLine,
32
+ StyledMark: () => StyledMark,
33
+ StyledMouseOverDetectionBox: () => StyledMouseOverDetectionBox,
34
+ StyledPoint: () => StyledPoint,
35
+ StyledSVGWrapper: () => StyledSVGWrapper,
36
+ StyledTooltipContainer: () => StyledTooltipContainer
37
+ });
38
+ module.exports = __toCommonJS(styles_exports);
39
+ var React = __toESM(require("react"));
40
+ var import_ds_system = require("@elliemae/ds-system");
41
+ const StyledSVGWrapper = import_ds_system.styled.div`
42
+ :focus {
43
+ outline: none;
44
+ }
45
+ :focus-within {
46
+ outline: none;
47
+ }
48
+ `;
49
+ const StyledAxis = (0, import_ds_system.styled)("g")`
50
+ text {
51
+ fill: #635f5d;
52
+ }
53
+
54
+ text.axis-label {
55
+ font-size: 2.5em;
56
+ }
57
+
58
+ .tick text {
59
+ ${({ color }) => color ? `fill: ${color}` : ""}
60
+ }
61
+ .tick line {
62
+ ${({ color }) => color ? `stroke: ${color}` : ""}
63
+ }
64
+ line {
65
+ stroke: #c0c0bb;
66
+ }
67
+ `;
68
+ const StyledGrid = (0, import_ds_system.styled)("g")`
69
+ line {
70
+ stroke: #c0c0bb;
71
+ }
72
+ `;
73
+ const borderCircle = import_ds_system.css`
74
+ stroke: red;
75
+ stroke-width: 2;
76
+ `;
77
+ const StyledMark = (0, import_ds_system.styled)("rect")`
78
+ ${({ isFocused }) => isFocused ? borderCircle : ""};
79
+ `;
80
+ const StyleFocusableRegion = (0, import_ds_system.styled)("div")`
81
+ width: ${({ s }) => s * 2}px;
82
+ height: ${({ s }) => s * 2}px;
83
+ :focus {
84
+ outline: none;
85
+ }
86
+ `;
87
+ const StyledLine = (0, import_ds_system.styled)("path")`
88
+ fill: none;
89
+ stroke-width: ${({ isActiveLine }) => isActiveLine ? 5 : 3};
90
+ stroke-linejoin: round;
91
+ `;
92
+ const StyledArea = (0, import_ds_system.styled)("path")`
93
+ stroke-width: ${({ isActiveLine }) => isActiveLine ? 5 : 3};
94
+ stroke-linejoin: round;
95
+ opacity: 0.8;
96
+ `;
97
+ const StyledPoint = (0, import_ds_system.styled)("circle")`
98
+ //opacity: ${({ isFocused }) => isFocused ? 1 : 0};
99
+ ${({ isFocused }) => isFocused ? borderCircle : ""};
100
+ `;
101
+ const StyledTooltipContainer = import_ds_system.styled.div`
102
+ text-align: center;
103
+ min-width: ${({ theme }) => theme.space.l};
104
+ max-width: 250px;
105
+ min-height: 30px;
106
+ display: grid;
107
+ align-items: center;
108
+ padding: ${({ theme }) => `${theme.space.xxxs} ${theme.space.xs}`};
109
+ position: relative;
110
+ background-color: white;
111
+ border-radius: 2px;
112
+ font-size: 13px;
113
+ color: ${({ theme }) => theme.colors.neutral[600]};
114
+ `;
115
+ const StyledMouseOverDetectionBox = import_ds_system.styled.div`
116
+ position: absolute;
117
+ top: -15px;
118
+ right: -15px;
119
+ width: calc(100% + 30px);
120
+ height: calc(100% + 30px);
121
+ z-index: -1;
122
+ `;
123
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/graphs/Chart/styles.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { styled, css } from '@elliemae/ds-system';\n\nexport const StyledSVGWrapper = styled.div`\n :focus {\n outline: none;\n }\n :focus-within {\n outline: none;\n }\n`;\n\nexport const StyledAxis = styled('g')`\n text {\n fill: #635f5d;\n }\n\n text.axis-label {\n font-size: 2.5em;\n }\n\n .tick text {\n ${({ color }) => (color ? `fill: ${color}` : '')}\n }\n .tick line {\n ${({ color }) => (color ? `stroke: ${color}` : '')}\n }\n line {\n stroke: #c0c0bb;\n }\n`;\n\nexport const StyledGrid = styled('g')`\n line {\n stroke: #c0c0bb;\n }\n`;\n\nconst borderCircle = css`\n stroke: red;\n stroke-width: 2;\n`;\nexport const StyledMark = styled('rect')<{ isFocused: boolean }>`\n ${({ isFocused }) => (isFocused ? borderCircle : '')};\n`;\n\nexport const StyleFocusableRegion = styled('div')<{ s: number }>`\n width: ${({ s }) => s * 2 ?? '1'}px;\n height: ${({ s }) => s * 2 ?? '1'}px;\n :focus {\n outline: none;\n }\n`;\n\nexport const StyledLine = styled('path')`\n fill: none;\n stroke-width: ${({ isActiveLine }) => (isActiveLine ? 5 : 3)};\n stroke-linejoin: round;\n`;\nexport const StyledArea = styled('path')`\n stroke-width: ${({ isActiveLine }) => (isActiveLine ? 5 : 3)};\n stroke-linejoin: round;\n opacity: 0.8;\n`;\n\nexport const StyledPoint = styled('circle')<{ isFocused: boolean }>`\n //opacity: ${({ isFocused }) => (isFocused ? 1 : 0)};\n ${({ isFocused }) => (isFocused ? borderCircle : '')};\n`;\n\nexport const StyledTooltipContainer = styled.div`\n text-align: center;\n min-width: ${({ theme }) => theme.space.l};\n max-width: 250px;\n min-height: 30px;\n display: grid;\n align-items: center;\n padding: ${({ theme }) => `${theme.space.xxxs} ${theme.space.xs}`};\n position: relative;\n background-color: white;\n border-radius: 2px;\n font-size: 13px;\n color: ${({ theme }) => theme.colors.neutral[600]};\n`;\n\nexport const StyledMouseOverDetectionBox = styled.div`\n position: absolute;\n top: -15px;\n right: -15px;\n width: calc(100% + 30px);\n height: calc(100% + 30px);\n z-index: -1;\n`;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAA4B;AAErB,MAAM,mBAAmB,wBAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAShC,MAAM,iBAAa,yBAAO,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAU9B,CAAC,EAAE,MAAM,MAAO,QAAQ,SAAS,UAAU;AAAA;AAAA;AAAA,MAG3C,CAAC,EAAE,MAAM,MAAO,QAAQ,WAAW,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAO5C,MAAM,iBAAa,yBAAO,GAAG;AAAA;AAAA;AAAA;AAAA;AAMpC,MAAM,eAAe;AAAA;AAAA;AAAA;AAId,MAAM,iBAAa,yBAAO,MAAM;AAAA,IACnC,CAAC,EAAE,UAAU,MAAO,YAAY,eAAe;AAAA;AAG5C,MAAM,2BAAuB,yBAAO,KAAK;AAAA,WACrC,CAAC,EAAE,EAAE,MAAM,IAAI;AAAA,YACd,CAAC,EAAE,EAAE,MAAM,IAAI;AAAA;AAAA;AAAA;AAAA;AAMpB,MAAM,iBAAa,yBAAO,MAAM;AAAA;AAAA,kBAErB,CAAC,EAAE,aAAa,MAAO,eAAe,IAAI;AAAA;AAAA;AAGrD,MAAM,iBAAa,yBAAO,MAAM;AAAA,kBACrB,CAAC,EAAE,aAAa,MAAO,eAAe,IAAI;AAAA;AAAA;AAAA;AAKrD,MAAM,kBAAc,yBAAO,QAAQ;AAAA,eAC3B,CAAC,EAAE,UAAU,MAAO,YAAY,IAAI;AAAA,IAC/C,CAAC,EAAE,UAAU,MAAO,YAAY,eAAe;AAAA;AAG5C,MAAM,yBAAyB,wBAAO;AAAA;AAAA,eAE9B,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA,aAK7B,CAAC,EAAE,MAAM,MAAM,GAAG,MAAM,MAAM,QAAQ,MAAM,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA,WAKpD,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ;AAAA;AAGxC,MAAM,8BAA8B,wBAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
24
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
+ var constants_exports = {};
26
+ __export(constants_exports, {
27
+ TICK_FORMATS: () => TICK_FORMATS
28
+ });
29
+ module.exports = __toCommonJS(constants_exports);
30
+ var React = __toESM(require("react"));
31
+ var import_d3 = require("d3");
32
+ const TICK_FORMATS = {
33
+ MILLIONS: (v) => (0, import_d3.format)(".2s")(v).replace("G", "B"),
34
+ KSEPARATOR: (v) => (0, import_d3.format)(",")(v),
35
+ TIME: (userFormat) => (v) => (0, import_d3.timeFormat)(userFormat)(v)
36
+ };
37
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/graphs/constants.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { format, timeFormat } from 'd3';\n\nexport const TICK_FORMATS = {\n MILLIONS: (v) => format('.2s')(v).replace('G', 'B'),\n KSEPARATOR: (v) => format(',')(v),\n TIME: (userFormat: string) => (v) => timeFormat(userFormat)(v),\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,gBAAmC;AAE5B,MAAM,eAAe;AAAA,EAC1B,UAAU,CAAC,UAAM,kBAAO,KAAK,EAAE,CAAC,EAAE,QAAQ,KAAK,GAAG;AAAA,EAClD,YAAY,CAAC,UAAM,kBAAO,GAAG,EAAE,CAAC;AAAA,EAChC,MAAM,CAAC,eAAuB,CAAC,UAAM,sBAAW,UAAU,EAAE,CAAC;AAC/D;",
6
+ "names": []
7
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (let key of __getOwnPropNames(from))
11
+ if (!__hasOwnProp.call(to, key) && key !== except)
12
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ }
14
+ return to;
15
+ };
16
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
17
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
18
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
19
+ mod
20
+ ));
21
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
22
+ var graphs_exports = {};
23
+ module.exports = __toCommonJS(graphs_exports);
24
+ var React = __toESM(require("react"));
25
+ __reExport(graphs_exports, require("./Chart"), module.exports);
26
+ __reExport(graphs_exports, require("./constants"), module.exports);
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/graphs/index.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["export * from './Chart';\nexport * from './constants';\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;ADAvB,2BAAc,oBAAd;AACA,2BAAc,wBADd;",
6
+ "names": []
7
+ }
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
24
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
+ var src_exports = {};
26
+ __export(src_exports, {
27
+ Chart: () => import_graphs.Chart,
28
+ TICK_FORMATS: () => import_graphs.TICK_FORMATS
29
+ });
30
+ module.exports = __toCommonJS(src_exports);
31
+ var React = __toESM(require("react"));
32
+ var import_graphs = require("./graphs");
33
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.ts", "../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["export { Chart, TICK_FORMATS } from './graphs';\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,oBAAoC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,35 @@
1
+ import * as React from "react";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { AxisBottom } from "./parts/AxisBottom";
4
+ import { AxisLeft } from "./parts/AxisLeft";
5
+ import { AxisRight } from "./parts/AxisRight";
6
+ import { ChartContainer } from "./parts/ChartContainer";
7
+ import { SeriesFactory } from "./parts/SeriesFactory";
8
+ import { ActivePoint } from "./parts/ActivePoint";
9
+ import { ChartContext } from "./ChartContext";
10
+ import { useChart } from "./config/useChart";
11
+ import { ColorLegend } from "./parts/ColorLegend";
12
+ import { Scrapper } from "./parts/Scrapper";
13
+ import { VerticalScrapper } from "./parts/VerticalScrapper";
14
+ const Chart = (props) => {
15
+ const ctx = useChart(props);
16
+ return /* @__PURE__ */ jsx(ChartContext.Provider, {
17
+ value: ctx,
18
+ children: /* @__PURE__ */ jsxs(ChartContainer, {
19
+ children: [
20
+ /* @__PURE__ */ jsx(AxisBottom, {}),
21
+ /* @__PURE__ */ jsx(AxisLeft, {}),
22
+ /* @__PURE__ */ jsx(AxisRight, {}),
23
+ /* @__PURE__ */ jsx(ColorLegend, {}),
24
+ /* @__PURE__ */ jsx(SeriesFactory, {}),
25
+ props.scrapper?.type === "horizontal" ? /* @__PURE__ */ jsx(Scrapper, {}) : null,
26
+ props.scrapper?.type === "vertical" ? /* @__PURE__ */ jsx(VerticalScrapper, {}) : null,
27
+ /* @__PURE__ */ jsx(ActivePoint, {})
28
+ ]
29
+ })
30
+ });
31
+ };
32
+ export {
33
+ Chart
34
+ };
35
+ //# sourceMappingURL=Chart.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/graphs/Chart/Chart.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { AxisBottom } from './parts/AxisBottom';\nimport { AxisLeft } from './parts/AxisLeft';\nimport { AxisRight } from './parts/AxisRight';\n\nimport { ChartContainer } from './parts/ChartContainer';\nimport { SeriesFactory } from './parts/SeriesFactory';\nimport { ActivePoint } from './parts/ActivePoint';\n\nimport { ChartContext } from './ChartContext';\nimport { useChart } from './config/useChart';\nimport type { DSChartT } from './react-desc-prop-types';\nimport { ColorLegend } from './parts/ColorLegend';\nimport { Scrapper } from './parts/Scrapper';\nimport { VerticalScrapper } from './parts/VerticalScrapper';\nexport const Chart: React.ComponentType<DSChartT.Props> = (props) => {\n const ctx = useChart(props);\n return (\n <ChartContext.Provider value={ctx}>\n <ChartContainer>\n <AxisBottom />\n <AxisLeft />\n <AxisRight />\n <ColorLegend />\n <SeriesFactory />\n {props.scrapper?.type === 'horizontal' ? <Scrapper /> : null}\n {props.scrapper?.type === 'vertical' ? <VerticalScrapper /> : null}\n <ActivePoint />\n </ChartContainer>\n </ChartContext.Provider>\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB;AACA,SAAS,kBAAkB;AAC3B,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AAE1B,SAAS,sBAAsB;AAC/B,SAAS,qBAAqB;AAC9B,SAAS,mBAAmB;AAE5B,SAAS,oBAAoB;AAC7B,SAAS,gBAAgB;AAEzB,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB;AACzB,SAAS,wBAAwB;AAC1B,MAAM,QAA6C,CAAC,UAAU;AACnE,QAAM,MAAM,SAAS,KAAK;AAC1B,SACE,oBAAC,aAAa,UAAb;AAAA,IAAsB,OAAO;AAAA,IAC5B,+BAAC;AAAA,MACC;AAAA,4BAAC,cAAW;AAAA,QACZ,oBAAC,YAAS;AAAA,QACV,oBAAC,aAAU;AAAA,QACX,oBAAC,eAAY;AAAA,QACb,oBAAC,iBAAc;AAAA,QACd,MAAM,UAAU,SAAS,eAAe,oBAAC,YAAS,IAAK;AAAA,QACvD,MAAM,UAAU,SAAS,aAAa,oBAAC,oBAAiB,IAAK;AAAA,QAC9D,oBAAC,eAAY;AAAA;AAAA,KACf;AAAA,GACF;AAEJ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,41 @@
1
+ import * as React from "react";
2
+ import { createContext, createRef } from "react";
3
+ import { scaleLinear, scaleBand, scaleOrdinal } from "d3";
4
+ import { defaultProps } from "./react-desc-prop-types";
5
+ const defaultContext = {
6
+ props: defaultProps,
7
+ xScale: scaleBand(),
8
+ yScale: scaleLinear(),
9
+ innerHeight: 0,
10
+ innerWidth: 0,
11
+ activePoint: "",
12
+ setActivePoint: () => {
13
+ },
14
+ activeSerie: "",
15
+ setActiveSerie: () => {
16
+ },
17
+ scrapperPosY: "",
18
+ setScrapperPosY: () => {
19
+ },
20
+ containerRef: createRef(),
21
+ groups: [],
22
+ colorScale: scaleOrdinal()
23
+ };
24
+ const pieChartdefaultContext = {
25
+ props: defaultProps,
26
+ innerHeight: 0,
27
+ innerWidth: 0,
28
+ activeSerie: "",
29
+ setActiveSerie: () => {
30
+ },
31
+ containerRef: createRef(),
32
+ groups: [],
33
+ colorScale: scaleOrdinal()
34
+ };
35
+ const ChartContext = createContext(defaultContext);
36
+ const PieChartContext = createContext(pieChartdefaultContext);
37
+ export {
38
+ ChartContext,
39
+ PieChartContext
40
+ };
41
+ //# sourceMappingURL=ChartContext.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/graphs/Chart/ChartContext.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { createContext, createRef } from 'react';\nimport { ScaleLinear, ScaleBand, scaleLinear, scaleBand, scaleOrdinal, ScaleOrdinal } from 'd3';\nimport { defaultProps, DSChartT } from './react-desc-prop-types';\n\ninterface ContextT {\n props: Partial<DSChartT.Props>;\n xScale: ScaleLinear<number, number, never> | ScaleBand<string>;\n yScale: ScaleLinear<number, number, never> | ScaleBand<string>;\n innerHeight: number;\n innerWidth: number;\n activePoint: string;\n setActivePoint: React.Dispatch<React.SetStateAction<string>>;\n activeSerie: string;\n setActiveSerie: React.Dispatch<React.SetStateAction<string>>;\n containerRef: React.RefObject<HTMLDivElement>;\n groups: string[];\n subGroupScale?: ScaleBand<string> | null;\n colorScale: ScaleOrdinal<string, unknown, never>;\n}\n\ninterface PieChartContextT {\n props: Partial<DSChartT.Props>;\n innerHeight: number;\n innerWidth: number;\n activeSerie: string;\n setActiveSerie: React.Dispatch<React.SetStateAction<string>>;\n containerRef: React.RefObject<HTMLDivElement>;\n groups: string[];\n colorScale: ScaleOrdinal<string, unknown, never>;\n}\n\nconst defaultContext: ContextT = {\n props: defaultProps,\n xScale: scaleBand(),\n yScale: scaleLinear(),\n innerHeight: 0,\n innerWidth: 0,\n activePoint: '',\n setActivePoint: () => {},\n activeSerie: '',\n setActiveSerie: () => {},\n scrapperPosY: '',\n setScrapperPosY: () => {},\n containerRef: createRef<HTMLDivElement>(),\n groups: [],\n colorScale: scaleOrdinal(),\n};\n\nconst pieChartdefaultContext: PieChartContextT = {\n props: defaultProps,\n innerHeight: 0,\n innerWidth: 0,\n activeSerie: '',\n setActiveSerie: () => {},\n containerRef: createRef<HTMLDivElement>(),\n groups: [],\n colorScale: scaleOrdinal(),\n};\n\nexport const ChartContext = createContext(defaultContext);\nexport const PieChartContext = createContext(pieChartdefaultContext);\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,eAAe,iBAAiB;AACzC,SAAiC,aAAa,WAAW,oBAAkC;AAC3F,SAAS,oBAA8B;AA6BvC,MAAM,iBAA2B;AAAA,EAC/B,OAAO;AAAA,EACP,QAAQ,UAAU;AAAA,EAClB,QAAQ,YAAY;AAAA,EACpB,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,gBAAgB,MAAM;AAAA,EAAC;AAAA,EACvB,aAAa;AAAA,EACb,gBAAgB,MAAM;AAAA,EAAC;AAAA,EACvB,cAAc;AAAA,EACd,iBAAiB,MAAM;AAAA,EAAC;AAAA,EACxB,cAAc,UAA0B;AAAA,EACxC,QAAQ,CAAC;AAAA,EACT,YAAY,aAAa;AAC3B;AAEA,MAAM,yBAA2C;AAAA,EAC/C,OAAO;AAAA,EACP,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,gBAAgB,MAAM;AAAA,EAAC;AAAA,EACvB,cAAc,UAA0B;AAAA,EACxC,QAAQ,CAAC;AAAA,EACT,YAAY,aAAa;AAC3B;AAEO,MAAM,eAAe,cAAc,cAAc;AACjD,MAAM,kBAAkB,cAAc,sBAAsB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,23 @@
1
+ import * as React from "react";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { ChartContainer } from "./parts/ChartContainer";
4
+ import { Pie } from "./series";
5
+ import { PieChartContext } from "./ChartContext";
6
+ import { usePie } from "./config/usePie";
7
+ import { ColorLegend } from "./parts/ColorLegend";
8
+ const PieChart = (props) => {
9
+ const ctx = usePie(props);
10
+ return /* @__PURE__ */ jsx(PieChartContext.Provider, {
11
+ value: ctx,
12
+ children: /* @__PURE__ */ jsxs(ChartContainer, {
13
+ children: [
14
+ /* @__PURE__ */ jsx(ColorLegend, {}),
15
+ /* @__PURE__ */ jsx(Pie, {})
16
+ ]
17
+ })
18
+ });
19
+ };
20
+ export {
21
+ PieChart
22
+ };
23
+ //# sourceMappingURL=Pie.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/graphs/Chart/Pie.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { ChartContainer } from './parts/ChartContainer';\nimport { Pie } from './series';\nimport { PieChartContext } from './ChartContext';\nimport { usePie } from './config/usePie';\nimport type { DSPieT } from './react-desc-prop-types';\nimport { ColorLegend } from './parts/ColorLegend';\nexport const PieChart: React.ComponentType<DSPieT.Props> = (props) => {\n const ctx = usePie(props);\n return (\n <PieChartContext.Provider value={ctx}>\n <ChartContainer>\n <ColorLegend />\n <Pie />\n </ChartContainer>\n </PieChartContext.Provider>\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB;AACA,SAAS,sBAAsB;AAC/B,SAAS,WAAW;AACpB,SAAS,uBAAuB;AAChC,SAAS,cAAc;AAEvB,SAAS,mBAAmB;AACrB,MAAM,WAA8C,CAAC,UAAU;AACpE,QAAM,MAAM,OAAO,KAAK;AACxB,SACE,oBAAC,gBAAgB,UAAhB;AAAA,IAAyB,OAAO;AAAA,IAC/B,+BAAC;AAAA,MACC;AAAA,4BAAC,eAAY;AAAA,QACb,oBAAC,OAAI;AAAA;AAAA,KACP;AAAA,GACF;AAEJ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,83 @@
1
+ import * as React from "react";
2
+ import { useMemo, useState, useRef } from "react";
3
+ import { useScales } from "./useScales";
4
+ import { stackData } from "../helpers";
5
+ const useChart = (props) => {
6
+ const { series, width, height, margin, groups: groupsStacked } = props;
7
+ const containerRef = useRef(null);
8
+ const svgRef = useRef(null);
9
+ const [activePoint, setActivePoint] = useState("");
10
+ const [activeSerie, setActiveSerie] = useState("");
11
+ const [scrapperPosY, setScrapperPosY] = useState("");
12
+ const [scrapperPosX, setScrapperPosX] = useState("");
13
+ const innerHeight = height - margin.top - margin.bottom;
14
+ const innerWidth = width - margin.left - margin.right;
15
+ const groups = series.map((serie) => serie.name);
16
+ const stackedData = useMemo(() => stackData(groupsStacked, series), [groupsStacked, series]);
17
+ const currentData = series.map((d, i) => ({
18
+ ...d,
19
+ originalData: d,
20
+ key: `${d.name}-${i}`,
21
+ data: d.data.map((value, index) => ({
22
+ key: `${d.name}-${i}-${index}`,
23
+ value,
24
+ position: index
25
+ }))
26
+ }));
27
+ const { xScale, yScale, y2Scale, subGroupScale, colorScale, getBandwidth } = useScales({
28
+ props,
29
+ innerHeight,
30
+ innerWidth,
31
+ groups,
32
+ stackedData,
33
+ currentData
34
+ });
35
+ return useMemo(
36
+ () => ({
37
+ props: { ...props, data: currentData },
38
+ innerHeight,
39
+ innerWidth,
40
+ groups,
41
+ colorScale,
42
+ stackedData,
43
+ subGroupScale,
44
+ svgRef,
45
+ xScale,
46
+ yScale,
47
+ y2Scale,
48
+ containerRef,
49
+ getBandwidth,
50
+ scrapperPosY,
51
+ setScrapperPosY,
52
+ scrapperPosX,
53
+ setScrapperPosX,
54
+ activePoint,
55
+ setActivePoint,
56
+ activeSerie,
57
+ setActiveSerie
58
+ }),
59
+ [
60
+ props,
61
+ currentData,
62
+ innerHeight,
63
+ innerWidth,
64
+ groups,
65
+ colorScale,
66
+ stackedData,
67
+ subGroupScale,
68
+ scrapperPosX,
69
+ setScrapperPosX,
70
+ xScale,
71
+ yScale,
72
+ y2Scale,
73
+ getBandwidth,
74
+ scrapperPosY,
75
+ activePoint,
76
+ activeSerie
77
+ ]
78
+ );
79
+ };
80
+ export {
81
+ useChart
82
+ };
83
+ //# sourceMappingURL=useChart.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/graphs/Chart/config/useChart.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-nested-callbacks */\n/* eslint-disable max-statements */\n/* eslint-disable indent */\nimport { useMemo, useState, useRef } from 'react';\n// import { useValidateTypescriptPropTypes } from '@elliemae/ds-utilities';\nimport type { DSChartT } from '../react-desc-prop-types';\n// import { propTypes } from '../react-desc-prop-types';\nimport { useScales } from './useScales';\nimport { stackData } from '../helpers';\nexport const useChart = (props: DSChartT.Props) => {\n // useValidateTypescriptPropTypes(props, propTypes);\n\n const { series, width, height, margin, groups: groupsStacked } = props;\n\n const containerRef = useRef(null);\n const svgRef = useRef(null);\n\n const [activePoint, setActivePoint] = useState('');\n const [activeSerie, setActiveSerie] = useState('');\n const [scrapperPosY, setScrapperPosY] = useState('');\n const [scrapperPosX, setScrapperPosX] = useState('');\n\n const innerHeight = height - margin.top - margin.bottom;\n const innerWidth = width - margin.left - margin.right;\n\n const groups = series.map((serie) => serie.name);\n\n const stackedData = useMemo(() => stackData(groupsStacked, series), [groupsStacked, series]);\n\n const currentData = series.map((d, i) => ({\n ...d,\n originalData: d,\n key: `${d.name}-${i}`,\n data: d.data.map((value, index) => ({\n key: `${d.name}-${i}-${index}`,\n value,\n position: index,\n })),\n }));\n\n const { xScale, yScale, y2Scale, subGroupScale, colorScale, getBandwidth } = useScales({\n props,\n innerHeight,\n innerWidth,\n groups,\n stackedData,\n currentData,\n });\n\n return useMemo(\n () => ({\n props: { ...props, data: currentData },\n innerHeight,\n innerWidth,\n groups,\n colorScale,\n stackedData,\n subGroupScale,\n svgRef,\n xScale,\n yScale,\n y2Scale,\n containerRef,\n getBandwidth,\n scrapperPosY,\n setScrapperPosY,\n scrapperPosX,\n setScrapperPosX,\n activePoint,\n setActivePoint,\n activeSerie,\n setActiveSerie,\n }),\n [\n props,\n currentData,\n innerHeight,\n innerWidth,\n groups,\n colorScale,\n stackedData,\n subGroupScale,\n scrapperPosX,\n setScrapperPosX,\n xScale,\n yScale,\n y2Scale,\n getBandwidth,\n scrapperPosY,\n activePoint,\n activeSerie,\n ],\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,SAAS,UAAU,cAAc;AAI1C,SAAS,iBAAiB;AAC1B,SAAS,iBAAiB;AACnB,MAAM,WAAW,CAAC,UAA0B;AAGjD,QAAM,EAAE,QAAQ,OAAO,QAAQ,QAAQ,QAAQ,cAAc,IAAI;AAEjE,QAAM,eAAe,OAAO,IAAI;AAChC,QAAM,SAAS,OAAO,IAAI;AAE1B,QAAM,CAAC,aAAa,cAAc,IAAI,SAAS,EAAE;AACjD,QAAM,CAAC,aAAa,cAAc,IAAI,SAAS,EAAE;AACjD,QAAM,CAAC,cAAc,eAAe,IAAI,SAAS,EAAE;AACnD,QAAM,CAAC,cAAc,eAAe,IAAI,SAAS,EAAE;AAEnD,QAAM,cAAc,SAAS,OAAO,MAAM,OAAO;AACjD,QAAM,aAAa,QAAQ,OAAO,OAAO,OAAO;AAEhD,QAAM,SAAS,OAAO,IAAI,CAAC,UAAU,MAAM,IAAI;AAE/C,QAAM,cAAc,QAAQ,MAAM,UAAU,eAAe,MAAM,GAAG,CAAC,eAAe,MAAM,CAAC;AAE3F,QAAM,cAAc,OAAO,IAAI,CAAC,GAAG,OAAO;AAAA,IACxC,GAAG;AAAA,IACH,cAAc;AAAA,IACd,KAAK,GAAG,EAAE,QAAQ;AAAA,IAClB,MAAM,EAAE,KAAK,IAAI,CAAC,OAAO,WAAW;AAAA,MAClC,KAAK,GAAG,EAAE,QAAQ,KAAK;AAAA,MACvB;AAAA,MACA,UAAU;AAAA,IACZ,EAAE;AAAA,EACJ,EAAE;AAEF,QAAM,EAAE,QAAQ,QAAQ,SAAS,eAAe,YAAY,aAAa,IAAI,UAAU;AAAA,IACrF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,SAAO;AAAA,IACL,OAAO;AAAA,MACL,OAAO,EAAE,GAAG,OAAO,MAAM,YAAY;AAAA,MACrC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
6
+ "names": []
7
+ }