@carbon/charts 0.53.5 → 0.54.0

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 (107) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/build/demo/data/CHART_TYPES.d.ts +5 -0
  3. package/build/demo/data/heatmap.d.ts +96 -0
  4. package/build/demo/data/index.d.ts +1 -0
  5. package/build/src/charts/heatmap.d.ts +10 -0
  6. package/build/src/charts/index.d.ts +1 -0
  7. package/build/src/components/axes/axis.d.ts +7 -1
  8. package/build/src/components/axes/hover-axis.d.ts +10 -0
  9. package/build/src/components/essentials/color-scale-legend.d.ts +11 -0
  10. package/build/src/components/graphs/heatmap.d.ts +25 -0
  11. package/build/src/components/index.d.ts +2 -0
  12. package/build/src/configuration-non-customizable.d.ts +12 -0
  13. package/build/src/configuration.d.ts +2 -1
  14. package/build/src/interfaces/charts.d.ts +35 -2
  15. package/build/src/interfaces/enums.d.ts +22 -0
  16. package/build/src/interfaces/events.d.ts +13 -1
  17. package/build/src/model/cartesian-charts.d.ts +8 -1
  18. package/build/src/model/heatmap.d.ts +57 -0
  19. package/build/src/services/scales-cartesian.d.ts +1 -0
  20. package/bundle.js +1 -1
  21. package/charts/heatmap.d.ts +10 -0
  22. package/charts/heatmap.js +138 -0
  23. package/charts/heatmap.js.map +1 -0
  24. package/charts/index.d.ts +1 -0
  25. package/charts/index.js +1 -0
  26. package/charts/index.js.map +1 -1
  27. package/components/axes/axis.d.ts +7 -1
  28. package/components/axes/axis.js +9 -2
  29. package/components/axes/axis.js.map +1 -1
  30. package/components/axes/hover-axis.d.ts +10 -0
  31. package/components/axes/hover-axis.js +235 -0
  32. package/components/axes/hover-axis.js.map +1 -0
  33. package/components/axes/two-dimensional-axes.js +8 -3
  34. package/components/axes/two-dimensional-axes.js.map +1 -1
  35. package/components/essentials/color-scale-legend.d.ts +11 -0
  36. package/components/essentials/color-scale-legend.js +236 -0
  37. package/components/essentials/color-scale-legend.js.map +1 -0
  38. package/components/graphs/heatmap.d.ts +25 -0
  39. package/components/graphs/heatmap.js +369 -0
  40. package/components/graphs/heatmap.js.map +1 -0
  41. package/components/index.d.ts +2 -0
  42. package/components/index.js +2 -0
  43. package/components/index.js.map +1 -1
  44. package/configuration-non-customizable.d.ts +12 -0
  45. package/configuration-non-customizable.js +13 -0
  46. package/configuration-non-customizable.js.map +1 -1
  47. package/configuration.d.ts +2 -1
  48. package/configuration.js +13 -1
  49. package/configuration.js.map +1 -1
  50. package/demo/data/CHART_TYPES.d.ts +5 -0
  51. package/demo/data/CHART_TYPES.js +5 -0
  52. package/demo/data/CHART_TYPES.js.map +1 -1
  53. package/demo/data/bundle.js +1 -1
  54. package/demo/data/heatmap.d.ts +96 -0
  55. package/demo/data/heatmap.js +1135 -0
  56. package/demo/data/heatmap.js.map +1 -0
  57. package/demo/data/index.d.ts +1 -0
  58. package/demo/data/index.js +30 -0
  59. package/demo/data/index.js.map +1 -1
  60. package/demo/styles.css +16458 -9179
  61. package/demo/styles.css.map +1 -1
  62. package/demo/styles.min.css +1 -1
  63. package/demo/styles.min.css.map +1 -1
  64. package/demo/tsconfig.tsbuildinfo +18 -4
  65. package/interfaces/charts.d.ts +35 -2
  66. package/interfaces/charts.js.map +1 -1
  67. package/interfaces/components.js.map +1 -1
  68. package/interfaces/enums.d.ts +22 -0
  69. package/interfaces/enums.js +25 -0
  70. package/interfaces/enums.js.map +1 -1
  71. package/interfaces/events.d.ts +13 -1
  72. package/interfaces/events.js +13 -0
  73. package/interfaces/events.js.map +1 -1
  74. package/model/cartesian-charts.d.ts +8 -1
  75. package/model/cartesian-charts.js +4 -2
  76. package/model/cartesian-charts.js.map +1 -1
  77. package/model/heatmap.d.ts +57 -0
  78. package/model/heatmap.js +289 -0
  79. package/model/heatmap.js.map +1 -0
  80. package/package.json +1 -1
  81. package/services/scales-cartesian.d.ts +1 -0
  82. package/services/scales-cartesian.js +16 -0
  83. package/services/scales-cartesian.js.map +1 -1
  84. package/styles/color-palatte.scss +96 -0
  85. package/styles/colors.scss +35 -1
  86. package/styles/components/_axis.scss +41 -0
  87. package/styles/components/_color-legend.scss +24 -0
  88. package/styles/components/index.scss +1 -0
  89. package/styles/graphs/_heatmap.scss +70 -0
  90. package/styles/graphs/index.scss +1 -0
  91. package/styles-g10.css +2000 -179
  92. package/styles-g10.css.map +1 -1
  93. package/styles-g10.min.css +1 -1
  94. package/styles-g10.min.css.map +1 -1
  95. package/styles-g100.css +2003 -182
  96. package/styles-g100.css.map +1 -1
  97. package/styles-g100.min.css +1 -1
  98. package/styles-g100.min.css.map +1 -1
  99. package/styles-g90.css +2004 -180
  100. package/styles-g90.css.map +1 -1
  101. package/styles-g90.min.css +1 -1
  102. package/styles-g90.min.css.map +1 -1
  103. package/styles.css +2000 -179
  104. package/styles.css.map +1 -1
  105. package/styles.min.css +1 -1
  106. package/styles.min.css.map +1 -1
  107. package/tsconfig.tsbuildinfo +178 -55
@@ -261,3 +261,99 @@ $white-theme-legend-area-item-colors: (
261
261
  );
262
262
 
263
263
  $white-theme-legend-area-item-stroke: getColorValue('gray', 50);
264
+
265
+ $monochrome-quantize-colors: (
266
+ 'mono-1': (
267
+ '1': #ffffff,
268
+ '2': getColorValue('purple', 10),
269
+ '3': getColorValue('purple', 20),
270
+ '4': getColorValue('purple', 30),
271
+ '5': getColorValue('purple', 40),
272
+ '6': getColorValue('purple', 50),
273
+ '7': getColorValue('purple', 60),
274
+ '8': getColorValue('purple', 70),
275
+ '9': getColorValue('purple', 80),
276
+ '10': getColorValue('purple', 90),
277
+ '11': getColorValue('purple', 100),
278
+ ),
279
+ 'mono-2': (
280
+ '1': #ffffff,
281
+ '2': getColorValue('blue', 10),
282
+ '3': getColorValue('blue', 20),
283
+ '4': getColorValue('blue', 30),
284
+ '5': getColorValue('blue', 40),
285
+ '6': getColorValue('blue', 50),
286
+ '7': getColorValue('blue', 60),
287
+ '8': getColorValue('blue', 70),
288
+ '9': getColorValue('blue', 80),
289
+ '10': getColorValue('blue', 90),
290
+ '11': getColorValue('blue', 100),
291
+ ),
292
+ 'mono-3': (
293
+ '1': #ffffff,
294
+ '2': getColorValue('cyan', 10),
295
+ '3': getColorValue('cyan', 20),
296
+ '4': getColorValue('cyan', 30),
297
+ '5': getColorValue('cyan', 40),
298
+ '6': getColorValue('cyan', 50),
299
+ '7': getColorValue('cyan', 60),
300
+ '8': getColorValue('cyan', 70),
301
+ '9': getColorValue('cyan', 80),
302
+ '10': getColorValue('cyan', 90),
303
+ '11': getColorValue('cyan', 100),
304
+ ),
305
+ 'mono-4': (
306
+ '1': #ffffff,
307
+ '2': getColorValue('teal', 10),
308
+ '3': getColorValue('teal', 20),
309
+ '4': getColorValue('teal', 30),
310
+ '5': getColorValue('teal', 40),
311
+ '6': getColorValue('teal', 50),
312
+ '7': getColorValue('teal', 60),
313
+ '8': getColorValue('teal', 70),
314
+ '9': getColorValue('teal', 80),
315
+ '10': getColorValue('teal', 90),
316
+ '11': getColorValue('teal', 100),
317
+ ),
318
+ );
319
+
320
+ $divergent-quantize-colors: (
321
+ 'diverge-1': (
322
+ '1': getColorValue('red', 80),
323
+ '2': getColorValue('red', 70),
324
+ '3': getColorValue('red', 60),
325
+ '4': getColorValue('red', 50),
326
+ '5': getColorValue('red', 40),
327
+ '6': getColorValue('red', 30),
328
+ '7': getColorValue('red', 20),
329
+ '8': getColorValue('red', 10),
330
+ '9': #ffffff,
331
+ '10': getColorValue('cyan', 10),
332
+ '11': getColorValue('cyan', 20),
333
+ '12': getColorValue('cyan', 30),
334
+ '13': getColorValue('cyan', 40),
335
+ '14': getColorValue('cyan', 50),
336
+ '15': getColorValue('cyan', 60),
337
+ '16': getColorValue('cyan', 70),
338
+ '17': getColorValue('cyan', 80),
339
+ ),
340
+ 'diverge-2': (
341
+ '1': getColorValue('purple', 80),
342
+ '2': getColorValue('purple', 70),
343
+ '3': getColorValue('purple', 60),
344
+ '4': getColorValue('purple', 50),
345
+ '5': getColorValue('purple', 40),
346
+ '6': getColorValue('purple', 30),
347
+ '7': getColorValue('purple', 20),
348
+ '8': getColorValue('purple', 10),
349
+ '9': #ffffff,
350
+ '10': getColorValue('teal', 10),
351
+ '11': getColorValue('teal', 20),
352
+ '12': getColorValue('teal', 30),
353
+ '13': getColorValue('teal', 40),
354
+ '14': getColorValue('teal', 50),
355
+ '15': getColorValue('teal', 60),
356
+ '16': getColorValue('teal', 70),
357
+ '17': getColorValue('teal', 80),
358
+ ),
359
+ );
@@ -12,6 +12,13 @@
12
12
  }
13
13
  }
14
14
 
15
+ @function getGradientColors() {
16
+ $monochrome: color-property(null, $monochrome-quantize-colors);
17
+ $divergent: color-property(null, $divergent-quantize-colors);
18
+
19
+ @return map-merge($monochrome, $divergent);
20
+ }
21
+
15
22
  @function getLegendAreaItemColors() {
16
23
  @if $carbon--theme ==
17
24
  $carbon--theme--g100 or
@@ -47,8 +54,31 @@
47
54
  }
48
55
  }
49
56
 
57
+ @function gradient-color-property($name, $theme-colors) {
58
+ $color-items: ();
59
+
60
+ @if type-of($theme-colors) == map {
61
+ @each $category, $value in $theme-colors {
62
+ @if $name == null {
63
+ $color-items: map-merge(
64
+ $color-items,
65
+ color-property('#{$category}', $value)
66
+ );
67
+ } @else {
68
+ $color-items: map-merge(
69
+ $color-items,
70
+ color-property('#{$name}-#{$category}', $value)
71
+ );
72
+ }
73
+ }
74
+ @return $color-items;
75
+ } @else {
76
+ @return (#{$name}: $theme-colors);
77
+ }
78
+ }
79
+
50
80
  .#{$prefix}--#{$charts-prefix}--chart-wrapper {
51
- $color-map: getThemeColors();
81
+ $color-map: map-merge(getThemeColors(), getGradientColors());
52
82
 
53
83
  @each $token, $color in $color-map {
54
84
  .fill-#{$token} {
@@ -72,6 +102,10 @@
72
102
  .stroke-#{$token} {
73
103
  stroke: $color;
74
104
  }
105
+
106
+ .stop-color-#{$token} {
107
+ stop-color: $color;
108
+ }
75
109
  }
76
110
  }
77
111
 
@@ -10,6 +10,47 @@
10
10
  visibility: hidden;
11
11
  }
12
12
 
13
+ g.tick-hover rect.axis-holder {
14
+ fill: transparent;
15
+ stroke: transparent;
16
+ stroke-width: 2px;
17
+ }
18
+
19
+ g.tick-hover:hover,
20
+ g.tick-hover:focus {
21
+ @if $carbon--theme ==
22
+ $carbon--theme--g90 or
23
+ $carbon--theme ==
24
+ $carbon--theme--g100
25
+ {
26
+ rect.axis-holder {
27
+ fill: white;
28
+ stroke: white;
29
+ stroke-width: 2px;
30
+ }
31
+
32
+ text {
33
+ fill: invert($text-02);
34
+ }
35
+ }
36
+
37
+ @if $carbon--theme ==
38
+ $carbon--theme--g10 or
39
+ $carbon--theme ==
40
+ $carbon--theme--white
41
+ {
42
+ rect.axis-holder {
43
+ fill: black;
44
+ stroke: black;
45
+ stroke-width: 2px;
46
+ }
47
+
48
+ text {
49
+ fill: white;
50
+ }
51
+ }
52
+ }
53
+
13
54
  g.tick text {
14
55
  fill: $text-02;
15
56
  font-family: carbon--font-family('sans-condensed');
@@ -0,0 +1,24 @@
1
+ svg.#{$prefix}--#{$charts-prefix}--color-legend {
2
+ display: flex;
3
+ user-select: none;
4
+
5
+ @if $carbon--theme ==
6
+ $carbon--theme--g90 or
7
+ $carbon--theme ==
8
+ $carbon--theme--g100
9
+ {
10
+ g.legend-title text {
11
+ color: white;
12
+ }
13
+ }
14
+
15
+ @if $carbon--theme ==
16
+ $carbon--theme--g10 or
17
+ $carbon--theme ==
18
+ $carbon--theme--white
19
+ {
20
+ g.legend-title text {
21
+ fill: black;
22
+ }
23
+ }
24
+ }
@@ -17,3 +17,4 @@
17
17
  @import './zoom-bar';
18
18
  @import './highlights';
19
19
  @import './diagrams/index.scss';
20
+ @import './color-legend';
@@ -0,0 +1,70 @@
1
+ .#{$prefix}--#{$charts-prefix}--heatmap {
2
+ g.highlighter-hidden {
3
+ visibility: hidden;
4
+ }
5
+
6
+ g.cell-highlight {
7
+ line {
8
+ stroke: white;
9
+ stroke-width: 1px;
10
+ }
11
+ }
12
+
13
+ g.cell-2 {
14
+ line {
15
+ stroke: white;
16
+ stroke-width: 2px !important;
17
+ }
18
+ }
19
+
20
+ g.multi-cell {
21
+ line {
22
+ stroke: white;
23
+ stroke-width: 2px;
24
+ }
25
+ }
26
+
27
+ rect.pattern-fill {
28
+ fill: $ui-04;
29
+ }
30
+
31
+ g.shadows {
32
+ line.top {
33
+ filter: drop-shadow(0px -3px 2px black);
34
+ }
35
+
36
+ line.down {
37
+ filter: drop-shadow(0px 3px 2px black);
38
+ }
39
+
40
+ line.left {
41
+ filter: drop-shadow(-3px 0px 2px black);
42
+ }
43
+
44
+ line.right {
45
+ filter: drop-shadow(3px 0px 2px black);
46
+ }
47
+ }
48
+
49
+ rect.null-state {
50
+ stroke: transparent !important;
51
+ }
52
+
53
+ rect.heat {
54
+ stroke-width: 0px;
55
+ }
56
+
57
+ rect.heat {
58
+ stroke: $ui-background;
59
+ }
60
+
61
+ rect.null-state {
62
+ fill: $ui-01;
63
+ }
64
+
65
+ @if $carbon--theme == $carbon--theme--g90 {
66
+ rect.null-state {
67
+ fill: $inverse-01;
68
+ }
69
+ }
70
+ }
@@ -15,3 +15,4 @@
15
15
  @import './circle-pack';
16
16
  @import './wordcloud';
17
17
  @import './alluvial';
18
+ @import './heatmap';