@carbon/charts 0.54.12 → 0.55.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.
- package/CHANGELOG.md +30 -0
- package/build/demo/data/heatmap.d.ts +34 -0
- package/build/src/components/essentials/color-scale-legend.d.ts +7 -1
- package/build/src/model/heatmap.d.ts +2 -2
- package/build/stories/tutorials/index.d.ts +1 -1
- package/bundle.js +1 -1
- package/components/axes/toolbar.js +11 -7
- package/components/axes/toolbar.js.map +1 -1
- package/components/essentials/color-scale-legend.d.ts +7 -1
- package/components/essentials/color-scale-legend.js +108 -114
- package/components/essentials/color-scale-legend.js.map +1 -1
- package/components/essentials/modal.js +5 -5
- package/components/essentials/modal.js.map +1 -1
- package/demo/data/bundle.js +1 -1
- package/demo/data/heatmap.d.ts +34 -0
- package/demo/data/heatmap.js +18 -0
- package/demo/data/heatmap.js.map +1 -1
- package/demo/data/index.js +5 -0
- package/demo/data/index.js.map +1 -1
- package/demo/tsconfig.tsbuildinfo +3 -3
- package/model/heatmap.d.ts +2 -2
- package/model/heatmap.js +12 -24
- package/model/heatmap.js.map +1 -1
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +6 -6
|
@@ -55,7 +55,7 @@ var Toolbar = /** @class */ (function (_super) {
|
|
|
55
55
|
if (!this.overflowMenu) {
|
|
56
56
|
this.overflowMenu = container
|
|
57
57
|
.append('div')
|
|
58
|
-
.attr('class', 'bx--overflow-menu-options bx--overflow-menu--flip')
|
|
58
|
+
.attr('class', 'bx--overflow-menu-options bx--overflow-menu--flip cds--overflow-menu-options cds--overflow-menu--flip')
|
|
59
59
|
.attr('tabindex', -1)
|
|
60
60
|
.attr('role', 'menu')
|
|
61
61
|
.html("<ul></ul>");
|
|
@@ -73,7 +73,7 @@ var Toolbar = /** @class */ (function (_super) {
|
|
|
73
73
|
var enteringToolbarControls = toolbarControls
|
|
74
74
|
.enter()
|
|
75
75
|
.append('div')
|
|
76
|
-
.attr('class', 'toolbar-control bx--overflow-menu')
|
|
76
|
+
.attr('class', 'toolbar-control bx--overflow-menu cds--overflow-menu')
|
|
77
77
|
.attr('role', 'button');
|
|
78
78
|
var self_1 = this;
|
|
79
79
|
var allToolbarControls = enteringToolbarControls
|
|
@@ -81,9 +81,9 @@ var Toolbar = /** @class */ (function (_super) {
|
|
|
81
81
|
.classed('disabled', function (d) { return d.shouldBeDisabled(); })
|
|
82
82
|
.attr('aria-disabled', function (d) { return d.shouldBeDisabled(); })
|
|
83
83
|
.attr('aria-label', function (d) { return d.title; })
|
|
84
|
-
.html(function (d) { return "\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("control-" + d.id) + "\" aria-label=\"" + d.title + "\">\n\t\t\t\t<svg focusable=\"false\" preserveAspectRatio=\"xMidYMid meet\" style=\"will-change: transform; width: " + (d.iconSVG.width !== undefined ? d.iconSVG.width : '20px') + "; height: " + (d.iconSVG.height !== undefined
|
|
84
|
+
.html(function (d) { return "\n\t\t\t<button\n\t\t\t\tclass=\"bx--overflow-menu__trigger cds--overflow-menu__trigger\"\n\t\t\t\taria-haspopup=\"true\" aria-expanded=\"false\" id=\"" + _this.services.domUtils.generateElementIDString("control-" + d.id) + "\" aria-label=\"" + d.title + "\">\n\t\t\t\t<svg focusable=\"false\" preserveAspectRatio=\"xMidYMid meet\" style=\"will-change: transform; width: " + (d.iconSVG.width !== undefined ? d.iconSVG.width : '20px') + "; height: " + (d.iconSVG.height !== undefined
|
|
85
85
|
? d.iconSVG.height
|
|
86
|
-
: '20px') + "\" 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>"; })
|
|
86
|
+
: '20px') + "\" xmlns=\"http://www.w3.org/2000/svg\" class=\"bx--overflow-menu__icon cds--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>"; })
|
|
87
87
|
.each(function (d, index) {
|
|
88
88
|
var _this = this;
|
|
89
89
|
select(this)
|
|
@@ -127,15 +127,18 @@ var Toolbar = /** @class */ (function (_super) {
|
|
|
127
127
|
.attr('id', function (d) {
|
|
128
128
|
return _this.services.domUtils.generateElementIDString("control-" + d.id);
|
|
129
129
|
})
|
|
130
|
-
.attr('class', 'bx--overflow-menu-options__option')
|
|
130
|
+
.attr('class', 'bx--overflow-menu-options__option cds--overflow-menu-options__option')
|
|
131
131
|
.attr('role', 'menuitem');
|
|
132
132
|
enteringOverflowMenuControls
|
|
133
133
|
.append('button')
|
|
134
|
-
.attr('class', 'bx--overflow-menu-options__btn');
|
|
134
|
+
.attr('class', 'bx--overflow-menu-options__btn cds--overflow-menu-options__btn');
|
|
135
135
|
enteringOverflowMenuControls
|
|
136
136
|
.merge(overflowMenuControls)
|
|
137
137
|
.classed('bx--overflow-menu-options__option--disabled', function (d) {
|
|
138
138
|
return d.shouldBeDisabled();
|
|
139
|
+
})
|
|
140
|
+
.classed('cds--overflow-menu-options__option--disabled', function (d) {
|
|
141
|
+
return d.shouldBeDisabled();
|
|
139
142
|
})
|
|
140
143
|
.attr('aria-disabled', function (d) { return d.shouldBeDisabled(); })
|
|
141
144
|
.selectAll('button')
|
|
@@ -153,7 +156,8 @@ var Toolbar = /** @class */ (function (_super) {
|
|
|
153
156
|
// update overflow button background
|
|
154
157
|
if (this.overflowButton) {
|
|
155
158
|
this.overflowButton.attr('aria-expanded', show);
|
|
156
|
-
select(this.overflowButton.node().parentNode)
|
|
159
|
+
select(this.overflowButton.node().parentNode)
|
|
160
|
+
.classed('bx--overflow-menu--open', show).classed('cds--overflow-menu--open', show);
|
|
157
161
|
}
|
|
158
162
|
if (show) {
|
|
159
163
|
this.services.events.dispatchEvent(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U;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"]}
|
|
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,qEAmpBC;QAjpBA,UAAI,GAAG,S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,oBAAoB;oBACxB,KAAK,EAAE,eAAe;oBACtB,gBAAgB,EAAE,cAAM,OAAA,KAAK,EAAL,CAAK;oBAC7B,OAAO,EAAE;wBACR,OAAO,EAAE,IAAI,CAAC,oBAAoB,CAAC,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;IAjpBM,gBAAQ,GAAG,CAAC,CAAC;IAkpBrB,cAAC;CAAA,AAnpBD,CAA6B,SAAS,GAmpBrC;SAnpBY,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 cds--overflow-menu-options cds--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 cds--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 cds--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 cds--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 cds--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 cds--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.classed('cds--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)\n\t\t\t\t.classed(\n\t\t\t\t\t'bx--overflow-menu--open',\n\t\t\t\t\tshow\n\t\t\t\t).classed(\n\t\t\t\t\t'cds--overflow-menu--open',\n\t\t\t\t\tshow\n\t\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"]}
|
|
@@ -5,7 +5,13 @@ export declare class ColorScaleLegend extends Legend {
|
|
|
5
5
|
renderType: RenderTypes;
|
|
6
6
|
private gradient_id;
|
|
7
7
|
init(): void;
|
|
8
|
-
|
|
8
|
+
handleAxisCompleteEvent: (event: CustomEvent<any>) => void;
|
|
9
9
|
render(animate?: boolean): void;
|
|
10
|
+
drawLinear(colorPairing: any, legendGroupElement: any, barWidth: any): void;
|
|
11
|
+
/**
|
|
12
|
+
* Renders quantized legend
|
|
13
|
+
* @returns number (range start)
|
|
14
|
+
*/
|
|
15
|
+
drawQuantize(colorPairing: any, colorScheme: any, customColorsEnabled: any, legendGroupElement: any, barWidth: any): number;
|
|
10
16
|
destroy(): void;
|
|
11
17
|
}
|
|
@@ -20,7 +20,7 @@ import { DOMUtils } from '../../services';
|
|
|
20
20
|
// D3 imports
|
|
21
21
|
import { axisBottom } from 'd3-axis';
|
|
22
22
|
import { scaleBand, scaleLinear } from 'd3-scale';
|
|
23
|
-
import {
|
|
23
|
+
import { interpolateNumber, quantize } from 'd3-interpolate';
|
|
24
24
|
var ColorScaleLegend = /** @class */ (function (_super) {
|
|
25
25
|
__extends(ColorScaleLegend, _super);
|
|
26
26
|
function ColorScaleLegend() {
|
|
@@ -28,7 +28,8 @@ var ColorScaleLegend = /** @class */ (function (_super) {
|
|
|
28
28
|
_this.type = 'color-legend';
|
|
29
29
|
_this.renderType = RenderTypes.SVG;
|
|
30
30
|
_this.gradient_id = 'gradient-id-' + Math.floor(Math.random() * 99999999999);
|
|
31
|
-
|
|
31
|
+
// Position legend after axis have rendered
|
|
32
|
+
_this.handleAxisCompleteEvent = function (event) {
|
|
32
33
|
var svg = _this.getComponentContainer();
|
|
33
34
|
var width = DOMUtils.getSVGElementSize(svg, {
|
|
34
35
|
useAttrs: true,
|
|
@@ -37,7 +38,7 @@ var ColorScaleLegend = /** @class */ (function (_super) {
|
|
|
37
38
|
if (width > Configuration.legend.color.barWidth && !isDataLoading) {
|
|
38
39
|
var title = Tools.getProperty(_this.getOptions(), 'heatmap', 'colorLegend', 'title');
|
|
39
40
|
var cartesianScales = _this.services.cartesianScales;
|
|
40
|
-
// Get
|
|
41
|
+
// Get axis width & start/end positions
|
|
41
42
|
var mainXScale = cartesianScales.getMainXScale();
|
|
42
43
|
var xDimensions = mainXScale.range();
|
|
43
44
|
// Align legend with the axis
|
|
@@ -45,9 +46,9 @@ var ColorScaleLegend = /** @class */ (function (_super) {
|
|
|
45
46
|
svg.select('g.legend').attr('transform', "translate(" + xDimensions[0] + ", 0)");
|
|
46
47
|
if (title) {
|
|
47
48
|
var textWidth = DOMUtils.getSVGElementSize(svg.select('g.legend-title').select('text'), { useBBox: true }).width;
|
|
48
|
-
//
|
|
49
|
+
// D3 moves the LEFT y-axis labels by 9
|
|
49
50
|
var availableSpace = xDimensions[0] - textWidth - 9;
|
|
50
|
-
// If space is available align the
|
|
51
|
+
// If space is available, align the label with the axis labels
|
|
51
52
|
if (availableSpace > 1) {
|
|
52
53
|
svg.select('g.legend-title').attr('transform', "translate(" + availableSpace + ", 0)");
|
|
53
54
|
}
|
|
@@ -60,45 +61,50 @@ var ColorScaleLegend = /** @class */ (function (_super) {
|
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
63
|
}
|
|
64
|
+
else {
|
|
65
|
+
// Default state
|
|
66
|
+
svg.select('g.legend-title').attr('transform', "translate(0, 0)");
|
|
67
|
+
}
|
|
63
68
|
};
|
|
64
69
|
return _this;
|
|
65
70
|
}
|
|
66
71
|
ColorScaleLegend.prototype.init = function () {
|
|
67
72
|
var eventsFragment = this.services.events;
|
|
68
73
|
// Highlight correct circle on legend item hovers
|
|
69
|
-
eventsFragment.addEventListener(Events.Axis.RENDER_COMPLETE, this.
|
|
74
|
+
eventsFragment.addEventListener(Events.Axis.RENDER_COMPLETE, this.handleAxisCompleteEvent);
|
|
70
75
|
};
|
|
71
76
|
ColorScaleLegend.prototype.render = function (animate) {
|
|
72
77
|
if (animate === void 0) { animate = false; }
|
|
73
78
|
var options = this.getOptions();
|
|
79
|
+
var svg = this.getComponentContainer();
|
|
80
|
+
var width = DOMUtils.getSVGElementSize(svg, {
|
|
81
|
+
useAttrs: true,
|
|
82
|
+
}).width;
|
|
74
83
|
var customColors = Tools.getProperty(options, 'color', 'gradient', 'colors');
|
|
75
84
|
var colorScaleType = Tools.getProperty(options, 'heatmap', 'colorLegend', 'type');
|
|
76
85
|
var colorPairingOption = Tools.getProperty(options, 'color', 'pairing', 'option');
|
|
77
86
|
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
87
|
// Clear DOM if loading
|
|
82
88
|
var isDataLoading = Tools.getProperty(this.getOptions(), 'data', 'loading');
|
|
83
89
|
if (isDataLoading) {
|
|
84
90
|
svg.html('');
|
|
85
91
|
return;
|
|
86
92
|
}
|
|
87
|
-
var
|
|
88
|
-
var
|
|
89
|
-
var
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
var customColorsEnabled = !Tools.isEmpty(customColors);
|
|
94
|
+
var domain = this.model.getValueDomain();
|
|
95
|
+
var useDefaultBarWidth = !(width <= Configuration.legend.color.barWidth);
|
|
96
|
+
var barWidth = useDefaultBarWidth
|
|
97
|
+
? Configuration.legend.color.barWidth
|
|
98
|
+
: width;
|
|
99
|
+
var legendGroupElement = DOMUtils.appendOrSelect(svg, 'g.legend');
|
|
100
|
+
var axisElement = DOMUtils.appendOrSelect(legendGroupElement, 'g.legend-axis');
|
|
101
|
+
// Render title if it exists
|
|
96
102
|
if (title) {
|
|
97
103
|
var legendTitleGroup = DOMUtils.appendOrSelect(svg, 'g.legend-title');
|
|
98
104
|
var legendTitle = DOMUtils.appendOrSelect(legendTitleGroup, 'text');
|
|
99
105
|
legendTitle.text(title).attr('dy', '0.7em');
|
|
100
106
|
// Move the legend down by 16 pixels to display legend text on top
|
|
101
|
-
|
|
107
|
+
legendGroupElement.attr('transform', "translate(0, 16)");
|
|
102
108
|
}
|
|
103
109
|
// If domain consists of negative and positive values, use diverging palettes
|
|
104
110
|
var colorScheme = domain[0] < 0 && domain[1] > 0 ? 'diverge' : 'mono';
|
|
@@ -128,107 +134,95 @@ var ColorScaleLegend = /** @class */ (function (_super) {
|
|
|
128
134
|
// Use custom colors
|
|
129
135
|
colorPairing = customColors;
|
|
130
136
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
.
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
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();
|
|
137
|
+
// Generate equal chunks between range to act as ticks
|
|
138
|
+
var interpolator = interpolateNumber(domain[0], domain[1]);
|
|
139
|
+
var quant = quantize(interpolator, 3);
|
|
140
|
+
// Create scale & ticks
|
|
141
|
+
var linearScale = scaleLinear().domain(domain).range([0, barWidth]);
|
|
142
|
+
var legendAxis = axisBottom(linearScale)
|
|
143
|
+
.tickSize(0)
|
|
144
|
+
.tickValues(quant);
|
|
145
|
+
switch (colorScaleType) {
|
|
146
|
+
case ColorLegendType.LINEAR:
|
|
147
|
+
this.drawLinear(colorPairing, legendGroupElement, barWidth);
|
|
148
|
+
break;
|
|
149
|
+
case ColorLegendType.QUANTIZE:
|
|
150
|
+
var rangeStart = this.drawQuantize(colorPairing, colorScheme, customColorsEnabled, legendGroupElement, barWidth);
|
|
151
|
+
// Using range provided by drawQuantize for alignment purposes
|
|
152
|
+
linearScale.range([rangeStart, barWidth]);
|
|
153
|
+
break;
|
|
154
|
+
default:
|
|
155
|
+
throw Error('Entered color legend type is not supported.');
|
|
215
156
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
157
|
+
// Align axes at the bottom of the rectangle and delete the domain line
|
|
158
|
+
axisElement
|
|
159
|
+
.attr('transform', "translate(0," + Configuration.legend.color.axisYTranslation + ")")
|
|
160
|
+
.call(legendAxis);
|
|
161
|
+
// Remove auto generated axis bottom line
|
|
162
|
+
axisElement.select('.domain').remove();
|
|
163
|
+
// Translate first/last axis tick if barWidth equals chart width
|
|
164
|
+
// Ensures text is not clipped when default bar width (300px) is not used
|
|
165
|
+
axisElement
|
|
166
|
+
.select('g.tick:last-of-type text')
|
|
167
|
+
.style('text-anchor', useDefaultBarWidth ? 'middle' : 'end');
|
|
168
|
+
axisElement
|
|
169
|
+
.select('g.tick:first-of-type text')
|
|
170
|
+
.style('text-anchor', useDefaultBarWidth ? 'middle' : 'start');
|
|
171
|
+
};
|
|
172
|
+
// Renders gradient legend
|
|
173
|
+
ColorScaleLegend.prototype.drawLinear = function (colorPairing, legendGroupElement, barWidth) {
|
|
174
|
+
var stopLengthPercentage = 100 / (colorPairing.length - 1);
|
|
175
|
+
// Generate the gradient
|
|
176
|
+
var linearGradient = DOMUtils.appendOrSelect(legendGroupElement, 'linearGradient');
|
|
177
|
+
// Rendering gradient
|
|
178
|
+
linearGradient
|
|
179
|
+
.attr('id', this.gradient_id + "-legend")
|
|
180
|
+
.selectAll('stop')
|
|
181
|
+
.data(colorPairing)
|
|
182
|
+
.enter()
|
|
183
|
+
.append('stop')
|
|
184
|
+
.attr('offset', function (_, i) { return i * stopLengthPercentage + "%"; })
|
|
185
|
+
.attr('class', function (_, i) { return colorPairing[i]; })
|
|
186
|
+
.attr('stop-color', function (d) { return d; });
|
|
187
|
+
// Create the legend container
|
|
188
|
+
var rectangle = DOMUtils.appendOrSelect(legendGroupElement, 'rect');
|
|
189
|
+
rectangle
|
|
190
|
+
.attr('width', barWidth)
|
|
191
|
+
.attr('height', Configuration.legend.color.barHeight)
|
|
192
|
+
.style('fill', "url(#" + this.gradient_id + "-legend)");
|
|
193
|
+
};
|
|
194
|
+
/**
|
|
195
|
+
* Renders quantized legend
|
|
196
|
+
* @returns number (range start)
|
|
197
|
+
*/
|
|
198
|
+
ColorScaleLegend.prototype.drawQuantize = function (colorPairing, colorScheme, customColorsEnabled, legendGroupElement, barWidth) {
|
|
199
|
+
// If divergent && non-custom color, remove 0/white from being displayed
|
|
200
|
+
if (!customColorsEnabled && colorScheme === 'diverge') {
|
|
201
|
+
colorPairing.splice(colorPairing.length / 2, 1);
|
|
226
202
|
}
|
|
203
|
+
var colorScaleBand = scaleBand()
|
|
204
|
+
.domain(colorPairing)
|
|
205
|
+
.range([0, barWidth]);
|
|
206
|
+
// Render the quantized rectangles
|
|
207
|
+
var rectangle = DOMUtils.appendOrSelect(legendGroupElement, 'g.quantized-rect');
|
|
208
|
+
rectangle
|
|
209
|
+
.selectAll('rect')
|
|
210
|
+
.data(colorScaleBand.domain())
|
|
211
|
+
.join('rect')
|
|
212
|
+
.attr('x', function (d) { return colorScaleBand(d); })
|
|
213
|
+
.attr('y', 0)
|
|
214
|
+
.attr('width', Math.max(0, colorScaleBand.bandwidth() - 1))
|
|
215
|
+
.attr('height', Configuration.legend.color.barHeight)
|
|
216
|
+
.attr('class', function (d) { return d; })
|
|
217
|
+
.attr('fill', function (d) { return d; });
|
|
218
|
+
return (!customColorsEnabled && colorScheme) === 'mono'
|
|
219
|
+
? colorScaleBand.bandwidth() - 1
|
|
220
|
+
: 0;
|
|
227
221
|
};
|
|
228
222
|
ColorScaleLegend.prototype.destroy = function () {
|
|
229
223
|
// Remove legend listeners
|
|
230
224
|
var eventsFragment = this.services.events;
|
|
231
|
-
eventsFragment.removeEventListener(Events.Axis.RENDER_COMPLETE, this.
|
|
225
|
+
eventsFragment.removeEventListener(Events.Axis.RENDER_COMPLETE, this.handleAxisCompleteEvent);
|
|
232
226
|
};
|
|
233
227
|
return ColorScaleLegend;
|
|
234
228
|
}(Legend));
|