@pie-lib/charting 5.15.6 → 5.15.7-next.1618

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 (109) hide show
  1. package/CHANGELOG.json +1 -581
  2. package/CHANGELOG.md +206 -38
  3. package/NEXT.CHANGELOG.json +1 -0
  4. package/lib/actions-button.js +175 -0
  5. package/lib/actions-button.js.map +1 -0
  6. package/lib/axes.js +154 -104
  7. package/lib/axes.js.map +1 -1
  8. package/lib/bars/common/bars.js +105 -19
  9. package/lib/bars/common/bars.js.map +1 -1
  10. package/lib/bars/common/correct-check-icon.js +55 -0
  11. package/lib/bars/common/correct-check-icon.js.map +1 -0
  12. package/lib/chart-type.js +4 -4
  13. package/lib/chart-type.js.map +1 -1
  14. package/lib/chart.js +96 -65
  15. package/lib/chart.js.map +1 -1
  16. package/lib/common/correctness-indicators.js +99 -0
  17. package/lib/common/correctness-indicators.js.map +1 -0
  18. package/lib/common/drag-handle.js +47 -13
  19. package/lib/common/drag-handle.js.map +1 -1
  20. package/lib/common/drag-icon.js +7 -24
  21. package/lib/common/drag-icon.js.map +1 -1
  22. package/lib/grid.js +47 -10
  23. package/lib/grid.js.map +1 -1
  24. package/lib/index.js +8 -0
  25. package/lib/index.js.map +1 -1
  26. package/lib/key-legend.js +111 -0
  27. package/lib/key-legend.js.map +1 -0
  28. package/lib/line/common/drag-handle.js +40 -18
  29. package/lib/line/common/drag-handle.js.map +1 -1
  30. package/lib/line/common/line.js +7 -8
  31. package/lib/line/common/line.js.map +1 -1
  32. package/lib/line/line-cross.js +76 -9
  33. package/lib/line/line-cross.js.map +1 -1
  34. package/lib/line/line-dot.js +58 -5
  35. package/lib/line/line-dot.js.map +1 -1
  36. package/lib/mark-label.js +40 -15
  37. package/lib/mark-label.js.map +1 -1
  38. package/lib/plot/common/plot.js +129 -16
  39. package/lib/plot/common/plot.js.map +1 -1
  40. package/lib/plot/dot.js +17 -4
  41. package/lib/plot/dot.js.map +1 -1
  42. package/lib/plot/line.js +19 -6
  43. package/lib/plot/line.js.map +1 -1
  44. package/lib/tool-menu.js +0 -4
  45. package/lib/tool-menu.js.map +1 -1
  46. package/package.json +6 -8
  47. package/src/__tests__/__snapshots__/axes.test.jsx.snap +569 -0
  48. package/src/__tests__/__snapshots__/chart-type.test.jsx.snap +14 -0
  49. package/src/__tests__/__snapshots__/chart.test.jsx.snap +595 -0
  50. package/src/__tests__/__snapshots__/grid.test.jsx.snap +72 -0
  51. package/src/__tests__/__snapshots__/mark-label.test.jsx.snap +73 -0
  52. package/src/__tests__/axes.test.jsx +141 -0
  53. package/src/__tests__/chart-setup.test.jsx +47 -0
  54. package/src/__tests__/chart-type.test.jsx +29 -0
  55. package/src/__tests__/chart.test.jsx +95 -0
  56. package/src/__tests__/grid.test.jsx +25 -0
  57. package/src/__tests__/mark-label.test.jsx +31 -0
  58. package/src/__tests__/utils.js +30 -0
  59. package/src/__tests__/utils.test.js +100 -0
  60. package/src/actions-button.jsx +110 -0
  61. package/src/axes.jsx +98 -54
  62. package/src/bars/__tests__/__snapshots__/bar.test.jsx.snap +43 -0
  63. package/src/bars/__tests__/__snapshots__/histogram.test.jsx.snap +45 -0
  64. package/src/bars/__tests__/bar.test.jsx +37 -0
  65. package/src/bars/__tests__/histogram.test.jsx +38 -0
  66. package/src/bars/__tests__/utils.js +30 -0
  67. package/src/bars/common/__tests__/__snapshots__/bars.test.jsx.snap +110 -0
  68. package/src/bars/common/__tests__/bars.test.jsx +69 -0
  69. package/src/bars/common/__tests__/utils.js +30 -0
  70. package/src/bars/common/bars.jsx +101 -14
  71. package/src/bars/common/correct-check-icon.jsx +20 -0
  72. package/src/chart-type.js +7 -3
  73. package/src/chart.jsx +53 -29
  74. package/src/common/__tests__/__snapshots__/drag-handle.test.jsx.snap +48 -0
  75. package/src/common/__tests__/drag-handle.test.jsx +88 -0
  76. package/src/common/__tests__/utils.js +30 -0
  77. package/src/common/correctness-indicators.jsx +55 -0
  78. package/src/common/drag-handle.jsx +48 -26
  79. package/src/common/drag-icon.jsx +6 -21
  80. package/src/grid.jsx +37 -12
  81. package/src/index.js +2 -1
  82. package/src/key-legend.jsx +75 -0
  83. package/src/line/__tests__/__snapshots__/line-cross.test.jsx.snap +45 -0
  84. package/src/line/__tests__/__snapshots__/line-dot.test.jsx.snap +45 -0
  85. package/src/line/__tests__/line-cross.test.jsx +38 -0
  86. package/src/line/__tests__/line-dot.test.jsx +38 -0
  87. package/src/line/__tests__/utils.js +30 -0
  88. package/src/line/common/__tests__/__snapshots__/drag-handle.test.jsx.snap +49 -0
  89. package/src/line/common/__tests__/__snapshots__/line.test.jsx.snap +143 -0
  90. package/src/line/common/__tests__/drag-handle.test.jsx +88 -0
  91. package/src/line/common/__tests__/line.test.jsx +82 -0
  92. package/src/line/common/__tests__/utils.js +30 -0
  93. package/src/line/common/drag-handle.jsx +38 -16
  94. package/src/line/common/line.jsx +4 -6
  95. package/src/line/line-cross.js +56 -4
  96. package/src/line/line-dot.js +74 -10
  97. package/src/mark-label.jsx +83 -51
  98. package/src/plot/__tests__/__snapshots__/dot.test.jsx.snap +45 -0
  99. package/src/plot/__tests__/__snapshots__/line.test.jsx.snap +45 -0
  100. package/src/plot/__tests__/dot.test.jsx +38 -0
  101. package/src/plot/__tests__/line.test.jsx +38 -0
  102. package/src/plot/__tests__/utils.js +30 -0
  103. package/src/plot/common/__tests__/__snapshots__/plot.test.jsx.snap +97 -0
  104. package/src/plot/common/__tests__/plot.test.jsx +70 -0
  105. package/src/plot/common/__tests__/utils.js +30 -0
  106. package/src/plot/common/plot.jsx +127 -10
  107. package/src/plot/dot.js +19 -3
  108. package/src/plot/line.js +18 -4
  109. package/src/tool-menu.jsx +0 -4
package/CHANGELOG.md CHANGED
@@ -3,136 +3,304 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ## [5.15.6](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.5...@pie-lib/charting@5.15.6) (2023-10-16)
6
+ # [5.30.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.29.0...@pie-lib/charting@5.30.0) (2025-09-18)
7
7
 
8
+ **Note:** Version bump only for package @pie-lib/charting
8
9
 
9
- ### Bug Fixes
10
10
 
11
- * **charting:** add sanity check for data PD-3223 ([f573866](https://github.com/pie-framework/pie-lib/commit/f57386626933cdb5b8b6a1c0f91b45b6ea1b9ca7))
12
- * **charting:** address overlap of drag handle with category labels in charts PD-3223 ([ebe212e](https://github.com/pie-framework/pie-lib/commit/ebe212ecd315d6445b1d676568482fa47b40ebdb))
13
- * **charting:** limit number of categories in Define Correct Response Chart to 20 ([0b0e8ab](https://github.com/pie-framework/pie-lib/commit/0b0e8ab339126e00703c1ae5218c714bbcdb6dbf))
14
- * **charting:** refine error message display to prevent overlapping with other elements and other messages PD-3121 ([f2de1ad](https://github.com/pie-framework/pie-lib/commit/f2de1adb4d19a44e403beb3d88cbb333e3c5adb9))
15
- * **charting:** use red boxes only and for all duplicated category names, reorder CSS selectors to resolve styling conflicts, only display the validation message a single time for duplicate categories and for empty labels PD-3121 ([7cae40b](https://github.com/pie-framework/pie-lib/commit/7cae40b48a1da661d7d7c97780098a07e5b1d336))
16
11
 
17
12
 
18
13
 
14
+ # [5.29.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.28.0...@pie-lib/charting@5.29.0) (2025-09-18)
19
15
 
16
+ **Note:** Version bump only for package @pie-lib/charting
20
17
 
21
- ## [5.15.5](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.4...@pie-lib/charting@5.15.5) (2023-09-28)
18
+
19
+
20
+
21
+
22
+ # [5.28.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.28.0) (2025-09-18)
22
23
 
23
24
 
24
25
  ### Bug Fixes
25
26
 
26
- * **charting:** add drop shadow to evaluate bars PD-2790 ([328c730](https://github.com/pie-framework/pie-lib/commit/328c7308d026ca6e00575d47bdfaf1d9e4779d16))
27
+ * **charting:** make the “answer key correct” indicators smaller for plot PD-5198 ([ce6bb35](https://github.com/pie-framework/pie-lib/commit/ce6bb35099c832f017e1bc213403ccb094792442))
28
+ * fixed pie-lib/icons import [PD-5126] ([dcb506c](https://github.com/pie-framework/pie-lib/commit/dcb506c914a177f6d88bf73247a023bfe71dac1f))
27
29
 
28
30
 
31
+ ### Features
29
32
 
33
+ * split pie-toolbox into multiple packages [PD-5126] ([7d55a25](https://github.com/pie-framework/pie-lib/commit/7d55a2552d084cd3d0d5c00dc77411b2ced2f5e2))
30
34
 
31
35
 
32
- ## [5.15.4](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.3...@pie-lib/charting@5.15.4) (2023-09-28)
33
36
 
34
37
 
35
- ### Bug Fixes
36
38
 
37
- * **charting:** fix modal warnings ([34dbf3b](https://github.com/pie-framework/pie-lib/commit/34dbf3b04845773d23aa7c91a80fab57e1e78cd0))
38
- * **charting:** limit number of categories in Define Initial Chart Attributes to 20 PD-3128 ([b0da731](https://github.com/pie-framework/pie-lib/commit/b0da731a619c9d13a8b12e16a6e81dc924261396))
39
+ # [5.27.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.26.0...@pie-lib/charting@5.27.0) (2025-09-17)
39
40
 
41
+ **Note:** Version bump only for package @pie-lib/charting
40
42
 
41
43
 
42
44
 
43
45
 
44
- ## [5.15.3](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.2...@pie-lib/charting@5.15.3) (2023-09-26)
46
+
47
+ # [5.26.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.25.0...@pie-lib/charting@5.26.0) (2025-09-17)
48
+
49
+ **Note:** Version bump only for package @pie-lib/charting
50
+
51
+
52
+
53
+
54
+
55
+ # [5.25.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.24.1...@pie-lib/charting@5.25.0) (2025-09-17)
45
56
 
46
57
 
47
58
  ### Bug Fixes
48
59
 
49
- * **charting:** adjust icon for the drag handle PD-2790 ([fe670d7](https://github.com/pie-framework/pie-lib/commit/fe670d7a04f44da5c93dadbeec41b753ce50f9f6))
60
+ * **charting:** make the “answer key correct” indicators smaller for plot PD-5198 ([ce6bb35](https://github.com/pie-framework/pie-lib/commit/ce6bb35099c832f017e1bc213403ccb094792442))
50
61
 
51
62
 
52
63
 
53
64
 
54
65
 
55
- ## [5.15.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.1...@pie-lib/charting@5.15.2) (2023-09-25)
66
+ ## [5.24.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.24.1) (2025-08-11)
56
67
 
57
68
 
58
69
  ### Bug Fixes
59
70
 
60
- * add required packages for charting to work ([c7af164](https://github.com/pie-framework/pie-lib/commit/c7af16427245d0c0c5c041e296a1cfdf034b7b64))
71
+ * fixed pie-lib/icons import [PD-5126] ([dcb506c](https://github.com/pie-framework/pie-lib/commit/dcb506c914a177f6d88bf73247a023bfe71dac1f))
61
72
 
62
73
 
74
+ ### Features
63
75
 
76
+ * split pie-toolbox into multiple packages [PD-5126] ([7d55a25](https://github.com/pie-framework/pie-lib/commit/7d55a2552d084cd3d0d5c00dc77411b2ced2f5e2))
64
77
 
65
78
 
66
- ## [5.15.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.0...@pie-lib/charting@5.15.1) (2023-09-25)
67
79
 
68
80
 
69
- ### Bug Fixes
70
81
 
71
- * **charting:** add @mui/icons-material to package json PD-2790 ([0262857](https://github.com/pie-framework/pie-lib/commit/026285728f998e3fe31ec43c77e99f2311f9ad22))
82
+ # [5.24.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.24.0) (2025-08-07)
72
83
 
84
+ ### Features
73
85
 
86
+ - split pie-toolbox into multiple packages [PD-5126](<[7d55a25](https://github.com/pie-framework/pie-lib/commit/7d55a2552d084cd3d0d5c00dc77411b2ced2f5e2)>)
74
87
 
88
+ # [5.23.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.23.0) (2025-07-31)
75
89
 
90
+ **Note:** Version bump only for package @pie-lib/charting
76
91
 
77
- # [5.15.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.14.3...@pie-lib/charting@5.15.0) (2023-09-25)
92
+ # [5.22.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.22.0) (2025-07-31)
78
93
 
94
+ **Note:** Version bump only for package @pie-lib/charting
79
95
 
80
- ### Bug Fixes
96
+ # [5.21.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.21.0) (2025-07-31)
81
97
 
82
- * **charting:** set labelWidth to prevent outline from intersecting InputLabel for the ChartType menu PD-3166 ([ff9ca2b](https://github.com/pie-framework/pie-lib/commit/ff9ca2b9812d0afd209edccac2feecac396111cc))
98
+ **Note:** Version bump only for package @pie-lib/charting
83
99
 
100
+ # [5.20.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.20.0) (2025-07-31)
84
101
 
85
- ### Features
102
+ **Note:** Version bump only for package @pie-lib/charting
86
103
 
87
- * **charting:** add hover effect for plot and bars PD-2790 ([af0d9ba](https://github.com/pie-framework/pie-lib/commit/af0d9bab03fa8146299bf0a1947dbe418e306f85))
88
- * **charting:** adjust y-coordinate in maskSize for better chart fitting after adding new design, tweaks in design PD-2790 ([0edf288](https://github.com/pie-framework/pie-lib/commit/0edf2880c8c8c0e0e51df080aa582d071f0f1e52))
89
- * **charting:** make style dynamic for drag icon PD-2790 ([aed8c81](https://github.com/pie-framework/pie-lib/commit/aed8c818cbc70910a7e31566c94dd731d068efa1))
90
- * **charting:** Replace drag-enabled horizontal bars with widget for author and gather mode PD-2790, refactor RawDragHandle component ([e0a369a](https://github.com/pie-framework/pie-lib/commit/e0a369ad2aaf9cf5d3aa3ac061c23316443b35fb))
104
+ # [5.19.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.19.0) (2025-07-31)
91
105
 
106
+ **Note:** Version bump only for package @pie-lib/charting
92
107
 
108
+ # [5.18.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.18.0) (2025-07-31)
93
109
 
110
+ **Note:** Version bump only for package @pie-lib/charting
94
111
 
112
+ # [5.20.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.20.0) (2025-07-31)
95
113
 
96
- ## [5.14.3](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.14.2...@pie-lib/charting@5.14.3) (2023-09-18)
114
+ **Note:** Version bump only for package @pie-lib/charting
97
115
 
116
+ # [5.19.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.19.0) (2025-07-31)
98
117
 
99
- ### Bug Fixes
118
+ **Note:** Version bump only for package @pie-lib/charting
100
119
 
101
- * **charting:** add tests for resetValues PD-3105 ([972a3cd](https://github.com/pie-framework/pie-lib/commit/972a3cd4b3787352ffe4073085cbd22f91895b43))
102
- * **charting:** wip PD-3105 ([9e21836](https://github.com/pie-framework/pie-lib/commit/9e21836ad8c89c7c839c6561db5edc0329a6a6af))
103
- * **charting:** wip PD-3105 ([f2f8234](https://github.com/pie-framework/pie-lib/commit/f2f82343a373ae1a8f669754a061963cbfdbeb08))
104
- * **charting:** wip PD-3105 revert push in develop ([6cce5e2](https://github.com/pie-framework/pie-lib/commit/6cce5e2d25d079c1c3eb195425dc2cf016fcd36e))
120
+ # [5.18.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.18.0) (2025-07-31)
105
121
 
122
+ **Note:** Version bump only for package @pie-lib/charting
106
123
 
124
+ # [5.19.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.19.0) (2025-07-31)
107
125
 
126
+ **Note:** Version bump only for package @pie-lib/charting
108
127
 
128
+ # [5.18.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.18.0) (2025-07-31)
109
129
 
110
- ## [5.14.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.14.1...@pie-lib/charting@5.14.2) (2023-08-07)
130
+ **Note:** Version bump only for package @pie-lib/charting
131
+
132
+ # [5.17.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.17.0) (2025-07-31)
111
133
 
112
134
  **Note:** Version bump only for package @pie-lib/charting
113
135
 
136
+ # [5.17.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.17.0) (2025-07-31)
114
137
 
138
+ **Note:** Version bump only for package @pie-lib/charting
115
139
 
140
+ # [5.18.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.18.0) (2025-07-31)
116
141
 
142
+ **Note:** Version bump only for package @pie-lib/charting
117
143
 
118
- ## [5.14.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.14.0...@pie-lib/charting@5.14.1) (2023-06-24)
144
+ # [5.17.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.17.0) (2025-07-31)
119
145
 
120
146
  **Note:** Version bump only for package @pie-lib/charting
121
147
 
148
+ # [5.16.0-beta.8](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.16.0-beta.8) (2025-07-25)
122
149
 
150
+ **Note:** Version bump only for package @pie-lib/charting
123
151
 
152
+ # [5.16.0-beta.7](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.16.0-beta.7) (2025-07-25)
124
153
 
154
+ **Note:** Version bump only for package @pie-lib/charting
125
155
 
126
- # [5.14.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.13.0...@pie-lib/charting@5.14.0) (2023-06-13)
156
+ # [5.16.0-beta.7](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.16.0-beta.7) (2025-07-25)
157
+
158
+ **Note:** Version bump only for package @pie-lib/charting
159
+
160
+ # [5.16.0-beta.6](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.16.0-beta.6) (2025-07-25)
161
+
162
+ **Note:** Version bump only for package @pie-lib/charting
163
+
164
+ # [5.16.0-beta.6](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.16.0-beta.6) (2025-07-25)
165
+
166
+ **Note:** Version bump only for package @pie-lib/charting
167
+
168
+ # [5.16.0-beta.5](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.16.0-beta.5) (2025-07-25)
169
+
170
+ **Note:** Version bump only for package @pie-lib/charting
171
+
172
+ # [5.16.0-beta.5](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.16.0-beta.5) (2025-07-25)
173
+
174
+ **Note:** Version bump only for package @pie-lib/charting
175
+
176
+ # [5.16.0-beta.4](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.16.0-beta.4) (2025-07-25)
177
+
178
+ **Note:** Version bump only for package @pie-lib/charting
179
+
180
+ # [5.16.0-beta.3](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.16.0-beta.3) (2025-07-25)
181
+
182
+ **Note:** Version bump only for package @pie-lib/charting
183
+
184
+ # [5.16.0-beta.4](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.16.0-beta.4) (2025-07-23)
185
+
186
+ **Note:** Version bump only for package @pie-lib/charting
187
+
188
+ # [5.16.0-beta.3](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.16.0-beta.3) (2025-07-23)
189
+
190
+ **Note:** Version bump only for package @pie-lib/charting
191
+
192
+ # [5.16.0-beta.3](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.16.0-beta.3) (2025-07-20)
193
+
194
+ **Note:** Version bump only for package @pie-lib/charting
195
+
196
+ # [5.16.0-beta.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.16.0-beta.2) (2025-07-20)
197
+
198
+ **Note:** Version bump only for package @pie-lib/charting
199
+
200
+ # [5.16.0-beta.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.16.0-beta.1) (2025-07-20)
201
+
202
+ **Note:** Version bump only for package @pie-lib/charting
203
+
204
+ # [5.16.0-beta.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.16.0-beta.2) (2025-07-20)
205
+
206
+ **Note:** Version bump only for package @pie-lib/charting
207
+
208
+ # [5.16.0-beta.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.16.0-beta.1) (2025-07-20)
209
+
210
+ **Note:** Version bump only for package @pie-lib/charting
211
+
212
+ # [5.16.0-beta.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.16.0-beta.1) (2025-07-20)
213
+
214
+ **Note:** Version bump only for package @pie-lib/charting
215
+
216
+ # [5.16.0-beta.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.16.0-beta.0) (2025-07-20)
217
+
218
+ **Note:** Version bump only for package @pie-lib/charting
219
+
220
+ # [5.17.0-beta.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.17.0-beta.0) (2025-07-15)
221
+
222
+ **Note:** Version bump only for package @pie-lib/charting
223
+
224
+ # [5.16.0-beta.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.16.0-beta.0) (2025-07-15)
225
+
226
+ **Note:** Version bump only for package @pie-lib/charting
227
+
228
+ ## [5.15.6](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.5...@pie-lib/charting@5.15.6) (2023-10-16)
229
+
230
+ ### Bug Fixes
231
+
232
+ - **charting:** add sanity check for data PD-3223 ([f573866](https://github.com/pie-framework/pie-lib/commit/f57386626933cdb5b8b6a1c0f91b45b6ea1b9ca7))
233
+ - **charting:** address overlap of drag handle with category labels in charts PD-3223 ([ebe212e](https://github.com/pie-framework/pie-lib/commit/ebe212ecd315d6445b1d676568482fa47b40ebdb))
234
+ - **charting:** limit number of categories in Define Correct Response Chart to 20 ([0b0e8ab](https://github.com/pie-framework/pie-lib/commit/0b0e8ab339126e00703c1ae5218c714bbcdb6dbf))
235
+ - **charting:** refine error message display to prevent overlapping with other elements and other messages PD-3121 ([f2de1ad](https://github.com/pie-framework/pie-lib/commit/f2de1adb4d19a44e403beb3d88cbb333e3c5adb9))
236
+ - **charting:** use red boxes only and for all duplicated category names, reorder CSS selectors to resolve styling conflicts, only display the validation message a single time for duplicate categories and for empty labels PD-3121 ([7cae40b](https://github.com/pie-framework/pie-lib/commit/7cae40b48a1da661d7d7c97780098a07e5b1d336))
237
+
238
+ ## [5.15.5](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.4...@pie-lib/charting@5.15.5) (2023-09-28)
239
+
240
+ ### Bug Fixes
241
+
242
+ - **charting:** add drop shadow to evaluate bars PD-2790 ([328c730](https://github.com/pie-framework/pie-lib/commit/328c7308d026ca6e00575d47bdfaf1d9e4779d16))
127
243
 
244
+ ## [5.15.4](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.3...@pie-lib/charting@5.15.4) (2023-09-28)
245
+
246
+ ### Bug Fixes
247
+
248
+ - **charting:** fix modal warnings ([34dbf3b](https://github.com/pie-framework/pie-lib/commit/34dbf3b04845773d23aa7c91a80fab57e1e78cd0))
249
+ - **charting:** limit number of categories in Define Initial Chart Attributes to 20 PD-3128 ([b0da731](https://github.com/pie-framework/pie-lib/commit/b0da731a619c9d13a8b12e16a6e81dc924261396))
250
+
251
+ ## [5.15.3](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.2...@pie-lib/charting@5.15.3) (2023-09-26)
252
+
253
+ ### Bug Fixes
254
+
255
+ - **charting:** adjust icon for the drag handle PD-2790 ([fe670d7](https://github.com/pie-framework/pie-lib/commit/fe670d7a04f44da5c93dadbeec41b753ce50f9f6))
256
+
257
+ ## [5.15.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.1...@pie-lib/charting@5.15.2) (2023-09-25)
258
+
259
+ ### Bug Fixes
260
+
261
+ - add required packages for charting to work ([c7af164](https://github.com/pie-framework/pie-lib/commit/c7af16427245d0c0c5c041e296a1cfdf034b7b64))
262
+
263
+ ## [5.15.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.0...@pie-lib/charting@5.15.1) (2023-09-25)
264
+
265
+ ### Bug Fixes
266
+
267
+ - **charting:** add @mui/icons-material to package json PD-2790 ([0262857](https://github.com/pie-framework/pie-lib/commit/026285728f998e3fe31ec43c77e99f2311f9ad22))
268
+
269
+ # [5.15.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.14.3...@pie-lib/charting@5.15.0) (2023-09-25)
270
+
271
+ ### Bug Fixes
272
+
273
+ - **charting:** set labelWidth to prevent outline from intersecting InputLabel for the ChartType menu PD-3166 ([ff9ca2b](https://github.com/pie-framework/pie-lib/commit/ff9ca2b9812d0afd209edccac2feecac396111cc))
128
274
 
129
275
  ### Features
130
276
 
131
- * **charting, translator:** add translator to charting. add missing text in translator ([2c722a2](https://github.com/pie-framework/pie-lib/commit/2c722a241deb1ad4b51aa22c6eba74a0ec8a5ec0))
277
+ - **charting:** add hover effect for plot and bars PD-2790 ([af0d9ba](https://github.com/pie-framework/pie-lib/commit/af0d9bab03fa8146299bf0a1947dbe418e306f85))
278
+ - **charting:** adjust y-coordinate in maskSize for better chart fitting after adding new design, tweaks in design PD-2790 ([0edf288](https://github.com/pie-framework/pie-lib/commit/0edf2880c8c8c0e0e51df080aa582d071f0f1e52))
279
+ - **charting:** make style dynamic for drag icon PD-2790 ([aed8c81](https://github.com/pie-framework/pie-lib/commit/aed8c818cbc70910a7e31566c94dd731d068efa1))
280
+ - **charting:** Replace drag-enabled horizontal bars with widget for author and gather mode PD-2790, refactor RawDragHandle component ([e0a369a](https://github.com/pie-framework/pie-lib/commit/e0a369ad2aaf9cf5d3aa3ac061c23316443b35fb))
132
281
 
282
+ ## [5.14.3](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.14.2...@pie-lib/charting@5.14.3) (2023-09-18)
283
+
284
+ ### Bug Fixes
133
285
 
286
+ - **charting:** add tests for resetValues PD-3105 ([972a3cd](https://github.com/pie-framework/pie-lib/commit/972a3cd4b3787352ffe4073085cbd22f91895b43))
287
+ - **charting:** wip PD-3105 ([9e21836](https://github.com/pie-framework/pie-lib/commit/9e21836ad8c89c7c839c6561db5edc0329a6a6af))
288
+ - **charting:** wip PD-3105 ([f2f8234](https://github.com/pie-framework/pie-lib/commit/f2f82343a373ae1a8f669754a061963cbfdbeb08))
289
+ - **charting:** wip PD-3105 revert push in develop ([6cce5e2](https://github.com/pie-framework/pie-lib/commit/6cce5e2d25d079c1c3eb195425dc2cf016fcd36e))
290
+
291
+ ## [5.14.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.14.1...@pie-lib/charting@5.14.2) (2023-08-07)
134
292
 
293
+ **Note:** Version bump only for package @pie-lib/charting
294
+
295
+ ## [5.14.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.14.0...@pie-lib/charting@5.14.1) (2023-06-24)
296
+
297
+ **Note:** Version bump only for package @pie-lib/charting
298
+
299
+ # [5.14.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.13.0...@pie-lib/charting@5.14.0) (2023-06-13)
300
+
301
+ ### Features
135
302
 
303
+ - **charting, translator:** add translator to charting. add missing text in translator ([2c722a2](https://github.com/pie-framework/pie-lib/commit/2c722a241deb1ad4b51aa22c6eba74a0ec8a5ec0))
136
304
 
137
305
  # [5.13.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.12.0...@pie-lib/charting@5.13.0) (2023-06-12)
138
306
 
@@ -0,0 +1 @@
1
+ []
@@ -0,0 +1,175 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = exports.ActionsButton = void 0;
9
+
10
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
+
12
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
+
14
+ var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
15
+
16
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
17
+
18
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
19
+
20
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
21
+
22
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
23
+
24
+ var _react = _interopRequireDefault(require("react"));
25
+
26
+ var _propTypes = _interopRequireDefault(require("prop-types"));
27
+
28
+ var _styles = require("@material-ui/core/styles");
29
+
30
+ var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
31
+
32
+ var _Popover = _interopRequireDefault(require("@material-ui/core/Popover"));
33
+
34
+ var _Paper = _interopRequireDefault(require("@material-ui/core/Paper"));
35
+
36
+ var _renderUi = require("@pie-lib/render-ui");
37
+
38
+ var _translator = _interopRequireDefault(require("@pie-lib/translator"));
39
+
40
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
41
+
42
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
43
+
44
+ var translator = _translator["default"].translator;
45
+
46
+ var ActionsButton = /*#__PURE__*/function (_React$Component) {
47
+ (0, _inherits2["default"])(ActionsButton, _React$Component);
48
+
49
+ var _super = _createSuper(ActionsButton);
50
+
51
+ function ActionsButton(props) {
52
+ var _this;
53
+
54
+ (0, _classCallCheck2["default"])(this, ActionsButton);
55
+ _this = _super.call(this, props);
56
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleActionsClick", function (event) {
57
+ _this.setState({
58
+ actionsAnchorEl: event.currentTarget
59
+ });
60
+ });
61
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleActionsClose", function () {
62
+ _this.setState({
63
+ actionsAnchorEl: null
64
+ });
65
+ });
66
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleAddCategory", function () {
67
+ var addCategory = _this.props.addCategory;
68
+ addCategory();
69
+
70
+ _this.handleActionsClose();
71
+ });
72
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleDeleteCategory", function (index) {
73
+ var deleteCategory = _this.props.deleteCategory;
74
+ deleteCategory(index);
75
+
76
+ _this.handleActionsClose();
77
+ });
78
+ _this.state = {
79
+ actionsAnchorEl: null
80
+ };
81
+ return _this;
82
+ }
83
+
84
+ (0, _createClass2["default"])(ActionsButton, [{
85
+ key: "render",
86
+ value: function render() {
87
+ var _this2 = this;
88
+
89
+ var _this$props = this.props,
90
+ classes = _this$props.classes,
91
+ categories = _this$props.categories,
92
+ language = _this$props.language;
93
+ return /*#__PURE__*/_react["default"].createElement("div", {
94
+ className: classes.actions
95
+ }, /*#__PURE__*/_react["default"].createElement("div", {
96
+ role: "button",
97
+ tabIndex: 0,
98
+ className: classes.trigger,
99
+ onClick: this.handleActionsClick
100
+ }, "Actions"), /*#__PURE__*/_react["default"].createElement(_Popover["default"], {
101
+ open: Boolean(this.state.actionsAnchorEl),
102
+ anchorEl: this.state.actionsAnchorEl,
103
+ onClose: this.handleActionsClose,
104
+ anchorOrigin: {
105
+ vertical: 'bottom',
106
+ horizontal: 'left'
107
+ },
108
+ transformOrigin: {
109
+ vertical: 'top',
110
+ horizontal: 'left'
111
+ }
112
+ }, /*#__PURE__*/_react["default"].createElement(_Paper["default"], {
113
+ className: classes.actionsPaper
114
+ }, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
115
+ onClick: function onClick() {
116
+ return _this2.handleAddCategory();
117
+ }
118
+ }, "+ ", translator.t('charting.add', {
119
+ lng: language
120
+ })), categories.length > 0 && categories.map(function (category, index) {
121
+ return category.deletable && !category.correctness && /*#__PURE__*/_react["default"].createElement(_Button["default"], {
122
+ key: index,
123
+ onClick: function onClick() {
124
+ return _this2.handleDeleteCategory(index);
125
+ }
126
+ }, "".concat(translator.t('charting.delete', {
127
+ lng: language
128
+ }), " <").concat(category.label || translator.t('charting.newLabel', {
129
+ lng: language
130
+ }), ">"));
131
+ }))));
132
+ }
133
+ }]);
134
+ return ActionsButton;
135
+ }(_react["default"].Component);
136
+
137
+ exports.ActionsButton = ActionsButton;
138
+ (0, _defineProperty2["default"])(ActionsButton, "propTypes", {
139
+ classes: _propTypes["default"].object.isRequired,
140
+ addCategory: _propTypes["default"].func.isRequired,
141
+ deleteCategory: _propTypes["default"].func.isRequired,
142
+ language: _propTypes["default"].string,
143
+ categories: _propTypes["default"].array
144
+ });
145
+
146
+ var styles = function styles(theme) {
147
+ return {
148
+ actions: {
149
+ alignSelf: 'flex-end'
150
+ },
151
+ trigger: {
152
+ cursor: 'pointer',
153
+ fontSize: theme.typography.fontSize,
154
+ color: _renderUi.color.tertiary(),
155
+ padding: theme.spacing.unit
156
+ },
157
+ actionsPaper: {
158
+ padding: theme.spacing.unit,
159
+ display: 'flex',
160
+ flexDirection: 'column',
161
+ gap: theme.spacing.unit,
162
+ '& button': {
163
+ textTransform: 'none',
164
+ fontSize: theme.typography.fontSize,
165
+ color: _renderUi.color.text(),
166
+ justifyContent: 'flex-start'
167
+ }
168
+ }
169
+ };
170
+ };
171
+
172
+ var _default = (0, _styles.withStyles)(styles)(ActionsButton);
173
+
174
+ exports["default"] = _default;
175
+ //# sourceMappingURL=actions-button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/actions-button.jsx"],"names":["translator","Translator","ActionsButton","props","event","setState","actionsAnchorEl","currentTarget","addCategory","handleActionsClose","index","deleteCategory","state","classes","categories","language","actions","trigger","handleActionsClick","Boolean","vertical","horizontal","actionsPaper","handleAddCategory","t","lng","length","map","category","deletable","correctness","handleDeleteCategory","label","React","Component","PropTypes","object","isRequired","func","string","array","styles","theme","alignSelf","cursor","fontSize","typography","color","tertiary","padding","spacing","unit","display","flexDirection","gap","textTransform","text","justifyContent"],"mappings":"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","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@material-ui/core/styles';\nimport Button from '@material-ui/core/Button';\nimport Popover from '@material-ui/core/Popover';\nimport Paper from '@material-ui/core/Paper';\n\nimport { color } from '@pie-lib/render-ui';\nimport Translator from '@pie-lib/translator';\n\nconst { translator } = Translator;\n\nexport class ActionsButton extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n actionsAnchorEl: null,\n };\n }\n\n static propTypes = {\n classes: PropTypes.object.isRequired,\n addCategory: PropTypes.func.isRequired,\n deleteCategory: PropTypes.func.isRequired,\n language: PropTypes.string,\n categories: PropTypes.array,\n };\n\n handleActionsClick = (event) => {\n this.setState({ actionsAnchorEl: event.currentTarget });\n };\n\n handleActionsClose = () => {\n this.setState({ actionsAnchorEl: null });\n };\n\n handleAddCategory = () => {\n const { addCategory } = this.props;\n addCategory();\n this.handleActionsClose();\n };\n\n handleDeleteCategory = (index) => {\n const { deleteCategory } = this.props;\n deleteCategory(index);\n this.handleActionsClose();\n };\n\n render() {\n const { classes, categories, language } = this.props;\n\n return (\n <div className={classes.actions}>\n <div role=\"button\" tabIndex={0} className={classes.trigger} onClick={this.handleActionsClick}>\n Actions\n </div>\n <Popover\n open={Boolean(this.state.actionsAnchorEl)}\n anchorEl={this.state.actionsAnchorEl}\n onClose={this.handleActionsClose}\n anchorOrigin={{ vertical: 'bottom', horizontal: 'left' }}\n transformOrigin={{ vertical: 'top', horizontal: 'left' }}\n >\n <Paper className={classes.actionsPaper}>\n <Button onClick={() => this.handleAddCategory()}>\n + {translator.t('charting.add', { lng: language })}\n </Button>\n {categories.length > 0 &&\n categories.map(\n (category, index) =>\n category.deletable &&\n !category.correctness && (\n <Button key={index} onClick={() => this.handleDeleteCategory(index)}>\n {`${translator.t('charting.delete', { lng: language })} <${category.label ||\n translator.t('charting.newLabel', { lng: language })}>`}\n </Button>\n ),\n )}\n </Paper>\n </Popover>\n </div>\n );\n }\n}\n\nconst styles = (theme) => ({\n actions: {\n alignSelf: 'flex-end',\n },\n trigger: {\n cursor: 'pointer',\n fontSize: theme.typography.fontSize,\n color: color.tertiary(),\n padding: theme.spacing.unit,\n },\n actionsPaper: {\n padding: theme.spacing.unit,\n display: 'flex',\n flexDirection: 'column',\n gap: theme.spacing.unit,\n '& button': {\n textTransform: 'none',\n fontSize: theme.typography.fontSize,\n color: color.text(),\n justifyContent: 'flex-start',\n },\n },\n});\n\nexport default withStyles(styles)(ActionsButton);\n"],"file":"actions-button.js"}