@carbon/charts 0.33.0 → 0.34.2

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 (167) hide show
  1. package/CHANGELOG.md +45 -1
  2. package/axis-chart.d.ts +2 -2
  3. package/axis-chart.js +6 -4
  4. package/axis-chart.js.map +1 -1
  5. package/build/demo/data/bar.d.ts +12 -48
  6. package/build/demo/data/bubble.d.ts +1 -0
  7. package/build/src/axis-chart.d.ts +2 -2
  8. package/build/src/chart.d.ts +2 -2
  9. package/build/src/components/axes/ruler-stacked-bar.d.ts +4 -0
  10. package/build/src/components/axes/ruler.d.ts +6 -1
  11. package/build/src/components/essentials/tooltip-axis.d.ts +4 -0
  12. package/build/src/components/essentials/tooltip.d.ts +4 -10
  13. package/build/src/components/index.d.ts +2 -4
  14. package/build/src/configuration.d.ts +1 -3
  15. package/build/src/interfaces/a11y.d.ts +2 -1
  16. package/build/src/interfaces/charts.d.ts +1 -3
  17. package/build/src/interfaces/components.d.ts +7 -52
  18. package/build/src/interfaces/enums.d.ts +0 -10
  19. package/build/src/interfaces/events.d.ts +1 -0
  20. package/build/src/services/scales-cartesian.d.ts +6 -1
  21. package/bundle.js +1 -1
  22. package/chart.d.ts +2 -2
  23. package/chart.js +2 -1
  24. package/chart.js.map +1 -1
  25. package/charts/area-stacked.js +1 -3
  26. package/charts/area-stacked.js.map +1 -1
  27. package/charts/area.js +1 -2
  28. package/charts/area.js.map +1 -1
  29. package/charts/bar-grouped.js +1 -2
  30. package/charts/bar-grouped.js.map +1 -1
  31. package/charts/bar-simple.js +1 -2
  32. package/charts/bar-simple.js.map +1 -1
  33. package/charts/bar-stacked.js +2 -2
  34. package/charts/bar-stacked.js.map +1 -1
  35. package/charts/bubble.js +1 -2
  36. package/charts/bubble.js.map +1 -1
  37. package/charts/donut.js +1 -2
  38. package/charts/donut.js.map +1 -1
  39. package/charts/gauge.js +1 -2
  40. package/charts/gauge.js.map +1 -1
  41. package/charts/line.js +1 -2
  42. package/charts/line.js.map +1 -1
  43. package/charts/pie.js +1 -4
  44. package/charts/pie.js.map +1 -1
  45. package/charts/radar.js +0 -3
  46. package/charts/radar.js.map +1 -1
  47. package/charts/scatter.js +1 -2
  48. package/charts/scatter.js.map +1 -1
  49. package/components/axes/axis.js +23 -8
  50. package/components/axes/axis.js.map +1 -1
  51. package/components/axes/grid.js.map +1 -1
  52. package/components/axes/ruler-stacked-bar.d.ts +4 -0
  53. package/components/axes/ruler-stacked-bar.js +26 -0
  54. package/components/axes/ruler-stacked-bar.js.map +1 -0
  55. package/components/axes/ruler.d.ts +6 -1
  56. package/components/axes/ruler.js +25 -13
  57. package/components/axes/ruler.js.map +1 -1
  58. package/components/essentials/legend.js +15 -14
  59. package/components/essentials/legend.js.map +1 -1
  60. package/components/essentials/threshold.js +2 -2
  61. package/components/essentials/threshold.js.map +1 -1
  62. package/components/essentials/title.js +10 -9
  63. package/components/essentials/title.js.map +1 -1
  64. package/components/essentials/tooltip-axis.d.ts +4 -0
  65. package/components/essentials/tooltip-axis.js +120 -0
  66. package/components/essentials/tooltip-axis.js.map +1 -0
  67. package/components/essentials/tooltip.d.ts +4 -10
  68. package/components/essentials/tooltip.js +73 -100
  69. package/components/essentials/tooltip.js.map +1 -1
  70. package/components/graphs/area-stacked.js.map +1 -1
  71. package/components/graphs/bar-grouped.js +5 -3
  72. package/components/graphs/bar-grouped.js.map +1 -1
  73. package/components/graphs/bar-simple.js +4 -2
  74. package/components/graphs/bar-simple.js.map +1 -1
  75. package/components/graphs/bar-stacked.js +17 -14
  76. package/components/graphs/bar-stacked.js.map +1 -1
  77. package/components/graphs/pie.js +31 -12
  78. package/components/graphs/pie.js.map +1 -1
  79. package/components/graphs/radar.js +23 -18
  80. package/components/graphs/radar.js.map +1 -1
  81. package/components/graphs/scatter-stacked.js.map +1 -1
  82. package/components/graphs/scatter.js +18 -13
  83. package/components/graphs/scatter.js.map +1 -1
  84. package/components/graphs/skeleton.js +2 -5
  85. package/components/graphs/skeleton.js.map +1 -1
  86. package/components/index.d.ts +2 -4
  87. package/components/index.js +2 -4
  88. package/components/index.js.map +1 -1
  89. package/components/layout/layout.js +3 -1
  90. package/components/layout/layout.js.map +1 -1
  91. package/configuration.d.ts +1 -3
  92. package/configuration.js +6 -26
  93. package/configuration.js.map +1 -1
  94. package/demo/data/bar.d.ts +12 -48
  95. package/demo/data/bar.js +22 -58
  96. package/demo/data/bar.js.map +1 -1
  97. package/demo/data/bubble.d.ts +1 -0
  98. package/demo/data/bubble.js +2 -1
  99. package/demo/data/bubble.js.map +1 -1
  100. package/demo/data/bundle.js +1 -1
  101. package/demo/data/index.js +1 -1
  102. package/demo/data/index.js.map +1 -1
  103. package/demo/data/line.js +5 -5
  104. package/demo/data/line.js.map +1 -1
  105. package/demo/styles.css +48 -100
  106. package/demo/styles.css.map +1 -1
  107. package/demo/styles.min.css +1 -1
  108. package/demo/styles.min.css.map +1 -1
  109. package/demo/tsconfig.tsbuildinfo +16 -16
  110. package/interfaces/a11y.d.ts +2 -1
  111. package/interfaces/a11y.js +1 -0
  112. package/interfaces/a11y.js.map +1 -1
  113. package/interfaces/charts.d.ts +1 -3
  114. package/interfaces/charts.js.map +1 -1
  115. package/interfaces/components.d.ts +7 -52
  116. package/interfaces/components.js.map +1 -1
  117. package/interfaces/enums.d.ts +0 -10
  118. package/interfaces/enums.js +0 -11
  119. package/interfaces/enums.js.map +1 -1
  120. package/interfaces/events.d.ts +1 -0
  121. package/interfaces/events.js +1 -0
  122. package/interfaces/events.js.map +1 -1
  123. package/model.js +3 -5
  124. package/model.js.map +1 -1
  125. package/package.json +1 -1
  126. package/services/essentials/dom-utils.js +3 -1
  127. package/services/essentials/dom-utils.js.map +1 -1
  128. package/services/scales-cartesian.d.ts +6 -1
  129. package/services/scales-cartesian.js +20 -1
  130. package/services/scales-cartesian.js.map +1 -1
  131. package/styles/components/_ruler.scss +0 -6
  132. package/styles/components/_tooltip.scss +3 -9
  133. package/styles/graphs/_scatter-stacked.scss +10 -0
  134. package/styles/graphs/index.scss +1 -0
  135. package/styles-g10.css +13 -25
  136. package/styles-g10.css.map +1 -1
  137. package/styles-g10.min.css +1 -1
  138. package/styles-g10.min.css.map +1 -1
  139. package/styles-g100.css +13 -25
  140. package/styles-g100.css.map +1 -1
  141. package/styles-g100.min.css +1 -1
  142. package/styles-g100.min.css.map +1 -1
  143. package/styles-g90.css +13 -25
  144. package/styles-g90.css.map +1 -1
  145. package/styles-g90.min.css +1 -1
  146. package/styles-g90.min.css.map +1 -1
  147. package/styles.css +13 -25
  148. package/styles.css.map +1 -1
  149. package/styles.min.css +1 -1
  150. package/styles.min.css.map +1 -1
  151. package/tsconfig.tsbuildinfo +81 -138
  152. package/build/src/components/essentials/tooltip-bar.d.ts +0 -27
  153. package/build/src/components/essentials/tooltip-pie.d.ts +0 -5
  154. package/build/src/components/essentials/tooltip-radar.d.ts +0 -5
  155. package/build/src/components/essentials/tooltip-scatter.d.ts +0 -5
  156. package/components/essentials/tooltip-bar.d.ts +0 -27
  157. package/components/essentials/tooltip-bar.js +0 -193
  158. package/components/essentials/tooltip-bar.js.map +0 -1
  159. package/components/essentials/tooltip-pie.d.ts +0 -5
  160. package/components/essentials/tooltip-pie.js +0 -44
  161. package/components/essentials/tooltip-pie.js.map +0 -1
  162. package/components/essentials/tooltip-radar.d.ts +0 -5
  163. package/components/essentials/tooltip-radar.js +0 -45
  164. package/components/essentials/tooltip-radar.js.map +0 -1
  165. package/components/essentials/tooltip-scatter.d.ts +0 -5
  166. package/components/essentials/tooltip-scatter.js +0 -46
  167. package/components/essentials/tooltip-scatter.js.map +0 -1
@@ -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,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAE3C,SAAS;AACT,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,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,0BAA0B,CAAC;AACzC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAElC,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,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC","sourcesContent":["export * from \"./component\";\n\n// ESSENTIALS\nexport * from \"./essentials/legend\";\nexport * from \"./essentials/threshold\";\nexport * from \"./essentials/title\";\nexport * from \"./essentials/tooltip\";\nexport * from \"./essentials/tooltip-bar\";\nexport * from \"./essentials/tooltip-pie\";\nexport * from \"./essentials/tooltip-scatter\";\nexport * from \"./essentials/tooltip-radar\";\n\n// GRAPHS\nexport * from \"./graphs/area\";\nexport * from \"./graphs/area-stacked\";\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/scatter-stacked\";\nexport * from \"./graphs/pie\";\nexport * from \"./graphs/gauge\";\nexport * from \"./graphs/donut\";\nexport * from \"./graphs/skeleton\";\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/ruler\";\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,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAE1C,SAAS;AACT,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,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,0BAA0B,CAAC;AACzC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAElC,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,cAAc,CAAC;AAC7B,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC","sourcesContent":["export * from \"./component\";\n\n// ESSENTIALS\nexport * from \"./essentials/legend\";\nexport * from \"./essentials/threshold\";\nexport * from \"./essentials/title\";\nexport * from \"./essentials/tooltip\";\nexport * from \"./essentials/tooltip-axis\";\n\n// GRAPHS\nexport * from \"./graphs/area\";\nexport * from \"./graphs/area-stacked\";\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/scatter-stacked\";\nexport * from \"./graphs/pie\";\nexport * from \"./graphs/gauge\";\nexport * from \"./graphs/donut\";\nexport * from \"./graphs/skeleton\";\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/ruler\";\nexport * from \"./axes/ruler-stacked-bar\";\nexport * from \"./axes/zero-line\";\n"]}
@@ -125,7 +125,9 @@ var LayoutComponent = /** @class */ (function (_super) {
125
125
  var growth = Tools.getProperty(d, "data", "growth", "x");
126
126
  var matchingSVGDimensions = DOMUtils.getSVGElementSize(select(this), { useBBox: true });
127
127
  if (d.data.id === "legend") {
128
- var svgSize = DOMUtils.getSVGElementSize(select(this), { useAttrs: true });
128
+ var svgSize = DOMUtils.getSVGElementSize(select(this), {
129
+ useAttrs: true
130
+ });
129
131
  if (svgSize.height < 40) {
130
132
  matchingSVGDimensions.height = svgSize.height;
131
133
  }
@@ -1 +1 @@
1
- {"version":3,"file":"layout.js","sourceRoot":"","sources":["layout.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mBAAmB;AACnB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EACN,eAAe,EACf,YAAY,EAGZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG1C,aAAa;AACb,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE7E,8CAA8C;AAC9C;IAAqC,mCAAS;IAW7C,yBACC,KAAiB,EACjB,QAAa,EACb,QAAgC,E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,OAAO,CAAC,UAAC,KAAK;YAC3B,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,UAAC,SAAS;gBAClC,OAAA,SAAS,CAAC,WAAW,CAAC,MAAM,CAAC;YAA7B,CAA6B,CAC7B,CAAC;QACH,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,iCAAO,GAAP;QACC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAC,KAAK;YAC3B,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,UAAC,SAAS,IAAK,OAAA,SAAS,CAAC,OAAO,EAAE,EAAnB,CAAmB,CAAC,CAAC;QAC9D,CAAC,CAAC,CAAC;IACJ,CAAC;IAxOD,4CAA4C;IAC5C,iDAAiD;IAC1C,0BAAU,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,WAAW,CAAC,CAAC;IAuO7D,sBAAC;CAAA,AA1OD,CAAqC,SAAS,GA0O7C;SA1OY,eAAe","sourcesContent":["// Internal Imports\nimport { Component } from \"../component\";\nimport {\n\tLayoutDirection,\n\tLayoutGrowth,\n\tLayoutComponentChild,\n\tLayoutConfigs\n} from \"../../interfaces/index\";\nimport { Tools } from \"../../tools\";\nimport { DOMUtils } from \"../../services\";\nimport { ChartModel } from \"../../model\";\n\n// D3 Imports\nimport { select } from \"d3-selection\";\nimport { hierarchy, treemap, treemapSlice, treemapDice } from \"d3-hierarchy\";\n\n// TODO - What if there is no \"growth\" object?\nexport class LayoutComponent extends Component {\n\t// Give every layout component a distinct ID\n\t// so they don't interfere when querying elements\n\tstatic instanceID = Math.floor(Math.random() * 99999999999);\n\n\ttype = \"layout\";\n\n\tchildren: LayoutComponentChild[];\n\n\tprivate _instanceID: number;\n\n\tconstructor(\n\t\tmodel: ChartModel,\n\t\tservices: any,\n\t\tchildren: LayoutComponentChild[],\n\t\tconfigs?: LayoutConfigs\n\t) {\n\t\tsuper(model, services, configs);\n\n\t\tthis.configs = configs;\n\t\tthis.children = children;\n\n\t\tthis._instanceID = LayoutComponent.instanceID++;\n\n\t\t// Pass children data to the hierarchy layout\n\t\t// And calculate sum of sizes\n\t\tconst directionIsReversed =\n\t\t\tthis.configs.direction === LayoutDirection.ROW_REVERSE ||\n\t\t\tthis.configs.direction === LayoutDirection.COLUMN_REVERSE;\n\t\tif (directionIsReversed) {\n\t\t\tthis.children = this.children.reverse();\n\t\t}\n\t\tthis.init();\n\t}\n\n\tinit() {\n\t\tthis.children.forEach((child) => {\n\t\t\tchild.components.forEach((component) => {\n\t\t\t\tcomponent.init();\n\t\t\t});\n\t\t});\n\t}\n\n\tgetPreferedAndFixedSizeSum(): number {\n\t\tconst svg = this.parent;\n\t\tlet sum = 0;\n\n\t\tsvg.selectAll(`svg.layout-child-${this._instanceID}`)\n\t\t\t.filter((d: any) => {\n\t\t\t\tconst growth = Tools.getProperty(d, \"data\", \"growth\", \"x\");\n\t\t\t\treturn (\n\t\t\t\t\tgrowth === LayoutGrowth.PREFERRED ||\n\t\t\t\t\tgrowth === LayoutGrowth.FIXED\n\t\t\t\t);\n\t\t\t})\n\t\t\t.each(function (d: any) {\n\t\t\t\tsum += d.data.size;\n\t\t\t});\n\n\t\treturn sum;\n\t}\n\n\tgetNumOfStretchChildren(): number {\n\t\tconst svg = this.parent;\n\n\t\treturn svg\n\t\t\t.selectAll(`svg.layout-child-${this._instanceID}`)\n\t\t\t.filter((d: any) => {\n\t\t\t\tconst growth = Tools.getProperty(d, \"data\", \"growth\", \"x\");\n\t\t\t\treturn growth === LayoutGrowth.STRETCH;\n\t\t\t})\n\t\t\t.size();\n\t}\n\n\trender(animate = true) {\n\t\t// Get parent SVG to render inside of\n\t\tconst svg = this.parent;\n\t\tconst { width, height } = DOMUtils.getSVGElementSize(svg, {\n\t\t\tuseAttrs: true\n\t\t});\n\n\t\tlet root = hierarchy({\n\t\t\tchildren: this.children\n\t\t}).sum((d: any) => d.size);\n\n\t\t// Grab the correct treemap tile function based on direction\n\t\tconst tileType =\n\t\t\tthis.configs.direction === LayoutDirection.ROW ||\n\t\t\tthis.configs.direction === LayoutDirection.ROW_REVERSE\n\t\t\t\t? treemapDice\n\t\t\t\t: treemapSlice;\n\n\t\t// Compute the position of all elements within the layout\n\t\ttreemap().tile(tileType).size([width, height])(root);\n\n\t\t// TODORF - Remove\n\t\tconst horizontal =\n\t\t\tthis.configs.direction === LayoutDirection.ROW ||\n\t\t\tthis.configs.direction === LayoutDirection.ROW_REVERSE;\n\n\t\t// Add new SVGs to the DOM for each layout child\n\t\tconst updatedSVGs = svg\n\t\t\t.selectAll(`svg.layout-child-${this._instanceID}`)\n\t\t\t.data(root.leaves(), (d: any) => d.data.id);\n\n\t\tupdatedSVGs\n\t\t\t.attr(\"width\", (d: any) => d.x1 - d.x0)\n\t\t\t.attr(\"height\", (d: any) => d.y1 - d.y0);\n\n\t\tconst enteringSVGs = updatedSVGs\n\t\t\t.enter()\n\t\t\t.append(\"svg\")\n\t\t\t.attr(\n\t\t\t\t\"class\",\n\t\t\t\t(d: any) =>\n\t\t\t\t\t`layout-child layout-child-${this._instanceID} ${d.data.id}`\n\t\t\t)\n\t\t\t.attr(\"x\", (d: any) => d.x0)\n\t\t\t.attr(\"y\", (d: any) => d.y0);\n\n\t\tenteringSVGs\n\t\t\t.merge(svg.selectAll(`svg.layout-child-${this._instanceID}`))\n\t\t\t.each(function (d: any) {\n\t\t\t\t// Set parent component for each child\n\t\t\t\td.data.components.forEach((itemComponent) => {\n\t\t\t\t\titemComponent.setParent(select(this));\n\n\t\t\t\t\t// Render preffered & fixed items\n\t\t\t\t\tconst growth = Tools.getProperty(d, \"data\", \"growth\", \"x\");\n\t\t\t\t\tif (\n\t\t\t\t\t\tgrowth === LayoutGrowth.PREFERRED ||\n\t\t\t\t\t\tgrowth === LayoutGrowth.FIXED\n\t\t\t\t\t) {\n\t\t\t\t\t\titemComponent.render(animate);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\n\t\tsvg.selectAll(`svg.layout-child-${this._instanceID}`).each(function (\n\t\t\td: any\n\t\t) {\n\t\t\t// Calculate preffered children sizes after internal rendering\n\t\t\tconst growth = Tools.getProperty(d, \"data\", \"growth\", \"x\");\n\t\t\tconst matchingSVGDimensions = DOMUtils.getSVGElementSize(\n\t\t\t\tselect(this),\n\t\t\t\t{ useBBox: true }\n\t\t\t);\n\n\t\t\tif (d.data.id === \"legend\") {\n\t\t\t\tconst svgSize = DOMUtils.getSVGElementSize(\n\t\t\t\t\tselect(this),\n\t\t\t\t\t{ useAttrs: true }\n\t\t\t\t);\n\n\t\t\t\tif (svgSize.height < 40) {\n\t\t\t\t\tmatchingSVGDimensions.height = svgSize.height;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (growth === LayoutGrowth.PREFERRED) {\n\t\t\t\tconst matchingSVGWidth = horizontal\n\t\t\t\t\t? matchingSVGDimensions.width\n\t\t\t\t\t: matchingSVGDimensions.height;\n\t\t\t\tconst svgWidth = horizontal ? width : height;\n\n\t\t\t\td.data.size = (matchingSVGWidth / svgWidth) * 100;\n\t\t\t}\n\t\t});\n\n\t\tupdatedSVGs.exit().remove();\n\n\t\t// Run through stretch x-items\n\t\tthis.children\n\t\t\t.filter((child) => {\n\t\t\t\tconst growth = Tools.getProperty(child, \"growth\", \"x\");\n\t\t\t\treturn growth === LayoutGrowth.STRETCH;\n\t\t\t})\n\t\t\t.forEach((child, i) => {\n\t\t\t\tchild.size =\n\t\t\t\t\t(100 - +this.getPreferedAndFixedSizeSum()) /\n\t\t\t\t\t+this.getNumOfStretchChildren();\n\t\t\t});\n\n\t\t// Pass children data to the hierarchy layout\n\t\t// And calculate sum of sizes\n\t\troot = hierarchy({\n\t\t\tchildren: this.children\n\t\t}).sum((d: any) => d.size);\n\n\t\t// Compute the position of all elements within the layout\n\t\ttreemap().tile(tileType).size([width, height]).padding(0)(root);\n\n\t\t// Add new SVGs to the DOM for each layout child\n\t\tsvg.selectAll(`svg.layout-child-${this._instanceID}`)\n\t\t\t.data(root.leaves(), (d: any) => d.data.id)\n\t\t\t.attr(\"x\", (d: any) => d.x0)\n\t\t\t.attr(\"y\", (d: any) => d.y0)\n\t\t\t.attr(\"width\", (d: any) => d.x1 - d.x0)\n\t\t\t.attr(\"height\", (d: any) => d.y1 - d.y0)\n\t\t\t.each(function (d: any, i) {\n\t\t\t\td.data.components.forEach((itemComponent) => {\n\t\t\t\t\tconst growth = Tools.getProperty(d, \"data\", \"growth\", \"x\");\n\t\t\t\t\tif (growth === LayoutGrowth.STRETCH) {\n\t\t\t\t\t\titemComponent.render(animate);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t}\n\n\t// Pass on model to children as well\n\tsetModel(newObj) {\n\t\tsuper.setModel(newObj);\n\n\t\tthis.children.forEach((child) => {\n\t\t\tchild.components.forEach((component) => component.setModel(newObj));\n\t\t});\n\t}\n\n\t// Pass on essentials to children as well\n\tsetServices(newObj) {\n\t\tsuper.setServices(newObj);\n\n\t\tthis.children.forEach((child) => {\n\t\t\tchild.components.forEach((component) =>\n\t\t\t\tcomponent.setServices(newObj)\n\t\t\t);\n\t\t});\n\t}\n\n\tdestroy() {\n\t\tthis.children.forEach((child) => {\n\t\t\tchild.components.forEach((component) => component.destroy());\n\t\t});\n\t}\n}\n"]}
1
+ {"version":3,"file":"layout.js","sourceRoot":"","sources":["layout.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mBAAmB;AACnB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EACN,eAAe,EACf,YAAY,EAGZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG1C,aAAa;AACb,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE7E,8CAA8C;AAC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AM,WAAW,YAAC,MAAM,CAAC,CAAC;QAE1B,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAC,KAAK;YAC3B,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,UAAC,SAAS;gBAClC,OAAA,SAAS,CAAC,WAAW,CAAC,MAAM,CAAC;YAA7B,CAA6B,CAC7B,CAAC;QACH,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,iCAAO,GAAP;QACC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAC,KAAK;YAC3B,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,UAAC,SAAS,IAAK,OAAA,SAAS,CAAC,OAAO,EAAE,EAAnB,CAAmB,CAAC,CAAC;QAC9D,CAAC,CAAC,CAAC;IACJ,CAAC;IAvOD,4CAA4C;IAC5C,iDAAiD;IAC1C,0BAAU,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,WAAW,CAAC,CAAC;IAsO7D,sBAAC;CAAA,AAzOD,CAAqC,SAAS,GAyO7C;SAzOY,eAAe","sourcesContent":["// Internal Imports\nimport { Component } from \"../component\";\nimport {\n\tLayoutDirection,\n\tLayoutGrowth,\n\tLayoutComponentChild,\n\tLayoutConfigs\n} from \"../../interfaces/index\";\nimport { Tools } from \"../../tools\";\nimport { DOMUtils } from \"../../services\";\nimport { ChartModel } from \"../../model\";\n\n// D3 Imports\nimport { select } from \"d3-selection\";\nimport { hierarchy, treemap, treemapSlice, treemapDice } from \"d3-hierarchy\";\n\n// TODO - What if there is no \"growth\" object?\nexport class LayoutComponent extends Component {\n\t// Give every layout component a distinct ID\n\t// so they don't interfere when querying elements\n\tstatic instanceID = Math.floor(Math.random() * 99999999999);\n\n\ttype = \"layout\";\n\n\tchildren: LayoutComponentChild[];\n\n\tprivate _instanceID: number;\n\n\tconstructor(\n\t\tmodel: ChartModel,\n\t\tservices: any,\n\t\tchildren: LayoutComponentChild[],\n\t\tconfigs?: LayoutConfigs\n\t) {\n\t\tsuper(model, services, configs);\n\n\t\tthis.configs = configs;\n\t\tthis.children = children;\n\n\t\tthis._instanceID = LayoutComponent.instanceID++;\n\n\t\t// Pass children data to the hierarchy layout\n\t\t// And calculate sum of sizes\n\t\tconst directionIsReversed =\n\t\t\tthis.configs.direction === LayoutDirection.ROW_REVERSE ||\n\t\t\tthis.configs.direction === LayoutDirection.COLUMN_REVERSE;\n\t\tif (directionIsReversed) {\n\t\t\tthis.children = this.children.reverse();\n\t\t}\n\t\tthis.init();\n\t}\n\n\tinit() {\n\t\tthis.children.forEach((child) => {\n\t\t\tchild.components.forEach((component) => {\n\t\t\t\tcomponent.init();\n\t\t\t});\n\t\t});\n\t}\n\n\tgetPreferedAndFixedSizeSum(): number {\n\t\tconst svg = this.parent;\n\t\tlet sum = 0;\n\n\t\tsvg.selectAll(`svg.layout-child-${this._instanceID}`)\n\t\t\t.filter((d: any) => {\n\t\t\t\tconst growth = Tools.getProperty(d, \"data\", \"growth\", \"x\");\n\t\t\t\treturn (\n\t\t\t\t\tgrowth === LayoutGrowth.PREFERRED ||\n\t\t\t\t\tgrowth === LayoutGrowth.FIXED\n\t\t\t\t);\n\t\t\t})\n\t\t\t.each(function (d: any) {\n\t\t\t\tsum += d.data.size;\n\t\t\t});\n\n\t\treturn sum;\n\t}\n\n\tgetNumOfStretchChildren(): number {\n\t\tconst svg = this.parent;\n\n\t\treturn svg\n\t\t\t.selectAll(`svg.layout-child-${this._instanceID}`)\n\t\t\t.filter((d: any) => {\n\t\t\t\tconst growth = Tools.getProperty(d, \"data\", \"growth\", \"x\");\n\t\t\t\treturn growth === LayoutGrowth.STRETCH;\n\t\t\t})\n\t\t\t.size();\n\t}\n\n\trender(animate = true) {\n\t\t// Get parent SVG to render inside of\n\t\tconst svg = this.parent;\n\t\tconst { width, height } = DOMUtils.getSVGElementSize(svg, {\n\t\t\tuseAttrs: true\n\t\t});\n\n\t\tlet root = hierarchy({\n\t\t\tchildren: this.children\n\t\t}).sum((d: any) => d.size);\n\n\t\t// Grab the correct treemap tile function based on direction\n\t\tconst tileType =\n\t\t\tthis.configs.direction === LayoutDirection.ROW ||\n\t\t\tthis.configs.direction === LayoutDirection.ROW_REVERSE\n\t\t\t\t? treemapDice\n\t\t\t\t: treemapSlice;\n\n\t\t// Compute the position of all elements within the layout\n\t\ttreemap().tile(tileType).size([width, height])(root);\n\n\t\t// TODORF - Remove\n\t\tconst horizontal =\n\t\t\tthis.configs.direction === LayoutDirection.ROW ||\n\t\t\tthis.configs.direction === LayoutDirection.ROW_REVERSE;\n\n\t\t// Add new SVGs to the DOM for each layout child\n\t\tconst updatedSVGs = svg\n\t\t\t.selectAll(`svg.layout-child-${this._instanceID}`)\n\t\t\t.data(root.leaves(), (d: any) => d.data.id);\n\n\t\tupdatedSVGs\n\t\t\t.attr(\"width\", (d: any) => d.x1 - d.x0)\n\t\t\t.attr(\"height\", (d: any) => d.y1 - d.y0);\n\n\t\tconst enteringSVGs = updatedSVGs\n\t\t\t.enter()\n\t\t\t.append(\"svg\")\n\t\t\t.attr(\n\t\t\t\t\"class\",\n\t\t\t\t(d: any) =>\n\t\t\t\t\t`layout-child layout-child-${this._instanceID} ${d.data.id}`\n\t\t\t)\n\t\t\t.attr(\"x\", (d: any) => d.x0)\n\t\t\t.attr(\"y\", (d: any) => d.y0);\n\n\t\tenteringSVGs\n\t\t\t.merge(svg.selectAll(`svg.layout-child-${this._instanceID}`))\n\t\t\t.each(function (d: any) {\n\t\t\t\t// Set parent component for each child\n\t\t\t\td.data.components.forEach((itemComponent) => {\n\t\t\t\t\titemComponent.setParent(select(this));\n\n\t\t\t\t\t// Render preffered & fixed items\n\t\t\t\t\tconst growth = Tools.getProperty(d, \"data\", \"growth\", \"x\");\n\t\t\t\t\tif (\n\t\t\t\t\t\tgrowth === LayoutGrowth.PREFERRED ||\n\t\t\t\t\t\tgrowth === LayoutGrowth.FIXED\n\t\t\t\t\t) {\n\t\t\t\t\t\titemComponent.render(animate);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\n\t\tsvg.selectAll(`svg.layout-child-${this._instanceID}`).each(function (\n\t\t\td: any\n\t\t) {\n\t\t\t// Calculate preffered children sizes after internal rendering\n\t\t\tconst growth = Tools.getProperty(d, \"data\", \"growth\", \"x\");\n\t\t\tconst matchingSVGDimensions = DOMUtils.getSVGElementSize(\n\t\t\t\tselect(this),\n\t\t\t\t{ useBBox: true }\n\t\t\t);\n\n\t\t\tif (d.data.id === \"legend\") {\n\t\t\t\tconst svgSize = DOMUtils.getSVGElementSize(select(this), {\n\t\t\t\t\tuseAttrs: true\n\t\t\t\t});\n\n\t\t\t\tif (svgSize.height < 40) {\n\t\t\t\t\tmatchingSVGDimensions.height = svgSize.height;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (growth === LayoutGrowth.PREFERRED) {\n\t\t\t\tconst matchingSVGWidth = horizontal\n\t\t\t\t\t? matchingSVGDimensions.width\n\t\t\t\t\t: matchingSVGDimensions.height;\n\t\t\t\tconst svgWidth = horizontal ? width : height;\n\n\t\t\t\td.data.size = (matchingSVGWidth / svgWidth) * 100;\n\t\t\t}\n\t\t});\n\n\t\tupdatedSVGs.exit().remove();\n\n\t\t// Run through stretch x-items\n\t\tthis.children\n\t\t\t.filter((child) => {\n\t\t\t\tconst growth = Tools.getProperty(child, \"growth\", \"x\");\n\t\t\t\treturn growth === LayoutGrowth.STRETCH;\n\t\t\t})\n\t\t\t.forEach((child, i) => {\n\t\t\t\tchild.size =\n\t\t\t\t\t(100 - +this.getPreferedAndFixedSizeSum()) /\n\t\t\t\t\t+this.getNumOfStretchChildren();\n\t\t\t});\n\n\t\t// Pass children data to the hierarchy layout\n\t\t// And calculate sum of sizes\n\t\troot = hierarchy({\n\t\t\tchildren: this.children\n\t\t}).sum((d: any) => d.size);\n\n\t\t// Compute the position of all elements within the layout\n\t\ttreemap().tile(tileType).size([width, height]).padding(0)(root);\n\n\t\t// Add new SVGs to the DOM for each layout child\n\t\tsvg.selectAll(`svg.layout-child-${this._instanceID}`)\n\t\t\t.data(root.leaves(), (d: any) => d.data.id)\n\t\t\t.attr(\"x\", (d: any) => d.x0)\n\t\t\t.attr(\"y\", (d: any) => d.y0)\n\t\t\t.attr(\"width\", (d: any) => d.x1 - d.x0)\n\t\t\t.attr(\"height\", (d: any) => d.y1 - d.y0)\n\t\t\t.each(function (d: any, i) {\n\t\t\t\td.data.components.forEach((itemComponent) => {\n\t\t\t\t\tconst growth = Tools.getProperty(d, \"data\", \"growth\", \"x\");\n\t\t\t\t\tif (growth === LayoutGrowth.STRETCH) {\n\t\t\t\t\t\titemComponent.render(animate);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t}\n\n\t// Pass on model to children as well\n\tsetModel(newObj) {\n\t\tsuper.setModel(newObj);\n\n\t\tthis.children.forEach((child) => {\n\t\t\tchild.components.forEach((component) => component.setModel(newObj));\n\t\t});\n\t}\n\n\t// Pass on essentials to children as well\n\tsetServices(newObj) {\n\t\tsuper.setServices(newObj);\n\n\t\tthis.children.forEach((child) => {\n\t\t\tchild.components.forEach((component) =>\n\t\t\t\tcomponent.setServices(newObj)\n\t\t\t);\n\t\t});\n\t}\n\n\tdestroy() {\n\t\tthis.children.forEach((child) => {\n\t\t\tchild.components.forEach((component) => component.destroy());\n\t\t});\n\t}\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { BaseChartOptions, AxisChartOptions, ScatterChartOptions, LineChartOptions, BarChartOptions, StackedBarChartOptions, AreaChartOptions, PieChartOptions, GaugeChartOptions, DonutChartOptions, BubbleChartOptions, RadarChartOptions, GridOptions, TimeScaleOptions, TooltipOptions, AxisTooltipOptions, BarTooltipOptions, LegendOptions } from "./interfaces";
1
+ import { BaseChartOptions, AxisChartOptions, ScatterChartOptions, LineChartOptions, BarChartOptions, StackedBarChartOptions, AreaChartOptions, PieChartOptions, GaugeChartOptions, DonutChartOptions, BubbleChartOptions, RadarChartOptions, GridOptions, TimeScaleOptions, TooltipOptions, LegendOptions } from "./interfaces";
2
2
  /**
3
3
  * Legend options
4
4
  */
@@ -11,8 +11,6 @@ export declare const grid: GridOptions;
11
11
  * Tooltip options
12
12
  */
13
13
  export declare const baseTooltip: TooltipOptions;
14
- export declare const axisChartTooltip: AxisTooltipOptions;
15
- export declare const barChartTooltip: BarTooltipOptions;
16
14
  export declare const timeScale: TimeScaleOptions;
17
15
  export declare const options: {
18
16
  chart: BaseChartOptions;
package/configuration.js CHANGED
@@ -51,29 +51,11 @@ export var grid = {
51
51
  * Tooltip options
52
52
  */
53
53
  export var baseTooltip = {
54
- datapoint: {
55
- horizontalOffset: 10,
56
- enabled: true
57
- },
58
- title: {
59
- verticalOffset: 0.75,
60
- width: 0.4
61
- }
54
+ horizontalOffset: 10,
55
+ showTotal: true,
56
+ valueFormatter: function (d) { return d.toLocaleString(); },
57
+ truncation: standardTruncationOptions
62
58
  };
63
- export var axisChartTooltip = Tools.merge({}, baseTooltip, {
64
- gridline: {
65
- enabled: true,
66
- threshold: 0.02
67
- }
68
- });
69
- export var barChartTooltip = Tools.merge({}, axisChartTooltip, {
70
- datapoint: {
71
- verticalOffset: 4
72
- },
73
- gridline: {
74
- enabled: false
75
- }
76
- });
77
59
  // These options will be managed by Tools.mergeDefaultChartOptions
78
60
  // by removing the ones the user is not providing,
79
61
  // and by TwoDimensionalAxes.
@@ -138,8 +120,7 @@ var chart = {
138
120
  var axisChart = Tools.merge({}, chart, {
139
121
  axes: axes,
140
122
  timeScale: timeScale,
141
- grid: grid,
142
- tooltip: axisChartTooltip
123
+ grid: grid
143
124
  });
144
125
  /**
145
126
  * options specific to simple bar charts
@@ -150,8 +131,7 @@ var baseBarChart = Tools.merge({}, axisChart, {
150
131
  },
151
132
  timeScale: Tools.merge(timeScale, {
152
133
  addSpaceOnEdges: 1
153
- }),
154
- tooltip: barChartTooltip
134
+ })
155
135
  });
156
136
  /**
157
137
  * options specific to simple bar charts
@@ -1 +1 @@
1
- {"version":3,"file":"configuration.js","sourceRoot":"","sources":["configuration.ts"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AAK,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\tAreaChartOptions,\n\tPieChartOptions,\n\tGaugeChartOptions,\n\tDonutChartOptions,\n\tBubbleChartOptions,\n\tRadarChartOptions,\n\t// Components\n\tGridOptions,\n\tAxesOptions,\n\tTimeScaleOptions,\n\tTooltipOptions,\n\tAxisTooltipOptions,\n\tBarTooltipOptions,\n\tLegendOptions,\n\tLegendPositions,\n\tTruncationTypes,\n\tStackedBarOptions,\n\tGaugeTypes\n} from \"./interfaces\";\nimport enUSLocaleObject from \"date-fns/locale/en-US/index\";\n\n/*\n *****************************\n * User configurable options *\n *****************************\n */\n\n/**\n * Default truncation configuration\n */\nconst standardTruncationOptions = {\n\ttype: TruncationTypes.END_LINE,\n\tthreshold: 16,\n\tnumCharacter: 14\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\ttruncation: standardTruncationOptions\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: 0.75,\n\t\twidth: 0.4\n\t}\n};\n\nexport const axisChartTooltip: AxisTooltipOptions = Tools.merge(\n\t{},\n\tbaseTooltip,\n\t{\n\t\tgridline: {\n\t\t\tenabled: true,\n\t\t\tthreshold: 0.02\n\t\t}\n\t} as AxisTooltipOptions\n);\n\nexport const barChartTooltip: BarTooltipOptions = Tools.merge(\n\t{},\n\taxisChartTooltip,\n\t{\n\t\tdatapoint: {\n\t\t\tverticalOffset: 4\n\t\t},\n\t\tgridline: {\n\t\t\tenabled: false\n\t\t}\n\t} as BarTooltipOptions\n);\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\ttruncation: standardTruncationOptions\n\t},\n\tbottom: {\n\t\tincludeZero: true,\n\t\ttruncation: standardTruncationOptions\n\t},\n\tleft: {\n\t\tincludeZero: true,\n\t\ttruncation: standardTruncationOptions\n\t},\n\tright: {\n\t\tincludeZero: true,\n\t\ttruncation: standardTruncationOptions\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\tminute: { primary: \"MMM d, p\", secondary: \"p\" },\n\t\t\"30minutes\": { primary: \"MMM d, p\", secondary: \"p\" },\n\t\thourly: { primary: \"MMM d, hh a\", secondary: \"hh a\" },\n\t\tdaily: { primary: \"MMM d\", secondary: \"d\" },\n\t\tweekly: { primary: \"eee, MMM d\", secondary: \"eee\" },\n\t\tmonthly: { primary: \"MMM yyyy\", secondary: \"MMM\" },\n\t\tquarterly: { primary: \"QQQ ''yy\", secondary: \"QQQ\" },\n\t\tyearly: { 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\tloading: false,\n\t\tselectedGroups: []\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(\n\t{},\n\tbaseBarChart,\n\t{} as BarChartOptions\n);\n\n/**\n * options specific to simple bar charts\n */\nconst groupedBarChart: BarChartOptions = Tools.merge(\n\t{},\n\tbaseBarChart,\n\t{} as BarChartOptions\n);\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 area charts\n */\nconst areaChart: AreaChartOptions = Tools.merge({}, lineChart, {\n\ttimeScale: Tools.merge(timeScale, {\n\t\taddSpaceOnEdges: 0\n\t} as TimeScaleOptions)\n} as LineChartOptions);\n\n/**\n * options specific to stacked area charts\n */\nconst stackedAreaChart = areaChart;\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(\n\t\t\t\tchartSize.width,\n\t\t\t\tchartSize.height\n\t\t\t);\n\t\t\treturn [\n\t\t\t\t(smallerChartDimension * 3) / 400,\n\t\t\t\t(smallerChartDimension * 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 gauge charts\n */\nconst gaugeChart: GaugeChartOptions = Tools.merge({}, chart, {\n\tlegend: {\n\t\tenabled: false\n\t},\n\tgauge: {\n\t\ttype: GaugeTypes.SEMI,\n\t\tarcWidth: 16,\n\t\tdeltaArrow: {\n\t\t\tsize: (radius) => radius / 8,\n\t\t\tenabled: true\n\t\t},\n\t\tstatus: null,\n\t\tnumberSpacing: 10,\n\t\tdeltaFontSize: (radius) => radius / 8,\n\t\tvalueFontSize: (radius) => radius / 2.5,\n\t\tnumberFormatter: (number) =>\n\t\t\tnumber.toFixed(2) % 1 !== 0\n\t\t\t\t? number.toFixed(2).toLocaleString()\n\t\t\t\t: number.toFixed().toLocaleString()\n\t}\n} as GaugeChartOptions);\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) =>\n\t\t\t\tMath.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\n/**\n * options specific to radar charts\n */\nconst radarChart: RadarChartOptions = Tools.merge({}, chart, {\n\tradar: {\n\t\taxes: {\n\t\t\tangle: \"key\",\n\t\t\tvalue: \"value\"\n\t\t},\n\t\topacity: {\n\t\t\tunselected: 0.1,\n\t\t\tselected: 0.3\n\t\t},\n\t\txLabelPadding: 10,\n\t\tyLabelPadding: 8,\n\t\tyTicksNumber: 4,\n\t\tminRange: 10,\n\t\txAxisRectHeight: 50,\n\t\tdotsRadius: 5\n\t},\n\ttooltip: {\n\t\tgridline: {\n\t\t\tenabled: true\n\t\t},\n\t\tvalueFormatter: (value) =>\n\t\t\tvalue !== null && value !== undefined ? value : \"N/A\"\n\t}\n} as RadarChartOptions);\n\nexport const options = {\n\tchart,\n\taxisChart,\n\tsimpleBarChart,\n\tgroupedBarChart,\n\tstackedBarChart,\n\tbubbleChart,\n\tlineChart,\n\tareaChart,\n\tstackedAreaChart,\n\tscatterChart,\n\tpieChart,\n\tdonutChart,\n\tradarChart,\n\tgaugeChart\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 * Options for area behaviour\n */\nexport const area = {\n\topacity: {\n\t\tunselected: 0,\n\t\tselected: 0.4\n\t}\n};\n\n/**\n * Options for area behaviour\n */\nexport const areas = {\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,EAmBN,eAAe,EACf,eAAe,EAEf,UAAU,EACV,MAAM,cAAc,CAAC;AACtB,OAAO,gBAAgB,MAAM,6BAA6B,CAAC;AAE3D;;;;GAIG;AAEH;;GAEG;AACH,IAAM,yBAAyB,GAAG;IACjC,IAAI,EAAE,eAAe,CAAC,QAAQ;IAC9B,SAAS,EAAE,EAAE;IACb,YAAY,EAAE,EAAE;CAChB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,IAAM,MAAM,GAAkB;IACpC,QAAQ,EAAE,eAAe,CAAC,MAAM;IAChC,SA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,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\tAreaChartOptions,\n\tPieChartOptions,\n\tGaugeChartOptions,\n\tDonutChartOptions,\n\tBubbleChartOptions,\n\tRadarChartOptions,\n\t// Components\n\tGridOptions,\n\tAxesOptions,\n\tTimeScaleOptions,\n\tTooltipOptions,\n\tLegendOptions,\n\tLegendPositions,\n\tTruncationTypes,\n\tStackedBarOptions,\n\tGaugeTypes\n} from \"./interfaces\";\nimport enUSLocaleObject from \"date-fns/locale/en-US/index\";\n\n/*\n *****************************\n * User configurable options *\n *****************************\n */\n\n/**\n * Default truncation configuration\n */\nconst standardTruncationOptions = {\n\ttype: TruncationTypes.END_LINE,\n\tthreshold: 16,\n\tnumCharacter: 14\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\ttruncation: standardTruncationOptions\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\thorizontalOffset: 10,\n\tshowTotal: true,\n\tvalueFormatter: (d) => d.toLocaleString(),\n\ttruncation: standardTruncationOptions\n};\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\ttruncation: standardTruncationOptions\n\t},\n\tbottom: {\n\t\tincludeZero: true,\n\t\ttruncation: standardTruncationOptions\n\t},\n\tleft: {\n\t\tincludeZero: true,\n\t\ttruncation: standardTruncationOptions\n\t},\n\tright: {\n\t\tincludeZero: true,\n\t\ttruncation: standardTruncationOptions\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\tminute: { primary: \"MMM d, p\", secondary: \"p\" },\n\t\t\"30minutes\": { primary: \"MMM d, p\", secondary: \"p\" },\n\t\thourly: { primary: \"MMM d, hh a\", secondary: \"hh a\" },\n\t\tdaily: { primary: \"MMM d\", secondary: \"d\" },\n\t\tweekly: { primary: \"eee, MMM d\", secondary: \"eee\" },\n\t\tmonthly: { primary: \"MMM yyyy\", secondary: \"MMM\" },\n\t\tquarterly: { primary: \"QQQ ''yy\", secondary: \"QQQ\" },\n\t\tyearly: { 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\tloading: false,\n\t\tselectedGroups: []\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} 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} as BarChartOptions);\n\n/**\n * options specific to simple bar charts\n */\nconst simpleBarChart: BarChartOptions = Tools.merge(\n\t{},\n\tbaseBarChart,\n\t{} as BarChartOptions\n);\n\n/**\n * options specific to simple bar charts\n */\nconst groupedBarChart: BarChartOptions = Tools.merge(\n\t{},\n\tbaseBarChart,\n\t{} as BarChartOptions\n);\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 area charts\n */\nconst areaChart: AreaChartOptions = Tools.merge({}, lineChart, {\n\ttimeScale: Tools.merge(timeScale, {\n\t\taddSpaceOnEdges: 0\n\t} as TimeScaleOptions)\n} as LineChartOptions);\n\n/**\n * options specific to stacked area charts\n */\nconst stackedAreaChart = areaChart;\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(\n\t\t\t\tchartSize.width,\n\t\t\t\tchartSize.height\n\t\t\t);\n\t\t\treturn [\n\t\t\t\t(smallerChartDimension * 3) / 400,\n\t\t\t\t(smallerChartDimension * 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 gauge charts\n */\nconst gaugeChart: GaugeChartOptions = Tools.merge({}, chart, {\n\tlegend: {\n\t\tenabled: false\n\t},\n\tgauge: {\n\t\ttype: GaugeTypes.SEMI,\n\t\tarcWidth: 16,\n\t\tdeltaArrow: {\n\t\t\tsize: (radius) => radius / 8,\n\t\t\tenabled: true\n\t\t},\n\t\tstatus: null,\n\t\tnumberSpacing: 10,\n\t\tdeltaFontSize: (radius) => radius / 8,\n\t\tvalueFontSize: (radius) => radius / 2.5,\n\t\tnumberFormatter: (number) =>\n\t\t\tnumber.toFixed(2) % 1 !== 0\n\t\t\t\t? number.toFixed(2).toLocaleString()\n\t\t\t\t: number.toFixed().toLocaleString()\n\t}\n} as GaugeChartOptions);\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) =>\n\t\t\t\tMath.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\n/**\n * options specific to radar charts\n */\nconst radarChart: RadarChartOptions = Tools.merge({}, chart, {\n\tradar: {\n\t\taxes: {\n\t\t\tangle: \"key\",\n\t\t\tvalue: \"value\"\n\t\t},\n\t\topacity: {\n\t\t\tunselected: 0.1,\n\t\t\tselected: 0.3\n\t\t},\n\t\txLabelPadding: 10,\n\t\tyLabelPadding: 8,\n\t\tyTicksNumber: 4,\n\t\tminRange: 10,\n\t\txAxisRectHeight: 50,\n\t\tdotsRadius: 5\n\t},\n\ttooltip: {\n\t\tgridline: {\n\t\t\tenabled: true\n\t\t},\n\t\tvalueFormatter: (value) =>\n\t\t\tvalue !== null && value !== undefined ? value : \"N/A\"\n\t}\n} as RadarChartOptions);\n\nexport const options = {\n\tchart,\n\taxisChart,\n\tsimpleBarChart,\n\tgroupedBarChart,\n\tstackedBarChart,\n\tbubbleChart,\n\tlineChart,\n\tareaChart,\n\tstackedAreaChart,\n\tscatterChart,\n\tpieChart,\n\tdonutChart,\n\tradarChart,\n\tgaugeChart\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 * Options for area behaviour\n */\nexport const area = {\n\topacity: {\n\t\tunselected: 0,\n\t\tselected: 0.4\n\t}\n};\n\n/**\n * Options for area behaviour\n */\nexport const areas = {\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"]}
@@ -257,12 +257,9 @@ export declare const simpleBarEmptyStateData: any[];
257
257
  export declare const simpleBarEmptyStateOptions: {
258
258
  title: string;
259
259
  axes: {
260
- left: {
261
- primary: boolean;
262
- };
260
+ left: {};
263
261
  bottom: {
264
262
  scaleType: string;
265
- secondary: boolean;
266
263
  };
267
264
  };
268
265
  };
@@ -270,12 +267,9 @@ export declare const simpleBarSkeletonData: any[];
270
267
  export declare const simpleBarSkeletonOptions: {
271
268
  title: string;
272
269
  axes: {
273
- left: {
274
- primary: boolean;
275
- };
270
+ left: {};
276
271
  bottom: {
277
272
  scaleType: string;
278
- secondary: boolean;
279
273
  };
280
274
  };
281
275
  data: {
@@ -286,12 +280,9 @@ export declare const groupedBarEmptyStateData: any[];
286
280
  export declare const groupedBarEmptyStateOptions: {
287
281
  title: string;
288
282
  axes: {
289
- left: {
290
- primary: boolean;
291
- };
283
+ left: {};
292
284
  bottom: {
293
285
  scaleType: string;
294
- secondary: boolean;
295
286
  };
296
287
  };
297
288
  };
@@ -299,12 +290,9 @@ export declare const groupedBarSkeletonData: any[];
299
290
  export declare const groupedBarSkeletonOptions: {
300
291
  title: string;
301
292
  axes: {
302
- left: {
303
- primary: boolean;
304
- };
293
+ left: {};
305
294
  bottom: {
306
295
  scaleType: string;
307
- secondary: boolean;
308
296
  };
309
297
  };
310
298
  data: {
@@ -315,12 +303,9 @@ export declare const stackedBarEmptyStateData: any[];
315
303
  export declare const stackedBarEmptyStateOptions: {
316
304
  title: string;
317
305
  axes: {
318
- left: {
319
- primary: boolean;
320
- };
306
+ left: {};
321
307
  bottom: {
322
308
  scaleType: string;
323
- secondary: boolean;
324
309
  };
325
310
  };
326
311
  };
@@ -328,12 +313,9 @@ export declare const stackedBarSkeletonData: any[];
328
313
  export declare const stackedBarSkeletonOptions: {
329
314
  title: string;
330
315
  axes: {
331
- left: {
332
- primary: boolean;
333
- };
316
+ left: {};
334
317
  bottom: {
335
318
  scaleType: string;
336
- secondary: boolean;
337
319
  };
338
320
  };
339
321
  data: {
@@ -345,12 +327,9 @@ export declare const simpleHorizontalBarEmptyStateOptions: {
345
327
  title: string;
346
328
  axes: {
347
329
  left: {
348
- primary: boolean;
349
330
  scaleType: string;
350
331
  };
351
- bottom: {
352
- secondary: boolean;
353
- };
332
+ bottom: {};
354
333
  };
355
334
  };
356
335
  export declare const simpleHorizontalBarSkeletonData: any[];
@@ -358,12 +337,9 @@ export declare const simpleHorizontalBarSkeletonOptions: {
358
337
  title: string;
359
338
  axes: {
360
339
  left: {
361
- primary: boolean;
362
340
  scaleType: string;
363
341
  };
364
- bottom: {
365
- secondary: boolean;
366
- };
342
+ bottom: {};
367
343
  };
368
344
  data: {
369
345
  loading: boolean;
@@ -374,12 +350,9 @@ export declare const groupedHorizontalBarEmptyStateOptions: {
374
350
  title: string;
375
351
  axes: {
376
352
  left: {
377
- primary: boolean;
378
353
  scaleType: string;
379
354
  };
380
- bottom: {
381
- secondary: boolean;
382
- };
355
+ bottom: {};
383
356
  };
384
357
  };
385
358
  export declare const groupedHorizontalBarSkeletonData: any[];
@@ -387,12 +360,9 @@ export declare const groupedHorizontalBarSkeletonOptions: {
387
360
  title: string;
388
361
  axes: {
389
362
  left: {
390
- primary: boolean;
391
363
  scaleType: string;
392
364
  };
393
- bottom: {
394
- secondary: boolean;
395
- };
365
+ bottom: {};
396
366
  };
397
367
  data: {
398
368
  loading: boolean;
@@ -403,12 +373,9 @@ export declare const stackedHorizontalBarEmptyStateOptions: {
403
373
  title: string;
404
374
  axes: {
405
375
  left: {
406
- primary: boolean;
407
376
  scaleType: string;
408
377
  };
409
- bottom: {
410
- secondary: boolean;
411
- };
378
+ bottom: {};
412
379
  };
413
380
  };
414
381
  export declare const stackedHorizontalBarSkeletonData: any[];
@@ -416,12 +383,9 @@ export declare const stackedHorizontalBarSkeletonOptions: {
416
383
  title: string;
417
384
  axes: {
418
385
  left: {
419
- primary: boolean;
420
386
  scaleType: string;
421
387
  };
422
- bottom: {
423
- secondary: boolean;
424
- };
388
+ bottom: {};
425
389
  };
426
390
  data: {
427
391
  loading: boolean;
package/demo/data/bar.js CHANGED
@@ -42,13 +42,13 @@ export var groupedBarSelectedGroupsOptions = {
42
42
  },
43
43
  axes: {
44
44
  left: {
45
- mapsTo: "value",
45
+ mapsTo: "value"
46
46
  },
47
47
  bottom: {
48
48
  scaleType: "labels",
49
- mapsTo: "key",
50
- },
51
- },
49
+ mapsTo: "key"
50
+ }
51
+ }
52
52
  };
53
53
  // Horizontal Grouped
54
54
  export var groupedHorizontalBarData = groupedBarData;
@@ -311,12 +311,9 @@ export var simpleBarEmptyStateData = [];
311
311
  export var simpleBarEmptyStateOptions = {
312
312
  title: "Simple bar (empty state)",
313
313
  axes: {
314
- left: {
315
- primary: true
316
- },
314
+ left: {},
317
315
  bottom: {
318
- scaleType: "labels",
319
- secondary: true
316
+ scaleType: "labels"
320
317
  }
321
318
  }
322
319
  };
@@ -325,12 +322,9 @@ export var simpleBarSkeletonData = [];
325
322
  export var simpleBarSkeletonOptions = {
326
323
  title: "Simple bar (skeleton)",
327
324
  axes: {
328
- left: {
329
- primary: true
330
- },
325
+ left: {},
331
326
  bottom: {
332
- scaleType: "labels",
333
- secondary: true
327
+ scaleType: "labels"
334
328
  }
335
329
  },
336
330
  data: {
@@ -342,12 +336,9 @@ export var groupedBarEmptyStateData = [];
342
336
  export var groupedBarEmptyStateOptions = {
343
337
  title: "Grouped bar (empty state)",
344
338
  axes: {
345
- left: {
346
- primary: true
347
- },
339
+ left: {},
348
340
  bottom: {
349
- scaleType: "labels",
350
- secondary: true
341
+ scaleType: "labels"
351
342
  }
352
343
  }
353
344
  };
@@ -356,12 +347,9 @@ export var groupedBarSkeletonData = [];
356
347
  export var groupedBarSkeletonOptions = {
357
348
  title: "Grouped bar (skeleton)",
358
349
  axes: {
359
- left: {
360
- primary: true
361
- },
350
+ left: {},
362
351
  bottom: {
363
- scaleType: "labels",
364
- secondary: true
352
+ scaleType: "labels"
365
353
  }
366
354
  },
367
355
  data: {
@@ -373,12 +361,9 @@ export var stackedBarEmptyStateData = [];
373
361
  export var stackedBarEmptyStateOptions = {
374
362
  title: "Stacked bar (empty state)",
375
363
  axes: {
376
- left: {
377
- primary: true
378
- },
364
+ left: {},
379
365
  bottom: {
380
- scaleType: "labels",
381
- secondary: true
366
+ scaleType: "labels"
382
367
  }
383
368
  }
384
369
  };
@@ -387,12 +372,9 @@ export var stackedBarSkeletonData = [];
387
372
  export var stackedBarSkeletonOptions = {
388
373
  title: "Stacked bar (skeleton)",
389
374
  axes: {
390
- left: {
391
- primary: true
392
- },
375
+ left: {},
393
376
  bottom: {
394
- scaleType: "labels",
395
- secondary: true
377
+ scaleType: "labels"
396
378
  }
397
379
  },
398
380
  data: {
@@ -405,12 +387,9 @@ export var simpleHorizontalBarEmptyStateOptions = {
405
387
  title: "Simple horizontal bar (empty state)",
406
388
  axes: {
407
389
  left: {
408
- primary: true,
409
390
  scaleType: "labels"
410
391
  },
411
- bottom: {
412
- secondary: true
413
- }
392
+ bottom: {}
414
393
  }
415
394
  };
416
395
  // simple horizontal bar - skeleton
@@ -419,12 +398,9 @@ export var simpleHorizontalBarSkeletonOptions = {
419
398
  title: "Simple horizontal bar (skeleton)",
420
399
  axes: {
421
400
  left: {
422
- primary: true,
423
401
  scaleType: "labels"
424
402
  },
425
- bottom: {
426
- secondary: true
427
- }
403
+ bottom: {}
428
404
  },
429
405
  data: {
430
406
  loading: true
@@ -436,12 +412,9 @@ export var groupedHorizontalBarEmptyStateOptions = {
436
412
  title: "Grouped horizontal bar (empty state)",
437
413
  axes: {
438
414
  left: {
439
- primary: true,
440
415
  scaleType: "labels"
441
416
  },
442
- bottom: {
443
- secondary: true
444
- }
417
+ bottom: {}
445
418
  }
446
419
  };
447
420
  // grouped horizontal bar - skeleton
@@ -450,12 +423,9 @@ export var groupedHorizontalBarSkeletonOptions = {
450
423
  title: "Grouped horizontal bar (skeleton)",
451
424
  axes: {
452
425
  left: {
453
- primary: true,
454
426
  scaleType: "labels"
455
427
  },
456
- bottom: {
457
- secondary: true
458
- }
428
+ bottom: {}
459
429
  },
460
430
  data: {
461
431
  loading: true
@@ -467,12 +437,9 @@ export var stackedHorizontalBarEmptyStateOptions = {
467
437
  title: "Stacked horizontal bar (empty state)",
468
438
  axes: {
469
439
  left: {
470
- primary: true,
471
440
  scaleType: "labels"
472
441
  },
473
- bottom: {
474
- secondary: true
475
- }
442
+ bottom: {}
476
443
  }
477
444
  };
478
445
  // stacked horizontal bar - skeleton
@@ -481,12 +448,9 @@ export var stackedHorizontalBarSkeletonOptions = {
481
448
  title: "Stacked horizontal bar (skeleton)",
482
449
  axes: {
483
450
  left: {
484
- primary: true,
485
451
  scaleType: "labels"
486
452
  },
487
- bottom: {
488
- secondary: true
489
- }
453
+ bottom: {}
490
454
  },
491
455
  data: {
492
456
  loading: true