@carbon/charts 0.53.2 → 0.54.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/build/demo/data/CHART_TYPES.d.ts +5 -0
  3. package/build/demo/data/heatmap.d.ts +96 -0
  4. package/build/demo/data/index.d.ts +1 -0
  5. package/build/src/charts/heatmap.d.ts +10 -0
  6. package/build/src/charts/index.d.ts +1 -0
  7. package/build/src/components/axes/axis.d.ts +7 -1
  8. package/build/src/components/axes/hover-axis.d.ts +10 -0
  9. package/build/src/components/axes/toolbar.d.ts +5 -1
  10. package/build/src/components/essentials/color-scale-legend.d.ts +11 -0
  11. package/build/src/components/graphs/heatmap.d.ts +25 -0
  12. package/build/src/components/index.d.ts +2 -0
  13. package/build/src/configuration-non-customizable.d.ts +12 -0
  14. package/build/src/configuration.d.ts +2 -1
  15. package/build/src/interfaces/charts.d.ts +35 -2
  16. package/build/src/interfaces/components.d.ts +19 -0
  17. package/build/src/interfaces/enums.d.ts +24 -1
  18. package/build/src/interfaces/events.d.ts +15 -2
  19. package/build/src/model/cartesian-charts.d.ts +8 -1
  20. package/build/src/model/heatmap.d.ts +57 -0
  21. package/build/src/services/scales-cartesian.d.ts +1 -0
  22. package/bundle.js +1 -1
  23. package/charts/heatmap.d.ts +10 -0
  24. package/charts/heatmap.js +138 -0
  25. package/charts/heatmap.js.map +1 -0
  26. package/charts/index.d.ts +1 -0
  27. package/charts/index.js +1 -0
  28. package/charts/index.js.map +1 -1
  29. package/components/axes/axis.d.ts +7 -1
  30. package/components/axes/axis.js +9 -2
  31. package/components/axes/axis.js.map +1 -1
  32. package/components/axes/hover-axis.d.ts +10 -0
  33. package/components/axes/hover-axis.js +235 -0
  34. package/components/axes/hover-axis.js.map +1 -0
  35. package/components/axes/toolbar.d.ts +5 -1
  36. package/components/axes/toolbar.js +100 -34
  37. package/components/axes/toolbar.js.map +1 -1
  38. package/components/axes/two-dimensional-axes.js +8 -3
  39. package/components/axes/two-dimensional-axes.js.map +1 -1
  40. package/components/essentials/color-scale-legend.d.ts +11 -0
  41. package/components/essentials/color-scale-legend.js +236 -0
  42. package/components/essentials/color-scale-legend.js.map +1 -0
  43. package/components/graphs/heatmap.d.ts +25 -0
  44. package/components/graphs/heatmap.js +369 -0
  45. package/components/graphs/heatmap.js.map +1 -0
  46. package/components/index.d.ts +2 -0
  47. package/components/index.js +2 -0
  48. package/components/index.js.map +1 -1
  49. package/configuration-non-customizable.d.ts +12 -0
  50. package/configuration-non-customizable.js +13 -0
  51. package/configuration-non-customizable.js.map +1 -1
  52. package/configuration.d.ts +2 -1
  53. package/configuration.js +13 -1
  54. package/configuration.js.map +1 -1
  55. package/demo/data/CHART_TYPES.d.ts +5 -0
  56. package/demo/data/CHART_TYPES.js +5 -0
  57. package/demo/data/CHART_TYPES.js.map +1 -1
  58. package/demo/data/bundle.js +1 -1
  59. package/demo/data/heatmap.d.ts +96 -0
  60. package/demo/data/heatmap.js +1135 -0
  61. package/demo/data/heatmap.js.map +1 -0
  62. package/demo/data/index.d.ts +1 -0
  63. package/demo/data/index.js +30 -0
  64. package/demo/data/index.js.map +1 -1
  65. package/demo/data/toolbar.js +12 -0
  66. package/demo/data/toolbar.js.map +1 -1
  67. package/demo/styles.css +16458 -9179
  68. package/demo/styles.css.map +1 -1
  69. package/demo/styles.min.css +1 -1
  70. package/demo/styles.min.css.map +1 -1
  71. package/demo/tsconfig.tsbuildinfo +19 -5
  72. package/interfaces/charts.d.ts +35 -2
  73. package/interfaces/charts.js.map +1 -1
  74. package/interfaces/components.d.ts +19 -0
  75. package/interfaces/components.js.map +1 -1
  76. package/interfaces/enums.d.ts +24 -1
  77. package/interfaces/enums.js +26 -0
  78. package/interfaces/enums.js.map +1 -1
  79. package/interfaces/events.d.ts +15 -2
  80. package/interfaces/events.js +14 -0
  81. package/interfaces/events.js.map +1 -1
  82. package/model/cartesian-charts.d.ts +8 -1
  83. package/model/cartesian-charts.js +4 -2
  84. package/model/cartesian-charts.js.map +1 -1
  85. package/model/heatmap.d.ts +57 -0
  86. package/model/heatmap.js +289 -0
  87. package/model/heatmap.js.map +1 -0
  88. package/package.json +1 -1
  89. package/services/scales-cartesian.d.ts +1 -0
  90. package/services/scales-cartesian.js +16 -0
  91. package/services/scales-cartesian.js.map +1 -1
  92. package/services/zoom.js +5 -0
  93. package/services/zoom.js.map +1 -1
  94. package/styles/color-palatte.scss +96 -0
  95. package/styles/colors.scss +35 -1
  96. package/styles/components/_axis.scss +41 -0
  97. package/styles/components/_color-legend.scss +24 -0
  98. package/styles/components/index.scss +1 -0
  99. package/styles/graphs/_heatmap.scss +70 -0
  100. package/styles/graphs/index.scss +1 -0
  101. package/styles-g10.css +2000 -179
  102. package/styles-g10.css.map +1 -1
  103. package/styles-g10.min.css +1 -1
  104. package/styles-g10.min.css.map +1 -1
  105. package/styles-g100.css +2003 -182
  106. package/styles-g100.css.map +1 -1
  107. package/styles-g100.min.css +1 -1
  108. package/styles-g100.min.css.map +1 -1
  109. package/styles-g90.css +2004 -180
  110. package/styles-g90.css.map +1 -1
  111. package/styles-g90.min.css +1 -1
  112. package/styles-g90.min.css.map +1 -1
  113. package/styles.css +2000 -179
  114. package/styles.css.map +1 -1
  115. package/styles.min.css +1 -1
  116. package/styles.min.css.map +1 -1
  117. package/tsconfig.tsbuildinfo +182 -59
@@ -1 +1 @@
1
- {"version":3,"file":"toolbar.js","sourceRoot":"","sources":["toolbar.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mBAAmB;AACnB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,aAAa;AACb,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC;IAA6B,2BAAS;IAAtC;Q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,CAAC;YACrJ,KAAK,mBAAmB,CAAC,QAAQ;gBAChC,OAAO,oNAC4I,CAAC;YACrJ,KAAK,mBAAmB,CAAC,UAAU;gBAClC,OAAO,iNAA+M,CAAC;YACxN,KAAK,mBAAmB,CAAC,eAAe;gBACvC,OAAO,oLAAgL,CAAC;YACzL,KAAK,mBAAmB,CAAC,iBAAiB;gBACzC,OAAO,gZAAgV,CAAC;YACzV,KAAK,mBAAmB,CAAC,UAAU;gBAClC,OAAO,iNAA+M,CAAC;YACxN,KAAK,mBAAmB,CAAC,UAAU;gBAClC,OAAO,iNAA+M,CAAC;YACxN,KAAK,mBAAmB,CAAC,UAAU;gBAClC,OAAO,iNAA+M,CAAC,CAAC,sBAAsB;YAC/O,sCAAsC;YAEtC;gBACC,MAAM,KAAK,CACV,sCAAsC,GAAG,WAAW,CACpD,CAAC;SACH;IACF,CAAC;IACF,cAAC;AAAD,CAAC,AApkBD,CAA6B,SAAS,GAokBrC","sourcesContent":["// Internal Imports\nimport { Component } from '../component';\nimport { Events, RenderTypes, ToolbarControlTypes } from '../../interfaces';\nimport { Tools } from '../../tools';\n\n// D3 Imports\nimport { select } from 'd3-selection';\n\nexport class Toolbar extends Component {\n\ttype = 'toolbar';\n\trenderType = RenderTypes.HTML;\n\n\t// overflow menu button to control background color\n\toverflowButton: any;\n\n\t// div options list element\n\toverflowMenu: any;\n\n\tinit() {\n\t\tconst bodyOnClickHandler = () => this.updateOverflowMenu(false);\n\n\t\t// Grab the tooltip element\n\t\tthis.services.events.addEventListener(\n\t\t\tEvents.Toolbar.SHOW_OVERFLOW_MENU,\n\t\t\t() => {\n\t\t\t\tthis.renderOverflowMenu();\n\n\t\t\t\t// hide overflow menu if user clicks on somewhere in web page\n\t\t\t\tdocument.body.addEventListener('click', bodyOnClickHandler);\n\t\t\t}\n\t\t);\n\n\t\t// listen to hide overflow menu event to hide the overflow menu\n\t\tthis.services.events.addEventListener(\n\t\t\tEvents.Toolbar.HIDE_OVERFLOW_MENU,\n\t\t\t() => {\n\t\t\t\t// // hide overflow menu if user clicks on somewhere in web page\n\t\t\t\tdocument.body.removeEventListener('click', bodyOnClickHandler);\n\t\t\t}\n\t\t);\n\t}\n\n\trender(animate = true) {\n\t\tconst container = this.getComponentContainer().attr('role', 'toolbar');\n\n\t\tconst isDataLoading = Tools.getProperty(\n\t\t\tthis.getOptions(),\n\t\t\t'data',\n\t\t\t'loading'\n\t\t);\n\n\t\tif (isDataLoading) {\n\t\t\tcontainer.html('');\n\t\t} else {\n\t\t\tif (!this.overflowMenu) {\n\t\t\t\tthis.overflowMenu = container\n\t\t\t\t\t.append('div')\n\t\t\t\t\t.attr(\n\t\t\t\t\t\t'class',\n\t\t\t\t\t\t'bx--overflow-menu-options bx--overflow-menu--flip'\n\t\t\t\t\t)\n\t\t\t\t\t.attr('tabindex', -1)\n\t\t\t\t\t.attr('role', 'menu')\n\t\t\t\t\t.html(`<ul></ul>`);\n\t\t\t}\n\n\t\t\t// get the toolbar buttons\n\t\t\tconst {\n\t\t\t\tbuttonList,\n\t\t\t\toverflowMenuItemList,\n\t\t\t} = this.getControlConfigs();\n\n\t\t\t// overflow button is required only if overflow menu item list is valid\n\t\t\tif (!!overflowMenuItemList) {\n\t\t\t\tbuttonList.push(this.getOverflowButtonConfig());\n\t\t\t}\n\n\t\t\tconst toolbarControls = container\n\t\t\t\t.selectAll('div.toolbar-control')\n\t\t\t\t.data(buttonList, (button) => button.id);\n\n\t\t\ttoolbarControls.exit().remove();\n\n\t\t\tconst enteringToolbarControls = toolbarControls\n\t\t\t\t.enter()\n\t\t\t\t.append('div')\n\t\t\t\t.attr('class', 'toolbar-control bx--overflow-menu')\n\t\t\t\t.attr('role', 'button');\n\n\t\t\tconst self = this;\n\t\t\tconst allToolbarControls = enteringToolbarControls\n\t\t\t\t.merge(toolbarControls)\n\t\t\t\t.classed('disabled', (d) =>\n\t\t\t\t\td.shouldBeDisabled ? d.shouldBeDisabled() : false\n\t\t\t\t)\n\t\t\t\t.attr('aria-disabled', (d) =>\n\t\t\t\t\td.shouldBeDisabled ? d.shouldBeDisabled() : false\n\t\t\t\t)\n\t\t\t\t.attr('aria-label', (d) => d.title)\n\t\t\t\t.html(\n\t\t\t\t\t(d) => `\n\t\t\t<button\n\t\t\t\tclass=\"bx--overflow-menu__trigger\"\n\t\t\t\taria-haspopup=\"true\" aria-expanded=\"false\" id=\"${this.services.domUtils.generateElementIDString(\n\t\t\t\t\t`control-${d.id}`\n\t\t\t\t)}\" aria-label=\"${d.title}\">\n\t\t\t\t<svg focusable=\"false\" preserveAspectRatio=\"xMidYMid meet\" style=\"will-change: transform; width: ${\n\t\t\t\t\td.iconWidth !== undefined ? d.iconWidth : '20px'\n\t\t\t\t}; height: ${\n\t\t\t\t\t\td.iconWidth !== undefined ? d.iconHeight : '20px'\n\t\t\t\t\t}\" xmlns=\"http://www.w3.org/2000/svg\" class=\"bx--overflow-menu__icon\" viewBox=\"0 0 32 32\" aria-hidden=\"true\">\n\t\t\t\t\t${d.iconSVGContent}\n\t\t\t\t</svg>\n\t\t\t</button>`\n\t\t\t\t)\n\t\t\t\t.each(function (d, index) {\n\t\t\t\t\tselect(this)\n\t\t\t\t\t\t.select('button')\n\t\t\t\t\t\t.on(\n\t\t\t\t\t\t\t'click',\n\t\t\t\t\t\t\t!d.shouldBeDisabled() ? d.clickFunction : null\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.on('keydown', (event: KeyboardEvent) => {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t(event.key && event.key === 'Enter') ||\n\t\t\t\t\t\t\t\tevent.key === ' '\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t\t\t\td.clickFunction();\n\t\t\t\t\t\t\t} else if (event.key && event.key === 'ArrowLeft') {\n\t\t\t\t\t\t\t\tself.focusOnPreviousEnabledToolbarItem(index);\n\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\tevent.key &&\n\t\t\t\t\t\t\t\tevent.key === 'ArrowRight'\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tself.focusOnNextEnabledToolbarItem(index);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t});\n\n\t\t\tthis.overflowButton = this.getComponentContainer().select(\n\t\t\t\t`button.bx--overflow-menu__trigger#${this.services.domUtils.generateElementIDString(\n\t\t\t\t\t'control-toolbar-overflow-menu'\n\t\t\t\t)}`\n\t\t\t);\n\t\t}\n\t}\n\n\trenderOverflowMenu() {\n\t\tconst { overflowMenuItemList } = this.getControlConfigs();\n\n\t\tconst overflowMenuControls = this.overflowMenu\n\t\t\t.select('ul')\n\t\t\t.selectAll('li.bx--overflow-menu-options__option')\n\t\t\t.data(overflowMenuItemList, (button) =>\n\t\t\t\tTools.getProperty(button, 'id')\n\t\t\t);\n\n\t\toverflowMenuControls.exit().remove();\n\n\t\tconst enteringOverflowMenuControls = overflowMenuControls\n\t\t\t.enter()\n\t\t\t.append('li')\n\t\t\t.attr('id', (d) =>\n\t\t\t\tthis.services.domUtils.generateElementIDString(\n\t\t\t\t\t`control-${d.id}`\n\t\t\t\t)\n\t\t\t)\n\t\t\t.attr('class', 'bx--overflow-menu-options__option')\n\t\t\t.attr('role', 'menuitem');\n\n\t\tenteringOverflowMenuControls\n\t\t\t.append('button')\n\t\t\t.attr('class', 'bx--overflow-menu-options__btn');\n\n\t\tenteringOverflowMenuControls\n\t\t\t.merge(overflowMenuControls)\n\t\t\t.classed('bx--overflow-menu-options__option--disabled', (d) =>\n\t\t\t\td.shouldBeDisabled()\n\t\t\t)\n\t\t\t.attr('aria-disabled', (d) => d.shouldBeDisabled())\n\t\t\t.selectAll('button')\n\t\t\t.text((d) => d.text);\n\t}\n\n\tisOverflowMenuOpen() {\n\t\treturn this.overflowMenu.classed('is-open');\n\t}\n\n\t// show/hide overflow menu\n\tupdateOverflowMenu(show: boolean) {\n\t\tthis.overflowMenu.classed('is-open', show);\n\n\t\t// update overflow button background\n\t\tif (this.overflowButton) {\n\t\t\tthis.overflowButton.attr('aria-expanded', show);\n\t\t\tselect(this.overflowButton.node().parentNode).classed(\n\t\t\t\t'bx--overflow-menu--open',\n\t\t\t\tshow\n\t\t\t);\n\t\t}\n\n\t\tif (show) {\n\t\t\tthis.services.events.dispatchEvent(\n\t\t\t\tEvents.Toolbar.SHOW_OVERFLOW_MENU\n\t\t\t);\n\t\t} else {\n\t\t\tthis.services.events.dispatchEvent(\n\t\t\t\tEvents.Toolbar.HIDE_OVERFLOW_MENU\n\t\t\t);\n\t\t}\n\t}\n\n\t// Toolbar controllers\n\tfocusOnPreviousEnabledToolbarItem(currentItemIndex) {\n\t\tconst buttonList = this.getToolbarButtonItems();\n\t\tlet previousItemIndex = buttonList.length;\n\n\t\tfor (let i = currentItemIndex - 1; i >= 0; i--) {\n\t\t\tconst previousButtonItem = buttonList[i];\n\t\t\tif (!previousButtonItem.shouldBeDisabled()) {\n\t\t\t\tpreviousItemIndex = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// only if previous enabled menu item found\n\t\tif (previousItemIndex < buttonList.length) {\n\t\t\tconst previousItemNode = select(\n\t\t\t\t`button#${this.services.domUtils.generateElementIDString(\n\t\t\t\t\t`control-${buttonList[previousItemIndex].id}`\n\t\t\t\t)}`\n\t\t\t).node();\n\t\t\tif ('focus' in previousItemNode) {\n\t\t\t\tpreviousItemNode.focus();\n\t\t\t}\n\t\t}\n\t}\n\n\tfocusOnNextEnabledToolbarItem(currentItemIndex) {\n\t\tconst buttonList = this.getToolbarButtonItems();\n\t\tlet nextItemIndex = -1;\n\n\t\tfor (let i = currentItemIndex + 1; i < buttonList.length; i++) {\n\t\t\tconst nextOverflowMenuItem = buttonList[i];\n\t\t\tif (!nextOverflowMenuItem.shouldBeDisabled()) {\n\t\t\t\tnextItemIndex = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// only if next enabled menu item found\n\t\tif (nextItemIndex > -1) {\n\t\t\tconst nextItemNode = select(\n\t\t\t\t`button#${this.services.domUtils.generateElementIDString(\n\t\t\t\t\t`control-${buttonList[nextItemIndex].id}`\n\t\t\t\t)}`\n\t\t\t).node();\n\n\t\t\tif ('focus' in nextItemNode) {\n\t\t\t\tnextItemNode.focus();\n\t\t\t}\n\t\t}\n\t}\n\n\tfocusOnPreviousEnabledMenuItem(currentItemIndex) {\n\t\tconst overflowMenuItems = this.getOverflowMenuItems();\n\t\tlet previousItemIndex = overflowMenuItems.length;\n\n\t\tfor (let i = currentItemIndex - 1; i >= 0; i--) {\n\t\t\tconst previousOverflowMenuItem = overflowMenuItems[i];\n\t\t\tif (!previousOverflowMenuItem.shouldBeDisabled()) {\n\t\t\t\tpreviousItemIndex = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// only if previous enabled menu item found\n\t\tif (previousItemIndex < overflowMenuItems.length) {\n\t\t\tconst previousItemNode = select(\n\t\t\t\t`#${this.services.domUtils.generateElementIDString(\n\t\t\t\t\t`control-${overflowMenuItems[previousItemIndex].id}`\n\t\t\t\t)} button`\n\t\t\t).node();\n\t\t\tif ('focus' in previousItemNode) {\n\t\t\t\tpreviousItemNode.focus();\n\t\t\t}\n\t\t}\n\t}\n\n\tfocusOnNextEnabledMenuItem(currentItemIndex) {\n\t\tconst overflowMenuItems = this.getOverflowMenuItems();\n\t\tlet nextItemIndex = -1;\n\n\t\tfor (let i = currentItemIndex + 1; i < overflowMenuItems.length; i++) {\n\t\t\tconst nextOverflowMenuItem = overflowMenuItems[i];\n\t\t\tif (!nextOverflowMenuItem.shouldBeDisabled()) {\n\t\t\t\tnextItemIndex = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// only if next enabled menu item found\n\t\tif (nextItemIndex > -1) {\n\t\t\tconst nextItemNode = select(\n\t\t\t\t`#${this.services.domUtils.generateElementIDString(\n\t\t\t\t\t`control-${overflowMenuItems[nextItemIndex].id}`\n\t\t\t\t)} button`\n\t\t\t).node();\n\n\t\t\tif ('focus' in nextItemNode) {\n\t\t\t\tnextItemNode.focus();\n\t\t\t}\n\t\t}\n\t}\n\n\ttoggleOverflowMenu(event) {\n\t\tif (this.isOverflowMenuOpen()) {\n\t\t\t// hide overflow menu\n\t\t\tthis.updateOverflowMenu(false);\n\t\t} else {\n\t\t\t// show overflow menu\n\t\t\tthis.updateOverflowMenu(true);\n\n\t\t\t// setup overflow menu item event listener\n\t\t\tconst self = this;\n\t\t\tconst overflowMenuItems = this.getOverflowMenuItems();\n\t\t\toverflowMenuItems.forEach((menuItem, index) => {\n\t\t\t\tconst element = select(\n\t\t\t\t\t`#${this.services.domUtils.generateElementIDString(\n\t\t\t\t\t\t`control-${menuItem.id}`\n\t\t\t\t\t)}`\n\t\t\t\t);\n\t\t\t\tif (element !== null) {\n\t\t\t\t\telement.on('click', () => {\n\t\t\t\t\t\t// call the specified function\n\t\t\t\t\t\tmenuItem.clickFunction();\n\n\t\t\t\t\t\t// hide overflow menu\n\t\t\t\t\t\tself.updateOverflowMenu(false);\n\t\t\t\t\t});\n\n\t\t\t\t\telement.on('keydown', (keyEvent: KeyboardEvent) => {\n\t\t\t\t\t\tif (keyEvent && keyEvent.key === 'Enter') {\n\t\t\t\t\t\t\t// call the specified function\n\t\t\t\t\t\t\tmenuItem.clickFunction();\n\t\t\t\t\t\t} else if (keyEvent && keyEvent.key === 'ArrowUp') {\n\t\t\t\t\t\t\t// focus on previous menu item\n\t\t\t\t\t\t\tself.focusOnPreviousEnabledMenuItem(index);\n\t\t\t\t\t\t} else if (keyEvent && keyEvent.key === 'ArrowDown') {\n\t\t\t\t\t\t\t// focus on next menu item\n\t\t\t\t\t\t\tself.focusOnNextEnabledMenuItem(index);\n\t\t\t\t\t\t} else if (keyEvent && keyEvent.key === 'Escape') {\n\t\t\t\t\t\t\tself.updateOverflowMenu(false);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Not hide overflow menu by keyboard arrow up/down event\n\t\t\t\t\t\t// Prevent page from scrolling up/down\n\t\t\t\t\t\tkeyEvent.preventDefault();\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// default to focus on the first enabled menu item\n\t\t\tself.focusOnNextEnabledMenuItem(-1);\n\t\t}\n\n\t\t// propogation should not be stopped for keyboard events\n\t\tif (!!event) {\n\t\t\tevent.stopImmediatePropagation();\n\t\t}\n\t}\n\n\tgetControlConfigs() {\n\t\tconst numberOfIcons = Tools.getProperty(\n\t\t\tthis.getOptions(),\n\t\t\t'toolbar',\n\t\t\t'numberOfIcons'\n\t\t);\n\t\tconst controls = Tools.getProperty(\n\t\t\tthis.getOptions(),\n\t\t\t'toolbar',\n\t\t\t'controls'\n\t\t);\n\n\t\tconst controlList = [];\n\t\tconst overflowSpecificControls = [];\n\t\tcontrols.forEach((control) => {\n\t\t\tconst controlConfig = this.getControlConfigByType(control.type);\n\n\t\t\t// add to list if config is valid\n\t\t\tif (controlConfig) {\n\t\t\t\tcontrolConfig.text = control.text ? control.text : control.type;\n\n\t\t\t\tif (controlConfig.id.indexOf('toolbar-export') !== -1) {\n\t\t\t\t\toverflowSpecificControls.push(controlConfig);\n\t\t\t\t} else {\n\t\t\t\t\tcontrolList.push(controlConfig);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tif (\n\t\t\tcontrolList.length <= numberOfIcons &&\n\t\t\toverflowSpecificControls.length === 0\n\t\t) {\n\t\t\treturn {\n\t\t\t\tbuttonList: controlList,\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\t// leave one button for overflow button\n\t\t\tbuttonList: controlList.splice(0, numberOfIcons - 1),\n\t\t\toverflowMenuItemList: controlList.concat(overflowSpecificControls),\n\t\t};\n\t}\n\n\tgetToolbarButtonItems() {\n\t\tconst { buttonList, overflowMenuItemList } = this.getControlConfigs();\n\t\tif (!!overflowMenuItemList) {\n\t\t\tbuttonList.push(this.getOverflowButtonConfig());\n\t\t}\n\t\tif (!!buttonList) {\n\t\t\treturn buttonList;\n\t\t}\n\n\t\treturn [];\n\t}\n\n\tgetOverflowMenuItems() {\n\t\tconst { overflowMenuItemList } = this.getControlConfigs();\n\t\tif (!!overflowMenuItemList) {\n\t\t\treturn overflowMenuItemList;\n\t\t} else {\n\t\t\treturn [];\n\t\t}\n\t}\n\n\t// special button config for overflow button\n\tgetOverflowButtonConfig() {\n\t\treturn {\n\t\t\tid: 'toolbar-overflow-menu',\n\t\t\ttitle: 'More options',\n\t\t\tshouldBeDisabled: () => false,\n\t\t\ticonSVGContent: `<circle cx=\"16\" cy=\"8\" r=\"2\"></circle>\n\t\t\t\t\t\t\t <circle cx=\"16\" cy=\"16\" r=\"2\"></circle>\n\t\t\t\t\t\t\t <circle cx=\"16\" cy=\"24\" r=\"2\"></circle>`,\n\t\t\tclickFunction: (event) => this.toggleOverflowMenu(event),\n\t\t};\n\t}\n\n\tgetControlConfigByType(controlType: ToolbarControlTypes) {\n\t\tconst isZoomBarEnabled =\n\t\t\tthis.services.zoom &&\n\t\t\tthis.services.zoom.isZoomBarEnabled() &&\n\t\t\t!this.services.zoom.isEmptyState();\n\n\t\tconst displayData = this.model.getDisplayData();\n\n\t\tlet controlConfig;\n\t\tswitch (controlType) {\n\t\t\tcase ToolbarControlTypes.ZOOM_IN:\n\t\t\t\tif (isZoomBarEnabled) {\n\t\t\t\t\tcontrolConfig = {\n\t\t\t\t\t\tid: 'toolbar-zoomIn',\n\t\t\t\t\t\ttitle: 'Zoom in',\n\t\t\t\t\t\tshouldBeDisabled: () =>\n\t\t\t\t\t\t\tthis.services.zoom.isMinZoomDomain(),\n\t\t\t\t\t\ticonSVGContent: this.getControlIconByType(controlType),\n\t\t\t\t\t\tclickFunction: () => this.services.zoom.zoomIn(),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase ToolbarControlTypes.ZOOM_OUT:\n\t\t\t\tif (isZoomBarEnabled) {\n\t\t\t\t\tcontrolConfig = {\n\t\t\t\t\t\tid: 'toolbar-zoomOut',\n\t\t\t\t\t\ttitle: 'Zoom out',\n\t\t\t\t\t\tshouldBeDisabled: () =>\n\t\t\t\t\t\t\tthis.services.zoom.isMaxZoomDomain(),\n\t\t\t\t\t\ticonSVGContent: this.getControlIconByType(controlType),\n\t\t\t\t\t\tclickFunction: () => this.services.zoom.zoomOut(),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase ToolbarControlTypes.RESET_ZOOM:\n\t\t\t\tif (isZoomBarEnabled) {\n\t\t\t\t\tcontrolConfig = {\n\t\t\t\t\t\tid: 'toolbar-resetZoom',\n\t\t\t\t\t\ttitle: 'Reset zoom',\n\t\t\t\t\t\tshouldBeDisabled: () =>\n\t\t\t\t\t\t\tthis.services.zoom.isMaxZoomDomain(),\n\t\t\t\t\t\ticonSVGContent: this.getControlIconByType(controlType),\n\t\t\t\t\t\tclickFunction: () =>\n\t\t\t\t\t\t\tthis.services.zoom.resetZoomDomain(),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase ToolbarControlTypes.MAKE_FULLSCREEN:\n\t\t\t\tcontrolConfig = {\n\t\t\t\t\tid: 'toolbar-makefullscreen',\n\t\t\t\t\ttitle: 'Make fullscreen',\n\t\t\t\t\ticonSVGContent: this.getControlIconByType(controlType),\n\t\t\t\t\ticonWidth: '15px',\n\t\t\t\t\ticonHight: '15px',\n\t\t\t\t\tshouldBeDisabled: () => false,\n\t\t\t\t\tclickFunction: () => {\n\t\t\t\t\t\tthis.services.domUtils.toggleFullscreen();\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase ToolbarControlTypes.SHOW_AS_DATATABLE:\n\t\t\t\tcontrolConfig = {\n\t\t\t\t\tid: 'toolbar-showasdatatable',\n\t\t\t\t\ttitle: 'Show as table',\n\t\t\t\t\ticonSVGContent: this.getControlIconByType(controlType),\n\t\t\t\t\tshouldBeDisabled: () => displayData.length === 0,\n\t\t\t\t\tclickFunction: () =>\n\t\t\t\t\t\tthis.services.events.dispatchEvent(Events.Modal.SHOW),\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase ToolbarControlTypes.EXPORT_CSV:\n\t\t\t\tcontrolConfig = {\n\t\t\t\t\tid: 'toolbar-export-CSV',\n\t\t\t\t\ttitle: 'Export as CSV',\n\t\t\t\t\tshouldBeDisabled: () => false,\n\t\t\t\t\ticonSVGContent: this.getControlIconByType(controlType),\n\t\t\t\t\tclickFunction: () => this.model.exportToCSV(),\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase ToolbarControlTypes.EXPORT_PNG:\n\t\t\t\tcontrolConfig = {\n\t\t\t\t\tid: 'toolbar-export-PNG',\n\t\t\t\t\ttitle: 'Export as PNG',\n\t\t\t\t\tshouldBeDisabled: () => false,\n\t\t\t\t\ticonSVGContent: this.getControlIconByType(controlType),\n\t\t\t\t\tclickFunction: () => this.services.domUtils.exportToPNG(),\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase ToolbarControlTypes.EXPORT_JPG:\n\t\t\t\tcontrolConfig = {\n\t\t\t\t\tid: 'toolbar-export-JPG',\n\t\t\t\t\ttitle: 'Export as JPG',\n\t\t\t\t\tshouldBeDisabled: () => false,\n\t\t\t\t\ticonSVGContent: this.getControlIconByType(controlType),\n\t\t\t\t\tclickFunction: () => this.services.domUtils.exportToJPG(),\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\t// add more toolbar control configuration here\n\n\t\t\tdefault:\n\t\t\t\tthrow Error(\n\t\t\t\t\t'Not supported toolbar control type: ' + controlType\n\t\t\t\t);\n\t\t}\n\t\treturn controlConfig;\n\t}\n\n\tgetControlIconByType(controlType: ToolbarControlTypes) {\n\t\tswitch (controlType) {\n\t\t\tcase ToolbarControlTypes.ZOOM_IN:\n\t\t\t\treturn `<polygon points=\"19 13 15 13 15 9 13 9 13 13 9 13 9 15 13 15 13 19 15 19 15 15 19 15 19 13\"/>\n\t\t\t\t\t\t<path d=\"M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z\"/>`;\n\t\t\tcase ToolbarControlTypes.ZOOM_OUT:\n\t\t\t\treturn `<rect x=\"9\" y=\"13\" width=\"10\" height=\"2\"/>\n\t\t\t\t\t\t<path d=\"M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z\"/>`;\n\t\t\tcase ToolbarControlTypes.RESET_ZOOM:\n\t\t\t\treturn `<path d=\"M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z\"/>`;\n\t\t\tcase ToolbarControlTypes.MAKE_FULLSCREEN:\n\t\t\t\treturn `<polygon points=\"21 2 21 4 26.59 4 17 13.58 18.41 15 28 5.41 28 11 30 11 30 2 21 2\"/><polygon points=\"15 18.42 13.59 17 4 26.59 4 21 2 21 2 30 11 30 11 28 5.41 28 15 18.42\"/>`;\n\t\t\tcase ToolbarControlTypes.SHOW_AS_DATATABLE:\n\t\t\t\treturn `<rect x=\"4\" y=\"6\" width=\"18\" height=\"2\"/><rect x=\"4\" y=\"12\" width=\"18\" height=\"2\"/><rect x=\"4\" y=\"18\" width=\"18\" height=\"2\"/><rect x=\"4\" y=\"24\" width=\"18\" height=\"2\"/><rect x=\"26\" y=\"6\" width=\"2\" height=\"2\"/><rect x=\"26\" y=\"12\" width=\"2\" height=\"2\"/><rect x=\"26\" y=\"18\" width=\"2\" height=\"2\"/><rect x=\"26\" y=\"24\" width=\"2\" height=\"2\"/>`;\n\t\t\tcase ToolbarControlTypes.EXPORT_CSV:\n\t\t\t\treturn `<path d=\"M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z\"/>`;\n\t\t\tcase ToolbarControlTypes.EXPORT_JPG:\n\t\t\t\treturn `<path d=\"M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z\"/>`;\n\t\t\tcase ToolbarControlTypes.EXPORT_PNG:\n\t\t\t\treturn `<path d=\"M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z\"/>`; // add more icons here\n\t\t\t// svg icon must be with 32x32 viewBox\n\n\t\t\tdefault:\n\t\t\t\tthrow Error(\n\t\t\t\t\t'Not supported toolbar control type: ' + controlType\n\t\t\t\t);\n\t\t}\n\t}\n}\n"]}
1
+ {"version":3,"file":"toolbar.js","sourceRoot":"","sources":["toolbar.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mBAAmB;AACnB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,aAAa;AACb,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC;IAA6B,2BAAS;IAAtC;QAAA,qEA4oBC;QA1oBA,UAAI,GAAG,S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AAC,WAAW,CAAC;qBAC/C;oBACD,aAAa,EAAE,cAAM,OAAA,KAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,WAAW,EAAE,EAApC,CAAoC;iBACzD,CAAC;gBACF,MAAM;YACP,8CAA8C;YAE9C;gBACC,MAAM,KAAK,CACV,sCAAsC,GAAG,WAAW,CACpD,CAAC;SACH;QACD,OAAO,aAAa,CAAC;IACtB,CAAC;IAED,sCAAoB,GAApB,UAAqB,WAAgC;QACpD,QAAQ,WAAW,EAAE;YACpB,KAAK,mBAAmB,CAAC,OAAO;gBAC/B,OAAO,iQAC4I,CAAC;YACrJ,KAAK,mBAAmB,CAAC,QAAQ;gBAChC,OAAO,oNAC4I,CAAC;YACrJ,KAAK,mBAAmB,CAAC,UAAU;gBAClC,OAAO,iNAA+M,CAAC;YACxN,KAAK,mBAAmB,CAAC,eAAe;gBACvC,OAAO,oLAAgL,CAAC;YACzL,KAAK,mBAAmB,CAAC,iBAAiB;gBACzC,OAAO,gZAAgV,CAAC;YACzV,KAAK,mBAAmB,CAAC,UAAU;gBAClC,OAAO,iNAA+M,CAAC;YACxN,KAAK,mBAAmB,CAAC,UAAU;gBAClC,OAAO,iNAA+M,CAAC;YACxN,KAAK,mBAAmB,CAAC,UAAU;gBAClC,OAAO,iNAA+M,CAAC,CAAC,sBAAsB;YAC/O,sCAAsC;YAEtC;gBACC,MAAM,KAAK,CACV,sCAAsC,GAAG,WAAW,CACpD,CAAC;SACH;IACF,CAAC;IA1oBM,gBAAQ,GAAG,CAAC,CAAC;IA2oBrB,cAAC;CAAA,AA5oBD,CAA6B,SAAS,GA4oBrC;SA5oBY,OAAO","sourcesContent":["// Internal Imports\nimport { Component } from '../component';\nimport { Events, RenderTypes, ToolbarControlTypes } from '../../interfaces';\nimport { Tools } from '../../tools';\n\n// D3 Imports\nimport { select } from 'd3-selection';\n\nexport class Toolbar extends Component {\n\tstatic buttonID = 0;\n\ttype = 'toolbar';\n\trenderType = RenderTypes.HTML;\n\n\t// overflow menu button to control background color\n\toverflowButton: any;\n\n\t// div options list element\n\toverflowMenu: any;\n\n\tinit() {\n\t\tconst bodyOnClickHandler = () => this.updateOverflowMenu(false);\n\n\t\t// Grab the tooltip element\n\t\tthis.services.events.addEventListener(\n\t\t\tEvents.Toolbar.SHOW_OVERFLOW_MENU,\n\t\t\t() => {\n\t\t\t\tthis.renderOverflowMenu();\n\n\t\t\t\t// hide overflow menu if user clicks on somewhere in web page\n\t\t\t\tdocument.body.addEventListener('click', bodyOnClickHandler);\n\t\t\t}\n\t\t);\n\n\t\t// listen to hide overflow menu event to hide the overflow menu\n\t\tthis.services.events.addEventListener(\n\t\t\tEvents.Toolbar.HIDE_OVERFLOW_MENU,\n\t\t\t() => {\n\t\t\t\t// // hide overflow menu if user clicks on somewhere in web page\n\t\t\t\tdocument.body.removeEventListener('click', bodyOnClickHandler);\n\t\t\t}\n\t\t);\n\t}\n\n\trender(animate = true) {\n\t\tconst container = this.getComponentContainer().attr('role', 'toolbar');\n\n\t\tconst isDataLoading = Tools.getProperty(\n\t\t\tthis.getOptions(),\n\t\t\t'data',\n\t\t\t'loading'\n\t\t);\n\n\t\tif (isDataLoading) {\n\t\t\tcontainer.html('');\n\t\t\t// Set overflow menu to null if data is loading\n\t\t\t// This will render in a new overflow menu when data is done loading\n\t\t\tthis.overflowMenu = null;\n\t\t} else {\n\t\t\tif (!this.overflowMenu) {\n\t\t\t\tthis.overflowMenu = container\n\t\t\t\t\t.append('div')\n\t\t\t\t\t.attr(\n\t\t\t\t\t\t'class',\n\t\t\t\t\t\t'bx--overflow-menu-options bx--overflow-menu--flip'\n\t\t\t\t\t)\n\t\t\t\t\t.attr('tabindex', -1)\n\t\t\t\t\t.attr('role', 'menu')\n\t\t\t\t\t.html(`<ul></ul>`);\n\t\t\t}\n\n\t\t\t// get the toolbar buttons\n\t\t\tconst {\n\t\t\t\tbuttonList,\n\t\t\t\toverflowMenuItemList,\n\t\t\t} = this.getControlConfigs();\n\n\t\t\t// overflow button is required only if overflow menu item list is valid\n\t\t\tif (!!overflowMenuItemList) {\n\t\t\t\tbuttonList.push(this.getOverflowButtonConfig());\n\t\t\t}\n\n\t\t\tconst toolbarControls = container\n\t\t\t\t.selectAll('div.toolbar-control')\n\t\t\t\t.data(buttonList, (button) => button.id);\n\n\t\t\ttoolbarControls.exit().remove();\n\n\t\t\tconst enteringToolbarControls = toolbarControls\n\t\t\t\t.enter()\n\t\t\t\t.append('div')\n\t\t\t\t.attr('class', 'toolbar-control bx--overflow-menu')\n\t\t\t\t.attr('role', 'button');\n\n\t\t\tconst self = this;\n\t\t\tconst allToolbarControls = enteringToolbarControls\n\t\t\t\t.merge(toolbarControls)\n\t\t\t\t.classed('disabled', (d) => d.shouldBeDisabled())\n\t\t\t\t.attr('aria-disabled', (d) => d.shouldBeDisabled())\n\t\t\t\t.attr('aria-label', (d) => d.title)\n\t\t\t\t.html(\n\t\t\t\t\t(d) => `\n\t\t\t<button\n\t\t\t\tclass=\"bx--overflow-menu__trigger\"\n\t\t\t\taria-haspopup=\"true\" aria-expanded=\"false\" id=\"${this.services.domUtils.generateElementIDString(\n\t\t\t\t\t`control-${d.id}`\n\t\t\t\t)}\" aria-label=\"${d.title}\">\n\t\t\t\t<svg focusable=\"false\" preserveAspectRatio=\"xMidYMid meet\" style=\"will-change: transform; width: ${\n\t\t\t\t\td.iconSVG.width !== undefined ? d.iconSVG.width : '20px'\n\t\t\t\t}; height: ${\n\t\t\t\t\t\td.iconSVG.height !== undefined\n\t\t\t\t\t\t\t? d.iconSVG.height\n\t\t\t\t\t\t\t: '20px'\n\t\t\t\t\t}\" xmlns=\"http://www.w3.org/2000/svg\" class=\"bx--overflow-menu__icon\" viewBox=\"0 0 32 32\" aria-hidden=\"true\">\n\t\t\t\t\t${d.iconSVG.content}\n\t\t\t\t</svg>\n\t\t\t</button>`\n\t\t\t\t)\n\t\t\t\t.each(function (d, index) {\n\t\t\t\t\tselect(this)\n\t\t\t\t\t\t.select('button')\n\t\t\t\t\t\t.on('click', (event) => {\n\t\t\t\t\t\t\tif (!d.shouldBeDisabled()) {\n\t\t\t\t\t\t\t\tself.triggerFunctionAndEvent(d, event, this);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.on('keydown', (event: KeyboardEvent) => {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t(event.key && event.key === 'Enter') ||\n\t\t\t\t\t\t\t\tevent.key === ' '\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\tself.triggerFunctionAndEvent(d, event, this);\n\t\t\t\t\t\t\t} else if (event.key && event.key === 'ArrowLeft') {\n\t\t\t\t\t\t\t\tself.focusOnPreviousEnabledToolbarItem(index);\n\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\tevent.key &&\n\t\t\t\t\t\t\t\tevent.key === 'ArrowRight'\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tself.focusOnNextEnabledToolbarItem(index);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t});\n\n\t\t\tthis.overflowButton = this.getComponentContainer().select(\n\t\t\t\t`button.bx--overflow-menu__trigger#${this.services.domUtils.generateElementIDString(\n\t\t\t\t\t'control-toolbar-overflow-menu'\n\t\t\t\t)}`\n\t\t\t);\n\t\t}\n\t}\n\n\trenderOverflowMenu() {\n\t\tconst { overflowMenuItemList } = this.getControlConfigs();\n\n\t\tconst overflowMenuControls = this.overflowMenu\n\t\t\t.select('ul')\n\t\t\t.selectAll('li.bx--overflow-menu-options__option')\n\t\t\t.data(overflowMenuItemList, (button) =>\n\t\t\t\tTools.getProperty(button, 'id')\n\t\t\t);\n\n\t\toverflowMenuControls.exit().remove();\n\n\t\tconst enteringOverflowMenuControls = overflowMenuControls\n\t\t\t.enter()\n\t\t\t.append('li')\n\t\t\t.attr('id', (d) =>\n\t\t\t\tthis.services.domUtils.generateElementIDString(\n\t\t\t\t\t`control-${d.id}`\n\t\t\t\t)\n\t\t\t)\n\t\t\t.attr('class', 'bx--overflow-menu-options__option')\n\t\t\t.attr('role', 'menuitem');\n\n\t\tenteringOverflowMenuControls\n\t\t\t.append('button')\n\t\t\t.attr('class', 'bx--overflow-menu-options__btn');\n\n\t\tenteringOverflowMenuControls\n\t\t\t.merge(overflowMenuControls)\n\t\t\t.classed('bx--overflow-menu-options__option--disabled', (d) =>\n\t\t\t\td.shouldBeDisabled()\n\t\t\t)\n\t\t\t.attr('aria-disabled', (d) => d.shouldBeDisabled())\n\t\t\t.selectAll('button')\n\t\t\t.text((d) => d.text);\n\t}\n\n\tisOverflowMenuOpen() {\n\t\treturn this.overflowMenu.classed('is-open');\n\t}\n\n\t// show/hide overflow menu\n\tupdateOverflowMenu(show: boolean) {\n\t\tif (!this.overflowMenu) {\n\t\t\treturn;\n\t\t}\n\t\tthis.overflowMenu.classed('is-open', show);\n\n\t\t// update overflow button background\n\t\tif (this.overflowButton) {\n\t\t\tthis.overflowButton.attr('aria-expanded', show);\n\t\t\tselect(this.overflowButton.node().parentNode).classed(\n\t\t\t\t'bx--overflow-menu--open',\n\t\t\t\tshow\n\t\t\t);\n\t\t}\n\n\t\tif (show) {\n\t\t\tthis.services.events.dispatchEvent(\n\t\t\t\tEvents.Toolbar.SHOW_OVERFLOW_MENU\n\t\t\t);\n\t\t} else {\n\t\t\tthis.services.events.dispatchEvent(\n\t\t\t\tEvents.Toolbar.HIDE_OVERFLOW_MENU\n\t\t\t);\n\t\t}\n\t}\n\n\t// Toolbar controllers\n\tfocusOnPreviousEnabledToolbarItem(currentItemIndex) {\n\t\tconst buttonList = this.getToolbarButtonItems();\n\t\tlet previousItemIndex = buttonList.length;\n\n\t\tfor (let i = currentItemIndex - 1; i >= 0; i--) {\n\t\t\tconst previousButtonItem = buttonList[i];\n\t\t\tif (!previousButtonItem.shouldBeDisabled()) {\n\t\t\t\tpreviousItemIndex = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// only if previous enabled menu item found\n\t\tif (previousItemIndex < buttonList.length) {\n\t\t\tconst previousItemNode = select(\n\t\t\t\t`button#${this.services.domUtils.generateElementIDString(\n\t\t\t\t\t`control-${buttonList[previousItemIndex].id}`\n\t\t\t\t)}`\n\t\t\t).node();\n\t\t\tif ('focus' in previousItemNode) {\n\t\t\t\tpreviousItemNode.focus();\n\t\t\t}\n\t\t}\n\t}\n\n\tfocusOnNextEnabledToolbarItem(currentItemIndex) {\n\t\tconst buttonList = this.getToolbarButtonItems();\n\t\tlet nextItemIndex = -1;\n\n\t\tfor (let i = currentItemIndex + 1; i < buttonList.length; i++) {\n\t\t\tconst nextOverflowMenuItem = buttonList[i];\n\t\t\tif (!nextOverflowMenuItem.shouldBeDisabled()) {\n\t\t\t\tnextItemIndex = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// only if next enabled menu item found\n\t\tif (nextItemIndex > -1) {\n\t\t\tconst nextItemNode = select(\n\t\t\t\t`button#${this.services.domUtils.generateElementIDString(\n\t\t\t\t\t`control-${buttonList[nextItemIndex].id}`\n\t\t\t\t)}`\n\t\t\t).node();\n\n\t\t\tif ('focus' in nextItemNode) {\n\t\t\t\tnextItemNode.focus();\n\t\t\t}\n\t\t}\n\t}\n\n\tfocusOnPreviousEnabledMenuItem(currentItemIndex) {\n\t\tconst overflowMenuItems = this.getOverflowMenuItems();\n\t\tlet previousItemIndex = overflowMenuItems.length;\n\n\t\tfor (let i = currentItemIndex - 1; i >= 0; i--) {\n\t\t\tconst previousOverflowMenuItem = overflowMenuItems[i];\n\t\t\tif (!previousOverflowMenuItem.shouldBeDisabled()) {\n\t\t\t\tpreviousItemIndex = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// only if previous enabled menu item found\n\t\tif (previousItemIndex < overflowMenuItems.length) {\n\t\t\tconst previousItemNode = select(\n\t\t\t\t`#${this.services.domUtils.generateElementIDString(\n\t\t\t\t\t`control-${overflowMenuItems[previousItemIndex].id}`\n\t\t\t\t)} button`\n\t\t\t).node();\n\t\t\tif ('focus' in previousItemNode) {\n\t\t\t\tpreviousItemNode.focus();\n\t\t\t}\n\t\t}\n\t}\n\n\tfocusOnNextEnabledMenuItem(currentItemIndex) {\n\t\tconst overflowMenuItems = this.getOverflowMenuItems();\n\t\tlet nextItemIndex = -1;\n\n\t\tfor (let i = currentItemIndex + 1; i < overflowMenuItems.length; i++) {\n\t\t\tconst nextOverflowMenuItem = overflowMenuItems[i];\n\t\t\tif (!nextOverflowMenuItem.shouldBeDisabled()) {\n\t\t\t\tnextItemIndex = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// only if next enabled menu item found\n\t\tif (nextItemIndex > -1) {\n\t\t\tconst nextItemNode = select(\n\t\t\t\t`#${this.services.domUtils.generateElementIDString(\n\t\t\t\t\t`control-${overflowMenuItems[nextItemIndex].id}`\n\t\t\t\t)} button`\n\t\t\t).node();\n\n\t\t\tif ('focus' in nextItemNode) {\n\t\t\t\tnextItemNode.focus();\n\t\t\t}\n\t\t}\n\t}\n\n\ttoggleOverflowMenu(event) {\n\t\tif (this.isOverflowMenuOpen()) {\n\t\t\t// hide overflow menu\n\t\t\tthis.updateOverflowMenu(false);\n\t\t} else {\n\t\t\t// show overflow menu\n\t\t\tthis.updateOverflowMenu(true);\n\n\t\t\t// setup overflow menu item event listener\n\t\t\tconst self = this;\n\t\t\tconst overflowMenuItems = this.getOverflowMenuItems();\n\t\t\toverflowMenuItems.forEach((menuItem, index) => {\n\t\t\t\tconst element = select(\n\t\t\t\t\t`#${this.services.domUtils.generateElementIDString(\n\t\t\t\t\t\t`control-${menuItem.id}`\n\t\t\t\t\t)}`\n\t\t\t\t);\n\t\t\t\tif (element !== null) {\n\t\t\t\t\telement.on('click', () => {\n\t\t\t\t\t\tself.triggerFunctionAndEvent(\n\t\t\t\t\t\t\tmenuItem,\n\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\telement.node()\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// hide overflow menu\n\t\t\t\t\t\tself.updateOverflowMenu(false);\n\t\t\t\t\t});\n\n\t\t\t\t\telement.on('keydown', (keyEvent: KeyboardEvent) => {\n\t\t\t\t\t\tif (keyEvent && keyEvent.key === 'Enter') {\n\t\t\t\t\t\t\tself.triggerFunctionAndEvent(\n\t\t\t\t\t\t\t\tmenuItem,\n\t\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\t\telement.node()\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else if (keyEvent && keyEvent.key === 'ArrowUp') {\n\t\t\t\t\t\t\t// focus on previous menu item\n\t\t\t\t\t\t\tself.focusOnPreviousEnabledMenuItem(index);\n\t\t\t\t\t\t} else if (keyEvent && keyEvent.key === 'ArrowDown') {\n\t\t\t\t\t\t\t// focus on next menu item\n\t\t\t\t\t\t\tself.focusOnNextEnabledMenuItem(index);\n\t\t\t\t\t\t} else if (keyEvent && keyEvent.key === 'Escape') {\n\t\t\t\t\t\t\tself.updateOverflowMenu(false);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Not hide overflow menu by keyboard arrow up/down event\n\t\t\t\t\t\t// Prevent page from scrolling up/down\n\t\t\t\t\t\tkeyEvent.preventDefault();\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// default to focus on the first enabled menu item\n\t\t\tself.focusOnNextEnabledMenuItem(-1);\n\t\t}\n\n\t\t// propogation should not be stopped for keyboard events\n\t\tif (!!event) {\n\t\t\tevent.stopImmediatePropagation();\n\t\t}\n\t}\n\n\t// Calls passed function && dispatches event\n\ttriggerFunctionAndEvent(control, event, element?) {\n\t\t// Call custom function only if it exists\n\t\tif (typeof control.clickFunction === 'function') {\n\t\t\tcontrol.clickFunction(event);\n\t\t}\n\n\t\t// Dispatch selection event\n\t\tthis.services.events.dispatchEvent(Events.Toolbar.BUTTON_CLICK, {\n\t\t\tcontrol,\n\t\t\tevent,\n\t\t\telement,\n\t\t});\n\t}\n\n\tgetControlConfigs() {\n\t\tconst numberOfIcons =\n\t\t\tTools.getProperty(this.getOptions(), 'toolbar', 'numberOfIcons') -\n\t\t\t1;\n\t\tconst controls = Tools.getProperty(\n\t\t\tthis.getOptions(),\n\t\t\t'toolbar',\n\t\t\t'controls'\n\t\t);\n\n\t\tconst overflowSpecificControls = [];\n\t\tconst buttonList = [];\n\t\tconst overflowList = [];\n\n\t\tcontrols.forEach((control) => {\n\t\t\tlet controlConfig = null;\n\t\t\t// check if button is custom or default control\n\t\t\tif (control.type === ToolbarControlTypes.CUSTOM) {\n\t\t\t\t// add generic id if missing\n\t\t\t\tif (Tools.getProperty(control, 'id') === null) {\n\t\t\t\t\t// add id directly to the data passed so that id isn't reassigned on rerender\n\t\t\t\t\tcontrol.id = `toolbar-button-${Toolbar.buttonID++}`;\n\t\t\t\t}\n\t\t\t\t// define function if missing\n\t\t\t\tif (Tools.getProperty(control, 'shouldBeDisabled') === null) {\n\t\t\t\t\tcontrol.shouldBeDisabled = () => false;\n\t\t\t\t}\n\n\t\t\t\tcontrolConfig = control;\n\t\t\t} else {\n\t\t\t\tcontrolConfig = this.getControlConfigByType(control.type);\n\t\t\t}\n\n\t\t\t// add to list if config is valid\n\t\t\tif (controlConfig) {\n\t\t\t\tcontrolConfig.text = control.text ? control.text : control.type;\n\n\t\t\t\tif (controlConfig.id.indexOf('toolbar-export') !== -1) {\n\t\t\t\t\toverflowSpecificControls.push(controlConfig);\n\t\t\t\t} else if (buttonList.length < numberOfIcons) {\n\t\t\t\t\t// check if icon exists else assign to the overflow list\n\t\t\t\t\tif (\n\t\t\t\t\t\tTools.getProperty(\n\t\t\t\t\t\t\tcontrolConfig,\n\t\t\t\t\t\t\t'iconSVG',\n\t\t\t\t\t\t\t'content'\n\t\t\t\t\t\t) === null\n\t\t\t\t\t) {\n\t\t\t\t\t\toverflowList.push(controlConfig);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbuttonList.push(controlConfig);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\toverflowList.push(controlConfig);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t// Ensures the `export` controls are always at the bottom\n\t\toverflowList.push(...overflowSpecificControls);\n\n\t\tif (!overflowList.length) {\n\t\t\treturn {\n\t\t\t\tbuttonList,\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\tbuttonList,\n\t\t\toverflowMenuItemList: overflowList,\n\t\t};\n\t}\n\n\tgetToolbarButtonItems() {\n\t\tconst { buttonList, overflowMenuItemList } = this.getControlConfigs();\n\t\tif (!!overflowMenuItemList) {\n\t\t\tbuttonList.push(this.getOverflowButtonConfig());\n\t\t}\n\t\tif (!!buttonList) {\n\t\t\treturn buttonList;\n\t\t}\n\n\t\treturn [];\n\t}\n\n\tgetOverflowMenuItems() {\n\t\tconst { overflowMenuItemList } = this.getControlConfigs();\n\t\tif (!!overflowMenuItemList) {\n\t\t\treturn overflowMenuItemList;\n\t\t} else {\n\t\t\treturn [];\n\t\t}\n\t}\n\n\t// special button config for overflow button\n\tgetOverflowButtonConfig() {\n\t\treturn {\n\t\t\tid: 'toolbar-overflow-menu',\n\t\t\ttitle: 'More options',\n\t\t\tshouldBeDisabled: () => false,\n\t\t\ticonSVG: {\n\t\t\t\tcontent: `<circle cx=\"16\" cy=\"8\" r=\"2\"></circle>\n\t\t\t\t<circle cx=\"16\" cy=\"16\" r=\"2\"></circle>\n\t\t\t\t<circle cx=\"16\" cy=\"24\" r=\"2\"></circle>`,\n\t\t\t},\n\t\t\tclickFunction: (event) => this.toggleOverflowMenu(event),\n\t\t};\n\t}\n\n\tgetControlConfigByType(controlType: ToolbarControlTypes) {\n\t\tconst isZoomBarEnabled =\n\t\t\tthis.services.zoom &&\n\t\t\tthis.services.zoom.isZoomBarEnabled() &&\n\t\t\t!this.services.zoom.isEmptyState();\n\n\t\tconst displayData = this.model.getDisplayData();\n\n\t\tlet controlConfig;\n\t\tswitch (controlType) {\n\t\t\tcase ToolbarControlTypes.ZOOM_IN:\n\t\t\t\tif (isZoomBarEnabled) {\n\t\t\t\t\tcontrolConfig = {\n\t\t\t\t\t\tid: 'toolbar-zoomIn',\n\t\t\t\t\t\ttitle: 'Zoom in',\n\t\t\t\t\t\tshouldBeDisabled: () =>\n\t\t\t\t\t\t\tthis.services.zoom.isMinZoomDomain(),\n\t\t\t\t\t\ticonSVG: {\n\t\t\t\t\t\t\tcontent: this.getControlIconByType(controlType),\n\t\t\t\t\t\t},\n\t\t\t\t\t\tclickFunction: () => this.services.zoom.zoomIn(),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase ToolbarControlTypes.ZOOM_OUT:\n\t\t\t\tif (isZoomBarEnabled) {\n\t\t\t\t\tcontrolConfig = {\n\t\t\t\t\t\tid: 'toolbar-zoomOut',\n\t\t\t\t\t\ttitle: 'Zoom out',\n\t\t\t\t\t\tshouldBeDisabled: () =>\n\t\t\t\t\t\t\tthis.services.zoom.isMaxZoomDomain(),\n\t\t\t\t\t\ticonSVG: {\n\t\t\t\t\t\t\tcontent: this.getControlIconByType(controlType),\n\t\t\t\t\t\t},\n\t\t\t\t\t\tclickFunction: () => this.services.zoom.zoomOut(),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase ToolbarControlTypes.RESET_ZOOM:\n\t\t\t\tif (isZoomBarEnabled) {\n\t\t\t\t\tcontrolConfig = {\n\t\t\t\t\t\tid: 'toolbar-resetZoom',\n\t\t\t\t\t\ttitle: 'Reset zoom',\n\t\t\t\t\t\tshouldBeDisabled: () =>\n\t\t\t\t\t\t\tthis.services.zoom.isMaxZoomDomain(),\n\t\t\t\t\t\ticonSVG: {\n\t\t\t\t\t\t\tcontent: this.getControlIconByType(controlType),\n\t\t\t\t\t\t},\n\t\t\t\t\t\tclickFunction: () =>\n\t\t\t\t\t\t\tthis.services.zoom.resetZoomDomain(),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase ToolbarControlTypes.MAKE_FULLSCREEN:\n\t\t\t\tcontrolConfig = {\n\t\t\t\t\tid: 'toolbar-makefullscreen',\n\t\t\t\t\ticonSVG: {\n\t\t\t\t\t\tcontent: this.getControlIconByType(controlType),\n\t\t\t\t\t\twidth: '15px',\n\t\t\t\t\t\theight: '15px',\n\t\t\t\t\t},\n\t\t\t\t\ttitle: 'Make fullscreen',\n\t\t\t\t\tshouldBeDisabled: () => false,\n\t\t\t\t\tclickFunction: () => {\n\t\t\t\t\t\tthis.services.domUtils.toggleFullscreen();\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase ToolbarControlTypes.SHOW_AS_DATATABLE:\n\t\t\t\tcontrolConfig = {\n\t\t\t\t\tid: 'toolbar-showasdatatable',\n\t\t\t\t\ticonSVG: {\n\t\t\t\t\t\tcontent: this.getControlIconByType(controlType),\n\t\t\t\t\t},\n\t\t\t\t\ttitle: 'Show as table',\n\t\t\t\t\tshouldBeDisabled: () => displayData.length === 0,\n\t\t\t\t\tclickFunction: () =>\n\t\t\t\t\t\tthis.services.events.dispatchEvent(Events.Modal.SHOW),\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase ToolbarControlTypes.EXPORT_CSV:\n\t\t\t\tcontrolConfig = {\n\t\t\t\t\tid: 'toolbar-export-CSV',\n\t\t\t\t\ttitle: 'Export as CSV',\n\t\t\t\t\tshouldBeDisabled: () => false,\n\t\t\t\t\ticonSVG: {\n\t\t\t\t\t\tcontent: this.getControlIconByType(controlType),\n\t\t\t\t\t},\n\t\t\t\t\tclickFunction: () => this.model.exportToCSV(),\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase ToolbarControlTypes.EXPORT_PNG:\n\t\t\t\tcontrolConfig = {\n\t\t\t\t\tid: 'toolbar-export-PNG',\n\t\t\t\t\ttitle: 'Export as PNG',\n\t\t\t\t\tshouldBeDisabled: () => false,\n\t\t\t\t\ticonSVG: {\n\t\t\t\t\t\tcontent: this.getControlIconByType(controlType),\n\t\t\t\t\t},\n\t\t\t\t\tclickFunction: () => this.services.domUtils.exportToPNG(),\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase ToolbarControlTypes.EXPORT_JPG:\n\t\t\t\tcontrolConfig = {\n\t\t\t\t\tid: 'toolbar-export-JPG',\n\t\t\t\t\ttitle: 'Export as JPG',\n\t\t\t\t\tshouldBeDisabled: () => false,\n\t\t\t\t\ticonSVG: {\n\t\t\t\t\t\tcontent: this.getControlIconByType(controlType),\n\t\t\t\t\t},\n\t\t\t\t\tclickFunction: () => this.services.domUtils.exportToJPG(),\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\t// add more toolbar control configuration here\n\n\t\t\tdefault:\n\t\t\t\tthrow Error(\n\t\t\t\t\t'Not supported toolbar control type: ' + controlType\n\t\t\t\t);\n\t\t}\n\t\treturn controlConfig;\n\t}\n\n\tgetControlIconByType(controlType: ToolbarControlTypes) {\n\t\tswitch (controlType) {\n\t\t\tcase ToolbarControlTypes.ZOOM_IN:\n\t\t\t\treturn `<polygon points=\"19 13 15 13 15 9 13 9 13 13 9 13 9 15 13 15 13 19 15 19 15 15 19 15 19 13\"/>\n\t\t\t\t\t\t<path d=\"M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z\"/>`;\n\t\t\tcase ToolbarControlTypes.ZOOM_OUT:\n\t\t\t\treturn `<rect x=\"9\" y=\"13\" width=\"10\" height=\"2\"/>\n\t\t\t\t\t\t<path d=\"M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z\"/>`;\n\t\t\tcase ToolbarControlTypes.RESET_ZOOM:\n\t\t\t\treturn `<path d=\"M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z\"/>`;\n\t\t\tcase ToolbarControlTypes.MAKE_FULLSCREEN:\n\t\t\t\treturn `<polygon points=\"21 2 21 4 26.59 4 17 13.58 18.41 15 28 5.41 28 11 30 11 30 2 21 2\"/><polygon points=\"15 18.42 13.59 17 4 26.59 4 21 2 21 2 30 11 30 11 28 5.41 28 15 18.42\"/>`;\n\t\t\tcase ToolbarControlTypes.SHOW_AS_DATATABLE:\n\t\t\t\treturn `<rect x=\"4\" y=\"6\" width=\"18\" height=\"2\"/><rect x=\"4\" y=\"12\" width=\"18\" height=\"2\"/><rect x=\"4\" y=\"18\" width=\"18\" height=\"2\"/><rect x=\"4\" y=\"24\" width=\"18\" height=\"2\"/><rect x=\"26\" y=\"6\" width=\"2\" height=\"2\"/><rect x=\"26\" y=\"12\" width=\"2\" height=\"2\"/><rect x=\"26\" y=\"18\" width=\"2\" height=\"2\"/><rect x=\"26\" y=\"24\" width=\"2\" height=\"2\"/>`;\n\t\t\tcase ToolbarControlTypes.EXPORT_CSV:\n\t\t\t\treturn `<path d=\"M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z\"/>`;\n\t\t\tcase ToolbarControlTypes.EXPORT_JPG:\n\t\t\t\treturn `<path d=\"M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z\"/>`;\n\t\t\tcase ToolbarControlTypes.EXPORT_PNG:\n\t\t\t\treturn `<path d=\"M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z\"/>`; // add more icons here\n\t\t\t// svg icon must be with 32x32 viewBox\n\n\t\t\tdefault:\n\t\t\t\tthrow Error(\n\t\t\t\t\t'Not supported toolbar control type: ' + controlType\n\t\t\t\t);\n\t\t}\n\t}\n}\n"]}
@@ -13,11 +13,12 @@ var __extends = (this && this.__extends) || (function () {
13
13
  })();
14
14
  // Internal Imports
15
15
  import { Component } from '../component';
16
- import { AxisPositions, RenderTypes, } from '../../interfaces';
16
+ import { AxisPositions, RenderTypes, AxisFlavor } from '../../interfaces';
17
17
  import { Axis } from './axis';
18
18
  import { Tools } from '../../tools';
19
19
  import { DOMUtils } from '../../services';
20
20
  import { Events } from './../../interfaces';
21
+ import { HoverAxis } from './hover-axis';
21
22
  var TwoDimensionalAxes = /** @class */ (function (_super) {
22
23
  __extends(TwoDimensionalAxes, _super);
23
24
  function TwoDimensionalAxes() {
@@ -52,11 +53,14 @@ var TwoDimensionalAxes = /** @class */ (function (_super) {
52
53
  var axisPosition = AxisPositions[axisPositionKey];
53
54
  if (_this.configs.axes[axisPosition] &&
54
55
  !_this.children[axisPosition]) {
55
- var axisComponent = new Axis(_this.model, _this.services, {
56
+ var configs = {
56
57
  position: axisPosition,
57
58
  axes: _this.configs.axes,
58
59
  margins: _this.margins,
59
- });
60
+ };
61
+ var axisComponent = _this.model.axisFlavor === AxisFlavor.DEFAULT
62
+ ? new Axis(_this.model, _this.services, configs)
63
+ : new HoverAxis(_this.model, _this.services, configs);
60
64
  // Set model, services & parent for the new axis component
61
65
  axisComponent.setModel(_this.model);
62
66
  axisComponent.setServices(_this.services);
@@ -107,6 +111,7 @@ var TwoDimensionalAxes = /** @class */ (function (_super) {
107
111
  break;
108
112
  }
109
113
  });
114
+ this.services.events.dispatchEvent(Events.Axis.RENDER_COMPLETE);
110
115
  // If the new margins are different than the existing ones
111
116
  var isNotEqual = Object.keys(margins).some(function (marginKey) {
112
117
  return _this.margins[marginKey] !== margins[marginKey];
@@ -1 +1 @@
1
- {"version":3,"file":"two-dimensional-axes.js","sourceRoot":"","sources":["two-dimensional-axes.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mBAAmB;AACnB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EACN,aAAa,EAGb,WAAW,GACX,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C;IAAwC,sCAAS;IAAjD;QAAA,qEA6HC;QA5HA,UAAI,GAAG,SAAS,CAAC;QACjB,gBAAU,GAAG,WAAW,CAAC,GAAG,CAAC;QAE7B,cAAQ,GAAQ,EAAE,CAAC;QAEnB,gBAAU,GAAgB,EAAE,CAAC;QAE7B,aAAO,GAAG;YACT,GAAG,EAAE,CAAC;YACN,KAAK,EAAE,CAAC;YACR,MAAM,EAAE,CAAC;YACT,IAAI,EAAE,CAAC;SACP,CAAC;;IAgHH,CAAC;IA9GA,mCAAM,GAAN,UAAO,OAAe;QAAtB,iBA6GC;QA7GM,wBAAA,EAAA,eAAe;QACrB,IAAM,IAAI,GAAG,EAAE,CAAC;QAChB,IAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACjD,IAAM,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,MAAM,CAAC,CAAC;QAEjE,aAAa,CAAC,OAA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AK,GAAG,MAAM,CAAC;oBAC/B,MAAM;aACP;QACF,CAAC,CAAC,CAAC;QAEH,0DAA0D;QAC1D,IAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,UAAC,SAAS;YACtD,OAAO,KAAI,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC;QACvD,CAAC,CAAC,CAAC;QAEH,IAAI,UAAU,EAAE;YACf,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAEpD,uEAAuE;YACvE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;YACpE,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YAE1D,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,UAAC,QAAQ;gBAC3C,IAAM,KAAK,GAAG,KAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;gBACtC,KAAK,CAAC,OAAO,GAAG,KAAI,CAAC,OAAO,CAAC;YAC9B,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;SAClB;IACF,CAAC;IACF,yBAAC;AAAD,CAAC,AA7HD,CAAwC,SAAS,GA6HhD","sourcesContent":["// Internal Imports\nimport { Component } from '../component';\nimport {\n\tAxisPositions,\n\tScaleTypes,\n\tAxesOptions,\n\tRenderTypes,\n} from '../../interfaces';\nimport { Axis } from './axis';\nimport { Tools } from '../../tools';\nimport { DOMUtils } from '../../services';\nimport { Threshold } from '../essentials/threshold';\nimport { Events } from './../../interfaces';\n\nexport class TwoDimensionalAxes extends Component {\n\ttype = '2D-axes';\n\trenderType = RenderTypes.SVG;\n\n\tchildren: any = {};\n\n\tthresholds: Threshold[] = [];\n\n\tmargins = {\n\t\ttop: 0,\n\t\tright: 0,\n\t\tbottom: 0,\n\t\tleft: 0,\n\t};\n\n\trender(animate = false) {\n\t\tconst axes = {};\n\t\tconst axisPositions = Object.keys(AxisPositions);\n\t\tconst axesOptions = Tools.getProperty(this.getOptions(), 'axes');\n\n\t\taxisPositions.forEach((axisPosition) => {\n\t\t\tconst axisOptions = axesOptions[AxisPositions[axisPosition]];\n\t\t\tif (axisOptions) {\n\t\t\t\taxes[AxisPositions[axisPosition]] = true;\n\t\t\t}\n\t\t});\n\n\t\tthis.configs.axes = axes;\n\n\t\t// Check the configs to know which axes need to be rendered\n\t\taxisPositions.forEach((axisPositionKey) => {\n\t\t\tconst axisPosition = AxisPositions[axisPositionKey];\n\t\t\tif (\n\t\t\t\tthis.configs.axes[axisPosition] &&\n\t\t\t\t!this.children[axisPosition]\n\t\t\t) {\n\t\t\t\tconst axisComponent = new Axis(this.model, this.services, {\n\t\t\t\t\tposition: axisPosition,\n\t\t\t\t\taxes: this.configs.axes,\n\t\t\t\t\tmargins: this.margins,\n\t\t\t\t});\n\n\t\t\t\t// Set model, services & parent for the new axis component\n\t\t\t\taxisComponent.setModel(this.model);\n\t\t\t\taxisComponent.setServices(this.services);\n\t\t\t\taxisComponent.setParent(this.parent);\n\n\t\t\t\tthis.children[axisPosition] = axisComponent;\n\t\t\t}\n\t\t});\n\n\t\tObject.keys(this.children).forEach((childKey) => {\n\t\t\tconst child = this.children[childKey];\n\t\t\tchild.render(animate);\n\t\t});\n\n\t\tconst margins = {} as any;\n\n\t\tObject.keys(this.children).forEach((childKey) => {\n\t\t\tconst child = this.children[childKey];\n\t\t\tconst axisPosition = child.configs.position;\n\n\t\t\t// Grab the invisibly rendered axis' width & height, and set margins\n\t\t\t// Based off of that\n\t\t\t// We draw the invisible axis because of the async nature of d3 transitions\n\t\t\t// To be able to tell the final width & height of the axis when initiaing the transition\n\t\t\t// The invisible axis is updated instantly and without a transition\n\t\t\tconst invisibleAxisRef = child.getInvisibleAxisRef();\n\t\t\tconst {\n\t\t\t\twidth,\n\t\t\t\theight,\n\t\t\t} = DOMUtils.getSVGElementSize(invisibleAxisRef, { useBBox: true });\n\n\t\t\tlet offset;\n\t\t\tif (child.getTitleRef().empty()) {\n\t\t\t\toffset = 0;\n\t\t\t} else {\n\t\t\t\toffset = DOMUtils.getSVGElementSize(child.getTitleRef(), {\n\t\t\t\t\tuseBBox: true,\n\t\t\t\t}).height;\n\n\t\t\t\tif (\n\t\t\t\t\taxisPosition === AxisPositions.LEFT ||\n\t\t\t\t\taxisPosition === AxisPositions.RIGHT\n\t\t\t\t) {\n\t\t\t\t\toffset += 5;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tswitch (axisPosition) {\n\t\t\t\tcase AxisPositions.TOP:\n\t\t\t\t\tmargins.top = height + offset;\n\t\t\t\t\tbreak;\n\t\t\t\tcase AxisPositions.BOTTOM:\n\t\t\t\t\tmargins.bottom = height + offset;\n\t\t\t\t\tbreak;\n\t\t\t\tcase AxisPositions.LEFT:\n\t\t\t\t\tmargins.left = width + offset;\n\t\t\t\t\tbreak;\n\t\t\t\tcase AxisPositions.RIGHT:\n\t\t\t\t\tmargins.right = width + offset;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t});\n\n\t\t// If the new margins are different than the existing ones\n\t\tconst isNotEqual = Object.keys(margins).some((marginKey) => {\n\t\t\treturn this.margins[marginKey] !== margins[marginKey];\n\t\t});\n\n\t\tif (isNotEqual) {\n\t\t\tthis.margins = Object.assign(this.margins, margins);\n\n\t\t\t// also set new margins to model to allow external components to access\n\t\t\tthis.model.set({ axesMargins: this.margins }, { skipUpdate: true });\n\t\t\tthis.services.events.dispatchEvent(Events.ZoomBar.UPDATE);\n\n\t\t\tObject.keys(this.children).forEach((childKey) => {\n\t\t\t\tconst child = this.children[childKey];\n\t\t\t\tchild.margins = this.margins;\n\t\t\t});\n\n\t\t\tthis.render(true);\n\t\t}\n\t}\n}\n"]}
1
+ {"version":3,"file":"two-dimensional-axes.js","sourceRoot":"","sources":["two-dimensional-axes.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mBAAmB;AACnB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC;IAAwC,sCAAS;IAAjD;QAAA,qEAoIC;QAnIA,UAAI,GAAG,SAAS,CAAC;QACjB,gBAAU,GAAG,WAAW,CAAC,GAAG,CAAC;QAE7B,cAAQ,GAAQ,EAAE,CAAC;QAEnB,gBAAU,GAAgB,EAAE,CAAC;QAE7B,aAAO,GAAG;YACT,GAAG,EAAE,CAAC;YACN,KAAK,EAAE,CAAC;YACR,MAAM,EAAE,CAAC;YACT,IAAI,EAAE,CAAC;SACP,CAAC;;IAuHH,CAAC;IArHA,mCAAM,GAAN,UAAO,OAAe;QAAtB,iBAoHC;QApHM,wBAAA,EAAA,eAAe;QACrB,IAAM,IAAI,GAAG,EAAE,CAAC;QAChB,IAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACjD,IAAM,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,MAAM,CAAC,CAAC;QAEjE,aAAa,CAAC,OAAO,CAAC,UAAC,YAAY;YAClC,IAAM,WAAW,GAAG,WAAW,CAAC,aAAa,CAAC,Y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oIhD","sourcesContent":["// Internal Imports\nimport { Component } from '../component';\nimport { AxisPositions, RenderTypes, AxisFlavor } from '../../interfaces';\nimport { Axis } from './axis';\nimport { Tools } from '../../tools';\nimport { DOMUtils } from '../../services';\nimport { Threshold } from '../essentials/threshold';\nimport { Events } from './../../interfaces';\nimport { HoverAxis } from './hover-axis';\n\nexport class TwoDimensionalAxes extends Component {\n\ttype = '2D-axes';\n\trenderType = RenderTypes.SVG;\n\n\tchildren: any = {};\n\n\tthresholds: Threshold[] = [];\n\n\tmargins = {\n\t\ttop: 0,\n\t\tright: 0,\n\t\tbottom: 0,\n\t\tleft: 0,\n\t};\n\n\trender(animate = false) {\n\t\tconst axes = {};\n\t\tconst axisPositions = Object.keys(AxisPositions);\n\t\tconst axesOptions = Tools.getProperty(this.getOptions(), 'axes');\n\n\t\taxisPositions.forEach((axisPosition) => {\n\t\t\tconst axisOptions = axesOptions[AxisPositions[axisPosition]];\n\t\t\tif (axisOptions) {\n\t\t\t\taxes[AxisPositions[axisPosition]] = true;\n\t\t\t}\n\t\t});\n\n\t\tthis.configs.axes = axes;\n\n\t\t// Check the configs to know which axes need to be rendered\n\t\taxisPositions.forEach((axisPositionKey) => {\n\t\t\tconst axisPosition = AxisPositions[axisPositionKey];\n\t\t\tif (\n\t\t\t\tthis.configs.axes[axisPosition] &&\n\t\t\t\t!this.children[axisPosition]\n\t\t\t) {\n\t\t\t\tconst configs = {\n\t\t\t\t\tposition: axisPosition,\n\t\t\t\t\taxes: this.configs.axes,\n\t\t\t\t\tmargins: this.margins,\n\t\t\t\t};\n\n\t\t\t\tconst axisComponent =\n\t\t\t\t\tthis.model.axisFlavor === AxisFlavor.DEFAULT\n\t\t\t\t\t\t? new Axis(this.model, this.services, configs)\n\t\t\t\t\t\t: new HoverAxis(this.model, this.services, configs);\n\n\t\t\t\t// Set model, services & parent for the new axis component\n\t\t\t\taxisComponent.setModel(this.model);\n\t\t\t\taxisComponent.setServices(this.services);\n\t\t\t\taxisComponent.setParent(this.parent);\n\n\t\t\t\tthis.children[axisPosition] = axisComponent;\n\t\t\t}\n\t\t});\n\n\t\tObject.keys(this.children).forEach((childKey) => {\n\t\t\tconst child = this.children[childKey];\n\t\t\tchild.render(animate);\n\t\t});\n\n\t\tconst margins = {} as any;\n\n\t\tObject.keys(this.children).forEach((childKey) => {\n\t\t\tconst child = this.children[childKey];\n\t\t\tconst axisPosition = child.configs.position;\n\n\t\t\t// Grab the invisibly rendered axis' width & height, and set margins\n\t\t\t// Based off of that\n\t\t\t// We draw the invisible axis because of the async nature of d3 transitions\n\t\t\t// To be able to tell the final width & height of the axis when initiaing the transition\n\t\t\t// The invisible axis is updated instantly and without a transition\n\t\t\tconst invisibleAxisRef = child.getInvisibleAxisRef();\n\t\t\tconst {\n\t\t\t\twidth,\n\t\t\t\theight,\n\t\t\t} = DOMUtils.getSVGElementSize(invisibleAxisRef, { useBBox: true });\n\n\t\t\tlet offset;\n\t\t\tif (child.getTitleRef().empty()) {\n\t\t\t\toffset = 0;\n\t\t\t} else {\n\t\t\t\toffset = DOMUtils.getSVGElementSize(child.getTitleRef(), {\n\t\t\t\t\tuseBBox: true,\n\t\t\t\t}).height;\n\n\t\t\t\tif (\n\t\t\t\t\taxisPosition === AxisPositions.LEFT ||\n\t\t\t\t\taxisPosition === AxisPositions.RIGHT\n\t\t\t\t) {\n\t\t\t\t\toffset += 5;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tswitch (axisPosition) {\n\t\t\t\tcase AxisPositions.TOP:\n\t\t\t\t\tmargins.top = height + offset;\n\t\t\t\t\tbreak;\n\t\t\t\tcase AxisPositions.BOTTOM:\n\t\t\t\t\tmargins.bottom = height + offset;\n\t\t\t\t\tbreak;\n\t\t\t\tcase AxisPositions.LEFT:\n\t\t\t\t\tmargins.left = width + offset;\n\t\t\t\t\tbreak;\n\t\t\t\tcase AxisPositions.RIGHT:\n\t\t\t\t\tmargins.right = width + offset;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t});\n\n\t\tthis.services.events.dispatchEvent(Events.Axis.RENDER_COMPLETE);\n\n\t\t// If the new margins are different than the existing ones\n\t\tconst isNotEqual = Object.keys(margins).some((marginKey) => {\n\t\t\treturn this.margins[marginKey] !== margins[marginKey];\n\t\t});\n\n\t\tif (isNotEqual) {\n\t\t\tthis.margins = Object.assign(this.margins, margins);\n\n\t\t\t// also set new margins to model to allow external components to access\n\t\t\tthis.model.set({ axesMargins: this.margins }, { skipUpdate: true });\n\t\t\tthis.services.events.dispatchEvent(Events.ZoomBar.UPDATE);\n\n\t\t\tObject.keys(this.children).forEach((childKey) => {\n\t\t\t\tconst child = this.children[childKey];\n\t\t\t\tchild.margins = this.margins;\n\t\t\t});\n\n\t\t\tthis.render(true);\n\t\t}\n\t}\n}\n"]}
@@ -0,0 +1,11 @@
1
+ import { RenderTypes } from '../../interfaces';
2
+ import { Legend } from '../';
3
+ export declare class ColorScaleLegend extends Legend {
4
+ type: string;
5
+ renderType: RenderTypes;
6
+ private gradient_id;
7
+ init(): void;
8
+ handleAxisComplete: (event: CustomEvent<any>) => void;
9
+ render(animate?: boolean): void;
10
+ destroy(): void;
11
+ }
@@ -0,0 +1,236 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ extendStatics(d, b);
10
+ function __() { this.constructor = d; }
11
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
+ };
13
+ })();
14
+ // Internal Imports
15
+ import { Tools } from '../../tools';
16
+ import { ColorLegendType, Events, RenderTypes } from '../../interfaces';
17
+ import * as Configuration from '../../configuration';
18
+ import { Legend } from '../';
19
+ import { DOMUtils } from '../../services';
20
+ // D3 imports
21
+ import { axisBottom } from 'd3-axis';
22
+ import { scaleBand, scaleLinear } from 'd3-scale';
23
+ import { interpolateRound, quantize } from 'd3-interpolate';
24
+ var ColorScaleLegend = /** @class */ (function (_super) {
25
+ __extends(ColorScaleLegend, _super);
26
+ function ColorScaleLegend() {
27
+ var _this = _super !== null && _super.apply(this, arguments) || this;
28
+ _this.type = 'color-legend';
29
+ _this.renderType = RenderTypes.SVG;
30
+ _this.gradient_id = 'gradient-id-' + Math.floor(Math.random() * 99999999999);
31
+ _this.handleAxisComplete = function (event) {
32
+ var svg = _this.getComponentContainer();
33
+ var width = DOMUtils.getSVGElementSize(svg, {
34
+ useAttrs: true,
35
+ }).width;
36
+ var isDataLoading = Tools.getProperty(_this.getOptions(), 'data', 'loading');
37
+ if (width > Configuration.legend.color.barWidth && !isDataLoading) {
38
+ var title = Tools.getProperty(_this.getOptions(), 'heatmap', 'colorLegend', 'title');
39
+ var cartesianScales = _this.services.cartesianScales;
40
+ // Get available chart area
41
+ var mainXScale = cartesianScales.getMainXScale();
42
+ var xDimensions = mainXScale.range();
43
+ // Align legend with the axis
44
+ if (xDimensions[0] > 1) {
45
+ svg.select('g.legend').attr('transform', "translate(" + xDimensions[0] + ", 0)");
46
+ if (title) {
47
+ var textWidth = DOMUtils.getSVGElementSize(svg.select('g.legend-title').select('text'), { useBBox: true }).width;
48
+ // -9 since LEFT y-axis labels are moved towards the left by 9 by d3
49
+ var availableSpace = xDimensions[0] - textWidth - 9;
50
+ // If space is available align the the label with the axis labels
51
+ if (availableSpace > 1) {
52
+ svg.select('g.legend-title').attr('transform', "translate(" + availableSpace + ", 0)");
53
+ }
54
+ else {
55
+ // Move the legend down by 16 pixels to display legend text on top
56
+ svg.select('g.legend').attr('transform', "translate(" + xDimensions[0] + ", 16)");
57
+ // Align legend title with start of axis
58
+ svg.select('g.legend-title').attr('transform', "translate(" + xDimensions[0] + ", 0)");
59
+ }
60
+ }
61
+ }
62
+ }
63
+ };
64
+ return _this;
65
+ }
66
+ ColorScaleLegend.prototype.init = function () {
67
+ var eventsFragment = this.services.events;
68
+ // Highlight correct circle on legend item hovers
69
+ eventsFragment.addEventListener(Events.Axis.RENDER_COMPLETE, this.handleAxisComplete);
70
+ };
71
+ ColorScaleLegend.prototype.render = function (animate) {
72
+ if (animate === void 0) { animate = false; }
73
+ var options = this.getOptions();
74
+ var customColors = Tools.getProperty(options, 'color', 'gradient', 'colors');
75
+ var colorScaleType = Tools.getProperty(options, 'heatmap', 'colorLegend', 'type');
76
+ var colorPairingOption = Tools.getProperty(options, 'color', 'pairing', 'option');
77
+ var title = Tools.getProperty(options, 'heatmap', 'colorLegend', 'title');
78
+ var customColorsEnabled = !Tools.isEmpty(customColors);
79
+ var domain = this.model.getValueDomain();
80
+ var svg = this.getComponentContainer();
81
+ // Clear DOM if loading
82
+ var isDataLoading = Tools.getProperty(this.getOptions(), 'data', 'loading');
83
+ if (isDataLoading) {
84
+ svg.html('');
85
+ return;
86
+ }
87
+ var legend = DOMUtils.appendOrSelect(svg, 'g.legend');
88
+ var axis = DOMUtils.appendOrSelect(legend, 'g.legend-axis');
89
+ var width = DOMUtils.getSVGElementSize(svg, {
90
+ useAttrs: true,
91
+ }).width;
92
+ var barWidth = Configuration.legend.color.barWidth;
93
+ if (width <= Configuration.legend.color.barWidth) {
94
+ barWidth = width;
95
+ }
96
+ if (title) {
97
+ var legendTitleGroup = DOMUtils.appendOrSelect(svg, 'g.legend-title');
98
+ var legendTitle = DOMUtils.appendOrSelect(legendTitleGroup, 'text');
99
+ legendTitle.text(title).attr('dy', '0.7em');
100
+ // Move the legend down by 16 pixels to display legend text on top
101
+ legend.attr('transform', "translate(0, 16)");
102
+ }
103
+ // If domain consists of negative and positive values, use diverging palettes
104
+ var colorScheme = domain[0] < 0 && domain[1] > 0 ? 'diverge' : 'mono';
105
+ // Use default color pairing options if not in defined range
106
+ if (colorPairingOption < 1 &&
107
+ colorPairingOption > 4 &&
108
+ colorScheme === 'mono') {
109
+ colorPairingOption = 1;
110
+ }
111
+ else if (colorPairingOption < 1 &&
112
+ colorPairingOption > 2 &&
113
+ colorScheme === 'diverge') {
114
+ colorPairingOption = 1;
115
+ }
116
+ var colorPairing = [];
117
+ // Carbon charts has 11 colors for a single monochromatic palette & 17 for a divergent palette
118
+ var colorGroupingLength = colorScheme === 'diverge' ? 17 : 11;
119
+ if (!customColorsEnabled) {
120
+ // Add class names to list and the amount based on the color scheme
121
+ for (var i = 1; i < colorGroupingLength + 1; i++) {
122
+ colorPairing.push(colorScaleType === ColorLegendType.LINEAR
123
+ ? "stop-color-" + colorScheme + "-" + colorPairingOption + "-" + i
124
+ : "fill-" + colorScheme + "-" + colorPairingOption + "-" + i);
125
+ }
126
+ }
127
+ else {
128
+ // Use custom colors
129
+ colorPairing = customColors;
130
+ }
131
+ if (colorScaleType === ColorLegendType.LINEAR) {
132
+ var stopLengthPercentage_1 = 100 / (colorPairing.length - 1);
133
+ // Generate the gradient
134
+ var linearGradient = DOMUtils.appendOrSelect(legend, 'linearGradient');
135
+ linearGradient
136
+ .attr('id', this.gradient_id + "-legend")
137
+ .selectAll('stop')
138
+ .data(colorPairing)
139
+ .enter()
140
+ .append('stop')
141
+ .attr('offset', function (_, i) { return i * stopLengthPercentage_1 + "%"; })
142
+ .attr('class', function (_, i) { return colorPairing[i]; })
143
+ .attr('stop-color', function (d) { return d; });
144
+ // Create the legend container
145
+ var rectangle = DOMUtils.appendOrSelect(legend, 'rect');
146
+ rectangle
147
+ .attr('width', barWidth)
148
+ .attr('height', Configuration.legend.color.barHeight)
149
+ .style('fill', "url(#" + this.gradient_id + "-legend)");
150
+ // Create scale & ticks
151
+ var linearScale = scaleLinear()
152
+ .domain(domain)
153
+ .range([0, barWidth]);
154
+ domain.splice(1, 0, (domain[0] + domain[1]) / 2);
155
+ var xAxis = axisBottom(linearScale)
156
+ .tickSize(0)
157
+ .tickValues(domain);
158
+ // Align axes at the bottom of the rectangle and delete the domain line
159
+ axis.attr('transform', "translate(0," + Configuration.legend.color.axisYTranslation + ")").call(xAxis);
160
+ // Remove domain
161
+ axis.select('.domain').remove();
162
+ // Align text to fit in container
163
+ axis.style('text-anchor', 'start');
164
+ }
165
+ else if (colorScaleType === ColorLegendType.QUANTIZE) {
166
+ // Generate equal chunks between range to act as ticks
167
+ var interpolator = interpolateRound(domain[0], domain[1]);
168
+ var quant_1 = quantize(interpolator, colorPairing.length);
169
+ // If divergent && non-custom color, remove 0/white from being displayed
170
+ if (!customColorsEnabled && colorScheme === 'diverge') {
171
+ colorPairing.splice(colorPairing.length / 2, 1);
172
+ }
173
+ var colorScaleBand_1 = scaleBand()
174
+ .domain(colorPairing)
175
+ .range([0, barWidth]);
176
+ // Render the quantized rectangles
177
+ var rectangle = DOMUtils.appendOrSelect(legend, 'g.quantized-rect');
178
+ rectangle
179
+ .selectAll('rect')
180
+ .data(colorScaleBand_1.domain())
181
+ .join('rect')
182
+ .attr('x', function (d) { return colorScaleBand_1(d); })
183
+ .attr('y', 0)
184
+ .attr('width', Math.max(0, colorScaleBand_1.bandwidth()) - 1)
185
+ .attr('height', Configuration.legend.color.barHeight)
186
+ .attr('class', function (d) { return d; })
187
+ .attr('fill', function (d) { return d; });
188
+ var xAxis = axisBottom(colorScaleBand_1)
189
+ .tickSize(0)
190
+ .tickValues(colorPairing)
191
+ .tickFormat(function (_, i) {
192
+ // Display every other tick to create space
193
+ if (!customColorsEnabled &&
194
+ ((i + 1) % 2 === 0 || i === colorPairing.length - 1)) {
195
+ return null;
196
+ }
197
+ // Use the quant interpolators as ticks
198
+ return quant_1[i].toString();
199
+ });
200
+ // Align axis to match bandwidth start after initial (white)
201
+ var axisTranslation = colorScaleBand_1.bandwidth() / 2;
202
+ axis.attr('transform', "translate(" + (!customColorsEnabled && colorScheme === 'diverge' ? '-' : '') + axisTranslation + ", " + Configuration.legend.color.axisYTranslation + ")").call(xAxis);
203
+ // Append the last tick
204
+ var firstTick = axis.select('g.tick').clone(true);
205
+ firstTick
206
+ .attr('transform', "translate(" + (barWidth +
207
+ (!customColorsEnabled && colorScheme === 'diverge'
208
+ ? axisTranslation
209
+ : -axisTranslation)) + ", 0)")
210
+ .classed('final-tick', true)
211
+ .select('text')
212
+ .text(quant_1[quant_1.length - 1]);
213
+ axis.enter().append(firstTick.node());
214
+ axis.select('.domain').remove();
215
+ }
216
+ else {
217
+ throw Error('Entered color legend type is not supported.');
218
+ }
219
+ // Translate last axis tick if barWidth equals chart width
220
+ if (width <= Configuration.legend.color.barWidth) {
221
+ var lastTick = axis.select('g.tick:last-of-type text');
222
+ var width_1 = DOMUtils.getSVGElementSize(lastTick, {
223
+ useBBox: true,
224
+ }).width;
225
+ lastTick.attr('x', "-" + width_1);
226
+ }
227
+ };
228
+ ColorScaleLegend.prototype.destroy = function () {
229
+ // Remove legend listeners
230
+ var eventsFragment = this.services.events;
231
+ eventsFragment.removeEventListener(Events.Axis.RENDER_COMPLETE, this.handleAxisComplete);
232
+ };
233
+ return ColorScaleLegend;
234
+ }(Legend));
235
+ export { ColorScaleLegend };
236
+ //# sourceMappingURL=../../../src/components/essentials/color-scale-legend.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color-scale-legend.js","sourceRoot":"","sources":["color-scale-legend.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mBAAmB;AACnB,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,WAAW,EAAS,MAAM,kBAAkB,CAAC;AAC/E,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,aAAa;AACb,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE5D;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AY,EAAE,IAAI,CAAC;iBAC3B,MAAM,CAAC,MAAM,CAAC;iBACd,IAAI,CAAC,OAAK,CAAC,OAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;YAEhC,IAAI,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC;YACtC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,CAAC;SAChC;aAAM;YACN,MAAM,KAAK,CAAC,6CAA6C,CAAC,CAAC;SAC3D;QAED,0DAA0D;QAC1D,IAAI,KAAK,IAAI,aAAa,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE;YACjD,IAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC;YACjD,IAAA;;oBAAK,CAEV;YACH,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,MAAI,OAAO,CAAC,CAAC;SAChC;IACF,CAAC;IAED,kCAAO,GAAP;QACC,0BAA0B;QAC1B,IAAM,cAAc,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;QAC5C,cAAc,CAAC,mBAAmB,CACjC,MAAM,CAAC,IAAI,CAAC,eAAe,EAC3B,IAAI,CAAC,kBAAkB,CACvB,CAAC;IACH,CAAC;IACF,uBAAC;AAAD,CAAC,AArVD,CAAsC,MAAM,GAqV3C","sourcesContent":["// Internal Imports\nimport { Tools } from '../../tools';\nimport { ColorLegendType, Events, RenderTypes, Roles } from '../../interfaces';\nimport * as Configuration from '../../configuration';\nimport { Legend } from '../';\nimport { DOMUtils } from '../../services';\n\n// D3 imports\nimport { axisBottom } from 'd3-axis';\nimport { scaleBand, scaleLinear } from 'd3-scale';\nimport { interpolateRound, quantize } from 'd3-interpolate';\n\nexport class ColorScaleLegend extends Legend {\n\ttype = 'color-legend';\n\trenderType = RenderTypes.SVG;\n\n\tprivate gradient_id =\n\t\t'gradient-id-' + Math.floor(Math.random() * 99999999999);\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(\n\t\t\tEvents.Axis.RENDER_COMPLETE,\n\t\t\tthis.handleAxisComplete\n\t\t);\n\t}\n\n\thandleAxisComplete = (event: CustomEvent) => {\n\t\tconst svg = this.getComponentContainer();\n\n\t\tconst { width } = DOMUtils.getSVGElementSize(svg, {\n\t\t\tuseAttrs: true,\n\t\t});\n\n\t\tconst isDataLoading = Tools.getProperty(\n\t\t\tthis.getOptions(),\n\t\t\t'data',\n\t\t\t'loading'\n\t\t);\n\n\t\tif (width > Configuration.legend.color.barWidth && !isDataLoading) {\n\t\t\tconst title = Tools.getProperty(\n\t\t\t\tthis.getOptions(),\n\t\t\t\t'heatmap',\n\t\t\t\t'colorLegend',\n\t\t\t\t'title'\n\t\t\t);\n\n\t\t\tconst { cartesianScales } = this.services;\n\t\t\t// Get available chart area\n\t\t\tconst mainXScale = cartesianScales.getMainXScale();\n\n\t\t\tconst xDimensions = mainXScale.range();\n\n\t\t\t// Align legend with the axis\n\t\t\tif (xDimensions[0] > 1) {\n\t\t\t\tsvg.select('g.legend').attr(\n\t\t\t\t\t'transform',\n\t\t\t\t\t`translate(${xDimensions[0]}, 0)`\n\t\t\t\t);\n\n\t\t\t\tif (title) {\n\t\t\t\t\tconst {\n\t\t\t\t\t\twidth: textWidth,\n\t\t\t\t\t} = DOMUtils.getSVGElementSize(\n\t\t\t\t\t\tsvg.select('g.legend-title').select('text'),\n\t\t\t\t\t\t{ useBBox: true }\n\t\t\t\t\t);\n\n\t\t\t\t\t// -9 since LEFT y-axis labels are moved towards the left by 9 by d3\n\t\t\t\t\tconst availableSpace = xDimensions[0] - textWidth - 9;\n\n\t\t\t\t\t// If space is available align the the label with the axis labels\n\t\t\t\t\tif (availableSpace > 1) {\n\t\t\t\t\t\tsvg.select('g.legend-title').attr(\n\t\t\t\t\t\t\t'transform',\n\t\t\t\t\t\t\t`translate(${availableSpace}, 0)`\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Move the legend down by 16 pixels to display legend text on top\n\t\t\t\t\t\tsvg.select('g.legend').attr(\n\t\t\t\t\t\t\t'transform',\n\t\t\t\t\t\t\t`translate(${xDimensions[0]}, 16)`\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// Align legend title with start of axis\n\t\t\t\t\t\tsvg.select('g.legend-title').attr(\n\t\t\t\t\t\t\t'transform',\n\t\t\t\t\t\t\t`translate(${xDimensions[0]}, 0)`\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\trender(animate = false) {\n\t\tconst options = this.getOptions();\n\n\t\tconst customColors = Tools.getProperty(\n\t\t\toptions,\n\t\t\t'color',\n\t\t\t'gradient',\n\t\t\t'colors'\n\t\t);\n\n\t\tconst colorScaleType = Tools.getProperty(\n\t\t\toptions,\n\t\t\t'heatmap',\n\t\t\t'colorLegend',\n\t\t\t'type'\n\t\t);\n\n\t\tlet colorPairingOption = Tools.getProperty(\n\t\t\toptions,\n\t\t\t'color',\n\t\t\t'pairing',\n\t\t\t'option'\n\t\t);\n\n\t\tconst title = Tools.getProperty(\n\t\t\toptions,\n\t\t\t'heatmap',\n\t\t\t'colorLegend',\n\t\t\t'title'\n\t\t);\n\n\t\tconst customColorsEnabled = !Tools.isEmpty(customColors);\n\t\tconst domain = this.model.getValueDomain();\n\n\t\tconst svg = this.getComponentContainer();\n\n\t\t// Clear DOM if loading\n\t\tconst isDataLoading = Tools.getProperty(\n\t\t\tthis.getOptions(),\n\t\t\t'data',\n\t\t\t'loading'\n\t\t);\n\n\t\tif (isDataLoading) {\n\t\t\tsvg.html('');\n\t\t\treturn;\n\t\t}\n\n\t\tconst legend = DOMUtils.appendOrSelect(svg, 'g.legend');\n\t\tconst axis = DOMUtils.appendOrSelect(legend, 'g.legend-axis');\n\n\t\tconst { width } = DOMUtils.getSVGElementSize(svg, {\n\t\t\tuseAttrs: true,\n\t\t});\n\n\t\tlet barWidth = Configuration.legend.color.barWidth;\n\t\tif (width <= Configuration.legend.color.barWidth) {\n\t\t\tbarWidth = width;\n\t\t}\n\n\t\tif (title) {\n\t\t\tconst legendTitleGroup = DOMUtils.appendOrSelect(\n\t\t\t\tsvg,\n\t\t\t\t'g.legend-title'\n\t\t\t);\n\t\t\tconst legendTitle = DOMUtils.appendOrSelect(\n\t\t\t\tlegendTitleGroup,\n\t\t\t\t'text'\n\t\t\t);\n\t\t\tlegendTitle.text(title).attr('dy', '0.7em');\n\n\t\t\t// Move the legend down by 16 pixels to display legend text on top\n\t\t\tlegend.attr('transform', `translate(0, 16)`);\n\t\t}\n\n\t\t// If domain consists of negative and positive values, use diverging palettes\n\t\tconst colorScheme = domain[0] < 0 && domain[1] > 0 ? 'diverge' : 'mono';\n\n\t\t// Use default color pairing options if not in defined range\n\t\tif (\n\t\t\tcolorPairingOption < 1 &&\n\t\t\tcolorPairingOption > 4 &&\n\t\t\tcolorScheme === 'mono'\n\t\t) {\n\t\t\tcolorPairingOption = 1;\n\t\t} else if (\n\t\t\tcolorPairingOption < 1 &&\n\t\t\tcolorPairingOption > 2 &&\n\t\t\tcolorScheme === 'diverge'\n\t\t) {\n\t\t\tcolorPairingOption = 1;\n\t\t}\n\n\t\tlet colorPairing = [];\n\t\t// Carbon charts has 11 colors for a single monochromatic palette & 17 for a divergent palette\n\t\tlet colorGroupingLength = colorScheme === 'diverge' ? 17 : 11;\n\n\t\tif (!customColorsEnabled) {\n\t\t\t// Add class names to list and the amount based on the color scheme\n\t\t\tfor (let i = 1; i < colorGroupingLength + 1; i++) {\n\t\t\t\tcolorPairing.push(\n\t\t\t\t\tcolorScaleType === ColorLegendType.LINEAR\n\t\t\t\t\t\t? `stop-color-${colorScheme}-${colorPairingOption}-${i}`\n\t\t\t\t\t\t: `fill-${colorScheme}-${colorPairingOption}-${i}`\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\t// Use custom colors\n\t\t\tcolorPairing = customColors;\n\t\t}\n\n\t\tif (colorScaleType === ColorLegendType.LINEAR) {\n\t\t\tconst stopLengthPercentage = 100 / (colorPairing.length - 1);\n\n\t\t\t// Generate the gradient\n\t\t\tconst linearGradient = DOMUtils.appendOrSelect(\n\t\t\t\tlegend,\n\t\t\t\t'linearGradient'\n\t\t\t);\n\t\t\tlinearGradient\n\t\t\t\t.attr('id', `${this.gradient_id}-legend`)\n\t\t\t\t.selectAll('stop')\n\t\t\t\t.data(colorPairing)\n\t\t\t\t.enter()\n\t\t\t\t.append('stop')\n\t\t\t\t.attr('offset', (_, i) => `${i * stopLengthPercentage}%`)\n\t\t\t\t.attr('class', (_, i) => colorPairing[i])\n\t\t\t\t.attr('stop-color', (d) => d);\n\n\t\t\t// Create the legend container\n\t\t\tconst rectangle = DOMUtils.appendOrSelect(legend, 'rect');\n\t\t\trectangle\n\t\t\t\t.attr('width', barWidth)\n\t\t\t\t.attr('height', Configuration.legend.color.barHeight)\n\t\t\t\t.style('fill', `url(#${this.gradient_id}-legend)`);\n\n\t\t\t// Create scale & ticks\n\t\t\tconst linearScale = scaleLinear()\n\t\t\t\t.domain(domain)\n\t\t\t\t.range([0, barWidth]);\n\t\t\tdomain.splice(1, 0, (domain[0] + domain[1]) / 2);\n\n\t\t\tconst xAxis = axisBottom(linearScale)\n\t\t\t\t.tickSize(0)\n\t\t\t\t.tickValues(domain);\n\n\t\t\t// Align axes at the bottom of the rectangle and delete the domain line\n\t\t\taxis.attr(\n\t\t\t\t'transform',\n\t\t\t\t`translate(0,${Configuration.legend.color.axisYTranslation})`\n\t\t\t).call(xAxis);\n\n\t\t\t// Remove domain\n\t\t\taxis.select('.domain').remove();\n\n\t\t\t// Align text to fit in container\n\t\t\taxis.style('text-anchor', 'start');\n\t\t} else if (colorScaleType === ColorLegendType.QUANTIZE) {\n\t\t\t// Generate equal chunks between range to act as ticks\n\t\t\tconst interpolator = interpolateRound(domain[0], domain[1]);\n\t\t\tconst quant = quantize(interpolator, colorPairing.length);\n\n\t\t\t// If divergent && non-custom color, remove 0/white from being displayed\n\t\t\tif (!customColorsEnabled && colorScheme === 'diverge') {\n\t\t\t\tcolorPairing.splice(colorPairing.length / 2, 1);\n\t\t\t}\n\n\t\t\tconst colorScaleBand = scaleBand()\n\t\t\t\t.domain(colorPairing)\n\t\t\t\t.range([0, barWidth]);\n\n\t\t\t// Render the quantized rectangles\n\t\t\tconst rectangle = DOMUtils.appendOrSelect(\n\t\t\t\tlegend,\n\t\t\t\t'g.quantized-rect'\n\t\t\t);\n\n\t\t\trectangle\n\t\t\t\t.selectAll('rect')\n\t\t\t\t.data(colorScaleBand.domain())\n\t\t\t\t.join('rect')\n\t\t\t\t.attr('x', (d) => colorScaleBand(d))\n\t\t\t\t.attr('y', 0)\n\t\t\t\t.attr('width', Math.max(0, colorScaleBand.bandwidth()) - 1)\n\t\t\t\t.attr('height', Configuration.legend.color.barHeight)\n\t\t\t\t.attr('class', (d) => d)\n\t\t\t\t.attr('fill', (d) => d);\n\n\t\t\tconst xAxis = axisBottom(colorScaleBand)\n\t\t\t\t.tickSize(0)\n\t\t\t\t.tickValues(colorPairing)\n\t\t\t\t.tickFormat((_, i) => {\n\t\t\t\t\t// Display every other tick to create space\n\t\t\t\t\tif (\n\t\t\t\t\t\t!customColorsEnabled &&\n\t\t\t\t\t\t((i + 1) % 2 === 0 || i === colorPairing.length - 1)\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Use the quant interpolators as ticks\n\t\t\t\t\treturn quant[i].toString();\n\t\t\t\t});\n\n\t\t\t// Align axis to match bandwidth start after initial (white)\n\t\t\tconst axisTranslation = colorScaleBand.bandwidth() / 2;\n\t\t\taxis.attr(\n\t\t\t\t'transform',\n\t\t\t\t`translate(${\n\t\t\t\t\t!customColorsEnabled && colorScheme === 'diverge' ? '-' : ''\n\t\t\t\t}${axisTranslation}, ${\n\t\t\t\t\tConfiguration.legend.color.axisYTranslation\n\t\t\t\t})`\n\t\t\t).call(xAxis);\n\n\t\t\t// Append the last tick\n\t\t\tconst firstTick = axis.select('g.tick').clone(true);\n\t\t\tfirstTick\n\t\t\t\t.attr(\n\t\t\t\t\t'transform',\n\t\t\t\t\t`translate(${\n\t\t\t\t\t\tbarWidth +\n\t\t\t\t\t\t(!customColorsEnabled && colorScheme === 'diverge'\n\t\t\t\t\t\t\t? axisTranslation\n\t\t\t\t\t\t\t: -axisTranslation)\n\t\t\t\t\t}, 0)`\n\t\t\t\t)\n\t\t\t\t.classed('final-tick', true)\n\t\t\t\t.select('text')\n\t\t\t\t.text(quant[quant.length - 1]);\n\n\t\t\taxis.enter().append(firstTick.node());\n\t\t\taxis.select('.domain').remove();\n\t\t} else {\n\t\t\tthrow Error('Entered color legend type is not supported.');\n\t\t}\n\n\t\t// Translate last axis tick if barWidth equals chart width\n\t\tif (width <= Configuration.legend.color.barWidth) {\n\t\t\tconst lastTick = axis.select('g.tick:last-of-type text');\n\t\t\tconst { width } = DOMUtils.getSVGElementSize(lastTick, {\n\t\t\t\tuseBBox: true,\n\t\t\t});\n\t\t\tlastTick.attr('x', `-${width}`);\n\t\t}\n\t}\n\n\tdestroy() {\n\t\t// Remove legend listeners\n\t\tconst eventsFragment = this.services.events;\n\t\teventsFragment.removeEventListener(\n\t\t\tEvents.Axis.RENDER_COMPLETE,\n\t\t\tthis.handleAxisComplete\n\t\t);\n\t}\n}\n"]}
@@ -0,0 +1,25 @@
1
+ import { Component } from '../component';
2
+ import { RenderTypes } from '../../interfaces';
3
+ export declare class Heatmap extends Component {
4
+ type: string;
5
+ renderType: RenderTypes;
6
+ private matrix;
7
+ private xBandwidth;
8
+ private yBandwidth;
9
+ private translationUnits;
10
+ init(): void;
11
+ render(animate?: boolean): void;
12
+ /**
13
+ * Generates a box using lines to create a hover effect
14
+ * The lines have drop shadow in their respective direction
15
+ * @param parentTag - tag name
16
+ * @param xBandwidth - X length
17
+ * @param yBandwidth - y length
18
+ */
19
+ private createOuterBox;
20
+ private determineDividerStatus;
21
+ addEventListener(): void;
22
+ handleAxisOnHover: (event: CustomEvent<any>) => void;
23
+ handleAxisMouseOut: (event: CustomEvent<any>) => void;
24
+ destroy(): void;
25
+ }