@hpcc-js/layout 3.2.8 → 3.2.10
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/dist/index.js +2300 -895
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +2 -7
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +8 -8
package/dist/index.umd.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.umd.cjs","sources":["../src/__package__.ts","../src/AbsoluteSurface.ts","../src/Accordion.ts","../src/Surface.ts","../src/Cell.ts","../src/Border.ts","../src/Border2.ts","../src/Carousel.ts","../../../node_modules/d3-path/src/path.js","../../../node_modules/d3-shape/src/constant.js","../../../node_modules/d3-shape/src/math.js","../../../node_modules/d3-shape/src/symbol/circle.js","../../../node_modules/d3-shape/src/symbol/cross.js","../../../node_modules/d3-shape/src/symbol/diamond.js","../../../node_modules/d3-shape/src/symbol/star.js","../../../node_modules/d3-shape/src/symbol/square.js","../../../node_modules/d3-shape/src/symbol/triangle.js","../../../node_modules/d3-shape/src/symbol/wye.js","../../../node_modules/d3-shape/src/symbol.js","../../../node_modules/d3-svg-legend/indexRollupNext.js","../src/Legend.ts","../src/Modal.ts","../src/ChartPanel.ts","../src/FlexGrid.ts","../../../node_modules/grid-list/src/gridList.js","../src/Grid.ts","../src/HorizontalList.ts","../src/Layered.ts","../src/Popup.ts","../src/Tabbed.ts","../src/Toolbar.ts","../src/VerticalList.ts"],"sourcesContent":["export const PKG_NAME = \"@hpcc-js/layout\";\nexport const PKG_VERSION = \"3.1.1\";\nexport const BUILD_VERSION = \"3.2.1\";\n","import { HTMLWidget } from \"@hpcc-js/common\";\n\nimport \"../src/AbsoluteSurface.css\";\n\nexport class AbsoluteSurface extends HTMLWidget {\n constructor() {\n super();\n\n this._tag = \"div\";\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n\n let xPos = 0;\n let yPos = 0;\n let width = this.clientWidth();\n let height = this.clientHeight();\n switch (this.units()) {\n case \"pixels\":\n xPos = this.widgetX();\n yPos = this.widgetY();\n width = this.widgetWidth() === \"\" ? width - xPos : Number(this.widgetWidth());\n height = this.widgetHeight() === \"\" ? height - yPos : Number(this.widgetHeight());\n break;\n case \"percent\":\n xPos = this.widgetX() * width / 100;\n yPos = this.widgetY() * height / 100;\n width = this.widgetWidth() === \"\" ? width - xPos : Number(this.widgetWidth()) * width / 100;\n height = this.widgetHeight() === \"\" ? height - yPos : Number(this.widgetHeight()) * height / 100;\n break;\n }\n element.style(\"opacity\", this.opacity());\n\n const widgets = element.selectAll(\"#\" + this._id + \" > .placeholder\").data(this.widget() ? [this.widget()] : [], function (d) { return d._id; });\n widgets.enter().append(\"div\")\n .attr(\"class\", \"placeholder\")\n .each(function (d) {\n d.target(this);\n })\n .merge(widgets)\n .style(\"left\", xPos + \"px\")\n .style(\"top\", yPos + \"px\")\n .style(\"width\", width + \"px\")\n .style(\"bottom\", height + \"px\")\n .each(function (d) {\n d\n .resize({ width, height })\n ;\n })\n ;\n widgets.exit().each(function (d) {\n d.target(null);\n }).remove();\n }\n\n exit(domNode, element) {\n if (this.widget()) {\n this.widget().target(null);\n }\n super.exit(domNode, element);\n }\n}\nAbsoluteSurface.prototype._class += \" layout_AbsoluteSurface\";\n\nexport interface AbsoluteSurface {\n units(): string;\n units(_: string): this;\n widgetX(): number;\n widgetX(_: number): this;\n widgetY(): number;\n widgetY(_: number): this;\n widgetWidth(): string;\n widgetWidth(_: string): this;\n widgetHeight(): string;\n widgetHeight(_: string): this;\n widget(): any;\n widget(_: any): this;\n opacity(): number;\n opacity(_: number): this;\n}\n\nAbsoluteSurface.prototype.publish(\"units\", \"percent\", \"set\", \"Units\", [\"pixels\", \"percent\"]);\nAbsoluteSurface.prototype.publish(\"widgetX\", 0, \"number\", \"Widget XPos\");\nAbsoluteSurface.prototype.publish(\"widgetY\", 0, \"number\", \"Widget YPos\");\nAbsoluteSurface.prototype.publish(\"widgetWidth\", \"100\", \"string\", \"Widget Width, omit for full\");\nAbsoluteSurface.prototype.publish(\"widgetHeight\", \"100\", \"string\", \"Widget Height, omit for full\");\nAbsoluteSurface.prototype.publish(\"widget\", null, \"widget\", \"Widget\", null, { tags: [\"Private\"] });\nAbsoluteSurface.prototype.publish(\"opacity\", 1, \"number\", \"Opacity\");\n","import { FAChar, HTMLWidget } from \"@hpcc-js/common\";\n\nimport \"../src/Accordion.css\";\n\nexport class Accordion extends HTMLWidget {\n protected _isClosed: boolean;\n titleSpan;\n iconDiv;\n ul;\n icon;\n\n constructor() {\n super();\n\n this._tag = \"div\";\n this._isClosed = false;\n }\n\n pushListItem(widget, prepend: boolean = false, protect: boolean = false) {\n const contentArr = this.content();\n\n widget._protected = protect;\n\n if (prepend) {\n contentArr.unshift(widget);\n } else {\n contentArr.push(widget);\n }\n this.content(contentArr);\n return this;\n }\n\n clearListItems() {\n const arr = [];\n for (const i in this.content()) {\n if (this.content()[i]._protected) {\n arr.push(this.content()[i]);\n }\n }\n this.content(arr);\n return this;\n }\n\n collapseClick(element) {\n if (element.classed(\"closed\")) {\n this._isClosed = false;\n element.classed(\"open\", true);\n element.classed(\"closed\", false);\n } else {\n this._isClosed = true;\n element.classed(\"open\", false);\n element.classed(\"closed\", true);\n }\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n const context = this;\n this._isClosed = this.defaultCollapsed();\n element.classed(this._isClosed ? \"closed\" : \"open\", true);\n\n this.titleSpan = element.append(\"span\").classed(\"collapsible-title\", true);\n this.iconDiv = element.append(\"div\").classed(\"collapsible-icon\", true);\n this.ul = element.append(\"ul\");\n\n this.icon = new FAChar()\n .size({ height: 24, width: 24 })\n .target(this.iconDiv.node());\n\n this.iconDiv.on(\"click\", function () {\n context.collapseClick(element);\n context.render();\n });\n this.titleSpan.on(\"click\", function () {\n context.collapseClick(element);\n context.render();\n });\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n const context = this;\n const this_id = \"\";\n this.titleSpan.text(context.title().length > 0 ? context.title() + this_id : \"Accordion [\" + context._id + \"]\" + this_id);\n const rows = this.ul.selectAll(\"#\" + context._id + \" > ul > li\").data(this.content(), function (d) {\n return d._id;\n });\n rows.enter()\n .append(function (widget) {\n const li = document.createElement(\"li\");\n if (widget._target === null) {\n const wSize = widget.size();\n if (wSize.width === 0 || wSize.height === 0) {\n const cSize = context.size();\n widget.size({\n width: cSize.width,\n height: cSize.width\n });\n }\n widget.target(li);\n } else {\n return widget._target;\n }\n return li;\n })\n ;\n rows.exit().remove();\n\n this.icon\n .text_colorFill(this.titleFontColor())\n .char(this._isClosed ? this.closedIcon() : this.openIcon()).render()\n ;\n }\n\n exit(domNode, element) {\n super.exit(domNode, element);\n }\n}\nAccordion.prototype._class += \" layout_Accordion\";\n\nexport interface Accordion {\n content(): any[];\n content(_: any[]): this;\n title(): string;\n title(_: string): this;\n openIcon(): string;\n openIcon(_: string): this;\n closedIcon(): string;\n closedIcon(_: string): this;\n titleFontColor(): string;\n titleFontColor(_: string): this;\n titleBackgroundColor(): string;\n titleBackgroundColor(_: string): this;\n\n defaultCollapsed(): boolean;\n defaultCollapsed(_: boolean): this;\n}\n\nAccordion.prototype.publish(\"content\", [], \"widgetArray\", \"Array of widgets\", null, { tags: [\"Basic\"] });\nAccordion.prototype.publish(\"title\", \"\", \"string\", \"Title of collapsible section\", null, { tags: [\"Private\"] });\nAccordion.prototype.publish(\"openIcon\", \"\\uf147\", \"string\", \"Icon to display when list is open\", null, { tags: [\"Private\"] });\nAccordion.prototype.publish(\"closedIcon\", \"\\uf196\", \"string\", \"Icon to display when list is closed\", null, { tags: [\"Private\"] });\nAccordion.prototype.publish(\"titleFontColor\", \"#FFFFFF\", \"html-color\", \"Title font color\", null, { tags: [\"Private\"] });\nAccordion.prototype.publish(\"titleBackgroundColor\", \"#333333\", \"html-color\", \"Title background color\", null, { tags: [\"Private\"] });\n\nAccordion.prototype.publish(\"defaultCollapsed\", false, \"boolean\", \"Collapsed by default if true\", null, { tags: [\"Private\"] });\n","import { HTMLWidget, Widget } from \"@hpcc-js/common\";\nimport { select as d3Select } from \"d3-selection\";\n\nimport \"../src/Surface.css\";\n\nexport class Surface extends HTMLWidget {\n _surfaceButtons;\n\n constructor() {\n super();\n\n this._tag = \"div\";\n this._surfaceButtons = [];\n }\n\n widgetSize(titleDiv, widgetDiv) {\n let width = this.clientWidth();\n let height = this.clientHeight();\n if (this.title()) {\n height -= this.calcHeight(titleDiv);\n }\n height -= this.calcFrameHeight(widgetDiv);\n width -= this.calcFrameWidth(widgetDiv);\n return { width, height };\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n }\n\n update(domNode, element2) {\n super.update(domNode, element2);\n const context = this;\n\n element2\n .classed(\"shadow2\", this.surfaceShadow())\n .style(\"border-width\", this.surfaceBorderWidth_exists() ? this.surfaceBorderWidth() + \"px\" : null)\n .style(\"border-color\", this.surfaceBorderColor())\n .style(\"border-radius\", this.surfaceBorderRadius_exists() ? this.surfaceBorderRadius() + \"px\" : null)\n .style(\"background-color\", this.surfaceBackgroundColor())\n ;\n\n const titles = element2.selectAll(\".surfaceTitle\").data(this.title() ? [this.title()] : []);\n titles.enter().insert(\"h3\", \"div\")\n .attr(\"class\", \"surfaceTitle\")\n .merge(titles)\n .text(function (d) { return d; })\n .style(\"text-align\", this.surfaceTitleAlignment())\n .style(\"color\", this.surfaceTitleFontColor())\n .style(\"font-size\", this.surfaceTitleFontSize_exists() ? this.surfaceTitleFontSize() + \"px\" : null)\n .style(\"font-family\", this.surfaceTitleFontFamily())\n .style(\"font-weight\", this.surfaceTitleFontBold() ? \"bold\" : \"normal\")\n .style(\"background-color\", this.surfaceTitleBackgroundColor())\n .style(\"padding\", this.surfaceTitlePadding_exists() ? this.surfaceTitlePadding() + \"px\" : null)\n .style(\"title\", this.altText_exists() ? this.altText() : null)\n ;\n titles.exit().remove();\n\n const surfaceTitle = element2.select(\".surfaceTitle\");\n\n const surfaceButtons = surfaceTitle.append(\"div\").attr(\"class\", \"html-button-container\").selectAll(\".surface-button\").data(this.buttonAnnotations());\n surfaceButtons.enter().append(\"button\").classed(\"surface-button\", true)\n .each(function (button, idx) {\n const el = context._surfaceButtons[idx] = d3Select(this)\n .attr(\"class\", \"surface-button\" + (button.class ? \" \" + button.class : \"\"))\n .attr(\"id\", button.id)\n .style(\"padding\", button.padding)\n .style(\"width\", button.width)\n .style(\"height\", button.height)\n .style(\"cursor\", \"pointer\");\n if (button.font === \"FontAwesome\") {\n el\n .style(\"background\", \"transparent\")\n .style(\"border\", \"none\")\n .on(\"click\", function (d) { context.click(d); })\n .append(\"i\")\n .attr(\"class\", \"fa\")\n .text(function () { return button.label; });\n } else {\n el\n .text(function () { return button.label; })\n .on(\"click\", function (d) { context.click(d); });\n }\n })\n ;\n surfaceButtons.exit()\n .each(function (_d, idx) {\n const element = d3Select(this);\n delete context._surfaceButtons[idx];\n element.remove();\n })\n ;\n const widgets = element2.selectAll(\"#\" + this._id + \" > .surfaceWidget\").data(this.widget() ? [this.widget()] : [], function (d) { return d._id; });\n\n widgets.enter().append(\"div\")\n .attr(\"class\", \"surfaceWidget\")\n .each(function (d) {\n d3Select(context.element().node().parentElement).classed(\"content-icon content-icon-\" + (d.classID().split(\"_\")[1]), true);\n d.target(this);\n })\n .merge(widgets)\n .style(\"padding\", this.surfacePadding_exists() ? this.surfacePadding() + \"px\" : null)\n .each(function (d) {\n const widgetSize = context.widgetSize(element2.select(\"h3\"), d3Select(this));\n if (widgetSize.width < 0) widgetSize.width = 0;\n if (widgetSize.height < 0) widgetSize.height = 0;\n d\n .resize({ width: widgetSize.width, height: widgetSize.height })\n ;\n })\n ;\n widgets.exit().each(function (d) {\n d.target(null);\n }).remove();\n }\n\n exit(domNode, element) {\n if (this.widget()) {\n this.widget().target(null);\n }\n super.exit(domNode, element);\n }\n\n // Events ---\n click(obj) {\n }\n}\nSurface.prototype._class += \" layout_Surface\";\n\nexport interface Surface {\n /* \n title: { (): string; (_: string): Surface; };\n altText: { (): string; (_: string): Surface; };\n altText_exists: () => boolean;\n surfaceTitlePadding: { (): number; (_: number): Surface; };\n surfaceTitlePadding_exists: () => boolean;\n surfaceTitleFontSize: { (): number; (_: number): Surface; };\n surfaceTitleFontSize_exists: () => boolean;\n surfaceTitleFontColor: { (): string; (_: string): Surface; };\n surfaceTitleFontFamily: { (): string; (_: string): Surface; };\n surfaceTitleFontBold: { (): boolean; (_: boolean): Surface; };\n surfaceTitleBackgroundColor: { (): string; (_: string): Surface; };\n surfaceTitleAlignment: { (): string; (_: string): Surface; };\n\n surfaceShadow: { (): boolean; (_: boolean): Surface; };\n surfacePadding: { (): string; (_: string): Surface; };\n surfacePadding_exists: () => boolean;\n surfaceBackgroundColor: { (): string; (_: string): Surface; };\n surfaceBorderWidth: { (): number; (_: number): Surface; };\n surfaceBorderWidth_exists: () => boolean;\n surfaceBorderColor: { (): string; (_: string): Surface; };\n surfaceBorderRadius: { (): number; (_: number): Surface; };\n surfaceBorderRadius_exists: () => boolean;\n\n buttonAnnotations: { (): any[]; (_: any[]): Surface; };\n\n widget: { (): Widget; (_: Widget): Surface; };\n */\n title(): string;\n title(_: string): this;\n altText(): string;\n altText(_: string): this;\n altText_exists(): boolean;\n surfaceTitlePadding(): number;\n surfaceTitlePadding(_: number): this;\n surfaceTitlePadding_exists(): boolean;\n surfaceTitleFontSize(): number;\n surfaceTitleFontSize(_: number): this;\n surfaceTitleFontSize_exists(): boolean;\n surfaceTitleFontColor(): string;\n surfaceTitleFontColor(_: string): this;\n surfaceTitleFontFamily(): string;\n surfaceTitleFontFamily(_: string): this;\n surfaceTitleFontBold(): boolean;\n surfaceTitleFontBold(_: boolean): this;\n surfaceTitleBackgroundColor(): string;\n surfaceTitleBackgroundColor(_: string): this;\n surfaceTitleAlignment(): string;\n surfaceTitleAlignment(_: string): this;\n\n surfaceShadow(): boolean;\n surfaceShadow(_: boolean): this;\n surfacePadding(): string;\n surfacePadding(_: string): this;\n surfacePadding_exists(): boolean;\n surfaceBackgroundColor(): string;\n surfaceBackgroundColor(_: string): this;\n surfaceBorderWidth(): number;\n surfaceBorderWidth(_: number): this;\n surfaceBorderWidth_exists(): boolean;\n surfaceBorderColor(): string;\n surfaceBorderColor(_: string): this;\n surfaceBorderRadius(): number;\n surfaceBorderRadius(_: number): this;\n surfaceBorderRadius_exists(): boolean;\n\n buttonAnnotations(): any[];\n buttonAnnotations(_: any[]): this;\n\n widget(): Widget;\n widget(_: Widget): this;\n}\n\nSurface.prototype.publish(\"title\", \"\", \"string\", \"Title\", null, { tags: [\"Intermediate\"] });\nSurface.prototype.publish(\"altText\", null, \"string\", \"Alt text\", null, { optional: true });\nSurface.prototype.publish(\"surfaceTitlePadding\", null, \"number\", \"Title Padding (px)\", null, { tags: [\"Advanced\"], disable: (w: any) => !w.title() });\nSurface.prototype.publish(\"surfaceTitleFontSize\", null, \"number\", \"Title Font Size (px)\", null, { tags: [\"Advanced\"], disable: (w: any) => !w.title() });\nSurface.prototype.publish(\"surfaceTitleFontColor\", null, \"html-color\", \"Title Font Color\", null, { tags: [\"Advanced\"], disable: (w: any) => !w.title() });\nSurface.prototype.publish(\"surfaceTitleFontFamily\", null, \"string\", \"Title Font Family\", null, { tags: [\"Advanced\"], disable: (w: any) => !w.title() });\nSurface.prototype.publish(\"surfaceTitleFontBold\", true, \"boolean\", \"Enable Bold Title Font\", null, { tags: [\"Advanced\"], disable: (w: any) => !w.title() });\nSurface.prototype.publish(\"surfaceTitleBackgroundColor\", null, \"html-color\", \"Title Background Color\", null, { tags: [\"Advanced\"], disable: (w: any) => !w.title() });\nSurface.prototype.publish(\"surfaceTitleAlignment\", \"center\", \"set\", \"Title Alignment\", [\"left\", \"right\", \"center\"], { tags: [\"Basic\"], disable: (w: any) => !w.title() });\n\nSurface.prototype.publish(\"surfaceShadow\", false, \"boolean\", \"3D Shadow\");\nSurface.prototype.publish(\"surfacePadding\", null, \"string\", \"Surface Padding (px)\", null, { tags: [\"Intermediate\"] });\nSurface.prototype.publish(\"surfaceBackgroundColor\", null, \"html-color\", \"Surface Background Color\", null, { tags: [\"Advanced\"] });\nSurface.prototype.publish(\"surfaceBorderWidth\", null, \"number\", \"Surface Border Width (px)\", null, { tags: [\"Advanced\"] });\nSurface.prototype.publish(\"surfaceBorderColor\", null, \"html-color\", \"Surface Border Color\", null, { tags: [\"Advanced\"] });\nSurface.prototype.publish(\"surfaceBorderRadius\", null, \"number\", \"Surface Border Radius (px)\", null, { tags: [\"Advanced\"] });\n\nSurface.prototype.publish(\"buttonAnnotations\", [], \"array\", \"Button Array\", null, { tags: [\"Private\"] });\n\nSurface.prototype.publish(\"widget\", null, \"widget\", \"Widget\", null, { tags: [\"Basic\"] });\n","import { Widget } from \"@hpcc-js/common\";\nimport { select as d3Select, selectAll as d3SelectAll } from \"d3-selection\";\nimport { Surface } from \"./Surface.ts\";\n\nimport \"../src/Cell.css\";\n\nexport class Cell extends Surface {\n _indicateTheseIds;\n\n constructor() {\n super();\n this._indicateTheseIds = [];\n }\n\n indicateTheseIds(): any[];\n indicateTheseIds(_: any[]): Cell;\n indicateTheseIds(_?: any[]): any[] | Cell {\n if (!arguments.length) return this._indicateTheseIds;\n this._indicateTheseIds = _;\n return this;\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n const context = this;\n element\n .classed(\"layout_Surface\", true)\n .on(\"mouseenter\", function () { context.onMouseEnter(); })\n .on(\"mouseleave\", function () { context.onMouseLeave(); })\n ;\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n }\n\n onMouseEnter() {\n const arr = this.indicateTheseIds();\n const opacity = this.indicatorOpacity();\n const indicatorBorderColor = this.indicatorBorderColor();\n const indicatorGlowColor = this.indicatorGlowColor();\n for (let i = 0; i < arr.length; i++) {\n const otherElement = d3Select(\"#\" + arr[i]);\n const otherWidget: Widget = otherElement.datum() as Widget;\n if (otherElement && otherWidget) {\n otherElement.append(\"div\")\n .attr(\"class\", \"update-indicator\")\n .style(\"width\", otherWidget.width() + \"px\")\n .style(\"height\", otherWidget.height() + \"px\")\n .style(\"opacity\", opacity)\n .style(\"border-color\", indicatorBorderColor)\n .style(\"-webkit-box-shadow\", \"inset 0px 0px 30px 0px \" + indicatorGlowColor)\n .style(\"-moz-box-shadow\", \"inset 0px 0px 30px 0px \" + indicatorGlowColor)\n .style(\"box-shadow\", \"inset 0px 0px 30px 0px \" + indicatorGlowColor)\n ;\n }\n }\n }\n\n onMouseLeave() {\n const arr = this.indicateTheseIds();\n for (let i = 0; i < arr.length; i++) {\n d3SelectAll(\"#\" + arr[i] + \" > div.update-indicator\").remove();\n }\n }\n}\nCell.prototype._class += \" layout_Cell\";\n\nexport interface Cell {\n gridRow(): number;\n gridRow(_: number): this;\n gridCol(): number;\n gridCol(_: number): this;\n gridRowSpan(): number;\n gridRowSpan(_: number): this;\n gridColSpan(): number;\n gridColSpan(_: number): this;\n\n indicatorGlowColor(): string;\n indicatorGlowColor(_: string): this;\n indicatorBorderColor(): string;\n indicatorBorderColor(_: string): this;\n indicatorOpacity(): number;\n indicatorOpacity(_: number): this;\n}\n\nCell.prototype.publish(\"gridRow\", 0, \"number\", \"Grid Row Position\", null, { tags: [\"Private\"] });\nCell.prototype.publish(\"gridCol\", 0, \"number\", \"Grid Column Position\", null, { tags: [\"Private\"] });\nCell.prototype.publish(\"gridRowSpan\", 1, \"number\", \"Grid Row Span\", null, { tags: [\"Private\"] });\nCell.prototype.publish(\"gridColSpan\", 1, \"number\", \"Grid Column Span\", null, { tags: [\"Private\"] });\n\nCell.prototype.publish(\"indicatorGlowColor\", \"#EEEE11\", \"html-color\", \"Glow color of update-indicator\", null, { tags: [\"Basic\"] });\nCell.prototype.publish(\"indicatorBorderColor\", \"#F48A00\", \"html-color\", \"Border color of update-indicator\", null, { tags: [\"Basic\"] });\nCell.prototype.publish(\"indicatorOpacity\", 0.8, \"number\", \"Opacity of update-indicator\", null, { tags: [\"Basic\"] });\n","import { d3Event, HTMLWidget, Platform, select as d3Select, selectAll as d3SelectAll, Utility } from \"@hpcc-js/common\";\nimport { drag as d3Drag } from \"d3-drag\";\nimport { Cell } from \"./Cell.ts\";\n\nimport \"../src/Border.css\";\n\nexport class Border extends HTMLWidget {\n _colCount: number;\n _rowCount: number;\n _colSize: number;\n _rowSize: number;\n _shrinkWrapBoxes;\n _watch;\n _offsetX;\n _offsetY;\n _dragCell;\n _dragCellSize;\n _dragCellStartSize;\n _handleTop;\n _handleLeft;\n _dragPrevX;\n _dragPrevY;\n _cellSizes;\n contentDiv;\n _scrollBarWidth;\n _borderHandles;\n _sectionTypeArr;\n\n constructor() {\n super();\n\n this._tag = \"div\";\n\n this._colCount = 0;\n this._rowCount = 0;\n this._colSize = 0;\n this._rowSize = 0;\n\n this._shrinkWrapBoxes = {};\n\n this.content([]);\n this.sectionTypes([]);\n }\n\n watchWidget(widget) {\n if (this._watch === undefined) {\n this._watch = {};\n }\n if (this._watch[widget.id()]) {\n this._watch[widget.id()].remove();\n delete this._watch[widget.id()];\n }\n if (widget) {\n const context = this;\n this._watch[widget.id()] = widget.monitor(function (paramId, newVal, oldVal) {\n if (oldVal !== newVal) {\n context.lazyPostUpdate();\n }\n });\n }\n }\n\n lazyPostUpdate = Utility.debounce(function () {\n this.postUpdate();\n }, 100);\n\n applyLayoutType() {\n const layoutObj = this.borderLayoutObject();\n this.content().forEach(function (cell, i) {\n cell._fixedLeft = layoutObj[this.sectionTypes()[i]].left;\n cell._fixedTop = layoutObj[this.sectionTypes()[i]].top;\n cell._fixedWidth = layoutObj[this.sectionTypes()[i]].width;\n cell._fixedHeight = layoutObj[this.sectionTypes()[i]].height;\n cell._dragHandles = this.cellSpecificDragHandles(this.sectionTypes()[i]);\n }, this);\n }\n cellSpecificDragHandles(sectionType) {\n switch (sectionType) {\n case \"top\": return [\"s\"];\n case \"right\": return [\"w\"];\n case \"bottom\": return [\"n\"];\n case \"left\": return [\"e\"];\n case \"center\": return [];\n }\n }\n\n borderLayoutObject(layoutType?) {\n const retObj = {};\n const context = this;\n let topSize;\n let topPerc;\n let bottomSize;\n let bottomPerc;\n let leftSize;\n let leftPerc;\n let rightSize;\n let rightPerc;\n\n const bcRect = this.target().getBoundingClientRect();\n const gridRect: any = {};\n gridRect.top = bcRect.top;\n gridRect.left = bcRect.left;\n gridRect.bottom = bcRect.bottom;\n gridRect.right = bcRect.right;\n if (this.target() instanceof SVGElement) {\n gridRect.width = parseFloat(this.target().getAttribute(\"width\"));\n gridRect.height = parseFloat(this.target().getAttribute(\"height\"));\n } else {\n gridRect.width = bcRect.width;\n gridRect.height = bcRect.height;\n }\n if (this.sectionTypes().indexOf(\"top\") !== -1) {\n topSize = this.topSize();\n topPerc = this.topPercentage();\n if (typeof (this._shrinkWrapBoxes[\"top\"]) !== \"undefined\") {\n topSize = this._shrinkWrapBoxes[\"top\"].height + this.gutter();\n topPerc = 0;\n }\n }\n if (this.sectionTypes().indexOf(\"bottom\") !== -1) {\n bottomSize = this.bottomSize();\n bottomPerc = this.bottomPercentage();\n if (typeof (this._shrinkWrapBoxes[\"bottom\"]) !== \"undefined\") {\n bottomSize = this._shrinkWrapBoxes[\"bottom\"].height + this.gutter();\n bottomPerc = 0;\n }\n }\n if (this.sectionTypes().indexOf(\"left\") !== -1) {\n leftSize = this.leftSize();\n leftPerc = this.leftPercentage();\n if (typeof (this._shrinkWrapBoxes[\"left\"]) !== \"undefined\") {\n leftSize = this._shrinkWrapBoxes[\"left\"].width + this.gutter();\n leftPerc = 0;\n }\n }\n if (this.sectionTypes().indexOf(\"right\") !== -1) {\n rightSize = this.rightSize();\n rightPerc = this.rightPercentage();\n if (typeof (this._shrinkWrapBoxes[\"right\"]) !== \"undefined\") {\n rightSize = this._shrinkWrapBoxes[\"right\"].width + this.gutter();\n rightPerc = 0;\n }\n }\n\n const t = _sectionPlacementObject({\n width: { \"px\": 0, \"%\": 100 },\n height: { \"px\": topSize, \"%\": topPerc },\n top: { \"px\": 0, \"%\": 0 },\n left: { \"px\": 0, \"%\": 0 }\n });\n const b = _sectionPlacementObject({\n width: { \"px\": 0, \"%\": 100 },\n height: { \"px\": bottomSize, \"%\": bottomPerc },\n top: { \"px\": 0, \"%\": 100 },\n left: { \"px\": 0, \"%\": 0 }\n });\n b.top -= b.height;\n const l = _sectionPlacementObject({\n width: { \"px\": leftSize, \"%\": leftPerc },\n height: { \"px\": -t.height - b.height, \"%\": 100 },\n top: { \"px\": t.height, \"%\": 0 },\n left: { \"px\": 0, \"%\": 0 }\n });\n const r = _sectionPlacementObject({\n width: { \"px\": rightSize, \"%\": rightPerc },\n height: { \"px\": -t.height - b.height, \"%\": 100 },\n top: { \"px\": t.height, \"%\": 0 },\n left: { \"px\": 0, \"%\": 100 }\n });\n r.left -= r.width;\n const c = _sectionPlacementObject({\n width: { \"px\": -r.width - l.width, \"%\": 100 },\n height: { \"px\": -t.height - b.height, \"%\": 100 },\n top: { \"px\": t.height, \"%\": 0 },\n left: { \"px\": l.width, \"%\": 0 }\n });\n retObj[\"top\"] = t;\n retObj[\"bottom\"] = b;\n retObj[\"right\"] = r;\n retObj[\"left\"] = l;\n retObj[\"center\"] = c;\n return retObj;\n\n function _sectionPlacementObject(obj) {\n obj.width[\"px\"] = typeof (obj.width[\"px\"]) !== \"undefined\" ? obj.width[\"px\"] : 0;\n obj.width[\"%\"] = typeof (obj.width[\"%\"]) !== \"undefined\" ? obj.width[\"%\"] : 0;\n obj.height[\"px\"] = typeof (obj.height[\"px\"]) !== \"undefined\" ? obj.height[\"px\"] : 0;\n obj.height[\"%\"] = typeof (obj.height[\"%\"]) !== \"undefined\" ? obj.height[\"%\"] : 0;\n const ret = {\n width: obj.width[\"px\"] + (obj.width[\"%\"] / 100 * context.width()),\n height: obj.height[\"px\"] + (obj.height[\"%\"] / 100 * context.height()),\n top: obj.top[\"px\"] + (obj.top[\"%\"] / 100 * context.height()) + context.gutter() / 2,\n left: obj.left[\"px\"] + (obj.left[\"%\"] / 100 * context.width()) + context.gutter() / 2\n };\n return ret;\n }\n }\n\n clearContent(sectionType) {\n if (!sectionType) {\n this.content().forEach(function (contentWidget) {\n contentWidget.target(null);\n return false;\n });\n d3Select(\"#\" + this.id() + \" > div.borderHandle\")\n .classed(\"borderHandleDisabled\", true)\n ;\n delete this._watch;\n this.content([]);\n this.sectionTypes([]);\n } else {\n const idx = this.sectionTypes().indexOf(sectionType);\n if (idx >= 0) {\n if (this._watch && this.content()[idx]) {\n delete this._watch[this.content()[idx].id()];\n }\n this.content()[idx].target(null);\n d3Select(\"#\" + this.id() + \" > div.borderHandle_\" + sectionType)\n .classed(\"borderHandleDisabled\", true)\n ;\n this.content().splice(idx, 1);\n this.sectionTypes().splice(idx, 1);\n }\n }\n }\n\n hasContent(sectionType, widget, title) {\n return this.sectionTypes().indexOf(sectionType) >= 0;\n }\n\n setContent(sectionType, widget, title?) {\n this.clearContent(sectionType);\n title = typeof (title) !== \"undefined\" ? title : \"\";\n if (widget) {\n const cell = new Cell()\n .surfaceBorderWidth(0)\n .widget(widget)\n .title(title)\n ;\n this.watchWidget(widget);\n this.content().push(cell);\n this.sectionTypes().push(sectionType);\n }\n return this;\n }\n\n getCell(id) {\n const idx = this.sectionTypes().indexOf(id);\n if (idx >= 0) {\n return this.content()[idx];\n }\n return null;\n }\n\n getContent(id) {\n const idx = this.sectionTypes().indexOf(id);\n if (idx >= 0) {\n return this.content()[idx].widget();\n }\n return null;\n }\n\n setLayoutOffsets() {\n this._offsetX = this._element.node().getBoundingClientRect().left + (this.gutter() / 2);\n this._offsetY = this._element.node().getBoundingClientRect().top + (this.gutter() / 2);\n }\n\n dragStart(handle) {\n const event = d3Event();\n event.sourceEvent.stopPropagation();\n const context = this;\n\n this._dragCell = handle;\n this._dragCellStartSize = this[handle + \"Size\"]();\n\n if (this[handle + \"ShrinkWrap\"]()) {\n this[handle + \"Percentage\"](0);\n this[handle + \"ShrinkWrap\"](false);\n }\n\n const handleElm = d3Select(\"#\" + context.id() + \" > div.borderHandle_\" + handle);\n context._handleTop = parseFloat(handleElm.style(\"top\").split(\"px\")[0]);\n context._handleLeft = parseFloat(handleElm.style(\"left\").split(\"px\")[0]);\n\n this._dragPrevX = event.sourceEvent.clientX;\n this._dragPrevY = event.sourceEvent.clientY;\n }\n dragTick(handle) {\n const context = this;\n\n const event = d3Event();\n const xDelta = this._dragPrevX - event.sourceEvent.clientX;\n const yDelta = this._dragPrevY - event.sourceEvent.clientY;\n\n switch (handle) {\n case \"top\":\n case \"bottom\":\n _moveHandles(handle, yDelta);\n break;\n case \"right\":\n case \"left\":\n _moveHandles(handle, xDelta);\n break;\n }\n\n function _moveHandles(handle2, delta) {\n if (delta === 0) return;\n const handles = d3SelectAll(\"#\" + context.id() + \" > div.borderHandle\");\n const grabbedHandle = d3Select(\"#\" + context.id() + \" > div.borderHandle_\" + handle2);\n\n if (grabbedHandle.classed(\"borderHandle_top\")) {\n grabbedHandle.style(\"top\", (context._handleTop - delta) + \"px\");\n context._cellSizes.topHeight = context._handleTop - delta;\n context._cellSizes.leftHeight = context._cellSizes.height;\n context._cellSizes.leftHeight -= context._cellSizes.topHeight;\n context._cellSizes.leftHeight -= context._cellSizes.bottomHeight;\n context._cellSizes.rightHeight = context._cellSizes.leftHeight;\n } else if (grabbedHandle.classed(\"borderHandle_right\")) {\n grabbedHandle.style(\"left\", (context._handleLeft - delta) + \"px\");\n context._cellSizes.rightWidth = context._cellSizes.width - context._handleLeft + delta;\n } else if (grabbedHandle.classed(\"borderHandle_bottom\")) {\n grabbedHandle.style(\"top\", (context._handleTop - delta) + \"px\");\n context._cellSizes.bottomHeight = context._cellSizes.height - context._handleTop + delta;\n context._cellSizes.leftHeight = context._cellSizes.height;\n context._cellSizes.leftHeight -= context._cellSizes.bottomHeight;\n context._cellSizes.leftHeight -= context._cellSizes.topHeight;\n context._cellSizes.rightHeight = context._cellSizes.leftHeight;\n } else if (grabbedHandle.classed(\"borderHandle_left\")) {\n grabbedHandle.style(\"left\", (context._handleLeft - delta) + \"px\");\n context._cellSizes.leftWidth = context._handleLeft - delta;\n }\n\n handles.each(function () {\n const handle3 = d3Select(this);\n if (handle3.classed(\"borderHandle_top\")) {\n handle3.style(\"width\", context._cellSizes.width + \"px\");\n handle3.style(\"top\", (context._cellSizes.topHeight - 3) + \"px\");\n } else if (handle3.classed(\"borderHandle_right\")) {\n handle3.style(\"left\", (context._cellSizes.width - context._cellSizes.rightWidth) + \"px\");\n handle3.style(\"top\", (context._cellSizes.topHeight + 3) + \"px\");\n handle3.style(\"height\", context._cellSizes.rightHeight + \"px\");\n } else if (handle3.classed(\"borderHandle_bottom\")) {\n handle3.style(\"width\", context._cellSizes.width + \"px\");\n handle3.style(\"top\", (context._cellSizes.height - context._cellSizes.bottomHeight - 3) + \"px\");\n } else if (handle3.classed(\"borderHandle_left\")) {\n handle3.style(\"left\", context._cellSizes.leftWidth + \"px\");\n handle3.style(\"height\", context._cellSizes.leftHeight + \"px\");\n handle3.style(\"top\", (context._cellSizes.topHeight + 3) + \"px\");\n }\n });\n }\n }\n dragEnd(handle) {\n if (handle) {\n const event = d3Event();\n const xDelta = this._dragPrevX - event.sourceEvent.clientX;\n const yDelta = this._dragPrevY - event.sourceEvent.clientY;\n\n switch (handle) {\n case \"top\":\n if (yDelta !== 0) {\n this.topPercentage(0);\n this.topSize(this.topSize() === 0 ? this.getContent(\"top\").getBBox().height - yDelta : this.topSize() - yDelta);\n }\n break;\n case \"right\":\n if (xDelta !== 0) {\n this.rightPercentage(0);\n this.rightSize(this.rightSize() === 0 ? this.getContent(\"right\").getBBox().width + xDelta : this.rightSize() + xDelta);\n }\n break;\n case \"bottom\":\n if (yDelta !== 0) {\n this.bottomPercentage(0);\n this.bottomSize(this.bottomSize() === 0 ? this.getContent(\"bottom\").getBBox().height + yDelta : this.bottomSize() + yDelta);\n }\n break;\n case \"left\":\n if (xDelta !== 0) {\n this.leftPercentage(0);\n this.leftSize(this.leftSize() === 0 ? this.getContent(\"left\").getBBox().width - xDelta : this.leftSize() - xDelta);\n }\n break;\n }\n\n this._dragPrevX = event.sourceEvent.clientX;\n this._dragPrevY = event.sourceEvent.clientY;\n }\n this.render();\n }\n\n size(_?) {\n const retVal = HTMLWidget.prototype.size.apply(this, arguments);\n if (arguments.length && this.contentDiv) {\n this.contentDiv\n .style(\"width\", this._size.width + \"px\")\n .style(\"height\", this._size.height + \"px\")\n ;\n }\n return retVal;\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n const context = this;\n element.style(\"position\", \"relative\");\n this.contentDiv = element.append(\"div\").classed(\"border-content\", true);\n this._scrollBarWidth = Platform.getScrollbarWidth();\n this._borderHandles = [\"top\", \"left\", \"right\", \"bottom\"];\n\n const handles = element.selectAll(\"div.borderHandle\").data(this._borderHandles);\n handles.enter().append(\"div\")\n .classed(\"borderHandle\", true)\n .each(function (handle) {\n const h = d3Select(this);\n h.classed(\"borderHandle_\" + handle, true)\n .classed(\"borderHandleDisabled\", context.getContent(handle) === null)\n ;\n });\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n this._sectionTypeArr = this.sectionTypes();\n const context = this;\n\n element.classed(\"design-mode\", this.designMode());\n\n this.setLayoutOffsets();\n\n const rows = this.contentDiv.selectAll(\".cell_\" + this._id).data(this.content(), function (d) { return d._id; });\n const rowsUpdate = rows.enter().append(\"div\")\n .classed(\"cell_\" + this._id, true)\n .style(\"position\", \"absolute\")\n .each(function (d, i) {\n d3Select(this).classed(\"border-cell border-cell-\" + context._sectionTypeArr[i], true);\n d.target(this);\n d3Select(\"#\" + context.id() + \" > div.borderHandle_\" + context._sectionTypeArr[i])\n .classed(\"borderHandleDisabled\", false);\n }).merge(rows);\n rowsUpdate\n .each(function (d, idx) {\n const sectionType = context.sectionTypes()[idx];\n if (typeof (context[sectionType + \"ShrinkWrap\"]) !== \"undefined\" && context[sectionType + \"ShrinkWrap\"]()) {\n d.render();\n context._shrinkWrapBoxes[sectionType] = d.widget().getBBox(true);\n } else {\n delete context._shrinkWrapBoxes[sectionType];\n }\n });\n\n const drag = d3Drag()\n .on(\"start\", function (d, i) { context.dragStart.call(context, d, i); })\n .on(\"drag\", function (d, i) { context.dragTick.call(context, d, i); })\n .on(\"end\", function (d, i) { context.dragEnd.call(context, d, i); })\n ;\n if (this.designMode()) {\n element.selectAll(\"#\" + this.id() + \" > div.borderHandle\").call(drag);\n } else {\n element.selectAll(\"#\" + this.id() + \" > div.borderHandle\").on(\".drag\", null);\n }\n\n const layoutObj = this.borderLayoutObject();\n this.content().forEach(function (cell, i) {\n cell._fixedLeft = layoutObj[this.sectionTypes()[i]].left;\n cell._fixedTop = layoutObj[this.sectionTypes()[i]].top;\n cell._fixedWidth = layoutObj[this.sectionTypes()[i]].width;\n cell._fixedHeight = layoutObj[this.sectionTypes()[i]].height;\n cell._dragHandles = [];\n }, this);\n\n rowsUpdate\n .style(\"left\", function (d) { return d._fixedLeft + \"px\"; })\n .style(\"top\", function (d) { return d._fixedTop + \"px\"; })\n .style(\"width\", function (d) { return d._fixedWidth - context.gutter() + \"px\"; })\n .style(\"height\", function (d) { return d._fixedHeight - context.gutter() + \"px\"; })\n .each(function (d) {\n d._placeholderElement\n .attr(\"draggable\", context.designMode())\n .selectAll(\".dragHandle\")\n .attr(\"draggable\", context.designMode())\n ;\n d\n .surfacePadding(context.surfacePadding())\n .resize()\n ;\n });\n rows.exit().each(function (d) {\n d.target(null);\n }).remove();\n\n this.getCellSizes();\n\n element\n .selectAll(\"#\" + this.id() + \" > div.borderHandle\")\n .each(function () {\n const handle = d3Select(this);\n if (handle.classed(\"borderHandle_top\")) {\n handle.style(\"width\", context._cellSizes.width + \"px\");\n handle.style(\"top\", (context._cellSizes.topHeight - 3) + \"px\");\n } else if (handle.classed(\"borderHandle_right\")) {\n handle.style(\"left\", (context._cellSizes.width - context._cellSizes.rightWidth) + \"px\");\n handle.style(\"top\", (context._cellSizes.topHeight + 3) + \"px\");\n handle.style(\"height\", context._cellSizes.rightHeight + \"px\");\n } else if (handle.classed(\"borderHandle_bottom\")) {\n handle.style(\"width\", context._cellSizes.width + \"px\");\n handle.style(\"top\", (context._cellSizes.height - context._cellSizes.bottomHeight - 3) + \"px\");\n } else if (handle.classed(\"borderHandle_left\")) {\n handle.style(\"left\", context._cellSizes.leftWidth + \"px\");\n handle.style(\"height\", context._cellSizes.leftHeight + \"px\");\n handle.style(\"top\", (context._cellSizes.topHeight + 3) + \"px\");\n }\n\n })\n ;\n }\n\n getCellSizes() {\n const context = this;\n context._cellSizes = {};\n const contentRect = this.element().node().getBoundingClientRect();\n context._cellSizes.width = contentRect.width;\n context._cellSizes.height = contentRect.height;\n this.element()\n .selectAll(\"#\" + this.id() + \" > div > div.border-cell\")\n .each(function () {\n const cell = d3Select(this);\n if (typeof cell.node === \"function\") {\n const rect = cell.node().getBoundingClientRect();\n if (cell.classed(\"border-cell-top\")) {\n context._cellSizes.topHeight = rect.height;\n } else if (cell.classed(\"border-cell-left\")) {\n context._cellSizes.leftWidth = rect.width;\n context._cellSizes.leftHeight = rect.height;\n } else if (cell.classed(\"border-cell-right\")) {\n context._cellSizes.rightWidth = rect.width;\n context._cellSizes.rightHeight = rect.height;\n } else if (cell.classed(\"border-cell-bottom\")) {\n context._cellSizes.bottomHeight = rect.height;\n }\n }\n });\n const sizes = [\"height\", \"width\", \"topHeight\", \"bottomHeight\", \"leftHeight\", \"rightHeight\", \"leftWidth\", \"rightWidth\"];\n sizes.forEach(function (size) {\n context._cellSizes[size] = context._cellSizes[size] === undefined ? 0 : context._cellSizes[size];\n });\n }\n\n postUpdate(domNode, element) {\n const context = this;\n this.content().forEach(function (n) {\n if (n._element.node() !== null && n.widget()) {\n const prevBox = n.widget().getBBox(false, true);\n const currBox = n.widget().getBBox(true, true);\n if (prevBox.width !== currBox.width || prevBox.height !== currBox.height) {\n context.lazyRender();\n }\n }\n });\n }\n\n exit(domNode, element) {\n this.content().forEach(w => w.target(null));\n super.exit(domNode, element);\n }\n}\nBorder.prototype._class += \" layout_Border\";\n\nexport interface Border {\n designMode(): boolean;\n designMode(_: boolean): this;\n\n content(): any[];\n content(_: any[]): this;\n\n gutter(): number;\n gutter(_: number): this;\n\n topShrinkWrap(): boolean;\n topShrinkWrap(_: boolean): this;\n leftShrinkWrap(): boolean;\n leftShrinkWrap(_: boolean): this;\n rightShrinkWrap(): boolean;\n rightShrinkWrap(_: boolean): this;\n bottomShrinkWrap(): boolean;\n bottomShrinkWrap(_: boolean): this;\n\n topSize(): number;\n topSize(_: number): this;\n leftSize(): number;\n leftSize(_: number): this;\n rightSize(): number;\n rightSize(_: number): this;\n bottomSize(): number;\n bottomSize(_: number): this;\n\n topPercentage(): number;\n topPercentage(_: number): this;\n leftPercentage(): number;\n leftPercentage(_: number): this;\n rightPercentage(): number;\n rightPercentage(_: number): this;\n bottomPercentage(): number;\n bottomPercentage(_: number): this;\n\n surfacePadding(): number;\n surfacePadding(_: number): this;\n\n sectionTypes(): any[];\n sectionTypes(_: any[]): this;\n}\n\nBorder.prototype.publish(\"designMode\", false, \"boolean\", \"Design Mode\", null, { tags: [\"Basic\"] });\n\nBorder.prototype.publish(\"content\", [], \"widgetArray\", \"widgets\", null, { tags: [\"Intermediate\"] });\n\nBorder.prototype.publish(\"gutter\", 0, \"number\", \"Gap Between Widgets\", null, { tags: [\"Basic\"] });\n\nBorder.prototype.publish(\"topShrinkWrap\", false, \"boolean\", \"'Top' Cell shrinks to fit content\", null, { tags: [\"Intermediate\"] });\nBorder.prototype.publish(\"leftShrinkWrap\", false, \"boolean\", \"'Left' Cell shrinks to fit content\", null, { tags: [\"Intermediate\"] });\nBorder.prototype.publish(\"rightShrinkWrap\", false, \"boolean\", \"'Right' Cell shrinks to fit content\", null, { tags: [\"Intermediate\"] });\nBorder.prototype.publish(\"bottomShrinkWrap\", false, \"boolean\", \"'Bottom' Cell shrinks to fit content\", null, { tags: [\"Intermediate\"] });\n\nBorder.prototype.publish(\"topSize\", 0, \"number\", \"Height of the 'Top' Cell (px)\", null, { tags: [\"Private\"] });\nBorder.prototype.publish(\"leftSize\", 0, \"number\", \"Width of the 'Left' Cell (px)\", null, { tags: [\"Private\"] });\nBorder.prototype.publish(\"rightSize\", 0, \"number\", \"Width of the 'Right' Cell (px)\", null, { tags: [\"Private\"] });\nBorder.prototype.publish(\"bottomSize\", 0, \"number\", \"Height of the 'Bottom' Cell (px)\", null, { tags: [\"Private\"] });\n\nBorder.prototype.publish(\"topPercentage\", 20, \"number\", \"Percentage (of parent) Height of the 'Top' Cell\", null, { tags: [\"Private\"] });\nBorder.prototype.publish(\"leftPercentage\", 20, \"number\", \"Percentage (of parent) Width of the 'Left' Cell\", null, { tags: [\"Private\"] });\nBorder.prototype.publish(\"rightPercentage\", 20, \"number\", \"Percentage (of parent) Width of the 'Right' Cell\", null, { tags: [\"Private\"] });\nBorder.prototype.publish(\"bottomPercentage\", 20, \"number\", \"Percentage (of parent) Height of the 'Bottom' Cell\", null, { tags: [\"Private\"] });\n\nBorder.prototype.publish(\"surfacePadding\", 0, \"number\", \"Cell Padding (px)\", null, { tags: [\"Intermediate\"] });\n\nBorder.prototype.publish(\"sectionTypes\", [], \"array\", \"Section Types sharing an index with 'content' - Used to determine position/size.\", null, { tags: [\"Private\"] });\n","import { BBox, HTMLWidget, Platform, Widget } from \"@hpcc-js/common\";\n\nimport \"../src/Border2.css\";\n\nexport type OverflowT = \"hidden\" | \"scroll\" | \"visible\" | \"auto\";\nexport type ChartPanelSectionT = \"top\" | \"right\" | \"bottom\" | \"left\" | \"center\";\nexport class WidgetDiv {\n private _div;\n private _overlay: boolean = false;\n private _overflowX: OverflowT = \"visible\";\n private _overflowY: OverflowT = \"visible\";\n private _widget: Widget;\n\n constructor(div) {\n this._div = div;\n }\n\n overlay(): boolean;\n overlay(_: boolean): this;\n overlay(_?: boolean): boolean | this {\n if (!arguments.length) return this._overlay;\n this._overlay = _;\n return this;\n }\n\n overflowX(): OverflowT;\n overflowX(_: OverflowT): this;\n overflowX(_?: OverflowT): OverflowT | this {\n if (!arguments.length) return this._overflowX;\n this._overflowX = _;\n this._div.style(\"overflow-x\", _);\n return this;\n }\n overflowY(): OverflowT;\n overflowY(_: OverflowT): this;\n overflowY(_?: OverflowT): OverflowT | this {\n if (!arguments.length) return this._overflowY;\n this._overflowY = _;\n this._div.style(\"overflow-y\", _);\n return this;\n }\n\n element() {\n return this._div;\n }\n\n node(): SVGElement | HTMLElement {\n return this._div.node();\n }\n\n widget(): Widget;\n widget(_: Widget): this;\n widget(_?: Widget): Widget | this {\n if (!arguments.length) return this._widget;\n if (this._widget !== _) {\n if (this._widget) {\n this._widget.target(null);\n }\n this._widget = _;\n if (this._widget) {\n this._widget.target(this._div.node());\n }\n }\n return this;\n }\n\n resize(size: { width: number, height: number }) {\n if (this._widget) {\n this._div\n .style(\"width\", `${size.width}px`)\n .style(\"height\", `${size.height}px`)\n ;\n this._widget.resize(size);\n }\n return this;\n }\n\n async render(getBBox?, availableHeight?: number, availableWidth?: number): Promise<BBox | undefined> {\n let overflowX = this.overflowX();\n if(!this.overlay() && overflowX === \"visible\") {\n overflowX = null;\n }\n let overflowY = this.overflowY();\n if(!this.overlay() && overflowY === \"visible\") {\n overflowY = null;\n }\n this._div\n .style(\"height\", this.overlay() ? \"0px\" : null)\n .style(\"overflow-x\", overflowX)\n .style(\"overflow-y\", overflowY)\n ;\n if (this._widget) {\n return this._widget.renderPromise().then(w => {\n if (getBBox && this._widget.visible()) {\n const retVal = this._widget.getBBox();\n retVal.width += 8;\n if (availableHeight !== undefined && retVal.height > availableHeight) {\n retVal.width += Platform.getScrollbarWidth();\n }\n if (availableWidth !== undefined && retVal.width > availableWidth) {\n retVal.height += Platform.getScrollbarWidth();\n }\n if (this.overlay()) {\n retVal.height = 0;\n } else {\n retVal.height += 4;\n }\n return retVal;\n }\n return getBBox ? { x: 0, y: 0, width: 0, height: 0 } : undefined;\n });\n } else {\n return Promise.resolve(getBBox ? { x: 0, y: 0, width: 0, height: 0 } : undefined);\n }\n }\n}\n\nexport class Border2 extends HTMLWidget {\n\n protected _bodyElement;\n\n protected _topWA: WidgetDiv;\n protected _leftWA: WidgetDiv;\n protected _centerWA: WidgetDiv;\n protected _rightWA: WidgetDiv;\n protected _bottomWA: WidgetDiv;\n protected _topPrevOverflow: OverflowT;\n protected _leftPrevOverflow: OverflowT;\n protected _rightPrevOverflow: OverflowT;\n protected _bottomPrevOverflow: OverflowT;\n\n constructor() {\n super();\n this._tag = \"div\";\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n \n const topElement = element.append(\"header\");\n\n this._bodyElement = element.append(\"div\").attr(\"class\", \"body\");\n const centerElement = this._bodyElement.append(\"div\").attr(\"class\", \"center\");\n const leftElement = this._bodyElement.append(\"div\").attr(\"class\", \"lhs\");\n const rightElement = this._bodyElement.append(\"div\").attr(\"class\", \"rhs\");\n\n const bottomElement = element.append(\"div\").attr(\"class\", \"footer\");\n\n this._topWA = new WidgetDiv(topElement);\n this._centerWA = new WidgetDiv(centerElement);\n this._leftWA = new WidgetDiv(leftElement);\n this._rightWA = new WidgetDiv(rightElement);\n this._bottomWA = new WidgetDiv(bottomElement);\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n this._topWA.element().style(\"display\", this.showTop() ? null : \"none\");\n this._rightWA.element().style(\"display\", this.showRight() ? null : \"none\");\n this._bottomWA.element().style(\"display\", this.showBottom() ? null : \"none\");\n this._leftWA.element().style(\"display\", this.showLeft() ? null : \"none\");\n if(this.topOverflowX() !== this._topWA.overflowX()) {\n this._topWA.overflowX(this.topOverflowX());\n }\n if(this.rightOverflowX() !== this._rightWA.overflowX()) {\n this._rightWA.overflowX(this.rightOverflowX());\n }\n if(this.bottomOverflowX() !== this._bottomWA.overflowX()) {\n this._bottomWA.overflowX(this.bottomOverflowX());\n }\n if(this.leftOverflowX() !== this._leftWA.overflowX()) {\n this._leftWA.overflowX(this.leftOverflowX());\n }\n if(this.topOverflowY() !== this._topWA.overflowY()) {\n this._topWA.overflowY(this.topOverflowY());\n }\n if(this.rightOverflowY() !== this._rightWA.overflowY()) {\n this._rightWA.overflowY(this.rightOverflowY());\n }\n if(this.bottomOverflowY() !== this._bottomWA.overflowY()) {\n this._bottomWA.overflowY(this.bottomOverflowY());\n }\n if(this.leftOverflowY() !== this._leftWA.overflowY()) {\n this._leftWA.overflowY(this.leftOverflowY());\n }\n this.element()\n .style(\"width\", `${this.width()}px`)\n .style(\"height\", `${this.height()}px`)\n ;\n }\n\n private targetNull(w?: Widget) {\n if (w) {\n w.target(null);\n }\n }\n\n exit(domNode, element) {\n this.targetNull(this.center());\n this.targetNull(this.bottom());\n this.targetNull(this.right());\n this.targetNull(this.left());\n this.targetNull(this.top());\n super.exit(domNode, element);\n }\n\n swap(sectionA: ChartPanelSectionT, sectionB: ChartPanelSectionT): this {\n const a = this[sectionA]();\n const b = this[sectionB]();\n this.targetNull(a);\n this.targetNull(b);\n this[`_${sectionA}WA`].widget(null);\n this[`_${sectionB}WA`].widget(null);\n this[sectionA](b);\n this[sectionB](a);\n return this;\n }\n\n render(callback?: (w: Widget) => void): this {\n const retVal = super.render(w => {\n if (this._topWA) {\n this._topWA\n .widget(this.top())\n .overlay(this.topOverlay())\n .render(true).then(async topBBox => {\n const bottomBBox: BBox = await this._bottomWA.widget(this.bottom()).render(true, undefined, this.width()) as BBox;\n const availableHeight = this.height() - (topBBox.height + bottomBBox.height);\n const leftBBox: BBox = await this._leftWA.widget(this.left()).render(true, availableHeight) as BBox;\n const rightBBox: BBox = await this._rightWA.widget(this.right()).render(true, availableHeight) as BBox;\n \n if (this.bottomHeight_exists()) {\n bottomBBox.height = this.bottomHeight();\n }\n const bodyWidth = this.width() - (leftBBox.width + rightBBox.width);\n const bodyHeight = this.height() - (topBBox.height + bottomBBox.height);\n \n const centerOverflowX = this.centerOverflowX();\n const centerOverflowY = this.centerOverflowY();\n\n const scrollCenterX = [\"auto\", \"scroll\"].indexOf(centerOverflowX) !== -1;\n const scrollCenterY = [\"auto\", \"scroll\"].indexOf(centerOverflowY) !== -1;\n if(scrollCenterX || scrollCenterY) {\n this._centerWA\n .overflowX(this.centerOverflowX())\n .overflowY(this.centerOverflowY())\n .widget(this.center())\n .resize({\n width: bodyWidth,\n height: bodyHeight\n })\n .render()\n ;\n }\n this._bodyElement.style(\"height\", `${bodyHeight}px`);\n const promises = [\n this._topWA\n .overflowX(this.topOverflowX())\n .overflowY(this.topOverflowY())\n .resize({\n width: this.width(),\n height: topBBox.height\n })\n .render(),\n this._leftWA\n .overflowX(this.leftOverflowX())\n .overflowY(this.leftOverflowY())\n .resize({\n width: leftBBox.width,\n height: bodyHeight\n })\n .render(),\n this._rightWA\n .overflowX(this.rightOverflowX())\n .overflowY(this.rightOverflowY())\n .resize({\n width: rightBBox.width,\n height: bodyHeight\n })\n .render(),\n this._centerWA\n .overflowX(this.centerOverflowX())\n .overflowY(this.centerOverflowY())\n .widget(this.center())\n .resize({\n width: bodyWidth,\n height: bodyHeight\n })\n .render(),\n this._bottomWA\n .overflowX(this.bottomOverflowX())\n .overflowY(this.bottomOverflowY())\n .resize({\n width: this.width(),\n height: bottomBBox.height\n })\n .render()\n ];\n Promise.all(promises).then(promises => {\n if (callback) {\n callback(this);\n }\n });\n })\n ;\n } else {\n if (callback) {\n callback(this);\n }\n }\n });\n return retVal;\n }\n}\nBorder2.prototype._class += \" layout_Border2\";\n\nexport interface Border2 {\n top(): Widget;\n top(_: Widget): this;\n topOverlay(): boolean;\n topOverlay(_: boolean): this;\n left(): Widget;\n left(_: Widget): this;\n center(): Widget;\n center(_: Widget): this;\n right(): Widget;\n right(_: Widget): this;\n bottom(): Widget;\n bottom(_: Widget): this;\n bottomHeight(): number;\n bottomHeight(_: number): this;\n bottomHeight_exists(): boolean;\n topOverflowX(): OverflowT;\n topOverflowX(_: OverflowT): this;\n rightOverflowX(): OverflowT;\n rightOverflowX(_: OverflowT): this;\n bottomOverflowX(): OverflowT;\n bottomOverflowX(_: OverflowT): this;\n leftOverflowX(): OverflowT;\n leftOverflowX(_: OverflowT): this;\n centerOverflowX(): OverflowT;\n centerOverflowX(_: OverflowT): this;\n topOverflowY(): OverflowT;\n topOverflowY(_: OverflowT): this;\n rightOverflowY(): OverflowT;\n rightOverflowY(_: OverflowT): this;\n bottomOverflowY(): OverflowT;\n bottomOverflowY(_: OverflowT): this;\n leftOverflowY(): OverflowT;\n leftOverflowY(_: OverflowT): this;\n centerOverflowY(): OverflowT;\n centerOverflowY(_: OverflowT): this;\n showTop(): boolean;\n showTop(_: boolean): this;\n showRight(): boolean;\n showRight(_: boolean): this;\n showBottom(): boolean;\n showBottom(_: boolean): this;\n showLeft(): boolean;\n showLeft(_: boolean): this;\n topOverflowX_default(_: OverflowT);\n rightOverflowX_default(_: OverflowT);\n bottomOverflowX_default(_: OverflowT);\n leftOverflowX_default(_: OverflowT);\n centerOverflowX_default(_: OverflowT);\n topOverflowY_default(_: OverflowT);\n rightOverflowY_default(_: OverflowT);\n bottomOverflowY_default(_: OverflowT);\n leftOverflowY_default(_: OverflowT);\n centerOverflowY_default(_: OverflowT);\n}\nBorder2.prototype.publish(\"showTop\", true, \"boolean\", \"If true, top widget adapter will display\");\nBorder2.prototype.publish(\"showRight\", true, \"boolean\", \"If true, right widget adapter will display\");\nBorder2.prototype.publish(\"showBottom\", true, \"boolean\", \"If true, bottom widget adapter will display\");\nBorder2.prototype.publish(\"showLeft\", true, \"boolean\", \"If true, left widget adapter will display\");\nBorder2.prototype.publish(\"topOverflowX\", \"visible\", \"set\", \"Sets the overflow-x css style for the top widget adapter\", [\"hidden\", \"scroll\", \"visible\", \"auto\"]);\nBorder2.prototype.publish(\"rightOverflowX\", \"visible\", \"set\", \"Sets the overflow-x css style for the right widget adapter\", [\"hidden\", \"scroll\", \"visible\", \"auto\"]);\nBorder2.prototype.publish(\"bottomOverflowX\", \"visible\", \"set\", \"Sets the overflow-x css style for the bottom widget adapter\", [\"hidden\", \"scroll\", \"visible\", \"auto\"]);\nBorder2.prototype.publish(\"leftOverflowX\", \"visible\", \"set\", \"Sets the overflow-x css style for the left widget adapter\", [\"hidden\", \"scroll\", \"visible\", \"auto\"]);\nBorder2.prototype.publish(\"centerOverflowX\", \"visible\", \"set\", \"Sets the overflow-x css style for the center widget adapter\", [\"hidden\", \"scroll\", \"visible\", \"auto\"]);\nBorder2.prototype.publish(\"topOverflowY\", \"visible\", \"set\", \"Sets the overflow-y css style for the top widget adapter\", [\"hidden\", \"scroll\", \"visible\", \"auto\"]);\nBorder2.prototype.publish(\"rightOverflowY\", \"visible\", \"set\", \"Sets the overflow-y css style for the right widget adapter\", [\"hidden\", \"scroll\", \"visible\", \"auto\"]);\nBorder2.prototype.publish(\"bottomOverflowY\", \"visible\", \"set\", \"Sets the overflow-y css style for the bottom widget adapter\", [\"hidden\", \"scroll\", \"visible\", \"auto\"]);\nBorder2.prototype.publish(\"leftOverflowY\", \"visible\", \"set\", \"Sets the overflow-y css style for the left widget adapter\", [\"hidden\", \"scroll\", \"visible\", \"auto\"]);\nBorder2.prototype.publish(\"centerOverflowY\", \"visible\", \"set\", \"Sets the overflow-y css style for the center widget adapter\", [\"hidden\", \"scroll\", \"visible\", \"auto\"]);\nBorder2.prototype.publish(\"top\", null, \"widget\", \"Top Widget\", undefined, { render: false });\nBorder2.prototype.publish(\"topOverlay\", false, \"boolean\", \"Overlay Top Widget\");\nBorder2.prototype.publish(\"left\", null, \"widget\", \"Left Widget\", undefined, { render: false });\nBorder2.prototype.publish(\"center\", null, \"widget\", \"Center Widget\", undefined, { render: false });\nBorder2.prototype.publish(\"right\", null, \"widget\", \"Right Widget\", undefined, { render: false });\nBorder2.prototype.publish(\"bottom\", null, \"widget\", \"Bottom Widget\", undefined, { render: false });\nBorder2.prototype.publish(\"bottomHeight\", null, \"number\", \"Bottom Fixed Height\", undefined, { optional: true });\n","import { HTMLWidget, Widget } from \"@hpcc-js/common\";\nimport { select as d3Select } from \"d3-selection\";\nimport \"d3-transition\";\n\nimport \"../src/Carousel.css\";\n\nexport class Carousel extends HTMLWidget {\n\n protected _prevActive: number = 0;\n protected _root;\n\n activeWidget(): Widget {\n return this.widgets()[this.active()];\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this._root = element.append(\"div\")\n .attr(\"id\", `${this.id()}_root`)\n ;\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n const active = this.active();\n const width = this.width();\n this._root\n .style(\"width\", `${width}px`)\n .style(\"height\", `${this.height()}px`)\n ;\n const widgetElements = this._root.selectAll(`#${this.id()}_root > .carouselItem`).data(this.widgets(), d => d.id());\n const update = widgetElements.enter().append(\"div\")\n .attr(\"class\", \"carouselItem\")\n .each(function (w) {\n w.target(this);\n })\n .merge(widgetElements)\n .style(\"left\", (d, i) => `${(i - this._prevActive) * width}px`)\n .style(\"width\", `${width}px`)\n ;\n if (this._prevActive !== active) {\n update\n .style(\"display\", (d, i) => i === this._prevActive || i === active ? null : \"none\") // Must be called before render callback (not inside transition)\n .transition().duration(this.transitionDuration())\n .style(\"left\", (d, i) => `${(i - active) * width}px`)\n .on(\"end\", function (d, i) {\n d3Select(this).style(\"display\", () => i === active ? null : \"none\");\n })\n ;\n this._prevActive = active;\n }\n widgetElements.exit()\n .each(function (w) {\n w.target(null);\n })\n .remove()\n ;\n }\n\n exit(domNode, element) {\n this.widgets().forEach(w => w.target(null));\n super.exit(domNode, element);\n }\n\n render(callback): this {\n return super.render(w => {\n if (!this.visible() || this.isDOMHidden()) {\n if (callback) {\n callback(w);\n }\n } else {\n const aw = this.activeWidget();\n if (aw) {\n aw\n .resize(this.size())\n .render(w2 => {\n if (callback) {\n callback(w);\n }\n })\n ;\n }\n }\n });\n }\n}\nCarousel.prototype._class += \" layout_Carousel\";\n\nexport interface Carousel {\n widgets(): Widget[];\n widgets(_: Widget[]): this;\n active(): number;\n active(_: number): this;\n transitionDuration(): Widget[];\n transitionDuration(_: Widget[]): this;\n}\n\nCarousel.prototype.publish(\"widgets\", [], \"widgetArray\", \"Widgets\", null, { render: false });\nCarousel.prototype.publish(\"active\", 0, \"number\", \"Active widget\");\nCarousel.prototype.publish(\"transitionDuration\", 500, \"number\", \"Transition duration\");\n","var pi = Math.PI,\n tau = 2 * pi,\n epsilon = 1e-6,\n tauEpsilon = tau - epsilon;\n\nfunction Path() {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n}\n\nfunction path() {\n return new Path;\n}\n\nPath.prototype = path.prototype = {\n constructor: Path,\n moveTo: function(x, y) {\n this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y);\n },\n closePath: function() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._ += \"Z\";\n }\n },\n lineTo: function(x, y) {\n this._ += \"L\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n quadraticCurveTo: function(x1, y1, x, y) {\n this._ += \"Q\" + (+x1) + \",\" + (+y1) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) {\n this._ += \"C\" + (+x1) + \",\" + (+y1) + \",\" + (+x2) + \",\" + (+y2) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n arcTo: function(x1, y1, x2, y2, r) {\n x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;\n var x0 = this._x1,\n y0 = this._y1,\n x21 = x2 - x1,\n y21 = y2 - y1,\n x01 = x0 - x1,\n y01 = y0 - y1,\n l01_2 = x01 * x01 + y01 * y01;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(\"negative radius: \" + r);\n\n // Is this path empty? Move to (x1,y1).\n if (this._x1 === null) {\n this._ += \"M\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n }\n\n // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.\n else if (!(l01_2 > epsilon));\n\n // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?\n // Equivalently, is (x1,y1) coincident with (x2,y2)?\n // Or, is the radius zero? Line to (x1,y1).\n else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {\n this._ += \"L\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n }\n\n // Otherwise, draw an arc!\n else {\n var x20 = x2 - x0,\n y20 = y2 - y0,\n l21_2 = x21 * x21 + y21 * y21,\n l20_2 = x20 * x20 + y20 * y20,\n l21 = Math.sqrt(l21_2),\n l01 = Math.sqrt(l01_2),\n l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),\n t01 = l / l01,\n t21 = l / l21;\n\n // If the start tangent is not coincident with (x0,y0), line to.\n if (Math.abs(t01 - 1) > epsilon) {\n this._ += \"L\" + (x1 + t01 * x01) + \",\" + (y1 + t01 * y01);\n }\n\n this._ += \"A\" + r + \",\" + r + \",0,0,\" + (+(y01 * x20 > x01 * y20)) + \",\" + (this._x1 = x1 + t21 * x21) + \",\" + (this._y1 = y1 + t21 * y21);\n }\n },\n arc: function(x, y, r, a0, a1, ccw) {\n x = +x, y = +y, r = +r, ccw = !!ccw;\n var dx = r * Math.cos(a0),\n dy = r * Math.sin(a0),\n x0 = x + dx,\n y0 = y + dy,\n cw = 1 ^ ccw,\n da = ccw ? a0 - a1 : a1 - a0;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(\"negative radius: \" + r);\n\n // Is this path empty? Move to (x0,y0).\n if (this._x1 === null) {\n this._ += \"M\" + x0 + \",\" + y0;\n }\n\n // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).\n else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {\n this._ += \"L\" + x0 + \",\" + y0;\n }\n\n // Is this arc empty? We’re done.\n if (!r) return;\n\n // Does the angle go the wrong way? Flip the direction.\n if (da < 0) da = da % tau + tau;\n\n // Is this a complete circle? Draw two arcs to complete the circle.\n if (da > tauEpsilon) {\n this._ += \"A\" + r + \",\" + r + \",0,1,\" + cw + \",\" + (x - dx) + \",\" + (y - dy) + \"A\" + r + \",\" + r + \",0,1,\" + cw + \",\" + (this._x1 = x0) + \",\" + (this._y1 = y0);\n }\n\n // Is this arc non-empty? Draw an arc!\n else if (da > epsilon) {\n this._ += \"A\" + r + \",\" + r + \",0,\" + (+(da >= pi)) + \",\" + cw + \",\" + (this._x1 = x + r * Math.cos(a1)) + \",\" + (this._y1 = y + r * Math.sin(a1));\n }\n },\n rect: function(x, y, w, h) {\n this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y) + \"h\" + (+w) + \"v\" + (+h) + \"h\" + (-w) + \"Z\";\n },\n toString: function() {\n return this._;\n }\n};\n\nexport default path;\n","export default function(x) {\n return function constant() {\n return x;\n };\n}\n","export var abs = Math.abs;\nexport var atan2 = Math.atan2;\nexport var cos = Math.cos;\nexport var max = Math.max;\nexport var min = Math.min;\nexport var sin = Math.sin;\nexport var sqrt = Math.sqrt;\n\nexport var epsilon = 1e-12;\nexport var pi = Math.PI;\nexport var halfPi = pi / 2;\nexport var tau = 2 * pi;\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function asin(x) {\n return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);\n}\n","import {pi, tau} from \"../math.js\";\n\nexport default {\n draw: function(context, size) {\n var r = Math.sqrt(size / pi);\n context.moveTo(r, 0);\n context.arc(0, 0, r, 0, tau);\n }\n};\n","export default {\n draw: function(context, size) {\n var r = Math.sqrt(size / 5) / 2;\n context.moveTo(-3 * r, -r);\n context.lineTo(-r, -r);\n context.lineTo(-r, -3 * r);\n context.lineTo(r, -3 * r);\n context.lineTo(r, -r);\n context.lineTo(3 * r, -r);\n context.lineTo(3 * r, r);\n context.lineTo(r, r);\n context.lineTo(r, 3 * r);\n context.lineTo(-r, 3 * r);\n context.lineTo(-r, r);\n context.lineTo(-3 * r, r);\n context.closePath();\n }\n};\n","var tan30 = Math.sqrt(1 / 3),\n tan30_2 = tan30 * 2;\n\nexport default {\n draw: function(context, size) {\n var y = Math.sqrt(size / tan30_2),\n x = y * tan30;\n context.moveTo(0, -y);\n context.lineTo(x, 0);\n context.lineTo(0, y);\n context.lineTo(-x, 0);\n context.closePath();\n }\n};\n","import {pi, tau} from \"../math.js\";\n\nvar ka = 0.89081309152928522810,\n kr = Math.sin(pi / 10) / Math.sin(7 * pi / 10),\n kx = Math.sin(tau / 10) * kr,\n ky = -Math.cos(tau / 10) * kr;\n\nexport default {\n draw: function(context, size) {\n var r = Math.sqrt(size * ka),\n x = kx * r,\n y = ky * r;\n context.moveTo(0, -r);\n context.lineTo(x, y);\n for (var i = 1; i < 5; ++i) {\n var a = tau * i / 5,\n c = Math.cos(a),\n s = Math.sin(a);\n context.lineTo(s * r, -c * r);\n context.lineTo(c * x - s * y, s * x + c * y);\n }\n context.closePath();\n }\n};\n","export default {\n draw: function(context, size) {\n var w = Math.sqrt(size),\n x = -w / 2;\n context.rect(x, x, w, w);\n }\n};\n","var sqrt3 = Math.sqrt(3);\n\nexport default {\n draw: function(context, size) {\n var y = -Math.sqrt(size / (sqrt3 * 3));\n context.moveTo(0, y * 2);\n context.lineTo(-sqrt3 * y, -y);\n context.lineTo(sqrt3 * y, -y);\n context.closePath();\n }\n};\n","var c = -0.5,\n s = Math.sqrt(3) / 2,\n k = 1 / Math.sqrt(12),\n a = (k / 2 + 1) * 3;\n\nexport default {\n draw: function(context, size) {\n var r = Math.sqrt(size / a),\n x0 = r / 2,\n y0 = r * k,\n x1 = x0,\n y1 = r * k + r,\n x2 = -x1,\n y2 = y1;\n context.moveTo(x0, y0);\n context.lineTo(x1, y1);\n context.lineTo(x2, y2);\n context.lineTo(c * x0 - s * y0, s * x0 + c * y0);\n context.lineTo(c * x1 - s * y1, s * x1 + c * y1);\n context.lineTo(c * x2 - s * y2, s * x2 + c * y2);\n context.lineTo(c * x0 + s * y0, c * y0 - s * x0);\n context.lineTo(c * x1 + s * y1, c * y1 - s * x1);\n context.lineTo(c * x2 + s * y2, c * y2 - s * x2);\n context.closePath();\n }\n};\n","import {path} from \"d3-path\";\nimport circle from \"./symbol/circle.js\";\nimport cross from \"./symbol/cross.js\";\nimport diamond from \"./symbol/diamond.js\";\nimport star from \"./symbol/star.js\";\nimport square from \"./symbol/square.js\";\nimport triangle from \"./symbol/triangle.js\";\nimport wye from \"./symbol/wye.js\";\nimport constant from \"./constant.js\";\n\nexport var symbols = [\n circle,\n cross,\n diamond,\n square,\n star,\n triangle,\n wye\n];\n\nexport default function() {\n var type = constant(circle),\n size = constant(64),\n context = null;\n\n function symbol() {\n var buffer;\n if (!context) context = buffer = path();\n type.apply(this, arguments).draw(context, +size.apply(this, arguments));\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n symbol.type = function(_) {\n return arguments.length ? (type = typeof _ === \"function\" ? _ : constant(_), symbol) : type;\n };\n\n symbol.size = function(_) {\n return arguments.length ? (size = typeof _ === \"function\" ? _ : constant(+_), symbol) : size;\n };\n\n symbol.context = function(_) {\n return arguments.length ? (context = _ == null ? null : _, symbol) : context;\n };\n\n return symbol;\n}\n","import { select } from 'd3-selection';\nimport { format, formatLocale, formatPrefix, formatSpecifier } from 'd3-format';\nimport { dispatch } from 'd3-dispatch';\nimport { scaleLinear } from 'd3-scale';\nimport { max, sum } from 'd3-array';\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n return typeof obj;\n} : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n};\n\nvar d3_identity = function d3_identity(d) {\n return d;\n};\n\nvar d3_reverse = function d3_reverse(arr) {\n var mirror = [];\n for (var i = 0, l = arr.length; i < l; i++) {\n mirror[i] = arr[l - i - 1];\n }\n return mirror;\n};\n\n//Text wrapping code adapted from Mike Bostock\nvar d3_textWrapping = function d3_textWrapping(text, width) {\n text.each(function () {\n var text = select(this),\n words = text.text().split(/\\s+/).reverse(),\n word,\n line = [],\n lineNumber = 0,\n lineHeight = 1.2,\n //ems\n y = text.attr(\"y\"),\n dy = parseFloat(text.attr(\"dy\")) || 0,\n tspan = text.text(null).append(\"tspan\").attr(\"x\", 0).attr(\"dy\", dy + \"em\");\n\n while (word = words.pop()) {\n line.push(word);\n tspan.text(line.join(\" \"));\n if (tspan.node().getComputedTextLength() > width && line.length > 1) {\n line.pop();\n tspan.text(line.join(\" \"));\n line = [word];\n tspan = text.append(\"tspan\").attr(\"x\", 0).attr(\"dy\", lineHeight + dy + \"em\").text(word);\n }\n }\n });\n};\n\nvar d3_mergeLabels = function d3_mergeLabels() {\n var gen = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n var labels = arguments[1];\n var domain = arguments[2];\n var range = arguments[3];\n var labelDelimiter = arguments[4];\n\n if ((typeof labels === \"undefined\" ? \"undefined\" : _typeof(labels)) === \"object\") {\n if (labels.length === 0) return gen;\n\n var i = labels.length;\n for (; i < gen.length; i++) {\n labels.push(gen[i]);\n }\n return labels;\n } else if (typeof labels === \"function\") {\n var customLabels = [];\n var genLength = gen.length;\n for (var _i = 0; _i < genLength; _i++) {\n customLabels.push(labels({\n i: _i,\n genLength: genLength,\n generatedLabels: gen,\n domain: domain,\n range: range,\n labelDelimiter: labelDelimiter\n }));\n }\n return customLabels;\n }\n\n return gen;\n};\n\nvar d3_linearLegend = function d3_linearLegend(scale, cells, labelFormat) {\n var data = [];\n\n if (cells.length > 1) {\n data = cells;\n } else {\n var domain = scale.domain(),\n increment = (domain[domain.length - 1] - domain[0]) / (cells - 1);\n var i = 0;\n\n for (; i < cells; i++) {\n data.push(domain[0] + i * increment);\n }\n }\n\n var labels = data.map(labelFormat);\n return {\n data: data,\n labels: labels,\n feature: function feature(d) {\n return scale(d);\n }\n };\n};\n\nvar d3_quantLegend = function d3_quantLegend(scale, labelFormat, labelDelimiter) {\n var labels = scale.range().map(function (d) {\n var invert = scale.invertExtent(d);\n return labelFormat(invert[0]) + \" \" + labelDelimiter + \" \" + labelFormat(invert[1]);\n });\n\n return {\n data: scale.range(),\n labels: labels,\n feature: d3_identity\n };\n};\n\nvar d3_ordinalLegend = function d3_ordinalLegend(scale) {\n return {\n data: scale.domain(),\n labels: scale.domain(),\n feature: function feature(d) {\n return scale(d);\n }\n };\n};\n\nvar d3_cellOver = function d3_cellOver(cellDispatcher, d, obj) {\n cellDispatcher.call(\"cellover\", obj, d);\n};\n\nvar d3_cellOut = function d3_cellOut(cellDispatcher, d, obj) {\n cellDispatcher.call(\"cellout\", obj, d);\n};\n\nvar d3_cellClick = function d3_cellClick(cellDispatcher, d, obj) {\n cellDispatcher.call(\"cellclick\", obj, d);\n};\n\nvar helper = {\n d3_drawShapes: function d3_drawShapes(shape, shapes, shapeHeight, shapeWidth, shapeRadius, path) {\n if (shape === \"rect\") {\n shapes.attr(\"height\", shapeHeight).attr(\"width\", shapeWidth);\n } else if (shape === \"circle\") {\n shapes.attr(\"r\", shapeRadius);\n } else if (shape === \"line\") {\n shapes.attr(\"x1\", 0).attr(\"x2\", shapeWidth).attr(\"y1\", 0).attr(\"y2\", 0);\n } else if (shape === \"path\") {\n shapes.attr(\"d\", path);\n }\n },\n\n d3_addText: function d3_addText(svg, enter, labels, classPrefix, labelWidth) {\n enter.append(\"text\").attr(\"class\", classPrefix + \"label\");\n var text = svg.selectAll(\"g.\" + classPrefix + \"cell text.\" + classPrefix + \"label\").data(labels).text(d3_identity);\n\n if (labelWidth) {\n svg.selectAll(\"g.\" + classPrefix + \"cell text.\" + classPrefix + \"label\").call(d3_textWrapping, labelWidth);\n }\n\n return text;\n },\n\n d3_calcType: function d3_calcType(scale, ascending, cells, labels, labelFormat, labelDelimiter) {\n var type = scale.invertExtent ? d3_quantLegend(scale, labelFormat, labelDelimiter) : scale.ticks ? d3_linearLegend(scale, cells, labelFormat) : d3_ordinalLegend(scale);\n\n //for d3.scaleSequential that doesn't have a range function\n var range = scale.range && scale.range() || scale.domain();\n type.labels = d3_mergeLabels(type.labels, labels, scale.domain(), range, labelDelimiter);\n\n if (ascending) {\n type.labels = d3_reverse(type.labels);\n type.data = d3_reverse(type.data);\n }\n\n return type;\n },\n\n d3_filterCells: function d3_filterCells(type, cellFilter) {\n var filterCells = type.data.map(function (d, i) {\n return { data: d, label: type.labels[i] };\n }).filter(cellFilter);\n var dataValues = filterCells.map(function (d) {\n return d.data;\n });\n var labelValues = filterCells.map(function (d) {\n return d.label;\n });\n type.data = type.data.filter(function (d) {\n return dataValues.indexOf(d) !== -1;\n });\n type.labels = type.labels.filter(function (d) {\n return labelValues.indexOf(d) !== -1;\n });\n return type;\n },\n\n d3_placement: function d3_placement(orient, cell, cellTrans, text, textTrans, labelAlign) {\n cell.attr(\"transform\", cellTrans);\n text.attr(\"transform\", textTrans);\n if (orient === \"horizontal\") {\n text.style(\"text-anchor\", labelAlign);\n }\n },\n\n d3_addEvents: function d3_addEvents(cells, dispatcher) {\n cells.on(\"mouseover.legend\", function (d) {\n d3_cellOver(dispatcher, d, this);\n }).on(\"mouseout.legend\", function (d) {\n d3_cellOut(dispatcher, d, this);\n }).on(\"click.legend\", function (d) {\n d3_cellClick(dispatcher, d, this);\n });\n },\n\n d3_title: function d3_title(svg, title, classPrefix, titleWidth) {\n if (title !== \"\") {\n var titleText = svg.selectAll(\"text.\" + classPrefix + \"legendTitle\");\n\n titleText.data([title]).enter().append(\"text\").attr(\"class\", classPrefix + \"legendTitle\");\n\n svg.selectAll(\"text.\" + classPrefix + \"legendTitle\").text(title);\n\n if (titleWidth) {\n svg.selectAll(\"text.\" + classPrefix + \"legendTitle\").call(d3_textWrapping, titleWidth);\n }\n\n var cellsSvg = svg.select(\".\" + classPrefix + \"legendCells\");\n var yOffset = svg.select(\".\" + classPrefix + \"legendTitle\").nodes().map(function (d) {\n return d.getBBox().height;\n })[0],\n xOffset = -cellsSvg.nodes().map(function (d) {\n return d.getBBox().x;\n })[0];\n cellsSvg.attr(\"transform\", \"translate(\" + xOffset + \",\" + yOffset + \")\");\n }\n },\n\n d3_defaultLocale: {\n format: format,\n formatPrefix: formatPrefix\n },\n\n d3_defaultFormatSpecifier: \".01f\",\n\n d3_defaultDelimiter: \"to\"\n};\n\nfunction color() {\n var scale = scaleLinear(),\n shape = \"rect\",\n shapeWidth = 15,\n shapeHeight = 15,\n shapeRadius = 10,\n shapePadding = 2,\n cells = [5],\n cellFilter = void 0,\n labels = [],\n classPrefix = \"\",\n useClass = false,\n title = \"\",\n locale = helper.d3_defaultLocale,\n specifier = helper.d3_defaultFormatSpecifier,\n labelOffset = 10,\n labelAlign = \"middle\",\n labelDelimiter = helper.d3_defaultDelimiter,\n labelWrap = void 0,\n orient = \"vertical\",\n ascending = false,\n path = void 0,\n titleWidth = void 0,\n legendDispatcher = dispatch(\"cellover\", \"cellout\", \"cellclick\");\n\n function legend(svg) {\n var type = helper.d3_calcType(scale, ascending, cells, labels, locale.format(specifier), labelDelimiter),\n legendG = svg.selectAll(\"g\").data([scale]);\n\n legendG.enter().append(\"g\").attr(\"class\", classPrefix + \"legendCells\");\n\n if (cellFilter) {\n helper.d3_filterCells(type, cellFilter);\n }\n\n var cell = svg.select(\".\" + classPrefix + \"legendCells\").selectAll(\".\" + classPrefix + \"cell\").data(type.data);\n\n var cellEnter = cell.enter().append(\"g\").attr(\"class\", classPrefix + \"cell\");\n cellEnter.append(shape).attr(\"class\", classPrefix + \"swatch\");\n\n var shapes = svg.selectAll(\"g.\" + classPrefix + \"cell \" + shape + \".\" + classPrefix + \"swatch\").data(type.data);\n\n //add event handlers\n helper.d3_addEvents(cellEnter, legendDispatcher);\n\n cell.exit().transition().style(\"opacity\", 0).remove();\n shapes.exit().transition().style(\"opacity\", 0).remove();\n\n shapes = shapes.merge(shapes);\n\n helper.d3_drawShapes(shape, shapes, shapeHeight, shapeWidth, shapeRadius, path);\n var text = helper.d3_addText(svg, cellEnter, type.labels, classPrefix, labelWrap);\n\n // we need to merge the selection, otherwise changes in the legend (e.g. change of orientation) are applied only to the new cells and not the existing ones.\n cell = cellEnter.merge(cell);\n\n // sets placement\n var textSize = text.nodes().map(function (d) {\n return d.getBBox();\n }),\n shapeSize = shapes.nodes().map(function (d) {\n return d.getBBox();\n });\n //sets scale\n //everything is fill except for line which is stroke,\n if (!useClass) {\n if (shape == \"line\") {\n shapes.style(\"stroke\", type.feature);\n } else {\n shapes.style(\"fill\", type.feature);\n }\n } else {\n shapes.attr(\"class\", function (d) {\n return classPrefix + \"swatch \" + type.feature(d);\n });\n }\n\n var cellTrans = void 0,\n textTrans = void 0,\n textAlign = labelAlign == \"start\" ? 0 : labelAlign == \"middle\" ? 0.5 : 1;\n\n //positions cells and text\n if (orient === \"vertical\") {\n (function () {\n var cellSize = textSize.map(function (d, i) {\n return Math.max(d.height, shapeSize[i].height);\n });\n\n cellTrans = function cellTrans(d, i) {\n var height = sum(cellSize.slice(0, i));\n return \"translate(0, \" + (height + i * shapePadding) + \")\";\n };\n\n textTrans = function textTrans(d, i) {\n return \"translate( \" + (shapeSize[i].width + shapeSize[i].x + labelOffset) + \", \" + (shapeSize[i].y + shapeSize[i].height / 2 + 5) + \")\";\n };\n })();\n } else if (orient === \"horizontal\") {\n cellTrans = function cellTrans(d, i) {\n return \"translate(\" + i * (shapeSize[i].width + shapePadding) + \",0)\";\n };\n textTrans = function textTrans(d, i) {\n return \"translate(\" + (shapeSize[i].width * textAlign + shapeSize[i].x) + \",\\n \" + (shapeSize[i].height + shapeSize[i].y + labelOffset + 8) + \")\";\n };\n }\n\n helper.d3_placement(orient, cell, cellTrans, text, textTrans, labelAlign);\n helper.d3_title(svg, title, classPrefix, titleWidth);\n\n cell.transition().style(\"opacity\", 1);\n }\n\n legend.scale = function (_) {\n if (!arguments.length) return scale;\n scale = _;\n return legend;\n };\n\n legend.cells = function (_) {\n if (!arguments.length) return cells;\n if (_.length > 1 || _ >= 2) {\n cells = _;\n }\n return legend;\n };\n\n legend.cellFilter = function (_) {\n if (!arguments.length) return cellFilter;\n cellFilter = _;\n return legend;\n };\n\n legend.shape = function (_, d) {\n if (!arguments.length) return shape;\n if (_ == \"rect\" || _ == \"circle\" || _ == \"line\" || _ == \"path\" && typeof d === \"string\") {\n shape = _;\n path = d;\n }\n return legend;\n };\n\n legend.shapeWidth = function (_) {\n if (!arguments.length) return shapeWidth;\n shapeWidth = +_;\n return legend;\n };\n\n legend.shapeHeight = function (_) {\n if (!arguments.length) return shapeHeight;\n shapeHeight = +_;\n return legend;\n };\n\n legend.shapeRadius = function (_) {\n if (!arguments.length) return shapeRadius;\n shapeRadius = +_;\n return legend;\n };\n\n legend.shapePadding = function (_) {\n if (!arguments.length) return shapePadding;\n shapePadding = +_;\n return legend;\n };\n\n legend.labels = function (_) {\n if (!arguments.length) return labels;\n labels = _;\n return legend;\n };\n\n legend.labelAlign = function (_) {\n if (!arguments.length) return labelAlign;\n if (_ == \"start\" || _ == \"end\" || _ == \"middle\") {\n labelAlign = _;\n }\n return legend;\n };\n\n legend.locale = function (_) {\n if (!arguments.length) return locale;\n locale = formatLocale(_);\n return legend;\n };\n\n legend.labelFormat = function (_) {\n if (!arguments.length) return legend.locale().format(specifier);\n specifier = formatSpecifier(_);\n return legend;\n };\n\n legend.labelOffset = function (_) {\n if (!arguments.length) return labelOffset;\n labelOffset = +_;\n return legend;\n };\n\n legend.labelDelimiter = function (_) {\n if (!arguments.length) return labelDelimiter;\n labelDelimiter = _;\n return legend;\n };\n\n legend.labelWrap = function (_) {\n if (!arguments.length) return labelWrap;\n labelWrap = _;\n return legend;\n };\n\n legend.useClass = function (_) {\n if (!arguments.length) return useClass;\n if (_ === true || _ === false) {\n useClass = _;\n }\n return legend;\n };\n\n legend.orient = function (_) {\n if (!arguments.length) return orient;\n _ = _.toLowerCase();\n if (_ == \"horizontal\" || _ == \"vertical\") {\n orient = _;\n }\n return legend;\n };\n\n legend.ascending = function (_) {\n if (!arguments.length) return ascending;\n ascending = !!_;\n return legend;\n };\n\n legend.classPrefix = function (_) {\n if (!arguments.length) return classPrefix;\n classPrefix = _;\n return legend;\n };\n\n legend.title = function (_) {\n if (!arguments.length) return title;\n title = _;\n return legend;\n };\n\n legend.titleWidth = function (_) {\n if (!arguments.length) return titleWidth;\n titleWidth = _;\n return legend;\n };\n\n legend.textWrap = function (_) {\n if (!arguments.length) return textWrap;\n textWrap = _;\n return legend;\n };\n\n legend.on = function () {\n var value = legendDispatcher.on.apply(legendDispatcher, arguments);\n return value === legendDispatcher ? legend : value;\n };\n\n return legend;\n}\n\nfunction size() {\n var scale = scaleLinear(),\n shape = \"rect\",\n shapeWidth = 15,\n shapePadding = 2,\n cells = [5],\n cellFilter = void 0,\n labels = [],\n classPrefix = \"\",\n title = \"\",\n locale = helper.d3_defaultLocale,\n specifier = helper.d3_defaultFormatSpecifier,\n labelOffset = 10,\n labelAlign = \"middle\",\n labelDelimiter = helper.d3_defaultDelimiter,\n labelWrap = void 0,\n orient = \"vertical\",\n ascending = false,\n path = void 0,\n titleWidth = void 0,\n legendDispatcher = dispatch(\"cellover\", \"cellout\", \"cellclick\");\n\n function legend(svg) {\n var type = helper.d3_calcType(scale, ascending, cells, labels, locale.format(specifier), labelDelimiter),\n legendG = svg.selectAll(\"g\").data([scale]);\n\n if (cellFilter) {\n helper.d3_filterCells(type, cellFilter);\n }\n\n legendG.enter().append(\"g\").attr(\"class\", classPrefix + \"legendCells\");\n\n var cell = svg.select(\".\" + classPrefix + \"legendCells\").selectAll(\".\" + classPrefix + \"cell\").data(type.data);\n var cellEnter = cell.enter().append(\"g\").attr(\"class\", classPrefix + \"cell\");\n cellEnter.append(shape).attr(\"class\", classPrefix + \"swatch\");\n\n var shapes = svg.selectAll(\"g.\" + classPrefix + \"cell \" + shape + \".\" + classPrefix + \"swatch\");\n\n //add event handlers\n helper.d3_addEvents(cellEnter, legendDispatcher);\n\n cell.exit().transition().style(\"opacity\", 0).remove();\n\n shapes.exit().transition().style(\"opacity\", 0).remove();\n shapes = shapes.merge(shapes);\n\n //creates shape\n if (shape === \"line\") {\n helper.d3_drawShapes(shape, shapes, 0, shapeWidth);\n shapes.attr(\"stroke-width\", type.feature);\n } else {\n helper.d3_drawShapes(shape, shapes, type.feature, type.feature, type.feature, path);\n }\n\n var text = helper.d3_addText(svg, cellEnter, type.labels, classPrefix, labelWrap);\n\n // we need to merge the selection, otherwise changes in the legend (e.g. change of orientation) are applied only to the new cells and not the existing ones.\n cell = cellEnter.merge(cell);\n\n //sets placement\n\n var textSize = text.nodes().map(function (d) {\n return d.getBBox();\n }),\n shapeSize = shapes.nodes().map(function (d, i) {\n var bbox = d.getBBox();\n var stroke = scale(type.data[i]);\n\n if (shape === \"line\" && orient === \"horizontal\") {\n bbox.height = bbox.height + stroke;\n } else if (shape === \"line\" && orient === \"vertical\") {\n bbox.width = bbox.width;\n }\n return bbox;\n });\n\n var maxH = max(shapeSize, function (d) {\n return d.height + d.y;\n }),\n maxW = max(shapeSize, function (d) {\n return d.width + d.x;\n });\n\n var cellTrans = void 0,\n textTrans = void 0,\n textAlign = labelAlign == \"start\" ? 0 : labelAlign == \"middle\" ? 0.5 : 1;\n\n //positions cells and text\n if (orient === \"vertical\") {\n (function () {\n var cellSize = textSize.map(function (d, i) {\n return Math.max(d.height, shapeSize[i].height);\n });\n var y = shape == \"circle\" || shape == \"line\" ? shapeSize[0].height / 2 : 0;\n cellTrans = function cellTrans(d, i) {\n var height = sum(cellSize.slice(0, i));\n\n return \"translate(0, \" + (y + height + i * shapePadding) + \")\";\n };\n\n textTrans = function textTrans(d, i) {\n return \"translate( \" + (maxW + labelOffset) + \",\\n \" + (shapeSize[i].y + shapeSize[i].height / 2 + 5) + \")\";\n };\n })();\n } else if (orient === \"horizontal\") {\n (function () {\n cellTrans = function cellTrans(d, i) {\n var width = sum(shapeSize.slice(0, i), function (d) {\n return d.width;\n });\n var y = shape == \"circle\" || shape == \"line\" ? maxH / 2 : 0;\n return \"translate(\" + (width + i * shapePadding) + \", \" + y + \")\";\n };\n\n var offset = shape == \"line\" ? maxH / 2 : maxH;\n textTrans = function textTrans(d, i) {\n return \"translate( \" + (shapeSize[i].width * textAlign + shapeSize[i].x) + \",\\n \" + (offset + labelOffset) + \")\";\n };\n })();\n }\n\n helper.d3_placement(orient, cell, cellTrans, text, textTrans, labelAlign);\n helper.d3_title(svg, title, classPrefix, titleWidth);\n\n cell.transition().style(\"opacity\", 1);\n }\n\n legend.scale = function (_) {\n if (!arguments.length) return scale;\n scale = _;\n return legend;\n };\n\n legend.cells = function (_) {\n if (!arguments.length) return cells;\n if (_.length > 1 || _ >= 2) {\n cells = _;\n }\n return legend;\n };\n\n legend.cellFilter = function (_) {\n if (!arguments.length) return cellFilter;\n cellFilter = _;\n return legend;\n };\n\n legend.shape = function (_, d) {\n if (!arguments.length) return shape;\n if (_ == \"rect\" || _ == \"circle\" || _ == \"line\") {\n shape = _;\n path = d;\n }\n return legend;\n };\n\n legend.shapeWidth = function (_) {\n if (!arguments.length) return shapeWidth;\n shapeWidth = +_;\n return legend;\n };\n\n legend.shapePadding = function (_) {\n if (!arguments.length) return shapePadding;\n shapePadding = +_;\n return legend;\n };\n\n legend.labels = function (_) {\n if (!arguments.length) return labels;\n labels = _;\n return legend;\n };\n\n legend.labelAlign = function (_) {\n if (!arguments.length) return labelAlign;\n if (_ == \"start\" || _ == \"end\" || _ == \"middle\") {\n labelAlign = _;\n }\n return legend;\n };\n\n legend.locale = function (_) {\n if (!arguments.length) return locale;\n locale = formatLocale(_);\n return legend;\n };\n\n legend.labelFormat = function (_) {\n if (!arguments.length) return legend.locale().format(specifier);\n specifier = formatSpecifier(_);\n return legend;\n };\n\n legend.labelOffset = function (_) {\n if (!arguments.length) return labelOffset;\n labelOffset = +_;\n return legend;\n };\n\n legend.labelDelimiter = function (_) {\n if (!arguments.length) return labelDelimiter;\n labelDelimiter = _;\n return legend;\n };\n\n legend.labelWrap = function (_) {\n if (!arguments.length) return labelWrap;\n labelWrap = _;\n return legend;\n };\n\n legend.orient = function (_) {\n if (!arguments.length) return orient;\n _ = _.toLowerCase();\n if (_ == \"horizontal\" || _ == \"vertical\") {\n orient = _;\n }\n return legend;\n };\n\n legend.ascending = function (_) {\n if (!arguments.length) return ascending;\n ascending = !!_;\n return legend;\n };\n\n legend.classPrefix = function (_) {\n if (!arguments.length) return classPrefix;\n classPrefix = _;\n return legend;\n };\n\n legend.title = function (_) {\n if (!arguments.length) return title;\n title = _;\n return legend;\n };\n\n legend.titleWidth = function (_) {\n if (!arguments.length) return titleWidth;\n titleWidth = _;\n return legend;\n };\n\n legend.on = function () {\n var value = legendDispatcher.on.apply(legendDispatcher, arguments);\n return value === legendDispatcher ? legend : value;\n };\n\n return legend;\n}\n\nfunction symbol() {\n var scale = scaleLinear(),\n shape = \"path\",\n shapeWidth = 15,\n shapeHeight = 15,\n shapeRadius = 10,\n shapePadding = 5,\n cells = [5],\n cellFilter = void 0,\n labels = [],\n classPrefix = \"\",\n title = \"\",\n locale = helper.d3_defaultLocale,\n specifier = helper.d3_defaultFormatSpecifier,\n labelAlign = \"middle\",\n labelOffset = 10,\n labelDelimiter = helper.d3_defaultDelimiter,\n labelWrap = void 0,\n orient = \"vertical\",\n ascending = false,\n titleWidth = void 0,\n legendDispatcher = dispatch(\"cellover\", \"cellout\", \"cellclick\");\n\n function legend(svg) {\n var type = helper.d3_calcType(scale, ascending, cells, labels, locale.format(specifier), labelDelimiter),\n legendG = svg.selectAll(\"g\").data([scale]);\n\n if (cellFilter) {\n helper.d3_filterCells(type, cellFilter);\n }\n\n legendG.enter().append(\"g\").attr(\"class\", classPrefix + \"legendCells\");\n\n var cell = svg.select(\".\" + classPrefix + \"legendCells\").selectAll(\".\" + classPrefix + \"cell\").data(type.data);\n var cellEnter = cell.enter().append(\"g\").attr(\"class\", classPrefix + \"cell\");\n cellEnter.append(shape).attr(\"class\", classPrefix + \"swatch\");\n\n var shapes = svg.selectAll(\"g.\" + classPrefix + \"cell \" + shape + \".\" + classPrefix + \"swatch\");\n\n //add event handlers\n helper.d3_addEvents(cellEnter, legendDispatcher);\n\n //remove old shapes\n cell.exit().transition().style(\"opacity\", 0).remove();\n shapes.exit().transition().style(\"opacity\", 0).remove();\n shapes = shapes.merge(shapes);\n\n helper.d3_drawShapes(shape, shapes, shapeHeight, shapeWidth, shapeRadius, type.feature);\n var text = helper.d3_addText(svg, cellEnter, type.labels, classPrefix, labelWrap);\n\n // we need to merge the selection, otherwise changes in the legend (e.g. change of orientation) are applied only to the new cells and not the existing ones.\n cell = cellEnter.merge(cell);\n\n // sets placement\n var textSize = text.nodes().map(function (d) {\n return d.getBBox();\n }),\n shapeSize = shapes.nodes().map(function (d) {\n return d.getBBox();\n });\n\n var maxH = max(shapeSize, function (d) {\n return d.height;\n }),\n maxW = max(shapeSize, function (d) {\n return d.width;\n });\n\n var cellTrans = void 0,\n textTrans = void 0,\n textAlign = labelAlign == \"start\" ? 0 : labelAlign == \"middle\" ? 0.5 : 1;\n\n //positions cells and text\n if (orient === \"vertical\") {\n (function () {\n var cellSize = textSize.map(function (d, i) {\n return Math.max(maxH, d.height);\n });\n\n cellTrans = function cellTrans(d, i) {\n var height = sum(cellSize.slice(0, i));\n return \"translate(0, \" + (height + i * shapePadding) + \" )\";\n };\n textTrans = function textTrans(d, i) {\n return \"translate( \" + (maxW + labelOffset) + \",\\n \" + (shapeSize[i].y + shapeSize[i].height / 2 + 5) + \")\";\n };\n })();\n } else if (orient === \"horizontal\") {\n cellTrans = function cellTrans(d, i) {\n return \"translate( \" + i * (maxW + shapePadding) + \",0)\";\n };\n textTrans = function textTrans(d, i) {\n return \"translate( \" + (shapeSize[i].width * textAlign + shapeSize[i].x) + \",\\n \" + (maxH + labelOffset) + \")\";\n };\n }\n\n helper.d3_placement(orient, cell, cellTrans, text, textTrans, labelAlign);\n helper.d3_title(svg, title, classPrefix, titleWidth);\n cell.transition().style(\"opacity\", 1);\n }\n\n legend.scale = function (_) {\n if (!arguments.length) return scale;\n scale = _;\n return legend;\n };\n\n legend.cells = function (_) {\n if (!arguments.length) return cells;\n if (_.length > 1 || _ >= 2) {\n cells = _;\n }\n return legend;\n };\n\n legend.cellFilter = function (_) {\n if (!arguments.length) return cellFilter;\n cellFilter = _;\n return legend;\n };\n\n legend.shapePadding = function (_) {\n if (!arguments.length) return shapePadding;\n shapePadding = +_;\n return legend;\n };\n\n legend.labels = function (_) {\n if (!arguments.length) return labels;\n labels = _;\n return legend;\n };\n\n legend.labelAlign = function (_) {\n if (!arguments.length) return labelAlign;\n if (_ == \"start\" || _ == \"end\" || _ == \"middle\") {\n labelAlign = _;\n }\n return legend;\n };\n\n legend.locale = function (_) {\n if (!arguments.length) return locale;\n locale = formatLocale(_);\n return legend;\n };\n\n legend.labelFormat = function (_) {\n if (!arguments.length) return legend.locale().format(specifier);\n specifier = formatSpecifier(_);\n return legend;\n };\n\n legend.labelOffset = function (_) {\n if (!arguments.length) return labelOffset;\n labelOffset = +_;\n return legend;\n };\n\n legend.labelDelimiter = function (_) {\n if (!arguments.length) return labelDelimiter;\n labelDelimiter = _;\n return legend;\n };\n\n legend.labelWrap = function (_) {\n if (!arguments.length) return labelWrap;\n labelWrap = _;\n return legend;\n };\n\n legend.orient = function (_) {\n if (!arguments.length) return orient;\n _ = _.toLowerCase();\n if (_ == \"horizontal\" || _ == \"vertical\") {\n orient = _;\n }\n return legend;\n };\n\n legend.ascending = function (_) {\n if (!arguments.length) return ascending;\n ascending = !!_;\n return legend;\n };\n\n legend.classPrefix = function (_) {\n if (!arguments.length) return classPrefix;\n classPrefix = _;\n return legend;\n };\n\n legend.title = function (_) {\n if (!arguments.length) return title;\n title = _;\n return legend;\n };\n\n legend.titleWidth = function (_) {\n if (!arguments.length) return titleWidth;\n titleWidth = _;\n return legend;\n };\n\n legend.on = function () {\n var value = legendDispatcher.on.apply(legendDispatcher, arguments);\n return value === legendDispatcher ? legend : value;\n };\n\n return legend;\n}\n\nvar thresholdLabels = function thresholdLabels(_ref) {\n var i = _ref.i,\n genLength = _ref.genLength,\n generatedLabels = _ref.generatedLabels,\n labelDelimiter = _ref.labelDelimiter;\n\n if (i === 0) {\n var values = generatedLabels[i].split(\" \" + labelDelimiter + \" \");\n return \"Less than \" + values[1];\n } else if (i === genLength - 1) {\n var _values = generatedLabels[i].split(\" \" + labelDelimiter + \" \");\n return _values[0] + \" or more\";\n }\n return generatedLabels[i];\n};\n\nvar legendHelpers = {\n thresholdLabels: thresholdLabels\n};\n\nvar index = {\n legendColor: color,\n legendSize: size,\n legendSymbol: symbol,\n legendHelpers: legendHelpers\n};\n\nexport { color as legendColor, size as legendSize, symbol as legendSymbol, legendHelpers };export default index;\n//# sourceMappingURL=indexRollupNext.js.map\n","import { instanceOfIHighlight } from \"@hpcc-js/api\";\nimport { Database, Palette, SVGWidget, Widget } from \"@hpcc-js/common\";\nimport { format as d3Format } from \"d3-format\";\nimport { scaleOrdinal as d3ScaleOrdinal } from \"d3-scale\";\nimport {\n symbol as d3Symbol,\n symbolCircle as d3SymbolCircle,\n symbolCross as d3SymbolCross,\n symbolDiamond as d3SymbolDiamond,\n symbolSquare as d3SymbolSquare,\n symbolStar as d3SymbolStar,\n symbolTriangle as d3SymbolTriangle,\n symbolWye as d3SymbolWye\n} from \"d3-shape\";\nimport { legendColor as d3LegendColor } from \"d3-svg-legend\";\nimport { ChartPanel } from \"./ChartPanel.ts\";\n\nexport class Legend extends SVGWidget {\n _owner: ChartPanel;\n _targetWidget: Widget;\n _targetWidgetMonitor;\n _legendOrdinal;\n _disabled: string[] = [];\n\n private _symbolTypeMap = {\n \"circle\": d3SymbolCircle,\n \"cross\": d3SymbolCross,\n \"diamond\": d3SymbolDiamond,\n \"square\": d3SymbolSquare,\n \"star\": d3SymbolStar,\n \"triangle\": d3SymbolTriangle,\n \"wye\": d3SymbolWye\n };\n\n constructor(owner: ChartPanel) {\n super();\n this._owner = owner;\n this._drawStartPos = \"origin\";\n\n const context = this;\n this._legendOrdinal = d3LegendColor()\n .shape(\"path\", d3Symbol().type(d3SymbolCircle).size(150)())\n .shapePadding(10)\n .shapeRadius(10)\n .on(\"cellclick\", function (d) {\n context.onClick(d, this);\n })\n .on(\"cellover\", (d) => {\n context.onOver(d, this);\n })\n .on(\"cellout\", (d) => {\n context.onOut(d, this);\n })\n ;\n }\n\n isDisabled(d: string | Database.Field): boolean {\n if (typeof d === \"undefined\") {\n return false;\n } else if (typeof d === \"string\") {\n return d.indexOf(\"__\") === 0 || this._disabled.indexOf(d) >= 0;\n } else if (d instanceof Database.Field) {\n return d.id().indexOf(\"__\") === 0 || this._disabled.indexOf(d.id()) >= 0;\n }\n return this._disabled.indexOf(d) >= 0;\n }\n\n filteredFields(): Database.Field[] {\n switch (this.dataFamily()) {\n case \"2D\":\n return this.fields();\n case \"ND\":\n return this.fields().filter(d => !this.isDisabled(d));\n }\n return this.fields();\n }\n\n filteredColumns(): string[] {\n switch (this.dataFamily()) {\n case \"2D\":\n return this.columns();\n case \"ND\":\n return this.columns().filter(d => !this.isDisabled(d));\n }\n return this.columns();\n }\n\n filteredData(): any[][] {\n switch (this.dataFamily()) {\n case \"2D\":\n return this.data().filter(row => !this.isDisabled(row[0]));\n case \"ND\":\n const disabledCols: { [key: number]: boolean } = {};\n let anyDisabled: boolean = false;\n this.columns().forEach((col, idx) => {\n const disabled = this.isDisabled(col);\n disabledCols[idx] = disabled;\n if (disabled) {\n anyDisabled = true;\n }\n });\n return !anyDisabled ? this.data() : this.data().map(row => {\n return row.filter((cell, idx) => !disabledCols[idx]);\n });\n }\n return this.data();\n }\n\n isRainbow() {\n const widget = this.getWidget();\n return widget && widget._palette && widget._palette.type() === \"rainbow\";\n }\n\n targetWidget(): Widget;\n targetWidget(_: Widget): this;\n targetWidget(_?: Widget): Widget | this {\n if (!arguments.length) return this._targetWidget;\n this._targetWidget = _;\n if (this._targetWidgetMonitor) {\n this._targetWidgetMonitor.remove();\n delete this._targetWidgetMonitor;\n }\n if (this._targetWidget) {\n const context = this;\n this._targetWidgetMonitor = this._targetWidget.monitor(function (key, newProp, oldProp, source) {\n switch (key) {\n case \"chart\":\n case \"columns\":\n case \"data\":\n case \"paletteID\":\n context.lazyRender();\n break;\n }\n });\n }\n return this;\n }\n\n getWidget() {\n if (this._targetWidget) {\n switch (this._targetWidget.classID()) {\n case \"composite_MultiChart\":\n return (this._targetWidget as any).chart();\n }\n }\n return this._targetWidget;\n }\n\n getPalette(): Palette.OrdinalPaletteFunc | Palette.RainbowPaletteFunc {\n const widget = this.getWidget();\n if (widget && widget._palette) {\n switch (widget._palette.type()) {\n case \"ordinal\":\n return Palette.ordinal(widget._palette.id());\n case \"rainbow\":\n return Palette.rainbow(widget._palette.id());\n }\n }\n return Palette.ordinal(\"default\");\n }\n\n getPaletteType() {\n return this.getPalette().type();\n }\n\n fillColorFunc() {\n const widget = this.getWidget();\n if (widget && widget.fillColor) {\n // Legend will render before the widget, so its possible the widgets palette will not have switched yet...\n if (widget._palette && widget.paletteID && widget._palette.name !== widget.paletteID()) {\n widget._palette = widget._palette.switch(widget.paletteID());\n }\n return (row, col, sel) => {\n return widget.fillColor(row, col, sel);\n };\n }\n const palette = Palette.ordinal(widget && widget.paletteID ? widget.paletteID() || \"default\" : \"default\");\n return (row, col, sel) => {\n return palette(col);\n };\n }\n\n fillColor(row, col, sel) {\n return this.fillColorFunc()(row, col, sel);\n }\n\n protected _g;\n enter(domNode, element) {\n super.enter(domNode, element);\n this._g = element.append(\"g\")\n .attr(\"class\", \"legendOrdinal\")\n ;\n }\n\n calcMetaData() {\n let dataArr = [];\n let total = 0;\n let maxLabelWidth = 0;\n const colLength = this.columns().length;\n\n if (this._targetWidget) {\n const columns = this.columns();\n switch (this.getPaletteType()) {\n case \"ordinal\":\n const fillColor = this.fillColorFunc();\n let val = 0;\n switch (this.dataFamily()) {\n case \"2D\":\n dataArr = this.data().map(function (n, i) {\n val = this.data()[i].slice(1, colLength).reduce((acc, n) => acc + n, 0);\n const disabled = this.isDisabled(n[0]);\n if (!disabled) total += val;\n const label = n[0] + (!disabled && this.showSeriesTotal() ? ` (${val})` : \"\");\n const textSize = this.textSize(label);\n if (maxLabelWidth < textSize.width) maxLabelWidth = textSize.width;\n return [fillColor(n, n[0], false), n[0], label];\n }, this);\n break;\n case \"ND\":\n const widgetColumns = this.columns().filter(col => col.indexOf(\"__\") !== 0);\n dataArr = widgetColumns.filter(function (n, i) { return i > 0; }).map(function (n, i) {\n val = this.data().reduce((acc, n) => acc + n[i + 1], 0);\n const disabled = this.isDisabled(columns[i + 1]);\n const label = n + (!disabled && this.showSeriesTotal() ? ` (${val})` : \"\");\n if (!disabled) total += val;\n const textSize = this.textSize(label);\n if (maxLabelWidth < textSize.width) maxLabelWidth = textSize.width;\n return [fillColor(undefined, n, false), n, label];\n }, this);\n break;\n default:\n const widgetColumns2 = this.columns();\n dataArr = widgetColumns2.map(function (n) {\n return [fillColor(undefined, n, false), n];\n }, this);\n break;\n }\n break;\n case \"rainbow\":\n const palette = this.getPalette() as Palette.RainbowPaletteFunc;\n const format = d3Format(this.rainbowFormat());\n const widget = this.getWidget();\n const steps = this.rainbowBins();\n const weightMin: number = widget._dataMinWeight;\n const weightMax: number = widget._dataMaxWeight;\n const stepWeightDiff = (weightMax - weightMin) / (steps - 1);\n dataArr.push([palette(weightMin, weightMin, weightMax), format(weightMin)]);\n for (let x = 1; x < steps - 1; ++x) {\n let mid = stepWeightDiff * x;\n if (Math.floor(mid) > parseInt(dataArr[0][1])) {\n mid = Math.floor(mid);\n }\n dataArr.push([palette(mid, weightMin, weightMax), format(mid)]);\n }\n dataArr.push([palette(weightMax, weightMin, weightMax), format(weightMax)]);\n break;\n }\n }\n return {\n dataArr,\n total,\n maxLabelWidth\n };\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n\n const { dataArr, maxLabelWidth, total } = this.calcMetaData();\n\n const radius = this.shapeRadius();\n const size = this.radiusToSymbolSize(radius);\n\n const strokeWidth = 1;\n\n let shapePadding = this.itemPadding();// + strokeWidth;\n if (this.orientation() === \"horizontal\") {\n shapePadding += maxLabelWidth - (radius * 2);\n }\n\n const ordinal = d3ScaleOrdinal()\n .domain(dataArr.map(row => row[1]))\n .range(dataArr.map(row => row[0]));\n this._legendOrdinal\n .shape(\"path\", d3Symbol().type(this._symbolTypeMap[this.symbolType()]).size(size)())\n .orient(this.orientation())\n .title(this.title())\n .labelWrap(this.labelMaxWidth())\n .labelAlign(this.labelAlign())\n .shapePadding(shapePadding)\n .scale(ordinal)\n .labels(d => dataArr[d.i][2])\n ;\n\n this._g.call(this._legendOrdinal);\n\n this.updateDisabled(element, dataArr);\n\n const legendCellsBbox = this._g.select(\".legendCells\").node().getBBox();\n let offsetX = Math.abs(legendCellsBbox.x);\n let offsetY = Math.abs(legendCellsBbox.y) + strokeWidth;\n\n if (this.orientation() === \"horizontal\") {\n if (this.labelAlign() === \"start\") {\n offsetX += strokeWidth;\n } else if (this.labelAlign() === \"end\") {\n offsetX -= strokeWidth;\n }\n if (this.width() > legendCellsBbox.width) {\n const extraWidth = this.width() - legendCellsBbox.width;\n offsetX += (extraWidth / 2);\n }\n } else if (this.orientation() === \"vertical\") {\n offsetX += strokeWidth;\n if (this._containerSize.height > legendCellsBbox.height) {\n const extraHeight = this.height() - legendCellsBbox.height;\n offsetY += (extraHeight / 2);\n }\n }\n\n this._g.attr(\"transform\", `translate(${offsetX}, ${offsetY})`);\n this.pos({\n x: 0,\n y: 0\n });\n this._legendOrdinal\n .labelOffset(this.itemPadding())\n ;\n const legendTotal = this._g.selectAll(\".legendTotal\").data(dataArr.length && this.showLegendTotal() ? [total] : []);\n const totalText = `Total: ${total}`;\n const totalOffsetX = -offsetX;\n const totalOffsetY = legendCellsBbox.height + this.itemPadding() + strokeWidth;\n this.enableOverflowScroll(false);\n this.enableOverflow(true);\n legendTotal\n .enter()\n .append(\"text\")\n .classed(\"legendTotal\", true)\n .merge(legendTotal)\n .attr(\"transform\", `translate(${totalOffsetX}, ${totalOffsetY})`)\n .text(totalText)\n ;\n legendTotal.exit().remove();\n }\n\n updateDisabled(element, dataArr) {\n element\n .style(\"cursor\", \"pointer\")\n .selectAll(\"path.swatch\").filter((d, i) => i < dataArr.length)\n .style(\"stroke\", (d, i) => dataArr[i][0])\n .style(\"fill\", (d, i) =>\n this._disabled.indexOf(d) < 0 ? dataArr[i][0] : \"white\"\n )\n ;\n }\n\n postUpdate(domNode, element) {\n let w;\n if (this._boundingBox) {\n w = this._boundingBox.width;\n this._boundingBox.width = this._size.width;\n }\n super.postUpdate(domNode, element);\n if (w !== undefined) {\n this._boundingBox.width = w;\n }\n this._parentRelativeDiv.style(\"overflow\", \"hidden\");\n }\n\n exit(domNode, element) {\n super.exit(domNode, element);\n }\n\n radiusToSymbolSize(radius) {\n const circleSize = Math.pow(radius, 2) * Math.PI;\n switch (this.symbolType()) {\n case \"star\":\n return circleSize * 0.45;\n case \"triangle\":\n return circleSize * 0.65;\n case \"cross\":\n case \"diamond\":\n case \"wye\":\n return circleSize * 0.75;\n case \"circle\":\n return circleSize;\n case \"square\":\n return circleSize * 1.3;\n }\n }\n\n onClick(d, domNode) {\n switch (this.getPaletteType()) {\n case \"ordinal\":\n switch (this.dataFamily()) {\n case \"2D\":\n case \"ND\":\n const disabledIdx = this._disabled.indexOf(d);\n if (disabledIdx < 0) {\n this._disabled.push(d);\n } else {\n this._disabled.splice(disabledIdx, 1);\n }\n this._owner.refreshColumns();\n this._owner.refreshData();\n this._owner.render();\n break;\n }\n break;\n }\n }\n\n onOver(d, domNode) {\n if (instanceOfIHighlight(this._owner)) {\n switch (this.getPaletteType()) {\n case \"ordinal\":\n switch (this.dataFamily()) {\n case \"2D\":\n case \"ND\":\n if (this._disabled.indexOf(d) < 0) {\n this._owner.highlightColumn(d);\n }\n break;\n }\n break;\n }\n }\n }\n\n onOut(d, domNode) {\n if (instanceOfIHighlight(this._owner)) {\n switch (this.getPaletteType()) {\n case \"ordinal\":\n switch (this.dataFamily()) {\n case \"2D\":\n case \"ND\":\n this._owner.highlightColumn();\n break;\n }\n break;\n }\n }\n }\n\n onDblClick(rowData, rowIdx) {\n }\n\n onMouseOver(rowData, rowIdx) {\n }\n private _containerSize;\n resize(_size?: { width: number, height: number }) {\n let retVal;\n if (this.fitToContent()) {\n this._containerSize = _size;\n const bbox = this.getBBox();\n if (_size.width > bbox.width) {\n bbox.width = _size.width;\n }\n if (_size.height > bbox.height) {\n bbox.height = _size.height;\n }\n retVal = super.resize.apply(this, [{ ...bbox }]);\n } else {\n retVal = super.resize.apply(this, arguments);\n }\n return retVal;\n }\n\n}\nLegend.prototype._class += \" layout_Legend\";\n\nexport interface Legend {\n title(): string;\n title(_: string): this;\n symbolType(): \"circle\" | \"cross\" | \"diamond\" | \"square\" | \"star\" | \"triangle\" | \"wye\";\n symbolType(_: \"circle\" | \"cross\" | \"diamond\" | \"square\" | \"star\" | \"triangle\" | \"wye\"): this;\n labelMaxWidth(): number;\n labelMaxWidth(_: number): this;\n orientation(): \"vertical\" | \"horizontal\";\n orientation(_: \"vertical\" | \"horizontal\"): this;\n orientation_exists: () => boolean;\n dataFamily(): \"1D\" | \"2D\" | \"ND\" | \"map\" | \"graph\" | \"any\";\n dataFamily(_: \"1D\" | \"2D\" | \"ND\" | \"map\" | \"graph\" | \"any\"): this;\n dataFamily_exists: () => boolean;\n rainbowFormat(): string;\n rainbowFormat(_: string): this;\n rainbowFormat_exists: () => boolean;\n rainbowBins(): number;\n rainbowBins(_: number): this;\n rainbowBins_exists: () => boolean;\n showSeriesTotal(): boolean;\n showSeriesTotal(_: boolean): this;\n showLegendTotal(): boolean;\n showLegendTotal(_: boolean): this;\n itemPadding(): number;\n itemPadding(_: number): this;\n shapeRadius(): number;\n shapeRadius(_: number): this;\n fitToContent(): boolean;\n fitToContent(_: boolean): this;\n labelAlign(): \"start\" | \"middle\" | \"end\";\n labelAlign(_: \"start\" | \"middle\" | \"end\"): this;\n}\nLegend.prototype.publish(\"title\", \"\", \"string\", \"Title\");\nLegend.prototype.publish(\"symbolType\", \"circle\", \"set\", \"Shape of each legend item\", [\"circle\", \"cross\", \"diamond\", \"square\", \"star\", \"triangle\", \"wye\"]);\nLegend.prototype.publish(\"labelMaxWidth\", null, \"number\", \"Max Label Width (pixels)\", null, { optional: true });\nLegend.prototype.publish(\"orientation\", \"vertical\", \"set\", \"Orientation of Legend rows\", [\"vertical\", \"horizontal\"], { tags: [\"Private\"] });\nLegend.prototype.publish(\"dataFamily\", \"ND\", \"set\", \"Type of data\", [\"1D\", \"2D\", \"ND\", \"map\", \"graph\", \"any\"], { tags: [\"Private\"] });\nLegend.prototype.publish(\"rainbowFormat\", \",\", \"string\", \"Rainbow number formatting\", null, { tags: [\"Private\"], optional: true, disable: w => !w.isRainbow() });\nLegend.prototype.publish(\"rainbowBins\", 8, \"number\", \"Number of rainbow bins\", null, { tags: [\"Private\"], disable: w => !w.isRainbow() });\nLegend.prototype.publish(\"showSeriesTotal\", false, \"boolean\", \"Show value next to series\");\nLegend.prototype.publish(\"showLegendTotal\", false, \"boolean\", \"Show a total of the series values under the legend\", null);\nLegend.prototype.publish(\"itemPadding\", 8, \"number\", \"Padding between legend items (pixels)\");\nLegend.prototype.publish(\"shapeRadius\", 7, \"number\", \"Radius of legend shape (pixels)\");\nLegend.prototype.publish(\"fitToContent\", true, \"boolean\", \"If true, resize will simply reapply the bounding box dimensions\");\nLegend.prototype.publish(\"labelAlign\", \"start\", \"set\", \"Horizontal alignment of legend item label (for horizontal orientation only)\", [\"start\", \"middle\", \"end\"], { optional: true, disable: (w: any) => w.orientation() === \"vertical\" });\n","import { HTMLWidget, ISize, Widget } from \"@hpcc-js/common\";\n\nimport \"../src/Modal.css\";\n\nexport class Modal extends HTMLWidget {\n\n protected _widget: Widget;\n\n protected _relativeTarget: HTMLElement;\n\n protected _fade;\n protected _modal;\n protected _modalHeader;\n protected _modalBody;\n protected _modalHeaderAnnotations;\n protected _modalHeaderCloseButton;\n _close: () => void;\n\n constructor() {\n super();\n this._tag = \"div\";\n }\n\n closeModal() {\n this.visible(false);\n }\n\n getRelativeTarget() {\n let relativeTarget;\n if (this.relativeTargetId()) {\n relativeTarget = document.getElementById(this.relativeTargetId());\n if (relativeTarget) {\n return relativeTarget;\n }\n }\n if (!relativeTarget) {\n relativeTarget = this.locateAncestor(\"layout_Grid\");\n if (relativeTarget && relativeTarget.element) {\n return relativeTarget.element().node();\n }\n }\n return document.body;\n }\n\n setModalSize(): ISize {\n if (this.fixedHeight() !== null && this.fixedWidth() !== null) {\n this._modal\n .style(\"height\", this.fixedHeight())\n .style(\"width\", this.fixedWidth())\n .style(\"min-height\", null)\n .style(\"min-width\", null)\n .style(\"max-height\", null)\n .style(\"max-width\", null)\n ;\n } else if (this.minHeight() || this.minWidth()) {\n this._modal\n .style(\"min-height\", this.minHeight())\n .style(\"min-width\", this.minWidth())\n .style(\"max-height\", this.maxHeight())\n .style(\"max-width\", this.maxWidth())\n ;\n }\n const modalRect = this._modal.node().getBoundingClientRect();\n const headerRect = this._modalHeader.node().getBoundingClientRect();\n this._modalBody\n .style(\"height\", (modalRect.height - headerRect.height) + \"px\")\n .style(\"width\", modalRect.width);\n\n return modalRect;\n }\n\n setFadePosition(rect) {\n this._fade\n .style(\"top\", rect.top + \"px\")\n .style(\"left\", rect.left + \"px\")\n .style(\"width\", rect.width + \"px\")\n .style(\"height\", rect.height + \"px\")\n ;\n }\n\n setModalPosition(rect) {\n const modalRect = this.setModalSize();\n if (this.fixedTop() !== null && this.fixedLeft() !== null) {\n this._modal\n .style(\"top\", `calc(${this.fixedTop()} + ${rect.top}px)`)\n .style(\"left\", `calc(${this.fixedLeft()} + ${rect.left}px)`)\n ;\n } else if (this.fixedHeight() !== null && this.fixedWidth() !== null) {\n this._modal\n .style(\"top\", (rect.top + (rect.height / 2) - (modalRect.height / 2)) + \"px\")\n .style(\"left\", (rect.left + (rect.width / 2) - (modalRect.width / 2)) + \"px\")\n ;\n } else if (this.minHeight() || this.minWidth()) {\n const contentRect = this._modal.node().getBoundingClientRect();\n this._modal\n .style(\"top\", (rect.top + (rect.height / 2) - (contentRect.height / 2)) + \"px\")\n .style(\"left\", (rect.left + (rect.width / 2) - (contentRect.width / 2)) + \"px\")\n ;\n }\n }\n\n resize(size?: any): this {\n super.resize();\n if (this._modal) this.setModalSize();\n return this;\n }\n\n resizeBodySync(width: number, height: number): this {\n const header = this._modalHeader.node();\n const headerRect = header.getBoundingClientRect();\n\n this._modal\n .style(\"width\", width + \"px\")\n .style(\"height\", (height + headerRect.height) + \"px\")\n .style(\"min-width\", width + \"px\")\n .style(\"min-height\", (height + headerRect.height) + \"px\")\n ;\n this._modalHeader\n .style(\"width\", width + \"px\")\n ;\n this._modalBody\n .style(\"width\", width + \"px\")\n .style(\"height\", height + \"px\")\n ;\n return this\n .minWidth(width + \"px\")\n .minHeight((height + headerRect.height) + \"px\")\n .resize({\n height: height + headerRect.height,\n width\n })\n ;\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this._fade = element.append(\"div\")\n .classed(\"layout_Modal-fade\", true)\n .classed(\"layout_Modal-fadeClickable\", this.enableClickFadeToClose())\n .classed(\"layout_Modal-fade-hidden\", !this.showFade())\n ;\n const header_h = this.titleFontSize() * 2;\n this._modal = element.append(\"div\")\n .classed(\"layout_Modal-content\", true)\n ;\n this._modalHeader = this._modal.append(\"div\")\n .classed(\"layout_Modal-header\", true)\n .style(\"color\", this.titleFontColor())\n .style(\"font-size\", this.titleFontSize() + \"px\")\n .style(\"height\", header_h + \"px\")\n ;\n this._modalBody = this._modal.append(\"div\")\n .classed(\"layout_Modal-body\", true)\n .style(\"height\", `calc( 100% - ${header_h}px )`)\n .style(\"overflow-x\", this.overflowX())\n .style(\"overflow-y\", this.overflowY())\n ;\n this._modalHeader.append(\"div\")\n .classed(\"layout_Modal-title\", true)\n .style(\"line-height\", this.titleFontSize() + \"px\")\n .style(\"top\", (this.titleFontSize() / 2) + \"px\")\n .style(\"left\", (this.titleFontSize() / 2) + \"px\")\n .text(this.formattedTitle())\n ;\n\n this._modalHeaderAnnotations = this._modalHeader.append(\"div\")\n .classed(\"layout_Modal-annotations\", true)\n ;\n this._modalHeaderCloseButton = this._modalHeaderAnnotations.append(\"div\")\n .classed(\"layout_Modal-closeButton\", true)\n .html(\"<i class=\\\"fa fa-close\\\"></i>\")\n ;\n\n this._modalHeaderAnnotations\n .style(\"line-height\", this.titleFontSize() + \"px\")\n .style(\"right\", (this.titleFontSize() / 2) + \"px\")\n .style(\"top\", (this.titleFontSize() / 2) + \"px\")\n ;\n this._modalHeaderCloseButton.on(\"click\", () => {\n this.closeModal();\n });\n this._fade.on(\"click\", n => {\n if (this.enableClickFadeToClose()) {\n this.closeModal();\n }\n });\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n element.style(\"display\", this.show() ? null : \"none\");\n this._fade.classed(\"layout_Modal-fade-hidden\", !this.showFade());\n this._relativeTarget = this.getRelativeTarget();\n\n this.setModalSize();\n const rect = this._relativeTarget.getBoundingClientRect();\n this.setFadePosition(rect);\n this.setModalPosition(rect);\n\n if (this.show()) {\n if (!this._widget.target()) {\n this._widget.target(this._modalBody.node());\n }\n this._widget.resize().render();\n } else {\n this._widget\n .target(null)\n .render()\n ;\n }\n }\n\n exit(domNode, element) {\n if (this._widget) {\n this._widget.target(null);\n }\n super.exit(domNode, element);\n }\n\n formattedTitle() {\n const title = this.title_exists() ? this.title().trim() : \"\";\n if (title.length > 0 && title.slice(0, 1) === \"(\" && title.slice(-1) === \")\") {\n return title.slice(1, -1);\n }\n return this.title();\n }\n}\nModal.prototype._class += \" layout_Modal\";\n\nexport interface Modal {\n show(): boolean;\n show(_: boolean): this;\n showFade(): boolean;\n showFade(_: boolean): this;\n enableClickFadeToClose(): boolean;\n enableClickFadeToClose(_: boolean): this;\n title(): string;\n title(_: string): this;\n title_exists(): boolean;\n titleFontSize(): number;\n titleFontSize(_: number): this;\n titleFontColor(): string;\n titleFontColor(_: string): this;\n minWidth(): string;\n minWidth(_: string): this;\n minHeight(): string;\n minHeight(_: string): this;\n maxWidth(): string;\n maxWidth(_: string): this;\n maxHeight(): string;\n maxHeight(_: string): this;\n fixedWidth(): string;\n fixedWidth(_: string): this;\n fixedHeight(): string;\n fixedHeight(_: string): this;\n fixedTop(): string;\n fixedTop(_: string): this;\n fixedLeft(): string;\n fixedLeft(_: string): this;\n relativeTargetId(): string;\n relativeTargetId(_: string): this;\n widget(): Widget;\n widget(_: Widget): this;\n overflowX(): \"hidden\" | \"scroll\";\n overflowX(_: \"hidden\" | \"scroll\"): this;\n overflowY(): \"hidden\" | \"scroll\";\n overflowY(_: \"hidden\" | \"scroll\"): this;\n}\n\nModal.prototype.publish(\"title\", null, \"string\", \"title\");\nModal.prototype.publish(\"widget\", null, \"widget\", \"widget\");\nModal.prototype.publish(\"titleFontSize\", 18, \"number\", \"titleFontSize (in pixels)\");\nModal.prototype.publish(\"titleFontColor\", \"#ffffff\", \"html-color\", \"titleFontColor\");\nModal.prototype.publish(\"relativeTargetId\", null, \"string\", \"relativeTargetId\");\n\nModal.prototype.publish(\"show\", true, \"boolean\", \"show\");\nModal.prototype.publish(\"showFade\", true, \"boolean\", \"showFade\");\nModal.prototype.publish(\"enableClickFadeToClose\", true, \"boolean\", \"enableClickFadeToClose\");\n\nModal.prototype.publish(\"minWidth\", \"400px\", \"string\", \"minWidth\");\nModal.prototype.publish(\"minHeight\", \"400px\", \"string\", \"minHeight\");\nModal.prototype.publish(\"maxWidth\", \"800px\", \"string\", \"maxWidth\");\nModal.prototype.publish(\"maxHeight\", \"800px\", \"string\", \"maxHeight\");\nModal.prototype.publish(\"fixedWidth\", null, \"string\", \"fixedWidth\");\nModal.prototype.publish(\"fixedHeight\", null, \"string\", \"fixedHeight\");\nModal.prototype.publish(\"fixedTop\", null, \"string\", \"fixedTop\");\nModal.prototype.publish(\"fixedLeft\", null, \"string\", \"fixedLeft\");\nModal.prototype.publish(\"overflowX\", \"hidden\", \"string\", \"overflowX\");\nModal.prototype.publish(\"overflowY\", \"scroll\", \"string\", \"overflowY\");\n","import { IHighlight } from \"@hpcc-js/api\";\nimport { Button, Database, IconBar, ProgressBar, Spacer, SVGWidget, Text, TitleBar, ToggleButton, Utility, Widget } from \"@hpcc-js/common\";\nimport type { XYAxis } from \"@hpcc-js/chart\";\nimport { Table } from \"@hpcc-js/dgrid\";\nimport { select as d3Select } from \"d3-selection\";\nimport { Border2 } from \"./Border2.ts\";\nimport { Carousel } from \"./Carousel.ts\";\nimport { Legend } from \"./Legend.ts\";\nimport { Modal } from \"./Modal.ts\";\n\nimport \"../src/ChartPanel.css\";\n\nexport class ChartPanel<T extends Widget = Widget> extends Border2 implements IHighlight {\n\n protected _legend = new Legend(this).enableOverflow(true);\n protected _progressBar = new ProgressBar();\n protected _autoScale = false;\n protected _resolutions = {\n tiny: { width: 100, height: 100 },\n small: { width: 300, height: 300 }\n };\n private _modal = new Modal();\n private _highlight: boolean;\n private _scale: number;\n private _orig_size: any;\n\n private _toggleInfo = new ToggleButton().faChar(\"fa-info-circle\").tooltip(\".Description\")\n .selected(false)\n .on(\"enabled\", () => {\n return this.description() !== \"\";\n })\n .on(\"click\", () => {\n if (this._toggleInfo.selected()) {\n this._modal\n .title(this.title())\n .widget(new Text().text(this.description()))\n .show(true)\n .render()\n ;\n\n const origCloseFunc = this._modal._close;\n this._modal._close = () => {\n this._toggleInfo\n .selected(false)\n .render()\n ;\n this._modal._close = origCloseFunc;\n };\n }\n })\n .on(\"mouseMove\", () => {\n /*\n this._modal.showPreview(true).render(n => {\n n.resize().render();\n });\n */\n })\n .on(\"mouseOut\", () => {\n /*\n if (this._modal.showPreview()) {\n this._modal.show(false).showPreview(false).render();\n }\n */\n });\n\n private _toggleData = new ToggleButton().faChar(\"fa-table\").tooltip(\"Data\")\n .on(\"click\", () => {\n this.dataVisible(this._toggleData.selected());\n this.render();\n });\n\n private _buttonDownload = new Button().faChar(\"fa-download\").tooltip(\"Download\")\n .on(\"click\", () => {\n this.downloadCSV();\n });\n\n private _buttonDownloadImage = new Button().faChar(\"fa-image\").tooltip(\"Download Image\")\n .on(\"click\", () => {\n this.downloadPNG();\n });\n\n private _toggleLegend = new ToggleButton().faChar(\"fa-list-ul\").tooltip(\"Legend\")\n .selected(false)\n .on(\"click\", () => {\n const selected = this._toggleLegend.selected();\n if (this.legendPosition() === \"bottom\") {\n this.showBottom(selected);\n } else if (this.legendPosition() === \"right\") {\n this.showRight(selected);\n }\n this.legendVisible(selected);\n this.render();\n });\n\n protected _spacer = new Spacer();\n\n _titleBar = new TitleBar().buttons([this._toggleData, this._buttonDownload, this._buttonDownloadImage, this._spacer, this._toggleLegend]);\n\n protected _carousel = new Carousel();\n protected _table = new Table();\n protected _widget: T;\n\n protected _hideLegendToggleList = [\"dgrid_Table\"];\n\n constructor() {\n super();\n this._tag = \"div\";\n }\n\n fields(): Database.Field[];\n fields(_: Database.Field[]): this;\n fields(_?: Database.Field[]): this | Database.Field[] {\n if (!arguments.length) return super.fields();\n super.fields(_);\n this._legend.fields(_);\n this.refreshFields();\n return this;\n }\n refreshFields() {\n this._widget.fields(this._legend.filteredFields());\n this._table.fields(this._legend.filteredFields());\n return this;\n }\n\n columns(): string[];\n columns(_: string[], asDefault?: boolean): this;\n columns(_?: string[], asDefault?: boolean): string[] | this {\n if (!arguments.length) return super.columns();\n super.columns(_, asDefault);\n this._legend.columns(_, asDefault);\n this.refreshColumns();\n return this;\n }\n refreshColumns() {\n this._widget.columns(this._legend.filteredColumns());\n this._table.columns(this._legend.filteredColumns());\n return this;\n }\n\n data(_?) {\n if (!arguments.length) return super.data();\n super.data(_);\n this._legend.data(_);\n this.refreshData();\n return this;\n }\n refreshData() {\n this._widget.data(this._legend.filteredData());\n this._table.data(this._legend.filteredData());\n return this;\n }\n\n highlight(): boolean;\n highlight(_: boolean): this;\n highlight(_?: boolean): boolean | this {\n if (!arguments.length) return this._highlight;\n this._highlight = _;\n return this;\n }\n\n startProgress() {\n this._progressBar.start();\n }\n\n finishProgress() {\n this._progressBar.finish();\n }\n\n buttons(): Widget[];\n buttons(_: Widget[]): this;\n buttons(_?: Widget[]): this | Widget[] {\n if (!arguments.length) return this._titleBar.buttons();\n this._titleBar.buttons(_);\n return this;\n }\n\n downloadCSV() {\n const namePrefix = this.downloadTitle() ? this.downloadTitle() : this.title() ? this.title() : \"data\";\n const nameSuffix = this.downloadTimestampSuffix() ? \"_\" + Utility.timestamp() : \"\";\n Utility.downloadString(\"CSV\", this._widget.export(\"CSV\"), namePrefix + nameSuffix);\n return this;\n }\n\n downloadPNG() {\n const widget = this.widget();\n if (widget instanceof SVGWidget) {\n if (!this.legendVisible()) {\n widget.downloadPNG(this.title());\n } else {\n widget.downloadPNG(this.title(), undefined, this._legend);\n }\n }\n return this;\n }\n\n highlightColumn(column?: string): this {\n if (column) {\n const cssTag = `series-${this.cssTag(column)}`;\n this._centerWA.element().selectAll(\".series\")\n .each(function () {\n const element = d3Select(this);\n const highlight = element.classed(cssTag);\n element\n .classed(\"highlight\", highlight)\n .classed(\"lowlight\", !highlight)\n ;\n })\n ;\n } else {\n this._centerWA.element().selectAll(\".series\")\n .classed(\"highlight\", false)\n .classed(\"lowlight\", false)\n ;\n }\n return this;\n }\n\n getResponsiveMode(): \"tiny\" | \"small\" | \"regular\" | \"none\" {\n if (!this.enableAutoscaling()) return \"none\";\n if (!this._autoScale) return \"regular\";\n if (this.size().width <= this._resolutions.tiny.width || this.size().height <= this._resolutions.tiny.height) {\n return \"tiny\";\n } else if (this.size().width <= this._resolutions.small.width || this.size().height <= this._resolutions.small.height) {\n return \"small\";\n }\n return \"regular\";\n }\n\n setOrigSize() {\n this._orig_size = JSON.parse(JSON.stringify(this.size()));\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this._modal\n .target(this.target())\n .relativeTargetId(this.id())\n ;\n\n this.top(this._titleBar);\n this.center(this._carousel);\n\n this._legend\n .targetWidget(this._widget)\n .orientation(\"vertical\")\n .title(\"\")\n .visible(false)\n ;\n\n this._progressBar.enter(domNode, element);\n this.setOrigSize();\n }\n\n preUpdateTiny(element) {\n element.selectAll(\"div.body,div.title-text,div.icon-bar\").style(\"display\", \"none\");\n }\n\n preUpdateSmall(element) {\n const scale_x = this._orig_size.width / this._resolutions.small.width;\n const scale_y = this._orig_size.height / this._resolutions.small.height;\n this._scale = Math.min(scale_x, scale_y);\n const x_is_smaller = this._scale === scale_x;\n this.size({\n width: x_is_smaller ? this._resolutions.small.width : this._orig_size.width * (1 / this._scale),\n height: !x_is_smaller ? this._resolutions.small.height : this._orig_size.height * (1 / this._scale)\n });\n element.select(\"div.title-icon\").style(\"position\", \"static\");\n element.selectAll(\"lhs\").style(\"display\", \"none\");\n element.selectAll(\"div.body,div.title-text,div.icon-bar\").style(\"display\", \"\");\n element.selectAll(\"div.data-count\").style(\"visibility\", \"hidden\");\n element.style(\"transform\", `scale(${this._scale})`);\n }\n\n preUpdateRegular(element) {\n element.selectAll(\"div.body,div.title-text,div.icon-bar\").style(\"display\", \"\");\n element.selectAll(\"div.data-count\").style(\"visibility\", \"hidden\");\n element.select(\"div.title-icon\").style(\"position\", \"static\");\n element.style(\"transform\", \"translate(0px,0px) scale(1)\");\n }\n\n private _prevdataVisible;\n private _prevlegendVisible;\n private _prevLegendPosition;\n private _prevChartDataFamily;\n private _prevChart;\n private _prevButtons;\n update(domNode, element) {\n super.update(domNode, element);\n }\n\n preUpdate(domNode, element) {\n\n super.preUpdate(domNode, element);\n\n if (this._prevLegendPosition !== this.legendPosition()) {\n if (this._legend.target() !== null) this._legend.target(null);\n if (this._prevLegendPosition !== undefined) {\n this.swap(this._prevLegendPosition, this.legendPosition());\n } else {\n this[this.legendPosition()](this._legend);\n }\n if (this.legendPosition() === \"right\") {\n this.rightOverflowX(\"hidden\");\n this.rightOverflowY(\"auto\");\n this.bottomOverflowX(\"visible\");\n this.bottomOverflowY(\"visible\");\n } else {\n this.rightOverflowX(\"visible\");\n this.rightOverflowY(\"visible\");\n this.bottomOverflowX(\"auto\");\n this.bottomOverflowY(\"hidden\");\n }\n this._prevLegendPosition = this.legendPosition();\n }\n\n if (this._prevdataVisible !== this.dataVisible()) {\n this._prevdataVisible = this.dataVisible();\n this._toggleData.selected(this._prevdataVisible);\n this._legend.visible(this._prevlegendVisible && !this._prevdataVisible);\n this._carousel.active(this._prevdataVisible ? 1 : 0);\n }\n\n if (this._prevlegendVisible !== this.legendVisible()) {\n this._prevlegendVisible = this.legendVisible();\n this._toggleLegend.selected(this._prevlegendVisible);\n this._legend.visible(this._prevlegendVisible && !this._prevdataVisible);\n }\n\n this._legend.orientation(this.legendPosition() === \"bottom\" ? \"horizontal\" : \"vertical\");\n\n this.showLeft(!this.left());\n\n switch (this.getResponsiveMode()) {\n case \"tiny\":\n this.preUpdateTiny(element);\n break;\n case \"small\":\n this.preUpdateSmall(element);\n break;\n case \"regular\":\n this.preUpdateRegular(element);\n break;\n }\n\n const chart = this._widget.classID() === \"composite_MultiChart\" ? this._widget[\"chart\"]() : this._widget;\n this._legend.dataFamily(chart._dataFamily || \"any\");\n\n if (this._prevChartDataFamily !== this._legend.dataFamily()) {\n this._prevChartDataFamily = this._legend.dataFamily();\n switch (this._prevChartDataFamily) {\n case \"any\":\n this._toggleLegend.selected(false);\n this._legend.visible(false);\n break;\n }\n }\n element.style(\"box-shadow\", this.highlight() ? `inset 0px 0px 0px ${this.highlightSize()}px ${this.highlightColor()}` : \"none\");\n\n if (this._hideLegendToggleList.indexOf(chart.classID()) !== -1) {\n this._spacer.visible(false);\n this._toggleLegend.visible(false);\n } else {\n this._spacer.visible(true);\n this._toggleLegend.visible(true);\n }\n if (this._prevChart !== chart) {\n this._prevChart = chart;\n const widgetIconBar = chart ? chart[\"_titleBar\"] || chart[\"_iconBar\"] : undefined;\n if (widgetIconBar && widgetIconBar instanceof IconBar) {\n this._prevButtons = this._prevButtons || [...this.buttons()];\n const buttons: Widget[] = [\n ...widgetIconBar.buttons(),\n new Spacer(),\n ...this._prevButtons\n ];\n widgetIconBar.buttons([]).render();\n this.buttons(buttons);\n } else if (this._prevButtons) {\n this.buttons(this._prevButtons);\n }\n }\n\n const hiddenButtons = [];\n if (!this.dataButtonVisible()) hiddenButtons.push(this._toggleData);\n if (!this.downloadButtonVisible()) hiddenButtons.push(this._buttonDownload);\n if (!this.downloadImageButtonVisible()) hiddenButtons.push(this._buttonDownloadImage);\n if (!this.legendButtonVisible()) hiddenButtons.push(this._toggleLegend);\n this._buttonDownloadImage.enabled(this.widget() instanceof SVGWidget);\n this._titleBar\n .hiddenButtons(hiddenButtons)\n .visible(this.titleVisible())\n ;\n this.topOverlay(this.titleOverlay() || !this.titleVisible());\n }\n\n postUpdate(domNode, element) {\n super.postUpdate(domNode, element);\n\n switch (this.getResponsiveMode()) {\n case \"tiny\":\n this.postUpdateTiny(element);\n break;\n case \"small\":\n this.postUpdateSmall(element);\n break;\n case \"regular\":\n this.postUpdateRegular(element);\n break;\n }\n }\n\n postUpdateTiny(element) {\n element.selectAll(\"div.body,div.title-text,div.icon-bar\").style(\"display\", \"none\");\n element.selectAll(\"div.data-count\")\n .style(\"visibility\", \"visible\")\n .style(\"font-size\", (this.titleIconFontSize() / 3) + \"px\")\n .style(\"line-height\", (this.titleIconFontSize() / 3) + \"px\")\n .style(\"left\", this.titleIconFontSize() + \"px\")\n .text(this.data().length)\n ;\n element.style(\"transform\", \"translate(0px,0px) scale(1)\");\n const iconDiv = element.selectAll(\"div.title-icon\");\n const _node = iconDiv.node();\n const _container = element.node().parentElement;\n const containerRect = _container.getBoundingClientRect();\n if (_node) {\n const rect = iconDiv.node().getBoundingClientRect();\n const icon_top = containerRect.height / 2;\n iconDiv\n .style(\"position\", \"absolute\")\n .style(\"left\", `calc(50% - ${rect.width / 2}px)`)\n .style(\"top\", `${icon_top - (rect.height / 2)}px`)\n ;\n element.selectAll(\"div.data-count\")\n .style(\"position\", \"absolute\")\n .style(\"left\", `calc(50% + ${rect.width / 2}px)`)\n .style(\"top\", `${icon_top - (rect.height / 2)}px`)\n ;\n }\n }\n\n postUpdateSmall(element) {\n element.selectAll(\"lhs\").style(\"display\", \"none\"); // TODO: a bug in Border2?\n element.selectAll(\"div.title-icon\").style(\"position\", \"static\");\n element.selectAll(\"div.body,div.title-text,div.icon-bar\").style(\"display\", \"\");\n element.selectAll(\"div.data-count\").style(\"visibility\", \"hidden\");\n const rect = element.node().getBoundingClientRect();\n const parentRect = element.node().parentElement.getBoundingClientRect();\n element.style(\"transform\", `translate(${parentRect.x - rect.x}px, ${parentRect.y - rect.y}px) scale(${this._scale})`);\n }\n\n postUpdateRegular(element) {\n element.selectAll(\"div.title-icon\").style(\"position\", \"static\");\n element.selectAll(\"div.body,div.title-text,div.icon-bar\").style(\"display\", \"\");\n element.selectAll(\"div.data-count\").style(\"visibility\", \"hidden\");\n }\n\n exit(domNode, element) {\n this._progressBar.exit(domNode, element);\n\n this.right(null);\n this._legend.target(null);\n this.center(null);\n this._carousel.target(null);\n this.top(null);\n this._titleBar.target(null);\n\n this._modal.target(null);\n\n delete this._prevChart;\n delete this._prevButtons;\n delete this._prevChartDataFamily;\n delete this._prevPos;\n delete this._prevdataVisible;\n delete this._prevlegendVisible;\n\n super.exit(domNode, element);\n }\n\n // Event Handlers ---\n // Events ---\n click(row, column, selected) {\n // console.log(\"Click: \" + JSON.stringify(row) + \", \" + column + \", \" + selected);\n }\n\n dblclick(row, column, selected) {\n // console.log(\"Double click: \" + JSON.stringify(row) + \", \" + column + \", \" + selected);\n }\n\n vertex_click(row, col, sel, more) {\n if (more && more.vertex) {\n // console.log(\"Vertex click: \" + more.vertex.id());\n }\n }\n\n vertex_dblclick(row, col, sel, more) {\n if (more && more.vertex) {\n // console.log(\"Vertex double click: \" + more.vertex.id());\n }\n }\n\n edge_click(row, col, sel, more) {\n if (more && more.edge) {\n // console.log(\"Edge click: \" + more.edge.id());\n }\n }\n\n edge_dblclick(row, col, sel, more) {\n if (more && more.edge) {\n // console.log(\"Edge double click: \" + more.edge.id());\n }\n }\n}\nChartPanel.prototype._class += \" layout_ChartPanel\";\n\nexport interface ChartPanel<T extends Widget = Widget> {\n title(): string;\n title(_: string): this;\n titleVisible(): boolean;\n titleVisible(_: boolean): this;\n titleOverlay(): boolean;\n titleOverlay(_: boolean): this;\n title_exists(): boolean;\n titleFontSize(): number;\n titleFontSize(_: number): this;\n titleFontSize_exists(): boolean;\n titleIconFontSize(): number;\n titleIconFontSize(_: number): this;\n titleIconFontSize_exists(): boolean;\n dataVisible(): boolean;\n dataVisible(_: boolean): this;\n dataButtonVisible(): boolean;\n dataButtonVisible(_: boolean): this;\n downloadButtonVisible(): boolean;\n downloadButtonVisible(_: boolean): this;\n downloadImageButtonVisible(): boolean;\n downloadImageButtonVisible(_: boolean): this;\n downloadTitle(): string;\n downloadTitle(_: string): this;\n downloadTimestampSuffix(): boolean;\n downloadTimestampSuffix(_: boolean): this;\n legendVisible(): boolean;\n legendVisible(_: boolean): this;\n legendButtonVisible(): boolean;\n legendButtonVisible(_: boolean): this;\n legendPosition(): \"right\" | \"bottom\";\n legendPosition(_: \"right\" | \"bottom\"): this;\n description(): string;\n description(_: string): this;\n description_exists(): boolean;\n widget(): T;\n widget(_: T): this;\n widget_exists(): boolean;\n enableAutoscaling(): boolean;\n enableAutoscaling(_: boolean): this;\n enableAutoscaling_exists(): boolean;\n highlightSize(): number;\n highlightSize(_: number): this;\n highlightSize_exists(): boolean;\n highlightColor(): string;\n highlightColor(_: string): this;\n highlightColor_exists(): boolean;\n}\n\nChartPanel.prototype.publishReset();\nChartPanel.prototype.publishProxy(\"title\", \"_titleBar\");\nChartPanel.prototype.publish(\"titleVisible\", true, \"boolean\");\nChartPanel.prototype.publish(\"titleOverlay\", false, \"boolean\");\nChartPanel.prototype.publishProxy(\"titleIcon\", \"_titleBar\");\nChartPanel.prototype.publishProxy(\"titleIconFont\", \"_titleBar\");\nChartPanel.prototype.publishProxy(\"titleFont\", \"_titleBar\");\nChartPanel.prototype.publishProxy(\"titleIconFontSize\", \"_titleBar\");\nChartPanel.prototype.publishProxy(\"titleFontSize\", \"_titleBar\");\nChartPanel.prototype.publishProxy(\"description\", \"_titleBar\");\nChartPanel.prototype.publishProxy(\"descriptionFont\", \"_titleBar\");\nChartPanel.prototype.publishProxy(\"descriptionFontSize\", \"_titleBar\");\nChartPanel.prototype.publish(\"dataVisible\", false, \"boolean\", \"Show data table\");\nChartPanel.prototype.publish(\"dataButtonVisible\", true, \"boolean\", \"Show data table button\");\nChartPanel.prototype.publish(\"downloadButtonVisible\", true, \"boolean\", \"Show data download button\");\nChartPanel.prototype.publish(\"downloadImageButtonVisible\", false, \"boolean\", \"Show image download button\");\nChartPanel.prototype.publish(\"downloadTitle\", \"\", \"string\", \"File name when downloaded\");\nChartPanel.prototype.publish(\"downloadTimestampSuffix\", true, \"boolean\", \"Use timestamp as file name suffix\");\nChartPanel.prototype.publish(\"legendVisible\", false, \"boolean\", \"Show legend\");\nChartPanel.prototype.publish(\"legendButtonVisible\", true, \"boolean\", \"Show legend button\");\nChartPanel.prototype.publish(\"legendPosition\", \"right\", \"set\", \"Position of legend\", [\"right\", \"bottom\"]);\nChartPanel.prototype.publishProxy(\"legend_labelMaxWidth\", \"_legend\", \"labelMaxWidth\");\nChartPanel.prototype.publishProxy(\"legend_showSeriesTotal\", \"_legend\", \"showSeriesTotal\");\nChartPanel.prototype.publishProxy(\"legend_showLegendTotal\", \"_legend\", \"showLegendTotal\");\nChartPanel.prototype.publishProxy(\"legend_itemPadding\", \"_legend\", \"itemPadding\");\nChartPanel.prototype.publishProxy(\"legend_shapeRadius\", \"_legend\", \"shapeRadius\");\nChartPanel.prototype.publishProxy(\"legend_symbolType\", \"_legend\", \"symbolType\");\nChartPanel.prototype.publishProxy(\"legend_labelAlign\", \"_legend\", \"labelAlign\");\nChartPanel.prototype.publish(\"widget\", null, \"widget\", \"Widget\", undefined, { render: false });\nChartPanel.prototype.publish(\"enableAutoscaling\", false, \"boolean\");\nChartPanel.prototype.publish(\"highlightSize\", 4, \"number\");\nChartPanel.prototype.publish(\"highlightColor\", \"#e67e22\", \"html-color\");\nChartPanel.prototype.publishProxy(\"progress_halfLife\", \"_progressBar\", \"halfLife\");\nChartPanel.prototype.publishProxy(\"progress_decay\", \"_progressBar\", \"decay\");\nChartPanel.prototype.publishProxy(\"progress_size\", \"_progressBar\", \"size\");\nChartPanel.prototype.publishProxy(\"progress_color\", \"_progressBar\", \"color\");\nChartPanel.prototype.publishProxy(\"progress_blurBar\", \"_progressBar\", \"blurBar\");\nChartPanel.prototype.publishProxy(\"progress_blurSize\", \"_progressBar\", \"blurSize\");\nChartPanel.prototype.publishProxy(\"progress_blurColor\", \"_progressBar\", \"blurColor\");\nChartPanel.prototype.publishProxy(\"progress_blurOpacity\", \"_progressBar\", \"blurOpacity\");\n\nChartPanel.prototype.widget = function (_?) {\n if (!arguments.length) return this._widget;\n this._carousel.widgets([_, this._table]);\n this._widget = _;\n this._widget\n .fields(this._legend.filteredFields())\n .data(this._legend.filteredData())\n ;\n\n const context = this;\n const tmpAny = this._widget as any;\n tmpAny.click = function () {\n context.click.apply(context, arguments);\n };\n tmpAny.dblclick = function () {\n context.dblclick.apply(context, arguments);\n };\n tmpAny.vertex_click = function () {\n context.vertex_click.apply(context, arguments);\n };\n tmpAny.vertex_dblclick = function () {\n context.vertex_dblclick.apply(context, arguments);\n };\n tmpAny.edge_click = function () {\n context.edge_click.apply(context, arguments);\n };\n tmpAny.edge_dblclick = function () {\n context.edge_dblclick.apply(context, arguments);\n };\n return this;\n};\n","import { HTMLWidget } from \"@hpcc-js/common\";\nimport { select as d3Select } from \"d3-selection\";\n\nimport \"../src/FlexGrid.css\";\n\nexport class FlexGrid extends HTMLWidget {\n constructor() {\n super();\n }\n enter(domNode, element) {\n super.enter(domNode, element);\n d3Select(domNode.parentNode)\n .style(\"height\", \"100%\")\n .style(\"width\", \"100%\")\n ;\n }\n update(domNode, element) {\n super.update(domNode, element);\n const context = this;\n\n const cachedSizes = [];\n this.updateFlexParent(element);\n const listItems = element.selectAll(\".FlexGrid-list-item\").data(this.widgets(), w => w.id());\n listItems.enter()\n .append(\"div\")\n .classed(\"FlexGrid-list-item\", true)\n .each(function (w) {\n w.target(this);\n })\n .merge(listItems)\n .style(\"min-height\", this.itemMinHeight() + \"px\")\n .style(\"min-width\", this.itemMinWidth() + \"px\")\n .style(\"flex-basis\", (n, i) => {\n const flexBasis = this.widgetsFlexBasis()[i];\n return typeof flexBasis !== \"undefined\" ? flexBasis : this.flexBasis();\n })\n .style(\"flex-grow\", (n, i) => {\n const flexGrow = this.widgetsFlexGrow()[i];\n return typeof flexGrow !== \"undefined\" ? flexGrow : this.flexGrow();\n })\n .style(\"border-width\", this.borderWidth() + \"px\")\n .style(\"border-color\", this.itemBorderColor())\n .each(function () {\n this.firstChild.style.display = \"none\";\n })\n .each(function () {\n const rect = this.getBoundingClientRect();\n cachedSizes.push([\n rect.width,\n rect.height\n ]);\n })\n .each(function (w, i) {\n this.firstChild.style.display = \"block\";\n w.resize({\n width: cachedSizes[i][0] - (2 * context.borderWidth()),\n height: cachedSizes[i][1] - (2 * context.borderWidth())\n });\n })\n ;\n listItems.exit().remove();\n }\n exit(domNode, element) {\n super.exit(domNode, element);\n }\n updateFlexParent(element) {\n element\n .style(\"height\", \"100%\")\n .style(\"flex-direction\", this.orientation() === \"horizontal\" ? \"row\" : \"column\")\n .style(\"flex-wrap\", this.flexWrap())\n .style(\"align-items\", this.alignItems())\n .style(\"align-content\", this.alignContent())\n .style(\"overflow-x\", () => {\n if (this.forceXScroll() || (this.orientation() === \"horizontal\" && this.flexWrap() === \"nowrap\" && !this.disableScroll())) {\n return \"scroll\";\n }\n return \"hidden\";\n })\n .style(\"overflow-y\", () => {\n if (this.forceYScroll() || (this.orientation() === \"vertical\" && this.flexWrap() === \"nowrap\" && !this.disableScroll())) {\n return \"scroll\";\n }\n return \"hidden\";\n })\n ;\n }\n}\nFlexGrid.prototype._class += \" layout_FlexGrid\";\n\nexport interface FlexGrid {\n widgets(): any;\n widgets(_: any): this;\n orientation(): \"horizontal\" | \"vertical\";\n orientation(_: \"horizontal\" | \"vertical\"): this;\n flexWrap(): \"nowrap\" | \"wrap\" | \"wrap-reverse\";\n flexWrap(_: \"nowrap\" | \"wrap\" | \"wrap-reverse\"): this;\n itemMinHeight(): number;\n itemMinHeight(_: number): this;\n itemMinWidth(): number;\n itemMinWidth(_: number): this;\n alignItems(): \"flex-start\" | \"center\" | \"flex-end\" | \"stretch\";\n alignItems(_: \"flex-start\" | \"center\" | \"flex-end\" | \"stretch\"): this;\n alignContent(): \"flex-start\" | \"center\" | \"flex-end\" | \"stretch\" | \"space-between\" | \"space-around\";\n alignContent(_: \"flex-start\" | \"center\" | \"flex-end\" | \"stretch\" | \"space-between\" | \"space-around\"): this;\n itemBorderColor(): string;\n itemBorderColor(_: string): this;\n borderWidth(): number;\n borderWidth(_: number): this;\n flexGrow(): number;\n flexGrow(_: number): this;\n widgetsFlexGrow(): number[];\n widgetsFlexGrow(_: number[]): this;\n flexBasis(): string;\n flexBasis(_: string): this;\n widgetsFlexBasis(): string[];\n widgetsFlexBasis(_: string[]): this;\n disableScroll(): boolean;\n disableScroll(_: boolean): this;\n forceXScroll(): boolean;\n forceXScroll(_: boolean): this;\n forceYScroll(): boolean;\n forceYScroll(_: boolean): this;\n}\n\nFlexGrid.prototype.publish(\"itemBorderColor\", \"transparent\", \"html-color\", \"Color of list item borders\");\nFlexGrid.prototype.publish(\"borderWidth\", 0, \"number\", \"Width of list item borders (pixels)\");\nFlexGrid.prototype.publish(\"orientation\", \"horizontal\", \"set\", \"Controls the flex-direction of the list items\", [\"horizontal\", \"vertical\"]);\nFlexGrid.prototype.publish(\"flexWrap\", \"wrap\", \"set\", \"Controls the line wrap when overflow occurs\", [\"nowrap\", \"wrap\", \"wrap-reverse\"]);\nFlexGrid.prototype.publish(\"disableScroll\", false, \"boolean\", \"If false, scrollbar will show (when flexWrap is set to 'nowrap')\", null, { disable: (w: any) => w.flexWrap() !== \"nowrap\" });\nFlexGrid.prototype.publish(\"forceXScroll\", false, \"boolean\", \"If true, horzontal scrollbar will show\");\nFlexGrid.prototype.publish(\"forceYScroll\", false, \"boolean\", \"If true, vertical scrollbar will show\");\nFlexGrid.prototype.publish(\"itemMinHeight\", 64, \"number\", \"Minimum height of a list item (pixels)\");\nFlexGrid.prototype.publish(\"itemMinWidth\", 64, \"number\", \"Minimum width of a list item (pixels)\");\nFlexGrid.prototype.publish(\"alignItems\", \"stretch\", \"set\", \"Controls normal alignment of items\", [\"flex-start\", \"center\", \"flex-end\", \"stretch\"]);\nFlexGrid.prototype.publish(\"alignContent\", \"stretch\", \"set\", \"Controls normal alignment of item rows\", [\"flex-start\", \"center\", \"flex-end\", \"stretch\", \"space-between\", \"space-around\"]);\nFlexGrid.prototype.publish(\"flexGrow\", 1, \"number\", \"Default flex-grow style for all list items\");\nFlexGrid.prototype.publish(\"flexBasis\", \"10%\", \"string\", \"Default flex-basis style for all list items\");\nFlexGrid.prototype.publish(\"widgetsFlexGrow\", [], \"array\", \"Array of flex-grow values keyed on the widgets array\");\nFlexGrid.prototype.publish(\"widgetsFlexBasis\", [], \"array\", \"Array of flex-basis values keyed on the widgets array\");\nFlexGrid.prototype.publish(\"widgets\", [], \"widgetArray\", \"Array of widgets to be rendered as list items\");\n","(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define([], factory);\n } else if (typeof exports === 'object') {\n // Node. Does not work with strict CommonJS, but\n // only CommonJS-like environments that support module.exports,\n // like Node.\n module.exports = factory();\n } else {\n // Browser globals (root is window)\n root.GridList = factory();\n }\n}(this, function() {\n\nvar GridList = function(items, options) {\n /**\n * A GridList manages the two-dimensional positions from a list of items,\n * within a virtual matrix.\n *\n * The GridList's main function is to convert the item positions from one\n * grid size to another, maintaining as much of their order as possible.\n *\n * The GridList's second function is to handle collisions when moving an item\n * over another.\n *\n * The positioning algorithm places items in columns. Starting from left to\n * right, going through each column top to bottom.\n *\n * The size of an item is expressed using the number of cols and rows it\n * takes up within the grid (w and h)\n *\n * The position of an item is express using the col and row position within\n * the grid (x and y)\n *\n * An item is an object of structure:\n * {\n * w: 3, h: 1,\n * x: 0, y: 1\n * }\n */\n\n this._options = options;\n for (var k in this.defaults) {\n if (!this._options.hasOwnProperty(k)) {\n this._options[k] = this.defaults[k];\n }\n }\n\n this.items = items;\n\n this._adjustSizeOfItems();\n\n this.generateGrid();\n};\n\nGridList.cloneItems = function(items, _items) {\n /**\n * Clone items with a deep level of one. Items are not referenced but their\n * properties are\n */\n var _item,\n i,\n k;\n if (_items === undefined) {\n _items = [];\n }\n for (i = 0; i < items.length; i++) {\n // XXX: this is good because we don't want to lose item reference, but\n // maybe we should clear their properties since some might be optional\n if (!_items[i]) {\n _items[i] = {};\n }\n for (k in items[i]) {\n _items[i][k] = items[i][k];\n }\n }\n return _items;\n};\n\nGridList.prototype = {\n\n defaults: {\n lanes: 5,\n direction: 'horizontal'\n },\n\n /**\n * Illustates grid as text-based table, using a number identifier for each\n * item. E.g.\n *\n * #| 0 1 2 3 4 5 6 7 8 9 10 11 12 13\n * --------------------------------------------\n * 0| 00 02 03 04 04 06 08 08 08 12 12 13 14 16\n * 1| 01 -- 03 05 05 07 09 10 11 11 -- 13 15 --\n *\n * Warn: Does not work if items don't have a width or height specified\n * besides their position in the grid.\n */\n toString: function() {\n var widthOfGrid = this.grid.length,\n output = '\\n #|',\n border = '\\n --',\n item,\n i,\n j;\n\n // Render the table header\n for (i = 0; i < widthOfGrid; i++) {\n output += ' ' + this._padNumber(i, ' ');\n border += '---';\n };\n output += border;\n\n // Render table contents row by row, as we go on the y axis\n for (i = 0; i < this._options.lanes; i++) {\n output += '\\n' + this._padNumber(i, ' ') + '|';\n for (j = 0; j < widthOfGrid; j++) {\n output += ' ';\n item = this.grid[j][i];\n output += item ? this._padNumber(this.items.indexOf(item), '0') : '--';\n }\n };\n output += '\\n';\n return output;\n },\n\n generateGrid: function() {\n /**\n * Build the grid structure from scratch, with the current item positions\n */\n var i;\n this._resetGrid();\n for (i = 0; i < this.items.length; i++) {\n this._markItemPositionToGrid(this.items[i]);\n }\n },\n\n resizeGrid: function(lanes) {\n var currentColumn = 0;\n\n this._options.lanes = lanes;\n this._adjustSizeOfItems();\n\n this._sortItemsByPosition();\n this._resetGrid();\n\n // The items will be sorted based on their index within the this.items array,\n // that is their \"1d position\"\n for (var i = 0; i < this.items.length; i++) {\n var item = this.items[i],\n position = this._getItemPosition(item);\n\n this._updateItemPosition(\n item, this.findPositionForItem(item, {x: currentColumn, y: 0}));\n\n // New items should never be placed to the left of previous items\n currentColumn = Math.max(currentColumn, position.x);\n }\n\n this._pullItemsToLeft();\n },\n\n findPositionForItem: function(item, start, fixedRow) {\n /**\n * This method has two options for the position we want for the item:\n * - Starting from a certain row/column number and only looking for\n * positions to its right\n * - Accepting positions for a certain row number only (use-case: items\n * being shifted to the left/right as a result of collisions)\n *\n * @param {Object<x:Number, y:Number, w:Number, h:Number} item\n * @param {Object<x:Number, y:Number} start Position from which to start\n * the search.\n * @param {Number} [fixedRow] If provided, we're going to try to find a\n * position for the new item on it. If doesn't fit there, we're going\n * to put it on the first row.\n *\n * @returns {Number[2]} x and y.\n */\n\n var x, y, position;\n\n // Start searching for a position from the horizontal position of the\n // rightmost item from the grid\n for (x = start.x; x < this.grid.length; x++) {\n if (fixedRow !== undefined) {\n position = [x, fixedRow];\n\n if (this._itemFitsAtPosition(item, position)) {\n return position;\n }\n } else {\n for (y = start.y; y < this._options.lanes; y++) {\n position = [x, y];\n\n if (this._itemFitsAtPosition(item, position)) {\n return position;\n }\n }\n }\n }\n\n // If we've reached this point, we need to start a new column\n var newCol = this.grid.length,\n newRow = 0;\n\n if (fixedRow !== undefined &&\n this._itemFitsAtPosition(item, [newCol, fixedRow])) {\n newRow = fixedRow;\n }\n\n return [newCol, newRow];\n },\n\n moveItemToPosition: function(item, newPosition) {\n var position = this._getItemPosition({\n x: newPosition[0],\n y: newPosition[1],\n w: item.w,\n h: item.h\n });\n\n this._updateItemPosition(item, [position.x, position.y]);\n this._resolveCollisions(item);\n },\n\n resizeItem: function(item, size) {\n /**\n * Resize an item and resolve collisions.\n *\n * @param {Object} item A reference to an item that's part of the grid.\n * @param {Object} size\n * @param {Number} [size.w=item.w] The new width.\n * @param {Number} [size.h=item.h] The new height.\n */\n\n var width = size.w || item.w,\n height = size.h || item.h;\n\n this._updateItemSize(item, width, height);\n\n this._resolveCollisions(item);\n\n this._pullItemsToLeft();\n },\n\n getChangedItems: function(initialItems, idAttribute) {\n /**\n * Compare the current items against a previous snapshot and return only\n * the ones that changed their attributes in the meantime. This includes both\n * position (x, y) and size (w, h)\n *\n * Since both their position and size can change, the items need an\n * additional identifier attribute to match them with their previous state\n */\n var changedItems = [];\n\n for (var i = 0; i < initialItems.length; i++) {\n var item = this._getItemByAttribute(idAttribute,\n initialItems[i][idAttribute]);\n\n if (item.x !== initialItems[i].x ||\n item.y !== initialItems[i].y ||\n item.w !== initialItems[i].w ||\n item.h !== initialItems[i].h) {\n changedItems.push(item);\n }\n }\n\n return changedItems;\n },\n\n _sortItemsByPosition: function() {\n this.items.sort(function(item1, item2) {\n var position1 = this._getItemPosition(item1),\n position2 = this._getItemPosition(item2);\n\n // Try to preserve columns.\n if (position1.x != position2.x) {\n return position1.x - position2.x;\n }\n\n if (position1.y != position2.y) {\n return position1.y - position2.y;\n }\n\n // The items are placed on the same position.\n return 0;\n }.bind(this));\n },\n\n _adjustSizeOfItems: function() {\n /**\n * Some items can have 100% height or 100% width. Those dimmensions are\n * expressed as 0. We need to ensure a valid width and height for each of\n * those items as the number of items per lane.\n */\n\n for (var i = 0; i < this.items.length; i++) {\n var item = this.items[i];\n\n // This can happen only the first time items are checked.\n // We need the property to have a value for all the items so that the\n // `cloneItems` method will merge the properties properly. If we only set\n // it to the items that need it then the following can happen:\n //\n // cloneItems([{id: 1, autoSize: true}, {id: 2}],\n // [{id: 2}, {id: 1, autoSize: true}]);\n //\n // will result in\n //\n // [{id: 1, autoSize: true}, {id: 2, autoSize: true}]\n if (item.autoSize === undefined) {\n item.autoSize = item.w === 0 || item.h === 0;\n }\n\n if (item.autoSize) {\n if (this._options.direction === 'horizontal') {\n item.h = this._options.lanes;\n } else {\n item.w = this._options.lanes;\n }\n }\n }\n },\n\n _resetGrid: function() {\n this.grid = [];\n },\n\n _itemFitsAtPosition: function(item, newPosition) {\n /**\n * Check that an item wouldn't overlap with another one if placed at a\n * certain position within the grid\n */\n\n var position = this._getItemPosition(item),\n x, y, row;\n\n // No coordonate can be negative\n if (newPosition[0] < 0 || newPosition[1] < 0) {\n return false;\n }\n\n // Make sure the item isn't larger than the entire grid\n if (newPosition[1] + position.h > this._options.lanes) {\n return false;\n }\n\n // Make sure the position doesn't overlap with an already positioned\n // item.\n for (x = newPosition[0]; x < newPosition[0] + position.w; x++) {\n var col = this.grid[x];\n\n // Surely a column that hasn't even been created yet is available\n if (!col) {\n continue;\n }\n\n for (y = newPosition[1]; y < newPosition[1] + position.h; y++) {\n // Any space occupied by an item can continue to be occupied by the\n // same item.\n if (col[y] && col[y] !== item) {\n return false;\n }\n }\n }\n\n return true;\n },\n\n _updateItemPosition: function(item, position) {\n if (item.x !== null && item.y !== null) {\n this._deleteItemPositionFromGrid(item);\n }\n\n this._setItemPosition(item, position);\n\n this._markItemPositionToGrid(item);\n },\n\n _updateItemSize: function(item, width, height) {\n /**\n * @param {Object} item A reference to a grid item.\n * @param {Number} width The new width.\n * @param {Number} height The new height.\n */\n\n if (item.x !== null && item.y !== null) {\n this._deleteItemPositionFromGrid(item);\n }\n\n item.w = width;\n item.h = height;\n\n this._markItemPositionToGrid(item);\n },\n\n _markItemPositionToGrid: function(item) {\n /**\n * Mark the grid cells that are occupied by an item. This prevents items\n * from overlapping in the grid\n */\n\n var position = this._getItemPosition(item),\n x, y;\n\n // Ensure that the grid has enough columns to accomodate the current item.\n this._ensureColumns(position.x + position.w);\n\n for (x = position.x; x < position.x + position.w; x++) {\n for (y = position.y; y < position.y + position.h; y++) {\n this.grid[x][y] = item;\n }\n }\n },\n\n _deleteItemPositionFromGrid: function(item) {\n var position = this._getItemPosition(item),\n x, y;\n\n for (x = position.x; x < position.x + position.w; x++) {\n // It can happen to try to remove an item from a position not generated\n // in the grid, probably when loading a persisted grid of items. No need\n // to create a column to be able to remove something from it, though\n if (!this.grid[x]) {\n continue;\n }\n\n for (y = position.y; y < position.y + position.h; y++) {\n // Don't clear the cell if it's been occupied by a different widget in\n // the meantime (e.g. when an item has been moved over this one, and\n // thus by continuing to clear this item's previous position you would\n // cancel the first item's move, leaving it without any position even)\n if (this.grid[x][y] == item) {\n this.grid[x][y] = null;\n }\n }\n }\n },\n\n _ensureColumns: function(N) {\n /**\n * Ensure that the grid has at least N columns available.\n */\n var i;\n for (i = 0; i < N; i++) {\n if (!this.grid[i]) {\n this.grid.push(new GridCol(this._options.lanes));\n }\n }\n },\n\n _getItemsCollidingWithItem: function(item) {\n var collidingItems = [];\n for (var i = 0; i < this.items.length; i++) {\n if (item != this.items[i] &&\n this._itemsAreColliding(item, this.items[i])) {\n collidingItems.push(i);\n }\n }\n return collidingItems;\n },\n\n _itemsAreColliding: function(item1, item2) {\n var position1 = this._getItemPosition(item1),\n position2 = this._getItemPosition(item2);\n\n return !(position2.x >= position1.x + position1.w ||\n position2.x + position2.w <= position1.x ||\n position2.y >= position1.y + position1.h ||\n position2.y + position2.h <= position1.y);\n },\n\n _resolveCollisions: function(item) {\n if (!this._tryToResolveCollisionsLocally(item)) {\n this._pullItemsToLeft(item);\n }\n this._pullItemsToLeft();\n },\n\n _tryToResolveCollisionsLocally: function(item) {\n /**\n * Attempt to resolve the collisions after moving a an item over one or more\n * other items within the grid, by shifting the position of the colliding\n * items around the moving one. This might result in subsequent collisions,\n * in which case we will revert all position permutations. To be able to\n * revert to the initial item positions, we create a virtual grid in the\n * process\n */\n var collidingItems = this._getItemsCollidingWithItem(item);\n if (!collidingItems.length) {\n return true;\n }\n var _gridList = new GridList([], this._options),\n leftOfItem,\n rightOfItem,\n aboveOfItem,\n belowOfItem;\n\n GridList.cloneItems(this.items, _gridList.items);\n _gridList.generateGrid();\n\n for (var i = 0; i < collidingItems.length; i++) {\n var collidingItem = _gridList.items[collidingItems[i]],\n collidingPosition = this._getItemPosition(collidingItem);\n\n // We use a simple algorithm for moving items around when collisions occur:\n // In this prioritized order, we try to move a colliding item around the\n // moving one:\n // 1. to its left side\n // 2. above it\n // 3. under it\n // 4. to its right side\n var position = this._getItemPosition(item);\n\n leftOfItem = [position.x - collidingPosition.w, collidingPosition.y];\n rightOfItem = [position.x + position.w, collidingPosition.y];\n aboveOfItem = [collidingPosition.x, position.y - collidingPosition.h];\n belowOfItem = [collidingPosition.x, position.y + position.h];\n\n if (_gridList._itemFitsAtPosition(collidingItem, leftOfItem)) {\n _gridList._updateItemPosition(collidingItem, leftOfItem);\n } else if (_gridList._itemFitsAtPosition(collidingItem, aboveOfItem)) {\n _gridList._updateItemPosition(collidingItem, aboveOfItem);\n } else if (_gridList._itemFitsAtPosition(collidingItem, belowOfItem)) {\n _gridList._updateItemPosition(collidingItem, belowOfItem);\n } else if (_gridList._itemFitsAtPosition(collidingItem, rightOfItem)) {\n _gridList._updateItemPosition(collidingItem, rightOfItem);\n } else {\n // Collisions failed, we must use the pullItemsToLeft method to arrange\n // the other items around this item with fixed position. This is our\n // plan B for when local collision resolving fails.\n return false;\n }\n }\n // If we reached this point it means we managed to resolve the collisions\n // from one single iteration, just by moving the colliding items around. So\n // we accept this scenario and marge the brached-out grid instance into the\n // original one\n GridList.cloneItems(_gridList.items, this.items);\n this.generateGrid();\n return true;\n },\n\n _pullItemsToLeft: function(fixedItem) {\n /**\n * Build the grid from scratch, by using the current item positions and\n * pulling them as much to the left as possible, removing as space between\n * them as possible.\n *\n * If a \"fixed item\" is provided, its position will be kept intact and the\n * rest of the items will be layed around it.\n */\n\n\n // Start a fresh grid with the fixed item already placed inside\n this._sortItemsByPosition();\n this._resetGrid();\n\n // Start the grid with the fixed item as the first positioned item\n if (fixedItem) {\n var fixedPosition = this._getItemPosition(fixedItem);\n this._updateItemPosition(fixedItem, [fixedPosition.x, fixedPosition.y]);\n }\n\n for (var i = 0; i < this.items.length; i++) {\n var item = this.items[i],\n position = this._getItemPosition(item);\n\n // The fixed item keeps its exact position\n if (fixedItem && item == fixedItem) {\n continue;\n }\n\n var x = this._findLeftMostPositionForItem(item),\n newPosition = this.findPositionForItem(\n item, {x: x, y: 0}, position.y);\n\n this._updateItemPosition(item, newPosition);\n }\n },\n\n _findLeftMostPositionForItem: function(item) {\n /**\n * When pulling items to the left, we need to find the leftmost position for\n * an item, with two considerations in mind:\n * - preserving its current row\n * - preserving the previous horizontal order between items\n */\n\n var tail = 0,\n position = this._getItemPosition(item);\n\n for (var i = 0; i < this.grid.length; i++) {\n for (var j = position.y; j < position.y + position.h; j++) {\n var otherItem = this.grid[i][j];\n\n if (!otherItem) {\n continue;\n }\n\n var otherPosition = this._getItemPosition(otherItem);\n\n if (this.items.indexOf(otherItem) < this.items.indexOf(item)) {\n tail = otherPosition.x + otherPosition.w;\n }\n }\n }\n\n return tail;\n },\n\n _getItemByAttribute: function(key, value) {\n for (var i = 0; i < this.items.length; i++) {\n if (this.items[i][key] === value) {\n return this.items[i];\n }\n }\n return null;\n },\n\n _padNumber: function(nr, prefix) {\n // Currently works for 2-digit numbers (<100)\n return nr >= 10 ? nr : prefix + nr;\n },\n\n _getItemPosition: function(item) {\n /**\n * If the direction is vertical we need to rotate the grid 90 deg to the\n * left. Thus, we simulate the fact that items are being pulled to the top.\n *\n * Since the items have widths and heights, if we apply the classic\n * counter-clockwise 90 deg rotation\n *\n * [0 -1]\n * [1 0]\n *\n * then the top left point of an item will become the bottom left point of\n * the rotated item. To adjust for this, we need to subtract from the y\n * position the height of the original item - the width of the rotated item.\n *\n * However, if we do this then we'll reverse some actions: resizing the\n * width of an item will stretch the item to the left instead of to the\n * right; resizing an item that doesn't fit into the grid will push the\n * items around it instead of going on a new row, etc.\n *\n * We found it better to do a vertical flip of the grid after rotating it.\n * This restores the direction of the actions and greatly simplifies the\n * transformations.\n */\n\n if (this._options.direction === 'horizontal') {\n return item;\n } else {\n return {\n x: item.y,\n y: item.x,\n w: item.h,\n h: item.w\n };\n }\n },\n\n _setItemPosition: function(item, position) {\n /**\n * See _getItemPosition.\n */\n\n if (this._options.direction === 'horizontal') {\n item.x = position[0];\n item.y = position[1];\n } else {\n // We're supposed to subtract the rotated item's height which is actually\n // the non-rotated item's width.\n item.x = position[1];\n item.y = position[0];\n }\n }\n};\n\nvar GridCol = function(lanes) {\n for (var i = 0; i < lanes; i++) {\n this.push(null);\n }\n};\n\n// Extend the Array prototype\nGridCol.prototype = [];\n\n// This module will have direct access to the GridList class\nreturn GridList;\n\n}));\n","import { d3Event, drag as d3Drag, HTMLWidget, Platform, select as d3Select, Utility } from \"@hpcc-js/common\";\nimport * as _GridList from \"grid-list\";\nimport { Cell } from \"./Cell.ts\";\n\nimport \"../src/Grid.css\";\n\nconst GridList = (_GridList && _GridList.default) || _GridList;\n\nexport type ICellPosition = [number, number, number, number];\n\nexport class Grid extends HTMLWidget {\n divItems;\n\n gridList;\n items;\n itemsMap;\n origItems;\n cellWidth;\n cellHeight;\n dragItem;\n dragItemPos;\n\n _d3Drag;\n _d3DragResize;\n _selectionBag;\n _scrollBarWidth;\n\n constructor() {\n super();\n\n this._tag = \"div\";\n this._selectionBag = new Utility.Selection(this);\n\n this.content([]);\n }\n\n getDimensions() {\n const size = { width: 0, height: 0 };\n this.content().forEach(function (cell) {\n if (size.width < cell.gridCol() + cell.gridColSpan()) {\n size.width = cell.gridCol() + cell.gridColSpan();\n }\n if (size.height < cell.gridRow() + cell.gridRowSpan()) {\n size.height = cell.gridRow() + cell.gridRowSpan();\n }\n }, this);\n return size;\n }\n\n clearContent(widget) {\n this.content(this.content().filter(function (contentWidget) {\n if (!widget) {\n contentWidget.target(null);\n return false;\n }\n let w: any = contentWidget;\n while (w) {\n if (widget === w) {\n contentWidget.target(null);\n return false;\n }\n w = w.widget ? w.widget() : null;\n }\n return true;\n }));\n }\n\n setContent(row, col, widget, title?, rowSpan?, colSpan?) {\n rowSpan = rowSpan || 1;\n colSpan = colSpan || 1;\n title = title || \"\";\n this.content(this.content().filter(function (contentWidget) {\n if (contentWidget.gridRow() === row && contentWidget.gridCol() === col) {\n contentWidget.target(null);\n return false;\n }\n return true;\n }));\n if (widget) {\n const cell = new Cell()\n .gridRow(row)\n .gridCol(col)\n .widget(widget)\n .title(title)\n .gridRowSpan(rowSpan)\n .gridColSpan(colSpan)\n ;\n this.content().push(cell);\n }\n return this;\n }\n\n sortedContent() {\n return this.content().sort(function (l, r) {\n if (l.gridRow() === r.gridRow()) {\n return l.gridCol() - r.gridCol();\n }\n return l.gridRow() - r.gridRow();\n });\n }\n\n getCell(row, col) {\n let retVal = null;\n this.content().some(function (cell) {\n if (row >= cell.gridRow() && row < cell.gridRow() + cell.gridRowSpan() &&\n col >= cell.gridCol() && col < cell.gridCol() + cell.gridColSpan()) {\n retVal = cell;\n return true;\n }\n return false;\n });\n return retVal;\n }\n\n getWidgetCell(id) {\n let retVal = null;\n this.content().some(function (cell) {\n if (cell.widget().id() === id) {\n retVal = cell;\n return true;\n }\n return false;\n });\n return retVal;\n }\n\n getContent(id) {\n let retVal = null;\n this.content().some(function (cell) {\n if (cell.widget().id() === id) {\n retVal = cell.widget();\n return true;\n }\n return false;\n });\n return retVal;\n }\n\n cellToGridItem(cell) {\n return {\n x: cell.gridCol(),\n y: cell.gridRow(),\n w: cell.gridColSpan(),\n h: cell.gridRowSpan(),\n id: cell.id(),\n cell\n };\n }\n\n gridItemToCell(item) {\n item.cell\n .gridCol(item.x)\n .gridRow(item.y)\n .gridColSpan(item.w)\n .gridRowSpan(item.h)\n ;\n }\n\n resetItemsPos() {\n this.origItems.forEach(function (origItem) {\n const item = this.itemsMap[origItem.id];\n item.x = origItem.x;\n item.y = origItem.y;\n }, this);\n }\n\n initGridList() {\n this.itemsMap = {};\n this.items = this.content().map(function (cell) {\n const retVal = this.cellToGridItem(cell);\n this.itemsMap[retVal.id] = retVal;\n return retVal;\n }, this);\n this.origItems = this.content().map(this.cellToGridItem);\n this.gridList = new GridList(this.items, {\n direction: this.snapping(),\n lanes: this.snapping() === \"horizontal\" ? this.snappingRows() : this.snappingColumns()\n });\n }\n\n killGridList() {\n this.gridList = null;\n delete this.items;\n delete this.itemsMap;\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n\n this._scrollBarWidth = Platform.getScrollbarWidth();\n\n const context = this;\n this._d3Drag = d3Drag()\n .subject(function (_d) {\n const d = context.cellToGridItem(_d);\n return { x: d.x * context.cellWidth, y: d.y * context.cellHeight };\n })\n .on(\"start\", function (_d: any) {\n if (!context.designMode()) return;\n d3Event().sourceEvent.stopPropagation();\n context.initGridList();\n const d = context.itemsMap[_d.id()];\n context.dragItem = element.append(\"div\")\n .attr(\"class\", \"dragging\")\n .style(\"transform\", function () { return \"translate(\" + d.x * context.cellWidth + \"px, \" + d.y * context.cellHeight + \"px)\"; })\n .style(\"width\", function () { return d.w * context.cellWidth - context.gutter() + \"px\"; })\n .style(\"height\", function () { return d.h * context.cellHeight - context.gutter() + \"px\"; })\n ;\n context.selectionBagClick(_d);\n })\n .on(\"drag\", function (_d: any) {\n if (!context.designMode()) return;\n const event = d3Event();\n event.sourceEvent.stopPropagation();\n const d = context.itemsMap[_d.id()];\n if (event.x < 0) {\n event.x = 0;\n }\n if (event.x + d.w * context.cellWidth > context.snappingColumns() * context.cellWidth) {\n event.x = context.snappingColumns() * context.cellWidth - d.w * context.cellWidth;\n }\n if (event.y < 0) {\n event.y = 0;\n }\n if (event.y + d.h * context.cellWidth > context.snappingRows() * context.cellWidth) {\n event.y = context.snappingRows() * context.cellWidth - d.h * context.cellWidth;\n }\n const pos = [Math.max(0, Math.floor((event.x + context.cellWidth / 2) / context.cellWidth)), Math.max(0, Math.floor((event.y + context.cellHeight / 2) / context.cellHeight))];\n if (d.x !== pos[0] || d.y !== pos[1]) {\n if (context.snapping() !== \"none\") {\n context.resetItemsPos();\n context.gridList.moveItemToPosition(d, pos);\n } else {\n d.x = pos[0];\n d.y = pos[1];\n }\n if (_d.gridCol() !== d.x || _d.gridRow() !== d.y) {\n context.items.forEach(context.gridItemToCell);\n context.updateGrid(false, 100);\n }\n }\n context.dragItem\n .style(\"transform\", function () { return \"translate(\" + event.x + \"px, \" + event.y + \"px)\"; })\n .style(\"width\", function () { return d.w * context.cellWidth + \"px\"; })\n .style(\"height\", function () { return d.h * context.cellHeight + \"px\"; })\n ;\n })\n .on(\"end\", function () {\n if (!context.designMode()) return;\n d3Event().sourceEvent.stopPropagation();\n context.dragItem.remove();\n context.dragItem = null;\n context.killGridList();\n })\n ;\n\n this._d3DragResize = d3Drag()\n .subject(function (_d) {\n const d = context.cellToGridItem(_d);\n return { x: (d.x + d.w - 1) * context.cellWidth, y: (d.y + d.h - 1) * context.cellHeight };\n })\n .on(\"start\", function (_d: any) {\n if (!context.designMode()) return;\n d3Event().sourceEvent.stopPropagation();\n context.initGridList();\n const d = context.itemsMap[_d.id()];\n context.dragItem = element.append(\"div\")\n .attr(\"class\", \"resizing\")\n .style(\"transform\", function () { return \"translate(\" + d.x * context.cellWidth + \"px, \" + d.y * context.cellHeight + \"px)\"; })\n .style(\"width\", function () { return d.w * context.cellWidth - context.gutter() + \"px\"; })\n .style(\"height\", function () { return d.h * context.cellHeight - context.gutter() + \"px\"; })\n ;\n context.dragItemPos = { x: d.x, y: d.y };\n })\n .on(\"drag\", function (_d: any) {\n if (!context.designMode()) return;\n const event = d3Event();\n event.sourceEvent.stopPropagation();\n const d = context.itemsMap[_d.id()];\n const pos = [Math.max(0, Math.round(event.x / context.cellWidth)), Math.max(0, Math.round(event.y / context.cellHeight))];\n const size = {\n w: Math.max(1, pos[0] - d.x + 1),\n h: Math.max(1, pos[1] - d.y + 1)\n };\n if (d.w !== size.w || d.h !== size.h) {\n if (context.snapping() !== \"none\") {\n context.resetItemsPos();\n context.gridList.resizeItem(d, size);\n } else {\n d.w = size.w;\n d.h = size.h;\n }\n if (_d.gridColSpan() !== d.w || _d.gridRowSpan() !== d.h) {\n context.items.forEach(context.gridItemToCell);\n context.updateGrid(d.id, 100);\n }\n }\n context.dragItem\n .style(\"width\", function () { return (-d.x + 1) * context.cellWidth + event.x - context.gutter() + \"px\"; })\n .style(\"height\", function () { return (-d.y + 1) * context.cellHeight + event.y - context.gutter() + \"px\"; })\n ;\n })\n .on(\"end\", function () {\n if (!context.designMode()) return;\n d3Event().sourceEvent.stopPropagation();\n context.dragItem.remove();\n context.dragItem = null;\n context.killGridList();\n })\n ;\n }\n\n updateGrid(resize, transitionDuration: number = 0, _noRender: boolean = false) {\n transitionDuration = transitionDuration || 0;\n const context = this;\n this.divItems\n .classed(\"draggable\", this.designMode())\n .transition().duration(transitionDuration)\n .style(\"left\", function (d) { return d.gridCol() * context.cellWidth + context.gutter() / 2 + \"px\"; })\n .style(\"top\", function (d) { return d.gridRow() * context.cellHeight + context.gutter() / 2 + \"px\"; })\n .style(\"width\", function (d) { return d.gridColSpan() * context.cellWidth - context.gutter() + \"px\"; })\n .style(\"height\", function (d) { return d.gridRowSpan() * context.cellHeight - context.gutter() + \"px\"; })\n .on(\"end\", function (d) {\n d\n .surfaceShadow_default(context.surfaceShadow())\n .surfacePadding_default(context.surfacePadding())\n .surfaceBorderWidth_default(context.surfaceBorderWidth())\n .surfaceBackgroundColor_default(context.surfaceBackgroundColor())\n ;\n\n if (resize === true || resize === d.id()) {\n d\n .resize()\n .lazyRender()\n ;\n }\n })\n ;\n }\n\n update(domNode, element2) {\n super.update(domNode, element2);\n\n this._placeholderElement.style(\"overflow-x\", this.fitTo() === \"width\" ? \"hidden\" : null);\n this._placeholderElement.style(\"overflow-y\", this.fitTo() === \"width\" ? \"scroll\" : null);\n const dimensions = this.getDimensions();\n const clientWidth = this.width() - (this.fitTo() === \"width\" ? this._scrollBarWidth : 0);\n this.cellWidth = clientWidth / dimensions.width;\n this.cellHeight = this.fitTo() === \"all\" ? this.height() / dimensions.height : this.cellWidth;\n if (this.designMode()) {\n const cellLaneRatio = Math.min(this.width() / this.snappingColumns(), this.height() / this.snappingRows());\n const laneWidth = Math.floor(cellLaneRatio);\n this.cellWidth = laneWidth;\n this.cellHeight = this.cellWidth;\n }\n\n // Grid ---\n const context = this;\n const divItems = element2.selectAll(\"#\" + this.id() + \" > .ddCell\").data(this.content(), function (d) { return d.id(); });\n this.divItems = divItems.enter().append(\"div\")\n .attr(\"class\", \"ddCell\")\n .each(function (d) {\n d.target(this);\n d.__grid_watch = d.monitor(function (key, newVal, oldVal) {\n if (context._renderCount && (key === \"snapping\" || key.indexOf(\"grid\") === 0) && newVal !== oldVal) {\n if (!context.gridList) {\n // API Call (only needed when not dragging) ---\n context.initGridList();\n if (context.snapping() !== \"none\") {\n context.gridList.resizeGrid(context.snapping() === \"horizontal\" ? context.snappingRows() : context.snappingColumns());\n }\n context.items.forEach(context.gridItemToCell);\n context.updateGrid(d.id(), 100);\n context.killGridList();\n }\n }\n });\n const element = d3Select(this);\n element.append(\"div\")\n .attr(\"class\", \"resizeHandle\")\n .call(context._d3DragResize)\n .append(\"div\")\n .attr(\"class\", \"resizeHandleDisplay\")\n ;\n }).merge(divItems)\n ;\n this.divItems.each(function (d) {\n const element = d3Select(this);\n if (context.designMode()) {\n element.call(context._d3Drag);\n } else {\n element\n .on(\"mousedown.drag\", null)\n .on(\"touchstart.drag\", null)\n ;\n }\n });\n this.divItems.select(\".resizeHandle\")\n .style(\"display\", this.designMode() ? null : \"none\")\n ;\n\n this.updateGrid(true);\n divItems.exit()\n .each(function (d) {\n d.target(null);\n if (d.__grid_watch) {\n d.__grid_watch.remove();\n }\n })\n .remove()\n ;\n\n // Snapping ---\n const lanesBackground = element2.selectAll(\"#\" + this.id() + \" > .laneBackground\").data(this.designMode() ? [\"\"] : []);\n lanesBackground.enter().insert(\"div\", \":first-child\")\n .attr(\"class\", \"laneBackground\")\n .style(\"left\", \"1px\")\n .style(\"top\", \"1px\")\n .on(\"click\", function () {\n context.selectionBagClear();\n })\n .merge(lanesBackground)\n .style(\"width\", (this.snappingColumns() * this.cellWidth) + \"px\")\n .style(\"height\", (this.snappingRows() * this.cellHeight) + \"px\")\n ;\n lanesBackground.exit()\n .each(function () {\n context.selectionBagClear();\n })\n .remove()\n ;\n\n const lanes = element2.selectAll(\"#\" + this.id() + \" > .lane\").data(this.designMode() ? [\"\"] : []);\n lanes.enter().append(\"div\")\n .attr(\"class\", \"lane\")\n .style(\"left\", \"1px\")\n .style(\"top\", \"1px\")\n ;\n lanes\n .style(\"display\", this.showLanes() ? null : \"none\")\n .style(\"width\", (this.snappingColumns() * this.cellWidth) + \"px\")\n .style(\"height\", (this.snappingRows() * this.cellHeight) + \"px\")\n .style(\"background-image\", \"linear-gradient(to right, grey 1px, transparent 1px), linear-gradient(to bottom, grey 1px, transparent 1px)\")\n .style(\"background-size\", this.cellWidth + \"px \" + this.cellHeight + \"px\")\n ;\n lanes.exit()\n .remove()\n ;\n }\n\n exit(domNode, element) {\n this.content().forEach(w => w.target(null));\n super.exit(domNode, element);\n }\n\n _createSelectionObject(d) {\n return {\n _id: d._id,\n element: () => {\n return d._element;\n },\n widget: d\n };\n }\n\n selection(_) {\n if (!arguments.length) return this._selectionBag.get().map(function (d) { return d._id; });\n this._selectionBag.set(_.map(function (row) {\n return this._createSelectionObject(row);\n }, this));\n return this;\n }\n\n selectionBagClear() {\n if (!this._selectionBag.isEmpty()) {\n this._selectionBag.clear();\n this.postSelectionChange();\n }\n }\n\n selectionBagClick(d) {\n if (d !== null) {\n const selectionObj = this._createSelectionObject(d);\n if (d3Event().sourceEvent.ctrlKey) {\n if (this._selectionBag.isSelected(selectionObj)) {\n this._selectionBag.remove(selectionObj);\n this.postSelectionChange();\n } else {\n this._selectionBag.append(selectionObj);\n this.postSelectionChange();\n }\n } else {\n const selected = this._selectionBag.get();\n if (selected.length === 1 && selected[0]._id === selectionObj._id) {\n this.selectionBagClear();\n } else {\n this._selectionBag.set([selectionObj]);\n }\n this.postSelectionChange();\n }\n }\n }\n\n postSelectionChange() {\n }\n\n applyLayout(layoutArr: ICellPosition[]) {\n this.divItems.each((d, i) => {\n if (layoutArr[i]) {\n const [x, y, w, h] = layoutArr[i];\n d\n .gridCol(x)\n .gridRow(y)\n .gridColSpan(w)\n .gridRowSpan(h)\n ;\n }\n });\n this.updateGrid(true);\n }\n\n vizActivation(elem) {\n }\n}\nGrid.prototype._class += \" layout_Grid\";\n\nexport interface Grid {\n designMode(): boolean;\n designMode(_: boolean): this;\n showLanes(): boolean;\n showLanes(_: boolean): this;\n fitTo(): string;\n fitTo(_: string): this;\n\n snapping(): string;\n snapping(_: string): this;\n snappingColumns(): number;\n snappingColumns(_: number): this;\n snappingRows(): number;\n snappingRows(_: number): this;\n snappingColumns_default(): number;\n snappingColumns_default(_: number): this;\n snappingRows_default(): number;\n snappingRows_default(_: number): this;\n\n gutter(): number;\n gutter(_: number): this;\n\n surfaceShadow(): boolean;\n surfaceShadow(_: boolean): this;\n surfacePadding(): string;\n surfacePadding(_: string): this;\n surfaceBorderWidth(): number;\n surfaceBorderWidth(_: number): this;\n surfaceBackgroundColor(): string;\n surfaceBackgroundColor(_: string): this;\n\n content(): Cell[];\n content(_: Cell[]): this;\n}\n\nGrid.prototype.publish(\"designMode\", false, \"boolean\", \"Design Mode\", null, { tags: [\"Basic\"] });\nGrid.prototype.publish(\"showLanes\", true, \"boolean\", \"Show snapping lanes when in design mode\", null, { tags: [\"Basic\"], disable: w => !w.designMode() });\nGrid.prototype.publish(\"fitTo\", \"all\", \"set\", \"Sizing Strategy\", [\"all\", \"width\"], { tags: [\"Basic\"] });\nGrid.prototype.publish(\"snapping\", \"vertical\", \"set\", \"Snapping Strategy\", [\"vertical\", \"horizontal\", \"none\"]);\nGrid.prototype.publish(\"snappingColumns\", 12, \"number\", \"Snapping Columns\");\nGrid.prototype.publish(\"snappingRows\", 16, \"number\", \"Snapping Rows\");\n\nGrid.prototype.publish(\"gutter\", 6, \"number\", \"Gap Between Widgets\", null, { tags: [\"Basic\"] });\n\nGrid.prototype.publish(\"surfaceShadow\", true, \"boolean\", \"3D Shadow\");\nGrid.prototype.publish(\"surfacePadding\", null, \"string\", \"Cell Padding (px)\", null, { tags: [\"Intermediate\"] });\nGrid.prototype.publish(\"surfaceBorderWidth\", 1, \"number\", \"Width (px) of Cell Border\", null, { tags: [\"Intermediate\"] });\nGrid.prototype.publish(\"surfaceBackgroundColor\", null, \"html-color\", \"Surface Background Color\", null, { tags: [\"Advanced\"] });\n\nGrid.prototype.publish(\"content\", [], \"widgetArray\", \"widgets\", null, { tags: [\"Basic\"], render: false });\n","import { FlexGrid } from \"./FlexGrid.ts\";\n\nexport class HorizontalList extends FlexGrid {\n constructor() {\n super();\n this.orientation_default(\"horizontal\");\n this.flexWrap_default(\"nowrap\");\n }\n}\nHorizontalList.prototype._class += \" layout_HorizontalList\";\n\nexport interface HorizontalList {\n orientation_default(_: \"horizontal\" | \"vertical\");\n flexWrap_default(_: \"nowrap\" | \"wrap\" | \"wrap-reverse\");\n}\n","import { HTMLWidget, Text } from \"@hpcc-js/common\";\n\nimport \"../src/Layered.css\";\n\nexport type LayerPlacement = \"default\" | \"top\" | \"right\" | \"bottom\" | \"left\" | \"center\";\n\nexport class Layered extends HTMLWidget {\n protected _contentContainer;\n _widgetPlacements;\n _widgetRatios;\n constructor() {\n super();\n\n this._tag = \"div\";\n this._widgetPlacements = [];\n this._widgetRatios = [];\n }\n\n addLayer(widget, placement: LayerPlacement = \"default\", widthRatio: number = 1, heightRatio: number = 1) {\n const widgets = this.widgets();\n widgets.push(widget ? widget : new Text().text(\"No widget defined for layer.\"));\n this.widgets(widgets);\n this._widgetPlacements.push(placement);\n this._widgetRatios.push([widthRatio, heightRatio]);\n return this;\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this._contentContainer = element.append(\"div\")\n .attr(\"class\", \"container\")\n ;\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n const context = this;\n\n element.style(\"padding\", this.surfacePadding() + \"px\");\n\n const content = this._contentContainer.selectAll(\".content.id\" + this.id()).data(this.widgets(), function (d) { return d.id(); });\n content.enter().append(\"div\")\n .attr(\"class\", \"content id\" + this.id())\n .each(function (widget, idx) {\n widget.target(this);\n })\n .merge(content)\n .each(function (widget, idx) {\n const clientSize = {\n width: context.clientWidth(),\n height: context.clientHeight()\n };\n const widgetSize = context.widgetSize(idx, clientSize);\n const widgetPosition = context.widgetPosition(idx, clientSize, widgetSize);\n this.style.top = widgetPosition.y + \"px\";\n this.style.left = widgetPosition.x + \"px\";\n widget\n .resize(widgetSize)\n .render()\n ;\n })\n ;\n content.exit()\n .each(function (widget, idx) {\n widget\n .target(null)\n ;\n })\n .remove()\n ;\n content.order();\n }\n\n widgetSize(idx, clientSize) {\n if (this._widgetPlacements[idx] === \"default\") {\n return {\n width: clientSize.width * this._widgetRatios[idx][0],\n height: clientSize.height * this._widgetRatios[idx][1]\n };\n } else {\n return {\n width: clientSize.width * this._widgetRatios[idx][0],\n height: clientSize.height * this._widgetRatios[idx][1]\n };\n }\n }\n widgetPosition(idx, clientSize, widgetSize) {\n switch (this._widgetPlacements[idx]) {\n default:\n return {\n x: 0,\n y: 0\n };\n case \"top\":\n return {\n x: (clientSize.width / 2) - (widgetSize.width / 2),\n y: 0\n };\n case \"bottom\":\n return {\n x: (clientSize.width / 2) - (widgetSize.width / 2),\n y: clientSize.height - widgetSize.height\n };\n case \"left\":\n return {\n x: 0,\n y: (clientSize.height / 2) - (widgetSize.height / 2)\n };\n case \"right\":\n return {\n x: clientSize.width - widgetSize.width,\n y: (clientSize.height / 2) - (widgetSize.height / 2)\n };\n case \"center\":\n return {\n x: (clientSize.width / 2) - (widgetSize.width / 2),\n y: (clientSize.height / 2) - (widgetSize.height / 2)\n };\n }\n }\n}\nLayered.prototype._class += \" layout_Layered\";\n\nexport interface Layered {\n surfacePadding(): number;\n surfacePadding(_: number): this;\n widgets(): any;\n widgets(_: any): this;\n}\n\nLayered.prototype.publish(\"surfacePadding\", 0, \"number\", \"Padding\");\nLayered.prototype.publish(\"widgets\", [], \"widgetArray\", \"widgets\", null, { tags: [\"Private\"] });\n","import { HTMLWidget, Widget } from \"@hpcc-js/common\";\n\nexport class Popup extends HTMLWidget {\n _surfaceButtons;\n _originalPosition;\n\n constructor() {\n super();\n this._tag = \"div\";\n this._surfaceButtons = [];\n }\n\n updateState(visible) {\n visible = visible || !this.popupState();\n this.popupState(visible).render();\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this.widget()\n .target(domNode)\n ;\n this._originalPosition = this.position();\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n element\n .style(\"visibility\", this.popupState() ? null : \"hidden\")\n .style(\"opacity\", this.popupState() ? null : 0)\n .style(\"width\", this.shrinkWrap() ? this.widget().width() + \"px\" : this._size.width + \"px\")\n .style(\"height\", this.shrinkWrap() ? this.widget().height() + \"px\" : this._size.height + \"px\")\n ;\n if (this.widget().size().height === 0) {\n this.widget().resize(this.size());\n }\n }\n\n postUpdate(domNode, element) {\n let left;\n let top;\n switch (this.centerPopup()) {\n case \"container\":\n if (this._placeholderElement) {\n left = parseInt(this._placeholderElement.style(\"width\")) / 2 - this.widget().width() / 2;\n top = parseInt(this._placeholderElement.style(\"height\")) / 2 - this.widget().height() / 2;\n }\n this.position(\"absolute\");\n break;\n\n case \"window\":\n left = window.innerWidth / 2 - this.widget().width() / 2;\n top = window.innerHeight / 2 - this.widget().height() / 2;\n this.position(\"fixed\");\n break;\n\n default:\n left = 0;\n top = 0;\n this.position(this._originalPosition);\n break;\n }\n\n this.pos({ x: left, y: top });\n\n super.postUpdate(domNode, element);\n\n element\n .style(\"position\", this.position())\n .style(\"left\", this.left() + \"px\")\n .style(\"right\", this.right() + \"px\")\n .style(\"top\", this.top() + \"px\")\n .style(\"bottom\", this.bottom() + \"px\")\n ;\n }\n\n exit(domNode, element) {\n if (this.widget()) {\n this.widget().target(null);\n }\n super.exit(domNode, element);\n }\n\n click(obj) {\n }\n}\nPopup.prototype._class += \" layout_Popup\";\n\nexport interface Popup {\n popupState(): boolean;\n popupState(_: boolean): this;\n shrinkWrap(): boolean;\n shrinkWrap(_: boolean): this;\n centerPopup(): \"none\" | \"container\" | \"window\";\n centerPopup(_: \"none\" | \"container\" | \"window\"): this;\n top(): number;\n top(_: number): this;\n bottom(): number;\n bottom(_: number): this;\n left(): number;\n left(_: number): this;\n right(): number;\n right(_: number): this;\n position(): string;\n position(_: string): this;\n\n widget(): Widget;\n widget(_: Widget): this;\n}\n\nPopup.prototype.publish(\"popupState\", false, \"boolean\", \"State of the popup, visible (true) or hidden (false)\", null, {});\nPopup.prototype.publish(\"shrinkWrap\", false, \"boolean\", \"The popup parent container either shrinks to the size of its contents (true) or expands to fit thge popup's parentDiv (false)\", null, {});\nPopup.prototype.publish(\"centerPopup\", \"none\", \"set\", \"Center the widget in its container element (target) or in the window\", [\"none\", \"container\", \"window\"], {});\nPopup.prototype.publish(\"top\", null, \"number\", \"Top position property of popup\", null, {});\nPopup.prototype.publish(\"bottom\", null, \"number\", \"Bottom position property of popup\", null, {});\nPopup.prototype.publish(\"left\", null, \"number\", \"Left position property of popup\", null, {});\nPopup.prototype.publish(\"right\", null, \"number\", \"Right position property of popup\", null, {});\nPopup.prototype.publish(\"position\", \"relative\", \"set\", \"Value of the 'position' property\", [\"absolute\", \"relative\", \"fixed\", \"static\", \"initial\", \"inherit\"], { tags: [\"Private\"] });\n\nPopup.prototype.publish(\"widget\", null, \"widget\", \"Widget\", null, { tags: [\"Private\"] });\n","import { HTMLWidget, Text, Widget } from \"@hpcc-js/common\";\nimport { select as d3Select } from \"d3-selection\";\nimport { Surface } from \"./Surface.ts\";\n\nimport \"../src/Tabbed.css\";\n\nexport class Tabbed extends HTMLWidget {\n _tabContainer;\n _contentContainer;\n\n constructor() {\n super();\n\n this._tag = \"div\";\n }\n\n clearTabs() {\n this.labels([]);\n this.widgets([]);\n return this;\n }\n\n addTab(widget, label, isActive?, callback?) {\n const widgetSize = widget.size();\n if (widgetSize.width === 0 && widgetSize.height === 0) {\n widget.size({ width: \"100%\", height: \"100%\" });\n }\n const labels = this.labels();\n const widgets = this.widgets();\n if (isActive) {\n this.activeTabIdx(this.widgets().length);\n }\n labels.push(label);\n const surface = new Surface().widget(widget ? widget : new Text().text(\"No widget defined for tab\"));\n widgets.push(surface);\n this.labels(labels);\n this.widgets(widgets);\n if (callback) {\n callback(surface);\n }\n return this;\n }\n\n widgetSize(widgetDiv) {\n const width = this.clientWidth();\n let height = this.clientHeight();\n\n const tcBox = this._tabContainer.node().getBoundingClientRect();\n if (typeof (tcBox.height) !== \"undefined\") {\n height -= tcBox.height;\n }\n return { width, height };\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this._tabContainer = element.append(\"div\");\n this._contentContainer = element.append(\"div\");\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n const context = this;\n\n element.style(\"padding\", this.surfacePadding_exists() ? this.surfacePadding() + \"px\" : null);\n\n const tabs = this._tabContainer.selectAll(\".tab-button.id\" + this.id()).data(this.showTabs() ? this.labels() : [], function (d) { return d; });\n tabs.enter().append(\"span\")\n .attr(\"class\", \"tab-button id\" + this.id())\n .style(\"cursor\", \"pointer\")\n .on(\"click\", function (d, idx) {\n context.click(context.widgets()[idx].widget(), d, idx);\n context\n .activeTabIdx(idx)\n .render()\n ;\n }).merge(tabs)\n .classed(\"active\", function (d, idx) { return context.activeTabIdx() === idx; })\n .text(function (d) { return d; })\n ;\n tabs.exit().remove();\n\n const content = this._contentContainer.selectAll(\".tab-content.id\" + this.id()).data(this.widgets(), function (d) { return d.id(); });\n content.enter().append(\"div\")\n .attr(\"class\", \"tab-content id\" + this.id())\n .each(function (widget, idx) {\n widget.target(this);\n }).merge(content)\n .classed(\"active\", function (d, idx) { return context.activeTabIdx() === idx; })\n .style(\"display\", function (d, idx) { return context.activeTabIdx() === idx ? \"block\" : \"none\"; })\n .each(function (surface, idx) {\n surface.visible(context.activeTabIdx() === idx);\n if (context.activeTabIdx() === idx) {\n const wSize = context.widgetSize(d3Select(this));\n surface\n .surfaceBorderWidth(context.showTabs() ? null : 0)\n .surfacePadding(context.showTabs() ? null : 0)\n .resize(wSize)\n ;\n }\n })\n ;\n content.exit()\n .each(function (widget, idx) {\n widget\n .target(null)\n ;\n })\n .remove();\n\n switch (this.tabLocation()) {\n case \"bottom\":\n this._tabContainer\n .attr(\"class\", \"on_bottom\")\n .style(\"top\", (this._contentContainer.node().offsetHeight + this.surfacePadding()) + \"px\")\n .style(\"position\", \"absolute\")\n ;\n this._contentContainer\n .style(\"top\", this.surfacePadding_exists() ? this.surfacePadding() + \"px\" : null)\n .style(\"position\", \"absolute\")\n ;\n break;\n default:\n this._tabContainer\n .attr(\"class\", \"on_top\")\n .style(\"top\", null)\n .style(\"position\", \"relative\")\n ;\n this._contentContainer\n .style(\"top\", (this._tabContainer.node().offsetHeight + this.surfacePadding()) + \"px\")\n .style(\"position\", \"absolute\")\n ;\n break;\n }\n }\n\n click(widget, column, idx) {\n }\n}\nTabbed.prototype._class += \" layout_Tabbed\";\n\nexport interface Tabbed {\n showTabs(): boolean;\n showTabs(_: boolean): this;\n surfacePadding(): number;\n surfacePadding(_: number): this;\n surfacePadding_exists(): boolean;\n activeTabIdx(): number;\n activeTabIdx(_: number): this;\n\n labels(): string[];\n labels(_: string[]): this;\n tabLocation(): \"top\" | \"bottom\";\n tabLocation(_: \"top\" | \"bottom\"): this;\n widgets(): any[];\n widgets(_: any[]): this;\n}\n\nTabbed.prototype.publish(\"showTabs\", true, \"boolean\", \"Show Tabs\", null, {});\nTabbed.prototype.publish(\"surfacePadding\", 4, \"number\", \"Padding\");\nTabbed.prototype.publish(\"activeTabIdx\", 0, \"number\", \"Index of active tab\", null, {});\n\nTabbed.prototype.publish(\"labels\", [], \"array\", \"Array of tab labels sharing an index with \", null, { tags: [\"Private\"] });\nTabbed.prototype.publish(\"tabLocation\", \"top\", \"set\", \"Position the tabs at the bottom of the widget\", [\"top\", \"bottom\"], { tags: [\"Private\"] });\nTabbed.prototype.publish(\"widgets\", [], \"widgetArray\", \"widgets\", null, { tags: [\"Private\"] });\n","import { HTMLWidget, Widget } from \"@hpcc-js/common\";\nimport { select as d3Select } from \"d3-selection\";\n\nimport \"../src/Toolbar.css\";\n\nexport class Toolbar extends HTMLWidget {\n\n constructor() {\n super();\n this._tag = \"div\";\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n const context = this;\n\n element\n .attr(\"title\", context.title())\n .style(\"background-color\", this.backgroundColor())\n ;\n\n const title = element.selectAll(\"div.toolbar-title\")\n .data(this.title() ? [this.title()] : []);\n title.enter().append(\"div\")\n .classed(\"toolbar-title\", true)\n .append(\"span\")\n ;\n title.selectAll(\"div.toolbar-title > span\")\n .style(\"font-size\", this.fontSize_exists() ? this.fontSize() + \"px\" : null)\n .style(\"color\", this.fontColor_exists() ? this.fontColor() : null)\n .style(\"font-family\", this.fontFamily_exists() ? this.fontFamily() : null)\n .style(\"font-weight\", this.fontBold_exists() ? (this.fontBold() ? \"bold\" : \"normal\") : null)\n .style(\"background-color\", this.backgroundColor_exists() ? this.backgroundColor() : null)\n .text(context.title())\n ;\n title.exit().remove();\n\n const childWidgets = element.selectAll(\"div.toolbar-child\")\n .data(this.widgets() !== null ? this.widgets() : [], function (d) { return d.id(); });\n\n childWidgets.enter().insert(\"div\", \"div.toolbar-title\")\n .each(function (d, i) {\n const widgetClass = context.widgetClasses()[i] ? context.widgetClasses()[i] + \" toolbar-child\" : \"toolbar-child\";\n d3Select(this).classed(widgetClass, true);\n d.target(this);\n });\n childWidgets.exit().each(function (d) {\n d.target(null);\n }).remove();\n childWidgets.order();\n }\n\n render(callback?: (w: Widget) => void): this {\n const context = this;\n return super.render(function (w) {\n const toolbarBBox = context.element().node().getBoundingClientRect();\n let minX = toolbarBBox.left + toolbarBBox.width;\n context.element().selectAll(\"div.toolbar-child\")\n .each(function (d, i) {\n const childBBox = this.getBoundingClientRect();\n if (minX > childBBox.left)\n minX = childBBox.left;\n })\n ;\n context.element().select(\".toolbar-title\")\n .style(\"width\", (minX - toolbarBBox.left - 4) + \"px\")\n ;\n if (callback) {\n callback(w);\n }\n });\n }\n\n exit(domNode, element) {\n this.widgets().forEach(function (w) {\n w.target(null);\n });\n super.exit(domNode, element);\n }\n}\nToolbar.prototype._class += \" layout_Toolbar\";\n\nexport interface Toolbar {\n title(): string;\n title(_: string): this;\n\n fontSize(): number;\n fontSize(_: number): this;\n fontSize_exists(): boolean;\n fontColor(): string;\n fontColor(_: string): this;\n fontColor_exists(): boolean;\n fontFamily(): string;\n fontFamily(_: string): this;\n fontFamily_exists(): boolean;\n fontBold(): boolean;\n fontBold(_: boolean): this;\n fontBold_exists(): boolean;\n backgroundColor(): string;\n backgroundColor(_: string): this;\n backgroundColor_exists(): boolean;\n\n responsive(): boolean;\n responsive(_: boolean): this;\n\n widgets(): any[];\n widgets(_: any[]): this;\n widgetClasses(): string[];\n widgetClasses(_: string[]): this;\n}\n\nToolbar.prototype.publish(\"title\", \"\", \"string\", \"Title\", null, { tags: [\"Intermediate\"] });\n\nToolbar.prototype.publish(\"fontSize\", null, \"number\", \"Title Font Size (px)\", null, { tags: [\"Advanced\"], optional: true });\nToolbar.prototype.publish(\"fontColor\", null, \"html-color\", \"Title Font Color\", null, { tags: [\"Advanced\"], optional: true });\nToolbar.prototype.publish(\"fontFamily\", null, \"string\", \"Title Font Family\", null, { tags: [\"Advanced\"], optional: true });\nToolbar.prototype.publish(\"fontBold\", true, \"boolean\", \"Enable Bold Title Font\", null, { tags: [\"Advanced\"], optional: true });\nToolbar.prototype.publish(\"backgroundColor\", null, \"html-color\", \"Background Color\", null, { tags: [\"Intermediate\"], optional: true });\n\nToolbar.prototype.publish(\"responsive\", true, \"boolean\", \"Adapts to pixel width\", null, { tags: [\"Basic\"] });\n\nToolbar.prototype.publish(\"widgets\", [], \"widgetArray\", \"Child widgets of the toolbar\", null, { tags: [\"Basic\"] });\nToolbar.prototype.publish(\"widgetClasses\", [], \"array\", \"Array of Html Element classes to be assigned to the child widgets (shares index with widgets param)\", null, { tags: [\"Basic\"] });\n","import { FlexGrid } from \"./FlexGrid.ts\";\n\nexport class VerticalList extends FlexGrid {\n constructor() {\n super();\n this.orientation_default(\"vertical\");\n this.flexWrap_default(\"nowrap\");\n }\n}\nVerticalList.prototype._class += \" layout_VerticalList\";\n\nexport interface VerticalList {\n orientation_default(_: \"horizontal\" | \"vertical\");\n flexWrap_default(_: \"nowrap\" | \"wrap\" | \"wrap-reverse\");\n}\n"],"names":["HTMLWidget","FAChar","d3Select","d3SelectAll","Utility","c","d3Event","Platform","d3Drag","a","promises","pi","tau","s","circle","text","select","path","format","formatPrefix","scaleLinear","dispatch","sum","formatLocale","formatSpecifier","SVGWidget","d3LegendColor","Database","Palette","n","d3Format","d3ScaleOrdinal","instanceOfIHighlight","ProgressBar","ToggleButton","Text","Button","Spacer","TitleBar","Table","IconBar","module","this","GridList","k","_GridList.default"],"mappings":"+mCAAO,MAAM,SAAW,kBACX,YAAc,QACd,cAAgB,QCEtB,MAAM,wBAAwBA,OAAAA,UAAW,CAC5C,aAAc,CACV,MAAA,EAEA,KAAK,KAAO,KAAA,CAGhB,MAAM,QAAS,QAAS,CACpB,MAAM,MAAM,QAAS,OAAO,CAAA,CAGhC,OAAO,QAAS,QAAS,CACrB,MAAM,OAAO,QAAS,OAAO,EAE7B,IAAI,KAAO,EACP,KAAO,EACP,MAAQ,KAAK,YAAA,EACb,OAAS,KAAK,aAAA,EAClB,OAAQ,KAAK,QAAM,CACf,IAAK,SACD,KAAO,KAAK,QAAA,EACZ,KAAO,KAAK,QAAA,EACZ,MAAQ,KAAK,gBAAkB,GAAK,MAAQ,KAAO,OAAO,KAAK,aAAa,EAC5E,OAAS,KAAK,iBAAmB,GAAK,OAAS,KAAO,OAAO,KAAK,cAAc,EAChF,MACJ,IAAK,UACD,KAAO,KAAK,QAAA,EAAY,MAAQ,IAChC,KAAO,KAAK,QAAA,EAAY,OAAS,IACjC,MAAQ,KAAK,YAAA,IAAkB,GAAK,MAAQ,KAAO,OAAO,KAAK,aAAa,EAAI,MAAQ,IACxF,OAAS,KAAK,aAAA,IAAmB,GAAK,OAAS,KAAO,OAAO,KAAK,cAAc,EAAI,OAAS,IAC7F,KAAA,CAER,QAAQ,MAAM,UAAW,KAAK,QAAA,CAAS,EAEvC,MAAM,QAAU,QAAQ,UAAU,IAAM,KAAK,IAAM,iBAAiB,EAAE,KAAK,KAAK,SAAW,CAAC,KAAK,OAAA,CAAQ,EAAI,CAAA,EAAI,SAAU,EAAG,CAAE,OAAO,EAAE,GAAA,CAAM,EAC/I,QAAQ,MAAA,EAAQ,OAAO,KAAK,EACvB,KAAK,QAAS,aAAa,EAC3B,KAAK,SAAU,EAAG,CACf,E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c,CACV,MAAA,EACA,KAAK,oBAAoB,UAAU,EACnC,KAAK,iBAAiB,QAAQ,CAAA,CAEtC,CACA,aAAa,UAAU,QAAU","x_google_ignoreList":[8,9,10,11,12,13,14,15,16,17,18,19,24]}
|
|
1
|
+
{"version":3,"file":"index.umd.cjs","sources":["../src/__package__.ts","../src/AbsoluteSurface.ts","../src/Accordion.ts","../src/Surface.ts","../src/Cell.ts","../src/Border.ts","../src/Border2.ts","../src/Carousel.ts","../../../node_modules/d3-path/src/path.js","../../../node_modules/d3-shape/src/constant.js","../../../node_modules/d3-shape/src/math.js","../../../node_modules/d3-shape/src/symbol/circle.js","../../../node_modules/d3-shape/src/symbol/cross.js","../../../node_modules/d3-shape/src/symbol/diamond.js","../../../node_modules/d3-shape/src/symbol/star.js","../../../node_modules/d3-shape/src/symbol/square.js","../../../node_modules/d3-shape/src/symbol/triangle.js","../../../node_modules/d3-shape/src/symbol/wye.js","../../../node_modules/d3-shape/src/symbol.js","../../../node_modules/d3-svg-legend/indexRollupNext.js","../src/Legend.ts","../src/Modal.ts","../src/ChartPanel.ts","../src/FlexGrid.ts","../../../node_modules/grid-list/src/gridList.js","../src/Grid.ts","../src/HorizontalList.ts","../src/Layered.ts","../src/Popup.ts","../src/Tabbed.ts","../src/Toolbar.ts","../src/VerticalList.ts"],"sourcesContent":["export const PKG_NAME = \"@hpcc-js/layout\";\nexport const PKG_VERSION = \"3.1.1\";\nexport const BUILD_VERSION = \"3.2.1\";\n","import { HTMLWidget } from \"@hpcc-js/common\";\n\nimport \"../src/AbsoluteSurface.css\";\n\nexport class AbsoluteSurface extends HTMLWidget {\n constructor() {\n super();\n\n this._tag = \"div\";\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n\n let xPos = 0;\n let yPos = 0;\n let width = this.clientWidth();\n let height = this.clientHeight();\n switch (this.units()) {\n case \"pixels\":\n xPos = this.widgetX();\n yPos = this.widgetY();\n width = this.widgetWidth() === \"\" ? width - xPos : Number(this.widgetWidth());\n height = this.widgetHeight() === \"\" ? height - yPos : Number(this.widgetHeight());\n break;\n case \"percent\":\n xPos = this.widgetX() * width / 100;\n yPos = this.widgetY() * height / 100;\n width = this.widgetWidth() === \"\" ? width - xPos : Number(this.widgetWidth()) * width / 100;\n height = this.widgetHeight() === \"\" ? height - yPos : Number(this.widgetHeight()) * height / 100;\n break;\n }\n element.style(\"opacity\", this.opacity());\n\n const widgets = element.selectAll(\"#\" + this._id + \" > .placeholder\").data(this.widget() ? [this.widget()] : [], function (d) { return d._id; });\n widgets.enter().append(\"div\")\n .attr(\"class\", \"placeholder\")\n .each(function (d) {\n d.target(this);\n })\n .merge(widgets)\n .style(\"left\", xPos + \"px\")\n .style(\"top\", yPos + \"px\")\n .style(\"width\", width + \"px\")\n .style(\"bottom\", height + \"px\")\n .each(function (d) {\n d\n .resize({ width, height })\n ;\n })\n ;\n widgets.exit().each(function (d) {\n d.target(null);\n }).remove();\n }\n\n exit(domNode, element) {\n if (this.widget()) {\n this.widget().target(null);\n }\n super.exit(domNode, element);\n }\n}\nAbsoluteSurface.prototype._class += \" layout_AbsoluteSurface\";\n\nexport interface AbsoluteSurface {\n units(): string;\n units(_: string): this;\n widgetX(): number;\n widgetX(_: number): this;\n widgetY(): number;\n widgetY(_: number): this;\n widgetWidth(): string;\n widgetWidth(_: string): this;\n widgetHeight(): string;\n widgetHeight(_: string): this;\n widget(): any;\n widget(_: any): this;\n opacity(): number;\n opacity(_: number): this;\n}\n\nAbsoluteSurface.prototype.publish(\"units\", \"percent\", \"set\", \"Units\", [\"pixels\", \"percent\"]);\nAbsoluteSurface.prototype.publish(\"widgetX\", 0, \"number\", \"Widget XPos\");\nAbsoluteSurface.prototype.publish(\"widgetY\", 0, \"number\", \"Widget YPos\");\nAbsoluteSurface.prototype.publish(\"widgetWidth\", \"100\", \"string\", \"Widget Width, omit for full\");\nAbsoluteSurface.prototype.publish(\"widgetHeight\", \"100\", \"string\", \"Widget Height, omit for full\");\nAbsoluteSurface.prototype.publish(\"widget\", null, \"widget\", \"Widget\", null, { tags: [\"Private\"] });\nAbsoluteSurface.prototype.publish(\"opacity\", 1, \"number\", \"Opacity\");\n","import { FAChar, HTMLWidget } from \"@hpcc-js/common\";\n\nimport \"../src/Accordion.css\";\n\nexport class Accordion extends HTMLWidget {\n protected _isClosed: boolean;\n titleSpan;\n iconDiv;\n ul;\n icon;\n\n constructor() {\n super();\n\n this._tag = \"div\";\n this._isClosed = false;\n }\n\n pushListItem(widget, prepend: boolean = false, protect: boolean = false) {\n const contentArr = this.content();\n\n widget._protected = protect;\n\n if (prepend) {\n contentArr.unshift(widget);\n } else {\n contentArr.push(widget);\n }\n this.content(contentArr);\n return this;\n }\n\n clearListItems() {\n const arr = [];\n for (const i in this.content()) {\n if (this.content()[i]._protected) {\n arr.push(this.content()[i]);\n }\n }\n this.content(arr);\n return this;\n }\n\n collapseClick(element) {\n if (element.classed(\"closed\")) {\n this._isClosed = false;\n element.classed(\"open\", true);\n element.classed(\"closed\", false);\n } else {\n this._isClosed = true;\n element.classed(\"open\", false);\n element.classed(\"closed\", true);\n }\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n const context = this;\n this._isClosed = this.defaultCollapsed();\n element.classed(this._isClosed ? \"closed\" : \"open\", true);\n\n this.titleSpan = element.append(\"span\").classed(\"collapsible-title\", true);\n this.iconDiv = element.append(\"div\").classed(\"collapsible-icon\", true);\n this.ul = element.append(\"ul\");\n\n this.icon = new FAChar()\n .size({ height: 24, width: 24 })\n .target(this.iconDiv.node());\n\n this.iconDiv.on(\"click\", function () {\n context.collapseClick(element);\n context.render();\n });\n this.titleSpan.on(\"click\", function () {\n context.collapseClick(element);\n context.render();\n });\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n const context = this;\n const this_id = \"\";\n this.titleSpan.text(context.title().length > 0 ? context.title() + this_id : \"Accordion [\" + context._id + \"]\" + this_id);\n const rows = this.ul.selectAll(\"#\" + context._id + \" > ul > li\").data(this.content(), function (d) {\n return d._id;\n });\n rows.enter()\n .append(function (widget) {\n const li = document.createElement(\"li\");\n if (widget._target === null) {\n const wSize = widget.size();\n if (wSize.width === 0 || wSize.height === 0) {\n const cSize = context.size();\n widget.size({\n width: cSize.width,\n height: cSize.width\n });\n }\n widget.target(li);\n } else {\n return widget._target;\n }\n return li;\n })\n ;\n rows.exit().remove();\n\n this.icon\n .text_colorFill(this.titleFontColor())\n .char(this._isClosed ? this.closedIcon() : this.openIcon()).render()\n ;\n }\n\n exit(domNode, element) {\n super.exit(domNode, element);\n }\n}\nAccordion.prototype._class += \" layout_Accordion\";\n\nexport interface Accordion {\n content(): any[];\n content(_: any[]): this;\n title(): string;\n title(_: string): this;\n openIcon(): string;\n openIcon(_: string): this;\n closedIcon(): string;\n closedIcon(_: string): this;\n titleFontColor(): string;\n titleFontColor(_: string): this;\n titleBackgroundColor(): string;\n titleBackgroundColor(_: string): this;\n\n defaultCollapsed(): boolean;\n defaultCollapsed(_: boolean): this;\n}\n\nAccordion.prototype.publish(\"content\", [], \"widgetArray\", \"Array of widgets\", null, { tags: [\"Basic\"] });\nAccordion.prototype.publish(\"title\", \"\", \"string\", \"Title of collapsible section\", null, { tags: [\"Private\"] });\nAccordion.prototype.publish(\"openIcon\", \"\\uf147\", \"string\", \"Icon to display when list is open\", null, { tags: [\"Private\"] });\nAccordion.prototype.publish(\"closedIcon\", \"\\uf196\", \"string\", \"Icon to display when list is closed\", null, { tags: [\"Private\"] });\nAccordion.prototype.publish(\"titleFontColor\", \"#FFFFFF\", \"html-color\", \"Title font color\", null, { tags: [\"Private\"] });\nAccordion.prototype.publish(\"titleBackgroundColor\", \"#333333\", \"html-color\", \"Title background color\", null, { tags: [\"Private\"] });\n\nAccordion.prototype.publish(\"defaultCollapsed\", false, \"boolean\", \"Collapsed by default if true\", null, { tags: [\"Private\"] });\n","import { HTMLWidget, Widget } from \"@hpcc-js/common\";\nimport { select as d3Select } from \"d3-selection\";\n\nimport \"../src/Surface.css\";\n\nexport class Surface extends HTMLWidget {\n _surfaceButtons;\n\n constructor() {\n super();\n\n this._tag = \"div\";\n this._surfaceButtons = [];\n }\n\n widgetSize(titleDiv, widgetDiv) {\n let width = this.clientWidth();\n let height = this.clientHeight();\n if (this.title()) {\n height -= this.calcHeight(titleDiv);\n }\n height -= this.calcFrameHeight(widgetDiv);\n width -= this.calcFrameWidth(widgetDiv);\n return { width, height };\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n }\n\n update(domNode, element2) {\n super.update(domNode, element2);\n const context = this;\n\n element2\n .classed(\"shadow2\", this.surfaceShadow())\n .style(\"border-width\", this.surfaceBorderWidth_exists() ? this.surfaceBorderWidth() + \"px\" : null)\n .style(\"border-color\", this.surfaceBorderColor())\n .style(\"border-radius\", this.surfaceBorderRadius_exists() ? this.surfaceBorderRadius() + \"px\" : null)\n .style(\"background-color\", this.surfaceBackgroundColor())\n ;\n\n const titles = element2.selectAll(\".surfaceTitle\").data(this.title() ? [this.title()] : []);\n titles.enter().insert(\"h3\", \"div\")\n .attr(\"class\", \"surfaceTitle\")\n .merge(titles)\n .text(function (d) { return d; })\n .style(\"text-align\", this.surfaceTitleAlignment())\n .style(\"color\", this.surfaceTitleFontColor())\n .style(\"font-size\", this.surfaceTitleFontSize_exists() ? this.surfaceTitleFontSize() + \"px\" : null)\n .style(\"font-family\", this.surfaceTitleFontFamily())\n .style(\"font-weight\", this.surfaceTitleFontBold() ? \"bold\" : \"normal\")\n .style(\"background-color\", this.surfaceTitleBackgroundColor())\n .style(\"padding\", this.surfaceTitlePadding_exists() ? this.surfaceTitlePadding() + \"px\" : null)\n .style(\"title\", this.altText_exists() ? this.altText() : null)\n ;\n titles.exit().remove();\n\n const surfaceTitle = element2.select(\".surfaceTitle\");\n\n const surfaceButtons = surfaceTitle.append(\"div\").attr(\"class\", \"html-button-container\").selectAll(\".surface-button\").data(this.buttonAnnotations());\n surfaceButtons.enter().append(\"button\").classed(\"surface-button\", true)\n .each(function (button, idx) {\n const el = context._surfaceButtons[idx] = d3Select(this)\n .attr(\"class\", \"surface-button\" + (button.class ? \" \" + button.class : \"\"))\n .attr(\"id\", button.id)\n .style(\"padding\", button.padding)\n .style(\"width\", button.width)\n .style(\"height\", button.height)\n .style(\"cursor\", \"pointer\");\n if (button.font === \"FontAwesome\") {\n el\n .style(\"background\", \"transparent\")\n .style(\"border\", \"none\")\n .on(\"click\", function (d) { context.click(d); })\n .append(\"i\")\n .attr(\"class\", \"fa\")\n .text(function () { return button.label; });\n } else {\n el\n .text(function () { return button.label; })\n .on(\"click\", function (d) { context.click(d); });\n }\n })\n ;\n surfaceButtons.exit()\n .each(function (_d, idx) {\n const element = d3Select(this);\n delete context._surfaceButtons[idx];\n element.remove();\n })\n ;\n const widgets = element2.selectAll(\"#\" + this._id + \" > .surfaceWidget\").data(this.widget() ? [this.widget()] : [], function (d) { return d._id; });\n\n widgets.enter().append(\"div\")\n .attr(\"class\", \"surfaceWidget\")\n .each(function (d) {\n d3Select(context.element().node().parentElement).classed(\"content-icon content-icon-\" + (d.classID().split(\"_\")[1]), true);\n d.target(this);\n })\n .merge(widgets)\n .style(\"padding\", this.surfacePadding_exists() ? this.surfacePadding() + \"px\" : null)\n .each(function (d) {\n const widgetSize = context.widgetSize(element2.select(\"h3\"), d3Select(this));\n if (widgetSize.width < 0) widgetSize.width = 0;\n if (widgetSize.height < 0) widgetSize.height = 0;\n d\n .resize({ width: widgetSize.width, height: widgetSize.height })\n ;\n })\n ;\n widgets.exit().each(function (d) {\n d.target(null);\n }).remove();\n }\n\n exit(domNode, element) {\n if (this.widget()) {\n this.widget().target(null);\n }\n super.exit(domNode, element);\n }\n\n // Events ---\n click(obj) {\n }\n}\nSurface.prototype._class += \" layout_Surface\";\n\nexport interface Surface {\n /* \n title: { (): string; (_: string): Surface; };\n altText: { (): string; (_: string): Surface; };\n altText_exists: () => boolean;\n surfaceTitlePadding: { (): number; (_: number): Surface; };\n surfaceTitlePadding_exists: () => boolean;\n surfaceTitleFontSize: { (): number; (_: number): Surface; };\n surfaceTitleFontSize_exists: () => boolean;\n surfaceTitleFontColor: { (): string; (_: string): Surface; };\n surfaceTitleFontFamily: { (): string; (_: string): Surface; };\n surfaceTitleFontBold: { (): boolean; (_: boolean): Surface; };\n surfaceTitleBackgroundColor: { (): string; (_: string): Surface; };\n surfaceTitleAlignment: { (): string; (_: string): Surface; };\n\n surfaceShadow: { (): boolean; (_: boolean): Surface; };\n surfacePadding: { (): string; (_: string): Surface; };\n surfacePadding_exists: () => boolean;\n surfaceBackgroundColor: { (): string; (_: string): Surface; };\n surfaceBorderWidth: { (): number; (_: number): Surface; };\n surfaceBorderWidth_exists: () => boolean;\n surfaceBorderColor: { (): string; (_: string): Surface; };\n surfaceBorderRadius: { (): number; (_: number): Surface; };\n surfaceBorderRadius_exists: () => boolean;\n\n buttonAnnotations: { (): any[]; (_: any[]): Surface; };\n\n widget: { (): Widget; (_: Widget): Surface; };\n */\n title(): string;\n title(_: string): this;\n altText(): string;\n altText(_: string): this;\n altText_exists(): boolean;\n surfaceTitlePadding(): number;\n surfaceTitlePadding(_: number): this;\n surfaceTitlePadding_exists(): boolean;\n surfaceTitleFontSize(): number;\n surfaceTitleFontSize(_: number): this;\n surfaceTitleFontSize_exists(): boolean;\n surfaceTitleFontColor(): string;\n surfaceTitleFontColor(_: string): this;\n surfaceTitleFontFamily(): string;\n surfaceTitleFontFamily(_: string): this;\n surfaceTitleFontBold(): boolean;\n surfaceTitleFontBold(_: boolean): this;\n surfaceTitleBackgroundColor(): string;\n surfaceTitleBackgroundColor(_: string): this;\n surfaceTitleAlignment(): string;\n surfaceTitleAlignment(_: string): this;\n\n surfaceShadow(): boolean;\n surfaceShadow(_: boolean): this;\n surfacePadding(): string;\n surfacePadding(_: string): this;\n surfacePadding_exists(): boolean;\n surfaceBackgroundColor(): string;\n surfaceBackgroundColor(_: string): this;\n surfaceBorderWidth(): number;\n surfaceBorderWidth(_: number): this;\n surfaceBorderWidth_exists(): boolean;\n surfaceBorderColor(): string;\n surfaceBorderColor(_: string): this;\n surfaceBorderRadius(): number;\n surfaceBorderRadius(_: number): this;\n surfaceBorderRadius_exists(): boolean;\n\n buttonAnnotations(): any[];\n buttonAnnotations(_: any[]): this;\n\n widget(): Widget;\n widget(_: Widget): this;\n}\n\nSurface.prototype.publish(\"title\", \"\", \"string\", \"Title\", null, { tags: [\"Intermediate\"] });\nSurface.prototype.publish(\"altText\", null, \"string\", \"Alt text\", null, { optional: true });\nSurface.prototype.publish(\"surfaceTitlePadding\", null, \"number\", \"Title Padding (px)\", null, { tags: [\"Advanced\"], disable: (w: any) => !w.title() });\nSurface.prototype.publish(\"surfaceTitleFontSize\", null, \"number\", \"Title Font Size (px)\", null, { tags: [\"Advanced\"], disable: (w: any) => !w.title() });\nSurface.prototype.publish(\"surfaceTitleFontColor\", null, \"html-color\", \"Title Font Color\", null, { tags: [\"Advanced\"], disable: (w: any) => !w.title() });\nSurface.prototype.publish(\"surfaceTitleFontFamily\", null, \"string\", \"Title Font Family\", null, { tags: [\"Advanced\"], disable: (w: any) => !w.title() });\nSurface.prototype.publish(\"surfaceTitleFontBold\", true, \"boolean\", \"Enable Bold Title Font\", null, { tags: [\"Advanced\"], disable: (w: any) => !w.title() });\nSurface.prototype.publish(\"surfaceTitleBackgroundColor\", null, \"html-color\", \"Title Background Color\", null, { tags: [\"Advanced\"], disable: (w: any) => !w.title() });\nSurface.prototype.publish(\"surfaceTitleAlignment\", \"center\", \"set\", \"Title Alignment\", [\"left\", \"right\", \"center\"], { tags: [\"Basic\"], disable: (w: any) => !w.title() });\n\nSurface.prototype.publish(\"surfaceShadow\", false, \"boolean\", \"3D Shadow\");\nSurface.prototype.publish(\"surfacePadding\", null, \"string\", \"Surface Padding (px)\", null, { tags: [\"Intermediate\"] });\nSurface.prototype.publish(\"surfaceBackgroundColor\", null, \"html-color\", \"Surface Background Color\", null, { tags: [\"Advanced\"] });\nSurface.prototype.publish(\"surfaceBorderWidth\", null, \"number\", \"Surface Border Width (px)\", null, { tags: [\"Advanced\"] });\nSurface.prototype.publish(\"surfaceBorderColor\", null, \"html-color\", \"Surface Border Color\", null, { tags: [\"Advanced\"] });\nSurface.prototype.publish(\"surfaceBorderRadius\", null, \"number\", \"Surface Border Radius (px)\", null, { tags: [\"Advanced\"] });\n\nSurface.prototype.publish(\"buttonAnnotations\", [], \"array\", \"Button Array\", null, { tags: [\"Private\"] });\n\nSurface.prototype.publish(\"widget\", null, \"widget\", \"Widget\", null, { tags: [\"Basic\"] });\n","import { Widget } from \"@hpcc-js/common\";\nimport { select as d3Select, selectAll as d3SelectAll } from \"d3-selection\";\nimport { Surface } from \"./Surface.ts\";\n\nimport \"../src/Cell.css\";\n\nexport class Cell extends Surface {\n _indicateTheseIds;\n\n constructor() {\n super();\n this._indicateTheseIds = [];\n }\n\n indicateTheseIds(): any[];\n indicateTheseIds(_: any[]): Cell;\n indicateTheseIds(_?: any[]): any[] | Cell {\n if (!arguments.length) return this._indicateTheseIds;\n this._indicateTheseIds = _;\n return this;\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n const context = this;\n element\n .classed(\"layout_Surface\", true)\n .on(\"mouseenter\", function () { context.onMouseEnter(); })\n .on(\"mouseleave\", function () { context.onMouseLeave(); })\n ;\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n }\n\n onMouseEnter() {\n const arr = this.indicateTheseIds();\n const opacity = this.indicatorOpacity();\n const indicatorBorderColor = this.indicatorBorderColor();\n const indicatorGlowColor = this.indicatorGlowColor();\n for (let i = 0; i < arr.length; i++) {\n const otherElement = d3Select(\"#\" + arr[i]);\n const otherWidget: Widget = otherElement.datum() as Widget;\n if (otherElement && otherWidget) {\n otherElement.append(\"div\")\n .attr(\"class\", \"update-indicator\")\n .style(\"width\", otherWidget.width() + \"px\")\n .style(\"height\", otherWidget.height() + \"px\")\n .style(\"opacity\", opacity)\n .style(\"border-color\", indicatorBorderColor)\n .style(\"-webkit-box-shadow\", \"inset 0px 0px 30px 0px \" + indicatorGlowColor)\n .style(\"-moz-box-shadow\", \"inset 0px 0px 30px 0px \" + indicatorGlowColor)\n .style(\"box-shadow\", \"inset 0px 0px 30px 0px \" + indicatorGlowColor)\n ;\n }\n }\n }\n\n onMouseLeave() {\n const arr = this.indicateTheseIds();\n for (let i = 0; i < arr.length; i++) {\n d3SelectAll(\"#\" + arr[i] + \" > div.update-indicator\").remove();\n }\n }\n}\nCell.prototype._class += \" layout_Cell\";\n\nexport interface Cell {\n gridRow(): number;\n gridRow(_: number): this;\n gridCol(): number;\n gridCol(_: number): this;\n gridRowSpan(): number;\n gridRowSpan(_: number): this;\n gridColSpan(): number;\n gridColSpan(_: number): this;\n\n indicatorGlowColor(): string;\n indicatorGlowColor(_: string): this;\n indicatorBorderColor(): string;\n indicatorBorderColor(_: string): this;\n indicatorOpacity(): number;\n indicatorOpacity(_: number): this;\n}\n\nCell.prototype.publish(\"gridRow\", 0, \"number\", \"Grid Row Position\", null, { tags: [\"Private\"] });\nCell.prototype.publish(\"gridCol\", 0, \"number\", \"Grid Column Position\", null, { tags: [\"Private\"] });\nCell.prototype.publish(\"gridRowSpan\", 1, \"number\", \"Grid Row Span\", null, { tags: [\"Private\"] });\nCell.prototype.publish(\"gridColSpan\", 1, \"number\", \"Grid Column Span\", null, { tags: [\"Private\"] });\n\nCell.prototype.publish(\"indicatorGlowColor\", \"#EEEE11\", \"html-color\", \"Glow color of update-indicator\", null, { tags: [\"Basic\"] });\nCell.prototype.publish(\"indicatorBorderColor\", \"#F48A00\", \"html-color\", \"Border color of update-indicator\", null, { tags: [\"Basic\"] });\nCell.prototype.publish(\"indicatorOpacity\", 0.8, \"number\", \"Opacity of update-indicator\", null, { tags: [\"Basic\"] });\n","import { d3Event, HTMLWidget, Platform, select as d3Select, selectAll as d3SelectAll, Utility } from \"@hpcc-js/common\";\nimport { drag as d3Drag } from \"d3-drag\";\nimport { Cell } from \"./Cell.ts\";\n\nimport \"../src/Border.css\";\n\nexport class Border extends HTMLWidget {\n _colCount: number;\n _rowCount: number;\n _colSize: number;\n _rowSize: number;\n _shrinkWrapBoxes;\n _watch;\n _offsetX;\n _offsetY;\n _dragCell;\n _dragCellSize;\n _dragCellStartSize;\n _handleTop;\n _handleLeft;\n _dragPrevX;\n _dragPrevY;\n _cellSizes;\n contentDiv;\n _scrollBarWidth;\n _borderHandles;\n _sectionTypeArr;\n\n constructor() {\n super();\n\n this._tag = \"div\";\n\n this._colCount = 0;\n this._rowCount = 0;\n this._colSize = 0;\n this._rowSize = 0;\n\n this._shrinkWrapBoxes = {};\n\n this.content([]);\n this.sectionTypes([]);\n }\n\n watchWidget(widget) {\n if (this._watch === undefined) {\n this._watch = {};\n }\n if (this._watch[widget.id()]) {\n this._watch[widget.id()].remove();\n delete this._watch[widget.id()];\n }\n if (widget) {\n const context = this;\n this._watch[widget.id()] = widget.monitor(function (paramId, newVal, oldVal) {\n if (oldVal !== newVal) {\n context.lazyPostUpdate();\n }\n });\n }\n }\n\n lazyPostUpdate = Utility.debounce(function () {\n this.postUpdate();\n }, 100);\n\n applyLayoutType() {\n const layoutObj = this.borderLayoutObject();\n this.content().forEach(function (cell, i) {\n cell._fixedLeft = layoutObj[this.sectionTypes()[i]].left;\n cell._fixedTop = layoutObj[this.sectionTypes()[i]].top;\n cell._fixedWidth = layoutObj[this.sectionTypes()[i]].width;\n cell._fixedHeight = layoutObj[this.sectionTypes()[i]].height;\n cell._dragHandles = this.cellSpecificDragHandles(this.sectionTypes()[i]);\n }, this);\n }\n cellSpecificDragHandles(sectionType) {\n switch (sectionType) {\n case \"top\": return [\"s\"];\n case \"right\": return [\"w\"];\n case \"bottom\": return [\"n\"];\n case \"left\": return [\"e\"];\n case \"center\": return [];\n }\n }\n\n borderLayoutObject(layoutType?) {\n const retObj = {};\n const context = this;\n let topSize;\n let topPerc;\n let bottomSize;\n let bottomPerc;\n let leftSize;\n let leftPerc;\n let rightSize;\n let rightPerc;\n\n const bcRect = this.target().getBoundingClientRect();\n const gridRect: any = {};\n gridRect.top = bcRect.top;\n gridRect.left = bcRect.left;\n gridRect.bottom = bcRect.bottom;\n gridRect.right = bcRect.right;\n if (this.target() instanceof SVGElement) {\n gridRect.width = parseFloat(this.target().getAttribute(\"width\"));\n gridRect.height = parseFloat(this.target().getAttribute(\"height\"));\n } else {\n gridRect.width = bcRect.width;\n gridRect.height = bcRect.height;\n }\n if (this.sectionTypes().indexOf(\"top\") !== -1) {\n topSize = this.topSize();\n topPerc = this.topPercentage();\n if (typeof (this._shrinkWrapBoxes[\"top\"]) !== \"undefined\") {\n topSize = this._shrinkWrapBoxes[\"top\"].height + this.gutter();\n topPerc = 0;\n }\n }\n if (this.sectionTypes().indexOf(\"bottom\") !== -1) {\n bottomSize = this.bottomSize();\n bottomPerc = this.bottomPercentage();\n if (typeof (this._shrinkWrapBoxes[\"bottom\"]) !== \"undefined\") {\n bottomSize = this._shrinkWrapBoxes[\"bottom\"].height + this.gutter();\n bottomPerc = 0;\n }\n }\n if (this.sectionTypes().indexOf(\"left\") !== -1) {\n leftSize = this.leftSize();\n leftPerc = this.leftPercentage();\n if (typeof (this._shrinkWrapBoxes[\"left\"]) !== \"undefined\") {\n leftSize = this._shrinkWrapBoxes[\"left\"].width + this.gutter();\n leftPerc = 0;\n }\n }\n if (this.sectionTypes().indexOf(\"right\") !== -1) {\n rightSize = this.rightSize();\n rightPerc = this.rightPercentage();\n if (typeof (this._shrinkWrapBoxes[\"right\"]) !== \"undefined\") {\n rightSize = this._shrinkWrapBoxes[\"right\"].width + this.gutter();\n rightPerc = 0;\n }\n }\n\n const t = _sectionPlacementObject({\n width: { \"px\": 0, \"%\": 100 },\n height: { \"px\": topSize, \"%\": topPerc },\n top: { \"px\": 0, \"%\": 0 },\n left: { \"px\": 0, \"%\": 0 }\n });\n const b = _sectionPlacementObject({\n width: { \"px\": 0, \"%\": 100 },\n height: { \"px\": bottomSize, \"%\": bottomPerc },\n top: { \"px\": 0, \"%\": 100 },\n left: { \"px\": 0, \"%\": 0 }\n });\n b.top -= b.height;\n const l = _sectionPlacementObject({\n width: { \"px\": leftSize, \"%\": leftPerc },\n height: { \"px\": -t.height - b.height, \"%\": 100 },\n top: { \"px\": t.height, \"%\": 0 },\n left: { \"px\": 0, \"%\": 0 }\n });\n const r = _sectionPlacementObject({\n width: { \"px\": rightSize, \"%\": rightPerc },\n height: { \"px\": -t.height - b.height, \"%\": 100 },\n top: { \"px\": t.height, \"%\": 0 },\n left: { \"px\": 0, \"%\": 100 }\n });\n r.left -= r.width;\n const c = _sectionPlacementObject({\n width: { \"px\": -r.width - l.width, \"%\": 100 },\n height: { \"px\": -t.height - b.height, \"%\": 100 },\n top: { \"px\": t.height, \"%\": 0 },\n left: { \"px\": l.width, \"%\": 0 }\n });\n retObj[\"top\"] = t;\n retObj[\"bottom\"] = b;\n retObj[\"right\"] = r;\n retObj[\"left\"] = l;\n retObj[\"center\"] = c;\n return retObj;\n\n function _sectionPlacementObject(obj) {\n obj.width[\"px\"] = typeof (obj.width[\"px\"]) !== \"undefined\" ? obj.width[\"px\"] : 0;\n obj.width[\"%\"] = typeof (obj.width[\"%\"]) !== \"undefined\" ? obj.width[\"%\"] : 0;\n obj.height[\"px\"] = typeof (obj.height[\"px\"]) !== \"undefined\" ? obj.height[\"px\"] : 0;\n obj.height[\"%\"] = typeof (obj.height[\"%\"]) !== \"undefined\" ? obj.height[\"%\"] : 0;\n const ret = {\n width: obj.width[\"px\"] + (obj.width[\"%\"] / 100 * context.width()),\n height: obj.height[\"px\"] + (obj.height[\"%\"] / 100 * context.height()),\n top: obj.top[\"px\"] + (obj.top[\"%\"] / 100 * context.height()) + context.gutter() / 2,\n left: obj.left[\"px\"] + (obj.left[\"%\"] / 100 * context.width()) + context.gutter() / 2\n };\n return ret;\n }\n }\n\n clearContent(sectionType) {\n if (!sectionType) {\n this.content().forEach(function (contentWidget) {\n contentWidget.target(null);\n return false;\n });\n d3Select(\"#\" + this.id() + \" > div.borderHandle\")\n .classed(\"borderHandleDisabled\", true)\n ;\n delete this._watch;\n this.content([]);\n this.sectionTypes([]);\n } else {\n const idx = this.sectionTypes().indexOf(sectionType);\n if (idx >= 0) {\n if (this._watch && this.content()[idx]) {\n delete this._watch[this.content()[idx].id()];\n }\n this.content()[idx].target(null);\n d3Select(\"#\" + this.id() + \" > div.borderHandle_\" + sectionType)\n .classed(\"borderHandleDisabled\", true)\n ;\n this.content().splice(idx, 1);\n this.sectionTypes().splice(idx, 1);\n }\n }\n }\n\n hasContent(sectionType, widget, title) {\n return this.sectionTypes().indexOf(sectionType) >= 0;\n }\n\n setContent(sectionType, widget, title?) {\n this.clearContent(sectionType);\n title = typeof (title) !== \"undefined\" ? title : \"\";\n if (widget) {\n const cell = new Cell()\n .surfaceBorderWidth(0)\n .widget(widget)\n .title(title)\n ;\n this.watchWidget(widget);\n this.content().push(cell);\n this.sectionTypes().push(sectionType);\n }\n return this;\n }\n\n getCell(id) {\n const idx = this.sectionTypes().indexOf(id);\n if (idx >= 0) {\n return this.content()[idx];\n }\n return null;\n }\n\n getContent(id) {\n const idx = this.sectionTypes().indexOf(id);\n if (idx >= 0) {\n return this.content()[idx].widget();\n }\n return null;\n }\n\n setLayoutOffsets() {\n this._offsetX = this._element.node().getBoundingClientRect().left + (this.gutter() / 2);\n this._offsetY = this._element.node().getBoundingClientRect().top + (this.gutter() / 2);\n }\n\n dragStart(handle) {\n const event = d3Event();\n event.sourceEvent.stopPropagation();\n const context = this;\n\n this._dragCell = handle;\n this._dragCellStartSize = this[handle + \"Size\"]();\n\n if (this[handle + \"ShrinkWrap\"]()) {\n this[handle + \"Percentage\"](0);\n this[handle + \"ShrinkWrap\"](false);\n }\n\n const handleElm = d3Select(\"#\" + context.id() + \" > div.borderHandle_\" + handle);\n context._handleTop = parseFloat(handleElm.style(\"top\").split(\"px\")[0]);\n context._handleLeft = parseFloat(handleElm.style(\"left\").split(\"px\")[0]);\n\n this._dragPrevX = event.sourceEvent.clientX;\n this._dragPrevY = event.sourceEvent.clientY;\n }\n dragTick(handle) {\n const context = this;\n\n const event = d3Event();\n const xDelta = this._dragPrevX - event.sourceEvent.clientX;\n const yDelta = this._dragPrevY - event.sourceEvent.clientY;\n\n switch (handle) {\n case \"top\":\n case \"bottom\":\n _moveHandles(handle, yDelta);\n break;\n case \"right\":\n case \"left\":\n _moveHandles(handle, xDelta);\n break;\n }\n\n function _moveHandles(handle2, delta) {\n if (delta === 0) return;\n const handles = d3SelectAll(\"#\" + context.id() + \" > div.borderHandle\");\n const grabbedHandle = d3Select(\"#\" + context.id() + \" > div.borderHandle_\" + handle2);\n\n if (grabbedHandle.classed(\"borderHandle_top\")) {\n grabbedHandle.style(\"top\", (context._handleTop - delta) + \"px\");\n context._cellSizes.topHeight = context._handleTop - delta;\n context._cellSizes.leftHeight = context._cellSizes.height;\n context._cellSizes.leftHeight -= context._cellSizes.topHeight;\n context._cellSizes.leftHeight -= context._cellSizes.bottomHeight;\n context._cellSizes.rightHeight = context._cellSizes.leftHeight;\n } else if (grabbedHandle.classed(\"borderHandle_right\")) {\n grabbedHandle.style(\"left\", (context._handleLeft - delta) + \"px\");\n context._cellSizes.rightWidth = context._cellSizes.width - context._handleLeft + delta;\n } else if (grabbedHandle.classed(\"borderHandle_bottom\")) {\n grabbedHandle.style(\"top\", (context._handleTop - delta) + \"px\");\n context._cellSizes.bottomHeight = context._cellSizes.height - context._handleTop + delta;\n context._cellSizes.leftHeight = context._cellSizes.height;\n context._cellSizes.leftHeight -= context._cellSizes.bottomHeight;\n context._cellSizes.leftHeight -= context._cellSizes.topHeight;\n context._cellSizes.rightHeight = context._cellSizes.leftHeight;\n } else if (grabbedHandle.classed(\"borderHandle_left\")) {\n grabbedHandle.style(\"left\", (context._handleLeft - delta) + \"px\");\n context._cellSizes.leftWidth = context._handleLeft - delta;\n }\n\n handles.each(function () {\n const handle3 = d3Select(this);\n if (handle3.classed(\"borderHandle_top\")) {\n handle3.style(\"width\", context._cellSizes.width + \"px\");\n handle3.style(\"top\", (context._cellSizes.topHeight - 3) + \"px\");\n } else if (handle3.classed(\"borderHandle_right\")) {\n handle3.style(\"left\", (context._cellSizes.width - context._cellSizes.rightWidth) + \"px\");\n handle3.style(\"top\", (context._cellSizes.topHeight + 3) + \"px\");\n handle3.style(\"height\", context._cellSizes.rightHeight + \"px\");\n } else if (handle3.classed(\"borderHandle_bottom\")) {\n handle3.style(\"width\", context._cellSizes.width + \"px\");\n handle3.style(\"top\", (context._cellSizes.height - context._cellSizes.bottomHeight - 3) + \"px\");\n } else if (handle3.classed(\"borderHandle_left\")) {\n handle3.style(\"left\", context._cellSizes.leftWidth + \"px\");\n handle3.style(\"height\", context._cellSizes.leftHeight + \"px\");\n handle3.style(\"top\", (context._cellSizes.topHeight + 3) + \"px\");\n }\n });\n }\n }\n dragEnd(handle) {\n if (handle) {\n const event = d3Event();\n const xDelta = this._dragPrevX - event.sourceEvent.clientX;\n const yDelta = this._dragPrevY - event.sourceEvent.clientY;\n\n switch (handle) {\n case \"top\":\n if (yDelta !== 0) {\n this.topPercentage(0);\n this.topSize(this.topSize() === 0 ? this.getContent(\"top\").getBBox().height - yDelta : this.topSize() - yDelta);\n }\n break;\n case \"right\":\n if (xDelta !== 0) {\n this.rightPercentage(0);\n this.rightSize(this.rightSize() === 0 ? this.getContent(\"right\").getBBox().width + xDelta : this.rightSize() + xDelta);\n }\n break;\n case \"bottom\":\n if (yDelta !== 0) {\n this.bottomPercentage(0);\n this.bottomSize(this.bottomSize() === 0 ? this.getContent(\"bottom\").getBBox().height + yDelta : this.bottomSize() + yDelta);\n }\n break;\n case \"left\":\n if (xDelta !== 0) {\n this.leftPercentage(0);\n this.leftSize(this.leftSize() === 0 ? this.getContent(\"left\").getBBox().width - xDelta : this.leftSize() - xDelta);\n }\n break;\n }\n\n this._dragPrevX = event.sourceEvent.clientX;\n this._dragPrevY = event.sourceEvent.clientY;\n }\n this.render();\n }\n\n size(_?) {\n const retVal = HTMLWidget.prototype.size.apply(this, arguments);\n if (arguments.length && this.contentDiv) {\n this.contentDiv\n .style(\"width\", this._size.width + \"px\")\n .style(\"height\", this._size.height + \"px\")\n ;\n }\n return retVal;\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n const context = this;\n element.style(\"position\", \"relative\");\n this.contentDiv = element.append(\"div\").classed(\"border-content\", true);\n this._scrollBarWidth = Platform.getScrollbarWidth();\n this._borderHandles = [\"top\", \"left\", \"right\", \"bottom\"];\n\n const handles = element.selectAll(\"div.borderHandle\").data(this._borderHandles);\n handles.enter().append(\"div\")\n .classed(\"borderHandle\", true)\n .each(function (handle) {\n const h = d3Select(this);\n h.classed(\"borderHandle_\" + handle, true)\n .classed(\"borderHandleDisabled\", context.getContent(handle) === null)\n ;\n });\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n this._sectionTypeArr = this.sectionTypes();\n const context = this;\n\n element.classed(\"design-mode\", this.designMode());\n\n this.setLayoutOffsets();\n\n const rows = this.contentDiv.selectAll(\".cell_\" + this._id).data(this.content(), function (d) { return d._id; });\n const rowsUpdate = rows.enter().append(\"div\")\n .classed(\"cell_\" + this._id, true)\n .style(\"position\", \"absolute\")\n .each(function (d, i) {\n d3Select(this).classed(\"border-cell border-cell-\" + context._sectionTypeArr[i], true);\n d.target(this);\n d3Select(\"#\" + context.id() + \" > div.borderHandle_\" + context._sectionTypeArr[i])\n .classed(\"borderHandleDisabled\", false);\n }).merge(rows);\n rowsUpdate\n .each(function (d, idx) {\n const sectionType = context.sectionTypes()[idx];\n if (typeof (context[sectionType + \"ShrinkWrap\"]) !== \"undefined\" && context[sectionType + \"ShrinkWrap\"]()) {\n d.render();\n context._shrinkWrapBoxes[sectionType] = d.widget().getBBox(true);\n } else {\n delete context._shrinkWrapBoxes[sectionType];\n }\n });\n\n const drag = d3Drag()\n .on(\"start\", function (d, i) { context.dragStart.call(context, d, i); })\n .on(\"drag\", function (d, i) { context.dragTick.call(context, d, i); })\n .on(\"end\", function (d, i) { context.dragEnd.call(context, d, i); })\n ;\n if (this.designMode()) {\n element.selectAll(\"#\" + this.id() + \" > div.borderHandle\").call(drag);\n } else {\n element.selectAll(\"#\" + this.id() + \" > div.borderHandle\").on(\".drag\", null);\n }\n\n const layoutObj = this.borderLayoutObject();\n this.content().forEach(function (cell, i) {\n cell._fixedLeft = layoutObj[this.sectionTypes()[i]].left;\n cell._fixedTop = layoutObj[this.sectionTypes()[i]].top;\n cell._fixedWidth = layoutObj[this.sectionTypes()[i]].width;\n cell._fixedHeight = layoutObj[this.sectionTypes()[i]].height;\n cell._dragHandles = [];\n }, this);\n\n rowsUpdate\n .style(\"left\", function (d) { return d._fixedLeft + \"px\"; })\n .style(\"top\", function (d) { return d._fixedTop + \"px\"; })\n .style(\"width\", function (d) { return d._fixedWidth - context.gutter() + \"px\"; })\n .style(\"height\", function (d) { return d._fixedHeight - context.gutter() + \"px\"; })\n .each(function (d) {\n d._placeholderElement\n .attr(\"draggable\", context.designMode())\n .selectAll(\".dragHandle\")\n .attr(\"draggable\", context.designMode())\n ;\n d\n .surfacePadding(context.surfacePadding())\n .resize()\n ;\n });\n rows.exit().each(function (d) {\n d.target(null);\n }).remove();\n\n this.getCellSizes();\n\n element\n .selectAll(\"#\" + this.id() + \" > div.borderHandle\")\n .each(function () {\n const handle = d3Select(this);\n if (handle.classed(\"borderHandle_top\")) {\n handle.style(\"width\", context._cellSizes.width + \"px\");\n handle.style(\"top\", (context._cellSizes.topHeight - 3) + \"px\");\n } else if (handle.classed(\"borderHandle_right\")) {\n handle.style(\"left\", (context._cellSizes.width - context._cellSizes.rightWidth) + \"px\");\n handle.style(\"top\", (context._cellSizes.topHeight + 3) + \"px\");\n handle.style(\"height\", context._cellSizes.rightHeight + \"px\");\n } else if (handle.classed(\"borderHandle_bottom\")) {\n handle.style(\"width\", context._cellSizes.width + \"px\");\n handle.style(\"top\", (context._cellSizes.height - context._cellSizes.bottomHeight - 3) + \"px\");\n } else if (handle.classed(\"borderHandle_left\")) {\n handle.style(\"left\", context._cellSizes.leftWidth + \"px\");\n handle.style(\"height\", context._cellSizes.leftHeight + \"px\");\n handle.style(\"top\", (context._cellSizes.topHeight + 3) + \"px\");\n }\n\n })\n ;\n }\n\n getCellSizes() {\n const context = this;\n context._cellSizes = {};\n const contentRect = this.element().node().getBoundingClientRect();\n context._cellSizes.width = contentRect.width;\n context._cellSizes.height = contentRect.height;\n this.element()\n .selectAll(\"#\" + this.id() + \" > div > div.border-cell\")\n .each(function () {\n const cell = d3Select(this);\n if (typeof cell.node === \"function\") {\n const rect = cell.node().getBoundingClientRect();\n if (cell.classed(\"border-cell-top\")) {\n context._cellSizes.topHeight = rect.height;\n } else if (cell.classed(\"border-cell-left\")) {\n context._cellSizes.leftWidth = rect.width;\n context._cellSizes.leftHeight = rect.height;\n } else if (cell.classed(\"border-cell-right\")) {\n context._cellSizes.rightWidth = rect.width;\n context._cellSizes.rightHeight = rect.height;\n } else if (cell.classed(\"border-cell-bottom\")) {\n context._cellSizes.bottomHeight = rect.height;\n }\n }\n });\n const sizes = [\"height\", \"width\", \"topHeight\", \"bottomHeight\", \"leftHeight\", \"rightHeight\", \"leftWidth\", \"rightWidth\"];\n sizes.forEach(function (size) {\n context._cellSizes[size] = context._cellSizes[size] === undefined ? 0 : context._cellSizes[size];\n });\n }\n\n postUpdate(domNode, element) {\n const context = this;\n this.content().forEach(function (n) {\n if (n._element.node() !== null && n.widget()) {\n const prevBox = n.widget().getBBox(false, true);\n const currBox = n.widget().getBBox(true, true);\n if (prevBox.width !== currBox.width || prevBox.height !== currBox.height) {\n context.lazyRender();\n }\n }\n });\n }\n\n exit(domNode, element) {\n this.content().forEach(w => w.target(null));\n super.exit(domNode, element);\n }\n}\nBorder.prototype._class += \" layout_Border\";\n\nexport interface Border {\n designMode(): boolean;\n designMode(_: boolean): this;\n\n content(): any[];\n content(_: any[]): this;\n\n gutter(): number;\n gutter(_: number): this;\n\n topShrinkWrap(): boolean;\n topShrinkWrap(_: boolean): this;\n leftShrinkWrap(): boolean;\n leftShrinkWrap(_: boolean): this;\n rightShrinkWrap(): boolean;\n rightShrinkWrap(_: boolean): this;\n bottomShrinkWrap(): boolean;\n bottomShrinkWrap(_: boolean): this;\n\n topSize(): number;\n topSize(_: number): this;\n leftSize(): number;\n leftSize(_: number): this;\n rightSize(): number;\n rightSize(_: number): this;\n bottomSize(): number;\n bottomSize(_: number): this;\n\n topPercentage(): number;\n topPercentage(_: number): this;\n leftPercentage(): number;\n leftPercentage(_: number): this;\n rightPercentage(): number;\n rightPercentage(_: number): this;\n bottomPercentage(): number;\n bottomPercentage(_: number): this;\n\n surfacePadding(): number;\n surfacePadding(_: number): this;\n\n sectionTypes(): any[];\n sectionTypes(_: any[]): this;\n}\n\nBorder.prototype.publish(\"designMode\", false, \"boolean\", \"Design Mode\", null, { tags: [\"Basic\"] });\n\nBorder.prototype.publish(\"content\", [], \"widgetArray\", \"widgets\", null, { tags: [\"Intermediate\"] });\n\nBorder.prototype.publish(\"gutter\", 0, \"number\", \"Gap Between Widgets\", null, { tags: [\"Basic\"] });\n\nBorder.prototype.publish(\"topShrinkWrap\", false, \"boolean\", \"'Top' Cell shrinks to fit content\", null, { tags: [\"Intermediate\"] });\nBorder.prototype.publish(\"leftShrinkWrap\", false, \"boolean\", \"'Left' Cell shrinks to fit content\", null, { tags: [\"Intermediate\"] });\nBorder.prototype.publish(\"rightShrinkWrap\", false, \"boolean\", \"'Right' Cell shrinks to fit content\", null, { tags: [\"Intermediate\"] });\nBorder.prototype.publish(\"bottomShrinkWrap\", false, \"boolean\", \"'Bottom' Cell shrinks to fit content\", null, { tags: [\"Intermediate\"] });\n\nBorder.prototype.publish(\"topSize\", 0, \"number\", \"Height of the 'Top' Cell (px)\", null, { tags: [\"Private\"] });\nBorder.prototype.publish(\"leftSize\", 0, \"number\", \"Width of the 'Left' Cell (px)\", null, { tags: [\"Private\"] });\nBorder.prototype.publish(\"rightSize\", 0, \"number\", \"Width of the 'Right' Cell (px)\", null, { tags: [\"Private\"] });\nBorder.prototype.publish(\"bottomSize\", 0, \"number\", \"Height of the 'Bottom' Cell (px)\", null, { tags: [\"Private\"] });\n\nBorder.prototype.publish(\"topPercentage\", 20, \"number\", \"Percentage (of parent) Height of the 'Top' Cell\", null, { tags: [\"Private\"] });\nBorder.prototype.publish(\"leftPercentage\", 20, \"number\", \"Percentage (of parent) Width of the 'Left' Cell\", null, { tags: [\"Private\"] });\nBorder.prototype.publish(\"rightPercentage\", 20, \"number\", \"Percentage (of parent) Width of the 'Right' Cell\", null, { tags: [\"Private\"] });\nBorder.prototype.publish(\"bottomPercentage\", 20, \"number\", \"Percentage (of parent) Height of the 'Bottom' Cell\", null, { tags: [\"Private\"] });\n\nBorder.prototype.publish(\"surfacePadding\", 0, \"number\", \"Cell Padding (px)\", null, { tags: [\"Intermediate\"] });\n\nBorder.prototype.publish(\"sectionTypes\", [], \"array\", \"Section Types sharing an index with 'content' - Used to determine position/size.\", null, { tags: [\"Private\"] });\n","import { BBox, HTMLWidget, Platform, Widget } from \"@hpcc-js/common\";\n\nimport \"../src/Border2.css\";\n\nexport type OverflowT = \"hidden\" | \"scroll\" | \"visible\" | \"auto\";\nexport type ChartPanelSectionT = \"top\" | \"right\" | \"bottom\" | \"left\" | \"center\";\nexport class WidgetDiv {\n private _div;\n private _overlay: boolean = false;\n private _overflowX: OverflowT = \"visible\";\n private _overflowY: OverflowT = \"visible\";\n private _widget: Widget;\n\n constructor(div) {\n this._div = div;\n }\n\n overlay(): boolean;\n overlay(_: boolean): this;\n overlay(_?: boolean): boolean | this {\n if (!arguments.length) return this._overlay;\n this._overlay = _;\n return this;\n }\n\n overflowX(): OverflowT;\n overflowX(_: OverflowT): this;\n overflowX(_?: OverflowT): OverflowT | this {\n if (!arguments.length) return this._overflowX;\n this._overflowX = _;\n this._div.style(\"overflow-x\", _);\n return this;\n }\n overflowY(): OverflowT;\n overflowY(_: OverflowT): this;\n overflowY(_?: OverflowT): OverflowT | this {\n if (!arguments.length) return this._overflowY;\n this._overflowY = _;\n this._div.style(\"overflow-y\", _);\n return this;\n }\n\n element() {\n return this._div;\n }\n\n node(): SVGElement | HTMLElement {\n return this._div.node();\n }\n\n widget(): Widget;\n widget(_: Widget): this;\n widget(_?: Widget): Widget | this {\n if (!arguments.length) return this._widget;\n if (this._widget !== _) {\n if (this._widget) {\n this._widget.target(null);\n }\n this._widget = _;\n if (this._widget) {\n this._widget.target(this._div.node());\n }\n }\n return this;\n }\n\n resize(size: { width: number, height: number }) {\n if (this._widget) {\n this._div\n .style(\"width\", `${size.width}px`)\n .style(\"height\", `${size.height}px`)\n ;\n this._widget.resize(size);\n }\n return this;\n }\n\n async render(getBBox?, availableHeight?: number, availableWidth?: number): Promise<BBox | undefined> {\n let overflowX = this.overflowX();\n if(!this.overlay() && overflowX === \"visible\") {\n overflowX = null;\n }\n let overflowY = this.overflowY();\n if(!this.overlay() && overflowY === \"visible\") {\n overflowY = null;\n }\n this._div\n .style(\"height\", this.overlay() ? \"0px\" : null)\n .style(\"overflow-x\", overflowX)\n .style(\"overflow-y\", overflowY)\n ;\n if (this._widget) {\n return this._widget.renderPromise().then(w => {\n if (getBBox && this._widget.visible()) {\n const retVal = this._widget.getBBox();\n retVal.width += 8;\n if (availableHeight !== undefined && retVal.height > availableHeight) {\n retVal.width += Platform.getScrollbarWidth();\n }\n if (availableWidth !== undefined && retVal.width > availableWidth) {\n retVal.height += Platform.getScrollbarWidth();\n }\n if (this.overlay()) {\n retVal.height = 0;\n } else {\n retVal.height += 4;\n }\n return retVal;\n }\n return getBBox ? { x: 0, y: 0, width: 0, height: 0 } : undefined;\n });\n } else {\n return Promise.resolve(getBBox ? { x: 0, y: 0, width: 0, height: 0 } : undefined);\n }\n }\n}\n\nexport class Border2 extends HTMLWidget {\n\n protected _bodyElement;\n\n protected _topWA: WidgetDiv;\n protected _leftWA: WidgetDiv;\n protected _centerWA: WidgetDiv;\n protected _rightWA: WidgetDiv;\n protected _bottomWA: WidgetDiv;\n protected _topPrevOverflow: OverflowT;\n protected _leftPrevOverflow: OverflowT;\n protected _rightPrevOverflow: OverflowT;\n protected _bottomPrevOverflow: OverflowT;\n\n constructor() {\n super();\n this._tag = \"div\";\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n \n const topElement = element.append(\"header\");\n\n this._bodyElement = element.append(\"div\").attr(\"class\", \"body\");\n const centerElement = this._bodyElement.append(\"div\").attr(\"class\", \"center\");\n const leftElement = this._bodyElement.append(\"div\").attr(\"class\", \"lhs\");\n const rightElement = this._bodyElement.append(\"div\").attr(\"class\", \"rhs\");\n\n const bottomElement = element.append(\"div\").attr(\"class\", \"footer\");\n\n this._topWA = new WidgetDiv(topElement);\n this._centerWA = new WidgetDiv(centerElement);\n this._leftWA = new WidgetDiv(leftElement);\n this._rightWA = new WidgetDiv(rightElement);\n this._bottomWA = new WidgetDiv(bottomElement);\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n this._topWA.element().style(\"display\", this.showTop() ? null : \"none\");\n this._rightWA.element().style(\"display\", this.showRight() ? null : \"none\");\n this._bottomWA.element().style(\"display\", this.showBottom() ? null : \"none\");\n this._leftWA.element().style(\"display\", this.showLeft() ? null : \"none\");\n if(this.topOverflowX() !== this._topWA.overflowX()) {\n this._topWA.overflowX(this.topOverflowX());\n }\n if(this.rightOverflowX() !== this._rightWA.overflowX()) {\n this._rightWA.overflowX(this.rightOverflowX());\n }\n if(this.bottomOverflowX() !== this._bottomWA.overflowX()) {\n this._bottomWA.overflowX(this.bottomOverflowX());\n }\n if(this.leftOverflowX() !== this._leftWA.overflowX()) {\n this._leftWA.overflowX(this.leftOverflowX());\n }\n if(this.topOverflowY() !== this._topWA.overflowY()) {\n this._topWA.overflowY(this.topOverflowY());\n }\n if(this.rightOverflowY() !== this._rightWA.overflowY()) {\n this._rightWA.overflowY(this.rightOverflowY());\n }\n if(this.bottomOverflowY() !== this._bottomWA.overflowY()) {\n this._bottomWA.overflowY(this.bottomOverflowY());\n }\n if(this.leftOverflowY() !== this._leftWA.overflowY()) {\n this._leftWA.overflowY(this.leftOverflowY());\n }\n this.element()\n .style(\"width\", `${this.width()}px`)\n .style(\"height\", `${this.height()}px`)\n ;\n }\n\n private targetNull(w?: Widget) {\n if (w) {\n w.target(null);\n }\n }\n\n exit(domNode, element) {\n this.targetNull(this.center());\n this.targetNull(this.bottom());\n this.targetNull(this.right());\n this.targetNull(this.left());\n this.targetNull(this.top());\n super.exit(domNode, element);\n }\n\n swap(sectionA: ChartPanelSectionT, sectionB: ChartPanelSectionT): this {\n const a = this[sectionA]();\n const b = this[sectionB]();\n this.targetNull(a);\n this.targetNull(b);\n this[`_${sectionA}WA`].widget(null);\n this[`_${sectionB}WA`].widget(null);\n this[sectionA](b);\n this[sectionB](a);\n return this;\n }\n\n render(callback?: (w: Widget) => void): this {\n const retVal = super.render(w => {\n if (this._topWA) {\n this._topWA\n .widget(this.top())\n .overlay(this.topOverlay())\n .render(true).then(async topBBox => {\n const bottomBBox: BBox = await this._bottomWA.widget(this.bottom()).render(true, undefined, this.width()) as BBox;\n const availableHeight = this.height() - (topBBox.height + bottomBBox.height);\n const leftBBox: BBox = await this._leftWA.widget(this.left()).render(true, availableHeight) as BBox;\n const rightBBox: BBox = await this._rightWA.widget(this.right()).render(true, availableHeight) as BBox;\n \n if (this.bottomHeight_exists()) {\n bottomBBox.height = this.bottomHeight();\n }\n const bodyWidth = this.width() - (leftBBox.width + rightBBox.width);\n const bodyHeight = this.height() - (topBBox.height + bottomBBox.height);\n \n const centerOverflowX = this.centerOverflowX();\n const centerOverflowY = this.centerOverflowY();\n\n const scrollCenterX = [\"auto\", \"scroll\"].indexOf(centerOverflowX) !== -1;\n const scrollCenterY = [\"auto\", \"scroll\"].indexOf(centerOverflowY) !== -1;\n if(scrollCenterX || scrollCenterY) {\n this._centerWA\n .overflowX(this.centerOverflowX())\n .overflowY(this.centerOverflowY())\n .widget(this.center())\n .resize({\n width: bodyWidth,\n height: bodyHeight\n })\n .render()\n ;\n }\n this._bodyElement.style(\"height\", `${bodyHeight}px`);\n const promises = [\n this._topWA\n .overflowX(this.topOverflowX())\n .overflowY(this.topOverflowY())\n .resize({\n width: this.width(),\n height: topBBox.height\n })\n .render(),\n this._leftWA\n .overflowX(this.leftOverflowX())\n .overflowY(this.leftOverflowY())\n .resize({\n width: leftBBox.width,\n height: bodyHeight\n })\n .render(),\n this._rightWA\n .overflowX(this.rightOverflowX())\n .overflowY(this.rightOverflowY())\n .resize({\n width: rightBBox.width,\n height: bodyHeight\n })\n .render(),\n this._centerWA\n .overflowX(this.centerOverflowX())\n .overflowY(this.centerOverflowY())\n .widget(this.center())\n .resize({\n width: bodyWidth,\n height: bodyHeight\n })\n .render(),\n this._bottomWA\n .overflowX(this.bottomOverflowX())\n .overflowY(this.bottomOverflowY())\n .resize({\n width: this.width(),\n height: bottomBBox.height\n })\n .render()\n ];\n Promise.all(promises).then(promises => {\n if (callback) {\n callback(this);\n }\n });\n })\n ;\n } else {\n if (callback) {\n callback(this);\n }\n }\n });\n return retVal;\n }\n}\nBorder2.prototype._class += \" layout_Border2\";\n\nexport interface Border2 {\n top(): Widget;\n top(_: Widget): this;\n topOverlay(): boolean;\n topOverlay(_: boolean): this;\n left(): Widget;\n left(_: Widget): this;\n center(): Widget;\n center(_: Widget): this;\n right(): Widget;\n right(_: Widget): this;\n bottom(): Widget;\n bottom(_: Widget): this;\n bottomHeight(): number;\n bottomHeight(_: number): this;\n bottomHeight_exists(): boolean;\n topOverflowX(): OverflowT;\n topOverflowX(_: OverflowT): this;\n rightOverflowX(): OverflowT;\n rightOverflowX(_: OverflowT): this;\n bottomOverflowX(): OverflowT;\n bottomOverflowX(_: OverflowT): this;\n leftOverflowX(): OverflowT;\n leftOverflowX(_: OverflowT): this;\n centerOverflowX(): OverflowT;\n centerOverflowX(_: OverflowT): this;\n topOverflowY(): OverflowT;\n topOverflowY(_: OverflowT): this;\n rightOverflowY(): OverflowT;\n rightOverflowY(_: OverflowT): this;\n bottomOverflowY(): OverflowT;\n bottomOverflowY(_: OverflowT): this;\n leftOverflowY(): OverflowT;\n leftOverflowY(_: OverflowT): this;\n centerOverflowY(): OverflowT;\n centerOverflowY(_: OverflowT): this;\n showTop(): boolean;\n showTop(_: boolean): this;\n showRight(): boolean;\n showRight(_: boolean): this;\n showBottom(): boolean;\n showBottom(_: boolean): this;\n showLeft(): boolean;\n showLeft(_: boolean): this;\n topOverflowX_default(_: OverflowT);\n rightOverflowX_default(_: OverflowT);\n bottomOverflowX_default(_: OverflowT);\n leftOverflowX_default(_: OverflowT);\n centerOverflowX_default(_: OverflowT);\n topOverflowY_default(_: OverflowT);\n rightOverflowY_default(_: OverflowT);\n bottomOverflowY_default(_: OverflowT);\n leftOverflowY_default(_: OverflowT);\n centerOverflowY_default(_: OverflowT);\n}\nBorder2.prototype.publish(\"showTop\", true, \"boolean\", \"If true, top widget adapter will display\");\nBorder2.prototype.publish(\"showRight\", true, \"boolean\", \"If true, right widget adapter will display\");\nBorder2.prototype.publish(\"showBottom\", true, \"boolean\", \"If true, bottom widget adapter will display\");\nBorder2.prototype.publish(\"showLeft\", true, \"boolean\", \"If true, left widget adapter will display\");\nBorder2.prototype.publish(\"topOverflowX\", \"visible\", \"set\", \"Sets the overflow-x css style for the top widget adapter\", [\"hidden\", \"scroll\", \"visible\", \"auto\"]);\nBorder2.prototype.publish(\"rightOverflowX\", \"visible\", \"set\", \"Sets the overflow-x css style for the right widget adapter\", [\"hidden\", \"scroll\", \"visible\", \"auto\"]);\nBorder2.prototype.publish(\"bottomOverflowX\", \"visible\", \"set\", \"Sets the overflow-x css style for the bottom widget adapter\", [\"hidden\", \"scroll\", \"visible\", \"auto\"]);\nBorder2.prototype.publish(\"leftOverflowX\", \"visible\", \"set\", \"Sets the overflow-x css style for the left widget adapter\", [\"hidden\", \"scroll\", \"visible\", \"auto\"]);\nBorder2.prototype.publish(\"centerOverflowX\", \"visible\", \"set\", \"Sets the overflow-x css style for the center widget adapter\", [\"hidden\", \"scroll\", \"visible\", \"auto\"]);\nBorder2.prototype.publish(\"topOverflowY\", \"visible\", \"set\", \"Sets the overflow-y css style for the top widget adapter\", [\"hidden\", \"scroll\", \"visible\", \"auto\"]);\nBorder2.prototype.publish(\"rightOverflowY\", \"visible\", \"set\", \"Sets the overflow-y css style for the right widget adapter\", [\"hidden\", \"scroll\", \"visible\", \"auto\"]);\nBorder2.prototype.publish(\"bottomOverflowY\", \"visible\", \"set\", \"Sets the overflow-y css style for the bottom widget adapter\", [\"hidden\", \"scroll\", \"visible\", \"auto\"]);\nBorder2.prototype.publish(\"leftOverflowY\", \"visible\", \"set\", \"Sets the overflow-y css style for the left widget adapter\", [\"hidden\", \"scroll\", \"visible\", \"auto\"]);\nBorder2.prototype.publish(\"centerOverflowY\", \"visible\", \"set\", \"Sets the overflow-y css style for the center widget adapter\", [\"hidden\", \"scroll\", \"visible\", \"auto\"]);\nBorder2.prototype.publish(\"top\", null, \"widget\", \"Top Widget\", undefined, { render: false });\nBorder2.prototype.publish(\"topOverlay\", false, \"boolean\", \"Overlay Top Widget\");\nBorder2.prototype.publish(\"left\", null, \"widget\", \"Left Widget\", undefined, { render: false });\nBorder2.prototype.publish(\"center\", null, \"widget\", \"Center Widget\", undefined, { render: false });\nBorder2.prototype.publish(\"right\", null, \"widget\", \"Right Widget\", undefined, { render: false });\nBorder2.prototype.publish(\"bottom\", null, \"widget\", \"Bottom Widget\", undefined, { render: false });\nBorder2.prototype.publish(\"bottomHeight\", null, \"number\", \"Bottom Fixed Height\", undefined, { optional: true });\n","import { HTMLWidget, Widget } from \"@hpcc-js/common\";\nimport { select as d3Select } from \"d3-selection\";\nimport \"d3-transition\";\n\nimport \"../src/Carousel.css\";\n\nexport class Carousel extends HTMLWidget {\n\n protected _prevActive: number = 0;\n protected _root;\n\n activeWidget(): Widget {\n return this.widgets()[this.active()];\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this._root = element.append(\"div\")\n .attr(\"id\", `${this.id()}_root`)\n ;\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n const active = this.active();\n const width = this.width();\n this._root\n .style(\"width\", `${width}px`)\n .style(\"height\", `${this.height()}px`)\n ;\n const widgetElements = this._root.selectAll(`#${this.id()}_root > .carouselItem`).data(this.widgets(), d => d.id());\n const update = widgetElements.enter().append(\"div\")\n .attr(\"class\", \"carouselItem\")\n .each(function (w) {\n w.target(this);\n })\n .merge(widgetElements)\n .style(\"left\", (d, i) => `${(i - this._prevActive) * width}px`)\n .style(\"width\", `${width}px`)\n ;\n if (this._prevActive !== active) {\n update\n .style(\"display\", (d, i) => i === this._prevActive || i === active ? null : \"none\") // Must be called before render callback (not inside transition)\n .transition().duration(this.transitionDuration())\n .style(\"left\", (d, i) => `${(i - active) * width}px`)\n .on(\"end\", function (d, i) {\n d3Select(this).style(\"display\", () => i === active ? null : \"none\");\n })\n ;\n this._prevActive = active;\n }\n widgetElements.exit()\n .each(function (w) {\n w.target(null);\n })\n .remove()\n ;\n }\n\n exit(domNode, element) {\n this.widgets().forEach(w => w.target(null));\n super.exit(domNode, element);\n }\n\n render(callback): this {\n return super.render(w => {\n if (!this.visible() || this.isDOMHidden()) {\n if (callback) {\n callback(w);\n }\n } else {\n const aw = this.activeWidget();\n if (aw) {\n aw\n .resize(this.size())\n .render(w2 => {\n if (callback) {\n callback(w);\n }\n })\n ;\n }\n }\n });\n }\n}\nCarousel.prototype._class += \" layout_Carousel\";\n\nexport interface Carousel {\n widgets(): Widget[];\n widgets(_: Widget[]): this;\n active(): number;\n active(_: number): this;\n transitionDuration(): Widget[];\n transitionDuration(_: Widget[]): this;\n}\n\nCarousel.prototype.publish(\"widgets\", [], \"widgetArray\", \"Widgets\", null, { render: false });\nCarousel.prototype.publish(\"active\", 0, \"number\", \"Active widget\");\nCarousel.prototype.publish(\"transitionDuration\", 500, \"number\", \"Transition duration\");\n","var pi = Math.PI,\n tau = 2 * pi,\n epsilon = 1e-6,\n tauEpsilon = tau - epsilon;\n\nfunction Path() {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n}\n\nfunction path() {\n return new Path;\n}\n\nPath.prototype = path.prototype = {\n constructor: Path,\n moveTo: function(x, y) {\n this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y);\n },\n closePath: function() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._ += \"Z\";\n }\n },\n lineTo: function(x, y) {\n this._ += \"L\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n quadraticCurveTo: function(x1, y1, x, y) {\n this._ += \"Q\" + (+x1) + \",\" + (+y1) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) {\n this._ += \"C\" + (+x1) + \",\" + (+y1) + \",\" + (+x2) + \",\" + (+y2) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n arcTo: function(x1, y1, x2, y2, r) {\n x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;\n var x0 = this._x1,\n y0 = this._y1,\n x21 = x2 - x1,\n y21 = y2 - y1,\n x01 = x0 - x1,\n y01 = y0 - y1,\n l01_2 = x01 * x01 + y01 * y01;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(\"negative radius: \" + r);\n\n // Is this path empty? Move to (x1,y1).\n if (this._x1 === null) {\n this._ += \"M\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n }\n\n // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.\n else if (!(l01_2 > epsilon));\n\n // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?\n // Equivalently, is (x1,y1) coincident with (x2,y2)?\n // Or, is the radius zero? Line to (x1,y1).\n else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {\n this._ += \"L\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n }\n\n // Otherwise, draw an arc!\n else {\n var x20 = x2 - x0,\n y20 = y2 - y0,\n l21_2 = x21 * x21 + y21 * y21,\n l20_2 = x20 * x20 + y20 * y20,\n l21 = Math.sqrt(l21_2),\n l01 = Math.sqrt(l01_2),\n l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),\n t01 = l / l01,\n t21 = l / l21;\n\n // If the start tangent is not coincident with (x0,y0), line to.\n if (Math.abs(t01 - 1) > epsilon) {\n this._ += \"L\" + (x1 + t01 * x01) + \",\" + (y1 + t01 * y01);\n }\n\n this._ += \"A\" + r + \",\" + r + \",0,0,\" + (+(y01 * x20 > x01 * y20)) + \",\" + (this._x1 = x1 + t21 * x21) + \",\" + (this._y1 = y1 + t21 * y21);\n }\n },\n arc: function(x, y, r, a0, a1, ccw) {\n x = +x, y = +y, r = +r, ccw = !!ccw;\n var dx = r * Math.cos(a0),\n dy = r * Math.sin(a0),\n x0 = x + dx,\n y0 = y + dy,\n cw = 1 ^ ccw,\n da = ccw ? a0 - a1 : a1 - a0;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(\"negative radius: \" + r);\n\n // Is this path empty? Move to (x0,y0).\n if (this._x1 === null) {\n this._ += \"M\" + x0 + \",\" + y0;\n }\n\n // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).\n else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {\n this._ += \"L\" + x0 + \",\" + y0;\n }\n\n // Is this arc empty? We’re done.\n if (!r) return;\n\n // Does the angle go the wrong way? Flip the direction.\n if (da < 0) da = da % tau + tau;\n\n // Is this a complete circle? Draw two arcs to complete the circle.\n if (da > tauEpsilon) {\n this._ += \"A\" + r + \",\" + r + \",0,1,\" + cw + \",\" + (x - dx) + \",\" + (y - dy) + \"A\" + r + \",\" + r + \",0,1,\" + cw + \",\" + (this._x1 = x0) + \",\" + (this._y1 = y0);\n }\n\n // Is this arc non-empty? Draw an arc!\n else if (da > epsilon) {\n this._ += \"A\" + r + \",\" + r + \",0,\" + (+(da >= pi)) + \",\" + cw + \",\" + (this._x1 = x + r * Math.cos(a1)) + \",\" + (this._y1 = y + r * Math.sin(a1));\n }\n },\n rect: function(x, y, w, h) {\n this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y) + \"h\" + (+w) + \"v\" + (+h) + \"h\" + (-w) + \"Z\";\n },\n toString: function() {\n return this._;\n }\n};\n\nexport default path;\n","export default function(x) {\n return function constant() {\n return x;\n };\n}\n","export var abs = Math.abs;\nexport var atan2 = Math.atan2;\nexport var cos = Math.cos;\nexport var max = Math.max;\nexport var min = Math.min;\nexport var sin = Math.sin;\nexport var sqrt = Math.sqrt;\n\nexport var epsilon = 1e-12;\nexport var pi = Math.PI;\nexport var halfPi = pi / 2;\nexport var tau = 2 * pi;\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function asin(x) {\n return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);\n}\n","import {pi, tau} from \"../math.js\";\n\nexport default {\n draw: function(context, size) {\n var r = Math.sqrt(size / pi);\n context.moveTo(r, 0);\n context.arc(0, 0, r, 0, tau);\n }\n};\n","export default {\n draw: function(context, size) {\n var r = Math.sqrt(size / 5) / 2;\n context.moveTo(-3 * r, -r);\n context.lineTo(-r, -r);\n context.lineTo(-r, -3 * r);\n context.lineTo(r, -3 * r);\n context.lineTo(r, -r);\n context.lineTo(3 * r, -r);\n context.lineTo(3 * r, r);\n context.lineTo(r, r);\n context.lineTo(r, 3 * r);\n context.lineTo(-r, 3 * r);\n context.lineTo(-r, r);\n context.lineTo(-3 * r, r);\n context.closePath();\n }\n};\n","var tan30 = Math.sqrt(1 / 3),\n tan30_2 = tan30 * 2;\n\nexport default {\n draw: function(context, size) {\n var y = Math.sqrt(size / tan30_2),\n x = y * tan30;\n context.moveTo(0, -y);\n context.lineTo(x, 0);\n context.lineTo(0, y);\n context.lineTo(-x, 0);\n context.closePath();\n }\n};\n","import {pi, tau} from \"../math.js\";\n\nvar ka = 0.89081309152928522810,\n kr = Math.sin(pi / 10) / Math.sin(7 * pi / 10),\n kx = Math.sin(tau / 10) * kr,\n ky = -Math.cos(tau / 10) * kr;\n\nexport default {\n draw: function(context, size) {\n var r = Math.sqrt(size * ka),\n x = kx * r,\n y = ky * r;\n context.moveTo(0, -r);\n context.lineTo(x, y);\n for (var i = 1; i < 5; ++i) {\n var a = tau * i / 5,\n c = Math.cos(a),\n s = Math.sin(a);\n context.lineTo(s * r, -c * r);\n context.lineTo(c * x - s * y, s * x + c * y);\n }\n context.closePath();\n }\n};\n","export default {\n draw: function(context, size) {\n var w = Math.sqrt(size),\n x = -w / 2;\n context.rect(x, x, w, w);\n }\n};\n","var sqrt3 = Math.sqrt(3);\n\nexport default {\n draw: function(context, size) {\n var y = -Math.sqrt(size / (sqrt3 * 3));\n context.moveTo(0, y * 2);\n context.lineTo(-sqrt3 * y, -y);\n context.lineTo(sqrt3 * y, -y);\n context.closePath();\n }\n};\n","var c = -0.5,\n s = Math.sqrt(3) / 2,\n k = 1 / Math.sqrt(12),\n a = (k / 2 + 1) * 3;\n\nexport default {\n draw: function(context, size) {\n var r = Math.sqrt(size / a),\n x0 = r / 2,\n y0 = r * k,\n x1 = x0,\n y1 = r * k + r,\n x2 = -x1,\n y2 = y1;\n context.moveTo(x0, y0);\n context.lineTo(x1, y1);\n context.lineTo(x2, y2);\n context.lineTo(c * x0 - s * y0, s * x0 + c * y0);\n context.lineTo(c * x1 - s * y1, s * x1 + c * y1);\n context.lineTo(c * x2 - s * y2, s * x2 + c * y2);\n context.lineTo(c * x0 + s * y0, c * y0 - s * x0);\n context.lineTo(c * x1 + s * y1, c * y1 - s * x1);\n context.lineTo(c * x2 + s * y2, c * y2 - s * x2);\n context.closePath();\n }\n};\n","import {path} from \"d3-path\";\nimport circle from \"./symbol/circle.js\";\nimport cross from \"./symbol/cross.js\";\nimport diamond from \"./symbol/diamond.js\";\nimport star from \"./symbol/star.js\";\nimport square from \"./symbol/square.js\";\nimport triangle from \"./symbol/triangle.js\";\nimport wye from \"./symbol/wye.js\";\nimport constant from \"./constant.js\";\n\nexport var symbols = [\n circle,\n cross,\n diamond,\n square,\n star,\n triangle,\n wye\n];\n\nexport default function() {\n var type = constant(circle),\n size = constant(64),\n context = null;\n\n function symbol() {\n var buffer;\n if (!context) context = buffer = path();\n type.apply(this, arguments).draw(context, +size.apply(this, arguments));\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n symbol.type = function(_) {\n return arguments.length ? (type = typeof _ === \"function\" ? _ : constant(_), symbol) : type;\n };\n\n symbol.size = function(_) {\n return arguments.length ? (size = typeof _ === \"function\" ? _ : constant(+_), symbol) : size;\n };\n\n symbol.context = function(_) {\n return arguments.length ? (context = _ == null ? null : _, symbol) : context;\n };\n\n return symbol;\n}\n","import { select } from 'd3-selection';\nimport { format, formatLocale, formatPrefix, formatSpecifier } from 'd3-format';\nimport { dispatch } from 'd3-dispatch';\nimport { scaleLinear } from 'd3-scale';\nimport { max, sum } from 'd3-array';\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n return typeof obj;\n} : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n};\n\nvar d3_identity = function d3_identity(d) {\n return d;\n};\n\nvar d3_reverse = function d3_reverse(arr) {\n var mirror = [];\n for (var i = 0, l = arr.length; i < l; i++) {\n mirror[i] = arr[l - i - 1];\n }\n return mirror;\n};\n\n//Text wrapping code adapted from Mike Bostock\nvar d3_textWrapping = function d3_textWrapping(text, width) {\n text.each(function () {\n var text = select(this),\n words = text.text().split(/\\s+/).reverse(),\n word,\n line = [],\n lineNumber = 0,\n lineHeight = 1.2,\n //ems\n y = text.attr(\"y\"),\n dy = parseFloat(text.attr(\"dy\")) || 0,\n tspan = text.text(null).append(\"tspan\").attr(\"x\", 0).attr(\"dy\", dy + \"em\");\n\n while (word = words.pop()) {\n line.push(word);\n tspan.text(line.join(\" \"));\n if (tspan.node().getComputedTextLength() > width && line.length > 1) {\n line.pop();\n tspan.text(line.join(\" \"));\n line = [word];\n tspan = text.append(\"tspan\").attr(\"x\", 0).attr(\"dy\", lineHeight + dy + \"em\").text(word);\n }\n }\n });\n};\n\nvar d3_mergeLabels = function d3_mergeLabels() {\n var gen = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n var labels = arguments[1];\n var domain = arguments[2];\n var range = arguments[3];\n var labelDelimiter = arguments[4];\n\n if ((typeof labels === \"undefined\" ? \"undefined\" : _typeof(labels)) === \"object\") {\n if (labels.length === 0) return gen;\n\n var i = labels.length;\n for (; i < gen.length; i++) {\n labels.push(gen[i]);\n }\n return labels;\n } else if (typeof labels === \"function\") {\n var customLabels = [];\n var genLength = gen.length;\n for (var _i = 0; _i < genLength; _i++) {\n customLabels.push(labels({\n i: _i,\n genLength: genLength,\n generatedLabels: gen,\n domain: domain,\n range: range,\n labelDelimiter: labelDelimiter\n }));\n }\n return customLabels;\n }\n\n return gen;\n};\n\nvar d3_linearLegend = function d3_linearLegend(scale, cells, labelFormat) {\n var data = [];\n\n if (cells.length > 1) {\n data = cells;\n } else {\n var domain = scale.domain(),\n increment = (domain[domain.length - 1] - domain[0]) / (cells - 1);\n var i = 0;\n\n for (; i < cells; i++) {\n data.push(domain[0] + i * increment);\n }\n }\n\n var labels = data.map(labelFormat);\n return {\n data: data,\n labels: labels,\n feature: function feature(d) {\n return scale(d);\n }\n };\n};\n\nvar d3_quantLegend = function d3_quantLegend(scale, labelFormat, labelDelimiter) {\n var labels = scale.range().map(function (d) {\n var invert = scale.invertExtent(d);\n return labelFormat(invert[0]) + \" \" + labelDelimiter + \" \" + labelFormat(invert[1]);\n });\n\n return {\n data: scale.range(),\n labels: labels,\n feature: d3_identity\n };\n};\n\nvar d3_ordinalLegend = function d3_ordinalLegend(scale) {\n return {\n data: scale.domain(),\n labels: scale.domain(),\n feature: function feature(d) {\n return scale(d);\n }\n };\n};\n\nvar d3_cellOver = function d3_cellOver(cellDispatcher, d, obj) {\n cellDispatcher.call(\"cellover\", obj, d);\n};\n\nvar d3_cellOut = function d3_cellOut(cellDispatcher, d, obj) {\n cellDispatcher.call(\"cellout\", obj, d);\n};\n\nvar d3_cellClick = function d3_cellClick(cellDispatcher, d, obj) {\n cellDispatcher.call(\"cellclick\", obj, d);\n};\n\nvar helper = {\n d3_drawShapes: function d3_drawShapes(shape, shapes, shapeHeight, shapeWidth, shapeRadius, path) {\n if (shape === \"rect\") {\n shapes.attr(\"height\", shapeHeight).attr(\"width\", shapeWidth);\n } else if (shape === \"circle\") {\n shapes.attr(\"r\", shapeRadius);\n } else if (shape === \"line\") {\n shapes.attr(\"x1\", 0).attr(\"x2\", shapeWidth).attr(\"y1\", 0).attr(\"y2\", 0);\n } else if (shape === \"path\") {\n shapes.attr(\"d\", path);\n }\n },\n\n d3_addText: function d3_addText(svg, enter, labels, classPrefix, labelWidth) {\n enter.append(\"text\").attr(\"class\", classPrefix + \"label\");\n var text = svg.selectAll(\"g.\" + classPrefix + \"cell text.\" + classPrefix + \"label\").data(labels).text(d3_identity);\n\n if (labelWidth) {\n svg.selectAll(\"g.\" + classPrefix + \"cell text.\" + classPrefix + \"label\").call(d3_textWrapping, labelWidth);\n }\n\n return text;\n },\n\n d3_calcType: function d3_calcType(scale, ascending, cells, labels, labelFormat, labelDelimiter) {\n var type = scale.invertExtent ? d3_quantLegend(scale, labelFormat, labelDelimiter) : scale.ticks ? d3_linearLegend(scale, cells, labelFormat) : d3_ordinalLegend(scale);\n\n //for d3.scaleSequential that doesn't have a range function\n var range = scale.range && scale.range() || scale.domain();\n type.labels = d3_mergeLabels(type.labels, labels, scale.domain(), range, labelDelimiter);\n\n if (ascending) {\n type.labels = d3_reverse(type.labels);\n type.data = d3_reverse(type.data);\n }\n\n return type;\n },\n\n d3_filterCells: function d3_filterCells(type, cellFilter) {\n var filterCells = type.data.map(function (d, i) {\n return { data: d, label: type.labels[i] };\n }).filter(cellFilter);\n var dataValues = filterCells.map(function (d) {\n return d.data;\n });\n var labelValues = filterCells.map(function (d) {\n return d.label;\n });\n type.data = type.data.filter(function (d) {\n return dataValues.indexOf(d) !== -1;\n });\n type.labels = type.labels.filter(function (d) {\n return labelValues.indexOf(d) !== -1;\n });\n return type;\n },\n\n d3_placement: function d3_placement(orient, cell, cellTrans, text, textTrans, labelAlign) {\n cell.attr(\"transform\", cellTrans);\n text.attr(\"transform\", textTrans);\n if (orient === \"horizontal\") {\n text.style(\"text-anchor\", labelAlign);\n }\n },\n\n d3_addEvents: function d3_addEvents(cells, dispatcher) {\n cells.on(\"mouseover.legend\", function (d) {\n d3_cellOver(dispatcher, d, this);\n }).on(\"mouseout.legend\", function (d) {\n d3_cellOut(dispatcher, d, this);\n }).on(\"click.legend\", function (d) {\n d3_cellClick(dispatcher, d, this);\n });\n },\n\n d3_title: function d3_title(svg, title, classPrefix, titleWidth) {\n if (title !== \"\") {\n var titleText = svg.selectAll(\"text.\" + classPrefix + \"legendTitle\");\n\n titleText.data([title]).enter().append(\"text\").attr(\"class\", classPrefix + \"legendTitle\");\n\n svg.selectAll(\"text.\" + classPrefix + \"legendTitle\").text(title);\n\n if (titleWidth) {\n svg.selectAll(\"text.\" + classPrefix + \"legendTitle\").call(d3_textWrapping, titleWidth);\n }\n\n var cellsSvg = svg.select(\".\" + classPrefix + \"legendCells\");\n var yOffset = svg.select(\".\" + classPrefix + \"legendTitle\").nodes().map(function (d) {\n return d.getBBox().height;\n })[0],\n xOffset = -cellsSvg.nodes().map(function (d) {\n return d.getBBox().x;\n })[0];\n cellsSvg.attr(\"transform\", \"translate(\" + xOffset + \",\" + yOffset + \")\");\n }\n },\n\n d3_defaultLocale: {\n format: format,\n formatPrefix: formatPrefix\n },\n\n d3_defaultFormatSpecifier: \".01f\",\n\n d3_defaultDelimiter: \"to\"\n};\n\nfunction color() {\n var scale = scaleLinear(),\n shape = \"rect\",\n shapeWidth = 15,\n shapeHeight = 15,\n shapeRadius = 10,\n shapePadding = 2,\n cells = [5],\n cellFilter = void 0,\n labels = [],\n classPrefix = \"\",\n useClass = false,\n title = \"\",\n locale = helper.d3_defaultLocale,\n specifier = helper.d3_defaultFormatSpecifier,\n labelOffset = 10,\n labelAlign = \"middle\",\n labelDelimiter = helper.d3_defaultDelimiter,\n labelWrap = void 0,\n orient = \"vertical\",\n ascending = false,\n path = void 0,\n titleWidth = void 0,\n legendDispatcher = dispatch(\"cellover\", \"cellout\", \"cellclick\");\n\n function legend(svg) {\n var type = helper.d3_calcType(scale, ascending, cells, labels, locale.format(specifier), labelDelimiter),\n legendG = svg.selectAll(\"g\").data([scale]);\n\n legendG.enter().append(\"g\").attr(\"class\", classPrefix + \"legendCells\");\n\n if (cellFilter) {\n helper.d3_filterCells(type, cellFilter);\n }\n\n var cell = svg.select(\".\" + classPrefix + \"legendCells\").selectAll(\".\" + classPrefix + \"cell\").data(type.data);\n\n var cellEnter = cell.enter().append(\"g\").attr(\"class\", classPrefix + \"cell\");\n cellEnter.append(shape).attr(\"class\", classPrefix + \"swatch\");\n\n var shapes = svg.selectAll(\"g.\" + classPrefix + \"cell \" + shape + \".\" + classPrefix + \"swatch\").data(type.data);\n\n //add event handlers\n helper.d3_addEvents(cellEnter, legendDispatcher);\n\n cell.exit().transition().style(\"opacity\", 0).remove();\n shapes.exit().transition().style(\"opacity\", 0).remove();\n\n shapes = shapes.merge(shapes);\n\n helper.d3_drawShapes(shape, shapes, shapeHeight, shapeWidth, shapeRadius, path);\n var text = helper.d3_addText(svg, cellEnter, type.labels, classPrefix, labelWrap);\n\n // we need to merge the selection, otherwise changes in the legend (e.g. change of orientation) are applied only to the new cells and not the existing ones.\n cell = cellEnter.merge(cell);\n\n // sets placement\n var textSize = text.nodes().map(function (d) {\n return d.getBBox();\n }),\n shapeSize = shapes.nodes().map(function (d) {\n return d.getBBox();\n });\n //sets scale\n //everything is fill except for line which is stroke,\n if (!useClass) {\n if (shape == \"line\") {\n shapes.style(\"stroke\", type.feature);\n } else {\n shapes.style(\"fill\", type.feature);\n }\n } else {\n shapes.attr(\"class\", function (d) {\n return classPrefix + \"swatch \" + type.feature(d);\n });\n }\n\n var cellTrans = void 0,\n textTrans = void 0,\n textAlign = labelAlign == \"start\" ? 0 : labelAlign == \"middle\" ? 0.5 : 1;\n\n //positions cells and text\n if (orient === \"vertical\") {\n (function () {\n var cellSize = textSize.map(function (d, i) {\n return Math.max(d.height, shapeSize[i].height);\n });\n\n cellTrans = function cellTrans(d, i) {\n var height = sum(cellSize.slice(0, i));\n return \"translate(0, \" + (height + i * shapePadding) + \")\";\n };\n\n textTrans = function textTrans(d, i) {\n return \"translate( \" + (shapeSize[i].width + shapeSize[i].x + labelOffset) + \", \" + (shapeSize[i].y + shapeSize[i].height / 2 + 5) + \")\";\n };\n })();\n } else if (orient === \"horizontal\") {\n cellTrans = function cellTrans(d, i) {\n return \"translate(\" + i * (shapeSize[i].width + shapePadding) + \",0)\";\n };\n textTrans = function textTrans(d, i) {\n return \"translate(\" + (shapeSize[i].width * textAlign + shapeSize[i].x) + \",\\n \" + (shapeSize[i].height + shapeSize[i].y + labelOffset + 8) + \")\";\n };\n }\n\n helper.d3_placement(orient, cell, cellTrans, text, textTrans, labelAlign);\n helper.d3_title(svg, title, classPrefix, titleWidth);\n\n cell.transition().style(\"opacity\", 1);\n }\n\n legend.scale = function (_) {\n if (!arguments.length) return scale;\n scale = _;\n return legend;\n };\n\n legend.cells = function (_) {\n if (!arguments.length) return cells;\n if (_.length > 1 || _ >= 2) {\n cells = _;\n }\n return legend;\n };\n\n legend.cellFilter = function (_) {\n if (!arguments.length) return cellFilter;\n cellFilter = _;\n return legend;\n };\n\n legend.shape = function (_, d) {\n if (!arguments.length) return shape;\n if (_ == \"rect\" || _ == \"circle\" || _ == \"line\" || _ == \"path\" && typeof d === \"string\") {\n shape = _;\n path = d;\n }\n return legend;\n };\n\n legend.shapeWidth = function (_) {\n if (!arguments.length) return shapeWidth;\n shapeWidth = +_;\n return legend;\n };\n\n legend.shapeHeight = function (_) {\n if (!arguments.length) return shapeHeight;\n shapeHeight = +_;\n return legend;\n };\n\n legend.shapeRadius = function (_) {\n if (!arguments.length) return shapeRadius;\n shapeRadius = +_;\n return legend;\n };\n\n legend.shapePadding = function (_) {\n if (!arguments.length) return shapePadding;\n shapePadding = +_;\n return legend;\n };\n\n legend.labels = function (_) {\n if (!arguments.length) return labels;\n labels = _;\n return legend;\n };\n\n legend.labelAlign = function (_) {\n if (!arguments.length) return labelAlign;\n if (_ == \"start\" || _ == \"end\" || _ == \"middle\") {\n labelAlign = _;\n }\n return legend;\n };\n\n legend.locale = function (_) {\n if (!arguments.length) return locale;\n locale = formatLocale(_);\n return legend;\n };\n\n legend.labelFormat = function (_) {\n if (!arguments.length) return legend.locale().format(specifier);\n specifier = formatSpecifier(_);\n return legend;\n };\n\n legend.labelOffset = function (_) {\n if (!arguments.length) return labelOffset;\n labelOffset = +_;\n return legend;\n };\n\n legend.labelDelimiter = function (_) {\n if (!arguments.length) return labelDelimiter;\n labelDelimiter = _;\n return legend;\n };\n\n legend.labelWrap = function (_) {\n if (!arguments.length) return labelWrap;\n labelWrap = _;\n return legend;\n };\n\n legend.useClass = function (_) {\n if (!arguments.length) return useClass;\n if (_ === true || _ === false) {\n useClass = _;\n }\n return legend;\n };\n\n legend.orient = function (_) {\n if (!arguments.length) return orient;\n _ = _.toLowerCase();\n if (_ == \"horizontal\" || _ == \"vertical\") {\n orient = _;\n }\n return legend;\n };\n\n legend.ascending = function (_) {\n if (!arguments.length) return ascending;\n ascending = !!_;\n return legend;\n };\n\n legend.classPrefix = function (_) {\n if (!arguments.length) return classPrefix;\n classPrefix = _;\n return legend;\n };\n\n legend.title = function (_) {\n if (!arguments.length) return title;\n title = _;\n return legend;\n };\n\n legend.titleWidth = function (_) {\n if (!arguments.length) return titleWidth;\n titleWidth = _;\n return legend;\n };\n\n legend.textWrap = function (_) {\n if (!arguments.length) return textWrap;\n textWrap = _;\n return legend;\n };\n\n legend.on = function () {\n var value = legendDispatcher.on.apply(legendDispatcher, arguments);\n return value === legendDispatcher ? legend : value;\n };\n\n return legend;\n}\n\nfunction size() {\n var scale = scaleLinear(),\n shape = \"rect\",\n shapeWidth = 15,\n shapePadding = 2,\n cells = [5],\n cellFilter = void 0,\n labels = [],\n classPrefix = \"\",\n title = \"\",\n locale = helper.d3_defaultLocale,\n specifier = helper.d3_defaultFormatSpecifier,\n labelOffset = 10,\n labelAlign = \"middle\",\n labelDelimiter = helper.d3_defaultDelimiter,\n labelWrap = void 0,\n orient = \"vertical\",\n ascending = false,\n path = void 0,\n titleWidth = void 0,\n legendDispatcher = dispatch(\"cellover\", \"cellout\", \"cellclick\");\n\n function legend(svg) {\n var type = helper.d3_calcType(scale, ascending, cells, labels, locale.format(specifier), labelDelimiter),\n legendG = svg.selectAll(\"g\").data([scale]);\n\n if (cellFilter) {\n helper.d3_filterCells(type, cellFilter);\n }\n\n legendG.enter().append(\"g\").attr(\"class\", classPrefix + \"legendCells\");\n\n var cell = svg.select(\".\" + classPrefix + \"legendCells\").selectAll(\".\" + classPrefix + \"cell\").data(type.data);\n var cellEnter = cell.enter().append(\"g\").attr(\"class\", classPrefix + \"cell\");\n cellEnter.append(shape).attr(\"class\", classPrefix + \"swatch\");\n\n var shapes = svg.selectAll(\"g.\" + classPrefix + \"cell \" + shape + \".\" + classPrefix + \"swatch\");\n\n //add event handlers\n helper.d3_addEvents(cellEnter, legendDispatcher);\n\n cell.exit().transition().style(\"opacity\", 0).remove();\n\n shapes.exit().transition().style(\"opacity\", 0).remove();\n shapes = shapes.merge(shapes);\n\n //creates shape\n if (shape === \"line\") {\n helper.d3_drawShapes(shape, shapes, 0, shapeWidth);\n shapes.attr(\"stroke-width\", type.feature);\n } else {\n helper.d3_drawShapes(shape, shapes, type.feature, type.feature, type.feature, path);\n }\n\n var text = helper.d3_addText(svg, cellEnter, type.labels, classPrefix, labelWrap);\n\n // we need to merge the selection, otherwise changes in the legend (e.g. change of orientation) are applied only to the new cells and not the existing ones.\n cell = cellEnter.merge(cell);\n\n //sets placement\n\n var textSize = text.nodes().map(function (d) {\n return d.getBBox();\n }),\n shapeSize = shapes.nodes().map(function (d, i) {\n var bbox = d.getBBox();\n var stroke = scale(type.data[i]);\n\n if (shape === \"line\" && orient === \"horizontal\") {\n bbox.height = bbox.height + stroke;\n } else if (shape === \"line\" && orient === \"vertical\") {\n bbox.width = bbox.width;\n }\n return bbox;\n });\n\n var maxH = max(shapeSize, function (d) {\n return d.height + d.y;\n }),\n maxW = max(shapeSize, function (d) {\n return d.width + d.x;\n });\n\n var cellTrans = void 0,\n textTrans = void 0,\n textAlign = labelAlign == \"start\" ? 0 : labelAlign == \"middle\" ? 0.5 : 1;\n\n //positions cells and text\n if (orient === \"vertical\") {\n (function () {\n var cellSize = textSize.map(function (d, i) {\n return Math.max(d.height, shapeSize[i].height);\n });\n var y = shape == \"circle\" || shape == \"line\" ? shapeSize[0].height / 2 : 0;\n cellTrans = function cellTrans(d, i) {\n var height = sum(cellSize.slice(0, i));\n\n return \"translate(0, \" + (y + height + i * shapePadding) + \")\";\n };\n\n textTrans = function textTrans(d, i) {\n return \"translate( \" + (maxW + labelOffset) + \",\\n \" + (shapeSize[i].y + shapeSize[i].height / 2 + 5) + \")\";\n };\n })();\n } else if (orient === \"horizontal\") {\n (function () {\n cellTrans = function cellTrans(d, i) {\n var width = sum(shapeSize.slice(0, i), function (d) {\n return d.width;\n });\n var y = shape == \"circle\" || shape == \"line\" ? maxH / 2 : 0;\n return \"translate(\" + (width + i * shapePadding) + \", \" + y + \")\";\n };\n\n var offset = shape == \"line\" ? maxH / 2 : maxH;\n textTrans = function textTrans(d, i) {\n return \"translate( \" + (shapeSize[i].width * textAlign + shapeSize[i].x) + \",\\n \" + (offset + labelOffset) + \")\";\n };\n })();\n }\n\n helper.d3_placement(orient, cell, cellTrans, text, textTrans, labelAlign);\n helper.d3_title(svg, title, classPrefix, titleWidth);\n\n cell.transition().style(\"opacity\", 1);\n }\n\n legend.scale = function (_) {\n if (!arguments.length) return scale;\n scale = _;\n return legend;\n };\n\n legend.cells = function (_) {\n if (!arguments.length) return cells;\n if (_.length > 1 || _ >= 2) {\n cells = _;\n }\n return legend;\n };\n\n legend.cellFilter = function (_) {\n if (!arguments.length) return cellFilter;\n cellFilter = _;\n return legend;\n };\n\n legend.shape = function (_, d) {\n if (!arguments.length) return shape;\n if (_ == \"rect\" || _ == \"circle\" || _ == \"line\") {\n shape = _;\n path = d;\n }\n return legend;\n };\n\n legend.shapeWidth = function (_) {\n if (!arguments.length) return shapeWidth;\n shapeWidth = +_;\n return legend;\n };\n\n legend.shapePadding = function (_) {\n if (!arguments.length) return shapePadding;\n shapePadding = +_;\n return legend;\n };\n\n legend.labels = function (_) {\n if (!arguments.length) return labels;\n labels = _;\n return legend;\n };\n\n legend.labelAlign = function (_) {\n if (!arguments.length) return labelAlign;\n if (_ == \"start\" || _ == \"end\" || _ == \"middle\") {\n labelAlign = _;\n }\n return legend;\n };\n\n legend.locale = function (_) {\n if (!arguments.length) return locale;\n locale = formatLocale(_);\n return legend;\n };\n\n legend.labelFormat = function (_) {\n if (!arguments.length) return legend.locale().format(specifier);\n specifier = formatSpecifier(_);\n return legend;\n };\n\n legend.labelOffset = function (_) {\n if (!arguments.length) return labelOffset;\n labelOffset = +_;\n return legend;\n };\n\n legend.labelDelimiter = function (_) {\n if (!arguments.length) return labelDelimiter;\n labelDelimiter = _;\n return legend;\n };\n\n legend.labelWrap = function (_) {\n if (!arguments.length) return labelWrap;\n labelWrap = _;\n return legend;\n };\n\n legend.orient = function (_) {\n if (!arguments.length) return orient;\n _ = _.toLowerCase();\n if (_ == \"horizontal\" || _ == \"vertical\") {\n orient = _;\n }\n return legend;\n };\n\n legend.ascending = function (_) {\n if (!arguments.length) return ascending;\n ascending = !!_;\n return legend;\n };\n\n legend.classPrefix = function (_) {\n if (!arguments.length) return classPrefix;\n classPrefix = _;\n return legend;\n };\n\n legend.title = function (_) {\n if (!arguments.length) return title;\n title = _;\n return legend;\n };\n\n legend.titleWidth = function (_) {\n if (!arguments.length) return titleWidth;\n titleWidth = _;\n return legend;\n };\n\n legend.on = function () {\n var value = legendDispatcher.on.apply(legendDispatcher, arguments);\n return value === legendDispatcher ? legend : value;\n };\n\n return legend;\n}\n\nfunction symbol() {\n var scale = scaleLinear(),\n shape = \"path\",\n shapeWidth = 15,\n shapeHeight = 15,\n shapeRadius = 10,\n shapePadding = 5,\n cells = [5],\n cellFilter = void 0,\n labels = [],\n classPrefix = \"\",\n title = \"\",\n locale = helper.d3_defaultLocale,\n specifier = helper.d3_defaultFormatSpecifier,\n labelAlign = \"middle\",\n labelOffset = 10,\n labelDelimiter = helper.d3_defaultDelimiter,\n labelWrap = void 0,\n orient = \"vertical\",\n ascending = false,\n titleWidth = void 0,\n legendDispatcher = dispatch(\"cellover\", \"cellout\", \"cellclick\");\n\n function legend(svg) {\n var type = helper.d3_calcType(scale, ascending, cells, labels, locale.format(specifier), labelDelimiter),\n legendG = svg.selectAll(\"g\").data([scale]);\n\n if (cellFilter) {\n helper.d3_filterCells(type, cellFilter);\n }\n\n legendG.enter().append(\"g\").attr(\"class\", classPrefix + \"legendCells\");\n\n var cell = svg.select(\".\" + classPrefix + \"legendCells\").selectAll(\".\" + classPrefix + \"cell\").data(type.data);\n var cellEnter = cell.enter().append(\"g\").attr(\"class\", classPrefix + \"cell\");\n cellEnter.append(shape).attr(\"class\", classPrefix + \"swatch\");\n\n var shapes = svg.selectAll(\"g.\" + classPrefix + \"cell \" + shape + \".\" + classPrefix + \"swatch\");\n\n //add event handlers\n helper.d3_addEvents(cellEnter, legendDispatcher);\n\n //remove old shapes\n cell.exit().transition().style(\"opacity\", 0).remove();\n shapes.exit().transition().style(\"opacity\", 0).remove();\n shapes = shapes.merge(shapes);\n\n helper.d3_drawShapes(shape, shapes, shapeHeight, shapeWidth, shapeRadius, type.feature);\n var text = helper.d3_addText(svg, cellEnter, type.labels, classPrefix, labelWrap);\n\n // we need to merge the selection, otherwise changes in the legend (e.g. change of orientation) are applied only to the new cells and not the existing ones.\n cell = cellEnter.merge(cell);\n\n // sets placement\n var textSize = text.nodes().map(function (d) {\n return d.getBBox();\n }),\n shapeSize = shapes.nodes().map(function (d) {\n return d.getBBox();\n });\n\n var maxH = max(shapeSize, function (d) {\n return d.height;\n }),\n maxW = max(shapeSize, function (d) {\n return d.width;\n });\n\n var cellTrans = void 0,\n textTrans = void 0,\n textAlign = labelAlign == \"start\" ? 0 : labelAlign == \"middle\" ? 0.5 : 1;\n\n //positions cells and text\n if (orient === \"vertical\") {\n (function () {\n var cellSize = textSize.map(function (d, i) {\n return Math.max(maxH, d.height);\n });\n\n cellTrans = function cellTrans(d, i) {\n var height = sum(cellSize.slice(0, i));\n return \"translate(0, \" + (height + i * shapePadding) + \" )\";\n };\n textTrans = function textTrans(d, i) {\n return \"translate( \" + (maxW + labelOffset) + \",\\n \" + (shapeSize[i].y + shapeSize[i].height / 2 + 5) + \")\";\n };\n })();\n } else if (orient === \"horizontal\") {\n cellTrans = function cellTrans(d, i) {\n return \"translate( \" + i * (maxW + shapePadding) + \",0)\";\n };\n textTrans = function textTrans(d, i) {\n return \"translate( \" + (shapeSize[i].width * textAlign + shapeSize[i].x) + \",\\n \" + (maxH + labelOffset) + \")\";\n };\n }\n\n helper.d3_placement(orient, cell, cellTrans, text, textTrans, labelAlign);\n helper.d3_title(svg, title, classPrefix, titleWidth);\n cell.transition().style(\"opacity\", 1);\n }\n\n legend.scale = function (_) {\n if (!arguments.length) return scale;\n scale = _;\n return legend;\n };\n\n legend.cells = function (_) {\n if (!arguments.length) return cells;\n if (_.length > 1 || _ >= 2) {\n cells = _;\n }\n return legend;\n };\n\n legend.cellFilter = function (_) {\n if (!arguments.length) return cellFilter;\n cellFilter = _;\n return legend;\n };\n\n legend.shapePadding = function (_) {\n if (!arguments.length) return shapePadding;\n shapePadding = +_;\n return legend;\n };\n\n legend.labels = function (_) {\n if (!arguments.length) return labels;\n labels = _;\n return legend;\n };\n\n legend.labelAlign = function (_) {\n if (!arguments.length) return labelAlign;\n if (_ == \"start\" || _ == \"end\" || _ == \"middle\") {\n labelAlign = _;\n }\n return legend;\n };\n\n legend.locale = function (_) {\n if (!arguments.length) return locale;\n locale = formatLocale(_);\n return legend;\n };\n\n legend.labelFormat = function (_) {\n if (!arguments.length) return legend.locale().format(specifier);\n specifier = formatSpecifier(_);\n return legend;\n };\n\n legend.labelOffset = function (_) {\n if (!arguments.length) return labelOffset;\n labelOffset = +_;\n return legend;\n };\n\n legend.labelDelimiter = function (_) {\n if (!arguments.length) return labelDelimiter;\n labelDelimiter = _;\n return legend;\n };\n\n legend.labelWrap = function (_) {\n if (!arguments.length) return labelWrap;\n labelWrap = _;\n return legend;\n };\n\n legend.orient = function (_) {\n if (!arguments.length) return orient;\n _ = _.toLowerCase();\n if (_ == \"horizontal\" || _ == \"vertical\") {\n orient = _;\n }\n return legend;\n };\n\n legend.ascending = function (_) {\n if (!arguments.length) return ascending;\n ascending = !!_;\n return legend;\n };\n\n legend.classPrefix = function (_) {\n if (!arguments.length) return classPrefix;\n classPrefix = _;\n return legend;\n };\n\n legend.title = function (_) {\n if (!arguments.length) return title;\n title = _;\n return legend;\n };\n\n legend.titleWidth = function (_) {\n if (!arguments.length) return titleWidth;\n titleWidth = _;\n return legend;\n };\n\n legend.on = function () {\n var value = legendDispatcher.on.apply(legendDispatcher, arguments);\n return value === legendDispatcher ? legend : value;\n };\n\n return legend;\n}\n\nvar thresholdLabels = function thresholdLabels(_ref) {\n var i = _ref.i,\n genLength = _ref.genLength,\n generatedLabels = _ref.generatedLabels,\n labelDelimiter = _ref.labelDelimiter;\n\n if (i === 0) {\n var values = generatedLabels[i].split(\" \" + labelDelimiter + \" \");\n return \"Less than \" + values[1];\n } else if (i === genLength - 1) {\n var _values = generatedLabels[i].split(\" \" + labelDelimiter + \" \");\n return _values[0] + \" or more\";\n }\n return generatedLabels[i];\n};\n\nvar legendHelpers = {\n thresholdLabels: thresholdLabels\n};\n\nvar index = {\n legendColor: color,\n legendSize: size,\n legendSymbol: symbol,\n legendHelpers: legendHelpers\n};\n\nexport { color as legendColor, size as legendSize, symbol as legendSymbol, legendHelpers };export default index;\n//# sourceMappingURL=indexRollupNext.js.map\n","import { instanceOfIHighlight } from \"@hpcc-js/api\";\nimport { Database, Palette, SVGWidget, Widget } from \"@hpcc-js/common\";\nimport { format as d3Format } from \"d3-format\";\nimport { scaleOrdinal as d3ScaleOrdinal } from \"d3-scale\";\nimport {\n symbol as d3Symbol,\n symbolCircle as d3SymbolCircle,\n symbolCross as d3SymbolCross,\n symbolDiamond as d3SymbolDiamond,\n symbolSquare as d3SymbolSquare,\n symbolStar as d3SymbolStar,\n symbolTriangle as d3SymbolTriangle,\n symbolWye as d3SymbolWye\n} from \"d3-shape\";\nimport { legendColor as d3LegendColor } from \"d3-svg-legend\";\nimport { ChartPanel } from \"./ChartPanel.ts\";\n\nexport class Legend extends SVGWidget {\n _owner: ChartPanel;\n _targetWidget: Widget;\n _targetWidgetMonitor;\n _legendOrdinal;\n _disabled: string[] = [];\n\n private _symbolTypeMap = {\n \"circle\": d3SymbolCircle,\n \"cross\": d3SymbolCross,\n \"diamond\": d3SymbolDiamond,\n \"square\": d3SymbolSquare,\n \"star\": d3SymbolStar,\n \"triangle\": d3SymbolTriangle,\n \"wye\": d3SymbolWye\n };\n\n constructor(owner: ChartPanel) {\n super();\n this._owner = owner;\n this._drawStartPos = \"origin\";\n\n const context = this;\n this._legendOrdinal = d3LegendColor()\n .shape(\"path\", d3Symbol().type(d3SymbolCircle).size(150)())\n .shapePadding(10)\n .shapeRadius(10)\n .on(\"cellclick\", function (d) {\n context.onClick(d, this);\n })\n .on(\"cellover\", (d) => {\n context.onOver(d, this);\n })\n .on(\"cellout\", (d) => {\n context.onOut(d, this);\n })\n ;\n }\n\n isDisabled(d: string | Database.Field): boolean {\n if (typeof d === \"undefined\") {\n return false;\n } else if (typeof d === \"string\") {\n return d.indexOf(\"__\") === 0 || this._disabled.indexOf(d) >= 0;\n } else if (d instanceof Database.Field) {\n return d.id().indexOf(\"__\") === 0 || this._disabled.indexOf(d.id()) >= 0;\n }\n return this._disabled.indexOf(d) >= 0;\n }\n\n filteredFields(): Database.Field[] {\n switch (this.dataFamily()) {\n case \"2D\":\n return this.fields();\n case \"ND\":\n return this.fields().filter(d => !this.isDisabled(d));\n }\n return this.fields();\n }\n\n filteredColumns(): string[] {\n switch (this.dataFamily()) {\n case \"2D\":\n return this.columns();\n case \"ND\":\n return this.columns().filter(d => !this.isDisabled(d));\n }\n return this.columns();\n }\n\n filteredData(): any[][] {\n switch (this.dataFamily()) {\n case \"2D\":\n return this.data().filter(row => !this.isDisabled(row[0]));\n case \"ND\":\n const disabledCols: { [key: number]: boolean } = {};\n let anyDisabled: boolean = false;\n this.columns().forEach((col, idx) => {\n const disabled = this.isDisabled(col);\n disabledCols[idx] = disabled;\n if (disabled) {\n anyDisabled = true;\n }\n });\n return !anyDisabled ? this.data() : this.data().map(row => {\n return row.filter((cell, idx) => !disabledCols[idx]);\n });\n }\n return this.data();\n }\n\n isRainbow() {\n const widget = this.getWidget();\n return widget && widget._palette && widget._palette.type() === \"rainbow\";\n }\n\n targetWidget(): Widget;\n targetWidget(_: Widget): this;\n targetWidget(_?: Widget): Widget | this {\n if (!arguments.length) return this._targetWidget;\n this._targetWidget = _;\n if (this._targetWidgetMonitor) {\n this._targetWidgetMonitor.remove();\n delete this._targetWidgetMonitor;\n }\n if (this._targetWidget) {\n const context = this;\n this._targetWidgetMonitor = this._targetWidget.monitor(function (key, newProp, oldProp, source) {\n switch (key) {\n case \"chart\":\n case \"columns\":\n case \"data\":\n case \"paletteID\":\n context.lazyRender();\n break;\n }\n });\n }\n return this;\n }\n\n getWidget() {\n if (this._targetWidget) {\n switch (this._targetWidget.classID()) {\n case \"composite_MultiChart\":\n return (this._targetWidget as any).chart();\n }\n }\n return this._targetWidget;\n }\n\n getPalette(): Palette.OrdinalPaletteFunc | Palette.RainbowPaletteFunc {\n const widget = this.getWidget();\n if (widget && widget._palette) {\n switch (widget._palette.type()) {\n case \"ordinal\":\n return Palette.ordinal(widget._palette.id());\n case \"rainbow\":\n return Palette.rainbow(widget._palette.id());\n }\n }\n return Palette.ordinal(\"default\");\n }\n\n getPaletteType() {\n return this.getPalette().type();\n }\n\n fillColorFunc() {\n const widget = this.getWidget();\n if (widget && widget.fillColor) {\n // Legend will render before the widget, so its possible the widgets palette will not have switched yet...\n if (widget._palette && widget.paletteID && widget._palette.name !== widget.paletteID()) {\n widget._palette = widget._palette.switch(widget.paletteID());\n }\n return (row, col, sel) => {\n return widget.fillColor(row, col, sel);\n };\n }\n const palette = Palette.ordinal(widget && widget.paletteID ? widget.paletteID() || \"default\" : \"default\");\n return (row, col, sel) => {\n return palette(col);\n };\n }\n\n fillColor(row, col, sel) {\n return this.fillColorFunc()(row, col, sel);\n }\n\n protected _g;\n enter(domNode, element) {\n super.enter(domNode, element);\n this._g = element.append(\"g\")\n .attr(\"class\", \"legendOrdinal\")\n ;\n }\n\n calcMetaData() {\n let dataArr = [];\n let total = 0;\n let maxLabelWidth = 0;\n const colLength = this.columns().length;\n\n if (this._targetWidget) {\n const columns = this.columns();\n switch (this.getPaletteType()) {\n case \"ordinal\":\n const fillColor = this.fillColorFunc();\n let val = 0;\n switch (this.dataFamily()) {\n case \"2D\":\n dataArr = this.data().map(function (n, i) {\n val = this.data()[i].slice(1, colLength).reduce((acc, n) => acc + n, 0);\n const disabled = this.isDisabled(n[0]);\n if (!disabled) total += val;\n const label = n[0] + (!disabled && this.showSeriesTotal() ? ` (${val})` : \"\");\n const textSize = this.textSize(label);\n if (maxLabelWidth < textSize.width) maxLabelWidth = textSize.width;\n return [fillColor(n, n[0], false), n[0], label];\n }, this);\n break;\n case \"ND\":\n const widgetColumns = this.columns().filter(col => col.indexOf(\"__\") !== 0);\n dataArr = widgetColumns.filter(function (n, i) { return i > 0; }).map(function (n, i) {\n val = this.data().reduce((acc, n) => acc + n[i + 1], 0);\n const disabled = this.isDisabled(columns[i + 1]);\n const label = n + (!disabled && this.showSeriesTotal() ? ` (${val})` : \"\");\n if (!disabled) total += val;\n const textSize = this.textSize(label);\n if (maxLabelWidth < textSize.width) maxLabelWidth = textSize.width;\n return [fillColor(undefined, n, false), n, label];\n }, this);\n break;\n default:\n const widgetColumns2 = this.columns();\n dataArr = widgetColumns2.map(function (n) {\n return [fillColor(undefined, n, false), n];\n }, this);\n break;\n }\n break;\n case \"rainbow\":\n const palette = this.getPalette() as Palette.RainbowPaletteFunc;\n const format = d3Format(this.rainbowFormat());\n const widget = this.getWidget();\n const steps = this.rainbowBins();\n const weightMin: number = widget._dataMinWeight;\n const weightMax: number = widget._dataMaxWeight;\n const stepWeightDiff = (weightMax - weightMin) / (steps - 1);\n dataArr.push([palette(weightMin, weightMin, weightMax), format(weightMin)]);\n for (let x = 1; x < steps - 1; ++x) {\n let mid = stepWeightDiff * x;\n if (Math.floor(mid) > parseInt(dataArr[0][1])) {\n mid = Math.floor(mid);\n }\n dataArr.push([palette(mid, weightMin, weightMax), format(mid)]);\n }\n dataArr.push([palette(weightMax, weightMin, weightMax), format(weightMax)]);\n break;\n }\n }\n return {\n dataArr,\n total,\n maxLabelWidth\n };\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n\n const { dataArr, maxLabelWidth, total } = this.calcMetaData();\n\n const radius = this.shapeRadius();\n const size = this.radiusToSymbolSize(radius);\n\n const strokeWidth = 1;\n\n let shapePadding = this.itemPadding();// + strokeWidth;\n if (this.orientation() === \"horizontal\") {\n shapePadding += maxLabelWidth - (radius * 2);\n }\n\n const ordinal = d3ScaleOrdinal()\n .domain(dataArr.map(row => row[1]))\n .range(dataArr.map(row => row[0]));\n this._legendOrdinal\n .shape(\"path\", d3Symbol().type(this._symbolTypeMap[this.symbolType()]).size(size)())\n .orient(this.orientation())\n .title(this.title())\n .labelWrap(this.labelMaxWidth())\n .labelAlign(this.labelAlign())\n .shapePadding(shapePadding)\n .scale(ordinal)\n .labels(d => dataArr[d.i][2])\n ;\n\n this._g.call(this._legendOrdinal);\n\n this.updateDisabled(element, dataArr);\n\n const legendCellsBbox = this._g.select(\".legendCells\").node().getBBox();\n let offsetX = Math.abs(legendCellsBbox.x);\n let offsetY = Math.abs(legendCellsBbox.y) + strokeWidth;\n\n if (this.orientation() === \"horizontal\") {\n if (this.labelAlign() === \"start\") {\n offsetX += strokeWidth;\n } else if (this.labelAlign() === \"end\") {\n offsetX -= strokeWidth;\n }\n if (this.width() > legendCellsBbox.width) {\n const extraWidth = this.width() - legendCellsBbox.width;\n offsetX += (extraWidth / 2);\n }\n } else if (this.orientation() === \"vertical\") {\n offsetX += strokeWidth;\n if (this._containerSize.height > legendCellsBbox.height) {\n const extraHeight = this.height() - legendCellsBbox.height;\n offsetY += (extraHeight / 2);\n }\n }\n\n this._g.attr(\"transform\", `translate(${offsetX}, ${offsetY})`);\n this.pos({\n x: 0,\n y: 0\n });\n this._legendOrdinal\n .labelOffset(this.itemPadding())\n ;\n const legendTotal = this._g.selectAll(\".legendTotal\").data(dataArr.length && this.showLegendTotal() ? [total] : []);\n const totalText = `Total: ${total}`;\n const totalOffsetX = -offsetX;\n const totalOffsetY = legendCellsBbox.height + this.itemPadding() + strokeWidth;\n this.enableOverflowScroll(false);\n this.enableOverflow(true);\n legendTotal\n .enter()\n .append(\"text\")\n .classed(\"legendTotal\", true)\n .merge(legendTotal)\n .attr(\"transform\", `translate(${totalOffsetX}, ${totalOffsetY})`)\n .text(totalText)\n ;\n legendTotal.exit().remove();\n }\n\n updateDisabled(element, dataArr) {\n element\n .style(\"cursor\", \"pointer\")\n .selectAll(\"path.swatch\").filter((d, i) => i < dataArr.length)\n .style(\"stroke\", (d, i) => dataArr[i][0])\n .style(\"fill\", (d, i) =>\n this._disabled.indexOf(d) < 0 ? dataArr[i][0] : \"white\"\n )\n ;\n }\n\n postUpdate(domNode, element) {\n let w;\n if (this._boundingBox) {\n w = this._boundingBox.width;\n this._boundingBox.width = this._size.width;\n }\n super.postUpdate(domNode, element);\n if (w !== undefined) {\n this._boundingBox.width = w;\n }\n this._parentRelativeDiv.style(\"overflow\", \"hidden\");\n }\n\n exit(domNode, element) {\n super.exit(domNode, element);\n }\n\n radiusToSymbolSize(radius) {\n const circleSize = Math.pow(radius, 2) * Math.PI;\n switch (this.symbolType()) {\n case \"star\":\n return circleSize * 0.45;\n case \"triangle\":\n return circleSize * 0.65;\n case \"cross\":\n case \"diamond\":\n case \"wye\":\n return circleSize * 0.75;\n case \"circle\":\n return circleSize;\n case \"square\":\n return circleSize * 1.3;\n }\n }\n\n onClick(d, domNode) {\n switch (this.getPaletteType()) {\n case \"ordinal\":\n switch (this.dataFamily()) {\n case \"2D\":\n case \"ND\":\n const disabledIdx = this._disabled.indexOf(d);\n if (disabledIdx < 0) {\n this._disabled.push(d);\n } else {\n this._disabled.splice(disabledIdx, 1);\n }\n this._owner.refreshColumns();\n this._owner.refreshData();\n this._owner.render();\n break;\n }\n break;\n }\n }\n\n onOver(d, domNode) {\n if (instanceOfIHighlight(this._owner)) {\n switch (this.getPaletteType()) {\n case \"ordinal\":\n switch (this.dataFamily()) {\n case \"2D\":\n case \"ND\":\n if (this._disabled.indexOf(d) < 0) {\n this._owner.highlightColumn(d);\n }\n break;\n }\n break;\n }\n }\n }\n\n onOut(d, domNode) {\n if (instanceOfIHighlight(this._owner)) {\n switch (this.getPaletteType()) {\n case \"ordinal\":\n switch (this.dataFamily()) {\n case \"2D\":\n case \"ND\":\n this._owner.highlightColumn();\n break;\n }\n break;\n }\n }\n }\n\n onDblClick(rowData, rowIdx) {\n }\n\n onMouseOver(rowData, rowIdx) {\n }\n private _containerSize;\n resize(_size?: { width: number, height: number }) {\n let retVal;\n if (this.fitToContent()) {\n this._containerSize = _size;\n const bbox = this.getBBox();\n if (_size.width > bbox.width) {\n bbox.width = _size.width;\n }\n if (_size.height > bbox.height) {\n bbox.height = _size.height;\n }\n retVal = super.resize.apply(this, [{ ...bbox }]);\n } else {\n retVal = super.resize.apply(this, arguments);\n }\n return retVal;\n }\n\n}\nLegend.prototype._class += \" layout_Legend\";\n\nexport interface Legend {\n title(): string;\n title(_: string): this;\n symbolType(): \"circle\" | \"cross\" | \"diamond\" | \"square\" | \"star\" | \"triangle\" | \"wye\";\n symbolType(_: \"circle\" | \"cross\" | \"diamond\" | \"square\" | \"star\" | \"triangle\" | \"wye\"): this;\n labelMaxWidth(): number;\n labelMaxWidth(_: number): this;\n orientation(): \"vertical\" | \"horizontal\";\n orientation(_: \"vertical\" | \"horizontal\"): this;\n orientation_exists: () => boolean;\n dataFamily(): \"1D\" | \"2D\" | \"ND\" | \"map\" | \"graph\" | \"any\";\n dataFamily(_: \"1D\" | \"2D\" | \"ND\" | \"map\" | \"graph\" | \"any\"): this;\n dataFamily_exists: () => boolean;\n rainbowFormat(): string;\n rainbowFormat(_: string): this;\n rainbowFormat_exists: () => boolean;\n rainbowBins(): number;\n rainbowBins(_: number): this;\n rainbowBins_exists: () => boolean;\n showSeriesTotal(): boolean;\n showSeriesTotal(_: boolean): this;\n showLegendTotal(): boolean;\n showLegendTotal(_: boolean): this;\n itemPadding(): number;\n itemPadding(_: number): this;\n shapeRadius(): number;\n shapeRadius(_: number): this;\n fitToContent(): boolean;\n fitToContent(_: boolean): this;\n labelAlign(): \"start\" | \"middle\" | \"end\";\n labelAlign(_: \"start\" | \"middle\" | \"end\"): this;\n}\nLegend.prototype.publish(\"title\", \"\", \"string\", \"Title\");\nLegend.prototype.publish(\"symbolType\", \"circle\", \"set\", \"Shape of each legend item\", [\"circle\", \"cross\", \"diamond\", \"square\", \"star\", \"triangle\", \"wye\"]);\nLegend.prototype.publish(\"labelMaxWidth\", null, \"number\", \"Max Label Width (pixels)\", null, { optional: true });\nLegend.prototype.publish(\"orientation\", \"vertical\", \"set\", \"Orientation of Legend rows\", [\"vertical\", \"horizontal\"], { tags: [\"Private\"] });\nLegend.prototype.publish(\"dataFamily\", \"ND\", \"set\", \"Type of data\", [\"1D\", \"2D\", \"ND\", \"map\", \"graph\", \"any\"], { tags: [\"Private\"] });\nLegend.prototype.publish(\"rainbowFormat\", \",\", \"string\", \"Rainbow number formatting\", null, { tags: [\"Private\"], optional: true, disable: w => !w.isRainbow() });\nLegend.prototype.publish(\"rainbowBins\", 8, \"number\", \"Number of rainbow bins\", null, { tags: [\"Private\"], disable: w => !w.isRainbow() });\nLegend.prototype.publish(\"showSeriesTotal\", false, \"boolean\", \"Show value next to series\");\nLegend.prototype.publish(\"showLegendTotal\", false, \"boolean\", \"Show a total of the series values under the legend\", null);\nLegend.prototype.publish(\"itemPadding\", 8, \"number\", \"Padding between legend items (pixels)\");\nLegend.prototype.publish(\"shapeRadius\", 7, \"number\", \"Radius of legend shape (pixels)\");\nLegend.prototype.publish(\"fitToContent\", true, \"boolean\", \"If true, resize will simply reapply the bounding box dimensions\");\nLegend.prototype.publish(\"labelAlign\", \"start\", \"set\", \"Horizontal alignment of legend item label (for horizontal orientation only)\", [\"start\", \"middle\", \"end\"], { optional: true, disable: (w: any) => w.orientation() === \"vertical\" });\n","import { HTMLWidget, ISize, Widget } from \"@hpcc-js/common\";\n\nimport \"../src/Modal.css\";\n\nexport class Modal extends HTMLWidget {\n\n protected _widget: Widget;\n\n protected _relativeTarget: HTMLElement;\n\n protected _fade;\n protected _modal;\n protected _modalHeader;\n protected _modalBody;\n protected _modalHeaderAnnotations;\n protected _modalHeaderCloseButton;\n _close: () => void;\n\n constructor() {\n super();\n this._tag = \"div\";\n }\n\n closeModal() {\n this.visible(false);\n }\n\n getRelativeTarget() {\n let relativeTarget;\n if (this.relativeTargetId()) {\n relativeTarget = document.getElementById(this.relativeTargetId());\n if (relativeTarget) {\n return relativeTarget;\n }\n }\n if (!relativeTarget) {\n relativeTarget = this.locateAncestor(\"layout_Grid\");\n if (relativeTarget && relativeTarget.element) {\n return relativeTarget.element().node();\n }\n }\n return document.body;\n }\n\n setModalSize(): ISize {\n if (this.fixedHeight() !== null && this.fixedWidth() !== null) {\n this._modal\n .style(\"height\", this.fixedHeight())\n .style(\"width\", this.fixedWidth())\n .style(\"min-height\", null)\n .style(\"min-width\", null)\n .style(\"max-height\", null)\n .style(\"max-width\", null)\n ;\n } else if (this.minHeight() || this.minWidth()) {\n this._modal\n .style(\"min-height\", this.minHeight())\n .style(\"min-width\", this.minWidth())\n .style(\"max-height\", this.maxHeight())\n .style(\"max-width\", this.maxWidth())\n ;\n }\n const modalRect = this._modal.node().getBoundingClientRect();\n const headerRect = this._modalHeader.node().getBoundingClientRect();\n this._modalBody\n .style(\"height\", (modalRect.height - headerRect.height) + \"px\")\n .style(\"width\", modalRect.width);\n\n return modalRect;\n }\n\n setFadePosition(rect) {\n this._fade\n .style(\"top\", rect.top + \"px\")\n .style(\"left\", rect.left + \"px\")\n .style(\"width\", rect.width + \"px\")\n .style(\"height\", rect.height + \"px\")\n ;\n }\n\n setModalPosition(rect) {\n const modalRect = this.setModalSize();\n if (this.fixedTop() !== null && this.fixedLeft() !== null) {\n this._modal\n .style(\"top\", `calc(${this.fixedTop()} + ${rect.top}px)`)\n .style(\"left\", `calc(${this.fixedLeft()} + ${rect.left}px)`)\n ;\n } else if (this.fixedHeight() !== null && this.fixedWidth() !== null) {\n this._modal\n .style(\"top\", (rect.top + (rect.height / 2) - (modalRect.height / 2)) + \"px\")\n .style(\"left\", (rect.left + (rect.width / 2) - (modalRect.width / 2)) + \"px\")\n ;\n } else if (this.minHeight() || this.minWidth()) {\n const contentRect = this._modal.node().getBoundingClientRect();\n this._modal\n .style(\"top\", (rect.top + (rect.height / 2) - (contentRect.height / 2)) + \"px\")\n .style(\"left\", (rect.left + (rect.width / 2) - (contentRect.width / 2)) + \"px\")\n ;\n }\n }\n\n resize(size?: any): this {\n super.resize();\n if (this._modal) this.setModalSize();\n return this;\n }\n\n resizeBodySync(width: number, height: number): this {\n const header = this._modalHeader.node();\n const headerRect = header.getBoundingClientRect();\n\n this._modal\n .style(\"width\", width + \"px\")\n .style(\"height\", (height + headerRect.height) + \"px\")\n .style(\"min-width\", width + \"px\")\n .style(\"min-height\", (height + headerRect.height) + \"px\")\n ;\n this._modalHeader\n .style(\"width\", width + \"px\")\n ;\n this._modalBody\n .style(\"width\", width + \"px\")\n .style(\"height\", height + \"px\")\n ;\n return this\n .minWidth(width + \"px\")\n .minHeight((height + headerRect.height) + \"px\")\n .resize({\n height: height + headerRect.height,\n width\n })\n ;\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this._fade = element.append(\"div\")\n .classed(\"layout_Modal-fade\", true)\n .classed(\"layout_Modal-fadeClickable\", this.enableClickFadeToClose())\n .classed(\"layout_Modal-fade-hidden\", !this.showFade())\n ;\n const header_h = this.titleFontSize() * 2;\n this._modal = element.append(\"div\")\n .classed(\"layout_Modal-content\", true)\n ;\n this._modalHeader = this._modal.append(\"div\")\n .classed(\"layout_Modal-header\", true)\n .style(\"color\", this.titleFontColor())\n .style(\"font-size\", this.titleFontSize() + \"px\")\n .style(\"height\", header_h + \"px\")\n ;\n this._modalBody = this._modal.append(\"div\")\n .classed(\"layout_Modal-body\", true)\n .style(\"height\", `calc( 100% - ${header_h}px )`)\n .style(\"overflow-x\", this.overflowX())\n .style(\"overflow-y\", this.overflowY())\n ;\n this._modalHeader.append(\"div\")\n .classed(\"layout_Modal-title\", true)\n .style(\"line-height\", this.titleFontSize() + \"px\")\n .style(\"top\", (this.titleFontSize() / 2) + \"px\")\n .style(\"left\", (this.titleFontSize() / 2) + \"px\")\n .text(this.formattedTitle())\n ;\n\n this._modalHeaderAnnotations = this._modalHeader.append(\"div\")\n .classed(\"layout_Modal-annotations\", true)\n ;\n this._modalHeaderCloseButton = this._modalHeaderAnnotations.append(\"div\")\n .classed(\"layout_Modal-closeButton\", true)\n .html(\"<i class=\\\"fa fa-close\\\"></i>\")\n ;\n\n this._modalHeaderAnnotations\n .style(\"line-height\", this.titleFontSize() + \"px\")\n .style(\"right\", (this.titleFontSize() / 2) + \"px\")\n .style(\"top\", (this.titleFontSize() / 2) + \"px\")\n ;\n this._modalHeaderCloseButton.on(\"click\", () => {\n this.closeModal();\n });\n this._fade.on(\"click\", n => {\n if (this.enableClickFadeToClose()) {\n this.closeModal();\n }\n });\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n element.style(\"display\", this.show() ? null : \"none\");\n this._fade.classed(\"layout_Modal-fade-hidden\", !this.showFade());\n this._relativeTarget = this.getRelativeTarget();\n\n this.setModalSize();\n const rect = this._relativeTarget.getBoundingClientRect();\n this.setFadePosition(rect);\n this.setModalPosition(rect);\n\n if (this.show()) {\n if (!this._widget.target()) {\n this._widget.target(this._modalBody.node());\n }\n this._widget.resize().render();\n } else {\n this._widget\n .target(null)\n .render()\n ;\n }\n }\n\n exit(domNode, element) {\n if (this._widget) {\n this._widget.target(null);\n }\n super.exit(domNode, element);\n }\n\n formattedTitle() {\n const title = this.title_exists() ? this.title().trim() : \"\";\n if (title.length > 0 && title.slice(0, 1) === \"(\" && title.slice(-1) === \")\") {\n return title.slice(1, -1);\n }\n return this.title();\n }\n}\nModal.prototype._class += \" layout_Modal\";\n\nexport interface Modal {\n show(): boolean;\n show(_: boolean): this;\n showFade(): boolean;\n showFade(_: boolean): this;\n enableClickFadeToClose(): boolean;\n enableClickFadeToClose(_: boolean): this;\n title(): string;\n title(_: string): this;\n title_exists(): boolean;\n titleFontSize(): number;\n titleFontSize(_: number): this;\n titleFontColor(): string;\n titleFontColor(_: string): this;\n minWidth(): string;\n minWidth(_: string): this;\n minHeight(): string;\n minHeight(_: string): this;\n maxWidth(): string;\n maxWidth(_: string): this;\n maxHeight(): string;\n maxHeight(_: string): this;\n fixedWidth(): string;\n fixedWidth(_: string): this;\n fixedHeight(): string;\n fixedHeight(_: string): this;\n fixedTop(): string;\n fixedTop(_: string): this;\n fixedLeft(): string;\n fixedLeft(_: string): this;\n relativeTargetId(): string;\n relativeTargetId(_: string): this;\n widget(): Widget;\n widget(_: Widget): this;\n overflowX(): \"hidden\" | \"scroll\";\n overflowX(_: \"hidden\" | \"scroll\"): this;\n overflowY(): \"hidden\" | \"scroll\";\n overflowY(_: \"hidden\" | \"scroll\"): this;\n}\n\nModal.prototype.publish(\"title\", null, \"string\", \"title\");\nModal.prototype.publish(\"widget\", null, \"widget\", \"widget\");\nModal.prototype.publish(\"titleFontSize\", 18, \"number\", \"titleFontSize (in pixels)\");\nModal.prototype.publish(\"titleFontColor\", \"#ffffff\", \"html-color\", \"titleFontColor\");\nModal.prototype.publish(\"relativeTargetId\", null, \"string\", \"relativeTargetId\");\n\nModal.prototype.publish(\"show\", true, \"boolean\", \"show\");\nModal.prototype.publish(\"showFade\", true, \"boolean\", \"showFade\");\nModal.prototype.publish(\"enableClickFadeToClose\", true, \"boolean\", \"enableClickFadeToClose\");\n\nModal.prototype.publish(\"minWidth\", \"400px\", \"string\", \"minWidth\");\nModal.prototype.publish(\"minHeight\", \"400px\", \"string\", \"minHeight\");\nModal.prototype.publish(\"maxWidth\", \"800px\", \"string\", \"maxWidth\");\nModal.prototype.publish(\"maxHeight\", \"800px\", \"string\", \"maxHeight\");\nModal.prototype.publish(\"fixedWidth\", null, \"string\", \"fixedWidth\");\nModal.prototype.publish(\"fixedHeight\", null, \"string\", \"fixedHeight\");\nModal.prototype.publish(\"fixedTop\", null, \"string\", \"fixedTop\");\nModal.prototype.publish(\"fixedLeft\", null, \"string\", \"fixedLeft\");\nModal.prototype.publish(\"overflowX\", \"hidden\", \"string\", \"overflowX\");\nModal.prototype.publish(\"overflowY\", \"scroll\", \"string\", \"overflowY\");\n","import { IHighlight } from \"@hpcc-js/api\";\nimport { Button, Database, IconBar, ProgressBar, Spacer, SVGWidget, Text, TitleBar, ToggleButton, Utility, Widget } from \"@hpcc-js/common\";\nimport type { XYAxis } from \"@hpcc-js/chart\";\nimport { Table } from \"@hpcc-js/dgrid\";\nimport { select as d3Select } from \"d3-selection\";\nimport { Border2 } from \"./Border2.ts\";\nimport { Carousel } from \"./Carousel.ts\";\nimport { Legend } from \"./Legend.ts\";\nimport { Modal } from \"./Modal.ts\";\n\nimport \"../src/ChartPanel.css\";\n\nexport class ChartPanel<T extends Widget = Widget> extends Border2 implements IHighlight {\n\n protected _legend = new Legend(this).enableOverflow(true);\n protected _progressBar = new ProgressBar();\n protected _autoScale = false;\n protected _resolutions = {\n tiny: { width: 100, height: 100 },\n small: { width: 300, height: 300 }\n };\n private _modal = new Modal();\n private _highlight: boolean;\n private _scale: number;\n private _orig_size: any;\n\n private _toggleInfo = new ToggleButton().faChar(\"fa-info-circle\").tooltip(\".Description\")\n .selected(false)\n .on(\"enabled\", () => {\n return this.description() !== \"\";\n })\n .on(\"click\", () => {\n if (this._toggleInfo.selected()) {\n this._modal\n .title(this.title())\n .widget(new Text().text(this.description()))\n .show(true)\n .render()\n ;\n\n const origCloseFunc = this._modal._close;\n this._modal._close = () => {\n this._toggleInfo\n .selected(false)\n .render()\n ;\n this._modal._close = origCloseFunc;\n };\n }\n })\n .on(\"mouseMove\", () => {\n /*\n this._modal.showPreview(true).render(n => {\n n.resize().render();\n });\n */\n })\n .on(\"mouseOut\", () => {\n /*\n if (this._modal.showPreview()) {\n this._modal.show(false).showPreview(false).render();\n }\n */\n });\n\n private _toggleData = new ToggleButton().faChar(\"fa-table\").tooltip(\"Data\")\n .on(\"click\", () => {\n this.dataVisible(this._toggleData.selected());\n this.render();\n });\n\n private _buttonDownload = new Button().faChar(\"fa-download\").tooltip(\"Download\")\n .on(\"click\", () => {\n this.downloadCSV();\n });\n\n private _buttonDownloadImage = new Button().faChar(\"fa-image\").tooltip(\"Download Image\")\n .on(\"click\", () => {\n this.downloadPNG();\n });\n\n private _toggleLegend = new ToggleButton().faChar(\"fa-list-ul\").tooltip(\"Legend\")\n .selected(false)\n .on(\"click\", () => {\n const selected = this._toggleLegend.selected();\n if (this.legendPosition() === \"bottom\") {\n this.showBottom(selected);\n } else if (this.legendPosition() === \"right\") {\n this.showRight(selected);\n }\n this.legendVisible(selected);\n this.render();\n });\n\n protected _spacer = new Spacer();\n\n _titleBar = new TitleBar().buttons([this._toggleData, this._buttonDownload, this._buttonDownloadImage, this._spacer, this._toggleLegend]);\n\n protected _carousel = new Carousel();\n protected _table = new Table();\n protected _widget: T;\n\n protected _hideLegendToggleList = [\"dgrid_Table\"];\n\n constructor() {\n super();\n this._tag = \"div\";\n }\n\n fields(): Database.Field[];\n fields(_: Database.Field[]): this;\n fields(_?: Database.Field[]): this | Database.Field[] {\n if (!arguments.length) return super.fields();\n super.fields(_);\n this._legend.fields(_);\n this.refreshFields();\n return this;\n }\n refreshFields() {\n this._widget.fields(this._legend.filteredFields());\n this._table.fields(this._legend.filteredFields());\n return this;\n }\n\n columns(): string[];\n columns(_: string[], asDefault?: boolean): this;\n columns(_?: string[], asDefault?: boolean): string[] | this {\n if (!arguments.length) return super.columns();\n super.columns(_, asDefault);\n this._legend.columns(_, asDefault);\n this.refreshColumns();\n return this;\n }\n refreshColumns() {\n this._widget.columns(this._legend.filteredColumns());\n this._table.columns(this._legend.filteredColumns());\n return this;\n }\n\n data(_?) {\n if (!arguments.length) return super.data();\n super.data(_);\n this._legend.data(_);\n this.refreshData();\n return this;\n }\n refreshData() {\n this._widget.data(this._legend.filteredData());\n this._table.data(this._legend.filteredData());\n return this;\n }\n\n highlight(): boolean;\n highlight(_: boolean): this;\n highlight(_?: boolean): boolean | this {\n if (!arguments.length) return this._highlight;\n this._highlight = _;\n return this;\n }\n\n startProgress() {\n this._progressBar.start();\n }\n\n finishProgress() {\n this._progressBar.finish();\n }\n\n buttons(): Widget[];\n buttons(_: Widget[]): this;\n buttons(_?: Widget[]): this | Widget[] {\n if (!arguments.length) return this._titleBar.buttons();\n this._titleBar.buttons(_);\n return this;\n }\n\n downloadCSV() {\n const namePrefix = this.downloadTitle() ? this.downloadTitle() : this.title() ? this.title() : \"data\";\n const nameSuffix = this.downloadTimestampSuffix() ? \"_\" + Utility.timestamp() : \"\";\n Utility.downloadString(\"CSV\", this._widget.export(\"CSV\"), namePrefix + nameSuffix);\n return this;\n }\n\n downloadPNG() {\n const widget = this.widget();\n if (widget instanceof SVGWidget) {\n if (!this.legendVisible()) {\n widget.downloadPNG(this.title());\n } else {\n widget.downloadPNG(this.title(), undefined, this._legend);\n }\n }\n return this;\n }\n\n highlightColumn(column?: string): this {\n if (column) {\n const cssTag = `series-${this.cssTag(column)}`;\n this._centerWA.element().selectAll(\".series\")\n .each(function () {\n const element = d3Select(this);\n const highlight = element.classed(cssTag);\n element\n .classed(\"highlight\", highlight)\n .classed(\"lowlight\", !highlight)\n ;\n })\n ;\n } else {\n this._centerWA.element().selectAll(\".series\")\n .classed(\"highlight\", false)\n .classed(\"lowlight\", false)\n ;\n }\n return this;\n }\n\n getResponsiveMode(): \"tiny\" | \"small\" | \"regular\" | \"none\" {\n if (!this.enableAutoscaling()) return \"none\";\n if (!this._autoScale) return \"regular\";\n if (this.size().width <= this._resolutions.tiny.width || this.size().height <= this._resolutions.tiny.height) {\n return \"tiny\";\n } else if (this.size().width <= this._resolutions.small.width || this.size().height <= this._resolutions.small.height) {\n return \"small\";\n }\n return \"regular\";\n }\n\n setOrigSize() {\n this._orig_size = JSON.parse(JSON.stringify(this.size()));\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this._modal\n .target(this.target())\n .relativeTargetId(this.id())\n ;\n\n this.top(this._titleBar);\n this.center(this._carousel);\n\n this._legend\n .targetWidget(this._widget)\n .orientation(\"vertical\")\n .title(\"\")\n .visible(false)\n ;\n\n this._progressBar.enter(domNode, element);\n this.setOrigSize();\n }\n\n preUpdateTiny(element) {\n element.selectAll(\"div.body,div.title-text,div.icon-bar\").style(\"display\", \"none\");\n }\n\n preUpdateSmall(element) {\n const scale_x = this._orig_size.width / this._resolutions.small.width;\n const scale_y = this._orig_size.height / this._resolutions.small.height;\n this._scale = Math.min(scale_x, scale_y);\n const x_is_smaller = this._scale === scale_x;\n this.size({\n width: x_is_smaller ? this._resolutions.small.width : this._orig_size.width * (1 / this._scale),\n height: !x_is_smaller ? this._resolutions.small.height : this._orig_size.height * (1 / this._scale)\n });\n element.select(\"div.title-icon\").style(\"position\", \"static\");\n element.selectAll(\"lhs\").style(\"display\", \"none\");\n element.selectAll(\"div.body,div.title-text,div.icon-bar\").style(\"display\", \"\");\n element.selectAll(\"div.data-count\").style(\"visibility\", \"hidden\");\n element.style(\"transform\", `scale(${this._scale})`);\n }\n\n preUpdateRegular(element) {\n element.selectAll(\"div.body,div.title-text,div.icon-bar\").style(\"display\", \"\");\n element.selectAll(\"div.data-count\").style(\"visibility\", \"hidden\");\n element.select(\"div.title-icon\").style(\"position\", \"static\");\n element.style(\"transform\", \"translate(0px,0px) scale(1)\");\n }\n\n private _prevdataVisible;\n private _prevlegendVisible;\n private _prevLegendPosition;\n private _prevChartDataFamily;\n private _prevChart;\n private _prevButtons;\n update(domNode, element) {\n super.update(domNode, element);\n }\n\n preUpdate(domNode, element) {\n\n super.preUpdate(domNode, element);\n\n if (this._prevLegendPosition !== this.legendPosition()) {\n if (this._legend.target() !== null) this._legend.target(null);\n if (this._prevLegendPosition !== undefined) {\n this.swap(this._prevLegendPosition, this.legendPosition());\n } else {\n this[this.legendPosition()](this._legend);\n }\n if (this.legendPosition() === \"right\") {\n this.rightOverflowX(\"hidden\");\n this.rightOverflowY(\"auto\");\n this.bottomOverflowX(\"visible\");\n this.bottomOverflowY(\"visible\");\n } else {\n this.rightOverflowX(\"visible\");\n this.rightOverflowY(\"visible\");\n this.bottomOverflowX(\"auto\");\n this.bottomOverflowY(\"hidden\");\n }\n this._prevLegendPosition = this.legendPosition();\n }\n\n if (this._prevdataVisible !== this.dataVisible()) {\n this._prevdataVisible = this.dataVisible();\n this._toggleData.selected(this._prevdataVisible);\n this._legend.visible(this._prevlegendVisible && !this._prevdataVisible);\n this._carousel.active(this._prevdataVisible ? 1 : 0);\n }\n\n if (this._prevlegendVisible !== this.legendVisible()) {\n this._prevlegendVisible = this.legendVisible();\n this._toggleLegend.selected(this._prevlegendVisible);\n this._legend.visible(this._prevlegendVisible && !this._prevdataVisible);\n }\n\n this._legend.orientation(this.legendPosition() === \"bottom\" ? \"horizontal\" : \"vertical\");\n\n this.showLeft(!this.left());\n\n switch (this.getResponsiveMode()) {\n case \"tiny\":\n this.preUpdateTiny(element);\n break;\n case \"small\":\n this.preUpdateSmall(element);\n break;\n case \"regular\":\n this.preUpdateRegular(element);\n break;\n }\n\n const chart = this._widget.classID() === \"composite_MultiChart\" ? this._widget[\"chart\"]() : this._widget;\n this._legend.dataFamily(chart._dataFamily || \"any\");\n\n if (this._prevChartDataFamily !== this._legend.dataFamily()) {\n this._prevChartDataFamily = this._legend.dataFamily();\n switch (this._prevChartDataFamily) {\n case \"any\":\n this._toggleLegend.selected(false);\n this._legend.visible(false);\n break;\n }\n }\n element.style(\"box-shadow\", this.highlight() ? `inset 0px 0px 0px ${this.highlightSize()}px ${this.highlightColor()}` : \"none\");\n\n if (this._hideLegendToggleList.indexOf(chart.classID()) !== -1) {\n this._spacer.visible(false);\n this._toggleLegend.visible(false);\n } else {\n this._spacer.visible(true);\n this._toggleLegend.visible(true);\n }\n if (this._prevChart !== chart) {\n this._prevChart = chart;\n const widgetIconBar = chart ? chart[\"_titleBar\"] || chart[\"_iconBar\"] : undefined;\n if (widgetIconBar && widgetIconBar instanceof IconBar) {\n this._prevButtons = this._prevButtons || [...this.buttons()];\n const buttons: Widget[] = [\n ...widgetIconBar.buttons(),\n new Spacer(),\n ...this._prevButtons\n ];\n widgetIconBar.buttons([]).render();\n this.buttons(buttons);\n } else if (this._prevButtons) {\n this.buttons(this._prevButtons);\n }\n }\n\n const hiddenButtons = [];\n if (!this.dataButtonVisible()) hiddenButtons.push(this._toggleData);\n if (!this.downloadButtonVisible()) hiddenButtons.push(this._buttonDownload);\n if (!this.downloadImageButtonVisible()) hiddenButtons.push(this._buttonDownloadImage);\n if (!this.legendButtonVisible()) hiddenButtons.push(this._toggleLegend);\n this._buttonDownloadImage.enabled(this.widget() instanceof SVGWidget);\n this._titleBar\n .hiddenButtons(hiddenButtons)\n .visible(this.titleVisible())\n ;\n this.topOverlay(this.titleOverlay() || !this.titleVisible());\n }\n\n postUpdate(domNode, element) {\n super.postUpdate(domNode, element);\n\n switch (this.getResponsiveMode()) {\n case \"tiny\":\n this.postUpdateTiny(element);\n break;\n case \"small\":\n this.postUpdateSmall(element);\n break;\n case \"regular\":\n this.postUpdateRegular(element);\n break;\n }\n }\n\n postUpdateTiny(element) {\n element.selectAll(\"div.body,div.title-text,div.icon-bar\").style(\"display\", \"none\");\n element.selectAll(\"div.data-count\")\n .style(\"visibility\", \"visible\")\n .style(\"font-size\", (this.titleIconFontSize() / 3) + \"px\")\n .style(\"line-height\", (this.titleIconFontSize() / 3) + \"px\")\n .style(\"left\", this.titleIconFontSize() + \"px\")\n .text(this.data().length)\n ;\n element.style(\"transform\", \"translate(0px,0px) scale(1)\");\n const iconDiv = element.selectAll(\"div.title-icon\");\n const _node = iconDiv.node();\n const _container = element.node().parentElement;\n const containerRect = _container.getBoundingClientRect();\n if (_node) {\n const rect = iconDiv.node().getBoundingClientRect();\n const icon_top = containerRect.height / 2;\n iconDiv\n .style(\"position\", \"absolute\")\n .style(\"left\", `calc(50% - ${rect.width / 2}px)`)\n .style(\"top\", `${icon_top - (rect.height / 2)}px`)\n ;\n element.selectAll(\"div.data-count\")\n .style(\"position\", \"absolute\")\n .style(\"left\", `calc(50% + ${rect.width / 2}px)`)\n .style(\"top\", `${icon_top - (rect.height / 2)}px`)\n ;\n }\n }\n\n postUpdateSmall(element) {\n element.selectAll(\"lhs\").style(\"display\", \"none\"); // TODO: a bug in Border2?\n element.selectAll(\"div.title-icon\").style(\"position\", \"static\");\n element.selectAll(\"div.body,div.title-text,div.icon-bar\").style(\"display\", \"\");\n element.selectAll(\"div.data-count\").style(\"visibility\", \"hidden\");\n const rect = element.node().getBoundingClientRect();\n const parentRect = element.node().parentElement.getBoundingClientRect();\n element.style(\"transform\", `translate(${parentRect.x - rect.x}px, ${parentRect.y - rect.y}px) scale(${this._scale})`);\n }\n\n postUpdateRegular(element) {\n element.selectAll(\"div.title-icon\").style(\"position\", \"static\");\n element.selectAll(\"div.body,div.title-text,div.icon-bar\").style(\"display\", \"\");\n element.selectAll(\"div.data-count\").style(\"visibility\", \"hidden\");\n }\n\n exit(domNode, element) {\n this._progressBar.exit(domNode, element);\n\n this.right(null);\n this._legend.target(null);\n this.center(null);\n this._carousel.target(null);\n this.top(null);\n this._titleBar.target(null);\n\n this._modal.target(null);\n\n delete this._prevChart;\n delete this._prevButtons;\n delete this._prevChartDataFamily;\n delete this._prevPos;\n delete this._prevdataVisible;\n delete this._prevlegendVisible;\n\n super.exit(domNode, element);\n }\n\n // Event Handlers ---\n // Events ---\n click(row, column, selected) {\n // console.log(\"Click: \" + JSON.stringify(row) + \", \" + column + \", \" + selected);\n }\n\n dblclick(row, column, selected) {\n // console.log(\"Double click: \" + JSON.stringify(row) + \", \" + column + \", \" + selected);\n }\n\n vertex_click(row, col, sel, more) {\n if (more && more.vertex) {\n // console.log(\"Vertex click: \" + more.vertex.id());\n }\n }\n\n vertex_dblclick(row, col, sel, more) {\n if (more && more.vertex) {\n // console.log(\"Vertex double click: \" + more.vertex.id());\n }\n }\n\n edge_click(row, col, sel, more) {\n if (more && more.edge) {\n // console.log(\"Edge click: \" + more.edge.id());\n }\n }\n\n edge_dblclick(row, col, sel, more) {\n if (more && more.edge) {\n // console.log(\"Edge double click: \" + more.edge.id());\n }\n }\n}\nChartPanel.prototype._class += \" layout_ChartPanel\";\n\nexport interface ChartPanel<T extends Widget = Widget> {\n title(): string;\n title(_: string): this;\n titleVisible(): boolean;\n titleVisible(_: boolean): this;\n titleOverlay(): boolean;\n titleOverlay(_: boolean): this;\n title_exists(): boolean;\n titleFontSize(): number;\n titleFontSize(_: number): this;\n titleFontSize_exists(): boolean;\n titleIconFontSize(): number;\n titleIconFontSize(_: number): this;\n titleIconFontSize_exists(): boolean;\n dataVisible(): boolean;\n dataVisible(_: boolean): this;\n dataButtonVisible(): boolean;\n dataButtonVisible(_: boolean): this;\n downloadButtonVisible(): boolean;\n downloadButtonVisible(_: boolean): this;\n downloadImageButtonVisible(): boolean;\n downloadImageButtonVisible(_: boolean): this;\n downloadTitle(): string;\n downloadTitle(_: string): this;\n downloadTimestampSuffix(): boolean;\n downloadTimestampSuffix(_: boolean): this;\n legendVisible(): boolean;\n legendVisible(_: boolean): this;\n legendButtonVisible(): boolean;\n legendButtonVisible(_: boolean): this;\n legendPosition(): \"right\" | \"bottom\";\n legendPosition(_: \"right\" | \"bottom\"): this;\n description(): string;\n description(_: string): this;\n description_exists(): boolean;\n widget(): T;\n widget(_: T): this;\n widget_exists(): boolean;\n enableAutoscaling(): boolean;\n enableAutoscaling(_: boolean): this;\n enableAutoscaling_exists(): boolean;\n highlightSize(): number;\n highlightSize(_: number): this;\n highlightSize_exists(): boolean;\n highlightColor(): string;\n highlightColor(_: string): this;\n highlightColor_exists(): boolean;\n}\n\nChartPanel.prototype.publishReset();\nChartPanel.prototype.publishProxy(\"title\", \"_titleBar\");\nChartPanel.prototype.publish(\"titleVisible\", true, \"boolean\");\nChartPanel.prototype.publish(\"titleOverlay\", false, \"boolean\");\nChartPanel.prototype.publishProxy(\"titleIcon\", \"_titleBar\");\nChartPanel.prototype.publishProxy(\"titleIconFont\", \"_titleBar\");\nChartPanel.prototype.publishProxy(\"titleFont\", \"_titleBar\");\nChartPanel.prototype.publishProxy(\"titleIconFontSize\", \"_titleBar\");\nChartPanel.prototype.publishProxy(\"titleFontSize\", \"_titleBar\");\nChartPanel.prototype.publishProxy(\"description\", \"_titleBar\");\nChartPanel.prototype.publishProxy(\"descriptionFont\", \"_titleBar\");\nChartPanel.prototype.publishProxy(\"descriptionFontSize\", \"_titleBar\");\nChartPanel.prototype.publish(\"dataVisible\", false, \"boolean\", \"Show data table\");\nChartPanel.prototype.publish(\"dataButtonVisible\", true, \"boolean\", \"Show data table button\");\nChartPanel.prototype.publish(\"downloadButtonVisible\", true, \"boolean\", \"Show data download button\");\nChartPanel.prototype.publish(\"downloadImageButtonVisible\", false, \"boolean\", \"Show image download button\");\nChartPanel.prototype.publish(\"downloadTitle\", \"\", \"string\", \"File name when downloaded\");\nChartPanel.prototype.publish(\"downloadTimestampSuffix\", true, \"boolean\", \"Use timestamp as file name suffix\");\nChartPanel.prototype.publish(\"legendVisible\", false, \"boolean\", \"Show legend\");\nChartPanel.prototype.publish(\"legendButtonVisible\", true, \"boolean\", \"Show legend button\");\nChartPanel.prototype.publish(\"legendPosition\", \"right\", \"set\", \"Position of legend\", [\"right\", \"bottom\"]);\nChartPanel.prototype.publishProxy(\"legend_labelMaxWidth\", \"_legend\", \"labelMaxWidth\");\nChartPanel.prototype.publishProxy(\"legend_showSeriesTotal\", \"_legend\", \"showSeriesTotal\");\nChartPanel.prototype.publishProxy(\"legend_showLegendTotal\", \"_legend\", \"showLegendTotal\");\nChartPanel.prototype.publishProxy(\"legend_itemPadding\", \"_legend\", \"itemPadding\");\nChartPanel.prototype.publishProxy(\"legend_shapeRadius\", \"_legend\", \"shapeRadius\");\nChartPanel.prototype.publishProxy(\"legend_symbolType\", \"_legend\", \"symbolType\");\nChartPanel.prototype.publishProxy(\"legend_labelAlign\", \"_legend\", \"labelAlign\");\nChartPanel.prototype.publish(\"widget\", null, \"widget\", \"Widget\", undefined, { render: false });\nChartPanel.prototype.publish(\"enableAutoscaling\", false, \"boolean\");\nChartPanel.prototype.publish(\"highlightSize\", 4, \"number\");\nChartPanel.prototype.publish(\"highlightColor\", \"#e67e22\", \"html-color\");\nChartPanel.prototype.publishProxy(\"progress_halfLife\", \"_progressBar\", \"halfLife\");\nChartPanel.prototype.publishProxy(\"progress_decay\", \"_progressBar\", \"decay\");\nChartPanel.prototype.publishProxy(\"progress_size\", \"_progressBar\", \"size\");\nChartPanel.prototype.publishProxy(\"progress_color\", \"_progressBar\", \"color\");\nChartPanel.prototype.publishProxy(\"progress_blurBar\", \"_progressBar\", \"blurBar\");\nChartPanel.prototype.publishProxy(\"progress_blurSize\", \"_progressBar\", \"blurSize\");\nChartPanel.prototype.publishProxy(\"progress_blurColor\", \"_progressBar\", \"blurColor\");\nChartPanel.prototype.publishProxy(\"progress_blurOpacity\", \"_progressBar\", \"blurOpacity\");\n\nChartPanel.prototype.widget = function (_?) {\n if (!arguments.length) return this._widget;\n this._carousel.widgets([_, this._table]);\n this._widget = _;\n this._widget\n .fields(this._legend.filteredFields())\n .data(this._legend.filteredData())\n ;\n\n const context = this;\n const tmpAny = this._widget as any;\n tmpAny.click = function () {\n context.click.apply(context, arguments);\n };\n tmpAny.dblclick = function () {\n context.dblclick.apply(context, arguments);\n };\n tmpAny.vertex_click = function () {\n context.vertex_click.apply(context, arguments);\n };\n tmpAny.vertex_dblclick = function () {\n context.vertex_dblclick.apply(context, arguments);\n };\n tmpAny.edge_click = function () {\n context.edge_click.apply(context, arguments);\n };\n tmpAny.edge_dblclick = function () {\n context.edge_dblclick.apply(context, arguments);\n };\n return this;\n};\n","import { HTMLWidget } from \"@hpcc-js/common\";\nimport { select as d3Select } from \"d3-selection\";\n\nimport \"../src/FlexGrid.css\";\n\nexport class FlexGrid extends HTMLWidget {\n constructor() {\n super();\n }\n enter(domNode, element) {\n super.enter(domNode, element);\n d3Select(domNode.parentNode)\n .style(\"height\", \"100%\")\n .style(\"width\", \"100%\")\n ;\n }\n update(domNode, element) {\n super.update(domNode, element);\n const context = this;\n\n const cachedSizes = [];\n this.updateFlexParent(element);\n const listItems = element.selectAll(\".FlexGrid-list-item\").data(this.widgets(), w => w.id());\n listItems.enter()\n .append(\"div\")\n .classed(\"FlexGrid-list-item\", true)\n .each(function (w) {\n w.target(this);\n })\n .merge(listItems)\n .style(\"min-height\", this.itemMinHeight() + \"px\")\n .style(\"min-width\", this.itemMinWidth() + \"px\")\n .style(\"flex-basis\", (n, i) => {\n const flexBasis = this.widgetsFlexBasis()[i];\n return typeof flexBasis !== \"undefined\" ? flexBasis : this.flexBasis();\n })\n .style(\"flex-grow\", (n, i) => {\n const flexGrow = this.widgetsFlexGrow()[i];\n return typeof flexGrow !== \"undefined\" ? flexGrow : this.flexGrow();\n })\n .style(\"border-width\", this.borderWidth() + \"px\")\n .style(\"border-color\", this.itemBorderColor())\n .each(function () {\n this.firstChild.style.display = \"none\";\n })\n .each(function () {\n const rect = this.getBoundingClientRect();\n cachedSizes.push([\n rect.width,\n rect.height\n ]);\n })\n .each(function (w, i) {\n this.firstChild.style.display = \"block\";\n w.resize({\n width: cachedSizes[i][0] - (2 * context.borderWidth()),\n height: cachedSizes[i][1] - (2 * context.borderWidth())\n });\n })\n ;\n listItems.exit().remove();\n }\n exit(domNode, element) {\n super.exit(domNode, element);\n }\n updateFlexParent(element) {\n element\n .style(\"height\", \"100%\")\n .style(\"flex-direction\", this.orientation() === \"horizontal\" ? \"row\" : \"column\")\n .style(\"flex-wrap\", this.flexWrap())\n .style(\"align-items\", this.alignItems())\n .style(\"align-content\", this.alignContent())\n .style(\"overflow-x\", () => {\n if (this.forceXScroll() || (this.orientation() === \"horizontal\" && this.flexWrap() === \"nowrap\" && !this.disableScroll())) {\n return \"scroll\";\n }\n return \"hidden\";\n })\n .style(\"overflow-y\", () => {\n if (this.forceYScroll() || (this.orientation() === \"vertical\" && this.flexWrap() === \"nowrap\" && !this.disableScroll())) {\n return \"scroll\";\n }\n return \"hidden\";\n })\n ;\n }\n}\nFlexGrid.prototype._class += \" layout_FlexGrid\";\n\nexport interface FlexGrid {\n widgets(): any;\n widgets(_: any): this;\n orientation(): \"horizontal\" | \"vertical\";\n orientation(_: \"horizontal\" | \"vertical\"): this;\n flexWrap(): \"nowrap\" | \"wrap\" | \"wrap-reverse\";\n flexWrap(_: \"nowrap\" | \"wrap\" | \"wrap-reverse\"): this;\n itemMinHeight(): number;\n itemMinHeight(_: number): this;\n itemMinWidth(): number;\n itemMinWidth(_: number): this;\n alignItems(): \"flex-start\" | \"center\" | \"flex-end\" | \"stretch\";\n alignItems(_: \"flex-start\" | \"center\" | \"flex-end\" | \"stretch\"): this;\n alignContent(): \"flex-start\" | \"center\" | \"flex-end\" | \"stretch\" | \"space-between\" | \"space-around\";\n alignContent(_: \"flex-start\" | \"center\" | \"flex-end\" | \"stretch\" | \"space-between\" | \"space-around\"): this;\n itemBorderColor(): string;\n itemBorderColor(_: string): this;\n borderWidth(): number;\n borderWidth(_: number): this;\n flexGrow(): number;\n flexGrow(_: number): this;\n widgetsFlexGrow(): number[];\n widgetsFlexGrow(_: number[]): this;\n flexBasis(): string;\n flexBasis(_: string): this;\n widgetsFlexBasis(): string[];\n widgetsFlexBasis(_: string[]): this;\n disableScroll(): boolean;\n disableScroll(_: boolean): this;\n forceXScroll(): boolean;\n forceXScroll(_: boolean): this;\n forceYScroll(): boolean;\n forceYScroll(_: boolean): this;\n}\n\nFlexGrid.prototype.publish(\"itemBorderColor\", \"transparent\", \"html-color\", \"Color of list item borders\");\nFlexGrid.prototype.publish(\"borderWidth\", 0, \"number\", \"Width of list item borders (pixels)\");\nFlexGrid.prototype.publish(\"orientation\", \"horizontal\", \"set\", \"Controls the flex-direction of the list items\", [\"horizontal\", \"vertical\"]);\nFlexGrid.prototype.publish(\"flexWrap\", \"wrap\", \"set\", \"Controls the line wrap when overflow occurs\", [\"nowrap\", \"wrap\", \"wrap-reverse\"]);\nFlexGrid.prototype.publish(\"disableScroll\", false, \"boolean\", \"If false, scrollbar will show (when flexWrap is set to 'nowrap')\", null, { disable: (w: any) => w.flexWrap() !== \"nowrap\" });\nFlexGrid.prototype.publish(\"forceXScroll\", false, \"boolean\", \"If true, horzontal scrollbar will show\");\nFlexGrid.prototype.publish(\"forceYScroll\", false, \"boolean\", \"If true, vertical scrollbar will show\");\nFlexGrid.prototype.publish(\"itemMinHeight\", 64, \"number\", \"Minimum height of a list item (pixels)\");\nFlexGrid.prototype.publish(\"itemMinWidth\", 64, \"number\", \"Minimum width of a list item (pixels)\");\nFlexGrid.prototype.publish(\"alignItems\", \"stretch\", \"set\", \"Controls normal alignment of items\", [\"flex-start\", \"center\", \"flex-end\", \"stretch\"]);\nFlexGrid.prototype.publish(\"alignContent\", \"stretch\", \"set\", \"Controls normal alignment of item rows\", [\"flex-start\", \"center\", \"flex-end\", \"stretch\", \"space-between\", \"space-around\"]);\nFlexGrid.prototype.publish(\"flexGrow\", 1, \"number\", \"Default flex-grow style for all list items\");\nFlexGrid.prototype.publish(\"flexBasis\", \"10%\", \"string\", \"Default flex-basis style for all list items\");\nFlexGrid.prototype.publish(\"widgetsFlexGrow\", [], \"array\", \"Array of flex-grow values keyed on the widgets array\");\nFlexGrid.prototype.publish(\"widgetsFlexBasis\", [], \"array\", \"Array of flex-basis values keyed on the widgets array\");\nFlexGrid.prototype.publish(\"widgets\", [], \"widgetArray\", \"Array of widgets to be rendered as list items\");\n","(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define([], factory);\n } else if (typeof exports === 'object') {\n // Node. Does not work with strict CommonJS, but\n // only CommonJS-like environments that support module.exports,\n // like Node.\n module.exports = factory();\n } else {\n // Browser globals (root is window)\n root.GridList = factory();\n }\n}(this, function() {\n\nvar GridList = function(items, options) {\n /**\n * A GridList manages the two-dimensional positions from a list of items,\n * within a virtual matrix.\n *\n * The GridList's main function is to convert the item positions from one\n * grid size to another, maintaining as much of their order as possible.\n *\n * The GridList's second function is to handle collisions when moving an item\n * over another.\n *\n * The positioning algorithm places items in columns. Starting from left to\n * right, going through each column top to bottom.\n *\n * The size of an item is expressed using the number of cols and rows it\n * takes up within the grid (w and h)\n *\n * The position of an item is express using the col and row position within\n * the grid (x and y)\n *\n * An item is an object of structure:\n * {\n * w: 3, h: 1,\n * x: 0, y: 1\n * }\n */\n\n this._options = options;\n for (var k in this.defaults) {\n if (!this._options.hasOwnProperty(k)) {\n this._options[k] = this.defaults[k];\n }\n }\n\n this.items = items;\n\n this._adjustSizeOfItems();\n\n this.generateGrid();\n};\n\nGridList.cloneItems = function(items, _items) {\n /**\n * Clone items with a deep level of one. Items are not referenced but their\n * properties are\n */\n var _item,\n i,\n k;\n if (_items === undefined) {\n _items = [];\n }\n for (i = 0; i < items.length; i++) {\n // XXX: this is good because we don't want to lose item reference, but\n // maybe we should clear their properties since some might be optional\n if (!_items[i]) {\n _items[i] = {};\n }\n for (k in items[i]) {\n _items[i][k] = items[i][k];\n }\n }\n return _items;\n};\n\nGridList.prototype = {\n\n defaults: {\n lanes: 5,\n direction: 'horizontal'\n },\n\n /**\n * Illustates grid as text-based table, using a number identifier for each\n * item. E.g.\n *\n * #| 0 1 2 3 4 5 6 7 8 9 10 11 12 13\n * --------------------------------------------\n * 0| 00 02 03 04 04 06 08 08 08 12 12 13 14 16\n * 1| 01 -- 03 05 05 07 09 10 11 11 -- 13 15 --\n *\n * Warn: Does not work if items don't have a width or height specified\n * besides their position in the grid.\n */\n toString: function() {\n var widthOfGrid = this.grid.length,\n output = '\\n #|',\n border = '\\n --',\n item,\n i,\n j;\n\n // Render the table header\n for (i = 0; i < widthOfGrid; i++) {\n output += ' ' + this._padNumber(i, ' ');\n border += '---';\n };\n output += border;\n\n // Render table contents row by row, as we go on the y axis\n for (i = 0; i < this._options.lanes; i++) {\n output += '\\n' + this._padNumber(i, ' ') + '|';\n for (j = 0; j < widthOfGrid; j++) {\n output += ' ';\n item = this.grid[j][i];\n output += item ? this._padNumber(this.items.indexOf(item), '0') : '--';\n }\n };\n output += '\\n';\n return output;\n },\n\n generateGrid: function() {\n /**\n * Build the grid structure from scratch, with the current item positions\n */\n var i;\n this._resetGrid();\n for (i = 0; i < this.items.length; i++) {\n this._markItemPositionToGrid(this.items[i]);\n }\n },\n\n resizeGrid: function(lanes) {\n var currentColumn = 0;\n\n this._options.lanes = lanes;\n this._adjustSizeOfItems();\n\n this._sortItemsByPosition();\n this._resetGrid();\n\n // The items will be sorted based on their index within the this.items array,\n // that is their \"1d position\"\n for (var i = 0; i < this.items.length; i++) {\n var item = this.items[i],\n position = this._getItemPosition(item);\n\n this._updateItemPosition(\n item, this.findPositionForItem(item, {x: currentColumn, y: 0}));\n\n // New items should never be placed to the left of previous items\n currentColumn = Math.max(currentColumn, position.x);\n }\n\n this._pullItemsToLeft();\n },\n\n findPositionForItem: function(item, start, fixedRow) {\n /**\n * This method has two options for the position we want for the item:\n * - Starting from a certain row/column number and only looking for\n * positions to its right\n * - Accepting positions for a certain row number only (use-case: items\n * being shifted to the left/right as a result of collisions)\n *\n * @param {Object<x:Number, y:Number, w:Number, h:Number} item\n * @param {Object<x:Number, y:Number} start Position from which to start\n * the search.\n * @param {Number} [fixedRow] If provided, we're going to try to find a\n * position for the new item on it. If doesn't fit there, we're going\n * to put it on the first row.\n *\n * @returns {Number[2]} x and y.\n */\n\n var x, y, position;\n\n // Start searching for a position from the horizontal position of the\n // rightmost item from the grid\n for (x = start.x; x < this.grid.length; x++) {\n if (fixedRow !== undefined) {\n position = [x, fixedRow];\n\n if (this._itemFitsAtPosition(item, position)) {\n return position;\n }\n } else {\n for (y = start.y; y < this._options.lanes; y++) {\n position = [x, y];\n\n if (this._itemFitsAtPosition(item, position)) {\n return position;\n }\n }\n }\n }\n\n // If we've reached this point, we need to start a new column\n var newCol = this.grid.length,\n newRow = 0;\n\n if (fixedRow !== undefined &&\n this._itemFitsAtPosition(item, [newCol, fixedRow])) {\n newRow = fixedRow;\n }\n\n return [newCol, newRow];\n },\n\n moveItemToPosition: function(item, newPosition) {\n var position = this._getItemPosition({\n x: newPosition[0],\n y: newPosition[1],\n w: item.w,\n h: item.h\n });\n\n this._updateItemPosition(item, [position.x, position.y]);\n this._resolveCollisions(item);\n },\n\n resizeItem: function(item, size) {\n /**\n * Resize an item and resolve collisions.\n *\n * @param {Object} item A reference to an item that's part of the grid.\n * @param {Object} size\n * @param {Number} [size.w=item.w] The new width.\n * @param {Number} [size.h=item.h] The new height.\n */\n\n var width = size.w || item.w,\n height = size.h || item.h;\n\n this._updateItemSize(item, width, height);\n\n this._resolveCollisions(item);\n\n this._pullItemsToLeft();\n },\n\n getChangedItems: function(initialItems, idAttribute) {\n /**\n * Compare the current items against a previous snapshot and return only\n * the ones that changed their attributes in the meantime. This includes both\n * position (x, y) and size (w, h)\n *\n * Since both their position and size can change, the items need an\n * additional identifier attribute to match them with their previous state\n */\n var changedItems = [];\n\n for (var i = 0; i < initialItems.length; i++) {\n var item = this._getItemByAttribute(idAttribute,\n initialItems[i][idAttribute]);\n\n if (item.x !== initialItems[i].x ||\n item.y !== initialItems[i].y ||\n item.w !== initialItems[i].w ||\n item.h !== initialItems[i].h) {\n changedItems.push(item);\n }\n }\n\n return changedItems;\n },\n\n _sortItemsByPosition: function() {\n this.items.sort(function(item1, item2) {\n var position1 = this._getItemPosition(item1),\n position2 = this._getItemPosition(item2);\n\n // Try to preserve columns.\n if (position1.x != position2.x) {\n return position1.x - position2.x;\n }\n\n if (position1.y != position2.y) {\n return position1.y - position2.y;\n }\n\n // The items are placed on the same position.\n return 0;\n }.bind(this));\n },\n\n _adjustSizeOfItems: function() {\n /**\n * Some items can have 100% height or 100% width. Those dimmensions are\n * expressed as 0. We need to ensure a valid width and height for each of\n * those items as the number of items per lane.\n */\n\n for (var i = 0; i < this.items.length; i++) {\n var item = this.items[i];\n\n // This can happen only the first time items are checked.\n // We need the property to have a value for all the items so that the\n // `cloneItems` method will merge the properties properly. If we only set\n // it to the items that need it then the following can happen:\n //\n // cloneItems([{id: 1, autoSize: true}, {id: 2}],\n // [{id: 2}, {id: 1, autoSize: true}]);\n //\n // will result in\n //\n // [{id: 1, autoSize: true}, {id: 2, autoSize: true}]\n if (item.autoSize === undefined) {\n item.autoSize = item.w === 0 || item.h === 0;\n }\n\n if (item.autoSize) {\n if (this._options.direction === 'horizontal') {\n item.h = this._options.lanes;\n } else {\n item.w = this._options.lanes;\n }\n }\n }\n },\n\n _resetGrid: function() {\n this.grid = [];\n },\n\n _itemFitsAtPosition: function(item, newPosition) {\n /**\n * Check that an item wouldn't overlap with another one if placed at a\n * certain position within the grid\n */\n\n var position = this._getItemPosition(item),\n x, y, row;\n\n // No coordonate can be negative\n if (newPosition[0] < 0 || newPosition[1] < 0) {\n return false;\n }\n\n // Make sure the item isn't larger than the entire grid\n if (newPosition[1] + position.h > this._options.lanes) {\n return false;\n }\n\n // Make sure the position doesn't overlap with an already positioned\n // item.\n for (x = newPosition[0]; x < newPosition[0] + position.w; x++) {\n var col = this.grid[x];\n\n // Surely a column that hasn't even been created yet is available\n if (!col) {\n continue;\n }\n\n for (y = newPosition[1]; y < newPosition[1] + position.h; y++) {\n // Any space occupied by an item can continue to be occupied by the\n // same item.\n if (col[y] && col[y] !== item) {\n return false;\n }\n }\n }\n\n return true;\n },\n\n _updateItemPosition: function(item, position) {\n if (item.x !== null && item.y !== null) {\n this._deleteItemPositionFromGrid(item);\n }\n\n this._setItemPosition(item, position);\n\n this._markItemPositionToGrid(item);\n },\n\n _updateItemSize: function(item, width, height) {\n /**\n * @param {Object} item A reference to a grid item.\n * @param {Number} width The new width.\n * @param {Number} height The new height.\n */\n\n if (item.x !== null && item.y !== null) {\n this._deleteItemPositionFromGrid(item);\n }\n\n item.w = width;\n item.h = height;\n\n this._markItemPositionToGrid(item);\n },\n\n _markItemPositionToGrid: function(item) {\n /**\n * Mark the grid cells that are occupied by an item. This prevents items\n * from overlapping in the grid\n */\n\n var position = this._getItemPosition(item),\n x, y;\n\n // Ensure that the grid has enough columns to accomodate the current item.\n this._ensureColumns(position.x + position.w);\n\n for (x = position.x; x < position.x + position.w; x++) {\n for (y = position.y; y < position.y + position.h; y++) {\n this.grid[x][y] = item;\n }\n }\n },\n\n _deleteItemPositionFromGrid: function(item) {\n var position = this._getItemPosition(item),\n x, y;\n\n for (x = position.x; x < position.x + position.w; x++) {\n // It can happen to try to remove an item from a position not generated\n // in the grid, probably when loading a persisted grid of items. No need\n // to create a column to be able to remove something from it, though\n if (!this.grid[x]) {\n continue;\n }\n\n for (y = position.y; y < position.y + position.h; y++) {\n // Don't clear the cell if it's been occupied by a different widget in\n // the meantime (e.g. when an item has been moved over this one, and\n // thus by continuing to clear this item's previous position you would\n // cancel the first item's move, leaving it without any position even)\n if (this.grid[x][y] == item) {\n this.grid[x][y] = null;\n }\n }\n }\n },\n\n _ensureColumns: function(N) {\n /**\n * Ensure that the grid has at least N columns available.\n */\n var i;\n for (i = 0; i < N; i++) {\n if (!this.grid[i]) {\n this.grid.push(new GridCol(this._options.lanes));\n }\n }\n },\n\n _getItemsCollidingWithItem: function(item) {\n var collidingItems = [];\n for (var i = 0; i < this.items.length; i++) {\n if (item != this.items[i] &&\n this._itemsAreColliding(item, this.items[i])) {\n collidingItems.push(i);\n }\n }\n return collidingItems;\n },\n\n _itemsAreColliding: function(item1, item2) {\n var position1 = this._getItemPosition(item1),\n position2 = this._getItemPosition(item2);\n\n return !(position2.x >= position1.x + position1.w ||\n position2.x + position2.w <= position1.x ||\n position2.y >= position1.y + position1.h ||\n position2.y + position2.h <= position1.y);\n },\n\n _resolveCollisions: function(item) {\n if (!this._tryToResolveCollisionsLocally(item)) {\n this._pullItemsToLeft(item);\n }\n this._pullItemsToLeft();\n },\n\n _tryToResolveCollisionsLocally: function(item) {\n /**\n * Attempt to resolve the collisions after moving a an item over one or more\n * other items within the grid, by shifting the position of the colliding\n * items around the moving one. This might result in subsequent collisions,\n * in which case we will revert all position permutations. To be able to\n * revert to the initial item positions, we create a virtual grid in the\n * process\n */\n var collidingItems = this._getItemsCollidingWithItem(item);\n if (!collidingItems.length) {\n return true;\n }\n var _gridList = new GridList([], this._options),\n leftOfItem,\n rightOfItem,\n aboveOfItem,\n belowOfItem;\n\n GridList.cloneItems(this.items, _gridList.items);\n _gridList.generateGrid();\n\n for (var i = 0; i < collidingItems.length; i++) {\n var collidingItem = _gridList.items[collidingItems[i]],\n collidingPosition = this._getItemPosition(collidingItem);\n\n // We use a simple algorithm for moving items around when collisions occur:\n // In this prioritized order, we try to move a colliding item around the\n // moving one:\n // 1. to its left side\n // 2. above it\n // 3. under it\n // 4. to its right side\n var position = this._getItemPosition(item);\n\n leftOfItem = [position.x - collidingPosition.w, collidingPosition.y];\n rightOfItem = [position.x + position.w, collidingPosition.y];\n aboveOfItem = [collidingPosition.x, position.y - collidingPosition.h];\n belowOfItem = [collidingPosition.x, position.y + position.h];\n\n if (_gridList._itemFitsAtPosition(collidingItem, leftOfItem)) {\n _gridList._updateItemPosition(collidingItem, leftOfItem);\n } else if (_gridList._itemFitsAtPosition(collidingItem, aboveOfItem)) {\n _gridList._updateItemPosition(collidingItem, aboveOfItem);\n } else if (_gridList._itemFitsAtPosition(collidingItem, belowOfItem)) {\n _gridList._updateItemPosition(collidingItem, belowOfItem);\n } else if (_gridList._itemFitsAtPosition(collidingItem, rightOfItem)) {\n _gridList._updateItemPosition(collidingItem, rightOfItem);\n } else {\n // Collisions failed, we must use the pullItemsToLeft method to arrange\n // the other items around this item with fixed position. This is our\n // plan B for when local collision resolving fails.\n return false;\n }\n }\n // If we reached this point it means we managed to resolve the collisions\n // from one single iteration, just by moving the colliding items around. So\n // we accept this scenario and marge the brached-out grid instance into the\n // original one\n GridList.cloneItems(_gridList.items, this.items);\n this.generateGrid();\n return true;\n },\n\n _pullItemsToLeft: function(fixedItem) {\n /**\n * Build the grid from scratch, by using the current item positions and\n * pulling them as much to the left as possible, removing as space between\n * them as possible.\n *\n * If a \"fixed item\" is provided, its position will be kept intact and the\n * rest of the items will be layed around it.\n */\n\n\n // Start a fresh grid with the fixed item already placed inside\n this._sortItemsByPosition();\n this._resetGrid();\n\n // Start the grid with the fixed item as the first positioned item\n if (fixedItem) {\n var fixedPosition = this._getItemPosition(fixedItem);\n this._updateItemPosition(fixedItem, [fixedPosition.x, fixedPosition.y]);\n }\n\n for (var i = 0; i < this.items.length; i++) {\n var item = this.items[i],\n position = this._getItemPosition(item);\n\n // The fixed item keeps its exact position\n if (fixedItem && item == fixedItem) {\n continue;\n }\n\n var x = this._findLeftMostPositionForItem(item),\n newPosition = this.findPositionForItem(\n item, {x: x, y: 0}, position.y);\n\n this._updateItemPosition(item, newPosition);\n }\n },\n\n _findLeftMostPositionForItem: function(item) {\n /**\n * When pulling items to the left, we need to find the leftmost position for\n * an item, with two considerations in mind:\n * - preserving its current row\n * - preserving the previous horizontal order between items\n */\n\n var tail = 0,\n position = this._getItemPosition(item);\n\n for (var i = 0; i < this.grid.length; i++) {\n for (var j = position.y; j < position.y + position.h; j++) {\n var otherItem = this.grid[i][j];\n\n if (!otherItem) {\n continue;\n }\n\n var otherPosition = this._getItemPosition(otherItem);\n\n if (this.items.indexOf(otherItem) < this.items.indexOf(item)) {\n tail = otherPosition.x + otherPosition.w;\n }\n }\n }\n\n return tail;\n },\n\n _getItemByAttribute: function(key, value) {\n for (var i = 0; i < this.items.length; i++) {\n if (this.items[i][key] === value) {\n return this.items[i];\n }\n }\n return null;\n },\n\n _padNumber: function(nr, prefix) {\n // Currently works for 2-digit numbers (<100)\n return nr >= 10 ? nr : prefix + nr;\n },\n\n _getItemPosition: function(item) {\n /**\n * If the direction is vertical we need to rotate the grid 90 deg to the\n * left. Thus, we simulate the fact that items are being pulled to the top.\n *\n * Since the items have widths and heights, if we apply the classic\n * counter-clockwise 90 deg rotation\n *\n * [0 -1]\n * [1 0]\n *\n * then the top left point of an item will become the bottom left point of\n * the rotated item. To adjust for this, we need to subtract from the y\n * position the height of the original item - the width of the rotated item.\n *\n * However, if we do this then we'll reverse some actions: resizing the\n * width of an item will stretch the item to the left instead of to the\n * right; resizing an item that doesn't fit into the grid will push the\n * items around it instead of going on a new row, etc.\n *\n * We found it better to do a vertical flip of the grid after rotating it.\n * This restores the direction of the actions and greatly simplifies the\n * transformations.\n */\n\n if (this._options.direction === 'horizontal') {\n return item;\n } else {\n return {\n x: item.y,\n y: item.x,\n w: item.h,\n h: item.w\n };\n }\n },\n\n _setItemPosition: function(item, position) {\n /**\n * See _getItemPosition.\n */\n\n if (this._options.direction === 'horizontal') {\n item.x = position[0];\n item.y = position[1];\n } else {\n // We're supposed to subtract the rotated item's height which is actually\n // the non-rotated item's width.\n item.x = position[1];\n item.y = position[0];\n }\n }\n};\n\nvar GridCol = function(lanes) {\n for (var i = 0; i < lanes; i++) {\n this.push(null);\n }\n};\n\n// Extend the Array prototype\nGridCol.prototype = [];\n\n// This module will have direct access to the GridList class\nreturn GridList;\n\n}));\n","import { d3Event, drag as d3Drag, HTMLWidget, Platform, select as d3Select, Utility } from \"@hpcc-js/common\";\nimport * as _GridList from \"grid-list\";\nimport { Cell } from \"./Cell.ts\";\n\nimport \"../src/Grid.css\";\n\nconst GridList = (_GridList && _GridList.default) || _GridList;\n\nexport type ICellPosition = [number, number, number, number];\n\nexport class Grid extends HTMLWidget {\n divItems;\n\n gridList;\n items;\n itemsMap;\n origItems;\n cellWidth;\n cellHeight;\n dragItem;\n dragItemPos;\n\n _d3Drag;\n _d3DragResize;\n _selectionBag;\n _scrollBarWidth;\n\n constructor() {\n super();\n\n this._tag = \"div\";\n this._selectionBag = new Utility.Selection(this);\n\n this.content([]);\n }\n\n getDimensions() {\n const size = { width: 0, height: 0 };\n this.content().forEach(function (cell) {\n if (size.width < cell.gridCol() + cell.gridColSpan()) {\n size.width = cell.gridCol() + cell.gridColSpan();\n }\n if (size.height < cell.gridRow() + cell.gridRowSpan()) {\n size.height = cell.gridRow() + cell.gridRowSpan();\n }\n }, this);\n return size;\n }\n\n clearContent(widget) {\n this.content(this.content().filter(function (contentWidget) {\n if (!widget) {\n contentWidget.target(null);\n return false;\n }\n let w: any = contentWidget;\n while (w) {\n if (widget === w) {\n contentWidget.target(null);\n return false;\n }\n w = w.widget ? w.widget() : null;\n }\n return true;\n }));\n }\n\n setContent(row, col, widget, title?, rowSpan?, colSpan?) {\n rowSpan = rowSpan || 1;\n colSpan = colSpan || 1;\n title = title || \"\";\n this.content(this.content().filter(function (contentWidget) {\n if (contentWidget.gridRow() === row && contentWidget.gridCol() === col) {\n contentWidget.target(null);\n return false;\n }\n return true;\n }));\n if (widget) {\n const cell = new Cell()\n .gridRow(row)\n .gridCol(col)\n .widget(widget)\n .title(title)\n .gridRowSpan(rowSpan)\n .gridColSpan(colSpan)\n ;\n this.content().push(cell);\n }\n return this;\n }\n\n sortedContent() {\n return this.content().sort(function (l, r) {\n if (l.gridRow() === r.gridRow()) {\n return l.gridCol() - r.gridCol();\n }\n return l.gridRow() - r.gridRow();\n });\n }\n\n getCell(row, col) {\n let retVal = null;\n this.content().some(function (cell) {\n if (row >= cell.gridRow() && row < cell.gridRow() + cell.gridRowSpan() &&\n col >= cell.gridCol() && col < cell.gridCol() + cell.gridColSpan()) {\n retVal = cell;\n return true;\n }\n return false;\n });\n return retVal;\n }\n\n getWidgetCell(id) {\n let retVal = null;\n this.content().some(function (cell) {\n if (cell.widget().id() === id) {\n retVal = cell;\n return true;\n }\n return false;\n });\n return retVal;\n }\n\n getContent(id) {\n let retVal = null;\n this.content().some(function (cell) {\n if (cell.widget().id() === id) {\n retVal = cell.widget();\n return true;\n }\n return false;\n });\n return retVal;\n }\n\n cellToGridItem(cell) {\n return {\n x: cell.gridCol(),\n y: cell.gridRow(),\n w: cell.gridColSpan(),\n h: cell.gridRowSpan(),\n id: cell.id(),\n cell\n };\n }\n\n gridItemToCell(item) {\n item.cell\n .gridCol(item.x)\n .gridRow(item.y)\n .gridColSpan(item.w)\n .gridRowSpan(item.h)\n ;\n }\n\n resetItemsPos() {\n this.origItems.forEach(function (origItem) {\n const item = this.itemsMap[origItem.id];\n item.x = origItem.x;\n item.y = origItem.y;\n }, this);\n }\n\n initGridList() {\n this.itemsMap = {};\n this.items = this.content().map(function (cell) {\n const retVal = this.cellToGridItem(cell);\n this.itemsMap[retVal.id] = retVal;\n return retVal;\n }, this);\n this.origItems = this.content().map(this.cellToGridItem);\n this.gridList = new GridList(this.items, {\n direction: this.snapping(),\n lanes: this.snapping() === \"horizontal\" ? this.snappingRows() : this.snappingColumns()\n });\n }\n\n killGridList() {\n this.gridList = null;\n delete this.items;\n delete this.itemsMap;\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n\n this._scrollBarWidth = Platform.getScrollbarWidth();\n\n const context = this;\n this._d3Drag = d3Drag()\n .subject(function (_d) {\n const d = context.cellToGridItem(_d);\n return { x: d.x * context.cellWidth, y: d.y * context.cellHeight };\n })\n .on(\"start\", function (_d: any) {\n if (!context.designMode()) return;\n d3Event().sourceEvent.stopPropagation();\n context.initGridList();\n const d = context.itemsMap[_d.id()];\n context.dragItem = element.append(\"div\")\n .attr(\"class\", \"dragging\")\n .style(\"transform\", function () { return \"translate(\" + d.x * context.cellWidth + \"px, \" + d.y * context.cellHeight + \"px)\"; })\n .style(\"width\", function () { return d.w * context.cellWidth - context.gutter() + \"px\"; })\n .style(\"height\", function () { return d.h * context.cellHeight - context.gutter() + \"px\"; })\n ;\n context.selectionBagClick(_d);\n })\n .on(\"drag\", function (_d: any) {\n if (!context.designMode()) return;\n const event = d3Event();\n event.sourceEvent.stopPropagation();\n const d = context.itemsMap[_d.id()];\n if (event.x < 0) {\n event.x = 0;\n }\n if (event.x + d.w * context.cellWidth > context.snappingColumns() * context.cellWidth) {\n event.x = context.snappingColumns() * context.cellWidth - d.w * context.cellWidth;\n }\n if (event.y < 0) {\n event.y = 0;\n }\n if (event.y + d.h * context.cellWidth > context.snappingRows() * context.cellWidth) {\n event.y = context.snappingRows() * context.cellWidth - d.h * context.cellWidth;\n }\n const pos = [Math.max(0, Math.floor((event.x + context.cellWidth / 2) / context.cellWidth)), Math.max(0, Math.floor((event.y + context.cellHeight / 2) / context.cellHeight))];\n if (d.x !== pos[0] || d.y !== pos[1]) {\n if (context.snapping() !== \"none\") {\n context.resetItemsPos();\n context.gridList.moveItemToPosition(d, pos);\n } else {\n d.x = pos[0];\n d.y = pos[1];\n }\n if (_d.gridCol() !== d.x || _d.gridRow() !== d.y) {\n context.items.forEach(context.gridItemToCell);\n context.updateGrid(false, 100);\n }\n }\n context.dragItem\n .style(\"transform\", function () { return \"translate(\" + event.x + \"px, \" + event.y + \"px)\"; })\n .style(\"width\", function () { return d.w * context.cellWidth + \"px\"; })\n .style(\"height\", function () { return d.h * context.cellHeight + \"px\"; })\n ;\n })\n .on(\"end\", function () {\n if (!context.designMode()) return;\n d3Event().sourceEvent.stopPropagation();\n context.dragItem.remove();\n context.dragItem = null;\n context.killGridList();\n })\n ;\n\n this._d3DragResize = d3Drag()\n .subject(function (_d) {\n const d = context.cellToGridItem(_d);\n return { x: (d.x + d.w - 1) * context.cellWidth, y: (d.y + d.h - 1) * context.cellHeight };\n })\n .on(\"start\", function (_d: any) {\n if (!context.designMode()) return;\n d3Event().sourceEvent.stopPropagation();\n context.initGridList();\n const d = context.itemsMap[_d.id()];\n context.dragItem = element.append(\"div\")\n .attr(\"class\", \"resizing\")\n .style(\"transform\", function () { return \"translate(\" + d.x * context.cellWidth + \"px, \" + d.y * context.cellHeight + \"px)\"; })\n .style(\"width\", function () { return d.w * context.cellWidth - context.gutter() + \"px\"; })\n .style(\"height\", function () { return d.h * context.cellHeight - context.gutter() + \"px\"; })\n ;\n context.dragItemPos = { x: d.x, y: d.y };\n })\n .on(\"drag\", function (_d: any) {\n if (!context.designMode()) return;\n const event = d3Event();\n event.sourceEvent.stopPropagation();\n const d = context.itemsMap[_d.id()];\n const pos = [Math.max(0, Math.round(event.x / context.cellWidth)), Math.max(0, Math.round(event.y / context.cellHeight))];\n const size = {\n w: Math.max(1, pos[0] - d.x + 1),\n h: Math.max(1, pos[1] - d.y + 1)\n };\n if (d.w !== size.w || d.h !== size.h) {\n if (context.snapping() !== \"none\") {\n context.resetItemsPos();\n context.gridList.resizeItem(d, size);\n } else {\n d.w = size.w;\n d.h = size.h;\n }\n if (_d.gridColSpan() !== d.w || _d.gridRowSpan() !== d.h) {\n context.items.forEach(context.gridItemToCell);\n context.updateGrid(d.id, 100);\n }\n }\n context.dragItem\n .style(\"width\", function () { return (-d.x + 1) * context.cellWidth + event.x - context.gutter() + \"px\"; })\n .style(\"height\", function () { return (-d.y + 1) * context.cellHeight + event.y - context.gutter() + \"px\"; })\n ;\n })\n .on(\"end\", function () {\n if (!context.designMode()) return;\n d3Event().sourceEvent.stopPropagation();\n context.dragItem.remove();\n context.dragItem = null;\n context.killGridList();\n })\n ;\n }\n\n updateGrid(resize, transitionDuration: number = 0, _noRender: boolean = false) {\n transitionDuration = transitionDuration || 0;\n const context = this;\n this.divItems\n .classed(\"draggable\", this.designMode())\n .transition().duration(transitionDuration)\n .style(\"left\", function (d) { return d.gridCol() * context.cellWidth + context.gutter() / 2 + \"px\"; })\n .style(\"top\", function (d) { return d.gridRow() * context.cellHeight + context.gutter() / 2 + \"px\"; })\n .style(\"width\", function (d) { return d.gridColSpan() * context.cellWidth - context.gutter() + \"px\"; })\n .style(\"height\", function (d) { return d.gridRowSpan() * context.cellHeight - context.gutter() + \"px\"; })\n .on(\"end\", function (d) {\n d\n .surfaceShadow_default(context.surfaceShadow())\n .surfacePadding_default(context.surfacePadding())\n .surfaceBorderWidth_default(context.surfaceBorderWidth())\n .surfaceBackgroundColor_default(context.surfaceBackgroundColor())\n ;\n\n if (resize === true || resize === d.id()) {\n d\n .resize()\n .lazyRender()\n ;\n }\n })\n ;\n }\n\n update(domNode, element2) {\n super.update(domNode, element2);\n\n this._placeholderElement.style(\"overflow-x\", this.fitTo() === \"width\" ? \"hidden\" : null);\n this._placeholderElement.style(\"overflow-y\", this.fitTo() === \"width\" ? \"scroll\" : null);\n const dimensions = this.getDimensions();\n const clientWidth = this.width() - (this.fitTo() === \"width\" ? this._scrollBarWidth : 0);\n this.cellWidth = clientWidth / dimensions.width;\n this.cellHeight = this.fitTo() === \"all\" ? this.height() / dimensions.height : this.cellWidth;\n if (this.designMode()) {\n const cellLaneRatio = Math.min(this.width() / this.snappingColumns(), this.height() / this.snappingRows());\n const laneWidth = Math.floor(cellLaneRatio);\n this.cellWidth = laneWidth;\n this.cellHeight = this.cellWidth;\n }\n\n // Grid ---\n const context = this;\n const divItems = element2.selectAll(\"#\" + this.id() + \" > .ddCell\").data(this.content(), function (d) { return d.id(); });\n this.divItems = divItems.enter().append(\"div\")\n .attr(\"class\", \"ddCell\")\n .each(function (d) {\n d.target(this);\n d.__grid_watch = d.monitor(function (key, newVal, oldVal) {\n if (context._renderCount && (key === \"snapping\" || key.indexOf(\"grid\") === 0) && newVal !== oldVal) {\n if (!context.gridList) {\n // API Call (only needed when not dragging) ---\n context.initGridList();\n if (context.snapping() !== \"none\") {\n context.gridList.resizeGrid(context.snapping() === \"horizontal\" ? context.snappingRows() : context.snappingColumns());\n }\n context.items.forEach(context.gridItemToCell);\n context.updateGrid(d.id(), 100);\n context.killGridList();\n }\n }\n });\n const element = d3Select(this);\n element.append(\"div\")\n .attr(\"class\", \"resizeHandle\")\n .call(context._d3DragResize)\n .append(\"div\")\n .attr(\"class\", \"resizeHandleDisplay\")\n ;\n }).merge(divItems)\n ;\n this.divItems.each(function (d) {\n const element = d3Select(this);\n if (context.designMode()) {\n element.call(context._d3Drag);\n } else {\n element\n .on(\"mousedown.drag\", null)\n .on(\"touchstart.drag\", null)\n ;\n }\n });\n this.divItems.select(\".resizeHandle\")\n .style(\"display\", this.designMode() ? null : \"none\")\n ;\n\n this.updateGrid(true);\n divItems.exit()\n .each(function (d) {\n d.target(null);\n if (d.__grid_watch) {\n d.__grid_watch.remove();\n }\n })\n .remove()\n ;\n\n // Snapping ---\n const lanesBackground = element2.selectAll(\"#\" + this.id() + \" > .laneBackground\").data(this.designMode() ? [\"\"] : []);\n lanesBackground.enter().insert(\"div\", \":first-child\")\n .attr(\"class\", \"laneBackground\")\n .style(\"left\", \"1px\")\n .style(\"top\", \"1px\")\n .on(\"click\", function () {\n context.selectionBagClear();\n })\n .merge(lanesBackground)\n .style(\"width\", (this.snappingColumns() * this.cellWidth) + \"px\")\n .style(\"height\", (this.snappingRows() * this.cellHeight) + \"px\")\n ;\n lanesBackground.exit()\n .each(function () {\n context.selectionBagClear();\n })\n .remove()\n ;\n\n const lanes = element2.selectAll(\"#\" + this.id() + \" > .lane\").data(this.designMode() ? [\"\"] : []);\n lanes.enter().append(\"div\")\n .attr(\"class\", \"lane\")\n .style(\"left\", \"1px\")\n .style(\"top\", \"1px\")\n ;\n lanes\n .style(\"display\", this.showLanes() ? null : \"none\")\n .style(\"width\", (this.snappingColumns() * this.cellWidth) + \"px\")\n .style(\"height\", (this.snappingRows() * this.cellHeight) + \"px\")\n .style(\"background-image\", \"linear-gradient(to right, grey 1px, transparent 1px), linear-gradient(to bottom, grey 1px, transparent 1px)\")\n .style(\"background-size\", this.cellWidth + \"px \" + this.cellHeight + \"px\")\n ;\n lanes.exit()\n .remove()\n ;\n }\n\n exit(domNode, element) {\n this.content().forEach(w => w.target(null));\n super.exit(domNode, element);\n }\n\n _createSelectionObject(d) {\n return {\n _id: d._id,\n element: () => {\n return d._element;\n },\n widget: d\n };\n }\n\n selection(_) {\n if (!arguments.length) return this._selectionBag.get().map(function (d) { return d._id; });\n this._selectionBag.set(_.map(function (row) {\n return this._createSelectionObject(row);\n }, this));\n return this;\n }\n\n selectionBagClear() {\n if (!this._selectionBag.isEmpty()) {\n this._selectionBag.clear();\n this.postSelectionChange();\n }\n }\n\n selectionBagClick(d) {\n if (d !== null) {\n const selectionObj = this._createSelectionObject(d);\n if (d3Event().sourceEvent.ctrlKey) {\n if (this._selectionBag.isSelected(selectionObj)) {\n this._selectionBag.remove(selectionObj);\n this.postSelectionChange();\n } else {\n this._selectionBag.append(selectionObj);\n this.postSelectionChange();\n }\n } else {\n const selected = this._selectionBag.get();\n if (selected.length === 1 && selected[0]._id === selectionObj._id) {\n this.selectionBagClear();\n } else {\n this._selectionBag.set([selectionObj]);\n }\n this.postSelectionChange();\n }\n }\n }\n\n postSelectionChange() {\n }\n\n applyLayout(layoutArr: ICellPosition[]) {\n this.divItems.each((d, i) => {\n if (layoutArr[i]) {\n const [x, y, w, h] = layoutArr[i];\n d\n .gridCol(x)\n .gridRow(y)\n .gridColSpan(w)\n .gridRowSpan(h)\n ;\n }\n });\n this.updateGrid(true);\n }\n\n vizActivation(elem) {\n }\n}\nGrid.prototype._class += \" layout_Grid\";\n\nexport interface Grid {\n designMode(): boolean;\n designMode(_: boolean): this;\n showLanes(): boolean;\n showLanes(_: boolean): this;\n fitTo(): string;\n fitTo(_: string): this;\n\n snapping(): string;\n snapping(_: string): this;\n snappingColumns(): number;\n snappingColumns(_: number): this;\n snappingRows(): number;\n snappingRows(_: number): this;\n snappingColumns_default(): number;\n snappingColumns_default(_: number): this;\n snappingRows_default(): number;\n snappingRows_default(_: number): this;\n\n gutter(): number;\n gutter(_: number): this;\n\n surfaceShadow(): boolean;\n surfaceShadow(_: boolean): this;\n surfacePadding(): string;\n surfacePadding(_: string): this;\n surfaceBorderWidth(): number;\n surfaceBorderWidth(_: number): this;\n surfaceBackgroundColor(): string;\n surfaceBackgroundColor(_: string): this;\n\n content(): Cell[];\n content(_: Cell[]): this;\n}\n\nGrid.prototype.publish(\"designMode\", false, \"boolean\", \"Design Mode\", null, { tags: [\"Basic\"] });\nGrid.prototype.publish(\"showLanes\", true, \"boolean\", \"Show snapping lanes when in design mode\", null, { tags: [\"Basic\"], disable: w => !w.designMode() });\nGrid.prototype.publish(\"fitTo\", \"all\", \"set\", \"Sizing Strategy\", [\"all\", \"width\"], { tags: [\"Basic\"] });\nGrid.prototype.publish(\"snapping\", \"vertical\", \"set\", \"Snapping Strategy\", [\"vertical\", \"horizontal\", \"none\"]);\nGrid.prototype.publish(\"snappingColumns\", 12, \"number\", \"Snapping Columns\");\nGrid.prototype.publish(\"snappingRows\", 16, \"number\", \"Snapping Rows\");\n\nGrid.prototype.publish(\"gutter\", 6, \"number\", \"Gap Between Widgets\", null, { tags: [\"Basic\"] });\n\nGrid.prototype.publish(\"surfaceShadow\", true, \"boolean\", \"3D Shadow\");\nGrid.prototype.publish(\"surfacePadding\", null, \"string\", \"Cell Padding (px)\", null, { tags: [\"Intermediate\"] });\nGrid.prototype.publish(\"surfaceBorderWidth\", 1, \"number\", \"Width (px) of Cell Border\", null, { tags: [\"Intermediate\"] });\nGrid.prototype.publish(\"surfaceBackgroundColor\", null, \"html-color\", \"Surface Background Color\", null, { tags: [\"Advanced\"] });\n\nGrid.prototype.publish(\"content\", [], \"widgetArray\", \"widgets\", null, { tags: [\"Basic\"], render: false });\n","import { FlexGrid } from \"./FlexGrid.ts\";\n\nexport class HorizontalList extends FlexGrid {\n constructor() {\n super();\n this.orientation_default(\"horizontal\");\n this.flexWrap_default(\"nowrap\");\n }\n}\nHorizontalList.prototype._class += \" layout_HorizontalList\";\n\nexport interface HorizontalList {\n orientation_default(_: \"horizontal\" | \"vertical\");\n flexWrap_default(_: \"nowrap\" | \"wrap\" | \"wrap-reverse\");\n}\n","import { HTMLWidget, Text } from \"@hpcc-js/common\";\n\nimport \"../src/Layered.css\";\n\nexport type LayerPlacement = \"default\" | \"top\" | \"right\" | \"bottom\" | \"left\" | \"center\";\n\nexport class Layered extends HTMLWidget {\n protected _contentContainer;\n _widgetPlacements;\n _widgetRatios;\n constructor() {\n super();\n\n this._tag = \"div\";\n this._widgetPlacements = [];\n this._widgetRatios = [];\n }\n\n addLayer(widget, placement: LayerPlacement = \"default\", widthRatio: number = 1, heightRatio: number = 1) {\n const widgets = this.widgets();\n widgets.push(widget ? widget : new Text().text(\"No widget defined for layer.\"));\n this.widgets(widgets);\n this._widgetPlacements.push(placement);\n this._widgetRatios.push([widthRatio, heightRatio]);\n return this;\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this._contentContainer = element.append(\"div\")\n .attr(\"class\", \"container\")\n ;\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n const context = this;\n\n element.style(\"padding\", this.surfacePadding() + \"px\");\n\n const content = this._contentContainer.selectAll(\".content.id\" + this.id()).data(this.widgets(), function (d) { return d.id(); });\n content.enter().append(\"div\")\n .attr(\"class\", \"content id\" + this.id())\n .each(function (widget, idx) {\n widget.target(this);\n })\n .merge(content)\n .each(function (widget, idx) {\n const clientSize = {\n width: context.clientWidth(),\n height: context.clientHeight()\n };\n const widgetSize = context.widgetSize(idx, clientSize);\n const widgetPosition = context.widgetPosition(idx, clientSize, widgetSize);\n this.style.top = widgetPosition.y + \"px\";\n this.style.left = widgetPosition.x + \"px\";\n widget\n .resize(widgetSize)\n .render()\n ;\n })\n ;\n content.exit()\n .each(function (widget, idx) {\n widget\n .target(null)\n ;\n })\n .remove()\n ;\n content.order();\n }\n\n widgetSize(idx, clientSize) {\n if (this._widgetPlacements[idx] === \"default\") {\n return {\n width: clientSize.width * this._widgetRatios[idx][0],\n height: clientSize.height * this._widgetRatios[idx][1]\n };\n } else {\n return {\n width: clientSize.width * this._widgetRatios[idx][0],\n height: clientSize.height * this._widgetRatios[idx][1]\n };\n }\n }\n widgetPosition(idx, clientSize, widgetSize) {\n switch (this._widgetPlacements[idx]) {\n default:\n return {\n x: 0,\n y: 0\n };\n case \"top\":\n return {\n x: (clientSize.width / 2) - (widgetSize.width / 2),\n y: 0\n };\n case \"bottom\":\n return {\n x: (clientSize.width / 2) - (widgetSize.width / 2),\n y: clientSize.height - widgetSize.height\n };\n case \"left\":\n return {\n x: 0,\n y: (clientSize.height / 2) - (widgetSize.height / 2)\n };\n case \"right\":\n return {\n x: clientSize.width - widgetSize.width,\n y: (clientSize.height / 2) - (widgetSize.height / 2)\n };\n case \"center\":\n return {\n x: (clientSize.width / 2) - (widgetSize.width / 2),\n y: (clientSize.height / 2) - (widgetSize.height / 2)\n };\n }\n }\n}\nLayered.prototype._class += \" layout_Layered\";\n\nexport interface Layered {\n surfacePadding(): number;\n surfacePadding(_: number): this;\n widgets(): any;\n widgets(_: any): this;\n}\n\nLayered.prototype.publish(\"surfacePadding\", 0, \"number\", \"Padding\");\nLayered.prototype.publish(\"widgets\", [], \"widgetArray\", \"widgets\", null, { tags: [\"Private\"] });\n","import { HTMLWidget, Widget } from \"@hpcc-js/common\";\n\nexport class Popup extends HTMLWidget {\n _surfaceButtons;\n _originalPosition;\n\n constructor() {\n super();\n this._tag = \"div\";\n this._surfaceButtons = [];\n }\n\n updateState(visible) {\n visible = visible || !this.popupState();\n this.popupState(visible).render();\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this.widget()\n .target(domNode)\n ;\n this._originalPosition = this.position();\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n element\n .style(\"visibility\", this.popupState() ? null : \"hidden\")\n .style(\"opacity\", this.popupState() ? null : 0)\n .style(\"width\", this.shrinkWrap() ? this.widget().width() + \"px\" : this._size.width + \"px\")\n .style(\"height\", this.shrinkWrap() ? this.widget().height() + \"px\" : this._size.height + \"px\")\n ;\n if (this.widget().size().height === 0) {\n this.widget().resize(this.size());\n }\n }\n\n postUpdate(domNode, element) {\n let left;\n let top;\n switch (this.centerPopup()) {\n case \"container\":\n if (this._placeholderElement) {\n left = parseInt(this._placeholderElement.style(\"width\")) / 2 - this.widget().width() / 2;\n top = parseInt(this._placeholderElement.style(\"height\")) / 2 - this.widget().height() / 2;\n }\n this.position(\"absolute\");\n break;\n\n case \"window\":\n left = window.innerWidth / 2 - this.widget().width() / 2;\n top = window.innerHeight / 2 - this.widget().height() / 2;\n this.position(\"fixed\");\n break;\n\n default:\n left = 0;\n top = 0;\n this.position(this._originalPosition);\n break;\n }\n\n this.pos({ x: left, y: top });\n\n super.postUpdate(domNode, element);\n\n element\n .style(\"position\", this.position())\n .style(\"left\", this.left() + \"px\")\n .style(\"right\", this.right() + \"px\")\n .style(\"top\", this.top() + \"px\")\n .style(\"bottom\", this.bottom() + \"px\")\n ;\n }\n\n exit(domNode, element) {\n if (this.widget()) {\n this.widget().target(null);\n }\n super.exit(domNode, element);\n }\n\n click(obj) {\n }\n}\nPopup.prototype._class += \" layout_Popup\";\n\nexport interface Popup {\n popupState(): boolean;\n popupState(_: boolean): this;\n shrinkWrap(): boolean;\n shrinkWrap(_: boolean): this;\n centerPopup(): \"none\" | \"container\" | \"window\";\n centerPopup(_: \"none\" | \"container\" | \"window\"): this;\n top(): number;\n top(_: number): this;\n bottom(): number;\n bottom(_: number): this;\n left(): number;\n left(_: number): this;\n right(): number;\n right(_: number): this;\n position(): string;\n position(_: string): this;\n\n widget(): Widget;\n widget(_: Widget): this;\n}\n\nPopup.prototype.publish(\"popupState\", false, \"boolean\", \"State of the popup, visible (true) or hidden (false)\", null, {});\nPopup.prototype.publish(\"shrinkWrap\", false, \"boolean\", \"The popup parent container either shrinks to the size of its contents (true) or expands to fit thge popup's parentDiv (false)\", null, {});\nPopup.prototype.publish(\"centerPopup\", \"none\", \"set\", \"Center the widget in its container element (target) or in the window\", [\"none\", \"container\", \"window\"], {});\nPopup.prototype.publish(\"top\", null, \"number\", \"Top position property of popup\", null, {});\nPopup.prototype.publish(\"bottom\", null, \"number\", \"Bottom position property of popup\", null, {});\nPopup.prototype.publish(\"left\", null, \"number\", \"Left position property of popup\", null, {});\nPopup.prototype.publish(\"right\", null, \"number\", \"Right position property of popup\", null, {});\nPopup.prototype.publish(\"position\", \"relative\", \"set\", \"Value of the 'position' property\", [\"absolute\", \"relative\", \"fixed\", \"static\", \"initial\", \"inherit\"], { tags: [\"Private\"] });\n\nPopup.prototype.publish(\"widget\", null, \"widget\", \"Widget\", null, { tags: [\"Private\"] });\n","import { HTMLWidget, Text, Widget } from \"@hpcc-js/common\";\nimport { select as d3Select } from \"d3-selection\";\nimport { Surface } from \"./Surface.ts\";\n\nimport \"../src/Tabbed.css\";\n\nexport class Tabbed extends HTMLWidget {\n _tabContainer;\n _contentContainer;\n\n constructor() {\n super();\n\n this._tag = \"div\";\n }\n\n clearTabs() {\n this.labels([]);\n this.widgets([]);\n return this;\n }\n\n addTab(widget, label, isActive?, callback?) {\n const widgetSize = widget.size();\n if (widgetSize.width === 0 && widgetSize.height === 0) {\n widget.size({ width: \"100%\", height: \"100%\" });\n }\n const labels = this.labels();\n const widgets = this.widgets();\n if (isActive) {\n this.activeTabIdx(this.widgets().length);\n }\n labels.push(label);\n const surface = new Surface().widget(widget ? widget : new Text().text(\"No widget defined for tab\"));\n widgets.push(surface);\n this.labels(labels);\n this.widgets(widgets);\n if (callback) {\n callback(surface);\n }\n return this;\n }\n\n widgetSize(widgetDiv) {\n const width = this.clientWidth();\n let height = this.clientHeight();\n\n const tcBox = this._tabContainer.node().getBoundingClientRect();\n if (typeof (tcBox.height) !== \"undefined\") {\n height -= tcBox.height;\n }\n return { width, height };\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this._tabContainer = element.append(\"div\");\n this._contentContainer = element.append(\"div\");\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n const context = this;\n\n element.style(\"padding\", this.surfacePadding_exists() ? this.surfacePadding() + \"px\" : null);\n\n const tabs = this._tabContainer.selectAll(\".tab-button.id\" + this.id()).data(this.showTabs() ? this.labels() : [], function (d) { return d; });\n tabs.enter().append(\"span\")\n .attr(\"class\", \"tab-button id\" + this.id())\n .style(\"cursor\", \"pointer\")\n .on(\"click\", function (d, idx) {\n context.click(context.widgets()[idx].widget(), d, idx);\n context\n .activeTabIdx(idx)\n .render()\n ;\n }).merge(tabs)\n .classed(\"active\", function (d, idx) { return context.activeTabIdx() === idx; })\n .text(function (d) { return d; })\n ;\n tabs.exit().remove();\n\n const content = this._contentContainer.selectAll(\".tab-content.id\" + this.id()).data(this.widgets(), function (d) { return d.id(); });\n content.enter().append(\"div\")\n .attr(\"class\", \"tab-content id\" + this.id())\n .each(function (widget, idx) {\n widget.target(this);\n }).merge(content)\n .classed(\"active\", function (d, idx) { return context.activeTabIdx() === idx; })\n .style(\"display\", function (d, idx) { return context.activeTabIdx() === idx ? \"block\" : \"none\"; })\n .each(function (surface, idx) {\n surface.visible(context.activeTabIdx() === idx);\n if (context.activeTabIdx() === idx) {\n const wSize = context.widgetSize(d3Select(this));\n surface\n .surfaceBorderWidth(context.showTabs() ? null : 0)\n .surfacePadding(context.showTabs() ? null : 0)\n .resize(wSize)\n ;\n }\n })\n ;\n content.exit()\n .each(function (widget, idx) {\n widget\n .target(null)\n ;\n })\n .remove();\n\n switch (this.tabLocation()) {\n case \"bottom\":\n this._tabContainer\n .attr(\"class\", \"on_bottom\")\n .style(\"top\", (this._contentContainer.node().offsetHeight + this.surfacePadding()) + \"px\")\n .style(\"position\", \"absolute\")\n ;\n this._contentContainer\n .style(\"top\", this.surfacePadding_exists() ? this.surfacePadding() + \"px\" : null)\n .style(\"position\", \"absolute\")\n ;\n break;\n default:\n this._tabContainer\n .attr(\"class\", \"on_top\")\n .style(\"top\", null)\n .style(\"position\", \"relative\")\n ;\n this._contentContainer\n .style(\"top\", (this._tabContainer.node().offsetHeight + this.surfacePadding()) + \"px\")\n .style(\"position\", \"absolute\")\n ;\n break;\n }\n }\n\n click(widget, column, idx) {\n }\n}\nTabbed.prototype._class += \" layout_Tabbed\";\n\nexport interface Tabbed {\n showTabs(): boolean;\n showTabs(_: boolean): this;\n surfacePadding(): number;\n surfacePadding(_: number): this;\n surfacePadding_exists(): boolean;\n activeTabIdx(): number;\n activeTabIdx(_: number): this;\n\n labels(): string[];\n labels(_: string[]): this;\n tabLocation(): \"top\" | \"bottom\";\n tabLocation(_: \"top\" | \"bottom\"): this;\n widgets(): any[];\n widgets(_: any[]): this;\n}\n\nTabbed.prototype.publish(\"showTabs\", true, \"boolean\", \"Show Tabs\", null, {});\nTabbed.prototype.publish(\"surfacePadding\", 4, \"number\", \"Padding\");\nTabbed.prototype.publish(\"activeTabIdx\", 0, \"number\", \"Index of active tab\", null, {});\n\nTabbed.prototype.publish(\"labels\", [], \"array\", \"Array of tab labels sharing an index with \", null, { tags: [\"Private\"] });\nTabbed.prototype.publish(\"tabLocation\", \"top\", \"set\", \"Position the tabs at the bottom of the widget\", [\"top\", \"bottom\"], { tags: [\"Private\"] });\nTabbed.prototype.publish(\"widgets\", [], \"widgetArray\", \"widgets\", null, { tags: [\"Private\"] });\n","import { HTMLWidget, Widget } from \"@hpcc-js/common\";\nimport { select as d3Select } from \"d3-selection\";\n\nimport \"../src/Toolbar.css\";\n\nexport class Toolbar extends HTMLWidget {\n\n constructor() {\n super();\n this._tag = \"div\";\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n const context = this;\n\n element\n .attr(\"title\", context.title())\n .style(\"background-color\", this.backgroundColor())\n ;\n\n const title = element.selectAll(\"div.toolbar-title\")\n .data(this.title() ? [this.title()] : []);\n title.enter().append(\"div\")\n .classed(\"toolbar-title\", true)\n .append(\"span\")\n ;\n title.selectAll(\"div.toolbar-title > span\")\n .style(\"font-size\", this.fontSize_exists() ? this.fontSize() + \"px\" : null)\n .style(\"color\", this.fontColor_exists() ? this.fontColor() : null)\n .style(\"font-family\", this.fontFamily_exists() ? this.fontFamily() : null)\n .style(\"font-weight\", this.fontBold_exists() ? (this.fontBold() ? \"bold\" : \"normal\") : null)\n .style(\"background-color\", this.backgroundColor_exists() ? this.backgroundColor() : null)\n .text(context.title())\n ;\n title.exit().remove();\n\n const childWidgets = element.selectAll(\"div.toolbar-child\")\n .data(this.widgets() !== null ? this.widgets() : [], function (d) { return d.id(); });\n\n childWidgets.enter().insert(\"div\", \"div.toolbar-title\")\n .each(function (d, i) {\n const widgetClass = context.widgetClasses()[i] ? context.widgetClasses()[i] + \" toolbar-child\" : \"toolbar-child\";\n d3Select(this).classed(widgetClass, true);\n d.target(this);\n });\n childWidgets.exit().each(function (d) {\n d.target(null);\n }).remove();\n childWidgets.order();\n }\n\n render(callback?: (w: Widget) => void): this {\n const context = this;\n return super.render(function (w) {\n const toolbarBBox = context.element().node().getBoundingClientRect();\n let minX = toolbarBBox.left + toolbarBBox.width;\n context.element().selectAll(\"div.toolbar-child\")\n .each(function (d, i) {\n const childBBox = this.getBoundingClientRect();\n if (minX > childBBox.left)\n minX = childBBox.left;\n })\n ;\n context.element().select(\".toolbar-title\")\n .style(\"width\", (minX - toolbarBBox.left - 4) + \"px\")\n ;\n if (callback) {\n callback(w);\n }\n });\n }\n\n exit(domNode, element) {\n this.widgets().forEach(function (w) {\n w.target(null);\n });\n super.exit(domNode, element);\n }\n}\nToolbar.prototype._class += \" layout_Toolbar\";\n\nexport interface Toolbar {\n title(): string;\n title(_: string): this;\n\n fontSize(): number;\n fontSize(_: number): this;\n fontSize_exists(): boolean;\n fontColor(): string;\n fontColor(_: string): this;\n fontColor_exists(): boolean;\n fontFamily(): string;\n fontFamily(_: string): this;\n fontFamily_exists(): boolean;\n fontBold(): boolean;\n fontBold(_: boolean): this;\n fontBold_exists(): boolean;\n backgroundColor(): string;\n backgroundColor(_: string): this;\n backgroundColor_exists(): boolean;\n\n responsive(): boolean;\n responsive(_: boolean): this;\n\n widgets(): any[];\n widgets(_: any[]): this;\n widgetClasses(): string[];\n widgetClasses(_: string[]): this;\n}\n\nToolbar.prototype.publish(\"title\", \"\", \"string\", \"Title\", null, { tags: [\"Intermediate\"] });\n\nToolbar.prototype.publish(\"fontSize\", null, \"number\", \"Title Font Size (px)\", null, { tags: [\"Advanced\"], optional: true });\nToolbar.prototype.publish(\"fontColor\", null, \"html-color\", \"Title Font Color\", null, { tags: [\"Advanced\"], optional: true });\nToolbar.prototype.publish(\"fontFamily\", null, \"string\", \"Title Font Family\", null, { tags: [\"Advanced\"], optional: true });\nToolbar.prototype.publish(\"fontBold\", true, \"boolean\", \"Enable Bold Title Font\", null, { tags: [\"Advanced\"], optional: true });\nToolbar.prototype.publish(\"backgroundColor\", null, \"html-color\", \"Background Color\", null, { tags: [\"Intermediate\"], optional: true });\n\nToolbar.prototype.publish(\"responsive\", true, \"boolean\", \"Adapts to pixel width\", null, { tags: [\"Basic\"] });\n\nToolbar.prototype.publish(\"widgets\", [], \"widgetArray\", \"Child widgets of the toolbar\", null, { tags: [\"Basic\"] });\nToolbar.prototype.publish(\"widgetClasses\", [], \"array\", \"Array of Html Element classes to be assigned to the child widgets (shares index with widgets param)\", null, { tags: [\"Basic\"] });\n","import { FlexGrid } from \"./FlexGrid.ts\";\n\nexport class VerticalList extends FlexGrid {\n constructor() {\n super();\n this.orientation_default(\"vertical\");\n this.flexWrap_default(\"nowrap\");\n }\n}\nVerticalList.prototype._class += \" layout_VerticalList\";\n\nexport interface VerticalList {\n orientation_default(_: \"horizontal\" | \"vertical\");\n flexWrap_default(_: \"nowrap\" | \"wrap\" | \"wrap-reverse\");\n}\n"],"names":["_AbsoluteSurface","HTMLWidget","constructor","super","this","_tag","enter","domNode","element","update","xPos","yPos","width","clientWidth","height","clientHeight","units","widgetX","widgetY","widgetWidth","Number","widgetHeight","style","opacity","widgets","selectAll","_id","data","widget","d","append","attr","each","target","merge","resize","exit","remove","__name","AbsoluteSurface","prototype","_class","publish","tags","_Accordion","__publicField","_isClosed","pushListItem","prepend","protect","contentArr","content","_protected","unshift","push","clearListItems","arr","i","collapseClick","classed","context","defaultCollapsed","titleSpan","iconDiv","ul","icon","FAChar","size","node","on","render","text","title","length","rows","li","document","createElement","_target","wSize","cSize","text_colorFill","titleFontColor","char","closedIcon","openIcon","Accordion","_Surface","_surfaceButtons","widgetSize","titleDiv","widgetDiv","calcHeight","calcFrameHeight","calcFrameWidth","element2","surfaceShadow","surfaceBorderWidth_exists","surfaceBorderWidth","surfaceBorderColor","surfaceBorderRadius_exists","surfaceBorderRadius","surfaceBackgroundColor","titles","insert","surfaceTitleAlignment","surfaceTitleFontColor","surfaceTitleFontSize_exists","surfaceTitleFontSize","surfaceTitleFontFamily","surfaceTitleFontBold","surfaceTitleBackgroundColor","surfaceTitlePadding_exists","surfaceTitlePadding","altText_exists","altText","surfaceButtons","select","buttonAnnotations","button","idx","el","d3Select","class","id","padding","font","click","label","_d","parentElement","classID","split","surfacePadding_exists","surfacePadding","obj","Surface","optional","disable","w","_Cell","_indicateTheseIds","indicateTheseIds","_","arguments","onMouseEnter","onMouseLeave","indicatorOpacity","indicatorBorderColor","indicatorGlowColor","otherElement","otherWidget","datum","d3SelectAll","Cell","_Border","Utility","debounce","postUpdate","_colCount","_rowCount","_colSize","_rowSize","_shrinkWrapBoxes","sectionTypes","watchWidget","_watch","monitor","paramId","newVal","oldVal","lazyPostUpdate","applyLayoutType","layoutObj","borderLayoutObject","forEach","cell","_fixedLeft","left","_fixedTop","top","_fixedWidth","_fixedHeight","_dragHandles","cellSpecificDragHandles","sectionType","layoutType","retObj","topSize","topPerc","bottomSize","bottomPerc","leftSize","leftPerc","rightSize","rightPerc","bcRect","getBoundingClientRect","bottom","right","SVGElement","parseFloat","getAttribute","indexOf","topPercentage","gutter","bottomPercentage","leftPercentage","rightPercentage","t","_sectionPlacementObject","px","b","l","r","c","clearContent","splice","contentWidget","hasContent","setContent","getCell","getContent","setLayoutOffsets","_offsetX","_element","_offsetY","dragStart","handle","event","d3Event","sourceEvent","stopPropagation","_dragCell","_dragCellStartSize","handleElm","_handleTop","_handleLeft","_dragPrevX","clientX","_dragPrevY","clientY","dragTick","xDelta","yDelta","_moveHandles","handle2","delta","handles","grabbedHandle","_cellSizes","topHeight","leftHeight","bottomHeight","rightHeight","rightWidth","leftWidth","handle3","dragEnd","getBBox","retVal","apply","contentDiv","_size","_scrollBarWidth","Platform","getScrollbarWidth","_borderHandles","_sectionTypeArr","designMode","rowsUpdate","drag","d3Drag","call","_placeholderElement","getCellSizes","contentRect","rect","n","prevBox","currBox","lazyRender","Border","_WidgetDiv","div","_div","overlay","_overlay","overflowX","_overflowX","overflowY","_overflowY","_widget","availableHeight","availableWidth","renderPromise","then","visible","x","y","Promise","resolve","WidgetDiv","_Border2","topElement","_bodyElement","centerElement","leftElement","rightElement","bottomElement","_topWA","_centerWA","_leftWA","_rightWA","_bottomWA","showTop","showRight","showBottom","showLeft","topOverflowX","rightOverflowX","bottomOverflowX","leftOverflowX","topOverflowY","rightOverflowY","bottomOverflowY","leftOverflowY","targetNull","center","swap","sectionA","sectionB","a","callback","topOverlay","async","topBBox","bottomBBox","leftBBox","rightBBox","bottomHeight_exists","bodyWidth","bodyHeight","centerOverflowX","centerOverflowY","scrollCenterX","scrollCenterY","promises","all","Border2","_Carousel","activeWidget","active","_root","widgetElements","_prevActive","transition","duration","transitionDuration","isDOMHidden","aw","w2","Carousel","pi","Math","PI","tau","epsilon","tauEpsilon","Path","_x0","_y0","_x1","_y1","path","constant","moveTo","closePath","lineTo","quadraticCurveTo","x1","y1","bezierCurveTo","x2","y2","arcTo","x0","y0","x21","y21","x01","y01","l01_2","Error","abs","x20","y20","l21_2","l20_2","l21","sqrt","l01","tan","acos","t01","t21","arc","a0","a1","ccw","dx","cos","dy","sin","cw","da","h","toString","d3SymbolCircle","draw","d3SymbolCross","tan30","tan30_2","d3SymbolDiamond","kr","kx","ky","d3SymbolStar","s","d3SymbolSquare","sqrt3","d3SymbolTriangle","k","d3SymbolWye","d3Symbol","type","circle","symbol","buffer","_typeof","Symbol","iterator","d3_identity","d3_reverse","mirror","d3_textWrapping","word","words","reverse","line","tspan","pop","join","getComputedTextLength","d3_mergeLabels","gen","labels","domain","range","labelDelimiter","customLabels","genLength","_i","generatedLabels","d3_linearLegend","scale","cells","labelFormat","increment","map","feature","d3_quantLegend","invert","invertExtent","d3_ordinalLegend","d3_cellOver","cellDispatcher","d3_cellOut","d3_cellClick","helper","d3_drawShapes","shape","shapes","shapeHeight","shapeWidth","shapeRadius","d3_addText","svg","classPrefix","labelWidth","d3_calcType","ascending","ticks","d3_filterCells","cellFilter","filterCells","filter","dataValues","labelValues","d3_placement","orient","cellTrans","textTrans","labelAlign","d3_addEvents","dispatcher","d3_title","titleWidth","cellsSvg","yOffset","nodes","xOffset","d3_defaultLocale","format","formatPrefix","d3_defaultFormatSpecifier","d3_defaultDelimiter","color","scaleLinear","shapePadding","useClass","locale","specifier","labelOffset","labelWrap","legendDispatcher","dispatch","legend","cellEnter","textSize","shapeSize","cellSize","textAlign","max","sum","slice","formatLocale","formatSpecifier","toLowerCase","textWrap","value","_Legend","SVGWidget","owner","cross","diamond","square","star","triangle","wye","_owner","_drawStartPos","_legendOrdinal","d3LegendColor","onClick","onOver","onOut","isDisabled","_disabled","Database","Field","filteredFields","dataFamily","fields","filteredColumns","columns","filteredData","row","disabledCols","anyDisabled","col","disabled","isRainbow","getWidget","_palette","targetWidget","_targetWidget","_targetWidgetMonitor","key","newProp","oldProp","source","chart","getPalette","Palette","ordinal","rainbow","getPaletteType","fillColorFunc","fillColor","paletteID","name","switch","sel","palette","_g","calcMetaData","dataArr","total","maxLabelWidth","colLength","val","reduce","acc","showSeriesTotal","d3Format","rainbowFormat","steps","rainbowBins","weightMin","_dataMinWeight","weightMax","_dataMaxWeight","stepWeightDiff","mid","floor","parseInt","radius","radiusToSymbolSize","itemPadding","orientation","d3ScaleOrdinal","_symbolTypeMap","symbolType","labelMaxWidth","updateDisabled","legendCellsBbox","offsetX","offsetY","_containerSize","pos","legendTotal","showLegendTotal","totalText","totalOffsetX","totalOffsetY","enableOverflowScroll","enableOverflow","_boundingBox","_parentRelativeDiv","circleSize","pow","disabledIdx","refreshColumns","refreshData","instanceOfIHighlight","highlightColumn","onDblClick","rowData","rowIdx","onMouseOver","fitToContent","bbox","Legend","_Modal","closeModal","getRelativeTarget","relativeTarget","relativeTargetId","getElementById","locateAncestor","body","setModalSize","fixedHeight","fixedWidth","_modal","minHeight","minWidth","maxHeight","maxWidth","modalRect","headerRect","_modalHeader","_modalBody","setFadePosition","_fade","setModalPosition","fixedTop","fixedLeft","resizeBodySync","enableClickFadeToClose","showFade","header_h","titleFontSize","formattedTitle","_modalHeaderAnnotations","_modalHeaderCloseButton","html","show","_relativeTarget","title_exists","trim","Modal","_ChartPanel","ProgressBar","tiny","small","ToggleButton","faChar","tooltip","selected","description","_toggleInfo","Text","origCloseFunc","_close","dataVisible","_toggleData","Button","downloadCSV","downloadPNG","_toggleLegend","legendPosition","legendVisible","Spacer","TitleBar","buttons","_buttonDownload","_buttonDownloadImage","_spacer","Table","_legend","refreshFields","_table","asDefault","highlight","_highlight","startProgress","_progressBar","start","finishProgress","finish","_titleBar","namePrefix","downloadTitle","nameSuffix","downloadTimestampSuffix","timestamp","downloadString","export","column","cssTag","getResponsiveMode","enableAutoscaling","_autoScale","_resolutions","setOrigSize","_orig_size","JSON","parse","stringify","_carousel","preUpdateTiny","preUpdateSmall","scale_x","scale_y","_scale","min","x_is_smaller","preUpdateRegular","preUpdate","_prevLegendPosition","_prevdataVisible","_prevlegendVisible","_dataFamily","_prevChartDataFamily","highlightSize","highlightColor","_hideLegendToggleList","_prevChart","widgetIconBar","IconBar","_prevButtons","hiddenButtons","dataButtonVisible","downloadButtonVisible","downloadImageButtonVisible","legendButtonVisible","enabled","titleVisible","titleOverlay","postUpdateTiny","postUpdateSmall","postUpdateRegular","titleIconFontSize","_node","containerRect","icon_top","parentRect","_prevPos","dblclick","vertex_click","more","vertex","vertex_dblclick","edge_click","edge","edge_dblclick","ChartPanel","publishReset","publishProxy","tmpAny","_FlexGrid","parentNode","cachedSizes","updateFlexParent","listItems","itemMinHeight","itemMinWidth","flexBasis","widgetsFlexBasis","flexGrow","widgetsFlexGrow","borderWidth","itemBorderColor","firstChild","display","flexWrap","alignItems","alignContent","forceXScroll","disableScroll","forceYScroll","FlexGrid","exports","GridList","items","options","_options","defaults","hasOwnProperty","_adjustSizeOfItems","generateGrid","cloneItems","_items","lanes","direction","item","j","widthOfGrid","grid","output","border","_padNumber","_resetGrid","_markItemPositionToGrid","resizeGrid","currentColumn","_sortItemsByPosition","position","_getItemPosition","_updateItemPosition","findPositionForItem","_pullItemsToLeft","fixedRow","_itemFitsAtPosition","newCol","newRow","moveItemToPosition","newPosition","_resolveCollisions","resizeItem","_updateItemSize","getChangedItems","initialItems","idAttribute","changedItems","_getItemByAttribute","sort","item1","item2","position1","position2","bind","autoSize","_deleteItemPositionFromGrid","_setItemPosition","_ensureColumns","N","GridCol","_getItemsCollidingWithItem","collidingItems","_itemsAreColliding","_tryToResolveCollisionsLocally","leftOfItem","rightOfItem","aboveOfItem","belowOfItem","_gridList","collidingItem","collidingPosition","fixedItem","fixedPosition","_findLeftMostPositionForItem","tail","otherItem","otherPosition","nr","prefix","factory","_GridList","_GridList.default","_Grid","_selectionBag","Selection","getDimensions","gridCol","gridColSpan","gridRow","gridRowSpan","rowSpan","colSpan","sortedContent","some","getWidgetCell","cellToGridItem","gridItemToCell","resetItemsPos","origItems","origItem","itemsMap","initGridList","gridList","snapping","snappingRows","snappingColumns","killGridList","_d3Drag","subject","cellWidth","cellHeight","dragItem","selectionBagClick","updateGrid","_d3DragResize","dragItemPos","round","_noRender","divItems","surfaceShadow_default","surfacePadding_default","surfaceBorderWidth_default","surfaceBackgroundColor_default","fitTo","dimensions","cellLaneRatio","laneWidth","__grid_watch","_renderCount","lanesBackground","selectionBagClear","showLanes","_createSelectionObject","selection","set","get","isEmpty","clear","postSelectionChange","selectionObj","ctrlKey","isSelected","applyLayout","layoutArr","vizActivation","elem","Grid","_HorizontalList","orientation_default","flexWrap_default","HorizontalList","_Layered","_widgetPlacements","_widgetRatios","addLayer","placement","widthRatio","heightRatio","_contentContainer","clientSize","widgetPosition","order","Layered","_Popup","updateState","popupState","_originalPosition","shrinkWrap","centerPopup","window","innerWidth","innerHeight","Popup","_Tabbed","clearTabs","addTab","isActive","activeTabIdx","surface","tcBox","_tabContainer","tabs","showTabs","tabLocation","offsetHeight","Tabbed","_Toolbar","backgroundColor","fontSize_exists","fontSize","fontColor_exists","fontColor","fontFamily_exists","fontFamily","fontBold_exists","fontBold","backgroundColor_exists","childWidgets","widgetClass","widgetClasses","toolbarBBox","minX","childBBox","Toolbar","_VerticalList","VerticalList"],"mappings":"u/BAAO,MCIMA,EAAN,MAAMA,yBAAwBC,EAAAA,WACjC,WAAAC,GACIC,QAEAC,KAAKC,KAAO,KAChB,CAEA,KAAAC,CAAMC,EAASC,GACXL,MAAMG,MAAMC,EAASC,EACzB,CAEA,MAAAC,CAAOF,EAASC,GACZL,MAAMM,OAAOF,EAASC,GAEtB,IAAIE,EAAO,EACPC,EAAO,EACPC,EAAQR,KAAKS,cACbC,EAASV,KAAKW,eAClB,OAAQX,KAAKY,SACT,IAAK,SACDN,EAAON,KAAKa,UACZN,EAAOP,KAAKc,UACZN,EAA+B,KAAvBR,KAAKe,cAAuBP,EAAQF,EAAOU,OAAOhB,KAAKe,eAC/DL,EAAiC,KAAxBV,KAAKiB,eAAwBP,EAASH,EAAOS,OAAOhB,KAAKiB,gBAClE,MACJ,IAAK,UACDX,EAAON,KAAKa,UAAYL,EAAQ,IAChCD,EAAOP,KAAKc,UAAYJ,EAAS,IACjCF,EAA+B,KAAvBR,KAAKe,cAAuBP,EAAQF,EAAOU,OAAOhB,KAAKe,eAAiBP,EAAQ,IACxFE,EAAiC,KAAxBV,KAAKiB,eAAwBP,EAASH,EAAOS,OAAOhB,KAAKiB,gBAAkBP,EAAS,IAGrGN,EAAQc,MAAM,UAAWlB,KAAKmB,WAE9B,MAAMC,EAA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