@hpcc-js/layout 3.4.1 → 3.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/__package__.ts","../src/AbsoluteSurface.ts","../src/Accordion.ts","../src/Surface.ts","../src/Cell.ts","../src/Border.ts","../src/Border2.ts","../src/Carousel.ts","../../../node_modules/d3-path/src/path.js","../../../node_modules/d3-shape/src/constant.js","../../../node_modules/d3-shape/src/math.js","../../../node_modules/d3-shape/src/symbol/circle.js","../../../node_modules/d3-shape/src/symbol/cross.js","../../../node_modules/d3-shape/src/symbol/diamond.js","../../../node_modules/d3-shape/src/symbol/star.js","../../../node_modules/d3-shape/src/symbol/square.js","../../../node_modules/d3-shape/src/symbol/triangle.js","../../../node_modules/d3-shape/src/symbol/wye.js","../../../node_modules/d3-shape/src/symbol.js","../../../node_modules/d3-svg-legend/indexRollupNext.js","../src/Legend.ts","../src/Modal.ts","../src/ChartPanel.ts","../src/FlexGrid.ts","../../../node_modules/grid-list/src/gridList.js","../src/Grid.ts","../src/HorizontalList.ts","../src/Layered.ts","../src/Popup.ts","../src/Tabbed.ts","../src/Toolbar.ts","../src/VerticalList.ts"],"sourcesContent":["export const PKG_NAME = \"__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 type { XYAxis } from \"@hpcc-js/chart\";\nimport { Table } from \"@hpcc-js/dgrid\";\nimport { select as d3Select } from \"d3-selection\";\nimport { Border2 } from \"./Border2.ts\";\nimport { Carousel } from \"./Carousel.ts\";\nimport { Legend } from \"./Legend.ts\";\nimport { Modal } from \"./Modal.ts\";\n\nimport \"../src/ChartPanel.css\";\n\nexport class ChartPanel<T extends Widget = Widget> extends Border2 implements IHighlight {\n\n protected _legend = new Legend(this).enableOverflow(true);\n protected _progressBar = new ProgressBar();\n protected _autoScale = false;\n protected _resolutions = {\n tiny: { width: 100, height: 100 },\n small: { width: 300, height: 300 }\n };\n private _modal = new Modal();\n private _highlight: boolean;\n private _scale: number;\n private _orig_size: any;\n\n private _toggleInfo = new ToggleButton().faChar(\"fa-info-circle\").tooltip(\".Description\")\n .selected(false)\n .on(\"enabled\", () => {\n return this.description() !== \"\";\n })\n .on(\"click\", () => {\n if (this._toggleInfo.selected()) {\n this._modal\n .title(this.title())\n .widget(new Text().text(this.description()))\n .show(true)\n .render()\n ;\n\n const origCloseFunc = this._modal._close;\n this._modal._close = () => {\n this._toggleInfo\n .selected(false)\n .render()\n ;\n this._modal._close = origCloseFunc;\n };\n }\n })\n .on(\"mouseMove\", () => {\n /*\n this._modal.showPreview(true).render(n => {\n n.resize().render();\n });\n */\n })\n .on(\"mouseOut\", () => {\n /*\n if (this._modal.showPreview()) {\n this._modal.show(false).showPreview(false).render();\n }\n */\n });\n\n private _toggleData = new ToggleButton().faChar(\"fa-table\").tooltip(\"Data\")\n .on(\"click\", () => {\n this.dataVisible(this._toggleData.selected());\n this.render();\n });\n\n private _buttonDownload = new Button().faChar(\"fa-download\").tooltip(\"Download\")\n .on(\"click\", () => {\n this.downloadCSV();\n });\n\n private _buttonDownloadImage = new Button().faChar(\"fa-image\").tooltip(\"Download Image\")\n .on(\"click\", () => {\n this.downloadPNG();\n });\n\n private _toggleLegend = new ToggleButton().faChar(\"fa-list-ul\").tooltip(\"Legend\")\n .selected(false)\n .on(\"click\", () => {\n const selected = this._toggleLegend.selected();\n if (this.legendPosition() === \"bottom\") {\n this.showBottom(selected);\n } else if (this.legendPosition() === \"right\") {\n this.showRight(selected);\n }\n this.legendVisible(selected);\n this.render();\n });\n\n protected _spacer = new Spacer();\n\n _titleBar = new TitleBar().buttons([this._toggleData, this._buttonDownload, this._buttonDownloadImage, this._spacer, this._toggleLegend]);\n\n protected _carousel = new Carousel();\n protected _table = new Table();\n protected _widget: T;\n\n protected _hideLegendToggleList = [\"dgrid_Table\"];\n\n constructor() {\n super();\n this._tag = \"div\";\n }\n\n fields(): Database.Field[];\n fields(_: Database.Field[]): this;\n fields(_?: Database.Field[]): this | Database.Field[] {\n if (!arguments.length) return super.fields();\n super.fields(_);\n this._legend.fields(_);\n this.refreshFields();\n return this;\n }\n refreshFields() {\n this._widget.fields(this._legend.filteredFields());\n this._table.fields(this._legend.filteredFields());\n return this;\n }\n\n columns(): string[];\n columns(_: string[], asDefault?: boolean): this;\n columns(_?: string[], asDefault?: boolean): string[] | this {\n if (!arguments.length) return super.columns();\n super.columns(_, asDefault);\n this._legend.columns(_, asDefault);\n this.refreshColumns();\n return this;\n }\n refreshColumns() {\n this._widget.columns(this._legend.filteredColumns());\n this._table.columns(this._legend.filteredColumns());\n return this;\n }\n\n data(_?) {\n if (!arguments.length) return super.data();\n super.data(_);\n this._legend.data(_);\n this.refreshData();\n return this;\n }\n refreshData() {\n this._widget.data(this._legend.filteredData());\n this._table.data(this._legend.filteredData());\n return this;\n }\n\n highlight(): boolean;\n highlight(_: boolean): this;\n highlight(_?: boolean): boolean | this {\n if (!arguments.length) return this._highlight;\n this._highlight = _;\n return this;\n }\n\n startProgress() {\n this._progressBar.start();\n }\n\n finishProgress() {\n this._progressBar.finish();\n }\n\n buttons(): Widget[];\n buttons(_: Widget[]): this;\n buttons(_?: Widget[]): this | Widget[] {\n if (!arguments.length) return this._titleBar.buttons();\n this._titleBar.buttons(_);\n return this;\n }\n\n downloadCSV() {\n const namePrefix = this.downloadTitle() ? this.downloadTitle() : this.title() ? this.title() : \"data\";\n const nameSuffix = this.downloadTimestampSuffix() ? \"_\" + Utility.timestamp() : \"\";\n Utility.downloadString(\"CSV\", this._widget.export(\"CSV\"), namePrefix + nameSuffix);\n return this;\n }\n\n downloadPNG() {\n const widget = this.widget();\n if (widget instanceof SVGWidget) {\n if (!this.legendVisible()) {\n widget.downloadPNG(this.title());\n } else {\n widget.downloadPNG(this.title(), undefined, this._legend);\n }\n }\n return this;\n }\n\n highlightColumn(column?: string): this {\n if (column) {\n const cssTag = `series-${this.cssTag(column)}`;\n this._centerWA.element().selectAll(\".series\")\n .each(function () {\n const element = d3Select(this);\n const highlight = element.classed(cssTag);\n element\n .classed(\"highlight\", highlight)\n .classed(\"lowlight\", !highlight)\n ;\n })\n ;\n } else {\n this._centerWA.element().selectAll(\".series\")\n .classed(\"highlight\", false)\n .classed(\"lowlight\", false)\n ;\n }\n return this;\n }\n\n getResponsiveMode(): \"tiny\" | \"small\" | \"regular\" | \"none\" {\n if (!this.enableAutoscaling()) return \"none\";\n if (!this._autoScale) return \"regular\";\n if (this.size().width <= this._resolutions.tiny.width || this.size().height <= this._resolutions.tiny.height) {\n return \"tiny\";\n } else if (this.size().width <= this._resolutions.small.width || this.size().height <= this._resolutions.small.height) {\n return \"small\";\n }\n return \"regular\";\n }\n\n setOrigSize() {\n this._orig_size = JSON.parse(JSON.stringify(this.size()));\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this._modal\n .target(this.target())\n .relativeTargetId(this.id())\n ;\n\n this.top(this._titleBar);\n this.center(this._carousel);\n\n this._legend\n .targetWidget(this._widget)\n .orientation(\"vertical\")\n .title(\"\")\n .visible(false)\n ;\n\n this._progressBar.enter(domNode, element);\n this.setOrigSize();\n }\n\n preUpdateTiny(element) {\n element.selectAll(\"div.body,div.title-text,div.icon-bar\").style(\"display\", \"none\");\n }\n\n preUpdateSmall(element) {\n const scale_x = this._orig_size.width / this._resolutions.small.width;\n const scale_y = this._orig_size.height / this._resolutions.small.height;\n this._scale = Math.min(scale_x, scale_y);\n const x_is_smaller = this._scale === scale_x;\n this.size({\n width: x_is_smaller ? this._resolutions.small.width : this._orig_size.width * (1 / this._scale),\n height: !x_is_smaller ? this._resolutions.small.height : this._orig_size.height * (1 / this._scale)\n });\n element.select(\"div.title-icon\").style(\"position\", \"static\");\n element.selectAll(\"lhs\").style(\"display\", \"none\");\n element.selectAll(\"div.body,div.title-text,div.icon-bar\").style(\"display\", \"\");\n element.selectAll(\"div.data-count\").style(\"visibility\", \"hidden\");\n element.style(\"transform\", `scale(${this._scale})`);\n }\n\n preUpdateRegular(element) {\n element.selectAll(\"div.body,div.title-text,div.icon-bar\").style(\"display\", \"\");\n element.selectAll(\"div.data-count\").style(\"visibility\", \"hidden\");\n element.select(\"div.title-icon\").style(\"position\", \"static\");\n element.style(\"transform\", \"translate(0px,0px) scale(1)\");\n }\n\n private _prevdataVisible;\n private _prevlegendVisible;\n private _prevLegendPosition;\n private _prevChartDataFamily;\n private _prevChart;\n private _prevButtons;\n update(domNode, element) {\n super.update(domNode, element);\n }\n\n preUpdate(domNode, element) {\n\n super.preUpdate(domNode, element);\n\n if (this._prevLegendPosition !== this.legendPosition()) {\n if (this._legend.target() !== null) this._legend.target(null);\n if (this._prevLegendPosition !== undefined) {\n this.swap(this._prevLegendPosition, this.legendPosition());\n } else {\n this[this.legendPosition()](this._legend);\n }\n if (this.legendPosition() === \"right\") {\n this.rightOverflowX(\"hidden\");\n this.rightOverflowY(\"auto\");\n this.bottomOverflowX(\"visible\");\n this.bottomOverflowY(\"visible\");\n } else {\n this.rightOverflowX(\"visible\");\n this.rightOverflowY(\"visible\");\n this.bottomOverflowX(\"auto\");\n this.bottomOverflowY(\"hidden\");\n }\n this._prevLegendPosition = this.legendPosition();\n }\n\n if (this._prevdataVisible !== this.dataVisible()) {\n this._prevdataVisible = this.dataVisible();\n this._toggleData.selected(this._prevdataVisible);\n this._legend.visible(this._prevlegendVisible && !this._prevdataVisible);\n this._carousel.active(this._prevdataVisible ? 1 : 0);\n }\n\n if (this._prevlegendVisible !== this.legendVisible()) {\n this._prevlegendVisible = this.legendVisible();\n this._toggleLegend.selected(this._prevlegendVisible);\n this._legend.visible(this._prevlegendVisible && !this._prevdataVisible);\n }\n\n this._legend.orientation(this.legendPosition() === \"bottom\" ? \"horizontal\" : \"vertical\");\n\n this.showLeft(!this.left());\n\n switch (this.getResponsiveMode()) {\n case \"tiny\":\n this.preUpdateTiny(element);\n break;\n case \"small\":\n this.preUpdateSmall(element);\n break;\n case \"regular\":\n this.preUpdateRegular(element);\n break;\n }\n\n const chart = this._widget.classID() === \"composite_MultiChart\" ? this._widget[\"chart\"]() : this._widget;\n this._legend.dataFamily(chart._dataFamily || \"any\");\n\n if (this._prevChartDataFamily !== this._legend.dataFamily()) {\n this._prevChartDataFamily = this._legend.dataFamily();\n switch (this._prevChartDataFamily) {\n case \"any\":\n this._toggleLegend.selected(false);\n this._legend.visible(false);\n break;\n }\n }\n element.style(\"box-shadow\", this.highlight() ? `inset 0px 0px 0px ${this.highlightSize()}px ${this.highlightColor()}` : \"none\");\n\n if (this._hideLegendToggleList.indexOf(chart.classID()) !== -1) {\n this._spacer.visible(false);\n this._toggleLegend.visible(false);\n } else {\n this._spacer.visible(true);\n this._toggleLegend.visible(true);\n }\n if (this._prevChart !== chart) {\n this._prevChart = chart;\n const widgetIconBar = chart ? chart[\"_titleBar\"] || chart[\"_iconBar\"] : undefined;\n if (widgetIconBar && widgetIconBar instanceof IconBar) {\n this._prevButtons = this._prevButtons || [...this.buttons()];\n const buttons: Widget[] = [\n ...widgetIconBar.buttons(),\n new Spacer(),\n ...this._prevButtons\n ];\n widgetIconBar.buttons([]).render();\n this.buttons(buttons);\n } else if (this._prevButtons) {\n this.buttons(this._prevButtons);\n }\n }\n\n const hiddenButtons = [];\n if (!this.dataButtonVisible()) hiddenButtons.push(this._toggleData);\n if (!this.downloadButtonVisible()) hiddenButtons.push(this._buttonDownload);\n if (!this.downloadImageButtonVisible()) hiddenButtons.push(this._buttonDownloadImage);\n if (!this.legendButtonVisible()) hiddenButtons.push(this._toggleLegend);\n this._buttonDownloadImage.enabled(this.widget() instanceof SVGWidget);\n this._titleBar\n .hiddenButtons(hiddenButtons)\n .visible(this.titleVisible())\n ;\n this.topOverlay(this.titleOverlay() || !this.titleVisible());\n }\n\n postUpdate(domNode, element) {\n super.postUpdate(domNode, element);\n\n switch (this.getResponsiveMode()) {\n case \"tiny\":\n this.postUpdateTiny(element);\n break;\n case \"small\":\n this.postUpdateSmall(element);\n break;\n case \"regular\":\n this.postUpdateRegular(element);\n break;\n }\n }\n\n postUpdateTiny(element) {\n element.selectAll(\"div.body,div.title-text,div.icon-bar\").style(\"display\", \"none\");\n element.selectAll(\"div.data-count\")\n .style(\"visibility\", \"visible\")\n .style(\"font-size\", (this.titleIconFontSize() / 3) + \"px\")\n .style(\"line-height\", (this.titleIconFontSize() / 3) + \"px\")\n .style(\"left\", this.titleIconFontSize() + \"px\")\n .text(this.data().length)\n ;\n element.style(\"transform\", \"translate(0px,0px) scale(1)\");\n const iconDiv = element.selectAll(\"div.title-icon\");\n const _node = iconDiv.node();\n const _container = element.node().parentElement;\n const containerRect = _container.getBoundingClientRect();\n if (_node) {\n const rect = iconDiv.node().getBoundingClientRect();\n const icon_top = containerRect.height / 2;\n iconDiv\n .style(\"position\", \"absolute\")\n .style(\"left\", `calc(50% - ${rect.width / 2}px)`)\n .style(\"top\", `${icon_top - (rect.height / 2)}px`)\n ;\n element.selectAll(\"div.data-count\")\n .style(\"position\", \"absolute\")\n .style(\"left\", `calc(50% + ${rect.width / 2}px)`)\n .style(\"top\", `${icon_top - (rect.height / 2)}px`)\n ;\n }\n }\n\n postUpdateSmall(element) {\n element.selectAll(\"lhs\").style(\"display\", \"none\"); // TODO: a bug in Border2?\n element.selectAll(\"div.title-icon\").style(\"position\", \"static\");\n element.selectAll(\"div.body,div.title-text,div.icon-bar\").style(\"display\", \"\");\n element.selectAll(\"div.data-count\").style(\"visibility\", \"hidden\");\n const rect = element.node().getBoundingClientRect();\n const parentRect = element.node().parentElement.getBoundingClientRect();\n element.style(\"transform\", `translate(${parentRect.x - rect.x}px, ${parentRect.y - rect.y}px) scale(${this._scale})`);\n }\n\n postUpdateRegular(element) {\n element.selectAll(\"div.title-icon\").style(\"position\", \"static\");\n element.selectAll(\"div.body,div.title-text,div.icon-bar\").style(\"display\", \"\");\n element.selectAll(\"div.data-count\").style(\"visibility\", \"hidden\");\n }\n\n exit(domNode, element) {\n this._progressBar.exit(domNode, element);\n\n this.right(null);\n this._legend.target(null);\n this.center(null);\n this._carousel.target(null);\n this.top(null);\n this._titleBar.target(null);\n\n this._modal.target(null);\n\n delete this._prevChart;\n delete this._prevButtons;\n delete this._prevChartDataFamily;\n delete this._prevPos;\n delete this._prevdataVisible;\n delete this._prevlegendVisible;\n\n super.exit(domNode, element);\n }\n\n // Event Handlers ---\n // Events ---\n click(row, column, selected) {\n // console.log(\"Click: \" + JSON.stringify(row) + \", \" + column + \", \" + selected);\n }\n\n dblclick(row, column, selected) {\n // console.log(\"Double click: \" + JSON.stringify(row) + \", \" + column + \", \" + selected);\n }\n\n vertex_click(row, col, sel, more) {\n if (more && more.vertex) {\n // console.log(\"Vertex click: \" + more.vertex.id());\n }\n }\n\n vertex_dblclick(row, col, sel, more) {\n if (more && more.vertex) {\n // console.log(\"Vertex double click: \" + more.vertex.id());\n }\n }\n\n edge_click(row, col, sel, more) {\n if (more && more.edge) {\n // console.log(\"Edge click: \" + more.edge.id());\n }\n }\n\n edge_dblclick(row, col, sel, more) {\n if (more && more.edge) {\n // console.log(\"Edge double click: \" + more.edge.id());\n }\n }\n}\nChartPanel.prototype._class += \" layout_ChartPanel\";\n\nexport interface ChartPanel<T extends Widget = Widget> {\n title(): string;\n title(_: string): this;\n titleVisible(): boolean;\n titleVisible(_: boolean): this;\n titleOverlay(): boolean;\n titleOverlay(_: boolean): this;\n title_exists(): boolean;\n titleFontSize(): number;\n titleFontSize(_: number): this;\n titleFontSize_exists(): boolean;\n titleIconFontSize(): number;\n titleIconFontSize(_: number): this;\n titleIconFontSize_exists(): boolean;\n dataVisible(): boolean;\n dataVisible(_: boolean): this;\n dataButtonVisible(): boolean;\n dataButtonVisible(_: boolean): this;\n downloadButtonVisible(): boolean;\n downloadButtonVisible(_: boolean): this;\n downloadImageButtonVisible(): boolean;\n downloadImageButtonVisible(_: boolean): this;\n downloadTitle(): string;\n downloadTitle(_: string): this;\n downloadTimestampSuffix(): boolean;\n downloadTimestampSuffix(_: boolean): this;\n legendVisible(): boolean;\n legendVisible(_: boolean): this;\n legendButtonVisible(): boolean;\n legendButtonVisible(_: boolean): this;\n legendPosition(): \"right\" | \"bottom\";\n legendPosition(_: \"right\" | \"bottom\"): this;\n description(): string;\n description(_: string): this;\n description_exists(): boolean;\n widget(): T;\n widget(_: T): this;\n widget_exists(): boolean;\n enableAutoscaling(): boolean;\n enableAutoscaling(_: boolean): this;\n enableAutoscaling_exists(): boolean;\n highlightSize(): number;\n highlightSize(_: number): this;\n highlightSize_exists(): boolean;\n highlightColor(): string;\n highlightColor(_: string): this;\n highlightColor_exists(): boolean;\n}\n\nChartPanel.prototype.publishReset();\nChartPanel.prototype.publishProxy(\"title\", \"_titleBar\");\nChartPanel.prototype.publish(\"titleVisible\", true, \"boolean\");\nChartPanel.prototype.publish(\"titleOverlay\", false, \"boolean\");\nChartPanel.prototype.publishProxy(\"titleIcon\", \"_titleBar\");\nChartPanel.prototype.publishProxy(\"titleIconFont\", \"_titleBar\");\nChartPanel.prototype.publishProxy(\"titleFont\", \"_titleBar\");\nChartPanel.prototype.publishProxy(\"titleIconFontSize\", \"_titleBar\");\nChartPanel.prototype.publishProxy(\"titleFontSize\", \"_titleBar\");\nChartPanel.prototype.publishProxy(\"description\", \"_titleBar\");\nChartPanel.prototype.publishProxy(\"descriptionFont\", \"_titleBar\");\nChartPanel.prototype.publishProxy(\"descriptionFontSize\", \"_titleBar\");\nChartPanel.prototype.publish(\"dataVisible\", false, \"boolean\", \"Show data table\");\nChartPanel.prototype.publish(\"dataButtonVisible\", true, \"boolean\", \"Show data table button\");\nChartPanel.prototype.publish(\"downloadButtonVisible\", true, \"boolean\", \"Show data download button\");\nChartPanel.prototype.publish(\"downloadImageButtonVisible\", false, \"boolean\", \"Show image download button\");\nChartPanel.prototype.publish(\"downloadTitle\", \"\", \"string\", \"File name when downloaded\");\nChartPanel.prototype.publish(\"downloadTimestampSuffix\", true, \"boolean\", \"Use timestamp as file name suffix\");\nChartPanel.prototype.publish(\"legendVisible\", false, \"boolean\", \"Show legend\");\nChartPanel.prototype.publish(\"legendButtonVisible\", true, \"boolean\", \"Show legend button\");\nChartPanel.prototype.publish(\"legendPosition\", \"right\", \"set\", \"Position of legend\", [\"right\", \"bottom\"]);\nChartPanel.prototype.publishProxy(\"legend_labelMaxWidth\", \"_legend\", \"labelMaxWidth\");\nChartPanel.prototype.publishProxy(\"legend_showSeriesTotal\", \"_legend\", \"showSeriesTotal\");\nChartPanel.prototype.publishProxy(\"legend_showLegendTotal\", \"_legend\", \"showLegendTotal\");\nChartPanel.prototype.publishProxy(\"legend_itemPadding\", \"_legend\", \"itemPadding\");\nChartPanel.prototype.publishProxy(\"legend_shapeRadius\", \"_legend\", \"shapeRadius\");\nChartPanel.prototype.publishProxy(\"legend_symbolType\", \"_legend\", \"symbolType\");\nChartPanel.prototype.publishProxy(\"legend_labelAlign\", \"_legend\", \"labelAlign\");\nChartPanel.prototype.publish(\"widget\", null, \"widget\", \"Widget\", undefined, { render: false });\nChartPanel.prototype.publish(\"enableAutoscaling\", false, \"boolean\");\nChartPanel.prototype.publish(\"highlightSize\", 4, \"number\");\nChartPanel.prototype.publish(\"highlightColor\", \"#e67e22\", \"html-color\");\nChartPanel.prototype.publishProxy(\"progress_halfLife\", \"_progressBar\", \"halfLife\");\nChartPanel.prototype.publishProxy(\"progress_decay\", \"_progressBar\", \"decay\");\nChartPanel.prototype.publishProxy(\"progress_size\", \"_progressBar\", \"size\");\nChartPanel.prototype.publishProxy(\"progress_color\", \"_progressBar\", \"color\");\nChartPanel.prototype.publishProxy(\"progress_blurBar\", \"_progressBar\", \"blurBar\");\nChartPanel.prototype.publishProxy(\"progress_blurSize\", \"_progressBar\", \"blurSize\");\nChartPanel.prototype.publishProxy(\"progress_blurColor\", \"_progressBar\", \"blurColor\");\nChartPanel.prototype.publishProxy(\"progress_blurOpacity\", \"_progressBar\", \"blurOpacity\");\n\nChartPanel.prototype.widget = function (_?) {\n if (!arguments.length) return this._widget;\n this._carousel.widgets([_, this._table]);\n this._widget = _;\n this._widget\n .fields(this._legend.filteredFields())\n .data(this._legend.filteredData())\n ;\n\n const context = this;\n const tmpAny = this._widget as any;\n tmpAny.click = function () {\n context.click.apply(context, arguments);\n };\n tmpAny.dblclick = function () {\n context.dblclick.apply(context, arguments);\n };\n tmpAny.vertex_click = function () {\n context.vertex_click.apply(context, arguments);\n };\n tmpAny.vertex_dblclick = function () {\n context.vertex_dblclick.apply(context, arguments);\n };\n tmpAny.edge_click = function () {\n context.edge_click.apply(context, arguments);\n };\n tmpAny.edge_dblclick = function () {\n context.edge_dblclick.apply(context, arguments);\n };\n return this;\n};\n","import { HTMLWidget } from \"@hpcc-js/common\";\nimport { select as d3Select } from \"d3-selection\";\n\nimport \"../src/FlexGrid.css\";\n\nexport class FlexGrid extends HTMLWidget {\n constructor() {\n super();\n }\n enter(domNode, element) {\n super.enter(domNode, element);\n d3Select(domNode.parentNode)\n .style(\"height\", \"100%\")\n .style(\"width\", \"100%\")\n ;\n }\n update(domNode, element) {\n super.update(domNode, element);\n const context = this;\n\n const cachedSizes = [];\n this.updateFlexParent(element);\n const listItems = element.selectAll(\".FlexGrid-list-item\").data(this.widgets(), w => w.id());\n listItems.enter()\n .append(\"div\")\n .classed(\"FlexGrid-list-item\", true)\n .each(function (w) {\n w.target(this);\n })\n .merge(listItems)\n .style(\"min-height\", this.itemMinHeight() + \"px\")\n .style(\"min-width\", this.itemMinWidth() + \"px\")\n .style(\"flex-basis\", (n, i) => {\n const flexBasis = this.widgetsFlexBasis()[i];\n return typeof flexBasis !== \"undefined\" ? flexBasis : this.flexBasis();\n })\n .style(\"flex-grow\", (n, i) => {\n const flexGrow = this.widgetsFlexGrow()[i];\n return typeof flexGrow !== \"undefined\" ? flexGrow : this.flexGrow();\n })\n .style(\"border-width\", this.borderWidth() + \"px\")\n .style(\"border-color\", this.itemBorderColor())\n .each(function () {\n this.firstChild.style.display = \"none\";\n })\n .each(function () {\n const rect = this.getBoundingClientRect();\n cachedSizes.push([\n rect.width,\n rect.height\n ]);\n })\n .each(function (w, i) {\n this.firstChild.style.display = \"block\";\n w.resize({\n width: cachedSizes[i][0] - (2 * context.borderWidth()),\n height: cachedSizes[i][1] - (2 * context.borderWidth())\n });\n })\n ;\n listItems.exit().remove();\n }\n exit(domNode, element) {\n super.exit(domNode, element);\n }\n updateFlexParent(element) {\n element\n .style(\"height\", \"100%\")\n .style(\"flex-direction\", this.orientation() === \"horizontal\" ? \"row\" : \"column\")\n .style(\"flex-wrap\", this.flexWrap())\n .style(\"align-items\", this.alignItems())\n .style(\"align-content\", this.alignContent())\n .style(\"overflow-x\", () => {\n if (this.forceXScroll() || (this.orientation() === \"horizontal\" && this.flexWrap() === \"nowrap\" && !this.disableScroll())) {\n return \"scroll\";\n }\n return \"hidden\";\n })\n .style(\"overflow-y\", () => {\n if (this.forceYScroll() || (this.orientation() === \"vertical\" && this.flexWrap() === \"nowrap\" && !this.disableScroll())) {\n return \"scroll\";\n }\n return \"hidden\";\n })\n ;\n }\n}\nFlexGrid.prototype._class += \" layout_FlexGrid\";\n\nexport interface FlexGrid {\n widgets(): any;\n widgets(_: any): this;\n orientation(): \"horizontal\" | \"vertical\";\n orientation(_: \"horizontal\" | \"vertical\"): this;\n flexWrap(): \"nowrap\" | \"wrap\" | \"wrap-reverse\";\n flexWrap(_: \"nowrap\" | \"wrap\" | \"wrap-reverse\"): this;\n itemMinHeight(): number;\n itemMinHeight(_: number): this;\n itemMinWidth(): number;\n itemMinWidth(_: number): this;\n alignItems(): \"flex-start\" | \"center\" | \"flex-end\" | \"stretch\";\n alignItems(_: \"flex-start\" | \"center\" | \"flex-end\" | \"stretch\"): this;\n alignContent(): \"flex-start\" | \"center\" | \"flex-end\" | \"stretch\" | \"space-between\" | \"space-around\";\n alignContent(_: \"flex-start\" | \"center\" | \"flex-end\" | \"stretch\" | \"space-between\" | \"space-around\"): this;\n itemBorderColor(): string;\n itemBorderColor(_: string): this;\n borderWidth(): number;\n borderWidth(_: number): this;\n flexGrow(): number;\n flexGrow(_: number): this;\n widgetsFlexGrow(): number[];\n widgetsFlexGrow(_: number[]): this;\n flexBasis(): string;\n flexBasis(_: string): this;\n widgetsFlexBasis(): string[];\n widgetsFlexBasis(_: string[]): this;\n disableScroll(): boolean;\n disableScroll(_: boolean): this;\n forceXScroll(): boolean;\n forceXScroll(_: boolean): this;\n forceYScroll(): boolean;\n forceYScroll(_: boolean): this;\n}\n\nFlexGrid.prototype.publish(\"itemBorderColor\", \"transparent\", \"html-color\", \"Color of list item borders\");\nFlexGrid.prototype.publish(\"borderWidth\", 0, \"number\", \"Width of list item borders (pixels)\");\nFlexGrid.prototype.publish(\"orientation\", \"horizontal\", \"set\", \"Controls the flex-direction of the list items\", [\"horizontal\", \"vertical\"]);\nFlexGrid.prototype.publish(\"flexWrap\", \"wrap\", \"set\", \"Controls the line wrap when overflow occurs\", [\"nowrap\", \"wrap\", \"wrap-reverse\"]);\nFlexGrid.prototype.publish(\"disableScroll\", false, \"boolean\", \"If false, scrollbar will show (when flexWrap is set to 'nowrap')\", null, { disable: (w: any) => w.flexWrap() !== \"nowrap\" });\nFlexGrid.prototype.publish(\"forceXScroll\", false, \"boolean\", \"If true, horzontal scrollbar will show\");\nFlexGrid.prototype.publish(\"forceYScroll\", false, \"boolean\", \"If true, vertical scrollbar will show\");\nFlexGrid.prototype.publish(\"itemMinHeight\", 64, \"number\", \"Minimum height of a list item (pixels)\");\nFlexGrid.prototype.publish(\"itemMinWidth\", 64, \"number\", \"Minimum width of a list item (pixels)\");\nFlexGrid.prototype.publish(\"alignItems\", \"stretch\", \"set\", \"Controls normal alignment of items\", [\"flex-start\", \"center\", \"flex-end\", \"stretch\"]);\nFlexGrid.prototype.publish(\"alignContent\", \"stretch\", \"set\", \"Controls normal alignment of item rows\", [\"flex-start\", \"center\", \"flex-end\", \"stretch\", \"space-between\", \"space-around\"]);\nFlexGrid.prototype.publish(\"flexGrow\", 1, \"number\", \"Default flex-grow style for all list items\");\nFlexGrid.prototype.publish(\"flexBasis\", \"10%\", \"string\", \"Default flex-basis style for all list items\");\nFlexGrid.prototype.publish(\"widgetsFlexGrow\", [], \"array\", \"Array of flex-grow values keyed on the widgets array\");\nFlexGrid.prototype.publish(\"widgetsFlexBasis\", [], \"array\", \"Array of flex-basis values keyed on the widgets array\");\nFlexGrid.prototype.publish(\"widgets\", [], \"widgetArray\", \"Array of widgets to be rendered as list items\");\n","(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define([], factory);\n } else if (typeof exports === 'object') {\n // Node. Does not work with strict CommonJS, but\n // only CommonJS-like environments that support module.exports,\n // like Node.\n module.exports = factory();\n } else {\n // Browser globals (root is window)\n root.GridList = factory();\n }\n}(this, function() {\n\nvar GridList = function(items, options) {\n /**\n * A GridList manages the two-dimensional positions from a list of items,\n * within a virtual matrix.\n *\n * The GridList's main function is to convert the item positions from one\n * grid size to another, maintaining as much of their order as possible.\n *\n * The GridList's second function is to handle collisions when moving an item\n * over another.\n *\n * The positioning algorithm places items in columns. Starting from left to\n * right, going through each column top to bottom.\n *\n * The size of an item is expressed using the number of cols and rows it\n * takes up within the grid (w and h)\n *\n * The position of an item is express using the col and row position within\n * the grid (x and y)\n *\n * An item is an object of structure:\n * {\n * w: 3, h: 1,\n * x: 0, y: 1\n * }\n */\n\n this._options = options;\n for (var k in this.defaults) {\n if (!this._options.hasOwnProperty(k)) {\n this._options[k] = this.defaults[k];\n }\n }\n\n this.items = items;\n\n this._adjustSizeOfItems();\n\n this.generateGrid();\n};\n\nGridList.cloneItems = function(items, _items) {\n /**\n * Clone items with a deep level of one. Items are not referenced but their\n * properties are\n */\n var _item,\n i,\n k;\n if (_items === undefined) {\n _items = [];\n }\n for (i = 0; i < items.length; i++) {\n // XXX: this is good because we don't want to lose item reference, but\n // maybe we should clear their properties since some might be optional\n if (!_items[i]) {\n _items[i] = {};\n }\n for (k in items[i]) {\n _items[i][k] = items[i][k];\n }\n }\n return _items;\n};\n\nGridList.prototype = {\n\n defaults: {\n lanes: 5,\n direction: 'horizontal'\n },\n\n /**\n * Illustates grid as text-based table, using a number identifier for each\n * item. E.g.\n *\n * #| 0 1 2 3 4 5 6 7 8 9 10 11 12 13\n * --------------------------------------------\n * 0| 00 02 03 04 04 06 08 08 08 12 12 13 14 16\n * 1| 01 -- 03 05 05 07 09 10 11 11 -- 13 15 --\n *\n * Warn: Does not work if items don't have a width or height specified\n * besides their position in the grid.\n */\n toString: function() {\n var widthOfGrid = this.grid.length,\n output = '\\n #|',\n border = '\\n --',\n item,\n i,\n j;\n\n // Render the table header\n for (i = 0; i < widthOfGrid; i++) {\n output += ' ' + this._padNumber(i, ' ');\n border += '---';\n };\n output += border;\n\n // Render table contents row by row, as we go on the y axis\n for (i = 0; i < this._options.lanes; i++) {\n output += '\\n' + this._padNumber(i, ' ') + '|';\n for (j = 0; j < widthOfGrid; j++) {\n output += ' ';\n item = this.grid[j][i];\n output += item ? this._padNumber(this.items.indexOf(item), '0') : '--';\n }\n };\n output += '\\n';\n return output;\n },\n\n generateGrid: function() {\n /**\n * Build the grid structure from scratch, with the current item positions\n */\n var i;\n this._resetGrid();\n for (i = 0; i < this.items.length; i++) {\n this._markItemPositionToGrid(this.items[i]);\n }\n },\n\n resizeGrid: function(lanes) {\n var currentColumn = 0;\n\n this._options.lanes = lanes;\n this._adjustSizeOfItems();\n\n this._sortItemsByPosition();\n this._resetGrid();\n\n // The items will be sorted based on their index within the this.items array,\n // that is their \"1d position\"\n for (var i = 0; i < this.items.length; i++) {\n var item = this.items[i],\n position = this._getItemPosition(item);\n\n this._updateItemPosition(\n item, this.findPositionForItem(item, {x: currentColumn, y: 0}));\n\n // New items should never be placed to the left of previous items\n currentColumn = Math.max(currentColumn, position.x);\n }\n\n this._pullItemsToLeft();\n },\n\n findPositionForItem: function(item, start, fixedRow) {\n /**\n * This method has two options for the position we want for the item:\n * - Starting from a certain row/column number and only looking for\n * positions to its right\n * - Accepting positions for a certain row number only (use-case: items\n * being shifted to the left/right as a result of collisions)\n *\n * @param {Object<x:Number, y:Number, w:Number, h:Number} item\n * @param {Object<x:Number, y:Number} start Position from which to start\n * the search.\n * @param {Number} [fixedRow] If provided, we're going to try to find a\n * position for the new item on it. If doesn't fit there, we're going\n * to put it on the first row.\n *\n * @returns {Number[2]} x and y.\n */\n\n var x, y, position;\n\n // Start searching for a position from the horizontal position of the\n // rightmost item from the grid\n for (x = start.x; x < this.grid.length; x++) {\n if (fixedRow !== undefined) {\n position = [x, fixedRow];\n\n if (this._itemFitsAtPosition(item, position)) {\n return position;\n }\n } else {\n for (y = start.y; y < this._options.lanes; y++) {\n position = [x, y];\n\n if (this._itemFitsAtPosition(item, position)) {\n return position;\n }\n }\n }\n }\n\n // If we've reached this point, we need to start a new column\n var newCol = this.grid.length,\n newRow = 0;\n\n if (fixedRow !== undefined &&\n this._itemFitsAtPosition(item, [newCol, fixedRow])) {\n newRow = fixedRow;\n }\n\n return [newCol, newRow];\n },\n\n moveItemToPosition: function(item, newPosition) {\n var position = this._getItemPosition({\n x: newPosition[0],\n y: newPosition[1],\n w: item.w,\n h: item.h\n });\n\n this._updateItemPosition(item, [position.x, position.y]);\n this._resolveCollisions(item);\n },\n\n resizeItem: function(item, size) {\n /**\n * Resize an item and resolve collisions.\n *\n * @param {Object} item A reference to an item that's part of the grid.\n * @param {Object} size\n * @param {Number} [size.w=item.w] The new width.\n * @param {Number} [size.h=item.h] The new height.\n */\n\n var width = size.w || item.w,\n height = size.h || item.h;\n\n this._updateItemSize(item, width, height);\n\n this._resolveCollisions(item);\n\n this._pullItemsToLeft();\n },\n\n getChangedItems: function(initialItems, idAttribute) {\n /**\n * Compare the current items against a previous snapshot and return only\n * the ones that changed their attributes in the meantime. This includes both\n * position (x, y) and size (w, h)\n *\n * Since both their position and size can change, the items need an\n * additional identifier attribute to match them with their previous state\n */\n var changedItems = [];\n\n for (var i = 0; i < initialItems.length; i++) {\n var item = this._getItemByAttribute(idAttribute,\n initialItems[i][idAttribute]);\n\n if (item.x !== initialItems[i].x ||\n item.y !== initialItems[i].y ||\n item.w !== initialItems[i].w ||\n item.h !== initialItems[i].h) {\n changedItems.push(item);\n }\n }\n\n return changedItems;\n },\n\n _sortItemsByPosition: function() {\n this.items.sort(function(item1, item2) {\n var position1 = this._getItemPosition(item1),\n position2 = this._getItemPosition(item2);\n\n // Try to preserve columns.\n if (position1.x != position2.x) {\n return position1.x - position2.x;\n }\n\n if (position1.y != position2.y) {\n return position1.y - position2.y;\n }\n\n // The items are placed on the same position.\n return 0;\n }.bind(this));\n },\n\n _adjustSizeOfItems: function() {\n /**\n * Some items can have 100% height or 100% width. Those dimmensions are\n * expressed as 0. We need to ensure a valid width and height for each of\n * those items as the number of items per lane.\n */\n\n for (var i = 0; i < this.items.length; i++) {\n var item = this.items[i];\n\n // This can happen only the first time items are checked.\n // We need the property to have a value for all the items so that the\n // `cloneItems` method will merge the properties properly. If we only set\n // it to the items that need it then the following can happen:\n //\n // cloneItems([{id: 1, autoSize: true}, {id: 2}],\n // [{id: 2}, {id: 1, autoSize: true}]);\n //\n // will result in\n //\n // [{id: 1, autoSize: true}, {id: 2, autoSize: true}]\n if (item.autoSize === undefined) {\n item.autoSize = item.w === 0 || item.h === 0;\n }\n\n if (item.autoSize) {\n if (this._options.direction === 'horizontal') {\n item.h = this._options.lanes;\n } else {\n item.w = this._options.lanes;\n }\n }\n }\n },\n\n _resetGrid: function() {\n this.grid = [];\n },\n\n _itemFitsAtPosition: function(item, newPosition) {\n /**\n * Check that an item wouldn't overlap with another one if placed at a\n * certain position within the grid\n */\n\n var position = this._getItemPosition(item),\n x, y, row;\n\n // No coordonate can be negative\n if (newPosition[0] < 0 || newPosition[1] < 0) {\n return false;\n }\n\n // Make sure the item isn't larger than the entire grid\n if (newPosition[1] + position.h > this._options.lanes) {\n return false;\n }\n\n // Make sure the position doesn't overlap with an already positioned\n // item.\n for (x = newPosition[0]; x < newPosition[0] + position.w; x++) {\n var col = this.grid[x];\n\n // Surely a column that hasn't even been created yet is available\n if (!col) {\n continue;\n }\n\n for (y = newPosition[1]; y < newPosition[1] + position.h; y++) {\n // Any space occupied by an item can continue to be occupied by the\n // same item.\n if (col[y] && col[y] !== item) {\n return false;\n }\n }\n }\n\n return true;\n },\n\n _updateItemPosition: function(item, position) {\n if (item.x !== null && item.y !== null) {\n this._deleteItemPositionFromGrid(item);\n }\n\n this._setItemPosition(item, position);\n\n this._markItemPositionToGrid(item);\n },\n\n _updateItemSize: function(item, width, height) {\n /**\n * @param {Object} item A reference to a grid item.\n * @param {Number} width The new width.\n * @param {Number} height The new height.\n */\n\n if (item.x !== null && item.y !== null) {\n this._deleteItemPositionFromGrid(item);\n }\n\n item.w = width;\n item.h = height;\n\n this._markItemPositionToGrid(item);\n },\n\n _markItemPositionToGrid: function(item) {\n /**\n * Mark the grid cells that are occupied by an item. This prevents items\n * from overlapping in the grid\n */\n\n var position = this._getItemPosition(item),\n x, y;\n\n // Ensure that the grid has enough columns to accomodate the current item.\n this._ensureColumns(position.x + position.w);\n\n for (x = position.x; x < position.x + position.w; x++) {\n for (y = position.y; y < position.y + position.h; y++) {\n this.grid[x][y] = item;\n }\n }\n },\n\n _deleteItemPositionFromGrid: function(item) {\n var position = this._getItemPosition(item),\n x, y;\n\n for (x = position.x; x < position.x + position.w; x++) {\n // It can happen to try to remove an item from a position not generated\n // in the grid, probably when loading a persisted grid of items. No need\n // to create a column to be able to remove something from it, though\n if (!this.grid[x]) {\n continue;\n }\n\n for (y = position.y; y < position.y + position.h; y++) {\n // Don't clear the cell if it's been occupied by a different widget in\n // the meantime (e.g. when an item has been moved over this one, and\n // thus by continuing to clear this item's previous position you would\n // cancel the first item's move, leaving it without any position even)\n if (this.grid[x][y] == item) {\n this.grid[x][y] = null;\n }\n }\n }\n },\n\n _ensureColumns: function(N) {\n /**\n * Ensure that the grid has at least N columns available.\n */\n var i;\n for (i = 0; i < N; i++) {\n if (!this.grid[i]) {\n this.grid.push(new GridCol(this._options.lanes));\n }\n }\n },\n\n _getItemsCollidingWithItem: function(item) {\n var collidingItems = [];\n for (var i = 0; i < this.items.length; i++) {\n if (item != this.items[i] &&\n this._itemsAreColliding(item, this.items[i])) {\n collidingItems.push(i);\n }\n }\n return collidingItems;\n },\n\n _itemsAreColliding: function(item1, item2) {\n var position1 = this._getItemPosition(item1),\n position2 = this._getItemPosition(item2);\n\n return !(position2.x >= position1.x + position1.w ||\n position2.x + position2.w <= position1.x ||\n position2.y >= position1.y + position1.h ||\n position2.y + position2.h <= position1.y);\n },\n\n _resolveCollisions: function(item) {\n if (!this._tryToResolveCollisionsLocally(item)) {\n this._pullItemsToLeft(item);\n }\n this._pullItemsToLeft();\n },\n\n _tryToResolveCollisionsLocally: function(item) {\n /**\n * Attempt to resolve the collisions after moving a an item over one or more\n * other items within the grid, by shifting the position of the colliding\n * items around the moving one. This might result in subsequent collisions,\n * in which case we will revert all position permutations. To be able to\n * revert to the initial item positions, we create a virtual grid in the\n * process\n */\n var collidingItems = this._getItemsCollidingWithItem(item);\n if (!collidingItems.length) {\n return true;\n }\n var _gridList = new GridList([], this._options),\n leftOfItem,\n rightOfItem,\n aboveOfItem,\n belowOfItem;\n\n GridList.cloneItems(this.items, _gridList.items);\n _gridList.generateGrid();\n\n for (var i = 0; i < collidingItems.length; i++) {\n var collidingItem = _gridList.items[collidingItems[i]],\n collidingPosition = this._getItemPosition(collidingItem);\n\n // We use a simple algorithm for moving items around when collisions occur:\n // In this prioritized order, we try to move a colliding item around the\n // moving one:\n // 1. to its left side\n // 2. above it\n // 3. under it\n // 4. to its right side\n var position = this._getItemPosition(item);\n\n leftOfItem = [position.x - collidingPosition.w, collidingPosition.y];\n rightOfItem = [position.x + position.w, collidingPosition.y];\n aboveOfItem = [collidingPosition.x, position.y - collidingPosition.h];\n belowOfItem = [collidingPosition.x, position.y + position.h];\n\n if (_gridList._itemFitsAtPosition(collidingItem, leftOfItem)) {\n _gridList._updateItemPosition(collidingItem, leftOfItem);\n } else if (_gridList._itemFitsAtPosition(collidingItem, aboveOfItem)) {\n _gridList._updateItemPosition(collidingItem, aboveOfItem);\n } else if (_gridList._itemFitsAtPosition(collidingItem, belowOfItem)) {\n _gridList._updateItemPosition(collidingItem, belowOfItem);\n } else if (_gridList._itemFitsAtPosition(collidingItem, rightOfItem)) {\n _gridList._updateItemPosition(collidingItem, rightOfItem);\n } else {\n // Collisions failed, we must use the pullItemsToLeft method to arrange\n // the other items around this item with fixed position. This is our\n // plan B for when local collision resolving fails.\n return false;\n }\n }\n // If we reached this point it means we managed to resolve the collisions\n // from one single iteration, just by moving the colliding items around. So\n // we accept this scenario and marge the brached-out grid instance into the\n // original one\n GridList.cloneItems(_gridList.items, this.items);\n this.generateGrid();\n return true;\n },\n\n _pullItemsToLeft: function(fixedItem) {\n /**\n * Build the grid from scratch, by using the current item positions and\n * pulling them as much to the left as possible, removing as space between\n * them as possible.\n *\n * If a \"fixed item\" is provided, its position will be kept intact and the\n * rest of the items will be layed around it.\n */\n\n\n // Start a fresh grid with the fixed item already placed inside\n this._sortItemsByPosition();\n this._resetGrid();\n\n // Start the grid with the fixed item as the first positioned item\n if (fixedItem) {\n var fixedPosition = this._getItemPosition(fixedItem);\n this._updateItemPosition(fixedItem, [fixedPosition.x, fixedPosition.y]);\n }\n\n for (var i = 0; i < this.items.length; i++) {\n var item = this.items[i],\n position = this._getItemPosition(item);\n\n // The fixed item keeps its exact position\n if (fixedItem && item == fixedItem) {\n continue;\n }\n\n var x = this._findLeftMostPositionForItem(item),\n newPosition = this.findPositionForItem(\n item, {x: x, y: 0}, position.y);\n\n this._updateItemPosition(item, newPosition);\n }\n },\n\n _findLeftMostPositionForItem: function(item) {\n /**\n * When pulling items to the left, we need to find the leftmost position for\n * an item, with two considerations in mind:\n * - preserving its current row\n * - preserving the previous horizontal order between items\n */\n\n var tail = 0,\n position = this._getItemPosition(item);\n\n for (var i = 0; i < this.grid.length; i++) {\n for (var j = position.y; j < position.y + position.h; j++) {\n var otherItem = this.grid[i][j];\n\n if (!otherItem) {\n continue;\n }\n\n var otherPosition = this._getItemPosition(otherItem);\n\n if (this.items.indexOf(otherItem) < this.items.indexOf(item)) {\n tail = otherPosition.x + otherPosition.w;\n }\n }\n }\n\n return tail;\n },\n\n _getItemByAttribute: function(key, value) {\n for (var i = 0; i < this.items.length; i++) {\n if (this.items[i][key] === value) {\n return this.items[i];\n }\n }\n return null;\n },\n\n _padNumber: function(nr, prefix) {\n // Currently works for 2-digit numbers (<100)\n return nr >= 10 ? nr : prefix + nr;\n },\n\n _getItemPosition: function(item) {\n /**\n * If the direction is vertical we need to rotate the grid 90 deg to the\n * left. Thus, we simulate the fact that items are being pulled to the top.\n *\n * Since the items have widths and heights, if we apply the classic\n * counter-clockwise 90 deg rotation\n *\n * [0 -1]\n * [1 0]\n *\n * then the top left point of an item will become the bottom left point of\n * the rotated item. To adjust for this, we need to subtract from the y\n * position the height of the original item - the width of the rotated item.\n *\n * However, if we do this then we'll reverse some actions: resizing the\n * width of an item will stretch the item to the left instead of to the\n * right; resizing an item that doesn't fit into the grid will push the\n * items around it instead of going on a new row, etc.\n *\n * We found it better to do a vertical flip of the grid after rotating it.\n * This restores the direction of the actions and greatly simplifies the\n * transformations.\n */\n\n if (this._options.direction === 'horizontal') {\n return item;\n } else {\n return {\n x: item.y,\n y: item.x,\n w: item.h,\n h: item.w\n };\n }\n },\n\n _setItemPosition: function(item, position) {\n /**\n * See _getItemPosition.\n */\n\n if (this._options.direction === 'horizontal') {\n item.x = position[0];\n item.y = position[1];\n } else {\n // We're supposed to subtract the rotated item's height which is actually\n // the non-rotated item's width.\n item.x = position[1];\n item.y = position[0];\n }\n }\n};\n\nvar GridCol = function(lanes) {\n for (var i = 0; i < lanes; i++) {\n this.push(null);\n }\n};\n\n// Extend the Array prototype\nGridCol.prototype = [];\n\n// This module will have direct access to the GridList class\nreturn GridList;\n\n}));\n","import { d3Event, drag as d3Drag, HTMLWidget, Platform, select as d3Select, Utility } from \"@hpcc-js/common\";\nimport * as _GridList from \"grid-list\";\nimport { Cell } from \"./Cell.ts\";\n\nimport \"../src/Grid.css\";\n\nconst GridList = (_GridList && _GridList.default) || _GridList;\n\nexport type ICellPosition = [number, number, number, number];\n\nexport class Grid extends HTMLWidget {\n divItems;\n\n gridList;\n items;\n itemsMap;\n origItems;\n cellWidth;\n cellHeight;\n dragItem;\n dragItemPos;\n\n _d3Drag;\n _d3DragResize;\n _selectionBag;\n _scrollBarWidth;\n\n constructor() {\n super();\n\n this._tag = \"div\";\n this._selectionBag = new Utility.Selection(this);\n\n this.content([]);\n }\n\n getDimensions() {\n const size = { width: 0, height: 0 };\n this.content().forEach(function (cell) {\n if (size.width < cell.gridCol() + cell.gridColSpan()) {\n size.width = cell.gridCol() + cell.gridColSpan();\n }\n if (size.height < cell.gridRow() + cell.gridRowSpan()) {\n size.height = cell.gridRow() + cell.gridRowSpan();\n }\n }, this);\n return size;\n }\n\n clearContent(widget) {\n this.content(this.content().filter(function (contentWidget) {\n if (!widget) {\n contentWidget.target(null);\n return false;\n }\n let w: any = contentWidget;\n while (w) {\n if (widget === w) {\n contentWidget.target(null);\n return false;\n }\n w = w.widget ? w.widget() : null;\n }\n return true;\n }));\n }\n\n setContent(row, col, widget, title?, rowSpan?, colSpan?) {\n rowSpan = rowSpan || 1;\n colSpan = colSpan || 1;\n title = title || \"\";\n this.content(this.content().filter(function (contentWidget) {\n if (contentWidget.gridRow() === row && contentWidget.gridCol() === col) {\n contentWidget.target(null);\n return false;\n }\n return true;\n }));\n if (widget) {\n const cell = new Cell()\n .gridRow(row)\n .gridCol(col)\n .widget(widget)\n .title(title)\n .gridRowSpan(rowSpan)\n .gridColSpan(colSpan)\n ;\n this.content().push(cell);\n }\n return this;\n }\n\n sortedContent() {\n return this.content().sort(function (l, r) {\n if (l.gridRow() === r.gridRow()) {\n return l.gridCol() - r.gridCol();\n }\n return l.gridRow() - r.gridRow();\n });\n }\n\n getCell(row, col) {\n let retVal = null;\n this.content().some(function (cell) {\n if (row >= cell.gridRow() && row < cell.gridRow() + cell.gridRowSpan() &&\n col >= cell.gridCol() && col < cell.gridCol() + cell.gridColSpan()) {\n retVal = cell;\n return true;\n }\n return false;\n });\n return retVal;\n }\n\n getWidgetCell(id) {\n let retVal = null;\n this.content().some(function (cell) {\n if (cell.widget().id() === id) {\n retVal = cell;\n return true;\n }\n return false;\n });\n return retVal;\n }\n\n getContent(id) {\n let retVal = null;\n this.content().some(function (cell) {\n if (cell.widget().id() === id) {\n retVal = cell.widget();\n return true;\n }\n return false;\n });\n return retVal;\n }\n\n cellToGridItem(cell) {\n return {\n x: cell.gridCol(),\n y: cell.gridRow(),\n w: cell.gridColSpan(),\n h: cell.gridRowSpan(),\n id: cell.id(),\n cell\n };\n }\n\n gridItemToCell(item) {\n item.cell\n .gridCol(item.x)\n .gridRow(item.y)\n .gridColSpan(item.w)\n .gridRowSpan(item.h)\n ;\n }\n\n resetItemsPos() {\n this.origItems.forEach(function (origItem) {\n const item = this.itemsMap[origItem.id];\n item.x = origItem.x;\n item.y = origItem.y;\n }, this);\n }\n\n initGridList() {\n this.itemsMap = {};\n this.items = this.content().map(function (cell) {\n const retVal = this.cellToGridItem(cell);\n this.itemsMap[retVal.id] = retVal;\n return retVal;\n }, this);\n this.origItems = this.content().map(this.cellToGridItem);\n this.gridList = new GridList(this.items, {\n direction: this.snapping(),\n lanes: this.snapping() === \"horizontal\" ? this.snappingRows() : this.snappingColumns()\n });\n }\n\n killGridList() {\n this.gridList = null;\n delete this.items;\n delete this.itemsMap;\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n\n this._scrollBarWidth = Platform.getScrollbarWidth();\n\n const context = this;\n this._d3Drag = d3Drag()\n .subject(function (_d) {\n const d = context.cellToGridItem(_d);\n return { x: d.x * context.cellWidth, y: d.y * context.cellHeight };\n })\n .on(\"start\", function (_d: any) {\n if (!context.designMode()) return;\n d3Event().sourceEvent.stopPropagation();\n context.initGridList();\n const d = context.itemsMap[_d.id()];\n context.dragItem = element.append(\"div\")\n .attr(\"class\", \"dragging\")\n .style(\"transform\", function () { return \"translate(\" + d.x * context.cellWidth + \"px, \" + d.y * context.cellHeight + \"px)\"; })\n .style(\"width\", function () { return d.w * context.cellWidth - context.gutter() + \"px\"; })\n .style(\"height\", function () { return d.h * context.cellHeight - context.gutter() + \"px\"; })\n ;\n context.selectionBagClick(_d);\n })\n .on(\"drag\", function (_d: any) {\n if (!context.designMode()) return;\n const event = d3Event();\n event.sourceEvent.stopPropagation();\n const d = context.itemsMap[_d.id()];\n if (event.x < 0) {\n event.x = 0;\n }\n if (event.x + d.w * context.cellWidth > context.snappingColumns() * context.cellWidth) {\n event.x = context.snappingColumns() * context.cellWidth - d.w * context.cellWidth;\n }\n if (event.y < 0) {\n event.y = 0;\n }\n if (event.y + d.h * context.cellWidth > context.snappingRows() * context.cellWidth) {\n event.y = context.snappingRows() * context.cellWidth - d.h * context.cellWidth;\n }\n const pos = [Math.max(0, Math.floor((event.x + context.cellWidth / 2) / context.cellWidth)), Math.max(0, Math.floor((event.y + context.cellHeight / 2) / context.cellHeight))];\n if (d.x !== pos[0] || d.y !== pos[1]) {\n if (context.snapping() !== \"none\") {\n context.resetItemsPos();\n context.gridList.moveItemToPosition(d, pos);\n } else {\n d.x = pos[0];\n d.y = pos[1];\n }\n if (_d.gridCol() !== d.x || _d.gridRow() !== d.y) {\n context.items.forEach(context.gridItemToCell);\n context.updateGrid(false, 100);\n }\n }\n context.dragItem\n .style(\"transform\", function () { return \"translate(\" + event.x + \"px, \" + event.y + \"px)\"; })\n .style(\"width\", function () { return d.w * context.cellWidth + \"px\"; })\n .style(\"height\", function () { return d.h * context.cellHeight + \"px\"; })\n ;\n })\n .on(\"end\", function () {\n if (!context.designMode()) return;\n d3Event().sourceEvent.stopPropagation();\n context.dragItem.remove();\n context.dragItem = null;\n context.killGridList();\n })\n ;\n\n this._d3DragResize = d3Drag()\n .subject(function (_d) {\n const d = context.cellToGridItem(_d);\n return { x: (d.x + d.w - 1) * context.cellWidth, y: (d.y + d.h - 1) * context.cellHeight };\n })\n .on(\"start\", function (_d: any) {\n if (!context.designMode()) return;\n d3Event().sourceEvent.stopPropagation();\n context.initGridList();\n const d = context.itemsMap[_d.id()];\n context.dragItem = element.append(\"div\")\n .attr(\"class\", \"resizing\")\n .style(\"transform\", function () { return \"translate(\" + d.x * context.cellWidth + \"px, \" + d.y * context.cellHeight + \"px)\"; })\n .style(\"width\", function () { return d.w * context.cellWidth - context.gutter() + \"px\"; })\n .style(\"height\", function () { return d.h * context.cellHeight - context.gutter() + \"px\"; })\n ;\n context.dragItemPos = { x: d.x, y: d.y };\n })\n .on(\"drag\", function (_d: any) {\n if (!context.designMode()) return;\n const event = d3Event();\n event.sourceEvent.stopPropagation();\n const d = context.itemsMap[_d.id()];\n const pos = [Math.max(0, Math.round(event.x / context.cellWidth)), Math.max(0, Math.round(event.y / context.cellHeight))];\n const size = {\n w: Math.max(1, pos[0] - d.x + 1),\n h: Math.max(1, pos[1] - d.y + 1)\n };\n if (d.w !== size.w || d.h !== size.h) {\n if (context.snapping() !== \"none\") {\n context.resetItemsPos();\n context.gridList.resizeItem(d, size);\n } else {\n d.w = size.w;\n d.h = size.h;\n }\n if (_d.gridColSpan() !== d.w || _d.gridRowSpan() !== d.h) {\n context.items.forEach(context.gridItemToCell);\n context.updateGrid(d.id, 100);\n }\n }\n context.dragItem\n .style(\"width\", function () { return (-d.x + 1) * context.cellWidth + event.x - context.gutter() + \"px\"; })\n .style(\"height\", function () { return (-d.y + 1) * context.cellHeight + event.y - context.gutter() + \"px\"; })\n ;\n })\n .on(\"end\", function () {\n if (!context.designMode()) return;\n d3Event().sourceEvent.stopPropagation();\n context.dragItem.remove();\n context.dragItem = null;\n context.killGridList();\n })\n ;\n }\n\n updateGrid(resize, transitionDuration: number = 0, _noRender: boolean = false) {\n transitionDuration = transitionDuration || 0;\n const context = this;\n this.divItems\n .classed(\"draggable\", this.designMode())\n .transition().duration(transitionDuration)\n .style(\"left\", function (d) { return d.gridCol() * context.cellWidth + context.gutter() / 2 + \"px\"; })\n .style(\"top\", function (d) { return d.gridRow() * context.cellHeight + context.gutter() / 2 + \"px\"; })\n .style(\"width\", function (d) { return d.gridColSpan() * context.cellWidth - context.gutter() + \"px\"; })\n .style(\"height\", function (d) { return d.gridRowSpan() * context.cellHeight - context.gutter() + \"px\"; })\n .on(\"end\", function (d) {\n d\n .surfaceShadow_default(context.surfaceShadow())\n .surfacePadding_default(context.surfacePadding())\n .surfaceBorderWidth_default(context.surfaceBorderWidth())\n .surfaceBackgroundColor_default(context.surfaceBackgroundColor())\n ;\n\n if (resize === true || resize === d.id()) {\n d\n .resize()\n .lazyRender()\n ;\n }\n })\n ;\n }\n\n update(domNode, element2) {\n super.update(domNode, element2);\n\n this._placeholderElement.style(\"overflow-x\", this.fitTo() === \"width\" ? \"hidden\" : null);\n this._placeholderElement.style(\"overflow-y\", this.fitTo() === \"width\" ? \"scroll\" : null);\n const dimensions = this.getDimensions();\n const clientWidth = this.width() - (this.fitTo() === \"width\" ? this._scrollBarWidth : 0);\n this.cellWidth = clientWidth / dimensions.width;\n this.cellHeight = this.fitTo() === \"all\" ? this.height() / dimensions.height : this.cellWidth;\n if (this.designMode()) {\n const cellLaneRatio = Math.min(this.width() / this.snappingColumns(), this.height() / this.snappingRows());\n const laneWidth = Math.floor(cellLaneRatio);\n this.cellWidth = laneWidth;\n this.cellHeight = this.cellWidth;\n }\n\n // Grid ---\n const context = this;\n const divItems = element2.selectAll(\"#\" + this.id() + \" > .ddCell\").data(this.content(), function (d) { return d.id(); });\n this.divItems = divItems.enter().append(\"div\")\n .attr(\"class\", \"ddCell\")\n .each(function (d) {\n d.target(this);\n d.__grid_watch = d.monitor(function (key, newVal, oldVal) {\n if (context._renderCount && (key === \"snapping\" || key.indexOf(\"grid\") === 0) && newVal !== oldVal) {\n if (!context.gridList) {\n // API Call (only needed when not dragging) ---\n context.initGridList();\n if (context.snapping() !== \"none\") {\n context.gridList.resizeGrid(context.snapping() === \"horizontal\" ? context.snappingRows() : context.snappingColumns());\n }\n context.items.forEach(context.gridItemToCell);\n context.updateGrid(d.id(), 100);\n context.killGridList();\n }\n }\n });\n const element = d3Select(this);\n element.append(\"div\")\n .attr(\"class\", \"resizeHandle\")\n .call(context._d3DragResize)\n .append(\"div\")\n .attr(\"class\", \"resizeHandleDisplay\")\n ;\n }).merge(divItems)\n ;\n this.divItems.each(function (d) {\n const element = d3Select(this);\n if (context.designMode()) {\n element.call(context._d3Drag);\n } else {\n element\n .on(\"mousedown.drag\", null)\n .on(\"touchstart.drag\", null)\n ;\n }\n });\n this.divItems.select(\".resizeHandle\")\n .style(\"display\", this.designMode() ? null : \"none\")\n ;\n\n this.updateGrid(true);\n divItems.exit()\n .each(function (d) {\n d.target(null);\n if (d.__grid_watch) {\n d.__grid_watch.remove();\n }\n })\n .remove()\n ;\n\n // Snapping ---\n const lanesBackground = element2.selectAll(\"#\" + this.id() + \" > .laneBackground\").data(this.designMode() ? [\"\"] : []);\n lanesBackground.enter().insert(\"div\", \":first-child\")\n .attr(\"class\", \"laneBackground\")\n .style(\"left\", \"1px\")\n .style(\"top\", \"1px\")\n .on(\"click\", function () {\n context.selectionBagClear();\n })\n .merge(lanesBackground)\n .style(\"width\", (this.snappingColumns() * this.cellWidth) + \"px\")\n .style(\"height\", (this.snappingRows() * this.cellHeight) + \"px\")\n ;\n lanesBackground.exit()\n .each(function () {\n context.selectionBagClear();\n })\n .remove()\n ;\n\n const lanes = element2.selectAll(\"#\" + this.id() + \" > .lane\").data(this.designMode() ? [\"\"] : []);\n lanes.enter().append(\"div\")\n .attr(\"class\", \"lane\")\n .style(\"left\", \"1px\")\n .style(\"top\", \"1px\")\n ;\n lanes\n .style(\"display\", this.showLanes() ? null : \"none\")\n .style(\"width\", (this.snappingColumns() * this.cellWidth) + \"px\")\n .style(\"height\", (this.snappingRows() * this.cellHeight) + \"px\")\n .style(\"background-image\", \"linear-gradient(to right, grey 1px, transparent 1px), linear-gradient(to bottom, grey 1px, transparent 1px)\")\n .style(\"background-size\", this.cellWidth + \"px \" + this.cellHeight + \"px\")\n ;\n lanes.exit()\n .remove()\n ;\n }\n\n exit(domNode, element) {\n this.content().forEach(w => w.target(null));\n super.exit(domNode, element);\n }\n\n _createSelectionObject(d) {\n return {\n _id: d._id,\n element: () => {\n return d._element;\n },\n widget: d\n };\n }\n\n selection(_) {\n if (!arguments.length) return this._selectionBag.get().map(function (d) { return d._id; });\n this._selectionBag.set(_.map(function (row) {\n return this._createSelectionObject(row);\n }, this));\n return this;\n }\n\n selectionBagClear() {\n if (!this._selectionBag.isEmpty()) {\n this._selectionBag.clear();\n this.postSelectionChange();\n }\n }\n\n selectionBagClick(d) {\n if (d !== null) {\n const selectionObj = this._createSelectionObject(d);\n if (d3Event().sourceEvent.ctrlKey) {\n if (this._selectionBag.isSelected(selectionObj)) {\n this._selectionBag.remove(selectionObj);\n this.postSelectionChange();\n } else {\n this._selectionBag.append(selectionObj);\n this.postSelectionChange();\n }\n } else {\n const selected = this._selectionBag.get();\n if (selected.length === 1 && selected[0]._id === selectionObj._id) {\n this.selectionBagClear();\n } else {\n this._selectionBag.set([selectionObj]);\n }\n this.postSelectionChange();\n }\n }\n }\n\n postSelectionChange() {\n }\n\n applyLayout(layoutArr: ICellPosition[]) {\n this.divItems.each((d, i) => {\n if (layoutArr[i]) {\n const [x, y, w, h] = layoutArr[i];\n d\n .gridCol(x)\n .gridRow(y)\n .gridColSpan(w)\n .gridRowSpan(h)\n ;\n }\n });\n this.updateGrid(true);\n }\n\n vizActivation(elem) {\n }\n}\nGrid.prototype._class += \" layout_Grid\";\n\nexport interface Grid {\n designMode(): boolean;\n designMode(_: boolean): this;\n showLanes(): boolean;\n showLanes(_: boolean): this;\n fitTo(): string;\n fitTo(_: string): this;\n\n snapping(): string;\n snapping(_: string): this;\n snappingColumns(): number;\n snappingColumns(_: number): this;\n snappingRows(): number;\n snappingRows(_: number): this;\n snappingColumns_default(): number;\n snappingColumns_default(_: number): this;\n snappingRows_default(): number;\n snappingRows_default(_: number): this;\n\n gutter(): number;\n gutter(_: number): this;\n\n surfaceShadow(): boolean;\n surfaceShadow(_: boolean): this;\n surfacePadding(): string;\n surfacePadding(_: string): this;\n surfaceBorderWidth(): number;\n surfaceBorderWidth(_: number): this;\n surfaceBackgroundColor(): string;\n surfaceBackgroundColor(_: string): this;\n\n content(): Cell[];\n content(_: Cell[]): this;\n}\n\nGrid.prototype.publish(\"designMode\", false, \"boolean\", \"Design Mode\", null, { tags: [\"Basic\"] });\nGrid.prototype.publish(\"showLanes\", true, \"boolean\", \"Show snapping lanes when in design mode\", null, { tags: [\"Basic\"], disable: w => !w.designMode() });\nGrid.prototype.publish(\"fitTo\", \"all\", \"set\", \"Sizing Strategy\", [\"all\", \"width\"], { tags: [\"Basic\"] });\nGrid.prototype.publish(\"snapping\", \"vertical\", \"set\", \"Snapping Strategy\", [\"vertical\", \"horizontal\", \"none\"]);\nGrid.prototype.publish(\"snappingColumns\", 12, \"number\", \"Snapping Columns\");\nGrid.prototype.publish(\"snappingRows\", 16, \"number\", \"Snapping Rows\");\n\nGrid.prototype.publish(\"gutter\", 6, \"number\", \"Gap Between Widgets\", null, { tags: [\"Basic\"] });\n\nGrid.prototype.publish(\"surfaceShadow\", true, \"boolean\", \"3D Shadow\");\nGrid.prototype.publish(\"surfacePadding\", null, \"string\", \"Cell Padding (px)\", null, { tags: [\"Intermediate\"] });\nGrid.prototype.publish(\"surfaceBorderWidth\", 1, \"number\", \"Width (px) of Cell Border\", null, { tags: [\"Intermediate\"] });\nGrid.prototype.publish(\"surfaceBackgroundColor\", null, \"html-color\", \"Surface Background Color\", null, { tags: [\"Advanced\"] });\n\nGrid.prototype.publish(\"content\", [], \"widgetArray\", \"widgets\", null, { tags: [\"Basic\"], render: false });\n","import { FlexGrid } from \"./FlexGrid.ts\";\n\nexport class HorizontalList extends FlexGrid {\n constructor() {\n super();\n this.orientation_default(\"horizontal\");\n this.flexWrap_default(\"nowrap\");\n }\n}\nHorizontalList.prototype._class += \" layout_HorizontalList\";\n\nexport interface HorizontalList {\n orientation_default(_: \"horizontal\" | \"vertical\");\n flexWrap_default(_: \"nowrap\" | \"wrap\" | \"wrap-reverse\");\n}\n","import { HTMLWidget, Text } from \"@hpcc-js/common\";\n\nimport \"../src/Layered.css\";\n\nexport type LayerPlacement = \"default\" | \"top\" | \"right\" | \"bottom\" | \"left\" | \"center\";\n\nexport class Layered extends HTMLWidget {\n protected _contentContainer;\n _widgetPlacements;\n _widgetRatios;\n constructor() {\n super();\n\n this._tag = \"div\";\n this._widgetPlacements = [];\n this._widgetRatios = [];\n }\n\n addLayer(widget, placement: LayerPlacement = \"default\", widthRatio: number = 1, heightRatio: number = 1) {\n const widgets = this.widgets();\n widgets.push(widget ? widget : new Text().text(\"No widget defined for layer.\"));\n this.widgets(widgets);\n this._widgetPlacements.push(placement);\n this._widgetRatios.push([widthRatio, heightRatio]);\n return this;\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this._contentContainer = element.append(\"div\")\n .attr(\"class\", \"container\")\n ;\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n const context = this;\n\n element.style(\"padding\", this.surfacePadding() + \"px\");\n\n const content = this._contentContainer.selectAll(\".content.id\" + this.id()).data(this.widgets(), function (d) { return d.id(); });\n content.enter().append(\"div\")\n .attr(\"class\", \"content id\" + this.id())\n .each(function (widget, idx) {\n widget.target(this);\n })\n .merge(content)\n .each(function (widget, idx) {\n const clientSize = {\n width: context.clientWidth(),\n height: context.clientHeight()\n };\n const widgetSize = context.widgetSize(idx, clientSize);\n const widgetPosition = context.widgetPosition(idx, clientSize, widgetSize);\n this.style.top = widgetPosition.y + \"px\";\n this.style.left = widgetPosition.x + \"px\";\n widget\n .resize(widgetSize)\n .render()\n ;\n })\n ;\n content.exit()\n .each(function (widget, idx) {\n widget\n .target(null)\n ;\n })\n .remove()\n ;\n content.order();\n }\n\n widgetSize(idx, clientSize) {\n if (this._widgetPlacements[idx] === \"default\") {\n return {\n width: clientSize.width * this._widgetRatios[idx][0],\n height: clientSize.height * this._widgetRatios[idx][1]\n };\n } else {\n return {\n width: clientSize.width * this._widgetRatios[idx][0],\n height: clientSize.height * this._widgetRatios[idx][1]\n };\n }\n }\n widgetPosition(idx, clientSize, widgetSize) {\n switch (this._widgetPlacements[idx]) {\n default:\n return {\n x: 0,\n y: 0\n };\n case \"top\":\n return {\n x: (clientSize.width / 2) - (widgetSize.width / 2),\n y: 0\n };\n case \"bottom\":\n return {\n x: (clientSize.width / 2) - (widgetSize.width / 2),\n y: clientSize.height - widgetSize.height\n };\n case \"left\":\n return {\n x: 0,\n y: (clientSize.height / 2) - (widgetSize.height / 2)\n };\n case \"right\":\n return {\n x: clientSize.width - widgetSize.width,\n y: (clientSize.height / 2) - (widgetSize.height / 2)\n };\n case \"center\":\n return {\n x: (clientSize.width / 2) - (widgetSize.width / 2),\n y: (clientSize.height / 2) - (widgetSize.height / 2)\n };\n }\n }\n}\nLayered.prototype._class += \" layout_Layered\";\n\nexport interface Layered {\n surfacePadding(): number;\n surfacePadding(_: number): this;\n widgets(): any;\n widgets(_: any): this;\n}\n\nLayered.prototype.publish(\"surfacePadding\", 0, \"number\", \"Padding\");\nLayered.prototype.publish(\"widgets\", [], \"widgetArray\", \"widgets\", null, { tags: [\"Private\"] });\n","import { HTMLWidget, Widget } from \"@hpcc-js/common\";\n\nexport class Popup extends HTMLWidget {\n _surfaceButtons;\n _originalPosition;\n\n constructor() {\n super();\n this._tag = \"div\";\n this._surfaceButtons = [];\n }\n\n updateState(visible) {\n visible = visible || !this.popupState();\n this.popupState(visible).render();\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this.widget()\n .target(domNode)\n ;\n this._originalPosition = this.position();\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n element\n .style(\"visibility\", this.popupState() ? null : \"hidden\")\n .style(\"opacity\", this.popupState() ? null : 0)\n .style(\"width\", this.shrinkWrap() ? this.widget().width() + \"px\" : this._size.width + \"px\")\n .style(\"height\", this.shrinkWrap() ? this.widget().height() + \"px\" : this._size.height + \"px\")\n ;\n if (this.widget().size().height === 0) {\n this.widget().resize(this.size());\n }\n }\n\n postUpdate(domNode, element) {\n let left;\n let top;\n switch (this.centerPopup()) {\n case \"container\":\n if (this._placeholderElement) {\n left = parseInt(this._placeholderElement.style(\"width\")) / 2 - this.widget().width() / 2;\n top = parseInt(this._placeholderElement.style(\"height\")) / 2 - this.widget().height() / 2;\n }\n this.position(\"absolute\");\n break;\n\n case \"window\":\n left = window.innerWidth / 2 - this.widget().width() / 2;\n top = window.innerHeight / 2 - this.widget().height() / 2;\n this.position(\"fixed\");\n break;\n\n default:\n left = 0;\n top = 0;\n this.position(this._originalPosition);\n break;\n }\n\n this.pos({ x: left, y: top });\n\n super.postUpdate(domNode, element);\n\n element\n .style(\"position\", this.position())\n .style(\"left\", this.left() + \"px\")\n .style(\"right\", this.right() + \"px\")\n .style(\"top\", this.top() + \"px\")\n .style(\"bottom\", this.bottom() + \"px\")\n ;\n }\n\n exit(domNode, element) {\n if (this.widget()) {\n this.widget().target(null);\n }\n super.exit(domNode, element);\n }\n\n click(obj) {\n }\n}\nPopup.prototype._class += \" layout_Popup\";\n\nexport interface Popup {\n popupState(): boolean;\n popupState(_: boolean): this;\n shrinkWrap(): boolean;\n shrinkWrap(_: boolean): this;\n centerPopup(): \"none\" | \"container\" | \"window\";\n centerPopup(_: \"none\" | \"container\" | \"window\"): this;\n top(): number;\n top(_: number): this;\n bottom(): number;\n bottom(_: number): this;\n left(): number;\n left(_: number): this;\n right(): number;\n right(_: number): this;\n position(): string;\n position(_: string): this;\n\n widget(): Widget;\n widget(_: Widget): this;\n}\n\nPopup.prototype.publish(\"popupState\", false, \"boolean\", \"State of the popup, visible (true) or hidden (false)\", null, {});\nPopup.prototype.publish(\"shrinkWrap\", false, \"boolean\", \"The popup parent container either shrinks to the size of its contents (true) or expands to fit thge popup's parentDiv (false)\", null, {});\nPopup.prototype.publish(\"centerPopup\", \"none\", \"set\", \"Center the widget in its container element (target) or in the window\", [\"none\", \"container\", \"window\"], {});\nPopup.prototype.publish(\"top\", null, \"number\", \"Top position property of popup\", null, {});\nPopup.prototype.publish(\"bottom\", null, \"number\", \"Bottom position property of popup\", null, {});\nPopup.prototype.publish(\"left\", null, \"number\", \"Left position property of popup\", null, {});\nPopup.prototype.publish(\"right\", null, \"number\", \"Right position property of popup\", null, {});\nPopup.prototype.publish(\"position\", \"relative\", \"set\", \"Value of the 'position' property\", [\"absolute\", \"relative\", \"fixed\", \"static\", \"initial\", \"inherit\"], { tags: [\"Private\"] });\n\nPopup.prototype.publish(\"widget\", null, \"widget\", \"Widget\", null, { tags: [\"Private\"] });\n","import { HTMLWidget, Text, Widget } from \"@hpcc-js/common\";\nimport { select as d3Select } from \"d3-selection\";\nimport { Surface } from \"./Surface.ts\";\n\nimport \"../src/Tabbed.css\";\n\nexport class Tabbed extends HTMLWidget {\n _tabContainer;\n _contentContainer;\n\n constructor() {\n super();\n\n this._tag = \"div\";\n }\n\n clearTabs() {\n this.labels([]);\n this.widgets([]);\n return this;\n }\n\n addTab(widget, label, isActive?, callback?) {\n const widgetSize = widget.size();\n if (widgetSize.width === 0 && widgetSize.height === 0) {\n widget.size({ width: \"100%\", height: \"100%\" });\n }\n const labels = this.labels();\n const widgets = this.widgets();\n if (isActive) {\n this.activeTabIdx(this.widgets().length);\n }\n labels.push(label);\n const surface = new Surface().widget(widget ? widget : new Text().text(\"No widget defined for tab\"));\n widgets.push(surface);\n this.labels(labels);\n this.widgets(widgets);\n if (callback) {\n callback(surface);\n }\n return this;\n }\n\n widgetSize(widgetDiv) {\n const width = this.clientWidth();\n let height = this.clientHeight();\n\n const tcBox = this._tabContainer.node().getBoundingClientRect();\n if (typeof (tcBox.height) !== \"undefined\") {\n height -= tcBox.height;\n }\n return { width, height };\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this._tabContainer = element.append(\"div\");\n this._contentContainer = element.append(\"div\");\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n const context = this;\n\n element.style(\"padding\", this.surfacePadding_exists() ? this.surfacePadding() + \"px\" : null);\n\n const tabs = this._tabContainer.selectAll(\".tab-button.id\" + this.id()).data(this.showTabs() ? this.labels() : [], function (d) { return d; });\n tabs.enter().append(\"span\")\n .attr(\"class\", \"tab-button id\" + this.id())\n .style(\"cursor\", \"pointer\")\n .on(\"click\", function (d, idx) {\n context.click(context.widgets()[idx].widget(), d, idx);\n context\n .activeTabIdx(idx)\n .render()\n ;\n }).merge(tabs)\n .classed(\"active\", function (d, idx) { return context.activeTabIdx() === idx; })\n .text(function (d) { return d; })\n ;\n tabs.exit().remove();\n\n const content = this._contentContainer.selectAll(\".tab-content.id\" + this.id()).data(this.widgets(), function (d) { return d.id(); });\n content.enter().append(\"div\")\n .attr(\"class\", \"tab-content id\" + this.id())\n .each(function (widget, idx) {\n widget.target(this);\n }).merge(content)\n .classed(\"active\", function (d, idx) { return context.activeTabIdx() === idx; })\n .style(\"display\", function (d, idx) { return context.activeTabIdx() === idx ? \"block\" : \"none\"; })\n .each(function (surface, idx) {\n surface.visible(context.activeTabIdx() === idx);\n if (context.activeTabIdx() === idx) {\n const wSize = context.widgetSize(d3Select(this));\n surface\n .surfaceBorderWidth(context.showTabs() ? null : 0)\n .surfacePadding(context.showTabs() ? null : 0)\n .resize(wSize)\n ;\n }\n })\n ;\n content.exit()\n .each(function (widget, idx) {\n widget\n .target(null)\n ;\n })\n .remove();\n\n switch (this.tabLocation()) {\n case \"bottom\":\n this._tabContainer\n .attr(\"class\", \"on_bottom\")\n .style(\"top\", (this._contentContainer.node().offsetHeight + this.surfacePadding()) + \"px\")\n .style(\"position\", \"absolute\")\n ;\n this._contentContainer\n .style(\"top\", this.surfacePadding_exists() ? this.surfacePadding() + \"px\" : null)\n .style(\"position\", \"absolute\")\n ;\n break;\n default:\n this._tabContainer\n .attr(\"class\", \"on_top\")\n .style(\"top\", null)\n .style(\"position\", \"relative\")\n ;\n this._contentContainer\n .style(\"top\", (this._tabContainer.node().offsetHeight + this.surfacePadding()) + \"px\")\n .style(\"position\", \"absolute\")\n ;\n break;\n }\n }\n\n click(widget, column, idx) {\n }\n}\nTabbed.prototype._class += \" layout_Tabbed\";\n\nexport interface Tabbed {\n showTabs(): boolean;\n showTabs(_: boolean): this;\n surfacePadding(): number;\n surfacePadding(_: number): this;\n surfacePadding_exists(): boolean;\n activeTabIdx(): number;\n activeTabIdx(_: number): this;\n\n labels(): string[];\n labels(_: string[]): this;\n tabLocation(): \"top\" | \"bottom\";\n tabLocation(_: \"top\" | \"bottom\"): this;\n widgets(): any[];\n widgets(_: any[]): this;\n}\n\nTabbed.prototype.publish(\"showTabs\", true, \"boolean\", \"Show Tabs\", null, {});\nTabbed.prototype.publish(\"surfacePadding\", 4, \"number\", \"Padding\");\nTabbed.prototype.publish(\"activeTabIdx\", 0, \"number\", \"Index of active tab\", null, {});\n\nTabbed.prototype.publish(\"labels\", [], \"array\", \"Array of tab labels sharing an index with \", null, { tags: [\"Private\"] });\nTabbed.prototype.publish(\"tabLocation\", \"top\", \"set\", \"Position the tabs at the bottom of the widget\", [\"top\", \"bottom\"], { tags: [\"Private\"] });\nTabbed.prototype.publish(\"widgets\", [], \"widgetArray\", \"widgets\", null, { tags: [\"Private\"] });\n","import { HTMLWidget, Widget } from \"@hpcc-js/common\";\nimport { select as d3Select } from \"d3-selection\";\n\nimport \"../src/Toolbar.css\";\n\nexport class Toolbar extends HTMLWidget {\n\n constructor() {\n super();\n this._tag = \"div\";\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n const context = this;\n\n element\n .attr(\"title\", context.title())\n .style(\"background-color\", this.backgroundColor())\n ;\n\n const title = element.selectAll(\"div.toolbar-title\")\n .data(this.title() ? [this.title()] : []);\n title.enter().append(\"div\")\n .classed(\"toolbar-title\", true)\n .append(\"span\")\n ;\n title.selectAll(\"div.toolbar-title > span\")\n .style(\"font-size\", this.fontSize_exists() ? this.fontSize() + \"px\" : null)\n .style(\"color\", this.fontColor_exists() ? this.fontColor() : null)\n .style(\"font-family\", this.fontFamily_exists() ? this.fontFamily() : null)\n .style(\"font-weight\", this.fontBold_exists() ? (this.fontBold() ? \"bold\" : \"normal\") : null)\n .style(\"background-color\", this.backgroundColor_exists() ? this.backgroundColor() : null)\n .text(context.title())\n ;\n title.exit().remove();\n\n const childWidgets = element.selectAll(\"div.toolbar-child\")\n .data(this.widgets() !== null ? this.widgets() : [], function (d) { return d.id(); });\n\n childWidgets.enter().insert(\"div\", \"div.toolbar-title\")\n .each(function (d, i) {\n const widgetClass = context.widgetClasses()[i] ? context.widgetClasses()[i] + \" toolbar-child\" : \"toolbar-child\";\n d3Select(this).classed(widgetClass, true);\n d.target(this);\n });\n childWidgets.exit().each(function (d) {\n d.target(null);\n }).remove();\n childWidgets.order();\n }\n\n render(callback?: (w: Widget) => void): this {\n const context = this;\n return super.render(function (w) {\n const toolbarBBox = context.element().node().getBoundingClientRect();\n let minX = toolbarBBox.left + toolbarBBox.width;\n context.element().selectAll(\"div.toolbar-child\")\n .each(function (d, i) {\n const childBBox = this.getBoundingClientRect();\n if (minX > childBBox.left)\n minX = childBBox.left;\n })\n ;\n context.element().select(\".toolbar-title\")\n .style(\"width\", (minX - toolbarBBox.left - 4) + \"px\")\n ;\n if (callback) {\n callback(w);\n }\n });\n }\n\n exit(domNode, element) {\n this.widgets().forEach(function (w) {\n w.target(null);\n });\n super.exit(domNode, element);\n }\n}\nToolbar.prototype._class += \" layout_Toolbar\";\n\nexport interface Toolbar {\n title(): string;\n title(_: string): this;\n\n fontSize(): number;\n fontSize(_: number): this;\n fontSize_exists(): boolean;\n fontColor(): string;\n fontColor(_: string): this;\n fontColor_exists(): boolean;\n fontFamily(): string;\n fontFamily(_: string): this;\n fontFamily_exists(): boolean;\n fontBold(): boolean;\n fontBold(_: boolean): this;\n fontBold_exists(): boolean;\n backgroundColor(): string;\n backgroundColor(_: string): this;\n backgroundColor_exists(): boolean;\n\n responsive(): boolean;\n responsive(_: boolean): this;\n\n widgets(): any[];\n widgets(_: any[]): this;\n widgetClasses(): string[];\n widgetClasses(_: string[]): this;\n}\n\nToolbar.prototype.publish(\"title\", \"\", \"string\", \"Title\", null, { tags: [\"Intermediate\"] });\n\nToolbar.prototype.publish(\"fontSize\", null, \"number\", \"Title Font Size (px)\", null, { tags: [\"Advanced\"], optional: true });\nToolbar.prototype.publish(\"fontColor\", null, \"html-color\", \"Title Font Color\", null, { tags: [\"Advanced\"], optional: true });\nToolbar.prototype.publish(\"fontFamily\", null, \"string\", \"Title Font Family\", null, { tags: [\"Advanced\"], optional: true });\nToolbar.prototype.publish(\"fontBold\", true, \"boolean\", \"Enable Bold Title Font\", null, { tags: [\"Advanced\"], optional: true });\nToolbar.prototype.publish(\"backgroundColor\", null, \"html-color\", \"Background Color\", null, { tags: [\"Intermediate\"], optional: true });\n\nToolbar.prototype.publish(\"responsive\", true, \"boolean\", \"Adapts to pixel width\", null, { tags: [\"Basic\"] });\n\nToolbar.prototype.publish(\"widgets\", [], \"widgetArray\", \"Child widgets of the toolbar\", null, { tags: [\"Basic\"] });\nToolbar.prototype.publish(\"widgetClasses\", [], \"array\", \"Array of Html Element classes to be assigned to the child widgets (shares index with widgets param)\", null, { tags: [\"Basic\"] });\n","import { FlexGrid } from \"./FlexGrid.ts\";\n\nexport class VerticalList extends FlexGrid {\n constructor() {\n super();\n this.orientation_default(\"vertical\");\n this.flexWrap_default(\"nowrap\");\n }\n}\nVerticalList.prototype._class += \" layout_VerticalList\";\n\nexport interface VerticalList {\n orientation_default(_: \"horizontal\" | \"vertical\");\n flexWrap_default(_: \"nowrap\" | \"wrap\" | \"wrap-reverse\");\n}\n"],"names":["d3Select","d3SelectAll","c","drag","d3Drag","a","promises","pi","tau","constant","s","circle","d3_identity","d3_reverse","d3_textWrapping","text","d3_mergeLabels","d3_linearLegend","d3_quantLegend","d3_ordinalLegend","d3_cellOver","d3_cellOut","d3_cellClick","path","cellTrans","textTrans","d3LegendColor","n","format","d3Format","d3ScaleOrdinal","this","GridList","k","_GridList.default"],"mappings":";;;;;;;;;;;;;;;;;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__package__.ts","../src/AbsoluteSurface.ts","../src/Accordion.ts","../src/Surface.ts","../src/Cell.ts","../src/Border.ts","../src/Border2.ts","../src/Carousel.ts","../../../node_modules/d3-path/src/path.js","../../../node_modules/d3-shape/src/constant.js","../../../node_modules/d3-shape/src/math.js","../../../node_modules/d3-shape/src/symbol/circle.js","../../../node_modules/d3-shape/src/symbol/cross.js","../../../node_modules/d3-shape/src/symbol/diamond.js","../../../node_modules/d3-shape/src/symbol/star.js","../../../node_modules/d3-shape/src/symbol/square.js","../../../node_modules/d3-shape/src/symbol/triangle.js","../../../node_modules/d3-shape/src/symbol/wye.js","../../../node_modules/d3-shape/src/symbol.js","../../../node_modules/d3-svg-legend/indexRollupNext.js","../src/Legend.ts","../src/Modal.ts","../src/ChartPanel.ts","../src/FlexGrid.ts","../../../node_modules/grid-list/src/gridList.js","../src/Grid.ts","../src/HorizontalList.ts","../src/Layered.ts","../src/Popup.ts","../src/Tabbed.ts","../src/Toolbar.ts","../src/VerticalList.ts"],"sourcesContent":["export const PKG_NAME = \"__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 type { XYAxis } from \"@hpcc-js/chart\";\nimport { Table } from \"@hpcc-js/dgrid\";\nimport { select as d3Select } from \"d3-selection\";\nimport { Border2 } from \"./Border2.ts\";\nimport { Carousel } from \"./Carousel.ts\";\nimport { Legend } from \"./Legend.ts\";\nimport { Modal } from \"./Modal.ts\";\n\nimport \"../src/ChartPanel.css\";\n\nexport class ChartPanel<T extends Widget = Widget> extends Border2 implements IHighlight {\n\n protected _legend = new Legend(this).enableOverflow(true);\n protected _progressBar = new ProgressBar();\n protected _autoScale = false;\n protected _resolutions = {\n tiny: { width: 100, height: 100 },\n small: { width: 300, height: 300 }\n };\n private _modal = new Modal();\n private _highlight: boolean;\n private _scale: number;\n private _orig_size: any;\n\n private _toggleInfo = new ToggleButton().faChar(\"fa-info-circle\").tooltip(\".Description\")\n .selected(false)\n .on(\"enabled\", () => {\n return this.description() !== \"\";\n })\n .on(\"click\", () => {\n if (this._toggleInfo.selected()) {\n this._modal\n .title(this.title())\n .widget(new Text().text(this.description()))\n .show(true)\n .render()\n ;\n\n const origCloseFunc = this._modal._close;\n this._modal._close = () => {\n this._toggleInfo\n .selected(false)\n .render()\n ;\n this._modal._close = origCloseFunc;\n };\n }\n })\n .on(\"mouseMove\", () => {\n /*\n this._modal.showPreview(true).render(n => {\n n.resize().render();\n });\n */\n })\n .on(\"mouseOut\", () => {\n /*\n if (this._modal.showPreview()) {\n this._modal.show(false).showPreview(false).render();\n }\n */\n });\n\n private _toggleData = new ToggleButton().faChar(\"fa-table\").tooltip(\"Data\")\n .on(\"click\", () => {\n this.dataVisible(this._toggleData.selected());\n this.render();\n });\n\n private _buttonDownload = new Button().faChar(\"fa-download\").tooltip(\"Download\")\n .on(\"click\", () => {\n this.downloadCSV();\n });\n\n private _buttonDownloadImage = new Button().faChar(\"fa-image\").tooltip(\"Download Image\")\n .on(\"click\", () => {\n this.downloadPNG();\n });\n\n private _toggleLegend = new ToggleButton().faChar(\"fa-list-ul\").tooltip(\"Legend\")\n .selected(false)\n .on(\"click\", () => {\n const selected = this._toggleLegend.selected();\n if (this.legendPosition() === \"bottom\") {\n this.showBottom(selected);\n } else if (this.legendPosition() === \"right\") {\n this.showRight(selected);\n }\n this.legendVisible(selected);\n this.render();\n });\n\n protected _spacer = new Spacer();\n\n _titleBar = new TitleBar().buttons([this._toggleData, this._buttonDownload, this._buttonDownloadImage, this._spacer, this._toggleLegend]);\n\n protected _carousel = new Carousel();\n protected _table = new Table();\n protected _widget: T;\n\n protected _hideLegendToggleList = [\"dgrid_Table\"];\n\n constructor() {\n super();\n this._tag = \"div\";\n }\n\n fields(): Database.Field[];\n fields(_: Database.Field[]): this;\n fields(_?: Database.Field[]): this | Database.Field[] {\n if (!arguments.length) return super.fields();\n super.fields(_);\n this._legend.fields(_);\n this.refreshFields();\n return this;\n }\n refreshFields() {\n this._widget.fields(this._legend.filteredFields());\n this._table.fields(this._legend.filteredFields());\n return this;\n }\n\n columns(): string[];\n columns(_: string[], asDefault?: boolean): this;\n columns(_?: string[], asDefault?: boolean): string[] | this {\n if (!arguments.length) return super.columns();\n super.columns(_, asDefault);\n this._legend.columns(_, asDefault);\n this.refreshColumns();\n return this;\n }\n refreshColumns() {\n this._widget.columns(this._legend.filteredColumns());\n this._table.columns(this._legend.filteredColumns());\n return this;\n }\n\n data(_?) {\n if (!arguments.length) return super.data();\n super.data(_);\n this._legend.data(_);\n this.refreshData();\n return this;\n }\n refreshData() {\n this._widget.data(this._legend.filteredData());\n this._table.data(this._legend.filteredData());\n return this;\n }\n\n highlight(): boolean;\n highlight(_: boolean): this;\n highlight(_?: boolean): boolean | this {\n if (!arguments.length) return this._highlight;\n this._highlight = _;\n return this;\n }\n\n startProgress() {\n this._progressBar.start();\n }\n\n finishProgress() {\n this._progressBar.finish();\n }\n\n buttons(): Widget[];\n buttons(_: Widget[]): this;\n buttons(_?: Widget[]): this | Widget[] {\n if (!arguments.length) return this._titleBar.buttons();\n this._titleBar.buttons(_);\n return this;\n }\n\n downloadCSV() {\n const namePrefix = this.downloadTitle() ? this.downloadTitle() : this.title() ? this.title() : \"data\";\n const nameSuffix = this.downloadTimestampSuffix() ? \"_\" + Utility.timestamp() : \"\";\n Utility.downloadString(\"CSV\", this._widget.export(\"CSV\"), namePrefix + nameSuffix);\n return this;\n }\n\n downloadPNG() {\n const widget = this.widget();\n if (widget instanceof SVGWidget) {\n if (!this.legendVisible()) {\n widget.downloadPNG(this.title());\n } else {\n widget.downloadPNG(this.title(), undefined, this._legend);\n }\n }\n return this;\n }\n\n highlightColumn(column?: string): this {\n if (column) {\n const cssTag = `series-${this.cssTag(column)}`;\n this._centerWA.element().selectAll(\".series\")\n .each(function () {\n const element = d3Select(this);\n const highlight = element.classed(cssTag);\n element\n .classed(\"highlight\", highlight)\n .classed(\"lowlight\", !highlight)\n ;\n })\n ;\n } else {\n this._centerWA.element().selectAll(\".series\")\n .classed(\"highlight\", false)\n .classed(\"lowlight\", false)\n ;\n }\n return this;\n }\n\n getResponsiveMode(): \"tiny\" | \"small\" | \"regular\" | \"none\" {\n if (!this.enableAutoscaling()) return \"none\";\n if (!this._autoScale) return \"regular\";\n if (this.size().width <= this._resolutions.tiny.width || this.size().height <= this._resolutions.tiny.height) {\n return \"tiny\";\n } else if (this.size().width <= this._resolutions.small.width || this.size().height <= this._resolutions.small.height) {\n return \"small\";\n }\n return \"regular\";\n }\n\n setOrigSize() {\n this._orig_size = JSON.parse(JSON.stringify(this.size()));\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this._modal\n .target(this.target())\n .relativeTargetId(this.id())\n ;\n\n this.top(this._titleBar);\n this.center(this._carousel);\n\n this._legend\n .targetWidget(this._widget)\n .orientation(\"vertical\")\n .title(\"\")\n .visible(false)\n ;\n\n this._progressBar.enter(domNode, element);\n this.setOrigSize();\n }\n\n preUpdateTiny(element) {\n element.selectAll(\"div.body,div.title-text,div.icon-bar\").style(\"display\", \"none\");\n }\n\n preUpdateSmall(element) {\n const scale_x = this._orig_size.width / this._resolutions.small.width;\n const scale_y = this._orig_size.height / this._resolutions.small.height;\n this._scale = Math.min(scale_x, scale_y);\n const x_is_smaller = this._scale === scale_x;\n this.size({\n width: x_is_smaller ? this._resolutions.small.width : this._orig_size.width * (1 / this._scale),\n height: !x_is_smaller ? this._resolutions.small.height : this._orig_size.height * (1 / this._scale)\n });\n element.select(\"div.title-icon\").style(\"position\", \"static\");\n element.selectAll(\"lhs\").style(\"display\", \"none\");\n element.selectAll(\"div.body,div.title-text,div.icon-bar\").style(\"display\", \"\");\n element.selectAll(\"div.data-count\").style(\"visibility\", \"hidden\");\n element.style(\"transform\", `scale(${this._scale})`);\n }\n\n preUpdateRegular(element) {\n element.selectAll(\"div.body,div.title-text,div.icon-bar\").style(\"display\", \"\");\n element.selectAll(\"div.data-count\").style(\"visibility\", \"hidden\");\n element.select(\"div.title-icon\").style(\"position\", \"static\");\n element.style(\"transform\", \"translate(0px,0px) scale(1)\");\n }\n\n private _prevdataVisible;\n private _prevlegendVisible;\n private _prevLegendPosition;\n private _prevChartDataFamily;\n private _prevChart;\n private _prevButtons;\n update(domNode, element) {\n super.update(domNode, element);\n }\n\n preUpdate(domNode, element) {\n\n super.preUpdate(domNode, element);\n\n if (this._prevLegendPosition !== this.legendPosition()) {\n if (this._legend.target() !== null) this._legend.target(null);\n if (this._prevLegendPosition !== undefined) {\n this.swap(this._prevLegendPosition, this.legendPosition());\n } else {\n this[this.legendPosition()](this._legend);\n }\n if (this.legendPosition() === \"right\") {\n this.rightOverflowX(\"hidden\");\n this.rightOverflowY(\"auto\");\n this.bottomOverflowX(\"visible\");\n this.bottomOverflowY(\"visible\");\n } else {\n this.rightOverflowX(\"visible\");\n this.rightOverflowY(\"visible\");\n this.bottomOverflowX(\"auto\");\n this.bottomOverflowY(\"hidden\");\n }\n this._prevLegendPosition = this.legendPosition();\n }\n\n if (this._prevdataVisible !== this.dataVisible()) {\n this._prevdataVisible = this.dataVisible();\n this._toggleData.selected(this._prevdataVisible);\n this._legend.visible(this._prevlegendVisible && !this._prevdataVisible);\n this._carousel.active(this._prevdataVisible ? 1 : 0);\n }\n\n if (this._prevlegendVisible !== this.legendVisible()) {\n this._prevlegendVisible = this.legendVisible();\n this._toggleLegend.selected(this._prevlegendVisible);\n this._legend.visible(this._prevlegendVisible && !this._prevdataVisible);\n }\n\n this._legend.orientation(this.legendPosition() === \"bottom\" ? \"horizontal\" : \"vertical\");\n\n this.showLeft(!this.left());\n\n switch (this.getResponsiveMode()) {\n case \"tiny\":\n this.preUpdateTiny(element);\n break;\n case \"small\":\n this.preUpdateSmall(element);\n break;\n case \"regular\":\n this.preUpdateRegular(element);\n break;\n }\n\n const chart = this._widget.classID() === \"composite_MultiChart\" ? this._widget[\"chart\"]() : this._widget;\n this._legend.dataFamily(chart._dataFamily || \"any\");\n\n if (this._prevChartDataFamily !== this._legend.dataFamily()) {\n this._prevChartDataFamily = this._legend.dataFamily();\n switch (this._prevChartDataFamily) {\n case \"any\":\n this._toggleLegend.selected(false);\n this._legend.visible(false);\n break;\n }\n }\n element.style(\"box-shadow\", this.highlight() ? `inset 0px 0px 0px ${this.highlightSize()}px ${this.highlightColor()}` : \"none\");\n\n if (this._hideLegendToggleList.indexOf(chart.classID()) !== -1) {\n this._spacer.visible(false);\n this._toggleLegend.visible(false);\n } else {\n this._spacer.visible(true);\n this._toggleLegend.visible(true);\n }\n if (this._prevChart !== chart) {\n this._prevChart = chart;\n const widgetIconBar = chart ? chart[\"_titleBar\"] || chart[\"_iconBar\"] : undefined;\n if (widgetIconBar && widgetIconBar instanceof IconBar) {\n this._prevButtons = this._prevButtons || [...this.buttons()];\n const buttons: Widget[] = [\n ...widgetIconBar.buttons(),\n new Spacer(),\n ...this._prevButtons\n ];\n widgetIconBar.buttons([]).render();\n this.buttons(buttons);\n } else if (this._prevButtons) {\n this.buttons(this._prevButtons);\n }\n }\n\n const hiddenButtons = [];\n if (!this.dataButtonVisible()) hiddenButtons.push(this._toggleData);\n if (!this.downloadButtonVisible()) hiddenButtons.push(this._buttonDownload);\n if (!this.downloadImageButtonVisible()) hiddenButtons.push(this._buttonDownloadImage);\n if (!this.legendButtonVisible()) hiddenButtons.push(this._toggleLegend);\n this._buttonDownloadImage.enabled(this.widget() instanceof SVGWidget);\n this._titleBar\n .hiddenButtons(hiddenButtons)\n .visible(this.titleVisible())\n ;\n this.topOverlay(this.titleOverlay() || !this.titleVisible());\n }\n\n postUpdate(domNode, element) {\n super.postUpdate(domNode, element);\n\n switch (this.getResponsiveMode()) {\n case \"tiny\":\n this.postUpdateTiny(element);\n break;\n case \"small\":\n this.postUpdateSmall(element);\n break;\n case \"regular\":\n this.postUpdateRegular(element);\n break;\n }\n }\n\n postUpdateTiny(element) {\n element.selectAll(\"div.body,div.title-text,div.icon-bar\").style(\"display\", \"none\");\n element.selectAll(\"div.data-count\")\n .style(\"visibility\", \"visible\")\n .style(\"font-size\", (this.titleIconFontSize() / 3) + \"px\")\n .style(\"line-height\", (this.titleIconFontSize() / 3) + \"px\")\n .style(\"left\", this.titleIconFontSize() + \"px\")\n .text(this.data().length)\n ;\n element.style(\"transform\", \"translate(0px,0px) scale(1)\");\n const iconDiv = element.selectAll(\"div.title-icon\");\n const _node = iconDiv.node();\n const _container = element.node().parentElement;\n const containerRect = _container.getBoundingClientRect();\n if (_node) {\n const rect = iconDiv.node().getBoundingClientRect();\n const icon_top = containerRect.height / 2;\n iconDiv\n .style(\"position\", \"absolute\")\n .style(\"left\", `calc(50% - ${rect.width / 2}px)`)\n .style(\"top\", `${icon_top - (rect.height / 2)}px`)\n ;\n element.selectAll(\"div.data-count\")\n .style(\"position\", \"absolute\")\n .style(\"left\", `calc(50% + ${rect.width / 2}px)`)\n .style(\"top\", `${icon_top - (rect.height / 2)}px`)\n ;\n }\n }\n\n postUpdateSmall(element) {\n element.selectAll(\"lhs\").style(\"display\", \"none\"); // TODO: a bug in Border2?\n element.selectAll(\"div.title-icon\").style(\"position\", \"static\");\n element.selectAll(\"div.body,div.title-text,div.icon-bar\").style(\"display\", \"\");\n element.selectAll(\"div.data-count\").style(\"visibility\", \"hidden\");\n const rect = element.node().getBoundingClientRect();\n const parentRect = element.node().parentElement.getBoundingClientRect();\n element.style(\"transform\", `translate(${parentRect.x - rect.x}px, ${parentRect.y - rect.y}px) scale(${this._scale})`);\n }\n\n postUpdateRegular(element) {\n element.selectAll(\"div.title-icon\").style(\"position\", \"static\");\n element.selectAll(\"div.body,div.title-text,div.icon-bar\").style(\"display\", \"\");\n element.selectAll(\"div.data-count\").style(\"visibility\", \"hidden\");\n }\n\n exit(domNode, element) {\n this._progressBar.exit(domNode, element);\n\n this.right(null);\n this._legend.target(null);\n this.center(null);\n this._carousel.target(null);\n this.top(null);\n this._titleBar.target(null);\n\n this._modal.target(null);\n\n delete this._prevChart;\n delete this._prevButtons;\n delete this._prevChartDataFamily;\n delete this._prevPos;\n delete this._prevdataVisible;\n delete this._prevlegendVisible;\n\n super.exit(domNode, element);\n }\n\n // Event Handlers ---\n // Events ---\n click(row, column, selected) {\n // console.log(\"Click: \" + JSON.stringify(row) + \", \" + column + \", \" + selected);\n }\n\n dblclick(row, column, selected) {\n // console.log(\"Double click: \" + JSON.stringify(row) + \", \" + column + \", \" + selected);\n }\n\n vertex_click(row, col, sel, more) {\n if (more && more.vertex) {\n // console.log(\"Vertex click: \" + more.vertex.id());\n }\n }\n\n vertex_dblclick(row, col, sel, more) {\n if (more && more.vertex) {\n // console.log(\"Vertex double click: \" + more.vertex.id());\n }\n }\n\n edge_click(row, col, sel, more) {\n if (more && more.edge) {\n // console.log(\"Edge click: \" + more.edge.id());\n }\n }\n\n edge_dblclick(row, col, sel, more) {\n if (more && more.edge) {\n // console.log(\"Edge double click: \" + more.edge.id());\n }\n }\n}\nChartPanel.prototype._class += \" layout_ChartPanel\";\n\nexport interface ChartPanel<T extends Widget = Widget> {\n title(): string;\n title(_: string): this;\n titleVisible(): boolean;\n titleVisible(_: boolean): this;\n titleOverlay(): boolean;\n titleOverlay(_: boolean): this;\n title_exists(): boolean;\n titleFontSize(): number;\n titleFontSize(_: number): this;\n titleFontSize_exists(): boolean;\n titleIconFontSize(): number;\n titleIconFontSize(_: number): this;\n titleIconFontSize_exists(): boolean;\n dataVisible(): boolean;\n dataVisible(_: boolean): this;\n dataButtonVisible(): boolean;\n dataButtonVisible(_: boolean): this;\n downloadButtonVisible(): boolean;\n downloadButtonVisible(_: boolean): this;\n downloadImageButtonVisible(): boolean;\n downloadImageButtonVisible(_: boolean): this;\n downloadTitle(): string;\n downloadTitle(_: string): this;\n downloadTimestampSuffix(): boolean;\n downloadTimestampSuffix(_: boolean): this;\n legendVisible(): boolean;\n legendVisible(_: boolean): this;\n legendButtonVisible(): boolean;\n legendButtonVisible(_: boolean): this;\n legendPosition(): \"right\" | \"bottom\";\n legendPosition(_: \"right\" | \"bottom\"): this;\n description(): string;\n description(_: string): this;\n description_exists(): boolean;\n widget(): T;\n widget(_: T): this;\n widget_exists(): boolean;\n enableAutoscaling(): boolean;\n enableAutoscaling(_: boolean): this;\n enableAutoscaling_exists(): boolean;\n highlightSize(): number;\n highlightSize(_: number): this;\n highlightSize_exists(): boolean;\n highlightColor(): string;\n highlightColor(_: string): this;\n highlightColor_exists(): boolean;\n}\n\nChartPanel.prototype.publishReset();\nChartPanel.prototype.publishProxy(\"title\", \"_titleBar\");\nChartPanel.prototype.publish(\"titleVisible\", true, \"boolean\");\nChartPanel.prototype.publish(\"titleOverlay\", false, \"boolean\");\nChartPanel.prototype.publishProxy(\"titleIcon\", \"_titleBar\");\nChartPanel.prototype.publishProxy(\"titleIconFont\", \"_titleBar\");\nChartPanel.prototype.publishProxy(\"titleFont\", \"_titleBar\");\nChartPanel.prototype.publishProxy(\"titleIconFontSize\", \"_titleBar\");\nChartPanel.prototype.publishProxy(\"titleFontSize\", \"_titleBar\");\nChartPanel.prototype.publishProxy(\"description\", \"_titleBar\");\nChartPanel.prototype.publishProxy(\"descriptionFont\", \"_titleBar\");\nChartPanel.prototype.publishProxy(\"descriptionFontSize\", \"_titleBar\");\nChartPanel.prototype.publish(\"dataVisible\", false, \"boolean\", \"Show data table\");\nChartPanel.prototype.publish(\"dataButtonVisible\", true, \"boolean\", \"Show data table button\");\nChartPanel.prototype.publish(\"downloadButtonVisible\", true, \"boolean\", \"Show data download button\");\nChartPanel.prototype.publish(\"downloadImageButtonVisible\", false, \"boolean\", \"Show image download button\");\nChartPanel.prototype.publish(\"downloadTitle\", \"\", \"string\", \"File name when downloaded\");\nChartPanel.prototype.publish(\"downloadTimestampSuffix\", true, \"boolean\", \"Use timestamp as file name suffix\");\nChartPanel.prototype.publish(\"legendVisible\", false, \"boolean\", \"Show legend\");\nChartPanel.prototype.publish(\"legendButtonVisible\", true, \"boolean\", \"Show legend button\");\nChartPanel.prototype.publish(\"legendPosition\", \"right\", \"set\", \"Position of legend\", [\"right\", \"bottom\"]);\nChartPanel.prototype.publishProxy(\"legend_labelMaxWidth\", \"_legend\", \"labelMaxWidth\");\nChartPanel.prototype.publishProxy(\"legend_showSeriesTotal\", \"_legend\", \"showSeriesTotal\");\nChartPanel.prototype.publishProxy(\"legend_showLegendTotal\", \"_legend\", \"showLegendTotal\");\nChartPanel.prototype.publishProxy(\"legend_itemPadding\", \"_legend\", \"itemPadding\");\nChartPanel.prototype.publishProxy(\"legend_shapeRadius\", \"_legend\", \"shapeRadius\");\nChartPanel.prototype.publishProxy(\"legend_symbolType\", \"_legend\", \"symbolType\");\nChartPanel.prototype.publishProxy(\"legend_labelAlign\", \"_legend\", \"labelAlign\");\nChartPanel.prototype.publish(\"widget\", null, \"widget\", \"Widget\", undefined, { render: false });\nChartPanel.prototype.publish(\"enableAutoscaling\", false, \"boolean\");\nChartPanel.prototype.publish(\"highlightSize\", 4, \"number\");\nChartPanel.prototype.publish(\"highlightColor\", \"#e67e22\", \"html-color\");\nChartPanel.prototype.publishProxy(\"progress_halfLife\", \"_progressBar\", \"halfLife\");\nChartPanel.prototype.publishProxy(\"progress_decay\", \"_progressBar\", \"decay\");\nChartPanel.prototype.publishProxy(\"progress_size\", \"_progressBar\", \"size\");\nChartPanel.prototype.publishProxy(\"progress_color\", \"_progressBar\", \"color\");\nChartPanel.prototype.publishProxy(\"progress_blurBar\", \"_progressBar\", \"blurBar\");\nChartPanel.prototype.publishProxy(\"progress_blurSize\", \"_progressBar\", \"blurSize\");\nChartPanel.prototype.publishProxy(\"progress_blurColor\", \"_progressBar\", \"blurColor\");\nChartPanel.prototype.publishProxy(\"progress_blurOpacity\", \"_progressBar\", \"blurOpacity\");\n\nChartPanel.prototype.widget = function (_?) {\n if (!arguments.length) return this._widget;\n this._carousel.widgets([_, this._table]);\n this._widget = _;\n this._widget\n .fields(this._legend.filteredFields())\n .data(this._legend.filteredData())\n ;\n\n const context = this;\n const tmpAny = this._widget as any;\n tmpAny.click = function () {\n context.click.apply(context, arguments);\n };\n tmpAny.dblclick = function () {\n context.dblclick.apply(context, arguments);\n };\n tmpAny.vertex_click = function () {\n context.vertex_click.apply(context, arguments);\n };\n tmpAny.vertex_dblclick = function () {\n context.vertex_dblclick.apply(context, arguments);\n };\n tmpAny.edge_click = function () {\n context.edge_click.apply(context, arguments);\n };\n tmpAny.edge_dblclick = function () {\n context.edge_dblclick.apply(context, arguments);\n };\n return this;\n};\n","import { HTMLWidget } from \"@hpcc-js/common\";\nimport { select as d3Select } from \"d3-selection\";\n\nimport \"../src/FlexGrid.css\";\n\nexport class FlexGrid extends HTMLWidget {\n constructor() {\n super();\n }\n enter(domNode, element) {\n super.enter(domNode, element);\n d3Select(domNode.parentNode)\n .style(\"height\", \"100%\")\n .style(\"width\", \"100%\")\n ;\n }\n update(domNode, element) {\n super.update(domNode, element);\n const context = this;\n\n const cachedSizes = [];\n this.updateFlexParent(element);\n const listItems = element.selectAll(\".FlexGrid-list-item\").data(this.widgets(), w => w.id());\n listItems.enter()\n .append(\"div\")\n .classed(\"FlexGrid-list-item\", true)\n .each(function (w) {\n w.target(this);\n })\n .merge(listItems)\n .style(\"min-height\", this.itemMinHeight() + \"px\")\n .style(\"min-width\", this.itemMinWidth() + \"px\")\n .style(\"flex-basis\", (n, i) => {\n const flexBasis = this.widgetsFlexBasis()[i];\n return typeof flexBasis !== \"undefined\" ? flexBasis : this.flexBasis();\n })\n .style(\"flex-grow\", (n, i) => {\n const flexGrow = this.widgetsFlexGrow()[i];\n return typeof flexGrow !== \"undefined\" ? flexGrow : this.flexGrow();\n })\n .style(\"border-width\", this.borderWidth() + \"px\")\n .style(\"border-color\", this.itemBorderColor())\n .each(function () {\n this.firstChild.style.display = \"none\";\n })\n .each(function () {\n const rect = this.getBoundingClientRect();\n cachedSizes.push([\n rect.width,\n rect.height\n ]);\n })\n .each(function (w, i) {\n this.firstChild.style.display = \"block\";\n w.resize({\n width: cachedSizes[i][0] - (2 * context.borderWidth()),\n height: cachedSizes[i][1] - (2 * context.borderWidth())\n });\n })\n ;\n listItems.exit().remove();\n }\n exit(domNode, element) {\n super.exit(domNode, element);\n }\n updateFlexParent(element) {\n element\n .style(\"height\", \"100%\")\n .style(\"flex-direction\", this.orientation() === \"horizontal\" ? \"row\" : \"column\")\n .style(\"flex-wrap\", this.flexWrap())\n .style(\"align-items\", this.alignItems())\n .style(\"align-content\", this.alignContent())\n .style(\"overflow-x\", () => {\n if (this.forceXScroll() || (this.orientation() === \"horizontal\" && this.flexWrap() === \"nowrap\" && !this.disableScroll())) {\n return \"scroll\";\n }\n return \"hidden\";\n })\n .style(\"overflow-y\", () => {\n if (this.forceYScroll() || (this.orientation() === \"vertical\" && this.flexWrap() === \"nowrap\" && !this.disableScroll())) {\n return \"scroll\";\n }\n return \"hidden\";\n })\n ;\n }\n}\nFlexGrid.prototype._class += \" layout_FlexGrid\";\n\nexport interface FlexGrid {\n widgets(): any;\n widgets(_: any): this;\n orientation(): \"horizontal\" | \"vertical\";\n orientation(_: \"horizontal\" | \"vertical\"): this;\n flexWrap(): \"nowrap\" | \"wrap\" | \"wrap-reverse\";\n flexWrap(_: \"nowrap\" | \"wrap\" | \"wrap-reverse\"): this;\n itemMinHeight(): number;\n itemMinHeight(_: number): this;\n itemMinWidth(): number;\n itemMinWidth(_: number): this;\n alignItems(): \"flex-start\" | \"center\" | \"flex-end\" | \"stretch\";\n alignItems(_: \"flex-start\" | \"center\" | \"flex-end\" | \"stretch\"): this;\n alignContent(): \"flex-start\" | \"center\" | \"flex-end\" | \"stretch\" | \"space-between\" | \"space-around\";\n alignContent(_: \"flex-start\" | \"center\" | \"flex-end\" | \"stretch\" | \"space-between\" | \"space-around\"): this;\n itemBorderColor(): string;\n itemBorderColor(_: string): this;\n borderWidth(): number;\n borderWidth(_: number): this;\n flexGrow(): number;\n flexGrow(_: number): this;\n widgetsFlexGrow(): number[];\n widgetsFlexGrow(_: number[]): this;\n flexBasis(): string;\n flexBasis(_: string): this;\n widgetsFlexBasis(): string[];\n widgetsFlexBasis(_: string[]): this;\n disableScroll(): boolean;\n disableScroll(_: boolean): this;\n forceXScroll(): boolean;\n forceXScroll(_: boolean): this;\n forceYScroll(): boolean;\n forceYScroll(_: boolean): this;\n}\n\nFlexGrid.prototype.publish(\"itemBorderColor\", \"transparent\", \"html-color\", \"Color of list item borders\");\nFlexGrid.prototype.publish(\"borderWidth\", 0, \"number\", \"Width of list item borders (pixels)\");\nFlexGrid.prototype.publish(\"orientation\", \"horizontal\", \"set\", \"Controls the flex-direction of the list items\", [\"horizontal\", \"vertical\"]);\nFlexGrid.prototype.publish(\"flexWrap\", \"wrap\", \"set\", \"Controls the line wrap when overflow occurs\", [\"nowrap\", \"wrap\", \"wrap-reverse\"]);\nFlexGrid.prototype.publish(\"disableScroll\", false, \"boolean\", \"If false, scrollbar will show (when flexWrap is set to 'nowrap')\", null, { disable: (w: any) => w.flexWrap() !== \"nowrap\" });\nFlexGrid.prototype.publish(\"forceXScroll\", false, \"boolean\", \"If true, horzontal scrollbar will show\");\nFlexGrid.prototype.publish(\"forceYScroll\", false, \"boolean\", \"If true, vertical scrollbar will show\");\nFlexGrid.prototype.publish(\"itemMinHeight\", 64, \"number\", \"Minimum height of a list item (pixels)\");\nFlexGrid.prototype.publish(\"itemMinWidth\", 64, \"number\", \"Minimum width of a list item (pixels)\");\nFlexGrid.prototype.publish(\"alignItems\", \"stretch\", \"set\", \"Controls normal alignment of items\", [\"flex-start\", \"center\", \"flex-end\", \"stretch\"]);\nFlexGrid.prototype.publish(\"alignContent\", \"stretch\", \"set\", \"Controls normal alignment of item rows\", [\"flex-start\", \"center\", \"flex-end\", \"stretch\", \"space-between\", \"space-around\"]);\nFlexGrid.prototype.publish(\"flexGrow\", 1, \"number\", \"Default flex-grow style for all list items\");\nFlexGrid.prototype.publish(\"flexBasis\", \"10%\", \"string\", \"Default flex-basis style for all list items\");\nFlexGrid.prototype.publish(\"widgetsFlexGrow\", [], \"array\", \"Array of flex-grow values keyed on the widgets array\");\nFlexGrid.prototype.publish(\"widgetsFlexBasis\", [], \"array\", \"Array of flex-basis values keyed on the widgets array\");\nFlexGrid.prototype.publish(\"widgets\", [], \"widgetArray\", \"Array of widgets to be rendered as list items\");\n","(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define([], factory);\n } else if (typeof exports === 'object') {\n // Node. Does not work with strict CommonJS, but\n // only CommonJS-like environments that support module.exports,\n // like Node.\n module.exports = factory();\n } else {\n // Browser globals (root is window)\n root.GridList = factory();\n }\n}(this, function() {\n\nvar GridList = function(items, options) {\n /**\n * A GridList manages the two-dimensional positions from a list of items,\n * within a virtual matrix.\n *\n * The GridList's main function is to convert the item positions from one\n * grid size to another, maintaining as much of their order as possible.\n *\n * The GridList's second function is to handle collisions when moving an item\n * over another.\n *\n * The positioning algorithm places items in columns. Starting from left to\n * right, going through each column top to bottom.\n *\n * The size of an item is expressed using the number of cols and rows it\n * takes up within the grid (w and h)\n *\n * The position of an item is express using the col and row position within\n * the grid (x and y)\n *\n * An item is an object of structure:\n * {\n * w: 3, h: 1,\n * x: 0, y: 1\n * }\n */\n\n this._options = options;\n for (var k in this.defaults) {\n if (!this._options.hasOwnProperty(k)) {\n this._options[k] = this.defaults[k];\n }\n }\n\n this.items = items;\n\n this._adjustSizeOfItems();\n\n this.generateGrid();\n};\n\nGridList.cloneItems = function(items, _items) {\n /**\n * Clone items with a deep level of one. Items are not referenced but their\n * properties are\n */\n var _item,\n i,\n k;\n if (_items === undefined) {\n _items = [];\n }\n for (i = 0; i < items.length; i++) {\n // XXX: this is good because we don't want to lose item reference, but\n // maybe we should clear their properties since some might be optional\n if (!_items[i]) {\n _items[i] = {};\n }\n for (k in items[i]) {\n _items[i][k] = items[i][k];\n }\n }\n return _items;\n};\n\nGridList.prototype = {\n\n defaults: {\n lanes: 5,\n direction: 'horizontal'\n },\n\n /**\n * Illustates grid as text-based table, using a number identifier for each\n * item. E.g.\n *\n * #| 0 1 2 3 4 5 6 7 8 9 10 11 12 13\n * --------------------------------------------\n * 0| 00 02 03 04 04 06 08 08 08 12 12 13 14 16\n * 1| 01 -- 03 05 05 07 09 10 11 11 -- 13 15 --\n *\n * Warn: Does not work if items don't have a width or height specified\n * besides their position in the grid.\n */\n toString: function() {\n var widthOfGrid = this.grid.length,\n output = '\\n #|',\n border = '\\n --',\n item,\n i,\n j;\n\n // Render the table header\n for (i = 0; i < widthOfGrid; i++) {\n output += ' ' + this._padNumber(i, ' ');\n border += '---';\n };\n output += border;\n\n // Render table contents row by row, as we go on the y axis\n for (i = 0; i < this._options.lanes; i++) {\n output += '\\n' + this._padNumber(i, ' ') + '|';\n for (j = 0; j < widthOfGrid; j++) {\n output += ' ';\n item = this.grid[j][i];\n output += item ? this._padNumber(this.items.indexOf(item), '0') : '--';\n }\n };\n output += '\\n';\n return output;\n },\n\n generateGrid: function() {\n /**\n * Build the grid structure from scratch, with the current item positions\n */\n var i;\n this._resetGrid();\n for (i = 0; i < this.items.length; i++) {\n this._markItemPositionToGrid(this.items[i]);\n }\n },\n\n resizeGrid: function(lanes) {\n var currentColumn = 0;\n\n this._options.lanes = lanes;\n this._adjustSizeOfItems();\n\n this._sortItemsByPosition();\n this._resetGrid();\n\n // The items will be sorted based on their index within the this.items array,\n // that is their \"1d position\"\n for (var i = 0; i < this.items.length; i++) {\n var item = this.items[i],\n position = this._getItemPosition(item);\n\n this._updateItemPosition(\n item, this.findPositionForItem(item, {x: currentColumn, y: 0}));\n\n // New items should never be placed to the left of previous items\n currentColumn = Math.max(currentColumn, position.x);\n }\n\n this._pullItemsToLeft();\n },\n\n findPositionForItem: function(item, start, fixedRow) {\n /**\n * This method has two options for the position we want for the item:\n * - Starting from a certain row/column number and only looking for\n * positions to its right\n * - Accepting positions for a certain row number only (use-case: items\n * being shifted to the left/right as a result of collisions)\n *\n * @param {Object<x:Number, y:Number, w:Number, h:Number} item\n * @param {Object<x:Number, y:Number} start Position from which to start\n * the search.\n * @param {Number} [fixedRow] If provided, we're going to try to find a\n * position for the new item on it. If doesn't fit there, we're going\n * to put it on the first row.\n *\n * @returns {Number[2]} x and y.\n */\n\n var x, y, position;\n\n // Start searching for a position from the horizontal position of the\n // rightmost item from the grid\n for (x = start.x; x < this.grid.length; x++) {\n if (fixedRow !== undefined) {\n position = [x, fixedRow];\n\n if (this._itemFitsAtPosition(item, position)) {\n return position;\n }\n } else {\n for (y = start.y; y < this._options.lanes; y++) {\n position = [x, y];\n\n if (this._itemFitsAtPosition(item, position)) {\n return position;\n }\n }\n }\n }\n\n // If we've reached this point, we need to start a new column\n var newCol = this.grid.length,\n newRow = 0;\n\n if (fixedRow !== undefined &&\n this._itemFitsAtPosition(item, [newCol, fixedRow])) {\n newRow = fixedRow;\n }\n\n return [newCol, newRow];\n },\n\n moveItemToPosition: function(item, newPosition) {\n var position = this._getItemPosition({\n x: newPosition[0],\n y: newPosition[1],\n w: item.w,\n h: item.h\n });\n\n this._updateItemPosition(item, [position.x, position.y]);\n this._resolveCollisions(item);\n },\n\n resizeItem: function(item, size) {\n /**\n * Resize an item and resolve collisions.\n *\n * @param {Object} item A reference to an item that's part of the grid.\n * @param {Object} size\n * @param {Number} [size.w=item.w] The new width.\n * @param {Number} [size.h=item.h] The new height.\n */\n\n var width = size.w || item.w,\n height = size.h || item.h;\n\n this._updateItemSize(item, width, height);\n\n this._resolveCollisions(item);\n\n this._pullItemsToLeft();\n },\n\n getChangedItems: function(initialItems, idAttribute) {\n /**\n * Compare the current items against a previous snapshot and return only\n * the ones that changed their attributes in the meantime. This includes both\n * position (x, y) and size (w, h)\n *\n * Since both their position and size can change, the items need an\n * additional identifier attribute to match them with their previous state\n */\n var changedItems = [];\n\n for (var i = 0; i < initialItems.length; i++) {\n var item = this._getItemByAttribute(idAttribute,\n initialItems[i][idAttribute]);\n\n if (item.x !== initialItems[i].x ||\n item.y !== initialItems[i].y ||\n item.w !== initialItems[i].w ||\n item.h !== initialItems[i].h) {\n changedItems.push(item);\n }\n }\n\n return changedItems;\n },\n\n _sortItemsByPosition: function() {\n this.items.sort(function(item1, item2) {\n var position1 = this._getItemPosition(item1),\n position2 = this._getItemPosition(item2);\n\n // Try to preserve columns.\n if (position1.x != position2.x) {\n return position1.x - position2.x;\n }\n\n if (position1.y != position2.y) {\n return position1.y - position2.y;\n }\n\n // The items are placed on the same position.\n return 0;\n }.bind(this));\n },\n\n _adjustSizeOfItems: function() {\n /**\n * Some items can have 100% height or 100% width. Those dimmensions are\n * expressed as 0. We need to ensure a valid width and height for each of\n * those items as the number of items per lane.\n */\n\n for (var i = 0; i < this.items.length; i++) {\n var item = this.items[i];\n\n // This can happen only the first time items are checked.\n // We need the property to have a value for all the items so that the\n // `cloneItems` method will merge the properties properly. If we only set\n // it to the items that need it then the following can happen:\n //\n // cloneItems([{id: 1, autoSize: true}, {id: 2}],\n // [{id: 2}, {id: 1, autoSize: true}]);\n //\n // will result in\n //\n // [{id: 1, autoSize: true}, {id: 2, autoSize: true}]\n if (item.autoSize === undefined) {\n item.autoSize = item.w === 0 || item.h === 0;\n }\n\n if (item.autoSize) {\n if (this._options.direction === 'horizontal') {\n item.h = this._options.lanes;\n } else {\n item.w = this._options.lanes;\n }\n }\n }\n },\n\n _resetGrid: function() {\n this.grid = [];\n },\n\n _itemFitsAtPosition: function(item, newPosition) {\n /**\n * Check that an item wouldn't overlap with another one if placed at a\n * certain position within the grid\n */\n\n var position = this._getItemPosition(item),\n x, y, row;\n\n // No coordonate can be negative\n if (newPosition[0] < 0 || newPosition[1] < 0) {\n return false;\n }\n\n // Make sure the item isn't larger than the entire grid\n if (newPosition[1] + position.h > this._options.lanes) {\n return false;\n }\n\n // Make sure the position doesn't overlap with an already positioned\n // item.\n for (x = newPosition[0]; x < newPosition[0] + position.w; x++) {\n var col = this.grid[x];\n\n // Surely a column that hasn't even been created yet is available\n if (!col) {\n continue;\n }\n\n for (y = newPosition[1]; y < newPosition[1] + position.h; y++) {\n // Any space occupied by an item can continue to be occupied by the\n // same item.\n if (col[y] && col[y] !== item) {\n return false;\n }\n }\n }\n\n return true;\n },\n\n _updateItemPosition: function(item, position) {\n if (item.x !== null && item.y !== null) {\n this._deleteItemPositionFromGrid(item);\n }\n\n this._setItemPosition(item, position);\n\n this._markItemPositionToGrid(item);\n },\n\n _updateItemSize: function(item, width, height) {\n /**\n * @param {Object} item A reference to a grid item.\n * @param {Number} width The new width.\n * @param {Number} height The new height.\n */\n\n if (item.x !== null && item.y !== null) {\n this._deleteItemPositionFromGrid(item);\n }\n\n item.w = width;\n item.h = height;\n\n this._markItemPositionToGrid(item);\n },\n\n _markItemPositionToGrid: function(item) {\n /**\n * Mark the grid cells that are occupied by an item. This prevents items\n * from overlapping in the grid\n */\n\n var position = this._getItemPosition(item),\n x, y;\n\n // Ensure that the grid has enough columns to accomodate the current item.\n this._ensureColumns(position.x + position.w);\n\n for (x = position.x; x < position.x + position.w; x++) {\n for (y = position.y; y < position.y + position.h; y++) {\n this.grid[x][y] = item;\n }\n }\n },\n\n _deleteItemPositionFromGrid: function(item) {\n var position = this._getItemPosition(item),\n x, y;\n\n for (x = position.x; x < position.x + position.w; x++) {\n // It can happen to try to remove an item from a position not generated\n // in the grid, probably when loading a persisted grid of items. No need\n // to create a column to be able to remove something from it, though\n if (!this.grid[x]) {\n continue;\n }\n\n for (y = position.y; y < position.y + position.h; y++) {\n // Don't clear the cell if it's been occupied by a different widget in\n // the meantime (e.g. when an item has been moved over this one, and\n // thus by continuing to clear this item's previous position you would\n // cancel the first item's move, leaving it without any position even)\n if (this.grid[x][y] == item) {\n this.grid[x][y] = null;\n }\n }\n }\n },\n\n _ensureColumns: function(N) {\n /**\n * Ensure that the grid has at least N columns available.\n */\n var i;\n for (i = 0; i < N; i++) {\n if (!this.grid[i]) {\n this.grid.push(new GridCol(this._options.lanes));\n }\n }\n },\n\n _getItemsCollidingWithItem: function(item) {\n var collidingItems = [];\n for (var i = 0; i < this.items.length; i++) {\n if (item != this.items[i] &&\n this._itemsAreColliding(item, this.items[i])) {\n collidingItems.push(i);\n }\n }\n return collidingItems;\n },\n\n _itemsAreColliding: function(item1, item2) {\n var position1 = this._getItemPosition(item1),\n position2 = this._getItemPosition(item2);\n\n return !(position2.x >= position1.x + position1.w ||\n position2.x + position2.w <= position1.x ||\n position2.y >= position1.y + position1.h ||\n position2.y + position2.h <= position1.y);\n },\n\n _resolveCollisions: function(item) {\n if (!this._tryToResolveCollisionsLocally(item)) {\n this._pullItemsToLeft(item);\n }\n this._pullItemsToLeft();\n },\n\n _tryToResolveCollisionsLocally: function(item) {\n /**\n * Attempt to resolve the collisions after moving a an item over one or more\n * other items within the grid, by shifting the position of the colliding\n * items around the moving one. This might result in subsequent collisions,\n * in which case we will revert all position permutations. To be able to\n * revert to the initial item positions, we create a virtual grid in the\n * process\n */\n var collidingItems = this._getItemsCollidingWithItem(item);\n if (!collidingItems.length) {\n return true;\n }\n var _gridList = new GridList([], this._options),\n leftOfItem,\n rightOfItem,\n aboveOfItem,\n belowOfItem;\n\n GridList.cloneItems(this.items, _gridList.items);\n _gridList.generateGrid();\n\n for (var i = 0; i < collidingItems.length; i++) {\n var collidingItem = _gridList.items[collidingItems[i]],\n collidingPosition = this._getItemPosition(collidingItem);\n\n // We use a simple algorithm for moving items around when collisions occur:\n // In this prioritized order, we try to move a colliding item around the\n // moving one:\n // 1. to its left side\n // 2. above it\n // 3. under it\n // 4. to its right side\n var position = this._getItemPosition(item);\n\n leftOfItem = [position.x - collidingPosition.w, collidingPosition.y];\n rightOfItem = [position.x + position.w, collidingPosition.y];\n aboveOfItem = [collidingPosition.x, position.y - collidingPosition.h];\n belowOfItem = [collidingPosition.x, position.y + position.h];\n\n if (_gridList._itemFitsAtPosition(collidingItem, leftOfItem)) {\n _gridList._updateItemPosition(collidingItem, leftOfItem);\n } else if (_gridList._itemFitsAtPosition(collidingItem, aboveOfItem)) {\n _gridList._updateItemPosition(collidingItem, aboveOfItem);\n } else if (_gridList._itemFitsAtPosition(collidingItem, belowOfItem)) {\n _gridList._updateItemPosition(collidingItem, belowOfItem);\n } else if (_gridList._itemFitsAtPosition(collidingItem, rightOfItem)) {\n _gridList._updateItemPosition(collidingItem, rightOfItem);\n } else {\n // Collisions failed, we must use the pullItemsToLeft method to arrange\n // the other items around this item with fixed position. This is our\n // plan B for when local collision resolving fails.\n return false;\n }\n }\n // If we reached this point it means we managed to resolve the collisions\n // from one single iteration, just by moving the colliding items around. So\n // we accept this scenario and marge the brached-out grid instance into the\n // original one\n GridList.cloneItems(_gridList.items, this.items);\n this.generateGrid();\n return true;\n },\n\n _pullItemsToLeft: function(fixedItem) {\n /**\n * Build the grid from scratch, by using the current item positions and\n * pulling them as much to the left as possible, removing as space between\n * them as possible.\n *\n * If a \"fixed item\" is provided, its position will be kept intact and the\n * rest of the items will be layed around it.\n */\n\n\n // Start a fresh grid with the fixed item already placed inside\n this._sortItemsByPosition();\n this._resetGrid();\n\n // Start the grid with the fixed item as the first positioned item\n if (fixedItem) {\n var fixedPosition = this._getItemPosition(fixedItem);\n this._updateItemPosition(fixedItem, [fixedPosition.x, fixedPosition.y]);\n }\n\n for (var i = 0; i < this.items.length; i++) {\n var item = this.items[i],\n position = this._getItemPosition(item);\n\n // The fixed item keeps its exact position\n if (fixedItem && item == fixedItem) {\n continue;\n }\n\n var x = this._findLeftMostPositionForItem(item),\n newPosition = this.findPositionForItem(\n item, {x: x, y: 0}, position.y);\n\n this._updateItemPosition(item, newPosition);\n }\n },\n\n _findLeftMostPositionForItem: function(item) {\n /**\n * When pulling items to the left, we need to find the leftmost position for\n * an item, with two considerations in mind:\n * - preserving its current row\n * - preserving the previous horizontal order between items\n */\n\n var tail = 0,\n position = this._getItemPosition(item);\n\n for (var i = 0; i < this.grid.length; i++) {\n for (var j = position.y; j < position.y + position.h; j++) {\n var otherItem = this.grid[i][j];\n\n if (!otherItem) {\n continue;\n }\n\n var otherPosition = this._getItemPosition(otherItem);\n\n if (this.items.indexOf(otherItem) < this.items.indexOf(item)) {\n tail = otherPosition.x + otherPosition.w;\n }\n }\n }\n\n return tail;\n },\n\n _getItemByAttribute: function(key, value) {\n for (var i = 0; i < this.items.length; i++) {\n if (this.items[i][key] === value) {\n return this.items[i];\n }\n }\n return null;\n },\n\n _padNumber: function(nr, prefix) {\n // Currently works for 2-digit numbers (<100)\n return nr >= 10 ? nr : prefix + nr;\n },\n\n _getItemPosition: function(item) {\n /**\n * If the direction is vertical we need to rotate the grid 90 deg to the\n * left. Thus, we simulate the fact that items are being pulled to the top.\n *\n * Since the items have widths and heights, if we apply the classic\n * counter-clockwise 90 deg rotation\n *\n * [0 -1]\n * [1 0]\n *\n * then the top left point of an item will become the bottom left point of\n * the rotated item. To adjust for this, we need to subtract from the y\n * position the height of the original item - the width of the rotated item.\n *\n * However, if we do this then we'll reverse some actions: resizing the\n * width of an item will stretch the item to the left instead of to the\n * right; resizing an item that doesn't fit into the grid will push the\n * items around it instead of going on a new row, etc.\n *\n * We found it better to do a vertical flip of the grid after rotating it.\n * This restores the direction of the actions and greatly simplifies the\n * transformations.\n */\n\n if (this._options.direction === 'horizontal') {\n return item;\n } else {\n return {\n x: item.y,\n y: item.x,\n w: item.h,\n h: item.w\n };\n }\n },\n\n _setItemPosition: function(item, position) {\n /**\n * See _getItemPosition.\n */\n\n if (this._options.direction === 'horizontal') {\n item.x = position[0];\n item.y = position[1];\n } else {\n // We're supposed to subtract the rotated item's height which is actually\n // the non-rotated item's width.\n item.x = position[1];\n item.y = position[0];\n }\n }\n};\n\nvar GridCol = function(lanes) {\n for (var i = 0; i < lanes; i++) {\n this.push(null);\n }\n};\n\n// Extend the Array prototype\nGridCol.prototype = [];\n\n// This module will have direct access to the GridList class\nreturn GridList;\n\n}));\n","import { d3Event, drag as d3Drag, HTMLWidget, Platform, select as d3Select, Utility } from \"@hpcc-js/common\";\nimport * as _GridList from \"grid-list\";\nimport { Cell } from \"./Cell.ts\";\n\nimport \"../src/Grid.css\";\n\nconst GridList = (_GridList && _GridList.default) || _GridList;\n\nexport type ICellPosition = [number, number, number, number];\n\nexport class Grid extends HTMLWidget {\n divItems;\n\n gridList;\n items;\n itemsMap;\n origItems;\n cellWidth;\n cellHeight;\n dragItem;\n dragItemPos;\n\n _d3Drag;\n _d3DragResize;\n _selectionBag;\n _scrollBarWidth;\n\n constructor() {\n super();\n\n this._tag = \"div\";\n this._selectionBag = new Utility.Selection(this);\n\n this.content([]);\n }\n\n getDimensions() {\n const size = { width: 0, height: 0 };\n this.content().forEach(function (cell) {\n if (size.width < cell.gridCol() + cell.gridColSpan()) {\n size.width = cell.gridCol() + cell.gridColSpan();\n }\n if (size.height < cell.gridRow() + cell.gridRowSpan()) {\n size.height = cell.gridRow() + cell.gridRowSpan();\n }\n }, this);\n return size;\n }\n\n clearContent(widget) {\n this.content(this.content().filter(function (contentWidget) {\n if (!widget) {\n contentWidget.target(null);\n return false;\n }\n let w: any = contentWidget;\n while (w) {\n if (widget === w) {\n contentWidget.target(null);\n return false;\n }\n w = w.widget ? w.widget() : null;\n }\n return true;\n }));\n }\n\n setContent(row, col, widget, title?, rowSpan?, colSpan?) {\n rowSpan = rowSpan || 1;\n colSpan = colSpan || 1;\n title = title || \"\";\n this.content(this.content().filter(function (contentWidget) {\n if (contentWidget.gridRow() === row && contentWidget.gridCol() === col) {\n contentWidget.target(null);\n return false;\n }\n return true;\n }));\n if (widget) {\n const cell = new Cell()\n .gridRow(row)\n .gridCol(col)\n .widget(widget)\n .title(title)\n .gridRowSpan(rowSpan)\n .gridColSpan(colSpan)\n ;\n this.content().push(cell);\n }\n return this;\n }\n\n sortedContent() {\n return this.content().sort(function (l, r) {\n if (l.gridRow() === r.gridRow()) {\n return l.gridCol() - r.gridCol();\n }\n return l.gridRow() - r.gridRow();\n });\n }\n\n getCell(row, col) {\n let retVal = null;\n this.content().some(function (cell) {\n if (row >= cell.gridRow() && row < cell.gridRow() + cell.gridRowSpan() &&\n col >= cell.gridCol() && col < cell.gridCol() + cell.gridColSpan()) {\n retVal = cell;\n return true;\n }\n return false;\n });\n return retVal;\n }\n\n getWidgetCell(id) {\n let retVal = null;\n this.content().some(function (cell) {\n if (cell.widget().id() === id) {\n retVal = cell;\n return true;\n }\n return false;\n });\n return retVal;\n }\n\n getContent(id) {\n let retVal = null;\n this.content().some(function (cell) {\n if (cell.widget().id() === id) {\n retVal = cell.widget();\n return true;\n }\n return false;\n });\n return retVal;\n }\n\n cellToGridItem(cell) {\n return {\n x: cell.gridCol(),\n y: cell.gridRow(),\n w: cell.gridColSpan(),\n h: cell.gridRowSpan(),\n id: cell.id(),\n cell\n };\n }\n\n gridItemToCell(item) {\n item.cell\n .gridCol(item.x)\n .gridRow(item.y)\n .gridColSpan(item.w)\n .gridRowSpan(item.h)\n ;\n }\n\n resetItemsPos() {\n this.origItems.forEach(function (origItem) {\n const item = this.itemsMap[origItem.id];\n item.x = origItem.x;\n item.y = origItem.y;\n }, this);\n }\n\n initGridList() {\n this.itemsMap = {};\n this.items = this.content().map(function (cell) {\n const retVal = this.cellToGridItem(cell);\n this.itemsMap[retVal.id] = retVal;\n return retVal;\n }, this);\n this.origItems = this.content().map(this.cellToGridItem);\n this.gridList = new GridList(this.items, {\n direction: this.snapping(),\n lanes: this.snapping() === \"horizontal\" ? this.snappingRows() : this.snappingColumns()\n });\n }\n\n killGridList() {\n this.gridList = null;\n delete this.items;\n delete this.itemsMap;\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n\n this._scrollBarWidth = Platform.getScrollbarWidth();\n\n const context = this;\n this._d3Drag = d3Drag()\n .subject(function (_d) {\n const d = context.cellToGridItem(_d);\n return { x: d.x * context.cellWidth, y: d.y * context.cellHeight };\n })\n .on(\"start\", function (_d: any) {\n if (!context.designMode()) return;\n d3Event().sourceEvent.stopPropagation();\n context.initGridList();\n const d = context.itemsMap[_d.id()];\n context.dragItem = element.append(\"div\")\n .attr(\"class\", \"dragging\")\n .style(\"transform\", function () { return \"translate(\" + d.x * context.cellWidth + \"px, \" + d.y * context.cellHeight + \"px)\"; })\n .style(\"width\", function () { return d.w * context.cellWidth - context.gutter() + \"px\"; })\n .style(\"height\", function () { return d.h * context.cellHeight - context.gutter() + \"px\"; })\n ;\n context.selectionBagClick(_d);\n })\n .on(\"drag\", function (_d: any) {\n if (!context.designMode()) return;\n const event = d3Event();\n event.sourceEvent.stopPropagation();\n const d = context.itemsMap[_d.id()];\n if (event.x < 0) {\n event.x = 0;\n }\n if (event.x + d.w * context.cellWidth > context.snappingColumns() * context.cellWidth) {\n event.x = context.snappingColumns() * context.cellWidth - d.w * context.cellWidth;\n }\n if (event.y < 0) {\n event.y = 0;\n }\n if (event.y + d.h * context.cellWidth > context.snappingRows() * context.cellWidth) {\n event.y = context.snappingRows() * context.cellWidth - d.h * context.cellWidth;\n }\n const pos = [Math.max(0, Math.floor((event.x + context.cellWidth / 2) / context.cellWidth)), Math.max(0, Math.floor((event.y + context.cellHeight / 2) / context.cellHeight))];\n if (d.x !== pos[0] || d.y !== pos[1]) {\n if (context.snapping() !== \"none\") {\n context.resetItemsPos();\n context.gridList.moveItemToPosition(d, pos);\n } else {\n d.x = pos[0];\n d.y = pos[1];\n }\n if (_d.gridCol() !== d.x || _d.gridRow() !== d.y) {\n context.items.forEach(context.gridItemToCell);\n context.updateGrid(false, 100);\n }\n }\n context.dragItem\n .style(\"transform\", function () { return \"translate(\" + event.x + \"px, \" + event.y + \"px)\"; })\n .style(\"width\", function () { return d.w * context.cellWidth + \"px\"; })\n .style(\"height\", function () { return d.h * context.cellHeight + \"px\"; })\n ;\n })\n .on(\"end\", function () {\n if (!context.designMode()) return;\n d3Event().sourceEvent.stopPropagation();\n context.dragItem.remove();\n context.dragItem = null;\n context.killGridList();\n })\n ;\n\n this._d3DragResize = d3Drag()\n .subject(function (_d) {\n const d = context.cellToGridItem(_d);\n return { x: (d.x + d.w - 1) * context.cellWidth, y: (d.y + d.h - 1) * context.cellHeight };\n })\n .on(\"start\", function (_d: any) {\n if (!context.designMode()) return;\n d3Event().sourceEvent.stopPropagation();\n context.initGridList();\n const d = context.itemsMap[_d.id()];\n context.dragItem = element.append(\"div\")\n .attr(\"class\", \"resizing\")\n .style(\"transform\", function () { return \"translate(\" + d.x * context.cellWidth + \"px, \" + d.y * context.cellHeight + \"px)\"; })\n .style(\"width\", function () { return d.w * context.cellWidth - context.gutter() + \"px\"; })\n .style(\"height\", function () { return d.h * context.cellHeight - context.gutter() + \"px\"; })\n ;\n context.dragItemPos = { x: d.x, y: d.y };\n })\n .on(\"drag\", function (_d: any) {\n if (!context.designMode()) return;\n const event = d3Event();\n event.sourceEvent.stopPropagation();\n const d = context.itemsMap[_d.id()];\n const pos = [Math.max(0, Math.round(event.x / context.cellWidth)), Math.max(0, Math.round(event.y / context.cellHeight))];\n const size = {\n w: Math.max(1, pos[0] - d.x + 1),\n h: Math.max(1, pos[1] - d.y + 1)\n };\n if (d.w !== size.w || d.h !== size.h) {\n if (context.snapping() !== \"none\") {\n context.resetItemsPos();\n context.gridList.resizeItem(d, size);\n } else {\n d.w = size.w;\n d.h = size.h;\n }\n if (_d.gridColSpan() !== d.w || _d.gridRowSpan() !== d.h) {\n context.items.forEach(context.gridItemToCell);\n context.updateGrid(d.id, 100);\n }\n }\n context.dragItem\n .style(\"width\", function () { return (-d.x + 1) * context.cellWidth + event.x - context.gutter() + \"px\"; })\n .style(\"height\", function () { return (-d.y + 1) * context.cellHeight + event.y - context.gutter() + \"px\"; })\n ;\n })\n .on(\"end\", function () {\n if (!context.designMode()) return;\n d3Event().sourceEvent.stopPropagation();\n context.dragItem.remove();\n context.dragItem = null;\n context.killGridList();\n })\n ;\n }\n\n updateGrid(resize, transitionDuration: number = 0, _noRender: boolean = false) {\n transitionDuration = transitionDuration || 0;\n const context = this;\n this.divItems\n .classed(\"draggable\", this.designMode())\n .transition().duration(transitionDuration)\n .style(\"left\", function (d) { return d.gridCol() * context.cellWidth + context.gutter() / 2 + \"px\"; })\n .style(\"top\", function (d) { return d.gridRow() * context.cellHeight + context.gutter() / 2 + \"px\"; })\n .style(\"width\", function (d) { return d.gridColSpan() * context.cellWidth - context.gutter() + \"px\"; })\n .style(\"height\", function (d) { return d.gridRowSpan() * context.cellHeight - context.gutter() + \"px\"; })\n .on(\"end\", function (d) {\n d\n .surfaceShadow_default(context.surfaceShadow())\n .surfacePadding_default(context.surfacePadding())\n .surfaceBorderWidth_default(context.surfaceBorderWidth())\n .surfaceBackgroundColor_default(context.surfaceBackgroundColor())\n ;\n\n if (resize === true || resize === d.id()) {\n d\n .resize()\n .lazyRender()\n ;\n }\n })\n ;\n }\n\n update(domNode, element2) {\n super.update(domNode, element2);\n\n this._placeholderElement.style(\"overflow-x\", this.fitTo() === \"width\" ? \"hidden\" : null);\n this._placeholderElement.style(\"overflow-y\", this.fitTo() === \"width\" ? \"scroll\" : null);\n const dimensions = this.getDimensions();\n const clientWidth = this.width() - (this.fitTo() === \"width\" ? this._scrollBarWidth : 0);\n this.cellWidth = clientWidth / dimensions.width;\n this.cellHeight = this.fitTo() === \"all\" ? this.height() / dimensions.height : this.cellWidth;\n if (this.designMode()) {\n const cellLaneRatio = Math.min(this.width() / this.snappingColumns(), this.height() / this.snappingRows());\n const laneWidth = Math.floor(cellLaneRatio);\n this.cellWidth = laneWidth;\n this.cellHeight = this.cellWidth;\n }\n\n // Grid ---\n const context = this;\n const divItems = element2.selectAll(\"#\" + this.id() + \" > .ddCell\").data(this.content(), function (d) { return d.id(); });\n this.divItems = divItems.enter().append(\"div\")\n .attr(\"class\", \"ddCell\")\n .each(function (d) {\n d.target(this);\n d.__grid_watch = d.monitor(function (key, newVal, oldVal) {\n if (context._renderCount && (key === \"snapping\" || key.indexOf(\"grid\") === 0) && newVal !== oldVal) {\n if (!context.gridList) {\n // API Call (only needed when not dragging) ---\n context.initGridList();\n if (context.snapping() !== \"none\") {\n context.gridList.resizeGrid(context.snapping() === \"horizontal\" ? context.snappingRows() : context.snappingColumns());\n }\n context.items.forEach(context.gridItemToCell);\n context.updateGrid(d.id(), 100);\n context.killGridList();\n }\n }\n });\n const element = d3Select(this);\n element.append(\"div\")\n .attr(\"class\", \"resizeHandle\")\n .call(context._d3DragResize)\n .append(\"div\")\n .attr(\"class\", \"resizeHandleDisplay\")\n ;\n }).merge(divItems)\n ;\n this.divItems.each(function (d) {\n const element = d3Select(this);\n if (context.designMode()) {\n element.call(context._d3Drag);\n } else {\n element\n .on(\"mousedown.drag\", null)\n .on(\"touchstart.drag\", null)\n ;\n }\n });\n this.divItems.select(\".resizeHandle\")\n .style(\"display\", this.designMode() ? null : \"none\")\n ;\n\n this.updateGrid(true);\n divItems.exit()\n .each(function (d) {\n d.target(null);\n if (d.__grid_watch) {\n d.__grid_watch.remove();\n }\n })\n .remove()\n ;\n\n // Snapping ---\n const lanesBackground = element2.selectAll(\"#\" + this.id() + \" > .laneBackground\").data(this.designMode() ? [\"\"] : []);\n lanesBackground.enter().insert(\"div\", \":first-child\")\n .attr(\"class\", \"laneBackground\")\n .style(\"left\", \"1px\")\n .style(\"top\", \"1px\")\n .on(\"click\", function () {\n context.selectionBagClear();\n })\n .merge(lanesBackground)\n .style(\"width\", (this.snappingColumns() * this.cellWidth) + \"px\")\n .style(\"height\", (this.snappingRows() * this.cellHeight) + \"px\")\n ;\n lanesBackground.exit()\n .each(function () {\n context.selectionBagClear();\n })\n .remove()\n ;\n\n const lanes = element2.selectAll(\"#\" + this.id() + \" > .lane\").data(this.designMode() ? [\"\"] : []);\n lanes.enter().append(\"div\")\n .attr(\"class\", \"lane\")\n .style(\"left\", \"1px\")\n .style(\"top\", \"1px\")\n ;\n lanes\n .style(\"display\", this.showLanes() ? null : \"none\")\n .style(\"width\", (this.snappingColumns() * this.cellWidth) + \"px\")\n .style(\"height\", (this.snappingRows() * this.cellHeight) + \"px\")\n .style(\"background-image\", \"linear-gradient(to right, grey 1px, transparent 1px), linear-gradient(to bottom, grey 1px, transparent 1px)\")\n .style(\"background-size\", this.cellWidth + \"px \" + this.cellHeight + \"px\")\n ;\n lanes.exit()\n .remove()\n ;\n }\n\n exit(domNode, element) {\n this.content().forEach(w => w.target(null));\n super.exit(domNode, element);\n }\n\n _createSelectionObject(d) {\n return {\n _id: d._id,\n element: () => {\n return d._element;\n },\n widget: d\n };\n }\n\n selection(_) {\n if (!arguments.length) return this._selectionBag.get().map(function (d) { return d._id; });\n this._selectionBag.set(_.map(function (row) {\n return this._createSelectionObject(row);\n }, this));\n return this;\n }\n\n selectionBagClear() {\n if (!this._selectionBag.isEmpty()) {\n this._selectionBag.clear();\n this.postSelectionChange();\n }\n }\n\n selectionBagClick(d) {\n if (d !== null) {\n const selectionObj = this._createSelectionObject(d);\n if (d3Event().sourceEvent.ctrlKey) {\n if (this._selectionBag.isSelected(selectionObj)) {\n this._selectionBag.remove(selectionObj);\n this.postSelectionChange();\n } else {\n this._selectionBag.append(selectionObj);\n this.postSelectionChange();\n }\n } else {\n const selected = this._selectionBag.get();\n if (selected.length === 1 && selected[0]._id === selectionObj._id) {\n this.selectionBagClear();\n } else {\n this._selectionBag.set([selectionObj]);\n }\n this.postSelectionChange();\n }\n }\n }\n\n postSelectionChange() {\n }\n\n applyLayout(layoutArr: ICellPosition[]) {\n this.divItems.each((d, i) => {\n if (layoutArr[i]) {\n const [x, y, w, h] = layoutArr[i];\n d\n .gridCol(x)\n .gridRow(y)\n .gridColSpan(w)\n .gridRowSpan(h)\n ;\n }\n });\n this.updateGrid(true);\n }\n\n vizActivation(elem) {\n }\n}\nGrid.prototype._class += \" layout_Grid\";\n\nexport interface Grid {\n designMode(): boolean;\n designMode(_: boolean): this;\n showLanes(): boolean;\n showLanes(_: boolean): this;\n fitTo(): string;\n fitTo(_: string): this;\n\n snapping(): string;\n snapping(_: string): this;\n snappingColumns(): number;\n snappingColumns(_: number): this;\n snappingRows(): number;\n snappingRows(_: number): this;\n snappingColumns_default(): number;\n snappingColumns_default(_: number): this;\n snappingRows_default(): number;\n snappingRows_default(_: number): this;\n\n gutter(): number;\n gutter(_: number): this;\n\n surfaceShadow(): boolean;\n surfaceShadow(_: boolean): this;\n surfacePadding(): string;\n surfacePadding(_: string): this;\n surfaceBorderWidth(): number;\n surfaceBorderWidth(_: number): this;\n surfaceBackgroundColor(): string;\n surfaceBackgroundColor(_: string): this;\n\n content(): Cell[];\n content(_: Cell[]): this;\n}\n\nGrid.prototype.publish(\"designMode\", false, \"boolean\", \"Design Mode\", null, { tags: [\"Basic\"] });\nGrid.prototype.publish(\"showLanes\", true, \"boolean\", \"Show snapping lanes when in design mode\", null, { tags: [\"Basic\"], disable: w => !w.designMode() });\nGrid.prototype.publish(\"fitTo\", \"all\", \"set\", \"Sizing Strategy\", [\"all\", \"width\"], { tags: [\"Basic\"] });\nGrid.prototype.publish(\"snapping\", \"vertical\", \"set\", \"Snapping Strategy\", [\"vertical\", \"horizontal\", \"none\"]);\nGrid.prototype.publish(\"snappingColumns\", 12, \"number\", \"Snapping Columns\");\nGrid.prototype.publish(\"snappingRows\", 16, \"number\", \"Snapping Rows\");\n\nGrid.prototype.publish(\"gutter\", 6, \"number\", \"Gap Between Widgets\", null, { tags: [\"Basic\"] });\n\nGrid.prototype.publish(\"surfaceShadow\", true, \"boolean\", \"3D Shadow\");\nGrid.prototype.publish(\"surfacePadding\", null, \"string\", \"Cell Padding (px)\", null, { tags: [\"Intermediate\"] });\nGrid.prototype.publish(\"surfaceBorderWidth\", 1, \"number\", \"Width (px) of Cell Border\", null, { tags: [\"Intermediate\"] });\nGrid.prototype.publish(\"surfaceBackgroundColor\", null, \"html-color\", \"Surface Background Color\", null, { tags: [\"Advanced\"] });\n\nGrid.prototype.publish(\"content\", [], \"widgetArray\", \"widgets\", null, { tags: [\"Basic\"], render: false });\n","import { FlexGrid } from \"./FlexGrid.ts\";\n\nexport class HorizontalList extends FlexGrid {\n constructor() {\n super();\n this.orientation_default(\"horizontal\");\n this.flexWrap_default(\"nowrap\");\n }\n}\nHorizontalList.prototype._class += \" layout_HorizontalList\";\n\nexport interface HorizontalList {\n orientation_default(_: \"horizontal\" | \"vertical\");\n flexWrap_default(_: \"nowrap\" | \"wrap\" | \"wrap-reverse\");\n}\n","import { HTMLWidget, Text } from \"@hpcc-js/common\";\n\nimport \"../src/Layered.css\";\n\nexport type LayerPlacement = \"default\" | \"top\" | \"right\" | \"bottom\" | \"left\" | \"center\";\n\nexport class Layered extends HTMLWidget {\n protected _contentContainer;\n _widgetPlacements;\n _widgetRatios;\n constructor() {\n super();\n\n this._tag = \"div\";\n this._widgetPlacements = [];\n this._widgetRatios = [];\n }\n\n addLayer(widget, placement: LayerPlacement = \"default\", widthRatio: number = 1, heightRatio: number = 1) {\n const widgets = this.widgets();\n widgets.push(widget ? widget : new Text().text(\"No widget defined for layer.\"));\n this.widgets(widgets);\n this._widgetPlacements.push(placement);\n this._widgetRatios.push([widthRatio, heightRatio]);\n return this;\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this._contentContainer = element.append(\"div\")\n .attr(\"class\", \"container\")\n ;\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n const context = this;\n\n element.style(\"padding\", this.surfacePadding() + \"px\");\n\n const content = this._contentContainer.selectAll(\".content.id\" + this.id()).data(this.widgets(), function (d) { return d.id(); });\n content.enter().append(\"div\")\n .attr(\"class\", \"content id\" + this.id())\n .each(function (widget, idx) {\n widget.target(this);\n })\n .merge(content)\n .each(function (widget, idx) {\n const clientSize = {\n width: context.clientWidth(),\n height: context.clientHeight()\n };\n const widgetSize = context.widgetSize(idx, clientSize);\n const widgetPosition = context.widgetPosition(idx, clientSize, widgetSize);\n this.style.top = widgetPosition.y + \"px\";\n this.style.left = widgetPosition.x + \"px\";\n widget\n .resize(widgetSize)\n .render()\n ;\n })\n ;\n content.exit()\n .each(function (widget, idx) {\n widget\n .target(null)\n ;\n })\n .remove()\n ;\n content.order();\n }\n\n widgetSize(idx, clientSize) {\n if (this._widgetPlacements[idx] === \"default\") {\n return {\n width: clientSize.width * this._widgetRatios[idx][0],\n height: clientSize.height * this._widgetRatios[idx][1]\n };\n } else {\n return {\n width: clientSize.width * this._widgetRatios[idx][0],\n height: clientSize.height * this._widgetRatios[idx][1]\n };\n }\n }\n widgetPosition(idx, clientSize, widgetSize) {\n switch (this._widgetPlacements[idx]) {\n default:\n return {\n x: 0,\n y: 0\n };\n case \"top\":\n return {\n x: (clientSize.width / 2) - (widgetSize.width / 2),\n y: 0\n };\n case \"bottom\":\n return {\n x: (clientSize.width / 2) - (widgetSize.width / 2),\n y: clientSize.height - widgetSize.height\n };\n case \"left\":\n return {\n x: 0,\n y: (clientSize.height / 2) - (widgetSize.height / 2)\n };\n case \"right\":\n return {\n x: clientSize.width - widgetSize.width,\n y: (clientSize.height / 2) - (widgetSize.height / 2)\n };\n case \"center\":\n return {\n x: (clientSize.width / 2) - (widgetSize.width / 2),\n y: (clientSize.height / 2) - (widgetSize.height / 2)\n };\n }\n }\n}\nLayered.prototype._class += \" layout_Layered\";\n\nexport interface Layered {\n surfacePadding(): number;\n surfacePadding(_: number): this;\n widgets(): any;\n widgets(_: any): this;\n}\n\nLayered.prototype.publish(\"surfacePadding\", 0, \"number\", \"Padding\");\nLayered.prototype.publish(\"widgets\", [], \"widgetArray\", \"widgets\", null, { tags: [\"Private\"] });\n","import { HTMLWidget, Widget } from \"@hpcc-js/common\";\n\nexport class Popup extends HTMLWidget {\n _surfaceButtons;\n _originalPosition;\n\n constructor() {\n super();\n this._tag = \"div\";\n this._surfaceButtons = [];\n }\n\n updateState(visible) {\n visible = visible || !this.popupState();\n this.popupState(visible).render();\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this.widget()\n .target(domNode)\n ;\n this._originalPosition = this.position();\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n element\n .style(\"visibility\", this.popupState() ? null : \"hidden\")\n .style(\"opacity\", this.popupState() ? null : 0)\n .style(\"width\", this.shrinkWrap() ? this.widget().width() + \"px\" : this._size.width + \"px\")\n .style(\"height\", this.shrinkWrap() ? this.widget().height() + \"px\" : this._size.height + \"px\")\n ;\n if (this.widget().size().height === 0) {\n this.widget().resize(this.size());\n }\n }\n\n postUpdate(domNode, element) {\n let left;\n let top;\n switch (this.centerPopup()) {\n case \"container\":\n if (this._placeholderElement) {\n left = parseInt(this._placeholderElement.style(\"width\")) / 2 - this.widget().width() / 2;\n top = parseInt(this._placeholderElement.style(\"height\")) / 2 - this.widget().height() / 2;\n }\n this.position(\"absolute\");\n break;\n\n case \"window\":\n left = window.innerWidth / 2 - this.widget().width() / 2;\n top = window.innerHeight / 2 - this.widget().height() / 2;\n this.position(\"fixed\");\n break;\n\n default:\n left = 0;\n top = 0;\n this.position(this._originalPosition);\n break;\n }\n\n this.pos({ x: left, y: top });\n\n super.postUpdate(domNode, element);\n\n element\n .style(\"position\", this.position())\n .style(\"left\", this.left() + \"px\")\n .style(\"right\", this.right() + \"px\")\n .style(\"top\", this.top() + \"px\")\n .style(\"bottom\", this.bottom() + \"px\")\n ;\n }\n\n exit(domNode, element) {\n if (this.widget()) {\n this.widget().target(null);\n }\n super.exit(domNode, element);\n }\n\n click(obj) {\n }\n}\nPopup.prototype._class += \" layout_Popup\";\n\nexport interface Popup {\n popupState(): boolean;\n popupState(_: boolean): this;\n shrinkWrap(): boolean;\n shrinkWrap(_: boolean): this;\n centerPopup(): \"none\" | \"container\" | \"window\";\n centerPopup(_: \"none\" | \"container\" | \"window\"): this;\n top(): number;\n top(_: number): this;\n bottom(): number;\n bottom(_: number): this;\n left(): number;\n left(_: number): this;\n right(): number;\n right(_: number): this;\n position(): string;\n position(_: string): this;\n\n widget(): Widget;\n widget(_: Widget): this;\n}\n\nPopup.prototype.publish(\"popupState\", false, \"boolean\", \"State of the popup, visible (true) or hidden (false)\", null, {});\nPopup.prototype.publish(\"shrinkWrap\", false, \"boolean\", \"The popup parent container either shrinks to the size of its contents (true) or expands to fit thge popup's parentDiv (false)\", null, {});\nPopup.prototype.publish(\"centerPopup\", \"none\", \"set\", \"Center the widget in its container element (target) or in the window\", [\"none\", \"container\", \"window\"], {});\nPopup.prototype.publish(\"top\", null, \"number\", \"Top position property of popup\", null, {});\nPopup.prototype.publish(\"bottom\", null, \"number\", \"Bottom position property of popup\", null, {});\nPopup.prototype.publish(\"left\", null, \"number\", \"Left position property of popup\", null, {});\nPopup.prototype.publish(\"right\", null, \"number\", \"Right position property of popup\", null, {});\nPopup.prototype.publish(\"position\", \"relative\", \"set\", \"Value of the 'position' property\", [\"absolute\", \"relative\", \"fixed\", \"static\", \"initial\", \"inherit\"], { tags: [\"Private\"] });\n\nPopup.prototype.publish(\"widget\", null, \"widget\", \"Widget\", null, { tags: [\"Private\"] });\n","import { HTMLWidget, Text, Widget } from \"@hpcc-js/common\";\nimport { select as d3Select } from \"d3-selection\";\nimport { Surface } from \"./Surface.ts\";\n\nimport \"../src/Tabbed.css\";\n\nexport class Tabbed extends HTMLWidget {\n _tabContainer;\n _contentContainer;\n\n constructor() {\n super();\n\n this._tag = \"div\";\n }\n\n clearTabs() {\n this.labels([]);\n this.widgets([]);\n return this;\n }\n\n addTab(widget, label, isActive?, callback?) {\n const widgetSize = widget.size();\n if (widgetSize.width === 0 && widgetSize.height === 0) {\n widget.size({ width: \"100%\", height: \"100%\" });\n }\n const labels = this.labels();\n const widgets = this.widgets();\n if (isActive) {\n this.activeTabIdx(this.widgets().length);\n }\n labels.push(label);\n const surface = new Surface().widget(widget ? widget : new Text().text(\"No widget defined for tab\"));\n widgets.push(surface);\n this.labels(labels);\n this.widgets(widgets);\n if (callback) {\n callback(surface);\n }\n return this;\n }\n\n widgetSize(widgetDiv) {\n const width = this.clientWidth();\n let height = this.clientHeight();\n\n const tcBox = this._tabContainer.node().getBoundingClientRect();\n if (typeof (tcBox.height) !== \"undefined\") {\n height -= tcBox.height;\n }\n return { width, height };\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this._tabContainer = element.append(\"div\");\n this._contentContainer = element.append(\"div\");\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n const context = this;\n\n element.style(\"padding\", this.surfacePadding_exists() ? this.surfacePadding() + \"px\" : null);\n\n const tabs = this._tabContainer.selectAll(\".tab-button.id\" + this.id()).data(this.showTabs() ? this.labels() : [], function (d) { return d; });\n tabs.enter().append(\"span\")\n .attr(\"class\", \"tab-button id\" + this.id())\n .style(\"cursor\", \"pointer\")\n .on(\"click\", function (d, idx) {\n context.click(context.widgets()[idx].widget(), d, idx);\n context\n .activeTabIdx(idx)\n .render()\n ;\n }).merge(tabs)\n .classed(\"active\", function (d, idx) { return context.activeTabIdx() === idx; })\n .text(function (d) { return d; })\n ;\n tabs.exit().remove();\n\n const content = this._contentContainer.selectAll(\".tab-content.id\" + this.id()).data(this.widgets(), function (d) { return d.id(); });\n content.enter().append(\"div\")\n .attr(\"class\", \"tab-content id\" + this.id())\n .each(function (widget, idx) {\n widget.target(this);\n }).merge(content)\n .classed(\"active\", function (d, idx) { return context.activeTabIdx() === idx; })\n .style(\"display\", function (d, idx) { return context.activeTabIdx() === idx ? \"block\" : \"none\"; })\n .each(function (surface, idx) {\n surface.visible(context.activeTabIdx() === idx);\n if (context.activeTabIdx() === idx) {\n const wSize = context.widgetSize(d3Select(this));\n surface\n .surfaceBorderWidth(context.showTabs() ? null : 0)\n .surfacePadding(context.showTabs() ? null : 0)\n .resize(wSize)\n ;\n }\n })\n ;\n content.exit()\n .each(function (widget, idx) {\n widget\n .target(null)\n ;\n })\n .remove();\n\n switch (this.tabLocation()) {\n case \"bottom\":\n this._tabContainer\n .attr(\"class\", \"on_bottom\")\n .style(\"top\", (this._contentContainer.node().offsetHeight + this.surfacePadding()) + \"px\")\n .style(\"position\", \"absolute\")\n ;\n this._contentContainer\n .style(\"top\", this.surfacePadding_exists() ? this.surfacePadding() + \"px\" : null)\n .style(\"position\", \"absolute\")\n ;\n break;\n default:\n this._tabContainer\n .attr(\"class\", \"on_top\")\n .style(\"top\", null)\n .style(\"position\", \"relative\")\n ;\n this._contentContainer\n .style(\"top\", (this._tabContainer.node().offsetHeight + this.surfacePadding()) + \"px\")\n .style(\"position\", \"absolute\")\n ;\n break;\n }\n }\n\n click(widget, column, idx) {\n }\n}\nTabbed.prototype._class += \" layout_Tabbed\";\n\nexport interface Tabbed {\n showTabs(): boolean;\n showTabs(_: boolean): this;\n surfacePadding(): number;\n surfacePadding(_: number): this;\n surfacePadding_exists(): boolean;\n activeTabIdx(): number;\n activeTabIdx(_: number): this;\n\n labels(): string[];\n labels(_: string[]): this;\n tabLocation(): \"top\" | \"bottom\";\n tabLocation(_: \"top\" | \"bottom\"): this;\n widgets(): any[];\n widgets(_: any[]): this;\n}\n\nTabbed.prototype.publish(\"showTabs\", true, \"boolean\", \"Show Tabs\", null, {});\nTabbed.prototype.publish(\"surfacePadding\", 4, \"number\", \"Padding\");\nTabbed.prototype.publish(\"activeTabIdx\", 0, \"number\", \"Index of active tab\", null, {});\n\nTabbed.prototype.publish(\"labels\", [], \"array\", \"Array of tab labels sharing an index with \", null, { tags: [\"Private\"] });\nTabbed.prototype.publish(\"tabLocation\", \"top\", \"set\", \"Position the tabs at the bottom of the widget\", [\"top\", \"bottom\"], { tags: [\"Private\"] });\nTabbed.prototype.publish(\"widgets\", [], \"widgetArray\", \"widgets\", null, { tags: [\"Private\"] });\n","import { HTMLWidget, Widget } from \"@hpcc-js/common\";\nimport { select as d3Select } from \"d3-selection\";\n\nimport \"../src/Toolbar.css\";\n\nexport class Toolbar extends HTMLWidget {\n\n constructor() {\n super();\n this._tag = \"div\";\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n const context = this;\n\n element\n .attr(\"title\", context.title())\n .style(\"background-color\", this.backgroundColor())\n ;\n\n const title = element.selectAll(\"div.toolbar-title\")\n .data(this.title() ? [this.title()] : []);\n title.enter().append(\"div\")\n .classed(\"toolbar-title\", true)\n .append(\"span\")\n ;\n title.selectAll(\"div.toolbar-title > span\")\n .style(\"font-size\", this.fontSize_exists() ? this.fontSize() + \"px\" : null)\n .style(\"color\", this.fontColor_exists() ? this.fontColor() : null)\n .style(\"font-family\", this.fontFamily_exists() ? this.fontFamily() : null)\n .style(\"font-weight\", this.fontBold_exists() ? (this.fontBold() ? \"bold\" : \"normal\") : null)\n .style(\"background-color\", this.backgroundColor_exists() ? this.backgroundColor() : null)\n .text(context.title())\n ;\n title.exit().remove();\n\n const childWidgets = element.selectAll(\"div.toolbar-child\")\n .data(this.widgets() !== null ? this.widgets() : [], function (d) { return d.id(); });\n\n childWidgets.enter().insert(\"div\", \"div.toolbar-title\")\n .each(function (d, i) {\n const widgetClass = context.widgetClasses()[i] ? context.widgetClasses()[i] + \" toolbar-child\" : \"toolbar-child\";\n d3Select(this).classed(widgetClass, true);\n d.target(this);\n });\n childWidgets.exit().each(function (d) {\n d.target(null);\n }).remove();\n childWidgets.order();\n }\n\n render(callback?: (w: Widget) => void): this {\n const context = this;\n return super.render(function (w) {\n const toolbarBBox = context.element().node().getBoundingClientRect();\n let minX = toolbarBBox.left + toolbarBBox.width;\n context.element().selectAll(\"div.toolbar-child\")\n .each(function (d, i) {\n const childBBox = this.getBoundingClientRect();\n if (minX > childBBox.left)\n minX = childBBox.left;\n })\n ;\n context.element().select(\".toolbar-title\")\n .style(\"width\", (minX - toolbarBBox.left - 4) + \"px\")\n ;\n if (callback) {\n callback(w);\n }\n });\n }\n\n exit(domNode, element) {\n this.widgets().forEach(function (w) {\n w.target(null);\n });\n super.exit(domNode, element);\n }\n}\nToolbar.prototype._class += \" layout_Toolbar\";\n\nexport interface Toolbar {\n title(): string;\n title(_: string): this;\n\n fontSize(): number;\n fontSize(_: number): this;\n fontSize_exists(): boolean;\n fontColor(): string;\n fontColor(_: string): this;\n fontColor_exists(): boolean;\n fontFamily(): string;\n fontFamily(_: string): this;\n fontFamily_exists(): boolean;\n fontBold(): boolean;\n fontBold(_: boolean): this;\n fontBold_exists(): boolean;\n backgroundColor(): string;\n backgroundColor(_: string): this;\n backgroundColor_exists(): boolean;\n\n responsive(): boolean;\n responsive(_: boolean): this;\n\n widgets(): any[];\n widgets(_: any[]): this;\n widgetClasses(): string[];\n widgetClasses(_: string[]): this;\n}\n\nToolbar.prototype.publish(\"title\", \"\", \"string\", \"Title\", null, { tags: [\"Intermediate\"] });\n\nToolbar.prototype.publish(\"fontSize\", null, \"number\", \"Title Font Size (px)\", null, { tags: [\"Advanced\"], optional: true });\nToolbar.prototype.publish(\"fontColor\", null, \"html-color\", \"Title Font Color\", null, { tags: [\"Advanced\"], optional: true });\nToolbar.prototype.publish(\"fontFamily\", null, \"string\", \"Title Font Family\", null, { tags: [\"Advanced\"], optional: true });\nToolbar.prototype.publish(\"fontBold\", true, \"boolean\", \"Enable Bold Title Font\", null, { tags: [\"Advanced\"], optional: true });\nToolbar.prototype.publish(\"backgroundColor\", null, \"html-color\", \"Background Color\", null, { tags: [\"Intermediate\"], optional: true });\n\nToolbar.prototype.publish(\"responsive\", true, \"boolean\", \"Adapts to pixel width\", null, { tags: [\"Basic\"] });\n\nToolbar.prototype.publish(\"widgets\", [], \"widgetArray\", \"Child widgets of the toolbar\", null, { tags: [\"Basic\"] });\nToolbar.prototype.publish(\"widgetClasses\", [], \"array\", \"Array of Html Element classes to be assigned to the child widgets (shares index with widgets param)\", null, { tags: [\"Basic\"] });\n","import { FlexGrid } from \"./FlexGrid.ts\";\n\nexport class VerticalList extends FlexGrid {\n constructor() {\n super();\n this.orientation_default(\"vertical\");\n this.flexWrap_default(\"nowrap\");\n }\n}\nVerticalList.prototype._class += \" layout_VerticalList\";\n\nexport interface VerticalList {\n orientation_default(_: \"horizontal\" | \"vertical\");\n flexWrap_default(_: \"nowrap\" | \"wrap\" | \"wrap-reverse\");\n}\n"],"names":["PKG_NAME","PKG_VERSION","BUILD_VERSION","_AbsoluteSurface","HTMLWidget","constructor","super","this","_tag","enter","domNode","element","update","xPos","yPos","width","clientWidth","height","clientHeight","units","widgetX","widgetY","widgetWidth","Number","widgetHeight","style","opacity","widgets","selectAll","_id","data","widget","d","append","attr","each","target","merge","resize","exit","remove","__name","AbsoluteSurface","prototype","_class","publish","tags","_Accordion","_isClosed","titleSpan","iconDiv","ul","icon","pushListItem","prepend","protect","contentArr","content","_protected","unshift","push","clearListItems","arr","i","collapseClick","classed","context","defaultCollapsed","FAChar","size","node","on","render","text","title","length","rows","li","document","createElement","_target","wSize","cSize","text_colorFill","titleFontColor","char","closedIcon","openIcon","Accordion","_Surface","_surfaceButtons","widgetSize","titleDiv","widgetDiv","calcHeight","calcFrameHeight","calcFrameWidth","element2","surfaceShadow","surfaceBorderWidth_exists","surfaceBorderWidth","surfaceBorderColor","surfaceBorderRadius_exists","surfaceBorderRadius","surfaceBackgroundColor","titles","insert","surfaceTitleAlignment","surfaceTitleFontColor","surfaceTitleFontSize_exists","surfaceTitleFontSize","surfaceTitleFontFamily","surfaceTitleFontBold","surfaceTitleBackgroundColor","surfaceTitlePadding_exists","surfaceTitlePadding","altText_exists","altText","surfaceButtons","select","buttonAnnotations","button","idx","el","d3Select","class","id","padding","font","click","label","_d","parentElement","classID","split","surfacePadding_exists","surfacePadding","obj","Surface","optional","disable","w","_Cell","_indicateTheseIds","indicateTheseIds","_","arguments","onMouseEnter","onMouseLeave","indicatorOpacity","indicatorBorderColor","indicatorGlowColor","otherElement","otherWidget","datum","d3SelectAll","Cell","_Border","_colCount","_rowCount","_colSize","_rowSize","_shrinkWrapBoxes","_watch","_offsetX","_offsetY","_dragCell","_dragCellSize","_dragCellStartSize","_handleTop","_handleLeft","_dragPrevX","_dragPrevY","_cellSizes","contentDiv","_scrollBarWidth","_borderHandles","_sectionTypeArr","sectionTypes","watchWidget","monitor","paramId","newVal","oldVal","lazyPostUpdate","Utility","debounce","postUpdate","applyLayoutType","layoutObj","borderLayoutObject","forEach","cell","_fixedLeft","left","_fixedTop","top","_fixedWidth","_fixedHeight","_dragHandles","cellSpecificDragHandles","sectionType","layoutType","retObj","topSize","topPerc","bottomSize","bottomPerc","leftSize","leftPerc","rightSize","rightPerc","bcRect","getBoundingClientRect","bottom","right","SVGElement","parseFloat","getAttribute","indexOf","topPercentage","gutter","bottomPercentage","leftPercentage","rightPercentage","t","_sectionPlacementObject","px","b","l","r","c","clearContent","splice","contentWidget","hasContent","setContent","getCell","getContent","setLayoutOffsets","_element","dragStart","handle","event","d3Event","sourceEvent","stopPropagation","handleElm","clientX","clientY","dragTick","xDelta","yDelta","_moveHandles","handle2","delta","handles","grabbedHandle","topHeight","leftHeight","bottomHeight","rightHeight","rightWidth","leftWidth","handle3","dragEnd","getBBox","retVal","apply","_size","Platform","getScrollbarWidth","designMode","rowsUpdate","drag","d3Drag","call","_placeholderElement","getCellSizes","contentRect","rect","n","prevBox","currBox","lazyRender","Border","_WidgetDiv","_div","_overlay","_overflowX","_overflowY","_widget","div","overlay","overflowX","overflowY","availableHeight","availableWidth","renderPromise","then","visible","x","y","Promise","resolve","WidgetDiv","_Border2","_bodyElement","_topWA","_leftWA","_centerWA","_rightWA","_bottomWA","_topPrevOverflow","_leftPrevOverflow","_rightPrevOverflow","_bottomPrevOverflow","topElement","centerElement","leftElement","rightElement","bottomElement","showTop","showRight","showBottom","showLeft","topOverflowX","rightOverflowX","bottomOverflowX","leftOverflowX","topOverflowY","rightOverflowY","bottomOverflowY","leftOverflowY","targetNull","center","swap","sectionA","sectionB","a","callback","topOverlay","async","topBBox","bottomBBox","leftBBox","rightBBox","bottomHeight_exists","bodyWidth","bodyHeight","centerOverflowX","centerOverflowY","scrollCenterX","scrollCenterY","promises","all","Border2","_Carousel","_prevActive","_root","activeWidget","active","widgetElements","transition","duration","transitionDuration","isDOMHidden","aw","w2","Carousel","pi","Math","PI","tau","epsilon","tauEpsilon","Path","_x0","_y0","_x1","_y1","path","constant","moveTo","closePath","lineTo","quadraticCurveTo","x1","y1","bezierCurveTo","x2","y2","arcTo","x0","y0","x21","y21","x01","y01","l01_2","Error","abs","x20","y20","l21_2","l20_2","l21","sqrt","l01","tan","acos","t01","t21","arc","a0","a1","ccw","dx","cos","dy","sin","cw","da","h","toString","d3SymbolCircle","draw","d3SymbolCross","tan30","tan30_2","d3SymbolDiamond","kr","kx","ky","d3SymbolStar","s","d3SymbolSquare","sqrt3","d3SymbolTriangle","k","d3SymbolWye","d3Symbol","type","circle","symbol","buffer","_typeof","Symbol","iterator","d3_identity","d3_reverse","mirror","d3_textWrapping","word","words","reverse","line","tspan","pop","join","getComputedTextLength","d3_mergeLabels","gen","labels","domain","range","labelDelimiter","customLabels","genLength","_i","generatedLabels","d3_linearLegend","scale","cells","labelFormat","increment","map","feature","d3_quantLegend","invert","invertExtent","d3_ordinalLegend","d3_cellOver","cellDispatcher","d3_cellOut","d3_cellClick","helper","d3_drawShapes","shape","shapes","shapeHeight","shapeWidth","shapeRadius","d3_addText","svg","classPrefix","labelWidth","d3_calcType","ascending","ticks","d3_filterCells","cellFilter","filterCells","filter","dataValues","labelValues","d3_placement","orient","cellTrans","textTrans","labelAlign","d3_addEvents","dispatcher","d3_title","titleWidth","cellsSvg","yOffset","nodes","xOffset","d3_defaultLocale","format","formatPrefix","d3_defaultFormatSpecifier","d3_defaultDelimiter","color","scaleLinear","shapePadding","useClass","locale","specifier","labelOffset","labelWrap","legendDispatcher","dispatch","legend","cellEnter","textSize","shapeSize","cellSize","textAlign","max","sum","slice","formatLocale","formatSpecifier","toLowerCase","textWrap","value","_Legend","SVGWidget","_owner","_targetWidget","_targetWidgetMonitor","_legendOrdinal","_disabled","_symbolTypeMap","cross","diamond","square","star","triangle","wye","owner","_drawStartPos","d3LegendColor","onClick","onOver","onOut","isDisabled","Database","Field","filteredFields","dataFamily","fields","filteredColumns","columns","filteredData","row","disabledCols","anyDisabled","col","disabled","isRainbow","getWidget","_palette","targetWidget","key","newProp","oldProp","source","chart","getPalette","Palette","ordinal","rainbow","getPaletteType","fillColorFunc","fillColor","paletteID","name","switch","sel","palette","_g","calcMetaData","dataArr","total","maxLabelWidth","colLength","val","reduce","acc","showSeriesTotal","d3Format","rainbowFormat","steps","rainbowBins","weightMin","_dataMinWeight","weightMax","_dataMaxWeight","stepWeightDiff","mid","floor","parseInt","radius","radiusToSymbolSize","itemPadding","orientation","d3ScaleOrdinal","symbolType","labelMaxWidth","updateDisabled","legendCellsBbox","offsetX","offsetY","_containerSize","pos","legendTotal","showLegendTotal","totalText","totalOffsetX","totalOffsetY","enableOverflowScroll","enableOverflow","_boundingBox","_parentRelativeDiv","circleSize","pow","disabledIdx","refreshColumns","refreshData","instanceOfIHighlight","highlightColumn","onDblClick","rowData","rowIdx","onMouseOver","fitToContent","bbox","Legend","_Modal","_relativeTarget","_fade","_modal","_modalHeader","_modalBody","_modalHeaderAnnotations","_modalHeaderCloseButton","_close","closeModal","getRelativeTarget","relativeTarget","relativeTargetId","getElementById","locateAncestor","body","setModalSize","fixedHeight","fixedWidth","minHeight","minWidth","maxHeight","maxWidth","modalRect","headerRect","setFadePosition","setModalPosition","fixedTop","fixedLeft","resizeBodySync","enableClickFadeToClose","showFade","header_h","titleFontSize","formattedTitle","html","show","title_exists","trim","Modal","_ChartPanel","_legend","_progressBar","ProgressBar","_autoScale","_resolutions","tiny","small","_highlight","_scale","_orig_size","_toggleInfo","ToggleButton","faChar","tooltip","selected","description","Text","origCloseFunc","_toggleData","dataVisible","_buttonDownload","Button","downloadCSV","_buttonDownloadImage","downloadPNG","_toggleLegend","legendPosition","legendVisible","_spacer","Spacer","_titleBar","TitleBar","buttons","_carousel","_table","Table","_hideLegendToggleList","refreshFields","asDefault","highlight","startProgress","start","finishProgress","finish","namePrefix","downloadTitle","nameSuffix","downloadTimestampSuffix","timestamp","downloadString","export","column","cssTag","getResponsiveMode","enableAutoscaling","setOrigSize","JSON","parse","stringify","preUpdateTiny","preUpdateSmall","scale_x","scale_y","min","x_is_smaller","preUpdateRegular","_prevdataVisible","_prevlegendVisible","_prevLegendPosition","_prevChartDataFamily","_prevChart","_prevButtons","preUpdate","_dataFamily","highlightSize","highlightColor","widgetIconBar","IconBar","hiddenButtons","dataButtonVisible","downloadButtonVisible","downloadImageButtonVisible","legendButtonVisible","enabled","titleVisible","titleOverlay","postUpdateTiny","postUpdateSmall","postUpdateRegular","titleIconFontSize","_node","containerRect","icon_top","parentRect","_prevPos","dblclick","vertex_click","more","vertex","vertex_dblclick","edge_click","edge","edge_dblclick","ChartPanel","publishReset","publishProxy","tmpAny","_FlexGrid","parentNode","cachedSizes","updateFlexParent","listItems","itemMinHeight","itemMinWidth","flexBasis","widgetsFlexBasis","flexGrow","widgetsFlexGrow","borderWidth","itemBorderColor","firstChild","display","flexWrap","alignItems","alignContent","forceXScroll","disableScroll","forceYScroll","FlexGrid","exports","GridList","items","options","_options","defaults","hasOwnProperty","_adjustSizeOfItems","generateGrid","cloneItems","_items","lanes","direction","item","j","widthOfGrid","grid","output","border","_padNumber","_resetGrid","_markItemPositionToGrid","resizeGrid","currentColumn","_sortItemsByPosition","position","_getItemPosition","_updateItemPosition","findPositionForItem","_pullItemsToLeft","fixedRow","_itemFitsAtPosition","newCol","newRow","moveItemToPosition","newPosition","_resolveCollisions","resizeItem","_updateItemSize","getChangedItems","initialItems","idAttribute","changedItems","_getItemByAttribute","sort","item1","item2","position1","position2","bind","autoSize","_deleteItemPositionFromGrid","_setItemPosition","_ensureColumns","N","GridCol","_getItemsCollidingWithItem","collidingItems","_itemsAreColliding","_tryToResolveCollisionsLocally","leftOfItem","rightOfItem","aboveOfItem","belowOfItem","_gridList","collidingItem","collidingPosition","fixedItem","fixedPosition","_findLeftMostPositionForItem","tail","otherItem","otherPosition","nr","prefix","factory","_GridList","_GridList.default","_Grid","divItems","gridList","itemsMap","origItems","cellWidth","cellHeight","dragItem","dragItemPos","_d3Drag","_d3DragResize","_selectionBag","Selection","getDimensions","gridCol","gridColSpan","gridRow","gridRowSpan","rowSpan","colSpan","sortedContent","some","getWidgetCell","cellToGridItem","gridItemToCell","resetItemsPos","origItem","initGridList","snapping","snappingRows","snappingColumns","killGridList","subject","selectionBagClick","updateGrid","round","_noRender","surfaceShadow_default","surfacePadding_default","surfaceBorderWidth_default","surfaceBackgroundColor_default","fitTo","dimensions","cellLaneRatio","laneWidth","__grid_watch","_renderCount","lanesBackground","selectionBagClear","showLanes","_createSelectionObject","selection","set","get","isEmpty","clear","postSelectionChange","selectionObj","ctrlKey","isSelected","applyLayout","layoutArr","vizActivation","elem","Grid","_HorizontalList","orientation_default","flexWrap_default","HorizontalList","_Layered","_contentContainer","_widgetPlacements","_widgetRatios","addLayer","placement","widthRatio","heightRatio","clientSize","widgetPosition","order","Layered","_Popup","_originalPosition","updateState","popupState","shrinkWrap","centerPopup","window","innerWidth","innerHeight","Popup","_Tabbed","_tabContainer","clearTabs","addTab","isActive","activeTabIdx","surface","tcBox","tabs","showTabs","tabLocation","offsetHeight","Tabbed","_Toolbar","backgroundColor","fontSize_exists","fontSize","fontColor_exists","fontColor","fontFamily_exists","fontFamily","fontBold_exists","fontBold","backgroundColor_exists","childWidgets","widgetClass","widgetClasses","toolbarBBox","minX","childBBox","Toolbar","_VerticalList","VerticalList"],"mappings":"y7BAAO,MAAMA,EAAW,kBACXC,EAAc,QACdC,EAAgB,SCEhBC,EAAN,MAAMA,yBAAwBC,EACjC,WAAAC,GACIC,QAEAC,KAAKC,KAAO,KAChB,CAEA,KAAAC,CAAMC,EAASC,GACXL,MAAMG,MAAMC,EAASC,EACzB,CAEA,MAAAC,CAAOF,EAASC,GACZL,MAAMM,OAAOF,EAASC,GAEtB,IAAIE,EAAO,EACPC,EAAO,EACPC,EAAQR,KAAKS,cACbC,EAASV,KAAKW,eAClB,OAAQX,KAAKY,SACT,IAAK,SACDN,EAAON,KAAKa,UACZN,EAAOP,KAAKc,UACZN,EAA+B,KAAvBR,KAAKe,cAAuBP,EAAQF,EAAOU,OAAOhB,KAAKe,eAC/DL,EAAiC,KAAxBV,KAAKiB,eAAwBP,EAASH,EAAOS,OAAOhB,KAAKiB,gBAClE,MACJ,IAAK,UACDX,EAAON,KAAKa,UAAYL,EAAQ,IAChCD,EAAOP,KAAKc,UAAYJ,EAAS,IACjCF,EAA+B,KAAvBR,KAAKe,cAAuBP,EAAQF,EAAOU,OAAOhB,KAAKe,eAAiBP,EAAQ,IACxFE,EAAiC,KAAxBV,KAAKiB,eAAwBP,EAASH,EAAOS,OAAOhB,KAAKiB,gBAAkBP,EAAS,IAGrGN,EAAQc,MAAM,UAAWlB,KAAKmB,WAE9B,MAAMC,EAAUhB,EAAQiB,UAAU,IAAMrB,KAAKsB,IAAM,mBAAmBC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