@carbon/charts 0.30.5 → 0.30.9

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 (152) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +14 -8
  3. package/build/demo/data/bar.d.ts +56 -94
  4. package/build/demo/data/bubble.d.ts +58 -13
  5. package/build/demo/data/donut.d.ts +3 -6
  6. package/build/demo/data/line.d.ts +35 -35
  7. package/build/demo/data/pie.d.ts +3 -6
  8. package/build/demo/data/scatter.d.ts +33 -20
  9. package/build/demo/data/step.d.ts +15 -16
  10. package/build/demo/data/time-series-axis.d.ts +12 -48
  11. package/build/src/charts/bar-grouped.d.ts +2 -2
  12. package/build/src/charts/bar-simple.d.ts +2 -4
  13. package/build/src/components/essentials/legend.d.ts +0 -4
  14. package/build/src/components/essentials/tooltip-bar.d.ts +1 -1
  15. package/build/src/components/essentials/tooltip-pie.d.ts +5 -0
  16. package/build/src/components/essentials/tooltip-scatter.d.ts +1 -1
  17. package/build/src/components/graphs/bar-grouped.d.ts +6 -4
  18. package/build/src/components/graphs/bar-simple.d.ts +0 -1
  19. package/build/src/components/graphs/bar-stacked.d.ts +0 -1
  20. package/build/src/components/graphs/bubble.d.ts +0 -1
  21. package/build/src/components/graphs/line.d.ts +3 -1
  22. package/build/src/components/graphs/pie.d.ts +0 -1
  23. package/build/src/components/graphs/scatter.d.ts +0 -1
  24. package/build/src/components/index.d.ts +1 -0
  25. package/build/src/interfaces/axis-scales.d.ts +4 -16
  26. package/build/src/interfaces/charts.d.ts +23 -1
  27. package/build/src/interfaces/enums.d.ts +0 -4
  28. package/build/src/interfaces/events.d.ts +20 -0
  29. package/build/src/model-pie.d.ts +1 -7
  30. package/build/src/model.d.ts +31 -13
  31. package/build/src/services/scales-cartesian.d.ts +11 -3
  32. package/build/src/tools.d.ts +2 -2
  33. package/build/stories/tutorials.stories.d.ts +1 -0
  34. package/bundle.js +1 -1
  35. package/chart.js +2 -2
  36. package/chart.js.map +1 -1
  37. package/charts/bar-grouped.d.ts +2 -2
  38. package/charts/bar-grouped.js.map +1 -1
  39. package/charts/bar-simple.d.ts +2 -4
  40. package/charts/bar-simple.js +0 -2
  41. package/charts/bar-simple.js.map +1 -1
  42. package/charts/donut.js +2 -2
  43. package/charts/donut.js.map +1 -1
  44. package/charts/pie.js +2 -2
  45. package/charts/pie.js.map +1 -1
  46. package/components/axes/grid.js +12 -19
  47. package/components/axes/grid.js.map +1 -1
  48. package/components/component.js +1 -1
  49. package/components/component.js.map +1 -1
  50. package/components/essentials/legend.d.ts +0 -4
  51. package/components/essentials/legend.js +8 -22
  52. package/components/essentials/legend.js.map +1 -1
  53. package/components/essentials/title.js +4 -4
  54. package/components/essentials/title.js.map +1 -1
  55. package/components/essentials/tooltip-bar.d.ts +1 -1
  56. package/components/essentials/tooltip-bar.js +13 -5
  57. package/components/essentials/tooltip-bar.js.map +1 -1
  58. package/components/essentials/tooltip-pie.d.ts +5 -0
  59. package/components/essentials/tooltip-pie.js +40 -0
  60. package/components/essentials/tooltip-pie.js.map +1 -0
  61. package/components/essentials/tooltip-scatter.d.ts +1 -1
  62. package/components/essentials/tooltip-scatter.js +8 -6
  63. package/components/essentials/tooltip-scatter.js.map +1 -1
  64. package/components/essentials/tooltip.js +14 -17
  65. package/components/essentials/tooltip.js.map +1 -1
  66. package/components/graphs/bar-grouped.d.ts +6 -4
  67. package/components/graphs/bar-grouped.js +60 -32
  68. package/components/graphs/bar-grouped.js.map +1 -1
  69. package/components/graphs/bar-simple.d.ts +0 -1
  70. package/components/graphs/bar-simple.js +12 -30
  71. package/components/graphs/bar-simple.js.map +1 -1
  72. package/components/graphs/bar-stacked.d.ts +0 -1
  73. package/components/graphs/bar-stacked.js +26 -108
  74. package/components/graphs/bar-stacked.js.map +1 -1
  75. package/components/graphs/bar.js.map +1 -1
  76. package/components/graphs/bubble.d.ts +0 -1
  77. package/components/graphs/bubble.js +16 -20
  78. package/components/graphs/bubble.js.map +1 -1
  79. package/components/graphs/donut.js +1 -1
  80. package/components/graphs/donut.js.map +1 -1
  81. package/components/graphs/line.d.ts +3 -1
  82. package/components/graphs/line.js +41 -30
  83. package/components/graphs/line.js.map +1 -1
  84. package/components/graphs/pie.d.ts +0 -1
  85. package/components/graphs/pie.js +13 -20
  86. package/components/graphs/pie.js.map +1 -1
  87. package/components/graphs/scatter.d.ts +0 -1
  88. package/components/graphs/scatter.js +26 -41
  89. package/components/graphs/scatter.js.map +1 -1
  90. package/components/index.d.ts +1 -0
  91. package/components/index.js +1 -0
  92. package/components/index.js.map +1 -1
  93. package/configuration.js +7 -0
  94. package/configuration.js.map +1 -1
  95. package/demo/data/bar.d.ts +56 -94
  96. package/demo/data/bar.js +106 -271
  97. package/demo/data/bar.js.map +1 -1
  98. package/demo/data/bubble.d.ts +58 -13
  99. package/demo/data/bubble.js +74 -174
  100. package/demo/data/bubble.js.map +1 -1
  101. package/demo/data/bundle.js +1 -1
  102. package/demo/data/donut.d.ts +3 -6
  103. package/demo/data/index.js +22 -4
  104. package/demo/data/index.js.map +1 -1
  105. package/demo/data/line.d.ts +35 -35
  106. package/demo/data/line.js +70 -196
  107. package/demo/data/line.js.map +1 -1
  108. package/demo/data/pie.d.ts +3 -6
  109. package/demo/data/pie.js +8 -10
  110. package/demo/data/pie.js.map +1 -1
  111. package/demo/data/scatter.d.ts +33 -20
  112. package/demo/data/scatter.js +50 -68
  113. package/demo/data/scatter.js.map +1 -1
  114. package/demo/data/step.d.ts +15 -16
  115. package/demo/data/time-series-axis.d.ts +12 -48
  116. package/demo/data/time-series-axis.js +34 -46
  117. package/demo/data/time-series-axis.js.map +1 -1
  118. package/demo/styles.css +28 -0
  119. package/demo/styles.css.map +1 -1
  120. package/demo/styles.min.css +1 -1
  121. package/demo/styles.min.css.map +1 -1
  122. package/demo/tsconfig.tsbuildinfo +38 -37
  123. package/interfaces/axis-scales.d.ts +4 -16
  124. package/interfaces/axis-scales.js.map +1 -1
  125. package/interfaces/charts.d.ts +23 -1
  126. package/interfaces/charts.js.map +1 -1
  127. package/interfaces/enums.d.ts +0 -4
  128. package/interfaces/enums.js +0 -5
  129. package/interfaces/enums.js.map +1 -1
  130. package/interfaces/events.d.ts +20 -0
  131. package/interfaces/events.js +23 -0
  132. package/interfaces/events.js.map +1 -1
  133. package/model-pie.d.ts +1 -7
  134. package/model-pie.js +2 -107
  135. package/model-pie.js.map +1 -1
  136. package/model.d.ts +31 -13
  137. package/model.js +200 -76
  138. package/model.js.map +1 -1
  139. package/package.json +3 -1
  140. package/services/essentials/dom-utils.js +3 -2
  141. package/services/essentials/dom-utils.js.map +1 -1
  142. package/services/scales-cartesian.d.ts +11 -3
  143. package/services/scales-cartesian.js +104 -122
  144. package/services/scales-cartesian.js.map +1 -1
  145. package/tools.d.ts +2 -2
  146. package/tools.js +23 -2
  147. package/tools.js.map +1 -1
  148. package/tsconfig.tsbuildinfo +87 -88
  149. package/build/src/model-simple-bar.d.ts +0 -11
  150. package/model-simple-bar.d.ts +0 -11
  151. package/model-simple-bar.js +0 -88
  152. package/model-simple-bar.js.map +0 -1
@@ -23,9 +23,10 @@ var Scatter = /** @class */ (function (_super) {
23
23
  _this.type = "scatter";
24
24
  _this.handleLegendOnHover = function (event) {
25
25
  var hoveredElement = event.detail.hoveredElement;
26
+ var groupMapsTo = _this.model.getOptions().data.groupMapsTo;
26
27
  _this.parent.selectAll("circle.dot")
27
28
  .transition(_this.services.transitions.getTransition("legend-hover-scatter"))
28
- .attr("opacity", function (d) { return (d.datasetLabel !== hoveredElement.datum()["key"]) ? 0.3 : 1; });
29
+ .attr("opacity", function (d) { return (d[groupMapsTo] !== hoveredElement.datum()["name"]) ? 0.3 : 1; });
29
30
  };
30
31
  _this.handleLegendMouseOut = function (event) {
31
32
  _this.parent.selectAll("circle.dot")
@@ -35,21 +36,19 @@ var Scatter = /** @class */ (function (_super) {
35
36
  return _this;
36
37
  }
37
38
  Scatter.prototype.init = function () {
38
- var eventsFragment = this.services.events;
39
+ var events = this.services.events;
39
40
  // Highlight correct circle on legend item hovers
40
- eventsFragment.addEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover);
41
+ events.addEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover);
41
42
  // Un-highlight circles on legend item mouseouts
42
- eventsFragment.addEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut);
43
+ events.addEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut);
43
44
  };
44
45
  Scatter.prototype.render = function (animate) {
45
- var _this = this;
46
- // Chart options mixed with the internal configurations
47
- var options = this.model.getOptions();
48
46
  // Grab container SVG
49
47
  var svg = this.getContainerSVG();
48
+ var groupedData = this.model.getGroupedData();
50
49
  // Update data on dot groups
51
50
  var dotGroups = svg.selectAll("g.dots")
52
- .data(this.model.getDisplayData().datasets, function (dataset) { return dataset.label; });
51
+ .data(groupedData, function (group) { return group.name; });
53
52
  // Remove dot groups that need to be removed
54
53
  dotGroups.exit()
55
54
  .attr("opacity", 0)
@@ -59,10 +58,11 @@ var Scatter = /** @class */ (function (_super) {
59
58
  .append("g")
60
59
  .classed("dots", true)
61
60
  .attr("role", Roles.GROUP);
61
+ var rangeIdentifier = this.services.cartesianScales.getRangeIdentifier();
62
62
  // Update data on all circles
63
63
  var dots = dotGroupsEnter.merge(dotGroups)
64
64
  .selectAll("circle.dot")
65
- .data(function (d, i) { return _this.addLabelsToDataPoints(d, i); });
65
+ .data(function (group) { return group.data.filter(function (datum) { return datum[rangeIdentifier] !== null && datum[rangeIdentifier] !== undefined; }); });
66
66
  // Add the circles that need to be introduced
67
67
  var dotsEnter = dots.enter()
68
68
  .append("circle")
@@ -78,56 +78,41 @@ var Scatter = /** @class */ (function (_super) {
78
78
  // Chart options mixed with the internal configurations
79
79
  var options = this.model.getOptions();
80
80
  var filled = options.points.filled;
81
+ var groupMapsTo = options.data.groupMapsTo;
82
+ var domainIdentifier = this.services.cartesianScales.getDomainIdentifier();
83
+ var rangeIdentifier = this.services.cartesianScales.getRangeIdentifier();
81
84
  selection.raise()
82
85
  .classed("dot", true)
83
- .classed("filled", function (d) { return _this.model.getIsFilled(d.datasetLabel, d.label, d, filled); })
84
- .classed("unfilled", function (d) { return !_this.model.getIsFilled(d.datasetLabel, d.label, d, filled); })
86
+ .classed("filled", function (d) { return _this.model.getIsFilled(d[groupMapsTo], d[domainIdentifier], d, filled); })
87
+ .classed("unfilled", function (d) { return !_this.model.getIsFilled(d[groupMapsTo], d[domainIdentifier], d, filled); })
85
88
  .attr("cx", function (d, i) { return _this.services.cartesianScales.getDomainValue(d, i); })
86
89
  .transition(this.services.transitions.getTransition("scatter-update-enter", animate))
87
90
  .attr("cy", function (d, i) { return _this.services.cartesianScales.getRangeValue(d, i); })
88
91
  .attr("r", options.points.radius)
89
92
  .attr("fill", function (d) {
90
- if (_this.model.getIsFilled(d.datasetLabel, d.label, d, filled)) {
91
- return _this.model.getFillColor(d.datasetLabel, d.label, d);
93
+ if (_this.model.getIsFilled(d[groupMapsTo], d[domainIdentifier], d, filled)) {
94
+ return _this.model.getFillColor(d[groupMapsTo], d[domainIdentifier], d);
92
95
  }
93
96
  })
94
97
  .attr("fill-opacity", filled ? 0.2 : 1)
95
- .attr("stroke", function (d) { return _this.model.getStrokeColor(d.datasetLabel, d.label, d); })
98
+ .attr("stroke", function (d) { return _this.model.getStrokeColor(d[groupMapsTo], d[domainIdentifier], d); })
96
99
  .attr("opacity", 1)
97
100
  // a11y
98
101
  .attr("role", Roles.GRAPHICS_SYMBOL)
99
102
  .attr("aria-roledescription", "point")
100
- .attr("aria-label", function (d) { return d.value; });
103
+ .attr("aria-label", function (d) { return d[rangeIdentifier]; });
101
104
  // Add event listeners to elements drawn
102
105
  this.addEventListeners();
103
106
  };
104
- // TODO - This method could be re-used in more graphs
105
- Scatter.prototype.addLabelsToDataPoints = function (d, index) {
106
- var labels = this.model.getDisplayData().labels;
107
- return d.data
108
- // Remove datapoints with no value
109
- .filter(function (datum) {
110
- var value = isNaN(datum) ? datum.value : datum;
111
- if (value === null || value === undefined) {
112
- return false;
113
- }
114
- return true;
115
- })
116
- .map(function (datum, i) { return ({
117
- date: datum.date,
118
- label: labels[i],
119
- datasetLabel: d.label,
120
- class: datum.class,
121
- value: isNaN(datum) ? datum.value : datum
122
- }); });
123
- };
124
107
  Scatter.prototype.addEventListeners = function () {
125
108
  var self = this;
109
+ var groupMapsTo = this.model.getOptions().data.groupMapsTo;
110
+ var domainIdentifier = this.services.cartesianScales.getDomainIdentifier();
126
111
  this.parent.selectAll("circle")
127
112
  .on("mouseover mousemove", function (datum) {
128
113
  var hoveredElement = select(this);
129
114
  hoveredElement.classed("hovered", true)
130
- .style("fill", function (d) { return self.model.getFillColor(d.datasetLabel, d.label, d); });
115
+ .style("fill", function (d) { return self.model.getFillColor(d[groupMapsTo], d[domainIdentifier], d); });
131
116
  var eventNameToDispatch = d3Event.type === "mouseover" ? Events.Scatter.SCATTER_MOUSEOVER : Events.Scatter.SCATTER_MOUSEMOVE;
132
117
  // Dispatch mouse event
133
118
  self.services.events.dispatchEvent(eventNameToDispatch, {
@@ -135,7 +120,7 @@ var Scatter = /** @class */ (function (_super) {
135
120
  datum: datum
136
121
  });
137
122
  // Show tooltip
138
- self.services.events.dispatchEvent("show-tooltip", {
123
+ self.services.events.dispatchEvent(Events.Tooltip.SHOW, {
139
124
  hoveredElement: hoveredElement,
140
125
  type: TooltipTypes.DATAPOINT
141
126
  });
@@ -159,7 +144,7 @@ var Scatter = /** @class */ (function (_super) {
159
144
  datum: datum
160
145
  });
161
146
  // Hide tooltip
162
- self.services.events.dispatchEvent("hide-tooltip", { hoveredElement: hoveredElement });
147
+ self.services.events.dispatchEvent(Events.Tooltip.HIDE, { hoveredElement: hoveredElement });
163
148
  });
164
149
  };
165
150
  Scatter.prototype.destroy = function () {
@@ -168,9 +153,9 @@ var Scatter = /** @class */ (function (_super) {
168
153
  .on("mousemove", null)
169
154
  .on("mouseout", null);
170
155
  // Remove legend listeners
171
- var eventsFragment = this.services.events;
172
- eventsFragment.removeEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover);
173
- eventsFragment.removeEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut);
156
+ var events = this.services.events;
157
+ events.removeEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover);
158
+ events.removeEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut);
174
159
  };
175
160
  return Scatter;
176
161
  }(Component));
@@ -1 +1 @@
1
- {"version":3,"file":"scatter.js","sourceRoot":"","sources":["scatter.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mBAAmB;AACnB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE/D,aAAa;AACb,OAAO,EAAE,MAAM,EAAa,KAAK,IAAI,OAAO,EAAE,MAAM,cAAc,CAAC;AAEnE;IAA6B,2BAAS;IAAtC;QAAA,qEAmLC;QAlLA,UAAI,GAAG,SAAS,CAAC;QAkFjB,yBAAmB,GAAG,UAAC,KAAkB;YAChC,IAAA,4CAAc,CAAkB;YAExC,KAAI,CAAC,MAAM,CAAC,SAAS,CAAC,YAAY,CAAC;iBACjC,UAAU,CAAC,KAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,aAAa,CAAC,sBAAsB,CAAC,CAAC;iBAC3E,IAAI,CAAC,SAAS,EAAE,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,CAAC,YAAY,KAAK,cAAc,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAA5D,CAA4D,CAAC,CAAC;QACtF,CAAC,CAAA;QAED,0BAAoB,GAAG,UAAC,KAAkB;YACzC,KAAI,CAAC,MAAM,CAAC,SAAS,CAAC,YAAY,CAAC;iBACjC,UAAU,CAAC,KAAI,CAAC,QAAQ,CA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ACf,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,cAAc,EAAE,EAAE,cAAc,gBAAA,EAAE,CAAC,CAAC;QACxE,CAAC,CAAC,CAAC;IACL,CAAC;IAED,yBAAO,GAAP;QACC,yBAAyB;QACzB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC;aAC7B,EAAE,CAAC,WAAW,EAAE,IAAI,CAAC;aACrB,EAAE,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QAEvB,0BAA0B;QAC1B,IAAM,cAAc,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;QAC5C,cAAc,CAAC,mBAAmB,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;QACvF,cAAc,CAAC,mBAAmB,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,IAAI,CAAC,oBAAoB,CAAC,CAAC;IAC5F,CAAC;IACF,cAAC;AAAD,CAAC,AAnLD,CAA6B,SAAS,GAmLrC","sourcesContent":["// Internal Imports\nimport { Component } from \"../component\";\nimport { TooltipTypes, Roles, Events } from \"../../interfaces\";\n\n// D3 Imports\nimport { select, Selection, event as d3Event } from \"d3-selection\";\n\nexport class Scatter extends Component {\n\ttype = \"scatter\";\n\n\tinit() {\n\t\tconst eventsFragment = this.services.events;\n\n\t\t// Highlight correct circle on legend item hovers\n\t\teventsFragment.addEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover);\n\n\t\t// Un-highlight circles on legend item mouseouts\n\t\teventsFragment.addEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut);\n\t}\n\n\trender(animate: boolean) {\n\t\t// Chart options mixed with the internal configurations\n\t\tconst options = this.model.getOptions();\n\n\t\t// Grab container SVG\n\t\tconst svg = this.getContainerSVG();\n\n\t\t// Update data on dot groups\n\t\tconst dotGroups = svg.selectAll(\"g.dots\")\n\t\t\t.data(this.model.getDisplayData().datasets, dataset => dataset.label);\n\n\t\t// Remove dot groups that need to be removed\n\t\tdotGroups.exit()\n\t\t\t.attr(\"opacity\", 0)\n\t\t\t.remove();\n\n\t\t// Add the dot groups that need to be introduced\n\t\tconst dotGroupsEnter = dotGroups.enter()\n\t\t\t.append(\"g\")\n\t\t\t\t.classed(\"dots\", true)\n\t\t\t\t.attr(\"role\", Roles.GROUP);\n\n\t\t// Update data on all circles\n\t\tconst dots = dotGroupsEnter.merge(dotGroups)\n\t\t\t.selectAll(\"circle.dot\")\n\t\t\t.data((d, i) => this.addLabelsToDataPoints(d, i));\n\n\t\t// Add the circles that need to be introduced\n\t\tconst dotsEnter = dots.enter()\n\t\t\t.append(\"circle\")\n\t\t\t.attr(\"opacity\", 0);\n\n\t\t// Apply styling & position\n\t\tconst circlesToStyle = dotsEnter.merge(dots);\n\t\tthis.styleCircles(circlesToStyle, animate);\n\n\t\t// Add event listeners to elements drawn\n\t\tthis.addEventListeners();\n\t}\n\n\tstyleCircles(selection: Selection<any, any, any, any>, animate: boolean) {\n\t\t// Chart options mixed with the internal configurations\n\t\tconst options = this.model.getOptions();\n\t\tconst { filled } = options.points;\n\n\t\tselection.raise()\n\t\t\t.classed(\"dot\", true)\n\t\t\t.classed(\"filled\", d => this.model.getIsFilled(d.datasetLabel, d.label, d, filled))\n\t\t\t.classed(\"unfilled\", d => !this.model.getIsFilled(d.datasetLabel, d.label, d, filled))\n\t\t\t.attr(\"cx\", (d, i) => this.services.cartesianScales.getDomainValue(d, i))\n\t\t\t.transition(this.services.transitions.getTransition(\"scatter-update-enter\", animate))\n\t\t\t.attr(\"cy\", (d, i) => this.services.cartesianScales.getRangeValue(d, i))\n\t\t\t.attr(\"r\", options.points.radius)\n\t\t\t.attr(\"fill\", d => {\n\t\t\t\tif (this.model.getIsFilled(d.datasetLabel, d.label, d, filled)) {\n\t\t\t\t\treturn this.model.getFillColor(d.datasetLabel, d.label, d);\n\t\t\t\t}\n\t\t\t})\n\t\t\t.attr(\"fill-opacity\", filled ? 0.2 : 1)\n\t\t\t.attr(\"stroke\", d => this.model.getStrokeColor(d.datasetLabel, d.label, d))\n\t\t\t.attr(\"opacity\", 1)\n\t\t\t// a11y\n\t\t\t.attr(\"role\", Roles.GRAPHICS_SYMBOL)\n\t\t\t.attr(\"aria-roledescription\", \"point\")\n\t\t\t.attr(\"aria-label\", d => d.value);\n\n\t\t// Add event listeners to elements drawn\n\t\tthis.addEventListeners();\n\t}\n\n\thandleLegendOnHover = (event: CustomEvent) => {\n\t\tconst { hoveredElement } = event.detail;\n\n\t\tthis.parent.selectAll(\"circle.dot\")\n\t\t\t.transition(this.services.transitions.getTransition(\"legend-hover-scatter\"))\n\t\t\t.attr(\"opacity\", d => (d.datasetLabel !== hoveredElement.datum()[\"key\"]) ? 0.3 : 1);\n\t}\n\n\thandleLegendMouseOut = (event: CustomEvent) => {\n\t\tthis.parent.selectAll(\"circle.dot\")\n\t\t\t.transition(this.services.transitions.getTransition(\"legend-mouseout-scatter\"))\n\t\t\t.attr(\"opacity\", 1);\n\t}\n\n\t// TODO - This method could be re-used in more graphs\n\taddLabelsToDataPoints(d, index) {\n\t\tconst { labels } = this.model.getDisplayData();\n\n\t\treturn d.data\n\t\t\t// Remove datapoints with no value\n\t\t\t.filter((datum: any) => {\n\t\t\t\tconst value = isNaN(datum) ? datum.value : datum;\n\t\t\t\tif (value === null || value === undefined) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t})\n\t\t\t.map((datum, i) => ({\n\t\t\t\tdate: datum.date,\n\t\t\t\tlabel: labels[i],\n\t\t\t\tdatasetLabel: d.label,\n\t\t\t\tclass: datum.class,\n\t\t\t\tvalue: isNaN(datum) ? datum.value : datum\n\t\t\t}));\n\t}\n\n\taddEventListeners() {\n\t\tconst self = this;\n\t\tthis.parent.selectAll(\"circle\")\n\t\t\t.on(\"mouseover mousemove\", function(datum) {\n\t\t\t\tconst hoveredElement = select(this);\n\n\t\t\t\thoveredElement.classed(\"hovered\", true)\n\t\t\t\t\t.style(\"fill\", (d: any) => self.model.getFillColor(d.datasetLabel, d.label, d));\n\n\t\t\t\tconst eventNameToDispatch = d3Event.type === \"mouseover\" ? Events.Scatter.SCATTER_MOUSEOVER : Events.Scatter.SCATTER_MOUSEMOVE;\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(eventNameToDispatch, {\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t});\n\n\t\t\t\t// Show tooltip\n\t\t\t\tself.services.events.dispatchEvent(\"show-tooltip\", {\n\t\t\t\t\thoveredElement,\n\t\t\t\t\ttype: TooltipTypes.DATAPOINT\n\t\t\t\t});\n\t\t\t})\n\t\t\t.on(\"click\", function(datum) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Scatter.SCATTER_CLICK, {\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t});\n\t\t\t})\n\t\t\t.on(\"mouseout\", function(datum) {\n\t\t\t\tconst hoveredElement = select(this);\n\t\t\t\thoveredElement.classed(\"hovered\", false);\n\n\t\t\t\tif (!self.configs.filled) {\n\t\t\t\t\thoveredElement.style(\"fill\", null);\n\t\t\t\t}\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Scatter.SCATTER_MOUSEOUT, {\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t});\n\n\t\t\t\t// Hide tooltip\n\t\t\t\tself.services.events.dispatchEvent(\"hide-tooltip\", { hoveredElement });\n\t\t\t});\n\t}\n\n\tdestroy() {\n\t\t// Remove event listeners\n\t\tthis.parent.selectAll(\"circle\")\n\t\t\t.on(\"mousemove\", null)\n\t\t\t.on(\"mouseout\", null);\n\n\t\t// Remove legend listeners\n\t\tconst eventsFragment = this.services.events;\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover);\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut);\n\t}\n}\n"]}
1
+ {"version":3,"file":"scatter.js","sourceRoot":"","sources":["scatter.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mBAAmB;AACnB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE/D,aAAa;AACb,OAAO,EAAE,MAAM,EAAa,KAAK,IAAI,OAAO,EAAE,MAAM,cAAc,CAAC;AAEnE;IAA6B,2BAAS;IAAtC;QAAA,qEAmKC;QAlKA,UAAI,GAAG,SAAS,CAAC;QAoFjB,yBAAmB,GAAG,UAAC,KAAkB;YAChC,IAAA,4CAAc,CAAkB;YAEhC,IAAA,uDAAW,CAAkC;YAErD,KAAI,CAAC,MAAM,CAAC,SAAS,CAAC,YAAY,CAAC;iBACjC,UAAU,CAAC,KAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,aAAa,CAAC,sBAAsB,CAAC,CAAC;iBAC3E,IAAI,CAAC,SAAS,EAAE,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,cAAc,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAA7D,CAA6D,CAAC,CAAC;QACvF,CAAC,CAAA;QAED,0BAAoB,GAAG,UAAC,KAAkB;YACzC,KAAI,CAAC,MAAM,CAAC,SAAS,CAAC,YAAY,CAAC;iBACjC,UAAU,CAAC,KAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;iBAC9E,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;QACtB,CAAC,CAAA;;IAgEF,CAAC;IAhKA,sBAAI,GAAJ;QACS,IAAA,6BAAM,CAAmB;Q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,IAAI,CAAC,mBAAmB,CAAC,CAAC;QAC/E,MAAM,CAAC,mBAAmB,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,IAAI,CAAC,oBAAoB,CAAC,CAAC;IACpF,CAAC;IACF,cAAC;AAAD,CAAC,AAnKD,CAA6B,SAAS,GAmKrC","sourcesContent":["// Internal Imports\nimport { Component } from \"../component\";\nimport { TooltipTypes, Roles, Events } from \"../../interfaces\";\n\n// D3 Imports\nimport { select, Selection, event as d3Event } from \"d3-selection\";\n\nexport class Scatter extends Component {\n\ttype = \"scatter\";\n\n\tinit() {\n\t\tconst { events } = this.services;\n\t\t// Highlight correct circle on legend item hovers\n\t\tevents.addEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover);\n\t\t// Un-highlight circles on legend item mouseouts\n\t\tevents.addEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut);\n\t}\n\n\trender(animate: boolean) {\n\t\t// Grab container SVG\n\t\tconst svg = this.getContainerSVG();\n\n\t\tconst groupedData = this.model.getGroupedData();\n\n\t\t// Update data on dot groups\n\t\tconst dotGroups = svg.selectAll(\"g.dots\")\n\t\t\t.data(groupedData, group => group.name);\n\n\t\t// Remove dot groups that need to be removed\n\t\tdotGroups.exit()\n\t\t\t.attr(\"opacity\", 0)\n\t\t\t.remove();\n\n\t\t// Add the dot groups that need to be introduced\n\t\tconst dotGroupsEnter = dotGroups.enter()\n\t\t\t.append(\"g\")\n\t\t\t\t.classed(\"dots\", true)\n\t\t\t\t.attr(\"role\", Roles.GROUP);\n\n\t\tconst rangeIdentifier = this.services.cartesianScales.getRangeIdentifier();\n\t\t// Update data on all circles\n\t\tconst dots = dotGroupsEnter.merge(dotGroups)\n\t\t\t.selectAll(\"circle.dot\")\n\t\t\t.data(group => group.data.filter(datum => datum[rangeIdentifier] !== null && datum[rangeIdentifier] !== undefined));\n\n\t\t// Add the circles that need to be introduced\n\t\tconst dotsEnter = dots.enter()\n\t\t\t.append(\"circle\")\n\t\t\t.attr(\"opacity\", 0);\n\n\t\t// Apply styling & position\n\t\tconst circlesToStyle = dotsEnter.merge(dots);\n\t\tthis.styleCircles(circlesToStyle, animate);\n\n\t\t// Add event listeners to elements drawn\n\t\tthis.addEventListeners();\n\t}\n\n\tstyleCircles(selection: Selection<any, any, any, any>, animate: boolean) {\n\t\t// Chart options mixed with the internal configurations\n\t\tconst options = this.model.getOptions();\n\t\tconst { filled } = options.points;\n\n\t\tconst { groupMapsTo } = options.data;\n\t\tconst domainIdentifier = this.services.cartesianScales.getDomainIdentifier();\n\t\tconst rangeIdentifier = this.services.cartesianScales.getRangeIdentifier();\n\n\t\tselection.raise()\n\t\t\t.classed(\"dot\", true)\n\t\t\t.classed(\"filled\", d => this.model.getIsFilled(d[groupMapsTo], d[domainIdentifier], d, filled))\n\t\t\t.classed(\"unfilled\", d => !this.model.getIsFilled(d[groupMapsTo], d[domainIdentifier], d, filled))\n\t\t\t.attr(\"cx\", (d, i) => this.services.cartesianScales.getDomainValue(d, i))\n\t\t\t.transition(this.services.transitions.getTransition(\"scatter-update-enter\", animate))\n\t\t\t.attr(\"cy\", (d, i) => this.services.cartesianScales.getRangeValue(d, i))\n\t\t\t.attr(\"r\", options.points.radius)\n\t\t\t.attr(\"fill\", d => {\n\t\t\t\tif (this.model.getIsFilled(d[groupMapsTo], d[domainIdentifier], d, filled)) {\n\t\t\t\t\treturn this.model.getFillColor(d[groupMapsTo], d[domainIdentifier], d);\n\t\t\t\t}\n\t\t\t})\n\t\t\t.attr(\"fill-opacity\", filled ? 0.2 : 1)\n\t\t\t.attr(\"stroke\", d => this.model.getStrokeColor(d[groupMapsTo], d[domainIdentifier], d))\n\t\t\t.attr(\"opacity\", 1)\n\t\t\t// a11y\n\t\t\t.attr(\"role\", Roles.GRAPHICS_SYMBOL)\n\t\t\t.attr(\"aria-roledescription\", \"point\")\n\t\t\t.attr(\"aria-label\", d => d[rangeIdentifier]);\n\n\t\t// Add event listeners to elements drawn\n\t\tthis.addEventListeners();\n\t}\n\n\thandleLegendOnHover = (event: CustomEvent) => {\n\t\tconst { hoveredElement } = event.detail;\n\n\t\tconst { groupMapsTo } = this.model.getOptions().data;\n\n\t\tthis.parent.selectAll(\"circle.dot\")\n\t\t\t.transition(this.services.transitions.getTransition(\"legend-hover-scatter\"))\n\t\t\t.attr(\"opacity\", d => (d[groupMapsTo] !== hoveredElement.datum()[\"name\"]) ? 0.3 : 1);\n\t}\n\n\thandleLegendMouseOut = (event: CustomEvent) => {\n\t\tthis.parent.selectAll(\"circle.dot\")\n\t\t\t.transition(this.services.transitions.getTransition(\"legend-mouseout-scatter\"))\n\t\t\t.attr(\"opacity\", 1);\n\t}\n\n\taddEventListeners() {\n\t\tconst self = this;\n\t\tconst { groupMapsTo } = this.model.getOptions().data;\n\t\tconst domainIdentifier = this.services.cartesianScales.getDomainIdentifier();\n\n\t\tthis.parent.selectAll(\"circle\")\n\t\t\t.on(\"mouseover mousemove\", function(datum) {\n\t\t\t\tconst hoveredElement = select(this);\n\n\t\t\t\thoveredElement.classed(\"hovered\", true)\n\t\t\t\t\t.style(\"fill\", (d: any) => self.model.getFillColor(d[groupMapsTo], d[domainIdentifier], d));\n\n\t\t\t\tconst eventNameToDispatch = d3Event.type === \"mouseover\" ? Events.Scatter.SCATTER_MOUSEOVER : Events.Scatter.SCATTER_MOUSEMOVE;\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(eventNameToDispatch, {\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t});\n\n\t\t\t\t// Show tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\thoveredElement,\n\t\t\t\t\ttype: TooltipTypes.DATAPOINT\n\t\t\t\t});\n\t\t\t})\n\t\t\t.on(\"click\", function(datum) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Scatter.SCATTER_CLICK, {\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t});\n\t\t\t})\n\t\t\t.on(\"mouseout\", function(datum) {\n\t\t\t\tconst hoveredElement = select(this);\n\t\t\t\thoveredElement.classed(\"hovered\", false);\n\n\t\t\t\tif (!self.configs.filled) {\n\t\t\t\t\thoveredElement.style(\"fill\", null);\n\t\t\t\t}\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Scatter.SCATTER_MOUSEOUT, {\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t});\n\n\t\t\t\t// Hide tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE, { hoveredElement });\n\t\t\t});\n\t}\n\n\tdestroy() {\n\t\t// Remove event listeners\n\t\tthis.parent.selectAll(\"circle\")\n\t\t\t.on(\"mousemove\", null)\n\t\t\t.on(\"mouseout\", null);\n\n\t\t// Remove legend listeners\n\t\tconst { events } = this.services;\n\t\tevents.removeEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover);\n\t\tevents.removeEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut);\n\t}\n}\n"]}
@@ -3,6 +3,7 @@ export * from "./essentials/legend";
3
3
  export * from "./essentials/title";
4
4
  export * from "./essentials/tooltip";
5
5
  export * from "./essentials/tooltip-bar";
6
+ export * from "./essentials/tooltip-pie";
6
7
  export * from "./essentials/tooltip-scatter";
7
8
  export * from "./graphs/bar-simple";
8
9
  export * from "./graphs/bar-grouped";
@@ -4,6 +4,7 @@ export * from "./essentials/legend";
4
4
  export * from "./essentials/title";
5
5
  export * from "./essentials/tooltip";
6
6
  export * from "./essentials/tooltip-bar";
7
+ export * from "./essentials/tooltip-pie";
7
8
  export * from "./essentials/tooltip-scatter";
8
9
  // GRAPHS
9
10
  export * from "./graphs/bar-simple";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAE5B,aAAa;AACb,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAE7C,SAAS;AACT,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAE/B,SAAS;AACT,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAEhC,OAAO;AACP,cAAc,6BAA6B,CAAC;AAC5C,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC","sourcesContent":["export * from \"./component\";\n\n// ESSENTIALS\nexport * from \"./essentials/legend\";\nexport * from \"./essentials/title\";\nexport * from \"./essentials/tooltip\";\nexport * from \"./essentials/tooltip-bar\";\nexport * from \"./essentials/tooltip-scatter\";\n\n// GRAPHS\nexport * from \"./graphs/bar-simple\";\nexport * from \"./graphs/bar-grouped\";\nexport * from \"./graphs/bar-stacked\";\nexport * from \"./graphs/bubble\";\nexport * from \"./graphs/line\";\nexport * from \"./graphs/scatter\";\nexport * from \"./graphs/pie\";\nexport * from \"./graphs/donut\";\n\n// Layout\nexport * from \"./layout/spacer\";\nexport * from \"./layout/layout\";\n\n// MISC\nexport * from \"./axes/two-dimensional-axes\";\nexport * from \"./axes/axis\";\nexport * from \"./axes/grid\";\nexport * from \"./axes/zero-line\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAE5B,aAAa;AACb,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAE7C,SAAS;AACT,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAE/B,SAAS;AACT,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAEhC,OAAO;AACP,cAAc,6BAA6B,CAAC;AAC5C,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC","sourcesContent":["export * from \"./component\";\n\n// ESSENTIALS\nexport * from \"./essentials/legend\";\nexport * from \"./essentials/title\";\nexport * from \"./essentials/tooltip\";\nexport * from \"./essentials/tooltip-bar\";\nexport * from \"./essentials/tooltip-pie\";\nexport * from \"./essentials/tooltip-scatter\";\n\n// GRAPHS\nexport * from \"./graphs/bar-simple\";\nexport * from \"./graphs/bar-grouped\";\nexport * from \"./graphs/bar-stacked\";\nexport * from \"./graphs/bubble\";\nexport * from \"./graphs/line\";\nexport * from \"./graphs/scatter\";\nexport * from \"./graphs/pie\";\nexport * from \"./graphs/donut\";\n\n// Layout\nexport * from \"./layout/spacer\";\nexport * from \"./layout/layout\";\n\n// MISC\nexport * from \"./axes/two-dimensional-axes\";\nexport * from \"./axes/axis\";\nexport * from \"./axes/grid\";\nexport * from \"./axes/zero-line\";\n"]}
package/configuration.js CHANGED
@@ -109,6 +109,12 @@ var chart = {
109
109
  legend: legend,
110
110
  style: {
111
111
  prefix: "cc"
112
+ },
113
+ data: {
114
+ groupMapsTo: "group"
115
+ },
116
+ color: {
117
+ scale: null
112
118
  }
113
119
  };
114
120
  /**
@@ -174,6 +180,7 @@ var scatterChart = Tools.merge({}, axisChart, {
174
180
  */
175
181
  var bubbleChart = Tools.merge({}, axisChart, {
176
182
  bubble: {
183
+ radiusMapsTo: "radius",
177
184
  radiusRange: function (chartSize, data) {
178
185
  var smallerChartDimension = Math.min(chartSize.width, chartSize.height);
179
186
  return [
@@ -1 +1 @@
1
- {"version":3,"file":"configuration.js","sourceRoot":"","sources":["configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAkBN,eAAe,EAEf,MAAM,cAAc,CAAC;AACtB,OAAO,gBAAgB,MAAM,6BAA6B,CAAC;AAE3D;;;;GAIG;AAEH;;GAEG;AACH,MAAM,CAAC,IAAM,MAAM,GAAkB;IACpC,QAAQ,EAAE,eAAe,CAAC,MAAM;IAChC,SAAS,EAAE,IAAI;IACf,OAAO,EAAE,IAAI;IACb,KAAK,EAAE;QACN,MAAM,EAAE;YACP,MAAM,EAAE,CAAC;YACT,QAAQ,EAAE,CAAC;SACX;QACD,eAAe,EAAE,EAAE;QACnB,aAAa,EAAE,EAAE;QACjB,WAAW,EAAE,CAAC;KACd;IACD,QAAQ,EAAE;QACT,MAAM,EAAE,GAAG;QACX,UAAU,EAAE,CAAC;KACb;CACD,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,IAAM,IAAI,GAAgB;IAChC,CAAC,EAAE;QACF,aAAa,EAAE,CAAC;KAChB;IACD,CAAC,EAAE;QACF,aAAa,EAAE,CAAC;KAChB;CACD,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,IAAM,WAAW,GAAmB;IAC1C,SAAS,EAAE;QACV,gBAAgB,EAAE,EAAE;QACpB,OAAO,EAAE,IAAI;KACb;IACD,KAAK,EAAE;QACN,cAAc,EAAE,GAAG;QACnB,KAAK,EAAE,EAAE;KACT;CACD,CAAC;AAEF,MAAM,CAAC,IAAM,gBAAgB,GAAuB,KAAK,CAAC,KAAK,CAAC,EAAE,EAAE,WAAW,EAAE;IAChF,QAAQ,EAAE;QACT,OAAO,EAAE,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EAAE,GAAG;KACb;IACD,gBAAgB,EAAE;QACjB,QAAQ,EAAE,GAAG;KACb;IACD,mCAAmC,EAAE;QACpC,QAAQ,EAAE,GAAG;KACb;IACD,kCAAkC,EAAE;QACnC,QAAQ,EAAE,GAAG;KACb;CACD,CAAC;AAEF,MAAM,CAAC,IAAM,IAAI,GAAG;IACnB,KAAK,EAAE;QACN,MAAM,EAAE,CAAC;QACT,mBAAmB,EAAE,EAAE;KACvB;IACD,YAAY,EAAE,GAAG;CACjB,CAAC;AAEF,MAAM,CAAC,IAAM,OAAO,GAAG;IACtB,OAAO,EAAE;QACR,IAAI,EAAE,EAAE;KACR;CACD,CAAC;AAEF,MAAM,CAAC,IAAM,sBAAsB,GAAG,GAAG,CAAC;AAC1C,MAAM,CAAC,IAAM,wBAAwB,GAAG,GAAG,CAAC","sourcesContent":["import { Tools } from \"./tools\";\nimport {\n\tBaseChartOptions,\n\tAxisChartOptions,\n\tScatterChartOptions,\n\tLineChartOptions,\n\tBarChartOptions,\n\tStackedBarChartOptions,\n\tPieChartOptions,\n\tDonutChartOptions,\n\tBubbleChartOptions,\n\t// Components\n\tGridOptions,\n\tAxesOptions,\n\tTimeScaleOptions,\n\tTooltipOptions,\n\tAxisTooltipOptions,\n\tBarTooltipOptions,\n\tLegendOptions,\n\tLegendPositions,\n\tStackedBarOptions\n} from \"./interfaces\";\nimport enUSLocaleObject from \"date-fns/locale/en-US/index\";\n\n/*\n *****************************\n * User configurable options *\n *****************************\n */\n\n/**\n * Legend options\n */\nexport const legend: LegendOptions = {\n\tposition: LegendPositions.BOTTOM,\n\tclickable: true,\n\tenabled: true,\n\titems: {\n\t\tstatus: {\n\t\t\tACTIVE: 1,\n\t\t\tDISABLED: 0\n\t\t},\n\t\thorizontalSpace: 12,\n\t\tverticalSpace: 24,\n\t\ttextYOffset: 8\n\t},\n\tcheckbox: {\n\t\tradius: 6.5,\n\t\tspaceAfter: 4\n\t}\n};\n\n/**\n * Grid options\n */\nexport const grid: GridOptions = {\n\tx: {\n\t\tnumberOfTicks: 5\n\t},\n\ty: {\n\t\tnumberOfTicks: 5\n\t}\n};\n\n/**\n * Tooltip options\n */\nexport const baseTooltip: TooltipOptions = {\n\tdatapoint: {\n\t\thorizontalOffset: 10,\n\t\tenabled: true\n\t},\n\ttitle: {\n\t\tverticalOffset: .75,\n\t\twidth: .4\n\t}\n};\n\nexport const axisChartTooltip: AxisTooltipOptions = Tools.merge({}, baseTooltip, {\n\tgridline: {\n\t\tenabled: true,\n\t\tthreshold: 0.25\n\t}\n} as AxisTooltipOptions);\n\nexport const barChartTooltip: BarTooltipOptions = Tools.merge({}, axisChartTooltip, {\n\tdatapoint: {\n\t\tverticalOffset: 4\n\t},\n\tgridline: {\n\t\tenabled: false\n\t}\n} as BarTooltipOptions);\n\n// These options will be managed by Tools.mergeDefaultChartOptions\n// by removing the ones the user is not providing,\n// and by TwoDimensionalAxes.\nconst axes: AxesOptions = {\n\ttop: {\n\t\tincludeZero: true\n\t},\n\tbottom: {\n\t\tincludeZero: true\n\t},\n\tleft: {\n\t\tincludeZero: true\n\t},\n\tright: {\n\t\tincludeZero: true\n\t}\n};\n\nexport const timeScale: TimeScaleOptions = {\n\taddSpaceOnEdges: 1,\n\tshowDayName: false,\n\tlocaleObject: enUSLocaleObject,\n\ttimeIntervalFormats: {\n\t\t\"15seconds\": { primary: \"MMM d, pp\", secondary: \"pp\" },\n\t\t\"minute\": { primary: \"MMM d, p\", secondary: \"p\" },\n\t\t\"30minutes\": { primary: \"MMM d, p\", secondary: \"p\" },\n\t\t\"hourly\": { primary: \"MMM d, hh a\", secondary: \"hh a\" },\n\t\t\"daily\": { primary: \"MMM d\", secondary: \"d\" },\n\t\t\"weekly\": { primary: \"eee, MMM d\", secondary: \"eee\" },\n\t\t\"monthly\": { primary: \"MMM yyyy\", secondary: \"MMM\" },\n\t\t\"quarterly\": { primary: \"QQQ ''yy\", secondary: \"QQQ\" },\n\t\t\"yearly\": { primary: \"yyyy\", secondary: \"yyyy\" }\n\t}\n};\n\n/**\n * Base chart options common to any chart\n */\nconst chart: BaseChartOptions = {\n\twidth: null,\n\theight: null,\n\tresizable: true,\n\ttooltip: baseTooltip,\n\tlegend,\n\tstyle: {\n\t\tprefix: \"cc\"\n\t}\n};\n\n/**\n * Options common to any chart with an axis\n */\nconst axisChart: AxisChartOptions = Tools.merge({}, chart, {\n\taxes,\n\ttimeScale,\n\tgrid,\n\ttooltip: axisChartTooltip\n} as AxisChartOptions);\n\n/**\n * options specific to simple bar charts\n */\nconst baseBarChart: BarChartOptions = Tools.merge({}, axisChart, {\n\tbars: {\n\t\tmaxWidth: 16\n\t},\n\ttimeScale: Tools.merge(timeScale, {\n\t\taddSpaceOnEdges: 1\n\t} as TimeScaleOptions),\n\ttooltip: barChartTooltip,\n} as BarChartOptions);\n\n/**\n * options specific to simple bar charts\n */\nconst simpleBarChart: BarChartOptions = Tools.merge({}, baseBarChart, {\n\n} as BarChartOptions);\n\n/**\n * options specific to simple bar charts\n */\nconst groupedBarChart: BarChartOptions = Tools.merge({}, baseBarChart, {\n\n} as BarChartOptions);\n\n/**\n * options specific to stacked bar charts\n */\nconst stackedBarChart: StackedBarChartOptions = Tools.merge({}, baseBarChart, {\n\tbars: Tools.merge({}, baseBarChart.bars, {\n\t\tdividerSize: 1.5\n\t} as StackedBarOptions)\n} as BarChartOptions);\n\n/**\n * options specific to line charts\n */\nconst lineChart: LineChartOptions = Tools.merge({}, axisChart, {\n\tpoints: {\n\t\t// default point radius to 3\n\t\tradius: 3,\n\t\tfilled: false\n\t}\n} as LineChartOptions);\n\n/**\n * options specific to scatter charts\n */\nconst scatterChart: ScatterChartOptions = Tools.merge({}, axisChart, {\n\tpoints: {\n\t\t// default point radius to 4\n\t\tradius: 4,\n\t\tfillOpacity: 0.3,\n\t\tfilled: true\n\t}\n} as ScatterChartOptions);\n\n/**\n * options specific to bubble charts\n */\nconst bubbleChart: BubbleChartOptions = Tools.merge({}, axisChart, {\n\tbubble: {\n\t\tradiusRange: (chartSize, data) => {\n\t\t\tconst smallerChartDimension = Math.min(chartSize.width, chartSize.height);\n\t\t\treturn [\n\t\t\t\tsmallerChartDimension * 3 / 400,\n\t\t\t\tsmallerChartDimension * 25 / 400\n\t\t\t];\n\t\t},\n\t\tfillOpacity: 0.2\n\t}\n} as BubbleChartOptions);\n\n/**\n * options specific to pie charts\n */\nconst pieChart: PieChartOptions = Tools.merge({}, chart, {\n\tpie: {\n\t\tradiusOffset: -15,\n\t\tinnerRadius: 2,\n\t\tpadAngle: 0.007,\n\t\thoverArc: {\n\t\t\touterRadiusOffset: 3\n\t\t},\n\t\txOffset: 30,\n\t\tyOffset: 20,\n\t\tyOffsetCallout: 10,\n\t\tcallout: {\n\t\t\tminSliceDegree: 5,\n\t\t\toffsetX: 15,\n\t\t\toffsetY: 12,\n\t\t\thorizontalLineLength: 8,\n\t\t\ttextMargin: 2\n\t\t},\n\t\tlabels: {\n\t\t\tformatter: null\n\t\t}\n\t}\n} as PieChartOptions);\n\n/**\n * options specific to donut charts\n */\nconst donutChart: DonutChartOptions = Tools.merge({}, pieChart, {\n\tdonut: {\n\t\tcenter: {\n\t\t\tnumberFontSize: radius => Math.min((radius / 100) * 24, 24) + \"px\",\n\t\t\ttitleFontSize: radius => Math.min((radius / 100) * 15, 15) + \"px\",\n\t\t\ttitleYPosition: radius => Math.min((radius / 80) * 20, 20),\n\t\t\tnumberFormatter: number => Math.floor(number).toLocaleString()\n\t\t}\n\t}\n} as DonutChartOptions);\n\nexport const options = {\n\tchart,\n\taxisChart,\n\tsimpleBarChart,\n\tgroupedBarChart,\n\tstackedBarChart,\n\tbubbleChart,\n\tlineChart,\n\tscatterChart,\n\tpieChart,\n\tdonutChart\n};\n\n/**\n * Options for line behaviour\n */\nexport const lines = {\n\topacity: {\n\t\tunselected: 0.3,\n\t\tselected: 1\n\t}\n};\n\n/**\n * Base transition configuration\n */\nexport const transitions = {\n\tdefault: {\n\t\tduration: 300\n\t},\n\tpie_slice_mouseover: {\n\t\tduration: 100\n\t},\n\tpie_chart_titles: {\n\t\tduration: 375\n\t},\n\tgraph_element_mouseover_fill_update: {\n\t\tduration: 100\n\t},\n\tgraph_element_mouseout_fill_update: {\n\t\tduration: 100\n\t}\n};\n\nexport const axis = {\n\tticks: {\n\t\tnumber: 7,\n\t\trotateIfSmallerThan: 30\n\t},\n\tpaddingRatio: 0.1\n};\n\nexport const spacers = {\n\tdefault: {\n\t\tsize: 24\n\t}\n};\n\nexport const tickSpaceRatioVertical = 2.5;\nexport const tickSpaceRatioHorizontal = 3.5;\n"]}
1
+ {"version":3,"file":"configuration.js","sourceRoot":"","sources":["configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAkBN,eAAe,EAEf,MAAM,cAAc,CAAC;AACtB,OAAO,gBAAgB,MAAM,6BAA6B,CAAC;AAE3D;;;;GAIG;AAEH;;GAEG;AACH,MAAM,CAAC,IAAM,MAAM,GAAkB;IACpC,QAAQ,EAAE,eAAe,CAAC,MAAM;IAChC,SAAS,EAAE,IAAI;IACf,OAAO,EAAE,IAAI;IACb,KAAK,EAAE;QACN,MAAM,EAAE;YACP,MAAM,EAAE,CAAC;YACT,QAAQ,EAAE,CAAC;SACX;QACD,eAAe,EAAE,EAAE;QACnB,aAAa,EAAE,EAAE;QACjB,WAAW,EAAE,CAAC;KACd;IACD,QAAQ,EAAE;QACT,MAAM,EAAE,GAAG;QACX,UAAU,EAAE,CAAC;KACb;CACD,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,IAAM,IAAI,GAAgB;IAChC,CAAC,EAAE;QACF,aAAa,EAAE,CAAC;KAChB;IACD,CAAC,EAAE;QACF,aAAa,EAAE,CAAC;KAChB;CACD,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,IAAM,WAAW,GAAmB;IAC1C,SAAS,EAAE;QACV,gBAAgB,EAAE,EAAE;QACpB,OAAO,EAAE,IAAI;KACb;IACD,KAAK,EAAE;QACN,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AAQ,UAAA;IACR,UAAU,YAAA;CACV,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,IAAM,KAAK,GAAG;IACpB,OAAO,EAAE;QACR,UAAU,EAAE,GAAG;QACf,QAAQ,EAAE,CAAC;KACX;CACD,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,IAAM,WAAW,GAAG;IAC1B,OAAO,EAAE;QACR,QAAQ,EAAE,GAAG;KACb;IACD,mBAAmB,EAAE;QACpB,QAAQ,EAAE,GAAG;KACb;IACD,gBAAgB,EAAE;QACjB,QAAQ,EAAE,GAAG;KACb;IACD,mCAAmC,EAAE;QACpC,QAAQ,EAAE,GAAG;KACb;IACD,kCAAkC,EAAE;QACnC,QAAQ,EAAE,GAAG;KACb;CACD,CAAC;AAEF,MAAM,CAAC,IAAM,IAAI,GAAG;IACnB,KAAK,EAAE;QACN,MAAM,EAAE,CAAC;QACT,mBAAmB,EAAE,EAAE;KACvB;IACD,YAAY,EAAE,GAAG;CACjB,CAAC;AAEF,MAAM,CAAC,IAAM,OAAO,GAAG;IACtB,OAAO,EAAE;QACR,IAAI,EAAE,EAAE;KACR;CACD,CAAC;AAEF,MAAM,CAAC,IAAM,sBAAsB,GAAG,GAAG,CAAC;AAC1C,MAAM,CAAC,IAAM,wBAAwB,GAAG,GAAG,CAAC","sourcesContent":["import { Tools } from \"./tools\";\nimport {\n\tBaseChartOptions,\n\tAxisChartOptions,\n\tScatterChartOptions,\n\tLineChartOptions,\n\tBarChartOptions,\n\tStackedBarChartOptions,\n\tPieChartOptions,\n\tDonutChartOptions,\n\tBubbleChartOptions,\n\t// Components\n\tGridOptions,\n\tAxesOptions,\n\tTimeScaleOptions,\n\tTooltipOptions,\n\tAxisTooltipOptions,\n\tBarTooltipOptions,\n\tLegendOptions,\n\tLegendPositions,\n\tStackedBarOptions\n} from \"./interfaces\";\nimport enUSLocaleObject from \"date-fns/locale/en-US/index\";\n\n/*\n *****************************\n * User configurable options *\n *****************************\n */\n\n/**\n * Legend options\n */\nexport const legend: LegendOptions = {\n\tposition: LegendPositions.BOTTOM,\n\tclickable: true,\n\tenabled: true,\n\titems: {\n\t\tstatus: {\n\t\t\tACTIVE: 1,\n\t\t\tDISABLED: 0\n\t\t},\n\t\thorizontalSpace: 12,\n\t\tverticalSpace: 24,\n\t\ttextYOffset: 8\n\t},\n\tcheckbox: {\n\t\tradius: 6.5,\n\t\tspaceAfter: 4\n\t}\n};\n\n/**\n * Grid options\n */\nexport const grid: GridOptions = {\n\tx: {\n\t\tnumberOfTicks: 5\n\t},\n\ty: {\n\t\tnumberOfTicks: 5\n\t}\n};\n\n/**\n * Tooltip options\n */\nexport const baseTooltip: TooltipOptions = {\n\tdatapoint: {\n\t\thorizontalOffset: 10,\n\t\tenabled: true\n\t},\n\ttitle: {\n\t\tverticalOffset: .75,\n\t\twidth: .4\n\t}\n};\n\nexport const axisChartTooltip: AxisTooltipOptions = Tools.merge({}, baseTooltip, {\n\tgridline: {\n\t\tenabled: true,\n\t\tthreshold: 0.25\n\t}\n} as AxisTooltipOptions);\n\nexport const barChartTooltip: BarTooltipOptions = Tools.merge({}, axisChartTooltip, {\n\tdatapoint: {\n\t\tverticalOffset: 4\n\t},\n\tgridline: {\n\t\tenabled: false\n\t}\n} as BarTooltipOptions);\n\n// These options will be managed by Tools.mergeDefaultChartOptions\n// by removing the ones the user is not providing,\n// and by TwoDimensionalAxes.\nconst axes: AxesOptions = {\n\ttop: {\n\t\tincludeZero: true\n\t},\n\tbottom: {\n\t\tincludeZero: true\n\t},\n\tleft: {\n\t\tincludeZero: true\n\t},\n\tright: {\n\t\tincludeZero: true\n\t}\n};\n\nexport const timeScale: TimeScaleOptions = {\n\taddSpaceOnEdges: 1,\n\tshowDayName: false,\n\tlocaleObject: enUSLocaleObject,\n\ttimeIntervalFormats: {\n\t\t\"15seconds\": { primary: \"MMM d, pp\", secondary: \"pp\" },\n\t\t\"minute\": { primary: \"MMM d, p\", secondary: \"p\" },\n\t\t\"30minutes\": { primary: \"MMM d, p\", secondary: \"p\" },\n\t\t\"hourly\": { primary: \"MMM d, hh a\", secondary: \"hh a\" },\n\t\t\"daily\": { primary: \"MMM d\", secondary: \"d\" },\n\t\t\"weekly\": { primary: \"eee, MMM d\", secondary: \"eee\" },\n\t\t\"monthly\": { primary: \"MMM yyyy\", secondary: \"MMM\" },\n\t\t\"quarterly\": { primary: \"QQQ ''yy\", secondary: \"QQQ\" },\n\t\t\"yearly\": { primary: \"yyyy\", secondary: \"yyyy\" }\n\t}\n};\n\n/**\n * Base chart options common to any chart\n */\nconst chart: BaseChartOptions = {\n\twidth: null,\n\theight: null,\n\tresizable: true,\n\ttooltip: baseTooltip,\n\tlegend,\n\tstyle: {\n\t\tprefix: \"cc\"\n\t},\n\tdata: {\n\t\tgroupMapsTo: \"group\"\n\t},\n\tcolor: {\n\t\tscale: null\n\t}\n};\n\n/**\n * Options common to any chart with an axis\n */\nconst axisChart: AxisChartOptions = Tools.merge({}, chart, {\n\taxes,\n\ttimeScale,\n\tgrid,\n\ttooltip: axisChartTooltip\n} as AxisChartOptions);\n\n/**\n * options specific to simple bar charts\n */\nconst baseBarChart: BarChartOptions = Tools.merge({}, axisChart, {\n\tbars: {\n\t\tmaxWidth: 16\n\t},\n\ttimeScale: Tools.merge(timeScale, {\n\t\taddSpaceOnEdges: 1\n\t} as TimeScaleOptions),\n\ttooltip: barChartTooltip,\n} as BarChartOptions);\n\n/**\n * options specific to simple bar charts\n */\nconst simpleBarChart: BarChartOptions = Tools.merge({}, baseBarChart, {\n\n} as BarChartOptions);\n\n/**\n * options specific to simple bar charts\n */\nconst groupedBarChart: BarChartOptions = Tools.merge({}, baseBarChart, {\n\n} as BarChartOptions);\n\n/**\n * options specific to stacked bar charts\n */\nconst stackedBarChart: StackedBarChartOptions = Tools.merge({}, baseBarChart, {\n\tbars: Tools.merge({}, baseBarChart.bars, {\n\t\tdividerSize: 1.5\n\t} as StackedBarOptions)\n} as BarChartOptions);\n\n/**\n * options specific to line charts\n */\nconst lineChart: LineChartOptions = Tools.merge({}, axisChart, {\n\tpoints: {\n\t\t// default point radius to 3\n\t\tradius: 3,\n\t\tfilled: false\n\t}\n} as LineChartOptions);\n\n/**\n * options specific to scatter charts\n */\nconst scatterChart: ScatterChartOptions = Tools.merge({}, axisChart, {\n\tpoints: {\n\t\t// default point radius to 4\n\t\tradius: 4,\n\t\tfillOpacity: 0.3,\n\t\tfilled: true\n\t}\n} as ScatterChartOptions);\n\n/**\n * options specific to bubble charts\n */\nconst bubbleChart: BubbleChartOptions = Tools.merge({}, axisChart, {\n\tbubble: {\n\t\tradiusMapsTo: \"radius\",\n\t\tradiusRange: (chartSize, data) => {\n\t\t\tconst smallerChartDimension = Math.min(chartSize.width, chartSize.height);\n\t\t\treturn [\n\t\t\t\tsmallerChartDimension * 3 / 400,\n\t\t\t\tsmallerChartDimension * 25 / 400\n\t\t\t];\n\t\t},\n\t\tfillOpacity: 0.2\n\t}\n} as BubbleChartOptions);\n\n/**\n * options specific to pie charts\n */\nconst pieChart: PieChartOptions = Tools.merge({}, chart, {\n\tpie: {\n\t\tradiusOffset: -15,\n\t\tinnerRadius: 2,\n\t\tpadAngle: 0.007,\n\t\thoverArc: {\n\t\t\touterRadiusOffset: 3\n\t\t},\n\t\txOffset: 30,\n\t\tyOffset: 20,\n\t\tyOffsetCallout: 10,\n\t\tcallout: {\n\t\t\tminSliceDegree: 5,\n\t\t\toffsetX: 15,\n\t\t\toffsetY: 12,\n\t\t\thorizontalLineLength: 8,\n\t\t\ttextMargin: 2\n\t\t},\n\t\tlabels: {\n\t\t\tformatter: null\n\t\t}\n\t}\n} as PieChartOptions);\n\n/**\n * options specific to donut charts\n */\nconst donutChart: DonutChartOptions = Tools.merge({}, pieChart, {\n\tdonut: {\n\t\tcenter: {\n\t\t\tnumberFontSize: radius => Math.min((radius / 100) * 24, 24) + \"px\",\n\t\t\ttitleFontSize: radius => Math.min((radius / 100) * 15, 15) + \"px\",\n\t\t\ttitleYPosition: radius => Math.min((radius / 80) * 20, 20),\n\t\t\tnumberFormatter: number => Math.floor(number).toLocaleString()\n\t\t}\n\t}\n} as DonutChartOptions);\n\nexport const options = {\n\tchart,\n\taxisChart,\n\tsimpleBarChart,\n\tgroupedBarChart,\n\tstackedBarChart,\n\tbubbleChart,\n\tlineChart,\n\tscatterChart,\n\tpieChart,\n\tdonutChart\n};\n\n/**\n * Options for line behaviour\n */\nexport const lines = {\n\topacity: {\n\t\tunselected: 0.3,\n\t\tselected: 1\n\t}\n};\n\n/**\n * Base transition configuration\n */\nexport const transitions = {\n\tdefault: {\n\t\tduration: 300\n\t},\n\tpie_slice_mouseover: {\n\t\tduration: 100\n\t},\n\tpie_chart_titles: {\n\t\tduration: 375\n\t},\n\tgraph_element_mouseover_fill_update: {\n\t\tduration: 100\n\t},\n\tgraph_element_mouseout_fill_update: {\n\t\tduration: 100\n\t}\n};\n\nexport const axis = {\n\tticks: {\n\t\tnumber: 7,\n\t\trotateIfSmallerThan: 30\n\t},\n\tpaddingRatio: 0.1\n};\n\nexport const spacers = {\n\tdefault: {\n\t\tsize: 24\n\t}\n};\n\nexport const tickSpaceRatioVertical = 2.5;\nexport const tickSpaceRatioHorizontal = 3.5;\n"]}
@@ -1,57 +1,50 @@
1
1
  export declare const groupedBarData: {
2
- labels: string[];
3
- datasets: {
4
- label: string;
5
- data: number[];
6
- }[];
7
- };
2
+ group: string;
3
+ key: string;
4
+ value: number;
5
+ }[];
8
6
  export declare const groupedBarOptions: {
9
7
  title: string;
10
8
  axes: {
11
9
  left: {
12
- primary: boolean;
10
+ mapsTo: string;
13
11
  };
14
12
  bottom: {
15
13
  scaleType: string;
16
- secondary: boolean;
14
+ mapsTo: string;
17
15
  };
18
16
  };
19
17
  };
20
18
  export declare const groupedHorizontalBarData: {
21
- labels: string[];
22
- datasets: {
23
- label: string;
24
- data: number[];
25
- }[];
26
- };
19
+ group: string;
20
+ key: string;
21
+ value: number;
22
+ }[];
27
23
  export declare const groupedHorizontalBarOptions: {
28
24
  title: string;
29
25
  axes: {
30
26
  left: {
31
27
  scaleType: string;
32
- primary: boolean;
28
+ mapsTo: string;
33
29
  };
34
30
  bottom: {
35
- secondary: boolean;
31
+ mapsTo: string;
36
32
  };
37
33
  };
38
34
  };
39
35
  export declare const simpleBarData: {
40
- labels: string[];
41
- datasets: {
42
- label: string;
43
- data: number[];
44
- }[];
45
- };
36
+ group: string;
37
+ value: number;
38
+ }[];
46
39
  export declare const simpleBarOptions: {
47
40
  title: string;
48
41
  axes: {
49
42
  left: {
50
- primary: boolean;
43
+ mapsTo: string;
51
44
  };
52
45
  bottom: {
46
+ mapsTo: string;
53
47
  scaleType: string;
54
- secondary: boolean;
55
48
  };
56
49
  };
57
50
  };
@@ -59,53 +52,45 @@ export declare const simpleBarFixedDomainOptions: {
59
52
  title: string;
60
53
  axes: {
61
54
  left: {
62
- primary: boolean;
55
+ mapsTo: string;
63
56
  domain: number[];
64
57
  };
65
58
  bottom: {
66
59
  scaleType: string;
67
- secondary: boolean;
60
+ mapsTo: string;
68
61
  };
69
62
  };
70
63
  };
71
64
  export declare const simpleHorizontalBarData: {
72
- labels: string[];
73
- datasets: {
74
- label: string;
75
- data: number[];
76
- }[];
77
- };
65
+ group: string;
66
+ value: number;
67
+ }[];
78
68
  export declare const simpleHorizontalBarOptions: {
79
69
  title: string;
80
70
  axes: {
81
71
  left: {
82
- primary: boolean;
72
+ mapsTo: string;
83
73
  scaleType: string;
84
74
  };
85
75
  bottom: {
86
- secondary: boolean;
76
+ mapsTo: string;
87
77
  };
88
78
  };
89
79
  };
90
80
  export declare const simpleBarTimeSeriesData: {
91
- labels: string[];
92
- datasets: {
93
- label: string;
94
- data: {
95
- date: Date;
96
- value: number;
97
- }[];
98
- }[];
99
- };
81
+ group: string;
82
+ date: Date;
83
+ value: number;
84
+ }[];
100
85
  export declare const simpleBarTimeSeriesOptions: {
101
86
  title: string;
102
87
  axes: {
103
88
  left: {
104
- primary: boolean;
89
+ mapsTo: string;
105
90
  };
106
91
  bottom: {
92
+ mapsTo: string;
107
93
  scaleType: string;
108
- secondary: boolean;
109
94
  };
110
95
  };
111
96
  timeScale: {
@@ -116,84 +101,68 @@ export declare const simpleHorizontalBarTimeSeriesOptions: {
116
101
  title: string;
117
102
  axes: {
118
103
  left: {
104
+ mapsTo: string;
119
105
  scaleType: string;
120
- primary: boolean;
121
106
  };
122
107
  bottom: {
123
- secondary: boolean;
108
+ mapsTo: string;
124
109
  };
125
110
  };
126
111
  };
127
112
  export declare const simpleHorizontalBarTimeSeriesData: {
128
- labels: string[];
129
- datasets: {
130
- label: string;
131
- data: {
132
- date: Date;
133
- value: number;
134
- }[];
135
- }[];
136
- };
113
+ group: string;
114
+ date: Date;
115
+ value: number;
116
+ }[];
137
117
  export declare const stackedBarData: {
138
- labels: string[];
139
- datasets: {
140
- label: string;
141
- data: number[];
142
- }[];
143
- };
118
+ group: string;
119
+ key: string;
120
+ value: number;
121
+ }[];
144
122
  export declare const stackedBarOptions: {
145
123
  title: string;
146
124
  axes: {
147
125
  left: {
148
- primary: boolean;
126
+ mapsTo: string;
149
127
  stacked: boolean;
150
128
  };
151
129
  bottom: {
130
+ mapsTo: string;
152
131
  scaleType: string;
153
- secondary: boolean;
154
132
  };
155
133
  };
156
134
  };
157
135
  export declare const stackedHorizontalBarData: {
158
- labels: string[];
159
- datasets: {
160
- label: string;
161
- data: number[];
162
- }[];
163
- };
136
+ group: string;
137
+ key: string;
138
+ value: number;
139
+ }[];
164
140
  export declare const stackedHorizontalBarOptions: {
165
141
  title: string;
166
142
  axes: {
167
143
  left: {
168
144
  scaleType: string;
169
- primary: boolean;
170
145
  };
171
146
  bottom: {
172
147
  stacked: boolean;
173
- secondary: boolean;
174
148
  };
175
149
  };
176
150
  };
177
151
  export declare const stackedBarTimeSeriesData: {
178
- labels: string[];
179
- datasets: {
180
- label: string;
181
- data: {
182
- date: Date;
183
- value: number;
184
- }[];
185
- }[];
186
- };
152
+ group: string;
153
+ date: Date;
154
+ value: number;
155
+ }[];
187
156
  export declare const stackedBarTimeSeriesOptions: {
188
157
  title: string;
189
158
  axes: {
190
159
  left: {
191
- primary: boolean;
160
+ mapsTo: string;
192
161
  stacked: boolean;
193
162
  };
194
163
  bottom: {
164
+ mapsTo: string;
195
165
  scaleType: string;
196
- secondary: boolean;
197
166
  };
198
167
  };
199
168
  };
@@ -201,22 +170,15 @@ export declare const stackedHorizontalBarTimeSeriesOptions: {
201
170
  title: string;
202
171
  axes: {
203
172
  left: {
204
- primary: boolean;
205
173
  scaleType: string;
206
174
  };
207
175
  bottom: {
208
176
  stacked: boolean;
209
- secondary: boolean;
210
177
  };
211
178
  };
212
179
  };
213
180
  export declare const stackedHorizontalBarTimeSeriesData: {
214
- labels: string[];
215
- datasets: {
216
- label: string;
217
- data: {
218
- date: Date;
219
- value: number;
220
- }[];
221
- }[];
222
- };
181
+ group: string;
182
+ date: Date;
183
+ value: number;
184
+ }[];