@carbon/charts 0.49.5 → 0.50.1

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 (73) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/build/src/components/essentials/threshold.d.ts +1 -0
  3. package/build/src/services/essentials/transitions.d.ts +0 -3
  4. package/build/stories/tutorials/feature-flags.d.ts +4 -0
  5. package/build/stories/tutorials/index.d.ts +1 -0
  6. package/bundle.js +1 -1
  7. package/components/essentials/threshold.d.ts +1 -0
  8. package/components/essentials/threshold.js +42 -16
  9. package/components/essentials/threshold.js.map +1 -1
  10. package/components/graphs/alluvial.js +14 -2
  11. package/components/graphs/alluvial.js.map +1 -1
  12. package/components/graphs/area-stacked.js +14 -2
  13. package/components/graphs/area-stacked.js.map +1 -1
  14. package/components/graphs/area.js +14 -2
  15. package/components/graphs/area.js.map +1 -1
  16. package/components/graphs/bar-grouped.js +14 -4
  17. package/components/graphs/bar-grouped.js.map +1 -1
  18. package/components/graphs/bar-simple.js +14 -4
  19. package/components/graphs/bar-simple.js.map +1 -1
  20. package/components/graphs/bar-stacked.js +14 -3
  21. package/components/graphs/bar-stacked.js.map +1 -1
  22. package/components/graphs/bullet.js +14 -4
  23. package/components/graphs/bullet.js.map +1 -1
  24. package/components/graphs/circle-pack.js +21 -3
  25. package/components/graphs/circle-pack.js.map +1 -1
  26. package/components/graphs/histogram.js +14 -3
  27. package/components/graphs/histogram.js.map +1 -1
  28. package/components/graphs/line.js +14 -2
  29. package/components/graphs/line.js.map +1 -1
  30. package/components/graphs/lollipop.js +14 -2
  31. package/components/graphs/lollipop.js.map +1 -1
  32. package/components/graphs/meter.js +0 -1
  33. package/components/graphs/meter.js.map +1 -1
  34. package/components/graphs/pie.js +28 -4
  35. package/components/graphs/pie.js.map +1 -1
  36. package/components/graphs/radar.js +134 -17
  37. package/components/graphs/radar.js.map +1 -1
  38. package/components/graphs/scatter.js +28 -4
  39. package/components/graphs/scatter.js.map +1 -1
  40. package/components/graphs/treemap.js +28 -4
  41. package/components/graphs/treemap.js.map +1 -1
  42. package/components/graphs/wordcloud.js +30 -5
  43. package/components/graphs/wordcloud.js.map +1 -1
  44. package/demo/styles.css +9236 -10907
  45. package/demo/styles.css.map +1 -1
  46. package/demo/styles.min.css +1 -1
  47. package/demo/styles.min.css.map +1 -1
  48. package/package.json +1 -1
  49. package/services/essentials/transitions.d.ts +0 -3
  50. package/services/essentials/transitions.js +1 -25
  51. package/services/essentials/transitions.js.map +1 -1
  52. package/styles/_chart-feature-flags.scss +4 -0
  53. package/styles/_type.scss +7 -2
  54. package/styles/components/_modal.scss +0 -4
  55. package/styles/components/_toolbar.scss +0 -4
  56. package/styles/styles.scss +1 -0
  57. package/styles-g10.css +45 -3525
  58. package/styles-g10.css.map +1 -1
  59. package/styles-g10.min.css +1 -1
  60. package/styles-g10.min.css.map +1 -1
  61. package/styles-g100.css +46 -3526
  62. package/styles-g100.css.map +1 -1
  63. package/styles-g100.min.css +1 -1
  64. package/styles-g100.min.css.map +1 -1
  65. package/styles-g90.css +46 -3526
  66. package/styles-g90.css.map +1 -1
  67. package/styles-g90.min.css +1 -1
  68. package/styles-g90.min.css.map +1 -1
  69. package/styles.css +45 -3525
  70. package/styles.css.map +1 -1
  71. package/styles.min.css +1 -1
  72. package/styles.min.css.map +1 -1
  73. package/tsconfig.tsbuildinfo +21 -22
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carbon/charts",
3
- "version": "0.49.5",
3
+ "version": "0.50.1",
4
4
  "description": "Carbon charting components",
5
5
  "main": "./bundle.js",
6
6
  "module": "./index.js",
@@ -1,5 +1,4 @@
1
1
  import { Service } from '../service';
2
- import { Transition } from 'd3-transition';
3
2
  interface setupTransitionConfigs {
4
3
  transition?: any;
5
4
  name?: string;
@@ -8,8 +7,6 @@ interface setupTransitionConfigs {
8
7
  export declare class Transitions extends Service {
9
8
  pendingTransitions: {};
10
9
  init(): void;
11
- getTransition(name: string, animate?: boolean): Transition<any, any, any, any>;
12
- getInstantTransition(name?: string): Transition<any, any, any, any>;
13
10
  setupTransition({ transition: t, name, animate }: setupTransitionConfigs): any;
14
11
  getPendingTransitions(): {};
15
12
  }
@@ -16,8 +16,6 @@ import { Service } from '../service';
16
16
  import * as Configuration from '../../configuration';
17
17
  import { Events } from './../../interfaces';
18
18
  import { Tools } from '../../tools';
19
- // D3 Imports
20
- import { transition } from 'd3-transition';
21
19
  var Transitions = /** @class */ (function (_super) {
22
20
  __extends(Transitions, _super);
23
21
  function Transitions() {
@@ -31,28 +29,6 @@ var Transitions = /** @class */ (function (_super) {
31
29
  _this.pendingTransitions = {};
32
30
  });
33
31
  };
34
- Transitions.prototype.getTransition = function (name, animate) {
35
- var _this = this;
36
- if (this.model.getOptions().animations === false || animate === false) {
37
- return this.getInstantTransition(name);
38
- }
39
- var t = transition(name).duration(Tools.getProperty(Configuration.transitions, name, 'duration') ||
40
- Configuration.transitions.default.duration);
41
- this.pendingTransitions[t._id] = t;
42
- t.on('end interrupt cancel', function () {
43
- delete _this.pendingTransitions[t._id];
44
- });
45
- return t;
46
- };
47
- Transitions.prototype.getInstantTransition = function (name) {
48
- var _this = this;
49
- var t = transition(name).duration(0);
50
- this.pendingTransitions[t._id] = t;
51
- t.on('end interrupt cancel', function () {
52
- delete _this.pendingTransitions[t._id];
53
- });
54
- return t;
55
- };
56
32
  Transitions.prototype.setupTransition = function (_a) {
57
33
  var _this = this;
58
34
  var t = _a.transition, name = _a.name, animate = _a.animate;
@@ -60,7 +36,7 @@ var Transitions = /** @class */ (function (_super) {
60
36
  t.on('end interrupt cancel', function () {
61
37
  delete _this.pendingTransitions[t._id];
62
38
  });
63
- if (animate !== true) {
39
+ if (this.model.getOptions().animations === false || animate === false) {
64
40
  return t.duration(0);
65
41
  }
66
42
  return t.duration(Tools.getProperty(Configuration.transitions, name, 'duration') ||
@@ -1 +1 @@
1
- {"version":3,"file":"transitions.js","sourceRoot":"","sources":["transitions.ts"],"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AAC;QAEH,OAAO,CAAC,CAAC;IACV,CAAC;IAED,0CAAoB,GAApB,UAAqB,IAAa;QAAlC,iBASC;QARA,IAAM,CAAC,GAAQ,UAAU,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAE5C,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACnC,CAAC,CAAC,EAAE,CAAC,sBAAsB,EAAE;YAC5B,OAAO,KAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;QAEH,OAAO,CAAC,CAAC;IACV,CAAC;IAED,qCAAe,GAAf,UAAgB,EAAwD;QAAxE,iBAcC;YAdiB,iBAAa,EAAE,cAAI,EAAE,oBAAO;QAC7C,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACnC,CAAC,CAAC,EAAE,CAAC,sBAAsB,EAAE;YAC5B,OAAO,KAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;QAEH,IAAI,OAAO,KAAK,IAAI,EAAE;YACrB,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;SACrB;QAED,OAAO,CAAC,CAAC,QAAQ,CAChB,KAAK,CAAC,WAAW,CAAC,aAAa,CAAC,WAAW,EAAE,IAAI,EAAE,UAAU,CAAC;YAC7D,aAAa,CAAC,WAAW,CAAC,OAAO,CAAC,QAAQ,CAC3C,CAAC;IACH,CAAC;IAED,2CAAqB,GAArB;QACC,OAAO,IAAI,CAAC,kBAAkB,CAAC;IAChC,CAAC;IACF,kBAAC;AAAD,CAAC,AA5DD,CAAiC,OAAO,GA4DvC","sourcesContent":["// Internal Imports\nimport { Service } from '../service';\nimport * as Configuration from '../../configuration';\nimport { Events } from './../../interfaces';\nimport { Tools } from '../../tools';\n\n// D3 Imports\nimport { Transition, transition } from 'd3-transition';\n\ninterface setupTransitionConfigs {\n\ttransition?: any; // d3 types are causing issues here, hence why using `any`\n\tname?: string;\n\tanimate?: boolean;\n}\n\nexport class Transitions extends Service {\n\tpendingTransitions = {};\n\n\tinit() {\n\t\tthis.services.events.addEventListener(Events.Model.UPDATE, () => {\n\t\t\tthis.pendingTransitions = {};\n\t\t});\n\t}\n\n\tgetTransition(\n\t\tname: string,\n\t\tanimate?: boolean\n\t): Transition<any, any, any, any> {\n\t\tif (this.model.getOptions().animations === false || animate === false) {\n\t\t\treturn this.getInstantTransition(name);\n\t\t}\n\n\t\tconst t: any = transition(name).duration(\n\t\t\tTools.getProperty(Configuration.transitions, name, 'duration') ||\n\t\t\t\tConfiguration.transitions.default.duration\n\t\t);\n\n\t\tthis.pendingTransitions[t._id] = t;\n\t\tt.on('end interrupt cancel', () => {\n\t\t\tdelete this.pendingTransitions[t._id];\n\t\t});\n\n\t\treturn t;\n\t}\n\n\tgetInstantTransition(name?: string): Transition<any, any, any, any> {\n\t\tconst t: any = transition(name).duration(0);\n\n\t\tthis.pendingTransitions[t._id] = t;\n\t\tt.on('end interrupt cancel', () => {\n\t\t\tdelete this.pendingTransitions[t._id];\n\t\t});\n\n\t\treturn t;\n\t}\n\n\tsetupTransition({ transition: t, name, animate }: setupTransitionConfigs) {\n\t\tthis.pendingTransitions[t._id] = t;\n\t\tt.on('end interrupt cancel', () => {\n\t\t\tdelete this.pendingTransitions[t._id];\n\t\t});\n\n\t\tif (animate !== true) {\n\t\t\treturn t.duration(0);\n\t\t}\n\n\t\treturn t.duration(\n\t\t\tTools.getProperty(Configuration.transitions, name, 'duration') ||\n\t\t\t\tConfiguration.transitions.default.duration\n\t\t);\n\t}\n\n\tgetPendingTransitions() {\n\t\treturn this.pendingTransitions;\n\t}\n}\n"]}
1
+ {"version":3,"file":"transitions.js","sourceRoot":"","sources":["transitions.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mBAAmB;AACnB,OAAO,E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AAiC,OAAO,GA4BvC","sourcesContent":["// Internal Imports\nimport { Service } from '../service';\nimport * as Configuration from '../../configuration';\nimport { Events } from './../../interfaces';\nimport { Tools } from '../../tools';\n\n// D3 Imports\nimport { Transition, transition } from 'd3-transition';\n\ninterface setupTransitionConfigs {\n\ttransition?: any; // d3 types are causing issues here, hence why using `any`\n\tname?: string;\n\tanimate?: boolean;\n}\n\nexport class Transitions extends Service {\n\tpendingTransitions = {};\n\n\tinit() {\n\t\tthis.services.events.addEventListener(Events.Model.UPDATE, () => {\n\t\t\tthis.pendingTransitions = {};\n\t\t});\n\t}\n\n\tsetupTransition({ transition: t, name, animate }: setupTransitionConfigs) {\n\t\tthis.pendingTransitions[t._id] = t;\n\t\tt.on('end interrupt cancel', () => {\n\t\t\tdelete this.pendingTransitions[t._id];\n\t\t});\n\n\t\tif (this.model.getOptions().animations === false || animate === false) {\n\t\t\treturn t.duration(0);\n\t\t}\n\n\t\treturn t.duration(\n\t\t\tTools.getProperty(Configuration.transitions, name, 'duration') ||\n\t\t\t\tConfiguration.transitions.default.duration\n\t\t);\n\t}\n\n\tgetPendingTransitions() {\n\t\treturn this.pendingTransitions;\n\t}\n}\n"]}
@@ -0,0 +1,4 @@
1
+ /// Initialize the feature flag map with default values.
2
+ $chart-feature-flags: (
3
+ enable-font-imports: true,
4
+ ) !default;
package/styles/_type.scss CHANGED
@@ -1,8 +1,13 @@
1
1
  @import './vendor/@carbon/type/scss/type';
2
2
  @import './vendor/@carbon/type/scss/font-face/sans';
3
3
  @import './vendor/@carbon/type/scss/font-face/sans-condensed';
4
- @include carbon--font-face-sans();
5
- @include carbon--font-face-sans-condensed();
4
+
5
+ @import './chart-feature-flags';
6
+
7
+ @if map-get($chart-feature-flags, 'enable-font-imports') == true {
8
+ @include carbon--font-face-sans();
9
+ @include carbon--font-face-sans-condensed();
10
+ }
6
11
 
7
12
  .#{$prefix}--#{$charts-prefix}--chart-wrapper {
8
13
  font-family: carbon--font-family('sans-condensed');
@@ -1,8 +1,4 @@
1
- @import './../vendor/carbon-components/src/components/modal/modal';
2
-
3
1
  .#{$prefix}--chart-holder {
4
- @include modal;
5
-
6
2
  .#{$prefix}--modal {
7
3
  &.is-visible {
8
4
  z-index: 99999;
@@ -1,9 +1,5 @@
1
1
  $css--reset: false;
2
- @import './../vendor/carbon-components/src/components/overflow-menu/overflow-menu';
3
-
4
2
  .#{$prefix}--chart-holder {
5
- @include overflow-menu;
6
-
7
3
  .bx--overflow-menu,
8
4
  .bx--overflow-menu__trigger {
9
5
  width: 2rem;
@@ -28,6 +28,7 @@ $css--default-type: false;
28
28
  @import './graphs/index.scss';
29
29
  @import './type';
30
30
  @import './chart-holder';
31
+ @import './chart-feature-flags';
31
32
 
32
33
  .#{$prefix}--#{$charts-prefix}--chart-wrapper {
33
34
  overflow: visible;