@iamproperty/components 5.5.1-beta-1 → 5.5.1-beta-4

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 (124) hide show
  1. package/assets/css/components/actionbar.css +1 -1
  2. package/assets/css/components/actionbar.css.map +1 -1
  3. package/assets/css/components/applied-filters.css +1 -1
  4. package/assets/css/components/applied-filters.css.map +1 -1
  5. package/assets/css/components/card.css +1 -1
  6. package/assets/css/components/card.css.map +1 -1
  7. package/assets/css/components/card.global.css +1 -1
  8. package/assets/css/components/card.global.css.map +1 -1
  9. package/assets/css/components/charts.css +1 -1
  10. package/assets/css/components/charts.css.map +1 -1
  11. package/assets/css/components/fileupload.css.map +1 -1
  12. package/assets/css/components/inline-edit.css +1 -0
  13. package/assets/css/components/inline-edit.css.map +1 -0
  14. package/assets/css/components/inline-edit.preload.css +1 -0
  15. package/assets/css/components/inline-edit.preload.css.map +1 -0
  16. package/assets/css/components/multiselect.css +1 -0
  17. package/assets/css/components/multiselect.css.map +1 -0
  18. package/assets/css/components/multiselect.preload.css +1 -0
  19. package/assets/css/components/multiselect.preload.css.map +1 -0
  20. package/assets/css/components/nav.css.map +1 -1
  21. package/assets/css/components/nav.global.css +1 -1
  22. package/assets/css/components/nav.global.css.map +1 -1
  23. package/assets/css/components/slider.css.map +1 -1
  24. package/assets/css/components/tabs.css +1 -1
  25. package/assets/css/components/tabs.css.map +1 -1
  26. package/assets/css/core.min.css +1 -1
  27. package/assets/css/core.min.css.map +1 -1
  28. package/assets/css/style.min.css +1 -1
  29. package/assets/css/style.min.css.map +1 -1
  30. package/assets/js/components/accordion/accordion.component.min.js +1 -1
  31. package/assets/js/components/actionbar/actionbar.component.js +12 -3
  32. package/assets/js/components/actionbar/actionbar.component.min.js +6 -6
  33. package/assets/js/components/actionbar/actionbar.component.min.js.map +1 -1
  34. package/assets/js/components/address-lookup/address-lookup.component.min.js +1 -1
  35. package/assets/js/components/applied-filters/applied-filters.component.min.js +6 -6
  36. package/assets/js/components/applied-filters/applied-filters.component.min.js.map +1 -1
  37. package/assets/js/components/card/card.component.min.js +3 -3
  38. package/assets/js/components/chart/chart.component.js +71 -0
  39. package/assets/js/components/collapsible-side/collapsible-side.component.min.js +1 -1
  40. package/assets/js/components/fileupload/fileupload.component.js +1 -1
  41. package/assets/js/components/fileupload/fileupload.component.min.js +5 -5
  42. package/assets/js/components/fileupload/fileupload.component.min.js.map +1 -1
  43. package/assets/js/components/filterlist/filterlist.component.min.js +1 -1
  44. package/assets/js/components/header/header.component.min.js +1 -1
  45. package/assets/js/components/inline-edit/inline-edit.component.js +148 -0
  46. package/assets/js/components/inline-edit/inline-edit.component.min.js +22 -0
  47. package/assets/js/components/inline-edit/inline-edit.component.min.js.map +1 -0
  48. package/assets/js/components/multiselect/multiselect.component.js +221 -0
  49. package/assets/js/components/multiselect/multiselect.component.min.js +25 -0
  50. package/assets/js/components/multiselect/multiselect.component.min.js.map +1 -0
  51. package/assets/js/components/nav/nav.component.min.js +2 -2
  52. package/assets/js/components/notification/notification.component.min.js +1 -1
  53. package/assets/js/components/pagination/pagination.component.min.js +1 -1
  54. package/assets/js/components/search/search.component.min.js +1 -1
  55. package/assets/js/components/search/search.component.min.js.map +1 -1
  56. package/assets/js/components/table/table.component.js +2 -2
  57. package/assets/js/components/table/table.component.min.js +6 -6
  58. package/assets/js/components/table/table.component.min.js.map +1 -1
  59. package/assets/js/components/tabs/tabs.component.min.js +2 -2
  60. package/assets/js/dynamic.min.js +5 -5
  61. package/assets/js/dynamic.min.js.map +1 -1
  62. package/assets/js/modules/applied-filters.js +39 -7
  63. package/assets/js/modules/chart.js +613 -111
  64. package/assets/js/modules/fileupload.js +11 -0
  65. package/assets/js/modules/helpers.js +20 -0
  66. package/assets/js/modules/inputs.js +6 -2
  67. package/assets/js/modules/table.js +62 -11
  68. package/assets/js/scripts.bundle.js +31 -31
  69. package/assets/js/scripts.bundle.js.map +1 -1
  70. package/assets/js/scripts.bundle.min.js +2 -2
  71. package/assets/js/scripts.bundle.min.js.map +1 -1
  72. package/assets/sass/_components.scss +5 -0
  73. package/assets/sass/_elements.scss +1 -1
  74. package/assets/sass/_functions/variables.scss +80 -0
  75. package/assets/sass/_utilities.scss +1 -0
  76. package/assets/sass/components/actionbar.scss +16 -0
  77. package/assets/sass/components/applied-filters.scss +6 -48
  78. package/assets/sass/components/card.global.scss +4 -0
  79. package/assets/sass/components/card.scss +1 -1
  80. package/assets/sass/components/charts.scss +981 -234
  81. package/assets/sass/components/inline-edit.preload.scss +98 -0
  82. package/assets/sass/components/inline-edit.scss +32 -0
  83. package/assets/sass/components/multiselect.preload.scss +37 -0
  84. package/assets/sass/components/multiselect.scss +186 -0
  85. package/assets/sass/components/nav.global.scss +2 -0
  86. package/assets/sass/components/tabs.scss +10 -1
  87. package/assets/sass/elements/admin-panel.scss +0 -3
  88. package/assets/sass/elements/badge-tag.scss +92 -0
  89. package/assets/sass/elements/buttons.scss +13 -1
  90. package/assets/sass/elements/details.scss +94 -5
  91. package/assets/sass/elements/dialog.scss +2 -0
  92. package/assets/sass/elements/forms.scss +42 -25
  93. package/assets/sass/elements/tooltips.scss +4 -3
  94. package/assets/sass/foundations/root.scss +11 -0
  95. package/assets/sass/helpers/wider-colours.scss +11 -0
  96. package/assets/ts/components/actionbar/actionbar.component.ts +14 -3
  97. package/assets/ts/components/chart/README.md +37 -0
  98. package/assets/ts/components/chart/chart.component.ts +98 -0
  99. package/assets/ts/components/fileupload/fileupload.component.ts +1 -1
  100. package/assets/ts/components/inline-edit/README.md +30 -0
  101. package/assets/ts/components/inline-edit/inline-edit.component.ts +211 -0
  102. package/assets/ts/components/multiselect/README.md +35 -0
  103. package/assets/ts/components/multiselect/multiselect.component.ts +304 -0
  104. package/assets/ts/components/search/README.md +36 -0
  105. package/assets/ts/components/table/table.component.ts +2 -2
  106. package/assets/ts/modules/applied-filters.ts +61 -7
  107. package/assets/ts/modules/chart.ts +808 -119
  108. package/assets/ts/modules/fileupload.ts +19 -0
  109. package/assets/ts/modules/helpers.ts +29 -1
  110. package/assets/ts/modules/inputs.ts +8 -2
  111. package/assets/ts/modules/table.ts +86 -12
  112. package/dist/components.es.js +348 -329
  113. package/dist/components.umd.js +59 -63
  114. package/dist/style.css +1 -1
  115. package/package.json +1 -1
  116. package/src/components/AppliedFilters/AppliedFilters.vue +1 -1
  117. package/src/components/Chart/Chart.vue +26 -96
  118. package/src/components/InlineEdit/InlineEdit.vue +45 -0
  119. package/src/components/InlineEdit/README.md +7 -0
  120. package/src/components/Multiselect/Multiselect.vue +24 -0
  121. package/src/components/Multiselect/README.md +12 -0
  122. package/src/components/Search/README.md +11 -0
  123. package/src/components/Search/Search.vue +1 -1
  124. package/assets/sass/elements/badge.scss +0 -29
@@ -1,167 +1,414 @@
1
1
  @use "../_func" as *;
2
2
 
3
- // #region Chart Colours
3
+ $chart-colour-1: #1EBEE6!default;
4
+ $chart-colour-2: #FFD2D2!default;
5
+ $chart-colour-3: #B4E6A5!default;
6
+ $chart-colour-4: #ffa500!default;
7
+ $chart-colour-5: #46003c!default;
8
+ $chart-colour-6: #b4e6a5!default;
9
+ $chart-colour-7: #1ebee6!default;
10
+ $chart-colour-8: #ffd2d2!default;
11
+ $chart-colour-9: #9d9d9d!default;
12
+ $chart-colour-10: #66838a!default;
13
+
4
14
  $chart-colors: ();
5
15
  $chart-colors: map-merge((
6
- 1: --colour-primary,
7
- 2: --colour-secondary,
8
- 3: --colour-info,
9
- 4: --colour-warning,
10
- 5: --colour-dark,
11
- 6: --colour-light,
12
- 7: --colour-primary,
13
- 8: --colour-secondary,
14
- 9: --colour-info,
15
- 10: --colour-warning,
16
+ 1: $chart-colour-1,
17
+ 2: $chart-colour-2,
18
+ 3: $chart-colour-3,
19
+ 4: $chart-colour-4,
20
+ 5: $chart-colour-5,
21
+ 6: $chart-colour-6,
22
+ 7: $chart-colour-7,
23
+ 8: $chart-colour-8,
24
+ 9: $chart-colour-9,
25
+ 10: $chart-colour-10
16
26
  ), $chart-colors);
17
27
 
18
- :root {
28
+ $chart-height: 56.25%!default;
29
+ $chart-height-lg: 42.86%!default;
30
+
31
+ // Selectors
32
+ $default-chart: 'input[type="radio"]:not([value="none"]):not([value="pie"]):checked ~ .chart__wrapper';
33
+ $bar-chart: 'input[type=radio]:is([value="bar"],[value="comparison"]):not([value=none]):not([value=pie]):checked~.chart__wrapper';
34
+
35
+ //$comparison-chart: 'input[type=radio][value="comparison"]:not([value=none]):not([value=pie]):checked~.chart__wrapper';
36
+ //$comparison-chart-key: 'input[type=radio][value="comparison"]:not([value=none]):not([value=pie]):checked~.chart__key';
37
+
38
+ $responsive-chart: 'input[type=radio][value="responsive"]:not([value=none]):not([value=pie]):checked~.chart__wrapper';
39
+ $scatter-line-chart: 'input[type="radio"]:not([value="pie"]):is([value="line"],[value="scatter"],[value="bubble"],[value="radar"],[value="proportional"],[value="combo"]):checked ~ .chart__wrapper';
40
+
41
+
42
+ $line-chart: 'input[type="radio"]:not([value="pie"])[value="line"]:checked ~ .chart__wrapper';
43
+ //$bubble-chart: 'input[type="radio"]:not([value="none"]):not([value="pie"])[value="bubble"]:checked ~ .chart__wrapper';
44
+ //$radar-chart: 'input[type="radio"]:not([value="none"]):not([value="pie"])[value="radar"]:checked ~ .chart__wrapper';
45
+ //$proportional-chart: 'input[type="radio"]:not([value="none"]):not([value="pie"])[value="proportional"]:checked ~ .chart__wrapper';
46
+ //$proportional-chart-key: 'input[type="radio"]:not([value="none"]):not([value="pie"])[value="proportional"]:checked ~ .chart__key';
47
+ $pie-chart: 'input[type="radio"]:not([value="none"]):is([value="pie"],[value="polar"]):checked ~ .chart__wrapper';
48
+ //$polar-chart: 'input[type="radio"]:not([value="none"])[value="polar"]:checked ~ .chart__wrapper';
49
+ //$tree-chart: 'input[type="radio"]:not([value="none"])[value="treemap"]:checked ~ .chart__wrapper';
50
+ //$tree-chart-key: 'input[type="radio"]:not([value="none"])[value="treemap"]:checked ~ .chart__key';
51
+ //$dumbbell-chart: 'input[type="radio"]:not([value="none"])[value="dumbbell"]:checked ~ .chart__wrapper';
52
+ //$waffle-chart: 'input[type="radio"]:not([value="none"])[value="waffle"]:checked ~ .chart__wrapper';
53
+
54
+
55
+ // #region Basic setup - including: container setup, css vars
56
+
57
+ ::slotted(table) {
58
+ display: none!important;
59
+ }
60
+
61
+ .chart__outer {
62
+
63
+ container-type: inline-size;
19
64
 
65
+ // CSS vars that can be overwritten by declaring them without the -set on the end of the variable i.e. --chart-colour-1: red; would overwrite --chart-colour-1-set
66
+ --body-colour-set: var(--body-colour, white);
67
+ --text-colour-set: var(--text-colour, black);
68
+ --chart-height-set: var(--chart-height, #{$chart-height});
69
+ --chart-height-lg-set: var(--chart-height-lg, #{$chart-height-lg});
70
+ --chart-height-resp: var(--chart-height-set);
71
+
72
+ tbody {
73
+ --chart-direction: 360deg;
74
+ --chart-day-bg-pos: 100% calc(var(--single-day) * 7)
75
+ }
76
+
77
+
20
78
  @each $index, $value in $chart-colors {
21
- --colour-chart-#{$index}: var(#{$value});
79
+ --chart-colour-#{$index}-set: var(--chart-colour-#{$index},#{$value});
22
80
  }
23
- }
24
81
 
25
- @include dark-mode() {
82
+ // Non-configurable css vars
83
+ --index-below: -1;
84
+ --index-base: 0;
85
+ --index-focus: 2;
86
+ --index-above: 10;
87
+ --index-floating: 100;
88
+ --index-menu: 200;
89
+ --index-overlay: 1000;
90
+ --key-label-width: 100%;
91
+ --label-size: #{rem(12)};
92
+ --pie-size: calc(50% - 1.4rem);
93
+ --line-thickness: 1px;
94
+ --yaxis-width: auto;
95
+ --yaxis-point-display: block;
96
+ --yaxis-last-point-transform: translate(0,-50%);
97
+ --bar-gap: min(10%, 0.75rem);
98
+
99
+ @container (max-width: 36em) {
100
+
101
+ :has(tr:nth-child(5) td:nth-child(4)),
102
+ :has(tr:nth-child(10)){
103
+
104
+ --yaxis-width: 0;
105
+ --yaxis-point-display: none;
106
+ --yaxis-last-point-transform: translate(0,-100%);
107
+ --bar-gap: 0;
108
+ }
109
+ }
110
+ @container (max-width: 63em) {
111
+ :has(tr:nth-child(10)){
112
+
113
+ --bar-gap: 0;
114
+ }
115
+ }
116
+ @container (min-width: 36em) {
117
+ .chart__wrapper {
118
+ --chart-height-resp: var(--chart-height-lg-set);
119
+ --pie-size: calc(33.333% - 1.4rem);
120
+ --line-thickness: 0.8px;
121
+ --yaxis-width: auto;
122
+ --yaxis-point-display: block;
123
+ --yaxis-last-point-transform: translate(0,-50%);
124
+ }
125
+ }
126
+
127
+ @container (min-width: 62em) {
26
128
 
27
- :root {
28
- --colour-chart-1: var(--colour-dark);
29
- --colour-chart-5: var(--colour-light);
30
- --colour-chart-6: var(--colour-dark);
31
- --colour-chart-7: var(--colour-secondary);
129
+ .chart__wrapper {
130
+
131
+ --label-size: #{rem(14)};
132
+ --pie-size: calc(25% - 1.5rem);
133
+ --line-thickness: 0.5px;
134
+ }
32
135
  }
33
- }
34
136
 
35
- @media (forced-colors: active) {
36
- .chart__wrapper:has(.chart:not(.chart--line)) {
137
+ &:has(.chart__options){
138
+ position: relative;
139
+ padding-top: rem(24);
140
+ }
141
+
142
+ margin-bottom: 2rem;
143
+ display: flex;
144
+ flex-direction: column;
145
+
146
+ > * {
147
+ display: block;
148
+ order: 2;
149
+ }
150
+
151
+ > figcaption {
152
+ display: contents;
153
+
154
+ p:not(.chart__strapline,.chart__title) {
155
+ margin-bottom: 0.25rem;
156
+ font-size: var(--label-size);
157
+ }
158
+
159
+ > * {
160
+ order: 3;
161
+ }
37
162
 
38
- --colour-chart-1: repeating-linear-gradient(
39
- 45deg,
40
- CanvasText 0px,
41
- CanvasText 5px,
42
- Canvas 5px,
43
- Canvas 10px
44
- );
45
- --colour-chart-2: transparent radial-gradient(circle, CanvasText 3px, transparent 3px) 6px 6px/12px 12px repeat;
46
- --colour-chart-3: repeating-linear-gradient(
47
- 90deg,
48
- CanvasText 0px,
49
- CanvasText 5px,
50
- Canvas 5px,
51
- Canvas 10px
52
- );
53
- // TODO: Add more patterns
163
+ > :is(.chart__title, .chart__strapline) {
164
+ order: 1;
165
+ }
54
166
  }
55
167
  }
56
168
  // #endregion
57
169
 
58
- // #region Apply colours
170
+ // #region figure caption elements
171
+ .chart__title {
172
+ font-size: 2rem;
173
+ font-weight: 700;
174
+ margin-bottom: 0.25rem;
175
+ }
176
+
177
+ .chart__strapline {
178
+ margin-bottom: 1rem;
179
+ }
180
+
181
+ .chart__source {
182
+ border-top: 1px solid black;
183
+ position: relative;
184
+ padding-top: rem(4);
185
+
186
+ }
187
+ // #endregion
188
+
189
+ // #region Apply chart colours
59
190
  @for $i from 1 to 10 {
191
+
192
+ .chart__key .key:nth-child(10n - #{10 - $i}),
193
+ .chart__outer table tbody tr td:not(:first-child):nth-child(10n - #{10 - ($i+1)}) {
194
+
195
+ --chart-colour: var(#{'--chart-colour-'+$i+'-set'});
196
+ }
197
+
198
+ input:is([value="line"],[value="radar"],[value="combo"],[value="proportional"]):checked ~ .chart__wrapper .line:nth-child(10n - #{10 - $i}) {
199
+ color: var(#{'--chart-colour-'+$i+'-set'});
200
+ stroke: currentColor;
201
+ fill: currentColor;
202
+ z-index: #{10 - $i};
203
+ }
204
+ input:is([value="pie"],[value="polar"]):checked ~ .chart__wrapper .pie path:nth-child(10n - #{10 - $i}) {
205
+ fill: var(#{'--chart-colour-'+$i+'-set'});
206
+ }
207
+ }
208
+
209
+ .chart__key .key:nth-child(10n),
210
+ input[type="radio"]:not([value="none"]):not([value="pie"]):checked ~ .chart__outer table tbody tr td:not(:first-child):nth-child(10n + 1) {
211
+
212
+ --chart-colour: var(#{'--chart-colour-10-set'});
213
+ }
214
+ // #endregion
60
215
 
61
- .chart__key .key:not(:first-child):nth-child(#{$i+1}):before,
62
- .chart:not(.chart--none):not(.chart--pie) table tbody tr td:not(:first-child):nth-child(#{$i+1}) {
63
- background: var(#{'--colour-chart-'+$i});
216
+ // #region Chart type switcher
217
+ .chart__outer > [type="radio"]{
218
+ opacity: 0;
219
+ position: absolute;
220
+ pointer-events: none;
221
+ }
222
+
223
+ .chart__options {
224
+
225
+ &:has(span:first-child:last-child){
226
+ display: none;
227
+ }
228
+
229
+
230
+ position: absolute;
231
+ display: block;
232
+ width: fit-content;
233
+ z-index: var(--index-above);
234
+ top: 0;
235
+ right: 0;
236
+ background-color: var(--body-colour-set);
237
+
64
238
 
65
- @media (forced-colors: active) {
66
- forced-color-adjust: none;
67
- border: 1px solid CanvasText;
239
+ > span:first-child {
240
+ text-align: right;
241
+ display: block;
242
+ height: rem(24);
243
+
244
+ &:before {
245
+ content: "";
246
+ height: rem(16);
247
+ width: rem(16);
248
+ background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3e%3cpath d='M31 19.3v-6.5l-3.9-.5c-.1-.4-.3-.9-.5-1.5l2.4-3-4.7-4.7-3.1 2.4c-.4-.2-.9-.4-1.5-.6L19.2 1h-6.5l-.5 3.9c-.6.2-1.1.4-1.5.6l-3-2.4L3 7.7l2.4 3c-.2.5-.4 1.1-.5 1.5l-3.9.5v6.5l3.9.5c.2.5.3 1 .6 1.5l-2.4 3 4.7 4.7 3-2.3c.4.2 1 .5 1.5.6l.5 3.8h6.5l.5-3.8c.5-.2 1.1-.4 1.5-.6l3 2.3 4.7-4.7-2.4-3 .6-1.5 3.8-.4zm-2.1-1.9-3.4.5c-.3 1.5-.8 2.7-1.6 3.6l2.1 2.6-1.9 2-2.6-2c-1 .7-2.5 1.3-3.7 1.5l-.5 3.3h-2.6l-.5-3.3c-1.2-.2-2.7-.8-3.7-1.5l-2.6 2-1.9-2 2.1-2.6c-.8-.9-1.2-2.1-1.6-3.6l-3.4-.5v-2.7l3.5-.5c.2-1.1.6-2.3 1.4-3.7L6 7.9l1.9-2L10.6 8c.8-.7 1.7-1.1 3.6-1.6l.5-3.4h2.6l.5 3.4c1.9.5 2.8.9 3.6 1.6l2.7-2L26 8l-2 2.5c.8 1.4 1.2 2.6 1.4 3.7l3.5.5v2.7zM16 20.8c-2.7 0-4.7-2-4.7-4.8 0-2.7 2-4.7 4.7-4.7s4.7 2 4.7 4.7-2 4.8-4.7 4.8zm0 2.2c3.9 0 6.9-3 6.9-7 0-3.9-3-6.9-6.9-6.9s-6.9 3-6.9 6.9c0 4 3 7 6.9 7z'%3e%3c/path%3e%3c/svg%3e");
249
+ background-size: 100% 100%;
250
+ display: inline-block;
251
+
252
+ vertical-align: bottom;
253
+ margin-bottom: rem(3);
254
+ margin-right: rem(6);
68
255
  }
69
256
  }
70
- .chart.chart--line:not(.chart--none):not(.chart--pie) .line:nth-child(#{$i}) {
71
- stroke: var(#{'--colour-chart-'+$i});
72
- z-index: #{10 - $i};
73
257
 
74
- @media (forced-colors: active) {
75
- forced-color-adjust: none;
258
+ > *:not(:first-child) {
259
+
260
+ display: none;
261
+ }
262
+
263
+ label {
264
+ cursor: pointer;
265
+
266
+ &:hover {
267
+
268
+ background: var(--label-bg, rgb(220, 220, 220));
76
269
  }
77
270
  }
78
- .chart.chart--pie .pie path:nth-child(#{$i}) {
79
- fill: var(#{'--colour-chart-'+$i});
80
271
 
81
- @media (forced-colors: active) {
82
- forced-color-adjust: none;
272
+ &:hover {
273
+ outline: 3px solid black;
274
+
275
+ box-shadow: 0 0 0 calc(0.125rem + 0.125rem) #FFFFFF;
276
+ outline-offset: calc(0.125rem + 0.125rem);
277
+
278
+ > * {
279
+ display: block;
83
280
  }
84
281
  }
282
+
283
+ .chart__options__title {
284
+ margin-top: 1rem;
285
+ font-weight: bold;
286
+ }
85
287
  }
86
- // #endregion
87
288
 
88
- // #region caption
89
- .chart__wrapper {
90
- figcaption {
91
- font-size: 1rem;
92
- margin-bottom: 2rem;
289
+ .chart > [type="radio"]:focus ~ .chart__switcher{
290
+ label {
93
291
  display: block;
94
292
  }
95
293
  }
96
294
  // #endregion
97
295
 
98
296
  // #region Chart key
297
+ .chart__outer > input[type="checkbox"] {
298
+ opacity: 0;
299
+ position: absolute;
300
+ pointer-events: none;
301
+ }
302
+
99
303
  .chart__key {
100
304
 
101
- padding-bottom: 2rem;
102
- margin-bottom: 0;
305
+ padding: 0 0 0 0;
306
+ margin-bottom: 1.5rem;
307
+ //background: var(--colour-key-bg, rgb(220, 220, 220));
308
+ display: flex;
309
+ overflow: auto;
310
+ scroll-snap-type: x mandatory;
311
+ scroll-padding: 0.75rem;
312
+ justify-content: flex-end;
313
+ gap: 0.5rem;
103
314
 
104
- &:before {
105
- content: "Key: ";
106
- display: inline-block;
107
- padding-right: 1.5rem;
108
- margin-bottom: 1rem;
109
- width: 100%;
315
+ .key {
110
316
 
111
- @include media-breakpoint-up(sm) {
317
+ font-size: 1rem!important;
318
+ margin: 0;
112
319
 
113
- width: auto;
320
+ &:before {
321
+ content: "";
322
+ height: 0.8em;
323
+ width: 0.8em;
324
+ margin-right: 0.3em;
325
+ background-color: var(--chart-colour);
326
+ display: inline-block;
327
+ border-radius: 50%;
114
328
  }
115
- }
116
329
 
117
- .key {
330
+ /*
118
331
  display: inline-block;
119
- padding-right: 1.5rem;
120
- margin-bottom: 1rem;
332
+ padding: 0.5rem;
333
+ margin-right: 0.75rem;
334
+ margin-bottom: 0.75rem;
335
+ background: white;
336
+ white-space: nowrap;
337
+ cursor: pointer;
338
+ scroll-snap-align: start;
339
+
340
+ &:hover,
341
+ &:focus-within {
342
+ outline: 3px solid var(--chart-colour);
343
+ }
344
+ */
121
345
 
122
- &:before {
123
- content: "";
124
- height: 1em;
125
- width: 1em;
126
- margin-right: 0.25em;
127
- background: red;
128
- display: inline-block;
129
- vertical-align: middle;
130
- margin-bottom: 0.2em;
346
+ &[data-label="Min"],
347
+ &[data-label="Max"] {
348
+ display: none;
131
349
  }
132
350
 
133
- &:first-child {
351
+ .chart__total {
134
352
  display: none;
135
353
  }
136
354
  }
137
355
  }
138
356
  // #endregion
139
357
 
140
- // #region Default bar chart (Also applies to line chart)
141
- .chart:not(.chart--none):not(.chart--pie) {
358
+ // #region Hide data sets
359
+ .chart__outer > input[type="checkbox"]:not(:checked) ~ .chart__key .key {
360
+
361
+ opacity: 0.25;
362
+ }
142
363
 
143
- --label-size: #{rem(12)};
144
- --chart-ratio: 56.25%;
364
+ .chart__outer > input[type="checkbox"]:not(:checked) ~ .chart__wrapper table tbody tr td:not(:first-child) {
365
+ display: none;
366
+ }
367
+
368
+ .chart__outer > input[type="checkbox"]:not(:checked) ~ .chart__wrapper :is(.chart__lines, .radar) .line {
369
+ display: none!important;
370
+ }
145
371
 
146
- @include media-breakpoint-up(sm) {
372
+ @for $i from 1 to 10 {
147
373
 
148
- --chart-ratio: 42.86%; // 21:9 ratio
374
+ .chart__outer > input[type="checkbox"]:nth-of-type(#{$i}):focus ~ .chart__key .key:nth-of-type(#{$i}) {
375
+ //outline: 3px solid var(--chart-colour);
149
376
  }
150
377
 
151
- @include media-breakpoint-up(md) {
378
+ .chart__outer > input[type="checkbox"]:nth-of-type(#{$i}):not(:checked) ~ .chart__key .key:nth-of-type(#{$i}) {
379
+ opacity: 1;
380
+ }
152
381
 
153
- --label-size: #{rem(14)};
382
+ .chart__outer > input[type="checkbox"]:nth-of-type(#{$i}):not(:checked) ~ .chart__wrapper table tbody tr td:not(:first-child):nth-child(#{$i+1}) {
383
+ display: block;
154
384
  }
155
385
 
386
+ input:nth-of-type(#{$i}):not(:checked) ~ .chart__wrapper :is(.chart__lines,.radar) .line:nth-child(#{$i}) {
387
+ display: block!important;
388
+ }
389
+ }
390
+ // #endregion
391
+
392
+ // #region Second table
393
+ .chart:has(.chart__outer) > table {
394
+ order: 10;
395
+ display: none;
396
+ }
397
+ // #endregion Second table
398
+
399
+ // #region Default column chart (Also applies to line chart)
400
+ .chart__wrapper {
401
+
402
+ display: block;
156
403
  display: flex;
404
+ flex-direction: row;
157
405
  position: relative;
158
- margin-bottom: 2rem;
406
+ margin-bottom: 1rem;
159
407
 
160
408
  .chart__yaxis {
161
- margin-bottom: 2rem;
162
409
  display: flex;
163
410
  flex-direction: column-reverse;
164
- width: 0;
411
+ width: var(--yaxis-width);
165
412
 
166
413
  .axis__point {
167
414
 
@@ -171,7 +418,7 @@ $chart-colors: map-merge((
171
418
  white-space: nowrap;
172
419
 
173
420
  &:not(:last-child){
174
- display: none;
421
+ display: var(--yaxis-point-display);
175
422
  }
176
423
 
177
424
  span {
@@ -184,24 +431,35 @@ $chart-colors: map-merge((
184
431
 
185
432
  &:last-child span {
186
433
 
187
- transform: translate(0,-100%);
434
+ transform: var(--yaxis-last-point-transform);
188
435
  }
189
436
  }
437
+ }
190
438
 
191
- @include media-breakpoint-up(sm) {
192
-
193
- width: auto;
194
-
195
- .axis__point {
439
+ .chart__xaxis {
440
+ margin-bottom: 1rem;
441
+ display: flex;
442
+ flex-direction: column-reverse;
443
+ width: 100%;
444
+ position: absolute;
445
+ left: 0;
446
+ bottom: -1rem;
196
447
 
197
- &:not(:last-child){
198
- display: block;
199
- }
448
+ .axis__point {
449
+
450
+ left: var(--percent);
451
+ width: 1px;
452
+ position: absolute;
453
+ height: 0;
454
+ white-space: nowrap;
200
455
 
201
- &:last-child span {
202
-
203
- transform: translate(0,-50%);
204
- }
456
+ span {
457
+ display: block;
458
+ transform: translate(-50%, 0%);
459
+ text-align: center;
460
+ font-size: var(--label-size);
461
+ position: absolute;
462
+ left: 50%;
205
463
  }
206
464
  }
207
465
  }
@@ -212,11 +470,10 @@ $chart-colors: map-merge((
212
470
  top: 0;
213
471
  left: 0;
214
472
  width: 100%;
215
- height: calc(100% - 2rem);
216
- margin-bottom: 2rem;
217
- z-index: var(--index-below);
473
+ height: 100%;
218
474
  display: flex;
219
475
  flex-direction: column-reverse;
476
+ pointer-events: none;
220
477
 
221
478
  .guideline {
222
479
 
@@ -227,8 +484,30 @@ $chart-colors: map-merge((
227
484
  height: 0px;
228
485
  margin-bottom: -1px;
229
486
  border-bottom: 1px dashed #eeeeee;
487
+ pointer-events: none;
488
+ z-index: var(--index-below);
489
+ //overflow: hidden;
490
+
491
+ &:not(.guideline--target) span{
492
+ display: none;
493
+ }
230
494
  }
231
495
 
496
+ .guideline--target {
497
+
498
+ border-bottom: 1px dashed #000000;
499
+ z-index: var(--index-above);
500
+ text-shadow: 1px solid white;
501
+ overflow: visible;
502
+
503
+ span {
504
+ position: absolute;
505
+ bottom: 0;
506
+ font-size: var(--label-size);
507
+ text-shadow: 1px 1px 2px rgba(255, 255, 255, 1);
508
+ background: rgba(255,255,255,0.6);
509
+ }
510
+ }
232
511
  [data-value="0"] {
233
512
  border-bottom: 1px solid var(--colour-primary);
234
513
 
@@ -239,26 +518,19 @@ $chart-colors: map-merge((
239
518
  }
240
519
  }
241
520
 
242
- .table__wrapper {
243
-
244
- padding-bottom: 2rem;
245
- padding-right: 0;
246
- margin: 0;
247
- overflow-x: visible;
521
+ .chart {
522
+
248
523
  position: relative;
249
-
250
- table{
251
- overflow: visible;
252
- }
524
+ flex-grow: 1;
253
525
  }
254
526
 
255
527
  table {
256
528
  display: block;
257
- width: 100%;
258
- padding-top: var(--chart-ratio); // 16:9 ratio
529
+ width: 100%!important;
530
+ padding-top: var(--chart-height-resp); // 16:9 ratio
259
531
  position: relative;
260
532
  margin-bottom: 0;
261
- //border-bottom: 1px solid black;
533
+ overflow: visible;
262
534
 
263
535
  thead {
264
536
  display: none;
@@ -285,30 +557,41 @@ $chart-colors: map-merge((
285
557
  width: 100%;
286
558
  height: 100%;
287
559
  position: relative;
288
- padding: 0 5%;
560
+ padding: 0 2px;
561
+ gap: var(--bar-gap);
562
+
563
+ td {
564
+ font-weight: inherit;
565
+ }
289
566
 
290
567
  td:first-child {
291
568
  position: absolute;
292
569
  top: 100%;
293
570
  left: 50%;
294
571
  transform: translate(-50%,0);
295
- width: auto;
572
+ width: fit-content;
296
573
  padding: 0;
297
574
  white-space: nowrap;
298
- max-width: 120%;
575
+ max-width: 6rem;
299
576
  overflow: hidden;
300
577
  text-overflow: ellipsis;
301
578
  font-size: var(--label-size);
302
- display: none;
303
- border: none;
304
- min-width: auto;
579
+ //display: none;
580
+ text-align: center;
305
581
 
306
- @include media-breakpoint-up(md) {
582
+ @container (min-width: 62em) {
583
+
307
584
  display: block;
308
- max-width: 95%;
585
+ left: 50%!important;
586
+ transform: translate(-50%,0)!important;
309
587
  }
310
588
  }
311
589
 
590
+ td[data-label="Min"],
591
+ td[data-label="Max"] {
592
+ display: none;
593
+ }
594
+
312
595
  &:first-child td:first-child,
313
596
  &:last-child td:first-child {
314
597
 
@@ -319,13 +602,19 @@ $chart-colors: map-merge((
319
602
  height: 100%;
320
603
  height: var(--percent, 0%);
321
604
  bottom: var(--bottom,0%);
322
- width: 50%;
323
- min-width: 0;
324
- max-width: 10rem;
605
+ width: 100%;
606
+ max-width: 1.5rem;
325
607
  position: relative;
326
608
  background: green;
327
609
  padding: 0;
328
- border: none;
610
+ background: var(--chart-colour);
611
+ border-top-right-radius: 4px;
612
+ border-top-left-radius: 4px;
613
+
614
+ &:has(span:empty),
615
+ &:empty{
616
+ display: none;
617
+ }
329
618
 
330
619
  &[data-label]:before {
331
620
  display: none;
@@ -338,18 +627,22 @@ $chart-colors: map-merge((
338
627
  font-size: var(--label-size);
339
628
  line-height: 1.2;
340
629
  transform: translate(-50%,0);
341
- background: var(--colour-info);
630
+ background: var(--chart-colour);
342
631
  opacity: 0;
343
632
  pointer-events: none;
344
633
  padding: 0.5rem;
345
634
  border-radius: 0.5rem;
346
635
  margin-bottom: 0.25rem;
347
- color: white;
636
+ color: var(--colour-primary-theme);
348
637
  white-space: pre;
349
638
  text-align: center;
350
639
 
351
640
  &::before {
352
- content: attr(data-group) '\A' attr(data-label) ': ';
641
+ content: attr(data-label)'\A'attr(data-group)'\A';
642
+ }
643
+
644
+ &[data-second]:after {
645
+ content: '\A' attr(data-second-label) ': ' attr(data-second);
353
646
  }
354
647
  }
355
648
 
@@ -359,25 +652,14 @@ $chart-colors: map-merge((
359
652
  }
360
653
  }
361
654
 
362
- &:first-child td:not(:first-child) span {
363
-
364
- left: -20%;
365
- transform: translate(0%,0);
366
- }
367
-
368
- &:last-child td:not(:first-child) span {
369
-
370
- left: 120%;
371
- transform: translate(-100%,0);
372
- }
373
-
374
- @include media-breakpoint-up(sm) {
655
+ @container (min-width: 36em) {
375
656
 
376
657
  &:first-child td:not(:first-child) span,
377
658
  &:last-child td:not(:first-child) span {
378
659
 
379
660
  left: 50%;
380
661
  transform: translate(-50%,0);
662
+ text-align: center;
381
663
  }
382
664
  }
383
665
 
@@ -387,6 +669,95 @@ $chart-colors: map-merge((
387
669
  }
388
670
  }
389
671
  }
672
+
673
+ // change the look of chart when crowded
674
+ @container (max-width: 36em) {
675
+ tbody:has(tr:nth-child(5) td:nth-child(4)) tr,
676
+ tbody:has(tr:nth-child(10)) tr {
677
+
678
+ td:first-child {
679
+ display: none;
680
+ }
681
+
682
+ &:first-child td:first-child {
683
+
684
+ left: 0%;
685
+ transform: translate(0,0);
686
+ display: block;
687
+ text-align: left;
688
+ }
689
+ &:last-child td:first-child {
690
+
691
+ left: 100%;
692
+ transform: translate(-100%,0);
693
+ display: block;
694
+ text-align: right;
695
+ }
696
+
697
+ &:first-child td:not(:first-child) span {
698
+
699
+ left: -20%;
700
+ transform: translate(0%,0);
701
+ text-align: left;
702
+ }
703
+
704
+ &:last-child td:not(:first-child) span {
705
+
706
+ left: 120%;
707
+ transform: translate(-100%,0);
708
+ text-align: right;
709
+ }
710
+ }
711
+ }
712
+ // Hide labels when it gets crowded
713
+ @container (min-width: 62em) {
714
+
715
+ tbody:has(tr:nth-child(25)){
716
+ tr td:first-child {
717
+ display: none!important;
718
+ }
719
+
720
+ tr:is(:first-child, :nth-child(5n)) td:first-child {
721
+ display: block!important;
722
+ }
723
+ }
724
+
725
+ tbody:has(tr:nth-child(50)){
726
+
727
+ tr:is(:first-child, :nth-child(5n)) td:first-child,
728
+ tr td:first-child {
729
+ display: none!important;
730
+ }
731
+
732
+ tr:is(:first-child, :nth-child(10n)) td:first-child {
733
+ display: block!important;
734
+ }
735
+ }
736
+
737
+ tbody:has(tr:nth-child(100)){
738
+
739
+ tr:is(:first-child, :nth-child(10n)) td:first-child,
740
+ tr td:first-child {
741
+ display: none!important;
742
+ }
743
+
744
+ tr:is(:first-child, :nth-child(20n)) td:first-child {
745
+ display: block!important;
746
+ }
747
+ }
748
+ }
749
+
750
+ // Hide items when theres too many too display
751
+ tbody:has(tr:nth-child(1001)){
752
+
753
+ tr {
754
+ display: none;
755
+ }
756
+
757
+ tr:nth-last-child(-n+1001) ~ tr {
758
+ display: flex;
759
+ }
760
+ }
390
761
  }
391
762
 
392
763
  .line,
@@ -396,110 +767,289 @@ $chart-colors: map-merge((
396
767
  }
397
768
  // #endregion
398
769
 
399
- // #region Stacked bar chart
400
- .chart:not(.chart--none):not(.chart--pie).chart--stacked {
401
- table tbody tr {
402
- flex-direction: column-reverse;
403
- justify-content: flex-start;
404
- align-items: center;
405
- }
406
- }
407
- // #endregion
770
+ // #region Bar chart
771
+ @mixin barchart($selector) {
772
+ #{$selector} {
408
773
 
409
- // #region Line chart
410
- .chart.chart--line:not(.chart--none):not(.chart--pie) {
774
+ tbody {
775
+ --chart-direction: 90deg;
776
+ --chart-day-bg-pos: calc(var(--single-day) * 7) 100%;
777
+ --bar-gap: 0;
778
+ }
411
779
 
412
- --line-thickness: 1px;
780
+ .chart__guidelines {
781
+ position: absolute;
413
782
 
414
- @include media-breakpoint-up(sm) {
783
+ .guideline {
784
+ bottom: auto;
785
+ left: var(--percent);
786
+ height: 100%;
787
+ border-left: 1px dashed #eee;
788
+ width: 0;
415
789
 
416
- --line-thickness: 0.8px;
417
- }
418
- @include media-breakpoint-up(md) {
790
+ span{
791
+ display: block;
792
+ font-size: var(--label-size);
793
+ position: absolute;
794
+ top: 100%;
795
+ transform: translate(-50%,0.2em);
796
+ }
797
+ }
798
+ }
419
799
 
420
- --line-thickness: 0.5px;
421
- }
800
+ .chart__yaxis {
422
801
 
423
- table tbody {
424
- justify-content: space-between;
802
+ display: none;
803
+ }
425
804
 
426
- tr {
427
- width: 4rem;
428
- margin-left: -2rem;
429
- margin-right: -2rem;
430
- padding: 0;
805
+ table {
431
806
 
807
+ padding-top: 0;
808
+ }
432
809
 
433
- &:first-child td:first-child {
810
+ table tbody {
434
811
 
435
- transform: translate(0,0);
436
- display: block;
812
+ flex-direction: column;
813
+ position: relative;
814
+ }
815
+
816
+ table tbody tr {
817
+ flex-direction: column;
818
+ align-items: flex-start;
819
+ margin-bottom: 0.5rem;
820
+ padding: 0;
821
+
822
+ td {
823
+
824
+ height: 3rem;
825
+ bottom: 0;
826
+ left: var(--bottom, 0%);
827
+ width: var(--comparison,var(--percent));
828
+ max-width: 100%;
829
+ border-top-left-radius: 0;
830
+ border-bottom-right-radius: 4px;
437
831
  }
438
- &:last-child td:first-child {
439
832
 
440
- left: 100%;
441
- transform: translate(-100%,0);
442
- display: block;
833
+ td:first-child {
834
+ position: static;
835
+ transform: none;
836
+ display: block!important;
837
+ max-height: 1.5rem;
443
838
  }
839
+ }
840
+
841
+ &[data-longest-label] {
842
+ &:before {
843
+ display: block;
844
+ content: attr(data-longest-label);
845
+ font-size: var(--label-size);
846
+ padding-right: 0.5em;
847
+ opacity: 0;
848
+ pointer-events: none;
849
+ white-space: nowrap;
850
+ }
851
+ }
444
852
 
853
+ &[data-longest-label] table tbody tr {
445
854
  td:first-child {
855
+ position: absolute;
856
+ transform: translate(-100%, -50%)!important;
857
+ display: block !important;
858
+ max-height: 1.5rem;
859
+ z-index: var(--index-above);
860
+ top: 50%;
861
+ left: 0!important;
862
+ padding-right: 0.5em;
863
+ }
864
+ }
865
+
866
+ }
867
+ }
868
+
869
+ @include barchart('.chart__outer '+$bar-chart);
870
+
871
+ @container (max-width: 36em) {
872
+ @include barchart('.chart__outer '+$responsive-chart);
873
+ }
874
+ // #endregion
875
+
876
+ // #region stacked
877
+ input[type="radio"]:not([value="pie"])[value="stacked"]:checked ~ .chart__wrapper {
878
+ table tbody tr {
879
+ --bar-gap: 0;
880
+ flex-direction: column-reverse;
881
+ justify-content: flex-start;
882
+ align-items: center;
883
+
884
+ td {
885
+ border-radius: 0!important;
886
+ }
887
+ }
888
+ }
889
+ // #endregion
890
+
891
+ // #region Scatter and line chart
892
+ #{'.chart__outer '+$scatter-line-chart} {
893
+
894
+ table tbody {
895
+ justify-content: space-between;
896
+
897
+ tr {
898
+ td:not(.chart__bar):first-child {
446
899
  left: 50%!important;
900
+ width: 4rem;
447
901
  }
902
+ }
903
+ }
904
+ }
448
905
 
449
- td:not(:first-child) {
906
+ #{'.chart__outer '+$scatter-line-chart} {
907
+
908
+
909
+ table tbody {
910
+
911
+ tr:not(:has(.chart__bar)) {
912
+ width: 2px;
913
+ margin-left: -1px;
914
+ margin-right: -1px;
915
+ padding: 0;
916
+ }
917
+
918
+ tr {
919
+
920
+ td:not(.chart__bar):not(:first-child) {
450
921
  position: absolute;
451
922
  left: 50%;
452
- bottom: var(--percent);
923
+ bottom: calc(var(--axis));
453
924
  height: 6px;
454
925
  width: 6px;
455
926
  margin-bottom: -3px;
456
927
  margin-left: -3px;
457
928
  border-radius: 3px;
458
- opacity: 0;
459
929
 
460
930
  &:hover {
461
931
  opacity: 1;
462
932
  }
463
933
  }
464
934
 
935
+ &:before {
936
+ content: "";
937
+ border-left: 1px dashed #eeeeee;
938
+ height: 100%;
939
+ width: 0;
940
+ position: absolute;
941
+ top: 0;
942
+ left: 50%;
943
+ height: 100%;
944
+ margin-left: -1px;
945
+ z-index: var(--index-below);
946
+ opacity: 0;
947
+ }
948
+
465
949
  &:hover {
466
950
  &:before {
467
- content: "";
468
- border-left: 1px dashed #eeeeee;
951
+ opacity: 1;
952
+ }
953
+ }
469
954
 
470
- height: 100%;
471
- width: 0;
955
+ &:is([data-event],[data-event-right]) {
956
+ &:before {
957
+ opacity: 1;
958
+ border-left: 1px dashed #000000;
959
+ }
960
+ &:after {
961
+ content: attr(data-event);
472
962
  position: absolute;
473
963
  top: 0;
474
964
  left: 50%;
475
- height: 100%;
476
- margin-left: -1px;
965
+ width: max-content;
477
966
  z-index: var(--index-below);
967
+ font-size: var(--label-size);
968
+ background: rgba(255,255,255,0.5);
969
+ }
970
+ }
971
+ &[data-event] {
972
+ &:after {
973
+ transform: translate(-50%,-0.5em);
974
+ }
975
+ }
976
+ &[data-event-right] {
977
+ &:after {
978
+ transform: translate(-101%,-0.5em);
979
+ }
980
+ }
981
+ &[data-event-left] {
982
+ &:after {
983
+ transform: translate(1%,-0.5em);
478
984
  }
479
985
  }
480
986
  }
481
987
  }
482
988
 
483
- .line {
989
+ .pie {
990
+ display: none;
991
+ }
992
+ }
993
+
994
+ #{':host([data-increment][data-start][data-end]) .chart__outer '+$scatter-line-chart} {
995
+
996
+ table tbody tr {
997
+ position: absolute;
998
+ left: var(--position);
999
+
1000
+ td:first-child {
1001
+ display: none;
1002
+ }
1003
+ }
1004
+
1005
+ .slope {
1006
+
1007
+ pointer-events: none;
1008
+ }
1009
+ .slope svg {
1010
+ color: black;
1011
+ stroke: currentColor;
484
1012
  display: block;
485
1013
  position: absolute;
486
1014
  top: 0;
487
1015
  left: 0;
488
1016
  stroke-width: var(--line-thickness);
489
1017
  width: 100%;
490
- height: calc(100% - 2rem);
1018
+ height: calc(100% - 1rem);
491
1019
  pointer-events: none;
492
- z-index: var(--index-below)
1020
+ z-index: var(--index-above)
493
1021
  }
1022
+ }
1023
+ // #endregion
494
1024
 
495
- .pie {
496
- display: none;
1025
+ // #region Line chart
1026
+ #{'.chart__outer '+$line-chart} {
1027
+
1028
+ .chart__lines ~ table tbody {
1029
+ tr {
1030
+ td:not(.chart__bar):not(:first-child):not(:hover) {
1031
+ opacity: 0;
1032
+ }
1033
+ }
1034
+ }
1035
+
1036
+ .line {
1037
+ display: block;
1038
+ position: absolute;
1039
+ top: 0;
1040
+ left: 0;
1041
+ stroke-width: var(--line-thickness);
1042
+ width: 100%;
1043
+ height: 100%;
1044
+ pointer-events: none;
1045
+ z-index: var(--index-above)
497
1046
  }
498
1047
  }
499
1048
  // #endregion
500
1049
 
1050
+
501
1051
  // #region Pie chart
502
- .chart.chart--pie {
1052
+ #{'.chart__outer '+$pie-chart} {
503
1053
 
504
1054
  margin-bottom: 2rem;
505
1055
 
@@ -507,7 +1057,7 @@ $chart-colors: map-merge((
507
1057
  .line {
508
1058
  display: none;
509
1059
  }
510
- .table__wrapper {
1060
+ table {
511
1061
  display: none;
512
1062
  }
513
1063
 
@@ -525,16 +1075,7 @@ $chart-colors: map-merge((
525
1075
  min-width: rem(200);
526
1076
  flex: 1 1 auto;
527
1077
  display: inline-block;
528
-
529
- @include media-breakpoint-up(sm) {
530
-
531
- max-width: calc(33.333% - 1.4rem);
532
- }
533
- @include media-breakpoint-up(md) {
534
-
535
- max-width: calc(25% - 1.5rem);
536
- }
537
-
1078
+ max-width: var(--pie-size);
538
1079
 
539
1080
  &:first-child {
540
1081
  margin-left: 0;
@@ -553,8 +1094,35 @@ $chart-colors: map-merge((
553
1094
  }
554
1095
  }
555
1096
 
1097
+ .pie > div {
1098
+
1099
+ position: absolute;
1100
+ top: 50%;
1101
+ left: 50%;
1102
+ transform: translate(-50%, -50%);
1103
+ pointer-events: none;
1104
+ background: var(--body-colour-set);
1105
+ border-radius: 50%;
1106
+ z-index: var(--index-focus);
1107
+ padding: 1rem;
1108
+ aspect-ratio: 1/1;
1109
+ display: flex;
1110
+ justify-content: center;
1111
+ align-items: center;
1112
+ height: 67%;
1113
+
1114
+ span {
1115
+ text-align: center;
1116
+ display: block;
1117
+ }
1118
+ }
1119
+
1120
+ .pie:has(path:hover) > div {
1121
+ display: none;
1122
+ }
1123
+
556
1124
  .pie foreignObject {
557
- background: var(--colour-canvas);
1125
+ background: var(--body-colour-set);
558
1126
  border-radius: 50%;
559
1127
  z-index: var(--index-focus);
560
1128
  pointer-events: none;
@@ -564,7 +1132,7 @@ $chart-colors: map-merge((
564
1132
  div {
565
1133
  display: flex;
566
1134
  justify-content: center;
567
- align-items: center;
1135
+ align-items: center;
568
1136
  height: 100%;
569
1137
  }
570
1138
  span {
@@ -574,36 +1142,215 @@ $chart-colors: map-merge((
574
1142
  }
575
1143
 
576
1144
  .pie {
577
- foreignObject:nth-of-type(1) {
1145
+ path:nth-child(1):hover ~ foreignObject:nth-of-type(1),
1146
+ path:nth-child(2):hover ~ foreignObject:nth-of-type(2),
1147
+ path:nth-child(3):hover ~ foreignObject:nth-of-type(3),
1148
+ path:nth-child(4):hover ~ foreignObject:nth-of-type(4),
1149
+ path:nth-child(5):hover ~ foreignObject:nth-of-type(5),
1150
+ path:nth-child(6):hover ~ foreignObject:nth-of-type(6),
1151
+ path:nth-child(7):hover ~ foreignObject:nth-of-type(7),
1152
+ path:nth-child(8):hover ~ foreignObject:nth-of-type(8),
1153
+ path:nth-child(9):hover ~ foreignObject:nth-of-type(9){
578
1154
  display: block;
579
1155
  }
580
- path:hover ~ foreignObject:nth-of-type(1) {
581
- display: none;
1156
+ }
1157
+ }
1158
+ // #endregion
1159
+
1160
+
1161
+
1162
+
1163
+
1164
+ // #region Modifiers
1165
+
1166
+ // #region Display data modifier class
1167
+ :host(.chart--display-data) {
1168
+ table tbody tr {
1169
+
1170
+ td:not(:first-child) {
1171
+
1172
+ span {
1173
+ &:before {
1174
+ display: none;
1175
+ }
1176
+ opacity: 1!important;
1177
+ z-index: var(--index-above);
1178
+ top: 0%;
1179
+ transform: translate(-50%, 0%)!important;
1180
+ display: block!important;
1181
+ height: fit-content;
1182
+
1183
+ margin: 0;
1184
+ }
582
1185
  }
583
- path:nth-child(1):hover ~ foreignObject:nth-of-type(2),
584
- path:nth-child(2):hover ~ foreignObject:nth-of-type(3),
585
- path:nth-child(3):hover ~ foreignObject:nth-of-type(4),
586
- path:nth-child(4):hover ~ foreignObject:nth-of-type(5),
587
- path:nth-child(5):hover ~ foreignObject:nth-of-type(6),
588
- path:nth-child(6):hover ~ foreignObject:nth-of-type(7),
589
- path:nth-child(7):hover ~ foreignObject:nth-of-type(8),
590
- path:nth-child(8):hover ~ foreignObject:nth-of-type(9){
591
- display: block;
1186
+ }
1187
+
1188
+ #{$bar-chart} table tbody tr td:not(:first-child) {
1189
+ span {
1190
+ top: 50%;
1191
+ right: 0;
1192
+ left: 0;
1193
+ transform: translate(0%, -50%)!important;
1194
+ text-align: right;
1195
+ width: calc(100% - 0.4rem);
1196
+ min-width: fit-content;
1197
+ padding: 0 0.1rem;
1198
+ border-radius: 0;
1199
+ }
1200
+ }
1201
+
1202
+ #{$scatter-line-chart} table tbody tr td:not(:first-child) {
1203
+ span {
1204
+ bottom: 0.25rem;
1205
+ top: auto;
592
1206
  }
593
1207
  }
1208
+
1209
+ #{$line-chart} .chart__lines~table tbody tr td:not(:first-child):not(:hover) {
1210
+ opacity: 1;
1211
+ }
594
1212
  }
595
1213
  // #endregion
596
1214
 
597
- // #region Reverted back into a table
598
- .chart__key.chart__key--none{
599
- display: none;
1215
+ // #region show chart totals
1216
+ :host(.chart--show-totals) {
1217
+ .chart__key {
1218
+ .key {
1219
+
1220
+ .chart__total {
1221
+ display: flex;
1222
+ font-size: var(--label-size);
1223
+ font-weight: bold;
1224
+ line-height: 1;
1225
+ padding-left: 1.5em;
1226
+ }
1227
+
1228
+ .chart__total__number {
1229
+ margin-right: 1rem;
1230
+ }
1231
+ .chart__total__percent {
1232
+ margin-left: auto;
1233
+ }
1234
+ }
1235
+ }
600
1236
  }
601
- .chart.chart--none {
1237
+ // #endregion
602
1238
 
603
- .chart__yaxis,
604
- .line,
605
- .pie {
606
- display: none;
1239
+ // #endregion
1240
+
1241
+
1242
+ // #region aniamtion
1243
+
1244
+ #{'.chart--animate.animating.inview'} {
1245
+
1246
+ --animation-left: 2s;
1247
+
1248
+ table tbody tr td:not(:first-child){
1249
+
1250
+ transition: height 2s ease-out, width 2s ease-out, bottom 2s ease-out, left var(--animation-left) ease-out;
1251
+ transition-delay: calc(var(--row-index) * 0.1s);
1252
+ }
1253
+ }
1254
+
1255
+ #{'.chart--animate:not(.inview)'} {
1256
+
1257
+ table tbody tr td:not(:first-child) {
1258
+ --bottom: var(--min-bottom, 0%)!important;
1259
+ --percent: 0%!important;
1260
+ --axis: 0%!important;
1261
+ --comparison: 0%!important;
1262
+ }
1263
+ }
1264
+
1265
+ /*
1266
+ #{'.chart--animate.animating.inview '+comparison-chart} {
1267
+
1268
+ --animation-left: 0s;
1269
+ }
1270
+
1271
+ #{'.chart--animate:not(.inview) '+comparison-chart} {
1272
+
1273
+ table tbody tr td:not(:first-child) {
1274
+
1275
+ --comparison: 50%!important;
1276
+ }
1277
+ }
1278
+ */
1279
+
1280
+
1281
+ // #region Animate bar and column chart
1282
+ #{'.chart--animate.animating ' + $default-chart} {
1283
+
1284
+ table tbody tr td:not(:first-child) {
1285
+ overflow: hidden;
1286
+ }
1287
+ }
1288
+ // #endregion
1289
+
1290
+ // #region scatter and line charts
1291
+
1292
+ #{'.chart--animate:not(.inview) ' + $scatter-line-chart} {
1293
+
1294
+ table tbody tr td:not(:first-child) {
1295
+ --percent: 0%!important;
1296
+ }
1297
+ }
1298
+
1299
+ #{'.chart--animate.animating ' + $scatter-line-chart} {
1300
+
1301
+ .slope path {
1302
+ transition: 2s ease-out;
1303
+ }
1304
+ }
1305
+
1306
+ #{'.chart--animate:not(.inview) '+$scatter-line-chart} {
1307
+ .slope path {
1308
+ d: var(--path);
1309
+ }
1310
+ }
1311
+
1312
+ // Line chart
1313
+ #{'.chart--animate.animating '+$line-chart}
1314
+ //#{'.chart--animate '+proportional-chart},
1315
+ //#{'.chart--animate '+combo-chart}
1316
+ {
1317
+ .line path {
1318
+ transition: 2s ease-out;
1319
+ }
1320
+ }
1321
+
1322
+ #{'.chart--animate:not(.inview) '+$line-chart}
1323
+ //#{'.chart--animate:not(.inview) '+proportional-chart},
1324
+ //#{'.chart--animate:not(.inview) '+combo-chart}
1325
+ {
1326
+ .line path {
1327
+ d: var(--path);
607
1328
  }
608
1329
  }
609
1330
  // #endregion
1331
+
1332
+ // #region pie charts
1333
+ #{'.chart--animate '+$pie-chart} {
1334
+ .pie path {
1335
+ transition: calc(2s * var(--second-fraction, 1)) ease-out;
1336
+ transition-delay: calc((var(--row-index) * var(--path-index)) * 0.1s);
1337
+ }
1338
+ }
1339
+
1340
+ #{'.chart--animate:not(.inview) '+$pie-chart} {
1341
+ .pie path {
1342
+ transform: scale(60%) !important;
1343
+ }
1344
+ }
1345
+ /*#{'.chart--animate:not(.inview) '+polar-chart}
1346
+ {
1347
+ .pie path {
1348
+ transform: scale(40%) !important;
1349
+ }
1350
+ }
1351
+ */
1352
+ // #endregion
1353
+
1354
+
1355
+ // #endregion
1356
+