@hpcc-js/layout 3.5.15 → 3.6.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.umd.cjs","names":["pi","tau","constant","circle","format","formatPrefix"],"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.css","../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 = \"__PACKAGE_NAME__\";\nexport const PKG_VERSION = \"__PACKAGE_VERSION__\";\nexport const BUILD_VERSION = \"__BUILD_VERSION__\";\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 { Table } from \"@hpcc-js/dgrid2\";\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\", \"dgrid2_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",".layout_Grid>.ddCell {\n position: absolute;\n}\n\n.layout_Grid>.laneBackground {\n position: absolute;\n border-style: solid;\n border-width: 1px;\n background: whitesmoke;\n}\n\n.layout_Grid>.lane {\n position: absolute;\n border-style: none;\n opacity: 0.25;\n border-radius: 0px;\n pointer-events: none;\n}\n\n.layout_Grid>.ddCell.draggable {\n border-style: solid;\n border-width: 1px;\n background-color: ghostwhite;\n border-radius: 0px;\n cursor: move;\n}\n\n.layout_Grid>.ddCell.draggable>.resizeHandle {\n bottom: 0px;\n right: 0px;\n width: 8px;\n height: 8px;\n border-style: none;\n position: absolute;\n cursor: nwse-resize;\n}\n\n.layout_Grid>.ddCell.draggable .resizeHandleDisplay {\n bottom: 2px;\n right: 2px;\n width: 4px;\n height: 4px;\n border-style: solid;\n border-left-width: 0px;\n border-top-width: 0px;\n border-right-width: 2px;\n border-bottom-width: 2px;\n border-color: darkGray;\n background-color: none;\n position: absolute;\n}\n\n.layout_Grid>.ddCell.draggable .resizeHandleDisplay:hover {\n border-color: orange;\n}\n\n.layout_Grid>.dragging {\n border-style: solid;\n border-width: 1px;\n border-color: gray;\n border-radius: 0px;\n position: absolute;\n background: repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0) 4px, rgba(100, 100, 100, 0.1) 4px, rgba(100, 100, 100, 0.1) 8px);\n}\n\n.layout_Grid>.resizing {\n border-style: solid;\n border-width: 1px;\n border-color: gray;\n background-color: orange;\n border-radius: 0px;\n position: absolute;\n opacity: 0.3;\n background: repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0) 4px, orange 4px, orange 8px);\n}\n\n.layout_Grid>.ddCell.draggable .common_Widget.selected {\n border-style: solid;\n border-width: 1px;\n border-color: red;\n background-color: gray;\n border-radius: 0px;\n position: absolute;\n background: repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0) 4px, rgba(100, 0, 0, 0.1) 4px, rgba(100, 0, 0, 0.1) 8px);\n}\n\n.layout_Grid #drag-me::before {\n content: \"#\" attr(id);\n font-weight: bold;\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"],"x_google_ignoreList":[8,9,10,11,12,13,14,15,16,17,18,19,24],"mappings":"wlCAAa,EAAW,kBACX,EAAc,SACd,EAAgB,SCEhB,gBAAb,cAAqC,EAAA,UAAW,CAC5C,aAAc,CACV,MAAM,EAEN,KAAK,KAAO,KAChB,CAEA,MAA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EAAK,CAAC,EAC1H,QAAQ,UAAU,QAAQ,YAAa,KAAM,aAAc,mBAAoB,KAAM,CAAE,KAAM,CAAC,UAAU,EAAG,SAAU,EAAK,CAAC,EAC3H,QAAQ,UAAU,QAAQ,aAAc,KAAM,SAAU,oBAAqB,KAAM,CAAE,KAAM,CAAC,UAAU,EAAG,SAAU,EAAK,CAAC,EACzH,QAAQ,UAAU,QAAQ,WAAY,GAAM,UAAW,yBAA0B,KAAM,CAAE,KAAM,CAAC,UAAU,EAAG,SAAU,EAAK,CAAC,EAC7H,QAAQ,UAAU,QAAQ,kBAAmB,KAAM,aAAc,mBAAoB,KAAM,CAAE,KAAM,CAAC,cAAc,EAAG,SAAU,EAAK,CAAC,EAErI,QAAQ,UAAU,QAAQ,aAAc,GAAM,UAAW,wBAAyB,KAAM,CAAE,KAAM,CAAC,OAAO,CAAE,CAAC,EAE3G,QAAQ,UAAU,QAAQ,UAAW,CAAC,EAAG,cAAe,+BAAgC,KAAM,CAAE,KAAM,CAAC,OAAO,CAAE,CAAC,EACjH,QAAQ,UAAU,QAAQ,gBAAiB,CAAC,EAAG,QAAS,sGAAuG,KAAM,CAAE,KAAM,CAAC,OAAO,CAAE,CAAC,EC5HxL,IAAa,aAAb,cAAkC,QAAS,CACvC,aAAc,CACV,MAAM,EACN,KAAK,oBAAoB,UAAU,EACnC,KAAK,iBAAiB,QAAQ,CAClC,CACJ,EACA,aAAa,UAAU,QAAU"}
1
+ {"version":3,"file":"index.umd.cjs","names":["pi","tau","constant","circle","format","formatPrefix"],"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.css","../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 = \"__PACKAGE_NAME__\";\nexport const PKG_VERSION = \"__PACKAGE_VERSION__\";\nexport const BUILD_VERSION = \"__BUILD_VERSION__\";\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 { Table } from \"@hpcc-js/dgrid2\";\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\", \"dgrid2_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",".layout_Grid>.ddCell {\n position: absolute;\n}\n\n.layout_Grid>.laneBackground {\n position: absolute;\n border-style: solid;\n border-width: 1px;\n background: whitesmoke;\n}\n\n.layout_Grid>.lane {\n position: absolute;\n border-style: none;\n opacity: 0.25;\n border-radius: 0px;\n pointer-events: none;\n}\n\n.layout_Grid>.ddCell.draggable {\n border-style: solid;\n border-width: 1px;\n background-color: ghostwhite;\n border-radius: 0px;\n cursor: move;\n}\n\n.layout_Grid>.ddCell.draggable>.resizeHandle {\n bottom: 0px;\n right: 0px;\n width: 8px;\n height: 8px;\n border-style: none;\n position: absolute;\n cursor: nwse-resize;\n}\n\n.layout_Grid>.ddCell.draggable .resizeHandleDisplay {\n bottom: 2px;\n right: 2px;\n width: 4px;\n height: 4px;\n border-style: solid;\n border-left-width: 0px;\n border-top-width: 0px;\n border-right-width: 2px;\n border-bottom-width: 2px;\n border-color: darkGray;\n background-color: none;\n position: absolute;\n}\n\n.layout_Grid>.ddCell.draggable .resizeHandleDisplay:hover {\n border-color: orange;\n}\n\n.layout_Grid>.dragging {\n border-style: solid;\n border-width: 1px;\n border-color: gray;\n border-radius: 0px;\n position: absolute;\n background: repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0) 4px, rgba(100, 100, 100, 0.1) 4px, rgba(100, 100, 100, 0.1) 8px);\n}\n\n.layout_Grid>.resizing {\n border-style: solid;\n border-width: 1px;\n border-color: gray;\n background-color: orange;\n border-radius: 0px;\n position: absolute;\n opacity: 0.3;\n background: repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0) 4px, orange 4px, orange 8px);\n}\n\n.layout_Grid>.ddCell.draggable .common_Widget.selected {\n border-style: solid;\n border-width: 1px;\n border-color: red;\n background-color: gray;\n border-radius: 0px;\n position: absolute;\n background: repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0) 4px, rgba(100, 0, 0, 0.1) 4px, rgba(100, 0, 0, 0.1) 8px);\n}\n\n.layout_Grid #drag-me::before {\n content: \"#\" attr(id);\n font-weight: bold;\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"],"x_google_ignoreList":[8,9,10,11,12,13,14,15,16,17,18,19,24],"mappings":"wlCAAa,EAAW,kBACX,EAAc,QACd,EAAgB,SCEhB,gBAAb,cAAqC,EAAA,UAAW,CAC5C,aAAc,CACV,MAAM,EAEN,KAAK,KAAO,KAChB,CAEA,MAAM,EAAS,EAAS,CACpB,MAAM,MAAM,EAAS,CAAO,CAChC,CAEA,OAAO,EAAS,EAAS,CACrB,MAAM,OAAO,EAAS,CAAO,EAE7B,IAAI,EAAO,EACP,EAAO,EACP,EAAQ,KAAK,YAAY,EACzB,EAAS,KAAK,aAAa,EAC/B,OAAQ,KAAK,MAAM,EAAnB,CACI,IAAK,SACD,EAAO,KAAK,QAAQ,EACpB,EAAO,KAAK,QAAQ,EACpB,EAAQ,KAAK,YAAY,IAAM,GAAK,EAAQ,EAAO,OAAO,KAAK,YAAY,CAAC,EAC5E,EAAS,KAAK,aAAa,IAAM,GAAK,EAAS,EAAO,OAAO,KAAK,aAAa,CAAC,EAChF,MACJ,IAAK,UACD,EAAO,KAAK,QAAQ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