@hpcc-js/layout 3.2.1 → 3.2.3
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 +240 -259
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +4 -4
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +8 -8
- package/src/ChartPanel.ts +1 -21
- package/types/ChartPanel.d.ts +1 -1
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 = \"@hpcc-js/layout\";\nexport const PKG_VERSION = \"3.1.1\";\nexport const BUILD_VERSION = \"3.2.1\";\n","import { HTMLWidget } from \"@hpcc-js/common\";\n\nimport \"../src/AbsoluteSurface.css\";\n\nexport class AbsoluteSurface extends HTMLWidget {\n constructor() {\n super();\n\n this._tag = \"div\";\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n\n let xPos = 0;\n let yPos = 0;\n let width = this.clientWidth();\n let height = this.clientHeight();\n switch (this.units()) {\n case \"pixels\":\n xPos = this.widgetX();\n yPos = this.widgetY();\n width = this.widgetWidth() === \"\" ? width - xPos : Number(this.widgetWidth());\n height = this.widgetHeight() === \"\" ? height - yPos : Number(this.widgetHeight());\n break;\n case \"percent\":\n xPos = this.widgetX() * width / 100;\n yPos = this.widgetY() * height / 100;\n width = this.widgetWidth() === \"\" ? width - xPos : Number(this.widgetWidth()) * width / 100;\n height = this.widgetHeight() === \"\" ? height - yPos : Number(this.widgetHeight()) * height / 100;\n break;\n }\n element.style(\"opacity\", this.opacity());\n\n const widgets = element.selectAll(\"#\" + this._id + \" > .placeholder\").data(this.widget() ? [this.widget()] : [], function (d) { return d._id; });\n widgets.enter().append(\"div\")\n .attr(\"class\", \"placeholder\")\n .each(function (d) {\n d.target(this);\n })\n .merge(widgets)\n .style(\"left\", xPos + \"px\")\n .style(\"top\", yPos + \"px\")\n .style(\"width\", width + \"px\")\n .style(\"bottom\", height + \"px\")\n .each(function (d) {\n d\n .resize({ width, height })\n ;\n })\n ;\n widgets.exit().each(function (d) {\n d.target(null);\n }).remove();\n }\n\n exit(domNode, element) {\n if (this.widget()) {\n this.widget().target(null);\n }\n super.exit(domNode, element);\n }\n}\nAbsoluteSurface.prototype._class += \" layout_AbsoluteSurface\";\n\nexport interface AbsoluteSurface {\n units(): string;\n units(_: string): this;\n widgetX(): number;\n widgetX(_: number): this;\n widgetY(): number;\n widgetY(_: number): this;\n widgetWidth(): string;\n widgetWidth(_: string): this;\n widgetHeight(): string;\n widgetHeight(_: string): this;\n widget(): any;\n widget(_: any): this;\n opacity(): number;\n opacity(_: number): this;\n}\n\nAbsoluteSurface.prototype.publish(\"units\", \"percent\", \"set\", \"Units\", [\"pixels\", \"percent\"]);\nAbsoluteSurface.prototype.publish(\"widgetX\", 0, \"number\", \"Widget XPos\");\nAbsoluteSurface.prototype.publish(\"widgetY\", 0, \"number\", \"Widget YPos\");\nAbsoluteSurface.prototype.publish(\"widgetWidth\", \"100\", \"string\", \"Widget Width, omit for full\");\nAbsoluteSurface.prototype.publish(\"widgetHeight\", \"100\", \"string\", \"Widget Height, omit for full\");\nAbsoluteSurface.prototype.publish(\"widget\", null, \"widget\", \"Widget\", null, { tags: [\"Private\"] });\nAbsoluteSurface.prototype.publish(\"opacity\", 1, \"number\", \"Opacity\");\n","import { FAChar, HTMLWidget } from \"@hpcc-js/common\";\n\nimport \"../src/Accordion.css\";\n\nexport class Accordion extends HTMLWidget {\n protected _isClosed: boolean;\n titleSpan;\n iconDiv;\n ul;\n icon;\n\n constructor() {\n super();\n\n this._tag = \"div\";\n this._isClosed = false;\n }\n\n pushListItem(widget, prepend: boolean = false, protect: boolean = false) {\n const contentArr = this.content();\n\n widget._protected = protect;\n\n if (prepend) {\n contentArr.unshift(widget);\n } else {\n contentArr.push(widget);\n }\n this.content(contentArr);\n return this;\n }\n\n clearListItems() {\n const arr = [];\n for (const i in this.content()) {\n if (this.content()[i]._protected) {\n arr.push(this.content()[i]);\n }\n }\n this.content(arr);\n return this;\n }\n\n collapseClick(element) {\n if (element.classed(\"closed\")) {\n this._isClosed = false;\n element.classed(\"open\", true);\n element.classed(\"closed\", false);\n } else {\n this._isClosed = true;\n element.classed(\"open\", false);\n element.classed(\"closed\", true);\n }\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n const context = this;\n this._isClosed = this.defaultCollapsed();\n element.classed(this._isClosed ? \"closed\" : \"open\", true);\n\n this.titleSpan = element.append(\"span\").classed(\"collapsible-title\", true);\n this.iconDiv = element.append(\"div\").classed(\"collapsible-icon\", true);\n this.ul = element.append(\"ul\");\n\n this.icon = new FAChar()\n .size({ height: 24, width: 24 })\n .target(this.iconDiv.node());\n\n this.iconDiv.on(\"click\", function () {\n context.collapseClick(element);\n context.render();\n });\n this.titleSpan.on(\"click\", function () {\n context.collapseClick(element);\n context.render();\n });\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n const context = this;\n const this_id = \"\";\n this.titleSpan.text(context.title().length > 0 ? context.title() + this_id : \"Accordion [\" + context._id + \"]\" + this_id);\n const rows = this.ul.selectAll(\"#\" + context._id + \" > ul > li\").data(this.content(), function (d) {\n return d._id;\n });\n rows.enter()\n .append(function (widget) {\n const li = document.createElement(\"li\");\n if (widget._target === null) {\n const wSize = widget.size();\n if (wSize.width === 0 || wSize.height === 0) {\n const cSize = context.size();\n widget.size({\n width: cSize.width,\n height: cSize.width\n });\n }\n widget.target(li);\n } else {\n return widget._target;\n }\n return li;\n })\n ;\n rows.exit().remove();\n\n this.icon\n .text_colorFill(this.titleFontColor())\n .char(this._isClosed ? this.closedIcon() : this.openIcon()).render()\n ;\n }\n\n exit(domNode, element) {\n super.exit(domNode, element);\n }\n}\nAccordion.prototype._class += \" layout_Accordion\";\n\nexport interface Accordion {\n content(): any[];\n content(_: any[]): this;\n title(): string;\n title(_: string): this;\n openIcon(): string;\n openIcon(_: string): this;\n closedIcon(): string;\n closedIcon(_: string): this;\n titleFontColor(): string;\n titleFontColor(_: string): this;\n titleBackgroundColor(): string;\n titleBackgroundColor(_: string): this;\n\n defaultCollapsed(): boolean;\n defaultCollapsed(_: boolean): this;\n}\n\nAccordion.prototype.publish(\"content\", [], \"widgetArray\", \"Array of widgets\", null, { tags: [\"Basic\"] });\nAccordion.prototype.publish(\"title\", \"\", \"string\", \"Title of collapsible section\", null, { tags: [\"Private\"] });\nAccordion.prototype.publish(\"openIcon\", \"\\uf147\", \"string\", \"Icon to display when list is open\", null, { tags: [\"Private\"] });\nAccordion.prototype.publish(\"closedIcon\", \"\\uf196\", \"string\", \"Icon to display when list is closed\", null, { tags: [\"Private\"] });\nAccordion.prototype.publish(\"titleFontColor\", \"#FFFFFF\", \"html-color\", \"Title font color\", null, { tags: [\"Private\"] });\nAccordion.prototype.publish(\"titleBackgroundColor\", \"#333333\", \"html-color\", \"Title background color\", null, { tags: [\"Private\"] });\n\nAccordion.prototype.publish(\"defaultCollapsed\", false, \"boolean\", \"Collapsed by default if true\", null, { tags: [\"Private\"] });\n","import { HTMLWidget, Widget } from \"@hpcc-js/common\";\nimport { select as d3Select } from \"d3-selection\";\n\nimport \"../src/Surface.css\";\n\nexport class Surface extends HTMLWidget {\n _surfaceButtons;\n\n constructor() {\n super();\n\n this._tag = \"div\";\n this._surfaceButtons = [];\n }\n\n widgetSize(titleDiv, widgetDiv) {\n let width = this.clientWidth();\n let height = this.clientHeight();\n if (this.title()) {\n height -= this.calcHeight(titleDiv);\n }\n height -= this.calcFrameHeight(widgetDiv);\n width -= this.calcFrameWidth(widgetDiv);\n return { width, height };\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n }\n\n update(domNode, element2) {\n super.update(domNode, element2);\n const context = this;\n\n element2\n .classed(\"shadow2\", this.surfaceShadow())\n .style(\"border-width\", this.surfaceBorderWidth_exists() ? this.surfaceBorderWidth() + \"px\" : null)\n .style(\"border-color\", this.surfaceBorderColor())\n .style(\"border-radius\", this.surfaceBorderRadius_exists() ? this.surfaceBorderRadius() + \"px\" : null)\n .style(\"background-color\", this.surfaceBackgroundColor())\n ;\n\n const titles = element2.selectAll(\".surfaceTitle\").data(this.title() ? [this.title()] : []);\n titles.enter().insert(\"h3\", \"div\")\n .attr(\"class\", \"surfaceTitle\")\n .merge(titles)\n .text(function (d) { return d; })\n .style(\"text-align\", this.surfaceTitleAlignment())\n .style(\"color\", this.surfaceTitleFontColor())\n .style(\"font-size\", this.surfaceTitleFontSize_exists() ? this.surfaceTitleFontSize() + \"px\" : null)\n .style(\"font-family\", this.surfaceTitleFontFamily())\n .style(\"font-weight\", this.surfaceTitleFontBold() ? \"bold\" : \"normal\")\n .style(\"background-color\", this.surfaceTitleBackgroundColor())\n .style(\"padding\", this.surfaceTitlePadding_exists() ? this.surfaceTitlePadding() + \"px\" : null)\n .style(\"title\", this.altText_exists() ? this.altText() : null)\n ;\n titles.exit().remove();\n\n const surfaceTitle = element2.select(\".surfaceTitle\");\n\n const surfaceButtons = surfaceTitle.append(\"div\").attr(\"class\", \"html-button-container\").selectAll(\".surface-button\").data(this.buttonAnnotations());\n surfaceButtons.enter().append(\"button\").classed(\"surface-button\", true)\n .each(function (button, idx) {\n const el = context._surfaceButtons[idx] = d3Select(this)\n .attr(\"class\", \"surface-button\" + (button.class ? \" \" + button.class : \"\"))\n .attr(\"id\", button.id)\n .style(\"padding\", button.padding)\n .style(\"width\", button.width)\n .style(\"height\", button.height)\n .style(\"cursor\", \"pointer\");\n if (button.font === \"FontAwesome\") {\n el\n .style(\"background\", \"transparent\")\n .style(\"border\", \"none\")\n .on(\"click\", function (d) { context.click(d); })\n .append(\"i\")\n .attr(\"class\", \"fa\")\n .text(function () { return button.label; });\n } else {\n el\n .text(function () { return button.label; })\n .on(\"click\", function (d) { context.click(d); });\n }\n })\n ;\n surfaceButtons.exit()\n .each(function (_d, idx) {\n const element = d3Select(this);\n delete context._surfaceButtons[idx];\n element.remove();\n })\n ;\n const widgets = element2.selectAll(\"#\" + this._id + \" > .surfaceWidget\").data(this.widget() ? [this.widget()] : [], function (d) { return d._id; });\n\n widgets.enter().append(\"div\")\n .attr(\"class\", \"surfaceWidget\")\n .each(function (d) {\n d3Select(context.element().node().parentElement).classed(\"content-icon content-icon-\" + (d.classID().split(\"_\")[1]), true);\n d.target(this);\n })\n .merge(widgets)\n .style(\"padding\", this.surfacePadding_exists() ? this.surfacePadding() + \"px\" : null)\n .each(function (d) {\n const widgetSize = context.widgetSize(element2.select(\"h3\"), d3Select(this));\n if (widgetSize.width < 0) widgetSize.width = 0;\n if (widgetSize.height < 0) widgetSize.height = 0;\n d\n .resize({ width: widgetSize.width, height: widgetSize.height })\n ;\n })\n ;\n widgets.exit().each(function (d) {\n d.target(null);\n }).remove();\n }\n\n exit(domNode, element) {\n if (this.widget()) {\n this.widget().target(null);\n }\n super.exit(domNode, element);\n }\n\n // Events ---\n click(obj) {\n }\n}\nSurface.prototype._class += \" layout_Surface\";\n\nexport interface Surface {\n /* \n title: { (): string; (_: string): Surface; };\n altText: { (): string; (_: string): Surface; };\n altText_exists: () => boolean;\n surfaceTitlePadding: { (): number; (_: number): Surface; };\n surfaceTitlePadding_exists: () => boolean;\n surfaceTitleFontSize: { (): number; (_: number): Surface; };\n surfaceTitleFontSize_exists: () => boolean;\n surfaceTitleFontColor: { (): string; (_: string): Surface; };\n surfaceTitleFontFamily: { (): string; (_: string): Surface; };\n surfaceTitleFontBold: { (): boolean; (_: boolean): Surface; };\n surfaceTitleBackgroundColor: { (): string; (_: string): Surface; };\n surfaceTitleAlignment: { (): string; (_: string): Surface; };\n\n surfaceShadow: { (): boolean; (_: boolean): Surface; };\n surfacePadding: { (): string; (_: string): Surface; };\n surfacePadding_exists: () => boolean;\n surfaceBackgroundColor: { (): string; (_: string): Surface; };\n surfaceBorderWidth: { (): number; (_: number): Surface; };\n surfaceBorderWidth_exists: () => boolean;\n surfaceBorderColor: { (): string; (_: string): Surface; };\n surfaceBorderRadius: { (): number; (_: number): Surface; };\n surfaceBorderRadius_exists: () => boolean;\n\n buttonAnnotations: { (): any[]; (_: any[]): Surface; };\n\n widget: { (): Widget; (_: Widget): Surface; };\n */\n title(): string;\n title(_: string): this;\n altText(): string;\n altText(_: string): this;\n altText_exists(): boolean;\n surfaceTitlePadding(): number;\n surfaceTitlePadding(_: number): this;\n surfaceTitlePadding_exists(): boolean;\n surfaceTitleFontSize(): number;\n surfaceTitleFontSize(_: number): this;\n surfaceTitleFontSize_exists(): boolean;\n surfaceTitleFontColor(): string;\n surfaceTitleFontColor(_: string): this;\n surfaceTitleFontFamily(): string;\n surfaceTitleFontFamily(_: string): this;\n surfaceTitleFontBold(): boolean;\n surfaceTitleFontBold(_: boolean): this;\n surfaceTitleBackgroundColor(): string;\n surfaceTitleBackgroundColor(_: string): this;\n surfaceTitleAlignment(): string;\n surfaceTitleAlignment(_: string): this;\n\n surfaceShadow(): boolean;\n surfaceShadow(_: boolean): this;\n surfacePadding(): string;\n surfacePadding(_: string): this;\n surfacePadding_exists(): boolean;\n surfaceBackgroundColor(): string;\n surfaceBackgroundColor(_: string): this;\n surfaceBorderWidth(): number;\n surfaceBorderWidth(_: number): this;\n surfaceBorderWidth_exists(): boolean;\n surfaceBorderColor(): string;\n surfaceBorderColor(_: string): this;\n surfaceBorderRadius(): number;\n surfaceBorderRadius(_: number): this;\n surfaceBorderRadius_exists(): boolean;\n\n buttonAnnotations(): any[];\n buttonAnnotations(_: any[]): this;\n\n widget(): Widget;\n widget(_: Widget): this;\n}\n\nSurface.prototype.publish(\"title\", \"\", \"string\", \"Title\", null, { tags: [\"Intermediate\"] });\nSurface.prototype.publish(\"altText\", null, \"string\", \"Alt text\", null, { optional: true });\nSurface.prototype.publish(\"surfaceTitlePadding\", null, \"number\", \"Title Padding (px)\", null, { tags: [\"Advanced\"], disable: (w: any) => !w.title() });\nSurface.prototype.publish(\"surfaceTitleFontSize\", null, \"number\", \"Title Font Size (px)\", null, { tags: [\"Advanced\"], disable: (w: any) => !w.title() });\nSurface.prototype.publish(\"surfaceTitleFontColor\", null, \"html-color\", \"Title Font Color\", null, { tags: [\"Advanced\"], disable: (w: any) => !w.title() });\nSurface.prototype.publish(\"surfaceTitleFontFamily\", null, \"string\", \"Title Font Family\", null, { tags: [\"Advanced\"], disable: (w: any) => !w.title() });\nSurface.prototype.publish(\"surfaceTitleFontBold\", true, \"boolean\", \"Enable Bold Title Font\", null, { tags: [\"Advanced\"], disable: (w: any) => !w.title() });\nSurface.prototype.publish(\"surfaceTitleBackgroundColor\", null, \"html-color\", \"Title Background Color\", null, { tags: [\"Advanced\"], disable: (w: any) => !w.title() });\nSurface.prototype.publish(\"surfaceTitleAlignment\", \"center\", \"set\", \"Title Alignment\", [\"left\", \"right\", \"center\"], { tags: [\"Basic\"], disable: (w: any) => !w.title() });\n\nSurface.prototype.publish(\"surfaceShadow\", false, \"boolean\", \"3D Shadow\");\nSurface.prototype.publish(\"surfacePadding\", null, \"string\", \"Surface Padding (px)\", null, { tags: [\"Intermediate\"] });\nSurface.prototype.publish(\"surfaceBackgroundColor\", null, \"html-color\", \"Surface Background Color\", null, { tags: [\"Advanced\"] });\nSurface.prototype.publish(\"surfaceBorderWidth\", null, \"number\", \"Surface Border Width (px)\", null, { tags: [\"Advanced\"] });\nSurface.prototype.publish(\"surfaceBorderColor\", null, \"html-color\", \"Surface Border Color\", null, { tags: [\"Advanced\"] });\nSurface.prototype.publish(\"surfaceBorderRadius\", null, \"number\", \"Surface Border Radius (px)\", null, { tags: [\"Advanced\"] });\n\nSurface.prototype.publish(\"buttonAnnotations\", [], \"array\", \"Button Array\", null, { tags: [\"Private\"] });\n\nSurface.prototype.publish(\"widget\", null, \"widget\", \"Widget\", null, { tags: [\"Basic\"] });\n","import { Widget } from \"@hpcc-js/common\";\nimport { select as d3Select, selectAll as d3SelectAll } from \"d3-selection\";\nimport { Surface } from \"./Surface.ts\";\n\nimport \"../src/Cell.css\";\n\nexport class Cell extends Surface {\n _indicateTheseIds;\n\n constructor() {\n super();\n this._indicateTheseIds = [];\n }\n\n indicateTheseIds(): any[];\n indicateTheseIds(_: any[]): Cell;\n indicateTheseIds(_?: any[]): any[] | Cell {\n if (!arguments.length) return this._indicateTheseIds;\n this._indicateTheseIds = _;\n return this;\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n const context = this;\n element\n .classed(\"layout_Surface\", true)\n .on(\"mouseenter\", function () { context.onMouseEnter(); })\n .on(\"mouseleave\", function () { context.onMouseLeave(); })\n ;\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n }\n\n onMouseEnter() {\n const arr = this.indicateTheseIds();\n const opacity = this.indicatorOpacity();\n const indicatorBorderColor = this.indicatorBorderColor();\n const indicatorGlowColor = this.indicatorGlowColor();\n for (let i = 0; i < arr.length; i++) {\n const otherElement = d3Select(\"#\" + arr[i]);\n const otherWidget: Widget = otherElement.datum() as Widget;\n if (otherElement && otherWidget) {\n otherElement.append(\"div\")\n .attr(\"class\", \"update-indicator\")\n .style(\"width\", otherWidget.width() + \"px\")\n .style(\"height\", otherWidget.height() + \"px\")\n .style(\"opacity\", opacity)\n .style(\"border-color\", indicatorBorderColor)\n .style(\"-webkit-box-shadow\", \"inset 0px 0px 30px 0px \" + indicatorGlowColor)\n .style(\"-moz-box-shadow\", \"inset 0px 0px 30px 0px \" + indicatorGlowColor)\n .style(\"box-shadow\", \"inset 0px 0px 30px 0px \" + indicatorGlowColor)\n ;\n }\n }\n }\n\n onMouseLeave() {\n const arr = this.indicateTheseIds();\n for (let i = 0; i < arr.length; i++) {\n d3SelectAll(\"#\" + arr[i] + \" > div.update-indicator\").remove();\n }\n }\n}\nCell.prototype._class += \" layout_Cell\";\n\nexport interface Cell {\n gridRow(): number;\n gridRow(_: number): this;\n gridCol(): number;\n gridCol(_: number): this;\n gridRowSpan(): number;\n gridRowSpan(_: number): this;\n gridColSpan(): number;\n gridColSpan(_: number): this;\n\n indicatorGlowColor(): string;\n indicatorGlowColor(_: string): this;\n indicatorBorderColor(): string;\n indicatorBorderColor(_: string): this;\n indicatorOpacity(): number;\n indicatorOpacity(_: number): this;\n}\n\nCell.prototype.publish(\"gridRow\", 0, \"number\", \"Grid Row Position\", null, { tags: [\"Private\"] });\nCell.prototype.publish(\"gridCol\", 0, \"number\", \"Grid Column Position\", null, { tags: [\"Private\"] });\nCell.prototype.publish(\"gridRowSpan\", 1, \"number\", \"Grid Row Span\", null, { tags: [\"Private\"] });\nCell.prototype.publish(\"gridColSpan\", 1, \"number\", \"Grid Column Span\", null, { tags: [\"Private\"] });\n\nCell.prototype.publish(\"indicatorGlowColor\", \"#EEEE11\", \"html-color\", \"Glow color of update-indicator\", null, { tags: [\"Basic\"] });\nCell.prototype.publish(\"indicatorBorderColor\", \"#F48A00\", \"html-color\", \"Border color of update-indicator\", null, { tags: [\"Basic\"] });\nCell.prototype.publish(\"indicatorOpacity\", 0.8, \"number\", \"Opacity of update-indicator\", null, { tags: [\"Basic\"] });\n","import { d3Event, HTMLWidget, Platform, select as d3Select, selectAll as d3SelectAll, Utility } from \"@hpcc-js/common\";\nimport { drag as d3Drag } from \"d3-drag\";\nimport { Cell } from \"./Cell.ts\";\n\nimport \"../src/Border.css\";\n\nexport class Border extends HTMLWidget {\n _colCount: number;\n _rowCount: number;\n _colSize: number;\n _rowSize: number;\n _shrinkWrapBoxes;\n _watch;\n _offsetX;\n _offsetY;\n _dragCell;\n _dragCellSize;\n _dragCellStartSize;\n _handleTop;\n _handleLeft;\n _dragPrevX;\n _dragPrevY;\n _cellSizes;\n contentDiv;\n _scrollBarWidth;\n _borderHandles;\n _sectionTypeArr;\n\n constructor() {\n super();\n\n this._tag = \"div\";\n\n this._colCount = 0;\n this._rowCount = 0;\n this._colSize = 0;\n this._rowSize = 0;\n\n this._shrinkWrapBoxes = {};\n\n this.content([]);\n this.sectionTypes([]);\n }\n\n watchWidget(widget) {\n if (this._watch === undefined) {\n this._watch = {};\n }\n if (this._watch[widget.id()]) {\n this._watch[widget.id()].remove();\n delete this._watch[widget.id()];\n }\n if (widget) {\n const context = this;\n this._watch[widget.id()] = widget.monitor(function (paramId, newVal, oldVal) {\n if (oldVal !== newVal) {\n context.lazyPostUpdate();\n }\n });\n }\n }\n\n lazyPostUpdate = Utility.debounce(function () {\n this.postUpdate();\n }, 100);\n\n applyLayoutType() {\n const layoutObj = this.borderLayoutObject();\n this.content().forEach(function (cell, i) {\n cell._fixedLeft = layoutObj[this.sectionTypes()[i]].left;\n cell._fixedTop = layoutObj[this.sectionTypes()[i]].top;\n cell._fixedWidth = layoutObj[this.sectionTypes()[i]].width;\n cell._fixedHeight = layoutObj[this.sectionTypes()[i]].height;\n cell._dragHandles = this.cellSpecificDragHandles(this.sectionTypes()[i]);\n }, this);\n }\n cellSpecificDragHandles(sectionType) {\n switch (sectionType) {\n case \"top\": return [\"s\"];\n case \"right\": return [\"w\"];\n case \"bottom\": return [\"n\"];\n case \"left\": return [\"e\"];\n case \"center\": return [];\n }\n }\n\n borderLayoutObject(layoutType?) {\n const retObj = {};\n const context = this;\n let topSize;\n let topPerc;\n let bottomSize;\n let bottomPerc;\n let leftSize;\n let leftPerc;\n let rightSize;\n let rightPerc;\n\n const bcRect = this.target().getBoundingClientRect();\n const gridRect: any = {};\n gridRect.top = bcRect.top;\n gridRect.left = bcRect.left;\n gridRect.bottom = bcRect.bottom;\n gridRect.right = bcRect.right;\n if (this.target() instanceof SVGElement) {\n gridRect.width = parseFloat(this.target().getAttribute(\"width\"));\n gridRect.height = parseFloat(this.target().getAttribute(\"height\"));\n } else {\n gridRect.width = bcRect.width;\n gridRect.height = bcRect.height;\n }\n if (this.sectionTypes().indexOf(\"top\") !== -1) {\n topSize = this.topSize();\n topPerc = this.topPercentage();\n if (typeof (this._shrinkWrapBoxes[\"top\"]) !== \"undefined\") {\n topSize = this._shrinkWrapBoxes[\"top\"].height + this.gutter();\n topPerc = 0;\n }\n }\n if (this.sectionTypes().indexOf(\"bottom\") !== -1) {\n bottomSize = this.bottomSize();\n bottomPerc = this.bottomPercentage();\n if (typeof (this._shrinkWrapBoxes[\"bottom\"]) !== \"undefined\") {\n bottomSize = this._shrinkWrapBoxes[\"bottom\"].height + this.gutter();\n bottomPerc = 0;\n }\n }\n if (this.sectionTypes().indexOf(\"left\") !== -1) {\n leftSize = this.leftSize();\n leftPerc = this.leftPercentage();\n if (typeof (this._shrinkWrapBoxes[\"left\"]) !== \"undefined\") {\n leftSize = this._shrinkWrapBoxes[\"left\"].width + this.gutter();\n leftPerc = 0;\n }\n }\n if (this.sectionTypes().indexOf(\"right\") !== -1) {\n rightSize = this.rightSize();\n rightPerc = this.rightPercentage();\n if (typeof (this._shrinkWrapBoxes[\"right\"]) !== \"undefined\") {\n rightSize = this._shrinkWrapBoxes[\"right\"].width + this.gutter();\n rightPerc = 0;\n }\n }\n\n const t = _sectionPlacementObject({\n width: { \"px\": 0, \"%\": 100 },\n height: { \"px\": topSize, \"%\": topPerc },\n top: { \"px\": 0, \"%\": 0 },\n left: { \"px\": 0, \"%\": 0 }\n });\n const b = _sectionPlacementObject({\n width: { \"px\": 0, \"%\": 100 },\n height: { \"px\": bottomSize, \"%\": bottomPerc },\n top: { \"px\": 0, \"%\": 100 },\n left: { \"px\": 0, \"%\": 0 }\n });\n b.top -= b.height;\n const l = _sectionPlacementObject({\n width: { \"px\": leftSize, \"%\": leftPerc },\n height: { \"px\": -t.height - b.height, \"%\": 100 },\n top: { \"px\": t.height, \"%\": 0 },\n left: { \"px\": 0, \"%\": 0 }\n });\n const r = _sectionPlacementObject({\n width: { \"px\": rightSize, \"%\": rightPerc },\n height: { \"px\": -t.height - b.height, \"%\": 100 },\n top: { \"px\": t.height, \"%\": 0 },\n left: { \"px\": 0, \"%\": 100 }\n });\n r.left -= r.width;\n const c = _sectionPlacementObject({\n width: { \"px\": -r.width - l.width, \"%\": 100 },\n height: { \"px\": -t.height - b.height, \"%\": 100 },\n top: { \"px\": t.height, \"%\": 0 },\n left: { \"px\": l.width, \"%\": 0 }\n });\n retObj[\"top\"] = t;\n retObj[\"bottom\"] = b;\n retObj[\"right\"] = r;\n retObj[\"left\"] = l;\n retObj[\"center\"] = c;\n return retObj;\n\n function _sectionPlacementObject(obj) {\n obj.width[\"px\"] = typeof (obj.width[\"px\"]) !== \"undefined\" ? obj.width[\"px\"] : 0;\n obj.width[\"%\"] = typeof (obj.width[\"%\"]) !== \"undefined\" ? obj.width[\"%\"] : 0;\n obj.height[\"px\"] = typeof (obj.height[\"px\"]) !== \"undefined\" ? obj.height[\"px\"] : 0;\n obj.height[\"%\"] = typeof (obj.height[\"%\"]) !== \"undefined\" ? obj.height[\"%\"] : 0;\n const ret = {\n width: obj.width[\"px\"] + (obj.width[\"%\"] / 100 * context.width()),\n height: obj.height[\"px\"] + (obj.height[\"%\"] / 100 * context.height()),\n top: obj.top[\"px\"] + (obj.top[\"%\"] / 100 * context.height()) + context.gutter() / 2,\n left: obj.left[\"px\"] + (obj.left[\"%\"] / 100 * context.width()) + context.gutter() / 2\n };\n return ret;\n }\n }\n\n clearContent(sectionType) {\n if (!sectionType) {\n this.content().forEach(function (contentWidget) {\n contentWidget.target(null);\n return false;\n });\n d3Select(\"#\" + this.id() + \" > div.borderHandle\")\n .classed(\"borderHandleDisabled\", true)\n ;\n delete this._watch;\n this.content([]);\n this.sectionTypes([]);\n } else {\n const idx = this.sectionTypes().indexOf(sectionType);\n if (idx >= 0) {\n if (this._watch && this.content()[idx]) {\n delete this._watch[this.content()[idx].id()];\n }\n this.content()[idx].target(null);\n d3Select(\"#\" + this.id() + \" > div.borderHandle_\" + sectionType)\n .classed(\"borderHandleDisabled\", true)\n ;\n this.content().splice(idx, 1);\n this.sectionTypes().splice(idx, 1);\n }\n }\n }\n\n hasContent(sectionType, widget, title) {\n return this.sectionTypes().indexOf(sectionType) >= 0;\n }\n\n setContent(sectionType, widget, title?) {\n this.clearContent(sectionType);\n title = typeof (title) !== \"undefined\" ? title : \"\";\n if (widget) {\n const cell = new Cell()\n .surfaceBorderWidth(0)\n .widget(widget)\n .title(title)\n ;\n this.watchWidget(widget);\n this.content().push(cell);\n this.sectionTypes().push(sectionType);\n }\n return this;\n }\n\n getCell(id) {\n const idx = this.sectionTypes().indexOf(id);\n if (idx >= 0) {\n return this.content()[idx];\n }\n return null;\n }\n\n getContent(id) {\n const idx = this.sectionTypes().indexOf(id);\n if (idx >= 0) {\n return this.content()[idx].widget();\n }\n return null;\n }\n\n setLayoutOffsets() {\n this._offsetX = this._element.node().getBoundingClientRect().left + (this.gutter() / 2);\n this._offsetY = this._element.node().getBoundingClientRect().top + (this.gutter() / 2);\n }\n\n dragStart(handle) {\n const event = d3Event();\n event.sourceEvent.stopPropagation();\n const context = this;\n\n this._dragCell = handle;\n this._dragCellStartSize = this[handle + \"Size\"]();\n\n if (this[handle + \"ShrinkWrap\"]()) {\n this[handle + \"Percentage\"](0);\n this[handle + \"ShrinkWrap\"](false);\n }\n\n const handleElm = d3Select(\"#\" + context.id() + \" > div.borderHandle_\" + handle);\n context._handleTop = parseFloat(handleElm.style(\"top\").split(\"px\")[0]);\n context._handleLeft = parseFloat(handleElm.style(\"left\").split(\"px\")[0]);\n\n this._dragPrevX = event.sourceEvent.clientX;\n this._dragPrevY = event.sourceEvent.clientY;\n }\n dragTick(handle) {\n const context = this;\n\n const event = d3Event();\n const xDelta = this._dragPrevX - event.sourceEvent.clientX;\n const yDelta = this._dragPrevY - event.sourceEvent.clientY;\n\n switch (handle) {\n case \"top\":\n case \"bottom\":\n _moveHandles(handle, yDelta);\n break;\n case \"right\":\n case \"left\":\n _moveHandles(handle, xDelta);\n break;\n }\n\n function _moveHandles(handle2, delta) {\n if (delta === 0) return;\n const handles = d3SelectAll(\"#\" + context.id() + \" > div.borderHandle\");\n const grabbedHandle = d3Select(\"#\" + context.id() + \" > div.borderHandle_\" + handle2);\n\n if (grabbedHandle.classed(\"borderHandle_top\")) {\n grabbedHandle.style(\"top\", (context._handleTop - delta) + \"px\");\n context._cellSizes.topHeight = context._handleTop - delta;\n context._cellSizes.leftHeight = context._cellSizes.height;\n context._cellSizes.leftHeight -= context._cellSizes.topHeight;\n context._cellSizes.leftHeight -= context._cellSizes.bottomHeight;\n context._cellSizes.rightHeight = context._cellSizes.leftHeight;\n } else if (grabbedHandle.classed(\"borderHandle_right\")) {\n grabbedHandle.style(\"left\", (context._handleLeft - delta) + \"px\");\n context._cellSizes.rightWidth = context._cellSizes.width - context._handleLeft + delta;\n } else if (grabbedHandle.classed(\"borderHandle_bottom\")) {\n grabbedHandle.style(\"top\", (context._handleTop - delta) + \"px\");\n context._cellSizes.bottomHeight = context._cellSizes.height - context._handleTop + delta;\n context._cellSizes.leftHeight = context._cellSizes.height;\n context._cellSizes.leftHeight -= context._cellSizes.bottomHeight;\n context._cellSizes.leftHeight -= context._cellSizes.topHeight;\n context._cellSizes.rightHeight = context._cellSizes.leftHeight;\n } else if (grabbedHandle.classed(\"borderHandle_left\")) {\n grabbedHandle.style(\"left\", (context._handleLeft - delta) + \"px\");\n context._cellSizes.leftWidth = context._handleLeft - delta;\n }\n\n handles.each(function () {\n const handle3 = d3Select(this);\n if (handle3.classed(\"borderHandle_top\")) {\n handle3.style(\"width\", context._cellSizes.width + \"px\");\n handle3.style(\"top\", (context._cellSizes.topHeight - 3) + \"px\");\n } else if (handle3.classed(\"borderHandle_right\")) {\n handle3.style(\"left\", (context._cellSizes.width - context._cellSizes.rightWidth) + \"px\");\n handle3.style(\"top\", (context._cellSizes.topHeight + 3) + \"px\");\n handle3.style(\"height\", context._cellSizes.rightHeight + \"px\");\n } else if (handle3.classed(\"borderHandle_bottom\")) {\n handle3.style(\"width\", context._cellSizes.width + \"px\");\n handle3.style(\"top\", (context._cellSizes.height - context._cellSizes.bottomHeight - 3) + \"px\");\n } else if (handle3.classed(\"borderHandle_left\")) {\n handle3.style(\"left\", context._cellSizes.leftWidth + \"px\");\n handle3.style(\"height\", context._cellSizes.leftHeight + \"px\");\n handle3.style(\"top\", (context._cellSizes.topHeight + 3) + \"px\");\n }\n });\n }\n }\n dragEnd(handle) {\n if (handle) {\n const event = d3Event();\n const xDelta = this._dragPrevX - event.sourceEvent.clientX;\n const yDelta = this._dragPrevY - event.sourceEvent.clientY;\n\n switch (handle) {\n case \"top\":\n if (yDelta !== 0) {\n this.topPercentage(0);\n this.topSize(this.topSize() === 0 ? this.getContent(\"top\").getBBox().height - yDelta : this.topSize() - yDelta);\n }\n break;\n case \"right\":\n if (xDelta !== 0) {\n this.rightPercentage(0);\n this.rightSize(this.rightSize() === 0 ? this.getContent(\"right\").getBBox().width + xDelta : this.rightSize() + xDelta);\n }\n break;\n case \"bottom\":\n if (yDelta !== 0) {\n this.bottomPercentage(0);\n this.bottomSize(this.bottomSize() === 0 ? this.getContent(\"bottom\").getBBox().height + yDelta : this.bottomSize() + yDelta);\n }\n break;\n case \"left\":\n if (xDelta !== 0) {\n this.leftPercentage(0);\n this.leftSize(this.leftSize() === 0 ? this.getContent(\"left\").getBBox().width - xDelta : this.leftSize() - xDelta);\n }\n break;\n }\n\n this._dragPrevX = event.sourceEvent.clientX;\n this._dragPrevY = event.sourceEvent.clientY;\n }\n this.render();\n }\n\n size(_?) {\n const retVal = HTMLWidget.prototype.size.apply(this, arguments);\n if (arguments.length && this.contentDiv) {\n this.contentDiv\n .style(\"width\", this._size.width + \"px\")\n .style(\"height\", this._size.height + \"px\")\n ;\n }\n return retVal;\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n const context = this;\n element.style(\"position\", \"relative\");\n this.contentDiv = element.append(\"div\").classed(\"border-content\", true);\n this._scrollBarWidth = Platform.getScrollbarWidth();\n this._borderHandles = [\"top\", \"left\", \"right\", \"bottom\"];\n\n const handles = element.selectAll(\"div.borderHandle\").data(this._borderHandles);\n handles.enter().append(\"div\")\n .classed(\"borderHandle\", true)\n .each(function (handle) {\n const h = d3Select(this);\n h.classed(\"borderHandle_\" + handle, true)\n .classed(\"borderHandleDisabled\", context.getContent(handle) === null)\n ;\n });\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n this._sectionTypeArr = this.sectionTypes();\n const context = this;\n\n element.classed(\"design-mode\", this.designMode());\n\n this.setLayoutOffsets();\n\n const rows = this.contentDiv.selectAll(\".cell_\" + this._id).data(this.content(), function (d) { return d._id; });\n const rowsUpdate = rows.enter().append(\"div\")\n .classed(\"cell_\" + this._id, true)\n .style(\"position\", \"absolute\")\n .each(function (d, i) {\n d3Select(this).classed(\"border-cell border-cell-\" + context._sectionTypeArr[i], true);\n d.target(this);\n d3Select(\"#\" + context.id() + \" > div.borderHandle_\" + context._sectionTypeArr[i])\n .classed(\"borderHandleDisabled\", false);\n }).merge(rows);\n rowsUpdate\n .each(function (d, idx) {\n const sectionType = context.sectionTypes()[idx];\n if (typeof (context[sectionType + \"ShrinkWrap\"]) !== \"undefined\" && context[sectionType + \"ShrinkWrap\"]()) {\n d.render();\n context._shrinkWrapBoxes[sectionType] = d.widget().getBBox(true);\n } else {\n delete context._shrinkWrapBoxes[sectionType];\n }\n });\n\n const drag = d3Drag()\n .on(\"start\", function (d, i) { context.dragStart.call(context, d, i); })\n .on(\"drag\", function (d, i) { context.dragTick.call(context, d, i); })\n .on(\"end\", function (d, i) { context.dragEnd.call(context, d, i); })\n ;\n if (this.designMode()) {\n element.selectAll(\"#\" + this.id() + \" > div.borderHandle\").call(drag);\n } else {\n element.selectAll(\"#\" + this.id() + \" > div.borderHandle\").on(\".drag\", null);\n }\n\n const layoutObj = this.borderLayoutObject();\n this.content().forEach(function (cell, i) {\n cell._fixedLeft = layoutObj[this.sectionTypes()[i]].left;\n cell._fixedTop = layoutObj[this.sectionTypes()[i]].top;\n cell._fixedWidth = layoutObj[this.sectionTypes()[i]].width;\n cell._fixedHeight = layoutObj[this.sectionTypes()[i]].height;\n cell._dragHandles = [];\n }, this);\n\n rowsUpdate\n .style(\"left\", function (d) { return d._fixedLeft + \"px\"; })\n .style(\"top\", function (d) { return d._fixedTop + \"px\"; })\n .style(\"width\", function (d) { return d._fixedWidth - context.gutter() + \"px\"; })\n .style(\"height\", function (d) { return d._fixedHeight - context.gutter() + \"px\"; })\n .each(function (d) {\n d._placeholderElement\n .attr(\"draggable\", context.designMode())\n .selectAll(\".dragHandle\")\n .attr(\"draggable\", context.designMode())\n ;\n d\n .surfacePadding(context.surfacePadding())\n .resize()\n ;\n });\n rows.exit().each(function (d) {\n d.target(null);\n }).remove();\n\n this.getCellSizes();\n\n element\n .selectAll(\"#\" + this.id() + \" > div.borderHandle\")\n .each(function () {\n const handle = d3Select(this);\n if (handle.classed(\"borderHandle_top\")) {\n handle.style(\"width\", context._cellSizes.width + \"px\");\n handle.style(\"top\", (context._cellSizes.topHeight - 3) + \"px\");\n } else if (handle.classed(\"borderHandle_right\")) {\n handle.style(\"left\", (context._cellSizes.width - context._cellSizes.rightWidth) + \"px\");\n handle.style(\"top\", (context._cellSizes.topHeight + 3) + \"px\");\n handle.style(\"height\", context._cellSizes.rightHeight + \"px\");\n } else if (handle.classed(\"borderHandle_bottom\")) {\n handle.style(\"width\", context._cellSizes.width + \"px\");\n handle.style(\"top\", (context._cellSizes.height - context._cellSizes.bottomHeight - 3) + \"px\");\n } else if (handle.classed(\"borderHandle_left\")) {\n handle.style(\"left\", context._cellSizes.leftWidth + \"px\");\n handle.style(\"height\", context._cellSizes.leftHeight + \"px\");\n handle.style(\"top\", (context._cellSizes.topHeight + 3) + \"px\");\n }\n\n })\n ;\n }\n\n getCellSizes() {\n const context = this;\n context._cellSizes = {};\n const contentRect = this.element().node().getBoundingClientRect();\n context._cellSizes.width = contentRect.width;\n context._cellSizes.height = contentRect.height;\n this.element()\n .selectAll(\"#\" + this.id() + \" > div > div.border-cell\")\n .each(function () {\n const cell = d3Select(this);\n if (typeof cell.node === \"function\") {\n const rect = cell.node().getBoundingClientRect();\n if (cell.classed(\"border-cell-top\")) {\n context._cellSizes.topHeight = rect.height;\n } else if (cell.classed(\"border-cell-left\")) {\n context._cellSizes.leftWidth = rect.width;\n context._cellSizes.leftHeight = rect.height;\n } else if (cell.classed(\"border-cell-right\")) {\n context._cellSizes.rightWidth = rect.width;\n context._cellSizes.rightHeight = rect.height;\n } else if (cell.classed(\"border-cell-bottom\")) {\n context._cellSizes.bottomHeight = rect.height;\n }\n }\n });\n const sizes = [\"height\", \"width\", \"topHeight\", \"bottomHeight\", \"leftHeight\", \"rightHeight\", \"leftWidth\", \"rightWidth\"];\n sizes.forEach(function (size) {\n context._cellSizes[size] = context._cellSizes[size] === undefined ? 0 : context._cellSizes[size];\n });\n }\n\n postUpdate(domNode, element) {\n const context = this;\n this.content().forEach(function (n) {\n if (n._element.node() !== null && n.widget()) {\n const prevBox = n.widget().getBBox(false, true);\n const currBox = n.widget().getBBox(true, true);\n if (prevBox.width !== currBox.width || prevBox.height !== currBox.height) {\n context.lazyRender();\n }\n }\n });\n }\n\n exit(domNode, element) {\n this.content().forEach(w => w.target(null));\n super.exit(domNode, element);\n }\n}\nBorder.prototype._class += \" layout_Border\";\n\nexport interface Border {\n designMode(): boolean;\n designMode(_: boolean): this;\n\n content(): any[];\n content(_: any[]): this;\n\n gutter(): number;\n gutter(_: number): this;\n\n topShrinkWrap(): boolean;\n topShrinkWrap(_: boolean): this;\n leftShrinkWrap(): boolean;\n leftShrinkWrap(_: boolean): this;\n rightShrinkWrap(): boolean;\n rightShrinkWrap(_: boolean): this;\n bottomShrinkWrap(): boolean;\n bottomShrinkWrap(_: boolean): this;\n\n topSize(): number;\n topSize(_: number): this;\n leftSize(): number;\n leftSize(_: number): this;\n rightSize(): number;\n rightSize(_: number): this;\n bottomSize(): number;\n bottomSize(_: number): this;\n\n topPercentage(): number;\n topPercentage(_: number): this;\n leftPercentage(): number;\n leftPercentage(_: number): this;\n rightPercentage(): number;\n rightPercentage(_: number): this;\n bottomPercentage(): number;\n bottomPercentage(_: number): this;\n\n surfacePadding(): number;\n surfacePadding(_: number): this;\n\n sectionTypes(): any[];\n sectionTypes(_: any[]): this;\n}\n\nBorder.prototype.publish(\"designMode\", false, \"boolean\", \"Design Mode\", null, { tags: [\"Basic\"] });\n\nBorder.prototype.publish(\"content\", [], \"widgetArray\", \"widgets\", null, { tags: [\"Intermediate\"] });\n\nBorder.prototype.publish(\"gutter\", 0, \"number\", \"Gap Between Widgets\", null, { tags: [\"Basic\"] });\n\nBorder.prototype.publish(\"topShrinkWrap\", false, \"boolean\", \"'Top' Cell shrinks to fit content\", null, { tags: [\"Intermediate\"] });\nBorder.prototype.publish(\"leftShrinkWrap\", false, \"boolean\", \"'Left' Cell shrinks to fit content\", null, { tags: [\"Intermediate\"] });\nBorder.prototype.publish(\"rightShrinkWrap\", false, \"boolean\", \"'Right' Cell shrinks to fit content\", null, { tags: [\"Intermediate\"] });\nBorder.prototype.publish(\"bottomShrinkWrap\", false, \"boolean\", \"'Bottom' Cell shrinks to fit content\", null, { tags: [\"Intermediate\"] });\n\nBorder.prototype.publish(\"topSize\", 0, \"number\", \"Height of the 'Top' Cell (px)\", null, { tags: [\"Private\"] });\nBorder.prototype.publish(\"leftSize\", 0, \"number\", \"Width of the 'Left' Cell (px)\", null, { tags: [\"Private\"] });\nBorder.prototype.publish(\"rightSize\", 0, \"number\", \"Width of the 'Right' Cell (px)\", null, { tags: [\"Private\"] });\nBorder.prototype.publish(\"bottomSize\", 0, \"number\", \"Height of the 'Bottom' Cell (px)\", null, { tags: [\"Private\"] });\n\nBorder.prototype.publish(\"topPercentage\", 20, \"number\", \"Percentage (of parent) Height of the 'Top' Cell\", null, { tags: [\"Private\"] });\nBorder.prototype.publish(\"leftPercentage\", 20, \"number\", \"Percentage (of parent) Width of the 'Left' Cell\", null, { tags: [\"Private\"] });\nBorder.prototype.publish(\"rightPercentage\", 20, \"number\", \"Percentage (of parent) Width of the 'Right' Cell\", null, { tags: [\"Private\"] });\nBorder.prototype.publish(\"bottomPercentage\", 20, \"number\", \"Percentage (of parent) Height of the 'Bottom' Cell\", null, { tags: [\"Private\"] });\n\nBorder.prototype.publish(\"surfacePadding\", 0, \"number\", \"Cell Padding (px)\", null, { tags: [\"Intermediate\"] });\n\nBorder.prototype.publish(\"sectionTypes\", [], \"array\", \"Section Types sharing an index with 'content' - Used to determine position/size.\", null, { tags: [\"Private\"] });\n","import { BBox, HTMLWidget, Platform, Widget } from \"@hpcc-js/common\";\n\nimport \"../src/Border2.css\";\n\nexport type OverflowT = \"hidden\" | \"scroll\" | \"visible\" | \"auto\";\nexport type ChartPanelSectionT = \"top\" | \"right\" | \"bottom\" | \"left\" | \"center\";\nexport class WidgetDiv {\n private _div;\n private _overlay: boolean = false;\n private _overflowX: OverflowT = \"visible\";\n private _overflowY: OverflowT = \"visible\";\n private _widget: Widget;\n\n constructor(div) {\n this._div = div;\n }\n\n overlay(): boolean;\n overlay(_: boolean): this;\n overlay(_?: boolean): boolean | this {\n if (!arguments.length) return this._overlay;\n this._overlay = _;\n return this;\n }\n\n overflowX(): OverflowT;\n overflowX(_: OverflowT): this;\n overflowX(_?: OverflowT): OverflowT | this {\n if (!arguments.length) return this._overflowX;\n this._overflowX = _;\n this._div.style(\"overflow-x\", _);\n return this;\n }\n overflowY(): OverflowT;\n overflowY(_: OverflowT): this;\n overflowY(_?: OverflowT): OverflowT | this {\n if (!arguments.length) return this._overflowY;\n this._overflowY = _;\n this._div.style(\"overflow-y\", _);\n return this;\n }\n\n element() {\n return this._div;\n }\n\n node(): SVGElement | HTMLElement {\n return this._div.node();\n }\n\n widget(): Widget;\n widget(_: Widget): this;\n widget(_?: Widget): Widget | this {\n if (!arguments.length) return this._widget;\n if (this._widget !== _) {\n if (this._widget) {\n this._widget.target(null);\n }\n this._widget = _;\n if (this._widget) {\n this._widget.target(this._div.node());\n }\n }\n return this;\n }\n\n resize(size: { width: number, height: number }) {\n if (this._widget) {\n this._div\n .style(\"width\", `${size.width}px`)\n .style(\"height\", `${size.height}px`)\n ;\n this._widget.resize(size);\n }\n return this;\n }\n\n async render(getBBox?, availableHeight?: number, availableWidth?: number): Promise<BBox | undefined> {\n let overflowX = this.overflowX();\n if(!this.overlay() && overflowX === \"visible\") {\n overflowX = null;\n }\n let overflowY = this.overflowY();\n if(!this.overlay() && overflowY === \"visible\") {\n overflowY = null;\n }\n this._div\n .style(\"height\", this.overlay() ? \"0px\" : null)\n .style(\"overflow-x\", overflowX)\n .style(\"overflow-y\", overflowY)\n ;\n if (this._widget) {\n return this._widget.renderPromise().then(w => {\n if (getBBox && this._widget.visible()) {\n const retVal = this._widget.getBBox();\n retVal.width += 8;\n if (availableHeight !== undefined && retVal.height > availableHeight) {\n retVal.width += Platform.getScrollbarWidth();\n }\n if (availableWidth !== undefined && retVal.width > availableWidth) {\n retVal.height += Platform.getScrollbarWidth();\n }\n if (this.overlay()) {\n retVal.height = 0;\n } else {\n retVal.height += 4;\n }\n return retVal;\n }\n return getBBox ? { x: 0, y: 0, width: 0, height: 0 } : undefined;\n });\n } else {\n return Promise.resolve(getBBox ? { x: 0, y: 0, width: 0, height: 0 } : undefined);\n }\n }\n}\n\nexport class Border2 extends HTMLWidget {\n\n protected _bodyElement;\n\n protected _topWA: WidgetDiv;\n protected _leftWA: WidgetDiv;\n protected _centerWA: WidgetDiv;\n protected _rightWA: WidgetDiv;\n protected _bottomWA: WidgetDiv;\n protected _topPrevOverflow: OverflowT;\n protected _leftPrevOverflow: OverflowT;\n protected _rightPrevOverflow: OverflowT;\n protected _bottomPrevOverflow: OverflowT;\n\n constructor() {\n super();\n this._tag = \"div\";\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n \n const topElement = element.append(\"header\");\n\n this._bodyElement = element.append(\"div\").attr(\"class\", \"body\");\n const centerElement = this._bodyElement.append(\"div\").attr(\"class\", \"center\");\n const leftElement = this._bodyElement.append(\"div\").attr(\"class\", \"lhs\");\n const rightElement = this._bodyElement.append(\"div\").attr(\"class\", \"rhs\");\n\n const bottomElement = element.append(\"div\").attr(\"class\", \"footer\");\n\n this._topWA = new WidgetDiv(topElement);\n this._centerWA = new WidgetDiv(centerElement);\n this._leftWA = new WidgetDiv(leftElement);\n this._rightWA = new WidgetDiv(rightElement);\n this._bottomWA = new WidgetDiv(bottomElement);\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n this._topWA.element().style(\"display\", this.showTop() ? null : \"none\");\n this._rightWA.element().style(\"display\", this.showRight() ? null : \"none\");\n this._bottomWA.element().style(\"display\", this.showBottom() ? null : \"none\");\n this._leftWA.element().style(\"display\", this.showLeft() ? null : \"none\");\n if(this.topOverflowX() !== this._topWA.overflowX()) {\n this._topWA.overflowX(this.topOverflowX());\n }\n if(this.rightOverflowX() !== this._rightWA.overflowX()) {\n this._rightWA.overflowX(this.rightOverflowX());\n }\n if(this.bottomOverflowX() !== this._bottomWA.overflowX()) {\n this._bottomWA.overflowX(this.bottomOverflowX());\n }\n if(this.leftOverflowX() !== this._leftWA.overflowX()) {\n this._leftWA.overflowX(this.leftOverflowX());\n }\n if(this.topOverflowY() !== this._topWA.overflowY()) {\n this._topWA.overflowY(this.topOverflowY());\n }\n if(this.rightOverflowY() !== this._rightWA.overflowY()) {\n this._rightWA.overflowY(this.rightOverflowY());\n }\n if(this.bottomOverflowY() !== this._bottomWA.overflowY()) {\n this._bottomWA.overflowY(this.bottomOverflowY());\n }\n if(this.leftOverflowY() !== this._leftWA.overflowY()) {\n this._leftWA.overflowY(this.leftOverflowY());\n }\n this.element()\n .style(\"width\", `${this.width()}px`)\n .style(\"height\", `${this.height()}px`)\n ;\n }\n\n private targetNull(w?: Widget) {\n if (w) {\n w.target(null);\n }\n }\n\n exit(domNode, element) {\n this.targetNull(this.center());\n this.targetNull(this.bottom());\n this.targetNull(this.right());\n this.targetNull(this.left());\n this.targetNull(this.top());\n super.exit(domNode, element);\n }\n\n swap(sectionA: ChartPanelSectionT, sectionB: ChartPanelSectionT): this {\n const a = this[sectionA]();\n const b = this[sectionB]();\n this.targetNull(a);\n this.targetNull(b);\n this[`_${sectionA}WA`].widget(null);\n this[`_${sectionB}WA`].widget(null);\n this[sectionA](b);\n this[sectionB](a);\n return this;\n }\n\n render(callback?: (w: Widget) => void): this {\n const retVal = super.render(w => {\n if (this._topWA) {\n this._topWA\n .widget(this.top())\n .overlay(this.topOverlay())\n .render(true).then(async topBBox => {\n const bottomBBox: BBox = await this._bottomWA.widget(this.bottom()).render(true, undefined, this.width()) as BBox;\n const availableHeight = this.height() - (topBBox.height + bottomBBox.height);\n const leftBBox: BBox = await this._leftWA.widget(this.left()).render(true, availableHeight) as BBox;\n const rightBBox: BBox = await this._rightWA.widget(this.right()).render(true, availableHeight) as BBox;\n \n if (this.bottomHeight_exists()) {\n bottomBBox.height = this.bottomHeight();\n }\n const bodyWidth = this.width() - (leftBBox.width + rightBBox.width);\n const bodyHeight = this.height() - (topBBox.height + bottomBBox.height);\n \n const centerOverflowX = this.centerOverflowX();\n const centerOverflowY = this.centerOverflowY();\n\n const scrollCenterX = [\"auto\", \"scroll\"].indexOf(centerOverflowX) !== -1;\n const scrollCenterY = [\"auto\", \"scroll\"].indexOf(centerOverflowY) !== -1;\n if(scrollCenterX || scrollCenterY) {\n this._centerWA\n .overflowX(this.centerOverflowX())\n .overflowY(this.centerOverflowY())\n .widget(this.center())\n .resize({\n width: bodyWidth,\n height: bodyHeight\n })\n .render()\n ;\n }\n this._bodyElement.style(\"height\", `${bodyHeight}px`);\n const promises = [\n this._topWA\n .overflowX(this.topOverflowX())\n .overflowY(this.topOverflowY())\n .resize({\n width: this.width(),\n height: topBBox.height\n })\n .render(),\n this._leftWA\n .overflowX(this.leftOverflowX())\n .overflowY(this.leftOverflowY())\n .resize({\n width: leftBBox.width,\n height: bodyHeight\n })\n .render(),\n this._rightWA\n .overflowX(this.rightOverflowX())\n .overflowY(this.rightOverflowY())\n .resize({\n width: rightBBox.width,\n height: bodyHeight\n })\n .render(),\n this._centerWA\n .overflowX(this.centerOverflowX())\n .overflowY(this.centerOverflowY())\n .widget(this.center())\n .resize({\n width: bodyWidth,\n height: bodyHeight\n })\n .render(),\n this._bottomWA\n .overflowX(this.bottomOverflowX())\n .overflowY(this.bottomOverflowY())\n .resize({\n width: this.width(),\n height: bottomBBox.height\n })\n .render()\n ];\n Promise.all(promises).then(promises => {\n if (callback) {\n callback(this);\n }\n });\n })\n ;\n } else {\n if (callback) {\n callback(this);\n }\n }\n });\n return retVal;\n }\n}\nBorder2.prototype._class += \" layout_Border2\";\n\nexport interface Border2 {\n top(): Widget;\n top(_: Widget): this;\n topOverlay(): boolean;\n topOverlay(_: boolean): this;\n left(): Widget;\n left(_: Widget): this;\n center(): Widget;\n center(_: Widget): this;\n right(): Widget;\n right(_: Widget): this;\n bottom(): Widget;\n bottom(_: Widget): this;\n bottomHeight(): number;\n bottomHeight(_: number): this;\n bottomHeight_exists(): boolean;\n topOverflowX(): OverflowT;\n topOverflowX(_: OverflowT): this;\n rightOverflowX(): OverflowT;\n rightOverflowX(_: OverflowT): this;\n bottomOverflowX(): OverflowT;\n bottomOverflowX(_: OverflowT): this;\n leftOverflowX(): OverflowT;\n leftOverflowX(_: OverflowT): this;\n centerOverflowX(): OverflowT;\n centerOverflowX(_: OverflowT): this;\n topOverflowY(): OverflowT;\n topOverflowY(_: OverflowT): this;\n rightOverflowY(): OverflowT;\n rightOverflowY(_: OverflowT): this;\n bottomOverflowY(): OverflowT;\n bottomOverflowY(_: OverflowT): this;\n leftOverflowY(): OverflowT;\n leftOverflowY(_: OverflowT): this;\n centerOverflowY(): OverflowT;\n centerOverflowY(_: OverflowT): this;\n showTop(): boolean;\n showTop(_: boolean): this;\n showRight(): boolean;\n showRight(_: boolean): this;\n showBottom(): boolean;\n showBottom(_: boolean): this;\n showLeft(): boolean;\n showLeft(_: boolean): this;\n topOverflowX_default(_: OverflowT);\n rightOverflowX_default(_: OverflowT);\n bottomOverflowX_default(_: OverflowT);\n leftOverflowX_default(_: OverflowT);\n centerOverflowX_default(_: OverflowT);\n topOverflowY_default(_: OverflowT);\n rightOverflowY_default(_: OverflowT);\n bottomOverflowY_default(_: OverflowT);\n leftOverflowY_default(_: OverflowT);\n centerOverflowY_default(_: OverflowT);\n}\nBorder2.prototype.publish(\"showTop\", true, \"boolean\", \"If true, top widget adapter will display\");\nBorder2.prototype.publish(\"showRight\", true, \"boolean\", \"If true, right widget adapter will display\");\nBorder2.prototype.publish(\"showBottom\", true, \"boolean\", \"If true, bottom widget adapter will display\");\nBorder2.prototype.publish(\"showLeft\", true, \"boolean\", \"If true, left widget adapter will display\");\nBorder2.prototype.publish(\"topOverflowX\", \"visible\", \"set\", \"Sets the overflow-x css style for the top widget adapter\", [\"hidden\", \"scroll\", \"visible\", \"auto\"]);\nBorder2.prototype.publish(\"rightOverflowX\", \"visible\", \"set\", \"Sets the overflow-x css style for the right widget adapter\", [\"hidden\", \"scroll\", \"visible\", \"auto\"]);\nBorder2.prototype.publish(\"bottomOverflowX\", \"visible\", \"set\", \"Sets the overflow-x css style for the bottom widget adapter\", [\"hidden\", \"scroll\", \"visible\", \"auto\"]);\nBorder2.prototype.publish(\"leftOverflowX\", \"visible\", \"set\", \"Sets the overflow-x css style for the left widget adapter\", [\"hidden\", \"scroll\", \"visible\", \"auto\"]);\nBorder2.prototype.publish(\"centerOverflowX\", \"visible\", \"set\", \"Sets the overflow-x css style for the center widget adapter\", [\"hidden\", \"scroll\", \"visible\", \"auto\"]);\nBorder2.prototype.publish(\"topOverflowY\", \"visible\", \"set\", \"Sets the overflow-y css style for the top widget adapter\", [\"hidden\", \"scroll\", \"visible\", \"auto\"]);\nBorder2.prototype.publish(\"rightOverflowY\", \"visible\", \"set\", \"Sets the overflow-y css style for the right widget adapter\", [\"hidden\", \"scroll\", \"visible\", \"auto\"]);\nBorder2.prototype.publish(\"bottomOverflowY\", \"visible\", \"set\", \"Sets the overflow-y css style for the bottom widget adapter\", [\"hidden\", \"scroll\", \"visible\", \"auto\"]);\nBorder2.prototype.publish(\"leftOverflowY\", \"visible\", \"set\", \"Sets the overflow-y css style for the left widget adapter\", [\"hidden\", \"scroll\", \"visible\", \"auto\"]);\nBorder2.prototype.publish(\"centerOverflowY\", \"visible\", \"set\", \"Sets the overflow-y css style for the center widget adapter\", [\"hidden\", \"scroll\", \"visible\", \"auto\"]);\nBorder2.prototype.publish(\"top\", null, \"widget\", \"Top Widget\", undefined, { render: false });\nBorder2.prototype.publish(\"topOverlay\", false, \"boolean\", \"Overlay Top Widget\");\nBorder2.prototype.publish(\"left\", null, \"widget\", \"Left Widget\", undefined, { render: false });\nBorder2.prototype.publish(\"center\", null, \"widget\", \"Center Widget\", undefined, { render: false });\nBorder2.prototype.publish(\"right\", null, \"widget\", \"Right Widget\", undefined, { render: false });\nBorder2.prototype.publish(\"bottom\", null, \"widget\", \"Bottom Widget\", undefined, { render: false });\nBorder2.prototype.publish(\"bottomHeight\", null, \"number\", \"Bottom Fixed Height\", undefined, { optional: true });\n","import { HTMLWidget, Widget } from \"@hpcc-js/common\";\nimport { select as d3Select } from \"d3-selection\";\nimport \"d3-transition\";\n\nimport \"../src/Carousel.css\";\n\nexport class Carousel extends HTMLWidget {\n\n protected _prevActive: number = 0;\n protected _root;\n\n activeWidget(): Widget {\n return this.widgets()[this.active()];\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this._root = element.append(\"div\")\n .attr(\"id\", `${this.id()}_root`)\n ;\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n const active = this.active();\n const width = this.width();\n this._root\n .style(\"width\", `${width}px`)\n .style(\"height\", `${this.height()}px`)\n ;\n const widgetElements = this._root.selectAll(`#${this.id()}_root > .carouselItem`).data(this.widgets(), d => d.id());\n const update = widgetElements.enter().append(\"div\")\n .attr(\"class\", \"carouselItem\")\n .each(function (w) {\n w.target(this);\n })\n .merge(widgetElements)\n .style(\"left\", (d, i) => `${(i - this._prevActive) * width}px`)\n .style(\"width\", `${width}px`)\n ;\n if (this._prevActive !== active) {\n update\n .style(\"display\", (d, i) => i === this._prevActive || i === active ? null : \"none\") // Must be called before render callback (not inside transition)\n .transition().duration(this.transitionDuration())\n .style(\"left\", (d, i) => `${(i - active) * width}px`)\n .on(\"end\", function (d, i) {\n d3Select(this).style(\"display\", () => i === active ? null : \"none\");\n })\n ;\n this._prevActive = active;\n }\n widgetElements.exit()\n .each(function (w) {\n w.target(null);\n })\n .remove()\n ;\n }\n\n exit(domNode, element) {\n this.widgets().forEach(w => w.target(null));\n super.exit(domNode, element);\n }\n\n render(callback): this {\n return super.render(w => {\n if (!this.visible() || this.isDOMHidden()) {\n if (callback) {\n callback(w);\n }\n } else {\n const aw = this.activeWidget();\n if (aw) {\n aw\n .resize(this.size())\n .render(w2 => {\n if (callback) {\n callback(w);\n }\n })\n ;\n }\n }\n });\n }\n}\nCarousel.prototype._class += \" layout_Carousel\";\n\nexport interface Carousel {\n widgets(): Widget[];\n widgets(_: Widget[]): this;\n active(): number;\n active(_: number): this;\n transitionDuration(): Widget[];\n transitionDuration(_: Widget[]): this;\n}\n\nCarousel.prototype.publish(\"widgets\", [], \"widgetArray\", \"Widgets\", null, { render: false });\nCarousel.prototype.publish(\"active\", 0, \"number\", \"Active widget\");\nCarousel.prototype.publish(\"transitionDuration\", 500, \"number\", \"Transition duration\");\n","var pi = Math.PI,\n tau = 2 * pi,\n epsilon = 1e-6,\n tauEpsilon = tau - epsilon;\n\nfunction Path() {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n}\n\nfunction path() {\n return new Path;\n}\n\nPath.prototype = path.prototype = {\n constructor: Path,\n moveTo: function(x, y) {\n this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y);\n },\n closePath: function() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._ += \"Z\";\n }\n },\n lineTo: function(x, y) {\n this._ += \"L\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n quadraticCurveTo: function(x1, y1, x, y) {\n this._ += \"Q\" + (+x1) + \",\" + (+y1) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) {\n this._ += \"C\" + (+x1) + \",\" + (+y1) + \",\" + (+x2) + \",\" + (+y2) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n arcTo: function(x1, y1, x2, y2, r) {\n x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;\n var x0 = this._x1,\n y0 = this._y1,\n x21 = x2 - x1,\n y21 = y2 - y1,\n x01 = x0 - x1,\n y01 = y0 - y1,\n l01_2 = x01 * x01 + y01 * y01;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(\"negative radius: \" + r);\n\n // Is this path empty? Move to (x1,y1).\n if (this._x1 === null) {\n this._ += \"M\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n }\n\n // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.\n else if (!(l01_2 > epsilon));\n\n // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?\n // Equivalently, is (x1,y1) coincident with (x2,y2)?\n // Or, is the radius zero? Line to (x1,y1).\n else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {\n this._ += \"L\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n }\n\n // Otherwise, draw an arc!\n else {\n var x20 = x2 - x0,\n y20 = y2 - y0,\n l21_2 = x21 * x21 + y21 * y21,\n l20_2 = x20 * x20 + y20 * y20,\n l21 = Math.sqrt(l21_2),\n l01 = Math.sqrt(l01_2),\n l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),\n t01 = l / l01,\n t21 = l / l21;\n\n // If the start tangent is not coincident with (x0,y0), line to.\n if (Math.abs(t01 - 1) > epsilon) {\n this._ += \"L\" + (x1 + t01 * x01) + \",\" + (y1 + t01 * y01);\n }\n\n this._ += \"A\" + r + \",\" + r + \",0,0,\" + (+(y01 * x20 > x01 * y20)) + \",\" + (this._x1 = x1 + t21 * x21) + \",\" + (this._y1 = y1 + t21 * y21);\n }\n },\n arc: function(x, y, r, a0, a1, ccw) {\n x = +x, y = +y, r = +r, ccw = !!ccw;\n var dx = r * Math.cos(a0),\n dy = r * Math.sin(a0),\n x0 = x + dx,\n y0 = y + dy,\n cw = 1 ^ ccw,\n da = ccw ? a0 - a1 : a1 - a0;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(\"negative radius: \" + r);\n\n // Is this path empty? Move to (x0,y0).\n if (this._x1 === null) {\n this._ += \"M\" + x0 + \",\" + y0;\n }\n\n // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).\n else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {\n this._ += \"L\" + x0 + \",\" + y0;\n }\n\n // Is this arc empty? We’re done.\n if (!r) return;\n\n // Does the angle go the wrong way? Flip the direction.\n if (da < 0) da = da % tau + tau;\n\n // Is this a complete circle? Draw two arcs to complete the circle.\n if (da > tauEpsilon) {\n this._ += \"A\" + r + \",\" + r + \",0,1,\" + cw + \",\" + (x - dx) + \",\" + (y - dy) + \"A\" + r + \",\" + r + \",0,1,\" + cw + \",\" + (this._x1 = x0) + \",\" + (this._y1 = y0);\n }\n\n // Is this arc non-empty? Draw an arc!\n else if (da > epsilon) {\n this._ += \"A\" + r + \",\" + r + \",0,\" + (+(da >= pi)) + \",\" + cw + \",\" + (this._x1 = x + r * Math.cos(a1)) + \",\" + (this._y1 = y + r * Math.sin(a1));\n }\n },\n rect: function(x, y, w, h) {\n this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y) + \"h\" + (+w) + \"v\" + (+h) + \"h\" + (-w) + \"Z\";\n },\n toString: function() {\n return this._;\n }\n};\n\nexport default path;\n","export default function(x) {\n return function constant() {\n return x;\n };\n}\n","export var abs = Math.abs;\nexport var atan2 = Math.atan2;\nexport var cos = Math.cos;\nexport var max = Math.max;\nexport var min = Math.min;\nexport var sin = Math.sin;\nexport var sqrt = Math.sqrt;\n\nexport var epsilon = 1e-12;\nexport var pi = Math.PI;\nexport var halfPi = pi / 2;\nexport var tau = 2 * pi;\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function asin(x) {\n return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);\n}\n","import {pi, tau} from \"../math.js\";\n\nexport default {\n draw: function(context, size) {\n var r = Math.sqrt(size / pi);\n context.moveTo(r, 0);\n context.arc(0, 0, r, 0, tau);\n }\n};\n","export default {\n draw: function(context, size) {\n var r = Math.sqrt(size / 5) / 2;\n context.moveTo(-3 * r, -r);\n context.lineTo(-r, -r);\n context.lineTo(-r, -3 * r);\n context.lineTo(r, -3 * r);\n context.lineTo(r, -r);\n context.lineTo(3 * r, -r);\n context.lineTo(3 * r, r);\n context.lineTo(r, r);\n context.lineTo(r, 3 * r);\n context.lineTo(-r, 3 * r);\n context.lineTo(-r, r);\n context.lineTo(-3 * r, r);\n context.closePath();\n }\n};\n","var tan30 = Math.sqrt(1 / 3),\n tan30_2 = tan30 * 2;\n\nexport default {\n draw: function(context, size) {\n var y = Math.sqrt(size / tan30_2),\n x = y * tan30;\n context.moveTo(0, -y);\n context.lineTo(x, 0);\n context.lineTo(0, y);\n context.lineTo(-x, 0);\n context.closePath();\n }\n};\n","import {pi, tau} from \"../math.js\";\n\nvar ka = 0.89081309152928522810,\n kr = Math.sin(pi / 10) / Math.sin(7 * pi / 10),\n kx = Math.sin(tau / 10) * kr,\n ky = -Math.cos(tau / 10) * kr;\n\nexport default {\n draw: function(context, size) {\n var r = Math.sqrt(size * ka),\n x = kx * r,\n y = ky * r;\n context.moveTo(0, -r);\n context.lineTo(x, y);\n for (var i = 1; i < 5; ++i) {\n var a = tau * i / 5,\n c = Math.cos(a),\n s = Math.sin(a);\n context.lineTo(s * r, -c * r);\n context.lineTo(c * x - s * y, s * x + c * y);\n }\n context.closePath();\n }\n};\n","export default {\n draw: function(context, size) {\n var w = Math.sqrt(size),\n x = -w / 2;\n context.rect(x, x, w, w);\n }\n};\n","var sqrt3 = Math.sqrt(3);\n\nexport default {\n draw: function(context, size) {\n var y = -Math.sqrt(size / (sqrt3 * 3));\n context.moveTo(0, y * 2);\n context.lineTo(-sqrt3 * y, -y);\n context.lineTo(sqrt3 * y, -y);\n context.closePath();\n }\n};\n","var c = -0.5,\n s = Math.sqrt(3) / 2,\n k = 1 / Math.sqrt(12),\n a = (k / 2 + 1) * 3;\n\nexport default {\n draw: function(context, size) {\n var r = Math.sqrt(size / a),\n x0 = r / 2,\n y0 = r * k,\n x1 = x0,\n y1 = r * k + r,\n x2 = -x1,\n y2 = y1;\n context.moveTo(x0, y0);\n context.lineTo(x1, y1);\n context.lineTo(x2, y2);\n context.lineTo(c * x0 - s * y0, s * x0 + c * y0);\n context.lineTo(c * x1 - s * y1, s * x1 + c * y1);\n context.lineTo(c * x2 - s * y2, s * x2 + c * y2);\n context.lineTo(c * x0 + s * y0, c * y0 - s * x0);\n context.lineTo(c * x1 + s * y1, c * y1 - s * x1);\n context.lineTo(c * x2 + s * y2, c * y2 - s * x2);\n context.closePath();\n }\n};\n","import {path} from \"d3-path\";\nimport circle from \"./symbol/circle.js\";\nimport cross from \"./symbol/cross.js\";\nimport diamond from \"./symbol/diamond.js\";\nimport star from \"./symbol/star.js\";\nimport square from \"./symbol/square.js\";\nimport triangle from \"./symbol/triangle.js\";\nimport wye from \"./symbol/wye.js\";\nimport constant from \"./constant.js\";\n\nexport var symbols = [\n circle,\n cross,\n diamond,\n square,\n star,\n triangle,\n wye\n];\n\nexport default function() {\n var type = constant(circle),\n size = constant(64),\n context = null;\n\n function symbol() {\n var buffer;\n if (!context) context = buffer = path();\n type.apply(this, arguments).draw(context, +size.apply(this, arguments));\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n symbol.type = function(_) {\n return arguments.length ? (type = typeof _ === \"function\" ? _ : constant(_), symbol) : type;\n };\n\n symbol.size = function(_) {\n return arguments.length ? (size = typeof _ === \"function\" ? _ : constant(+_), symbol) : size;\n };\n\n symbol.context = function(_) {\n return arguments.length ? (context = _ == null ? null : _, symbol) : context;\n };\n\n return symbol;\n}\n","import { select } from 'd3-selection';\nimport { format, formatLocale, formatPrefix, formatSpecifier } from 'd3-format';\nimport { dispatch } from 'd3-dispatch';\nimport { scaleLinear } from 'd3-scale';\nimport { max, sum } from 'd3-array';\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n return typeof obj;\n} : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n};\n\nvar d3_identity = function d3_identity(d) {\n return d;\n};\n\nvar d3_reverse = function d3_reverse(arr) {\n var mirror = [];\n for (var i = 0, l = arr.length; i < l; i++) {\n mirror[i] = arr[l - i - 1];\n }\n return mirror;\n};\n\n//Text wrapping code adapted from Mike Bostock\nvar d3_textWrapping = function d3_textWrapping(text, width) {\n text.each(function () {\n var text = select(this),\n words = text.text().split(/\\s+/).reverse(),\n word,\n line = [],\n lineNumber = 0,\n lineHeight = 1.2,\n //ems\n y = text.attr(\"y\"),\n dy = parseFloat(text.attr(\"dy\")) || 0,\n tspan = text.text(null).append(\"tspan\").attr(\"x\", 0).attr(\"dy\", dy + \"em\");\n\n while (word = words.pop()) {\n line.push(word);\n tspan.text(line.join(\" \"));\n if (tspan.node().getComputedTextLength() > width && line.length > 1) {\n line.pop();\n tspan.text(line.join(\" \"));\n line = [word];\n tspan = text.append(\"tspan\").attr(\"x\", 0).attr(\"dy\", lineHeight + dy + \"em\").text(word);\n }\n }\n });\n};\n\nvar d3_mergeLabels = function d3_mergeLabels() {\n var gen = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n var labels = arguments[1];\n var domain = arguments[2];\n var range = arguments[3];\n var labelDelimiter = arguments[4];\n\n if ((typeof labels === \"undefined\" ? \"undefined\" : _typeof(labels)) === \"object\") {\n if (labels.length === 0) return gen;\n\n var i = labels.length;\n for (; i < gen.length; i++) {\n labels.push(gen[i]);\n }\n return labels;\n } else if (typeof labels === \"function\") {\n var customLabels = [];\n var genLength = gen.length;\n for (var _i = 0; _i < genLength; _i++) {\n customLabels.push(labels({\n i: _i,\n genLength: genLength,\n generatedLabels: gen,\n domain: domain,\n range: range,\n labelDelimiter: labelDelimiter\n }));\n }\n return customLabels;\n }\n\n return gen;\n};\n\nvar d3_linearLegend = function d3_linearLegend(scale, cells, labelFormat) {\n var data = [];\n\n if (cells.length > 1) {\n data = cells;\n } else {\n var domain = scale.domain(),\n increment = (domain[domain.length - 1] - domain[0]) / (cells - 1);\n var i = 0;\n\n for (; i < cells; i++) {\n data.push(domain[0] + i * increment);\n }\n }\n\n var labels = data.map(labelFormat);\n return {\n data: data,\n labels: labels,\n feature: function feature(d) {\n return scale(d);\n }\n };\n};\n\nvar d3_quantLegend = function d3_quantLegend(scale, labelFormat, labelDelimiter) {\n var labels = scale.range().map(function (d) {\n var invert = scale.invertExtent(d);\n return labelFormat(invert[0]) + \" \" + labelDelimiter + \" \" + labelFormat(invert[1]);\n });\n\n return {\n data: scale.range(),\n labels: labels,\n feature: d3_identity\n };\n};\n\nvar d3_ordinalLegend = function d3_ordinalLegend(scale) {\n return {\n data: scale.domain(),\n labels: scale.domain(),\n feature: function feature(d) {\n return scale(d);\n }\n };\n};\n\nvar d3_cellOver = function d3_cellOver(cellDispatcher, d, obj) {\n cellDispatcher.call(\"cellover\", obj, d);\n};\n\nvar d3_cellOut = function d3_cellOut(cellDispatcher, d, obj) {\n cellDispatcher.call(\"cellout\", obj, d);\n};\n\nvar d3_cellClick = function d3_cellClick(cellDispatcher, d, obj) {\n cellDispatcher.call(\"cellclick\", obj, d);\n};\n\nvar helper = {\n d3_drawShapes: function d3_drawShapes(shape, shapes, shapeHeight, shapeWidth, shapeRadius, path) {\n if (shape === \"rect\") {\n shapes.attr(\"height\", shapeHeight).attr(\"width\", shapeWidth);\n } else if (shape === \"circle\") {\n shapes.attr(\"r\", shapeRadius);\n } else if (shape === \"line\") {\n shapes.attr(\"x1\", 0).attr(\"x2\", shapeWidth).attr(\"y1\", 0).attr(\"y2\", 0);\n } else if (shape === \"path\") {\n shapes.attr(\"d\", path);\n }\n },\n\n d3_addText: function d3_addText(svg, enter, labels, classPrefix, labelWidth) {\n enter.append(\"text\").attr(\"class\", classPrefix + \"label\");\n var text = svg.selectAll(\"g.\" + classPrefix + \"cell text.\" + classPrefix + \"label\").data(labels).text(d3_identity);\n\n if (labelWidth) {\n svg.selectAll(\"g.\" + classPrefix + \"cell text.\" + classPrefix + \"label\").call(d3_textWrapping, labelWidth);\n }\n\n return text;\n },\n\n d3_calcType: function d3_calcType(scale, ascending, cells, labels, labelFormat, labelDelimiter) {\n var type = scale.invertExtent ? d3_quantLegend(scale, labelFormat, labelDelimiter) : scale.ticks ? d3_linearLegend(scale, cells, labelFormat) : d3_ordinalLegend(scale);\n\n //for d3.scaleSequential that doesn't have a range function\n var range = scale.range && scale.range() || scale.domain();\n type.labels = d3_mergeLabels(type.labels, labels, scale.domain(), range, labelDelimiter);\n\n if (ascending) {\n type.labels = d3_reverse(type.labels);\n type.data = d3_reverse(type.data);\n }\n\n return type;\n },\n\n d3_filterCells: function d3_filterCells(type, cellFilter) {\n var filterCells = type.data.map(function (d, i) {\n return { data: d, label: type.labels[i] };\n }).filter(cellFilter);\n var dataValues = filterCells.map(function (d) {\n return d.data;\n });\n var labelValues = filterCells.map(function (d) {\n return d.label;\n });\n type.data = type.data.filter(function (d) {\n return dataValues.indexOf(d) !== -1;\n });\n type.labels = type.labels.filter(function (d) {\n return labelValues.indexOf(d) !== -1;\n });\n return type;\n },\n\n d3_placement: function d3_placement(orient, cell, cellTrans, text, textTrans, labelAlign) {\n cell.attr(\"transform\", cellTrans);\n text.attr(\"transform\", textTrans);\n if (orient === \"horizontal\") {\n text.style(\"text-anchor\", labelAlign);\n }\n },\n\n d3_addEvents: function d3_addEvents(cells, dispatcher) {\n cells.on(\"mouseover.legend\", function (d) {\n d3_cellOver(dispatcher, d, this);\n }).on(\"mouseout.legend\", function (d) {\n d3_cellOut(dispatcher, d, this);\n }).on(\"click.legend\", function (d) {\n d3_cellClick(dispatcher, d, this);\n });\n },\n\n d3_title: function d3_title(svg, title, classPrefix, titleWidth) {\n if (title !== \"\") {\n var titleText = svg.selectAll(\"text.\" + classPrefix + \"legendTitle\");\n\n titleText.data([title]).enter().append(\"text\").attr(\"class\", classPrefix + \"legendTitle\");\n\n svg.selectAll(\"text.\" + classPrefix + \"legendTitle\").text(title);\n\n if (titleWidth) {\n svg.selectAll(\"text.\" + classPrefix + \"legendTitle\").call(d3_textWrapping, titleWidth);\n }\n\n var cellsSvg = svg.select(\".\" + classPrefix + \"legendCells\");\n var yOffset = svg.select(\".\" + classPrefix + \"legendTitle\").nodes().map(function (d) {\n return d.getBBox().height;\n })[0],\n xOffset = -cellsSvg.nodes().map(function (d) {\n return d.getBBox().x;\n })[0];\n cellsSvg.attr(\"transform\", \"translate(\" + xOffset + \",\" + yOffset + \")\");\n }\n },\n\n d3_defaultLocale: {\n format: format,\n formatPrefix: formatPrefix\n },\n\n d3_defaultFormatSpecifier: \".01f\",\n\n d3_defaultDelimiter: \"to\"\n};\n\nfunction color() {\n var scale = scaleLinear(),\n shape = \"rect\",\n shapeWidth = 15,\n shapeHeight = 15,\n shapeRadius = 10,\n shapePadding = 2,\n cells = [5],\n cellFilter = void 0,\n labels = [],\n classPrefix = \"\",\n useClass = false,\n title = \"\",\n locale = helper.d3_defaultLocale,\n specifier = helper.d3_defaultFormatSpecifier,\n labelOffset = 10,\n labelAlign = \"middle\",\n labelDelimiter = helper.d3_defaultDelimiter,\n labelWrap = void 0,\n orient = \"vertical\",\n ascending = false,\n path = void 0,\n titleWidth = void 0,\n legendDispatcher = dispatch(\"cellover\", \"cellout\", \"cellclick\");\n\n function legend(svg) {\n var type = helper.d3_calcType(scale, ascending, cells, labels, locale.format(specifier), labelDelimiter),\n legendG = svg.selectAll(\"g\").data([scale]);\n\n legendG.enter().append(\"g\").attr(\"class\", classPrefix + \"legendCells\");\n\n if (cellFilter) {\n helper.d3_filterCells(type, cellFilter);\n }\n\n var cell = svg.select(\".\" + classPrefix + \"legendCells\").selectAll(\".\" + classPrefix + \"cell\").data(type.data);\n\n var cellEnter = cell.enter().append(\"g\").attr(\"class\", classPrefix + \"cell\");\n cellEnter.append(shape).attr(\"class\", classPrefix + \"swatch\");\n\n var shapes = svg.selectAll(\"g.\" + classPrefix + \"cell \" + shape + \".\" + classPrefix + \"swatch\").data(type.data);\n\n //add event handlers\n helper.d3_addEvents(cellEnter, legendDispatcher);\n\n cell.exit().transition().style(\"opacity\", 0).remove();\n shapes.exit().transition().style(\"opacity\", 0).remove();\n\n shapes = shapes.merge(shapes);\n\n helper.d3_drawShapes(shape, shapes, shapeHeight, shapeWidth, shapeRadius, path);\n var text = helper.d3_addText(svg, cellEnter, type.labels, classPrefix, labelWrap);\n\n // we need to merge the selection, otherwise changes in the legend (e.g. change of orientation) are applied only to the new cells and not the existing ones.\n cell = cellEnter.merge(cell);\n\n // sets placement\n var textSize = text.nodes().map(function (d) {\n return d.getBBox();\n }),\n shapeSize = shapes.nodes().map(function (d) {\n return d.getBBox();\n });\n //sets scale\n //everything is fill except for line which is stroke,\n if (!useClass) {\n if (shape == \"line\") {\n shapes.style(\"stroke\", type.feature);\n } else {\n shapes.style(\"fill\", type.feature);\n }\n } else {\n shapes.attr(\"class\", function (d) {\n return classPrefix + \"swatch \" + type.feature(d);\n });\n }\n\n var cellTrans = void 0,\n textTrans = void 0,\n textAlign = labelAlign == \"start\" ? 0 : labelAlign == \"middle\" ? 0.5 : 1;\n\n //positions cells and text\n if (orient === \"vertical\") {\n (function () {\n var cellSize = textSize.map(function (d, i) {\n return Math.max(d.height, shapeSize[i].height);\n });\n\n cellTrans = function cellTrans(d, i) {\n var height = sum(cellSize.slice(0, i));\n return \"translate(0, \" + (height + i * shapePadding) + \")\";\n };\n\n textTrans = function textTrans(d, i) {\n return \"translate( \" + (shapeSize[i].width + shapeSize[i].x + labelOffset) + \", \" + (shapeSize[i].y + shapeSize[i].height / 2 + 5) + \")\";\n };\n })();\n } else if (orient === \"horizontal\") {\n cellTrans = function cellTrans(d, i) {\n return \"translate(\" + i * (shapeSize[i].width + shapePadding) + \",0)\";\n };\n textTrans = function textTrans(d, i) {\n return \"translate(\" + (shapeSize[i].width * textAlign + shapeSize[i].x) + \",\\n \" + (shapeSize[i].height + shapeSize[i].y + labelOffset + 8) + \")\";\n };\n }\n\n helper.d3_placement(orient, cell, cellTrans, text, textTrans, labelAlign);\n helper.d3_title(svg, title, classPrefix, titleWidth);\n\n cell.transition().style(\"opacity\", 1);\n }\n\n legend.scale = function (_) {\n if (!arguments.length) return scale;\n scale = _;\n return legend;\n };\n\n legend.cells = function (_) {\n if (!arguments.length) return cells;\n if (_.length > 1 || _ >= 2) {\n cells = _;\n }\n return legend;\n };\n\n legend.cellFilter = function (_) {\n if (!arguments.length) return cellFilter;\n cellFilter = _;\n return legend;\n };\n\n legend.shape = function (_, d) {\n if (!arguments.length) return shape;\n if (_ == \"rect\" || _ == \"circle\" || _ == \"line\" || _ == \"path\" && typeof d === \"string\") {\n shape = _;\n path = d;\n }\n return legend;\n };\n\n legend.shapeWidth = function (_) {\n if (!arguments.length) return shapeWidth;\n shapeWidth = +_;\n return legend;\n };\n\n legend.shapeHeight = function (_) {\n if (!arguments.length) return shapeHeight;\n shapeHeight = +_;\n return legend;\n };\n\n legend.shapeRadius = function (_) {\n if (!arguments.length) return shapeRadius;\n shapeRadius = +_;\n return legend;\n };\n\n legend.shapePadding = function (_) {\n if (!arguments.length) return shapePadding;\n shapePadding = +_;\n return legend;\n };\n\n legend.labels = function (_) {\n if (!arguments.length) return labels;\n labels = _;\n return legend;\n };\n\n legend.labelAlign = function (_) {\n if (!arguments.length) return labelAlign;\n if (_ == \"start\" || _ == \"end\" || _ == \"middle\") {\n labelAlign = _;\n }\n return legend;\n };\n\n legend.locale = function (_) {\n if (!arguments.length) return locale;\n locale = formatLocale(_);\n return legend;\n };\n\n legend.labelFormat = function (_) {\n if (!arguments.length) return legend.locale().format(specifier);\n specifier = formatSpecifier(_);\n return legend;\n };\n\n legend.labelOffset = function (_) {\n if (!arguments.length) return labelOffset;\n labelOffset = +_;\n return legend;\n };\n\n legend.labelDelimiter = function (_) {\n if (!arguments.length) return labelDelimiter;\n labelDelimiter = _;\n return legend;\n };\n\n legend.labelWrap = function (_) {\n if (!arguments.length) return labelWrap;\n labelWrap = _;\n return legend;\n };\n\n legend.useClass = function (_) {\n if (!arguments.length) return useClass;\n if (_ === true || _ === false) {\n useClass = _;\n }\n return legend;\n };\n\n legend.orient = function (_) {\n if (!arguments.length) return orient;\n _ = _.toLowerCase();\n if (_ == \"horizontal\" || _ == \"vertical\") {\n orient = _;\n }\n return legend;\n };\n\n legend.ascending = function (_) {\n if (!arguments.length) return ascending;\n ascending = !!_;\n return legend;\n };\n\n legend.classPrefix = function (_) {\n if (!arguments.length) return classPrefix;\n classPrefix = _;\n return legend;\n };\n\n legend.title = function (_) {\n if (!arguments.length) return title;\n title = _;\n return legend;\n };\n\n legend.titleWidth = function (_) {\n if (!arguments.length) return titleWidth;\n titleWidth = _;\n return legend;\n };\n\n legend.textWrap = function (_) {\n if (!arguments.length) return textWrap;\n textWrap = _;\n return legend;\n };\n\n legend.on = function () {\n var value = legendDispatcher.on.apply(legendDispatcher, arguments);\n return value === legendDispatcher ? legend : value;\n };\n\n return legend;\n}\n\nfunction size() {\n var scale = scaleLinear(),\n shape = \"rect\",\n shapeWidth = 15,\n shapePadding = 2,\n cells = [5],\n cellFilter = void 0,\n labels = [],\n classPrefix = \"\",\n title = \"\",\n locale = helper.d3_defaultLocale,\n specifier = helper.d3_defaultFormatSpecifier,\n labelOffset = 10,\n labelAlign = \"middle\",\n labelDelimiter = helper.d3_defaultDelimiter,\n labelWrap = void 0,\n orient = \"vertical\",\n ascending = false,\n path = void 0,\n titleWidth = void 0,\n legendDispatcher = dispatch(\"cellover\", \"cellout\", \"cellclick\");\n\n function legend(svg) {\n var type = helper.d3_calcType(scale, ascending, cells, labels, locale.format(specifier), labelDelimiter),\n legendG = svg.selectAll(\"g\").data([scale]);\n\n if (cellFilter) {\n helper.d3_filterCells(type, cellFilter);\n }\n\n legendG.enter().append(\"g\").attr(\"class\", classPrefix + \"legendCells\");\n\n var cell = svg.select(\".\" + classPrefix + \"legendCells\").selectAll(\".\" + classPrefix + \"cell\").data(type.data);\n var cellEnter = cell.enter().append(\"g\").attr(\"class\", classPrefix + \"cell\");\n cellEnter.append(shape).attr(\"class\", classPrefix + \"swatch\");\n\n var shapes = svg.selectAll(\"g.\" + classPrefix + \"cell \" + shape + \".\" + classPrefix + \"swatch\");\n\n //add event handlers\n helper.d3_addEvents(cellEnter, legendDispatcher);\n\n cell.exit().transition().style(\"opacity\", 0).remove();\n\n shapes.exit().transition().style(\"opacity\", 0).remove();\n shapes = shapes.merge(shapes);\n\n //creates shape\n if (shape === \"line\") {\n helper.d3_drawShapes(shape, shapes, 0, shapeWidth);\n shapes.attr(\"stroke-width\", type.feature);\n } else {\n helper.d3_drawShapes(shape, shapes, type.feature, type.feature, type.feature, path);\n }\n\n var text = helper.d3_addText(svg, cellEnter, type.labels, classPrefix, labelWrap);\n\n // we need to merge the selection, otherwise changes in the legend (e.g. change of orientation) are applied only to the new cells and not the existing ones.\n cell = cellEnter.merge(cell);\n\n //sets placement\n\n var textSize = text.nodes().map(function (d) {\n return d.getBBox();\n }),\n shapeSize = shapes.nodes().map(function (d, i) {\n var bbox = d.getBBox();\n var stroke = scale(type.data[i]);\n\n if (shape === \"line\" && orient === \"horizontal\") {\n bbox.height = bbox.height + stroke;\n } else if (shape === \"line\" && orient === \"vertical\") {\n bbox.width = bbox.width;\n }\n return bbox;\n });\n\n var maxH = max(shapeSize, function (d) {\n return d.height + d.y;\n }),\n maxW = max(shapeSize, function (d) {\n return d.width + d.x;\n });\n\n var cellTrans = void 0,\n textTrans = void 0,\n textAlign = labelAlign == \"start\" ? 0 : labelAlign == \"middle\" ? 0.5 : 1;\n\n //positions cells and text\n if (orient === \"vertical\") {\n (function () {\n var cellSize = textSize.map(function (d, i) {\n return Math.max(d.height, shapeSize[i].height);\n });\n var y = shape == \"circle\" || shape == \"line\" ? shapeSize[0].height / 2 : 0;\n cellTrans = function cellTrans(d, i) {\n var height = sum(cellSize.slice(0, i));\n\n return \"translate(0, \" + (y + height + i * shapePadding) + \")\";\n };\n\n textTrans = function textTrans(d, i) {\n return \"translate( \" + (maxW + labelOffset) + \",\\n \" + (shapeSize[i].y + shapeSize[i].height / 2 + 5) + \")\";\n };\n })();\n } else if (orient === \"horizontal\") {\n (function () {\n cellTrans = function cellTrans(d, i) {\n var width = sum(shapeSize.slice(0, i), function (d) {\n return d.width;\n });\n var y = shape == \"circle\" || shape == \"line\" ? maxH / 2 : 0;\n return \"translate(\" + (width + i * shapePadding) + \", \" + y + \")\";\n };\n\n var offset = shape == \"line\" ? maxH / 2 : maxH;\n textTrans = function textTrans(d, i) {\n return \"translate( \" + (shapeSize[i].width * textAlign + shapeSize[i].x) + \",\\n \" + (offset + labelOffset) + \")\";\n };\n })();\n }\n\n helper.d3_placement(orient, cell, cellTrans, text, textTrans, labelAlign);\n helper.d3_title(svg, title, classPrefix, titleWidth);\n\n cell.transition().style(\"opacity\", 1);\n }\n\n legend.scale = function (_) {\n if (!arguments.length) return scale;\n scale = _;\n return legend;\n };\n\n legend.cells = function (_) {\n if (!arguments.length) return cells;\n if (_.length > 1 || _ >= 2) {\n cells = _;\n }\n return legend;\n };\n\n legend.cellFilter = function (_) {\n if (!arguments.length) return cellFilter;\n cellFilter = _;\n return legend;\n };\n\n legend.shape = function (_, d) {\n if (!arguments.length) return shape;\n if (_ == \"rect\" || _ == \"circle\" || _ == \"line\") {\n shape = _;\n path = d;\n }\n return legend;\n };\n\n legend.shapeWidth = function (_) {\n if (!arguments.length) return shapeWidth;\n shapeWidth = +_;\n return legend;\n };\n\n legend.shapePadding = function (_) {\n if (!arguments.length) return shapePadding;\n shapePadding = +_;\n return legend;\n };\n\n legend.labels = function (_) {\n if (!arguments.length) return labels;\n labels = _;\n return legend;\n };\n\n legend.labelAlign = function (_) {\n if (!arguments.length) return labelAlign;\n if (_ == \"start\" || _ == \"end\" || _ == \"middle\") {\n labelAlign = _;\n }\n return legend;\n };\n\n legend.locale = function (_) {\n if (!arguments.length) return locale;\n locale = formatLocale(_);\n return legend;\n };\n\n legend.labelFormat = function (_) {\n if (!arguments.length) return legend.locale().format(specifier);\n specifier = formatSpecifier(_);\n return legend;\n };\n\n legend.labelOffset = function (_) {\n if (!arguments.length) return labelOffset;\n labelOffset = +_;\n return legend;\n };\n\n legend.labelDelimiter = function (_) {\n if (!arguments.length) return labelDelimiter;\n labelDelimiter = _;\n return legend;\n };\n\n legend.labelWrap = function (_) {\n if (!arguments.length) return labelWrap;\n labelWrap = _;\n return legend;\n };\n\n legend.orient = function (_) {\n if (!arguments.length) return orient;\n _ = _.toLowerCase();\n if (_ == \"horizontal\" || _ == \"vertical\") {\n orient = _;\n }\n return legend;\n };\n\n legend.ascending = function (_) {\n if (!arguments.length) return ascending;\n ascending = !!_;\n return legend;\n };\n\n legend.classPrefix = function (_) {\n if (!arguments.length) return classPrefix;\n classPrefix = _;\n return legend;\n };\n\n legend.title = function (_) {\n if (!arguments.length) return title;\n title = _;\n return legend;\n };\n\n legend.titleWidth = function (_) {\n if (!arguments.length) return titleWidth;\n titleWidth = _;\n return legend;\n };\n\n legend.on = function () {\n var value = legendDispatcher.on.apply(legendDispatcher, arguments);\n return value === legendDispatcher ? legend : value;\n };\n\n return legend;\n}\n\nfunction symbol() {\n var scale = scaleLinear(),\n shape = \"path\",\n shapeWidth = 15,\n shapeHeight = 15,\n shapeRadius = 10,\n shapePadding = 5,\n cells = [5],\n cellFilter = void 0,\n labels = [],\n classPrefix = \"\",\n title = \"\",\n locale = helper.d3_defaultLocale,\n specifier = helper.d3_defaultFormatSpecifier,\n labelAlign = \"middle\",\n labelOffset = 10,\n labelDelimiter = helper.d3_defaultDelimiter,\n labelWrap = void 0,\n orient = \"vertical\",\n ascending = false,\n titleWidth = void 0,\n legendDispatcher = dispatch(\"cellover\", \"cellout\", \"cellclick\");\n\n function legend(svg) {\n var type = helper.d3_calcType(scale, ascending, cells, labels, locale.format(specifier), labelDelimiter),\n legendG = svg.selectAll(\"g\").data([scale]);\n\n if (cellFilter) {\n helper.d3_filterCells(type, cellFilter);\n }\n\n legendG.enter().append(\"g\").attr(\"class\", classPrefix + \"legendCells\");\n\n var cell = svg.select(\".\" + classPrefix + \"legendCells\").selectAll(\".\" + classPrefix + \"cell\").data(type.data);\n var cellEnter = cell.enter().append(\"g\").attr(\"class\", classPrefix + \"cell\");\n cellEnter.append(shape).attr(\"class\", classPrefix + \"swatch\");\n\n var shapes = svg.selectAll(\"g.\" + classPrefix + \"cell \" + shape + \".\" + classPrefix + \"swatch\");\n\n //add event handlers\n helper.d3_addEvents(cellEnter, legendDispatcher);\n\n //remove old shapes\n cell.exit().transition().style(\"opacity\", 0).remove();\n shapes.exit().transition().style(\"opacity\", 0).remove();\n shapes = shapes.merge(shapes);\n\n helper.d3_drawShapes(shape, shapes, shapeHeight, shapeWidth, shapeRadius, type.feature);\n var text = helper.d3_addText(svg, cellEnter, type.labels, classPrefix, labelWrap);\n\n // we need to merge the selection, otherwise changes in the legend (e.g. change of orientation) are applied only to the new cells and not the existing ones.\n cell = cellEnter.merge(cell);\n\n // sets placement\n var textSize = text.nodes().map(function (d) {\n return d.getBBox();\n }),\n shapeSize = shapes.nodes().map(function (d) {\n return d.getBBox();\n });\n\n var maxH = max(shapeSize, function (d) {\n return d.height;\n }),\n maxW = max(shapeSize, function (d) {\n return d.width;\n });\n\n var cellTrans = void 0,\n textTrans = void 0,\n textAlign = labelAlign == \"start\" ? 0 : labelAlign == \"middle\" ? 0.5 : 1;\n\n //positions cells and text\n if (orient === \"vertical\") {\n (function () {\n var cellSize = textSize.map(function (d, i) {\n return Math.max(maxH, d.height);\n });\n\n cellTrans = function cellTrans(d, i) {\n var height = sum(cellSize.slice(0, i));\n return \"translate(0, \" + (height + i * shapePadding) + \" )\";\n };\n textTrans = function textTrans(d, i) {\n return \"translate( \" + (maxW + labelOffset) + \",\\n \" + (shapeSize[i].y + shapeSize[i].height / 2 + 5) + \")\";\n };\n })();\n } else if (orient === \"horizontal\") {\n cellTrans = function cellTrans(d, i) {\n return \"translate( \" + i * (maxW + shapePadding) + \",0)\";\n };\n textTrans = function textTrans(d, i) {\n return \"translate( \" + (shapeSize[i].width * textAlign + shapeSize[i].x) + \",\\n \" + (maxH + labelOffset) + \")\";\n };\n }\n\n helper.d3_placement(orient, cell, cellTrans, text, textTrans, labelAlign);\n helper.d3_title(svg, title, classPrefix, titleWidth);\n cell.transition().style(\"opacity\", 1);\n }\n\n legend.scale = function (_) {\n if (!arguments.length) return scale;\n scale = _;\n return legend;\n };\n\n legend.cells = function (_) {\n if (!arguments.length) return cells;\n if (_.length > 1 || _ >= 2) {\n cells = _;\n }\n return legend;\n };\n\n legend.cellFilter = function (_) {\n if (!arguments.length) return cellFilter;\n cellFilter = _;\n return legend;\n };\n\n legend.shapePadding = function (_) {\n if (!arguments.length) return shapePadding;\n shapePadding = +_;\n return legend;\n };\n\n legend.labels = function (_) {\n if (!arguments.length) return labels;\n labels = _;\n return legend;\n };\n\n legend.labelAlign = function (_) {\n if (!arguments.length) return labelAlign;\n if (_ == \"start\" || _ == \"end\" || _ == \"middle\") {\n labelAlign = _;\n }\n return legend;\n };\n\n legend.locale = function (_) {\n if (!arguments.length) return locale;\n locale = formatLocale(_);\n return legend;\n };\n\n legend.labelFormat = function (_) {\n if (!arguments.length) return legend.locale().format(specifier);\n specifier = formatSpecifier(_);\n return legend;\n };\n\n legend.labelOffset = function (_) {\n if (!arguments.length) return labelOffset;\n labelOffset = +_;\n return legend;\n };\n\n legend.labelDelimiter = function (_) {\n if (!arguments.length) return labelDelimiter;\n labelDelimiter = _;\n return legend;\n };\n\n legend.labelWrap = function (_) {\n if (!arguments.length) return labelWrap;\n labelWrap = _;\n return legend;\n };\n\n legend.orient = function (_) {\n if (!arguments.length) return orient;\n _ = _.toLowerCase();\n if (_ == \"horizontal\" || _ == \"vertical\") {\n orient = _;\n }\n return legend;\n };\n\n legend.ascending = function (_) {\n if (!arguments.length) return ascending;\n ascending = !!_;\n return legend;\n };\n\n legend.classPrefix = function (_) {\n if (!arguments.length) return classPrefix;\n classPrefix = _;\n return legend;\n };\n\n legend.title = function (_) {\n if (!arguments.length) return title;\n title = _;\n return legend;\n };\n\n legend.titleWidth = function (_) {\n if (!arguments.length) return titleWidth;\n titleWidth = _;\n return legend;\n };\n\n legend.on = function () {\n var value = legendDispatcher.on.apply(legendDispatcher, arguments);\n return value === legendDispatcher ? legend : value;\n };\n\n return legend;\n}\n\nvar thresholdLabels = function thresholdLabels(_ref) {\n var i = _ref.i,\n genLength = _ref.genLength,\n generatedLabels = _ref.generatedLabels,\n labelDelimiter = _ref.labelDelimiter;\n\n if (i === 0) {\n var values = generatedLabels[i].split(\" \" + labelDelimiter + \" \");\n return \"Less than \" + values[1];\n } else if (i === genLength - 1) {\n var _values = generatedLabels[i].split(\" \" + labelDelimiter + \" \");\n return _values[0] + \" or more\";\n }\n return generatedLabels[i];\n};\n\nvar legendHelpers = {\n thresholdLabels: thresholdLabels\n};\n\nvar index = {\n legendColor: color,\n legendSize: size,\n legendSymbol: symbol,\n legendHelpers: legendHelpers\n};\n\nexport { color as legendColor, size as legendSize, symbol as legendSymbol, legendHelpers };export default index;\n//# sourceMappingURL=indexRollupNext.js.map\n","import { instanceOfIHighlight } from \"@hpcc-js/api\";\nimport { Database, Palette, SVGWidget, Widget } from \"@hpcc-js/common\";\nimport { format as d3Format } from \"d3-format\";\nimport { scaleOrdinal as d3ScaleOrdinal } from \"d3-scale\";\nimport {\n symbol as d3Symbol,\n symbolCircle as d3SymbolCircle,\n symbolCross as d3SymbolCross,\n symbolDiamond as d3SymbolDiamond,\n symbolSquare as d3SymbolSquare,\n symbolStar as d3SymbolStar,\n symbolTriangle as d3SymbolTriangle,\n symbolWye as d3SymbolWye\n} from \"d3-shape\";\nimport { legendColor as d3LegendColor } from \"d3-svg-legend\";\nimport { ChartPanel } from \"./ChartPanel.ts\";\n\nexport class Legend extends SVGWidget {\n _owner: ChartPanel;\n _targetWidget: Widget;\n _targetWidgetMonitor;\n _legendOrdinal;\n _disabled: string[] = [];\n\n private _symbolTypeMap = {\n \"circle\": d3SymbolCircle,\n \"cross\": d3SymbolCross,\n \"diamond\": d3SymbolDiamond,\n \"square\": d3SymbolSquare,\n \"star\": d3SymbolStar,\n \"triangle\": d3SymbolTriangle,\n \"wye\": d3SymbolWye\n };\n\n constructor(owner: ChartPanel) {\n super();\n this._owner = owner;\n this._drawStartPos = \"origin\";\n\n const context = this;\n this._legendOrdinal = d3LegendColor()\n .shape(\"path\", d3Symbol().type(d3SymbolCircle).size(150)())\n .shapePadding(10)\n .shapeRadius(10)\n .on(\"cellclick\", function (d) {\n context.onClick(d, this);\n })\n .on(\"cellover\", (d) => {\n context.onOver(d, this);\n })\n .on(\"cellout\", (d) => {\n context.onOut(d, this);\n })\n ;\n }\n\n isDisabled(d: string | Database.Field): boolean {\n if (typeof d === \"undefined\") {\n return false;\n } else if (typeof d === \"string\") {\n return d.indexOf(\"__\") === 0 || this._disabled.indexOf(d) >= 0;\n } else if (d instanceof Database.Field) {\n return d.id().indexOf(\"__\") === 0 || this._disabled.indexOf(d.id()) >= 0;\n }\n return this._disabled.indexOf(d) >= 0;\n }\n\n filteredFields(): Database.Field[] {\n switch (this.dataFamily()) {\n case \"2D\":\n return this.fields();\n case \"ND\":\n return this.fields().filter(d => !this.isDisabled(d));\n }\n return this.fields();\n }\n\n filteredColumns(): string[] {\n switch (this.dataFamily()) {\n case \"2D\":\n return this.columns();\n case \"ND\":\n return this.columns().filter(d => !this.isDisabled(d));\n }\n return this.columns();\n }\n\n filteredData(): any[][] {\n switch (this.dataFamily()) {\n case \"2D\":\n return this.data().filter(row => !this.isDisabled(row[0]));\n case \"ND\":\n const disabledCols: { [key: number]: boolean } = {};\n let anyDisabled: boolean = false;\n this.columns().forEach((col, idx) => {\n const disabled = this.isDisabled(col);\n disabledCols[idx] = disabled;\n if (disabled) {\n anyDisabled = true;\n }\n });\n return !anyDisabled ? this.data() : this.data().map(row => {\n return row.filter((cell, idx) => !disabledCols[idx]);\n });\n }\n return this.data();\n }\n\n isRainbow() {\n const widget = this.getWidget();\n return widget && widget._palette && widget._palette.type() === \"rainbow\";\n }\n\n targetWidget(): Widget;\n targetWidget(_: Widget): this;\n targetWidget(_?: Widget): Widget | this {\n if (!arguments.length) return this._targetWidget;\n this._targetWidget = _;\n if (this._targetWidgetMonitor) {\n this._targetWidgetMonitor.remove();\n delete this._targetWidgetMonitor;\n }\n if (this._targetWidget) {\n const context = this;\n this._targetWidgetMonitor = this._targetWidget.monitor(function (key, newProp, oldProp, source) {\n switch (key) {\n case \"chart\":\n case \"columns\":\n case \"data\":\n case \"paletteID\":\n context.lazyRender();\n break;\n }\n });\n }\n return this;\n }\n\n getWidget() {\n if (this._targetWidget) {\n switch (this._targetWidget.classID()) {\n case \"composite_MultiChart\":\n return (this._targetWidget as any).chart();\n }\n }\n return this._targetWidget;\n }\n\n getPalette(): Palette.OrdinalPaletteFunc | Palette.RainbowPaletteFunc {\n const widget = this.getWidget();\n if (widget && widget._palette) {\n switch (widget._palette.type()) {\n case \"ordinal\":\n return Palette.ordinal(widget._palette.id());\n case \"rainbow\":\n return Palette.rainbow(widget._palette.id());\n }\n }\n return Palette.ordinal(\"default\");\n }\n\n getPaletteType() {\n return this.getPalette().type();\n }\n\n fillColorFunc() {\n const widget = this.getWidget();\n if (widget && widget.fillColor) {\n // Legend will render before the widget, so its possible the widgets palette will not have switched yet...\n if (widget._palette && widget.paletteID && widget._palette.name !== widget.paletteID()) {\n widget._palette = widget._palette.switch(widget.paletteID());\n }\n return (row, col, sel) => {\n return widget.fillColor(row, col, sel);\n };\n }\n const palette = Palette.ordinal(widget && widget.paletteID ? widget.paletteID() || \"default\" : \"default\");\n return (row, col, sel) => {\n return palette(col);\n };\n }\n\n fillColor(row, col, sel) {\n return this.fillColorFunc()(row, col, sel);\n }\n\n protected _g;\n enter(domNode, element) {\n super.enter(domNode, element);\n this._g = element.append(\"g\")\n .attr(\"class\", \"legendOrdinal\")\n ;\n }\n\n calcMetaData() {\n let dataArr = [];\n let total = 0;\n let maxLabelWidth = 0;\n const colLength = this.columns().length;\n\n if (this._targetWidget) {\n const columns = this.columns();\n switch (this.getPaletteType()) {\n case \"ordinal\":\n const fillColor = this.fillColorFunc();\n let val = 0;\n switch (this.dataFamily()) {\n case \"2D\":\n dataArr = this.data().map(function (n, i) {\n val = this.data()[i].slice(1, colLength).reduce((acc, n) => acc + n, 0);\n const disabled = this.isDisabled(n[0]);\n if (!disabled) total += val;\n const label = n[0] + (!disabled && this.showSeriesTotal() ? ` (${val})` : \"\");\n const textSize = this.textSize(label);\n if (maxLabelWidth < textSize.width) maxLabelWidth = textSize.width;\n return [fillColor(n, n[0], false), n[0], label];\n }, this);\n break;\n case \"ND\":\n const widgetColumns = this.columns().filter(col => col.indexOf(\"__\") !== 0);\n dataArr = widgetColumns.filter(function (n, i) { return i > 0; }).map(function (n, i) {\n val = this.data().reduce((acc, n) => acc + n[i + 1], 0);\n const disabled = this.isDisabled(columns[i + 1]);\n const label = n + (!disabled && this.showSeriesTotal() ? ` (${val})` : \"\");\n if (!disabled) total += val;\n const textSize = this.textSize(label);\n if (maxLabelWidth < textSize.width) maxLabelWidth = textSize.width;\n return [fillColor(undefined, n, false), n, label];\n }, this);\n break;\n default:\n const widgetColumns2 = this.columns();\n dataArr = widgetColumns2.map(function (n) {\n return [fillColor(undefined, n, false), n];\n }, this);\n break;\n }\n break;\n case \"rainbow\":\n const palette = this.getPalette() as Palette.RainbowPaletteFunc;\n const format = d3Format(this.rainbowFormat());\n const widget = this.getWidget();\n const steps = this.rainbowBins();\n const weightMin: number = widget._dataMinWeight;\n const weightMax: number = widget._dataMaxWeight;\n const stepWeightDiff = (weightMax - weightMin) / (steps - 1);\n dataArr.push([palette(weightMin, weightMin, weightMax), format(weightMin)]);\n for (let x = 1; x < steps - 1; ++x) {\n let mid = stepWeightDiff * x;\n if (Math.floor(mid) > parseInt(dataArr[0][1])) {\n mid = Math.floor(mid);\n }\n dataArr.push([palette(mid, weightMin, weightMax), format(mid)]);\n }\n dataArr.push([palette(weightMax, weightMin, weightMax), format(weightMax)]);\n break;\n }\n }\n return {\n dataArr,\n total,\n maxLabelWidth\n };\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n\n const { dataArr, maxLabelWidth, total } = this.calcMetaData();\n\n const radius = this.shapeRadius();\n const size = this.radiusToSymbolSize(radius);\n\n const strokeWidth = 1;\n\n let shapePadding = this.itemPadding();// + strokeWidth;\n if (this.orientation() === \"horizontal\") {\n shapePadding += maxLabelWidth - (radius * 2);\n }\n\n const ordinal = d3ScaleOrdinal()\n .domain(dataArr.map(row => row[1]))\n .range(dataArr.map(row => row[0]));\n this._legendOrdinal\n .shape(\"path\", d3Symbol().type(this._symbolTypeMap[this.symbolType()]).size(size)())\n .orient(this.orientation())\n .title(this.title())\n .labelWrap(this.labelMaxWidth())\n .labelAlign(this.labelAlign())\n .shapePadding(shapePadding)\n .scale(ordinal)\n .labels(d => dataArr[d.i][2])\n ;\n\n this._g.call(this._legendOrdinal);\n\n this.updateDisabled(element, dataArr);\n\n const legendCellsBbox = this._g.select(\".legendCells\").node().getBBox();\n let offsetX = Math.abs(legendCellsBbox.x);\n let offsetY = Math.abs(legendCellsBbox.y) + strokeWidth;\n\n if (this.orientation() === \"horizontal\") {\n if (this.labelAlign() === \"start\") {\n offsetX += strokeWidth;\n } else if (this.labelAlign() === \"end\") {\n offsetX -= strokeWidth;\n }\n if (this.width() > legendCellsBbox.width) {\n const extraWidth = this.width() - legendCellsBbox.width;\n offsetX += (extraWidth / 2);\n }\n } else if (this.orientation() === \"vertical\") {\n offsetX += strokeWidth;\n if (this._containerSize.height > legendCellsBbox.height) {\n const extraHeight = this.height() - legendCellsBbox.height;\n offsetY += (extraHeight / 2);\n }\n }\n\n this._g.attr(\"transform\", `translate(${offsetX}, ${offsetY})`);\n this.pos({\n x: 0,\n y: 0\n });\n this._legendOrdinal\n .labelOffset(this.itemPadding())\n ;\n const legendTotal = this._g.selectAll(\".legendTotal\").data(dataArr.length && this.showLegendTotal() ? [total] : []);\n const totalText = `Total: ${total}`;\n const totalOffsetX = -offsetX;\n const totalOffsetY = legendCellsBbox.height + this.itemPadding() + strokeWidth;\n this.enableOverflowScroll(false);\n this.enableOverflow(true);\n legendTotal\n .enter()\n .append(\"text\")\n .classed(\"legendTotal\", true)\n .merge(legendTotal)\n .attr(\"transform\", `translate(${totalOffsetX}, ${totalOffsetY})`)\n .text(totalText)\n ;\n legendTotal.exit().remove();\n }\n\n updateDisabled(element, dataArr) {\n element\n .style(\"cursor\", \"pointer\")\n .selectAll(\"path.swatch\").filter((d, i) => i < dataArr.length)\n .style(\"stroke\", (d, i) => dataArr[i][0])\n .style(\"fill\", (d, i) =>\n this._disabled.indexOf(d) < 0 ? dataArr[i][0] : \"white\"\n )\n ;\n }\n\n postUpdate(domNode, element) {\n let w;\n if (this._boundingBox) {\n w = this._boundingBox.width;\n this._boundingBox.width = this._size.width;\n }\n super.postUpdate(domNode, element);\n if (w !== undefined) {\n this._boundingBox.width = w;\n }\n this._parentRelativeDiv.style(\"overflow\", \"hidden\");\n }\n\n exit(domNode, element) {\n super.exit(domNode, element);\n }\n\n radiusToSymbolSize(radius) {\n const circleSize = Math.pow(radius, 2) * Math.PI;\n switch (this.symbolType()) {\n case \"star\":\n return circleSize * 0.45;\n case \"triangle\":\n return circleSize * 0.65;\n case \"cross\":\n case \"diamond\":\n case \"wye\":\n return circleSize * 0.75;\n case \"circle\":\n return circleSize;\n case \"square\":\n return circleSize * 1.3;\n }\n }\n\n onClick(d, domNode) {\n switch (this.getPaletteType()) {\n case \"ordinal\":\n switch (this.dataFamily()) {\n case \"2D\":\n case \"ND\":\n const disabledIdx = this._disabled.indexOf(d);\n if (disabledIdx < 0) {\n this._disabled.push(d);\n } else {\n this._disabled.splice(disabledIdx, 1);\n }\n this._owner.refreshColumns();\n this._owner.refreshData();\n this._owner.render();\n break;\n }\n break;\n }\n }\n\n onOver(d, domNode) {\n if (instanceOfIHighlight(this._owner)) {\n switch (this.getPaletteType()) {\n case \"ordinal\":\n switch (this.dataFamily()) {\n case \"2D\":\n case \"ND\":\n if (this._disabled.indexOf(d) < 0) {\n this._owner.highlightColumn(d);\n }\n break;\n }\n break;\n }\n }\n }\n\n onOut(d, domNode) {\n if (instanceOfIHighlight(this._owner)) {\n switch (this.getPaletteType()) {\n case \"ordinal\":\n switch (this.dataFamily()) {\n case \"2D\":\n case \"ND\":\n this._owner.highlightColumn();\n break;\n }\n break;\n }\n }\n }\n\n onDblClick(rowData, rowIdx) {\n }\n\n onMouseOver(rowData, rowIdx) {\n }\n private _containerSize;\n resize(_size?: { width: number, height: number }) {\n let retVal;\n if (this.fitToContent()) {\n this._containerSize = _size;\n const bbox = this.getBBox();\n if (_size.width > bbox.width) {\n bbox.width = _size.width;\n }\n if (_size.height > bbox.height) {\n bbox.height = _size.height;\n }\n retVal = super.resize.apply(this, [{ ...bbox }]);\n } else {\n retVal = super.resize.apply(this, arguments);\n }\n return retVal;\n }\n\n}\nLegend.prototype._class += \" layout_Legend\";\n\nexport interface Legend {\n title(): string;\n title(_: string): this;\n symbolType(): \"circle\" | \"cross\" | \"diamond\" | \"square\" | \"star\" | \"triangle\" | \"wye\";\n symbolType(_: \"circle\" | \"cross\" | \"diamond\" | \"square\" | \"star\" | \"triangle\" | \"wye\"): this;\n labelMaxWidth(): number;\n labelMaxWidth(_: number): this;\n orientation(): \"vertical\" | \"horizontal\";\n orientation(_: \"vertical\" | \"horizontal\"): this;\n orientation_exists: () => boolean;\n dataFamily(): \"1D\" | \"2D\" | \"ND\" | \"map\" | \"graph\" | \"any\";\n dataFamily(_: \"1D\" | \"2D\" | \"ND\" | \"map\" | \"graph\" | \"any\"): this;\n dataFamily_exists: () => boolean;\n rainbowFormat(): string;\n rainbowFormat(_: string): this;\n rainbowFormat_exists: () => boolean;\n rainbowBins(): number;\n rainbowBins(_: number): this;\n rainbowBins_exists: () => boolean;\n showSeriesTotal(): boolean;\n showSeriesTotal(_: boolean): this;\n showLegendTotal(): boolean;\n showLegendTotal(_: boolean): this;\n itemPadding(): number;\n itemPadding(_: number): this;\n shapeRadius(): number;\n shapeRadius(_: number): this;\n fitToContent(): boolean;\n fitToContent(_: boolean): this;\n labelAlign(): \"start\" | \"middle\" | \"end\";\n labelAlign(_: \"start\" | \"middle\" | \"end\"): this;\n}\nLegend.prototype.publish(\"title\", \"\", \"string\", \"Title\");\nLegend.prototype.publish(\"symbolType\", \"circle\", \"set\", \"Shape of each legend item\", [\"circle\", \"cross\", \"diamond\", \"square\", \"star\", \"triangle\", \"wye\"]);\nLegend.prototype.publish(\"labelMaxWidth\", null, \"number\", \"Max Label Width (pixels)\", null, { optional: true });\nLegend.prototype.publish(\"orientation\", \"vertical\", \"set\", \"Orientation of Legend rows\", [\"vertical\", \"horizontal\"], { tags: [\"Private\"] });\nLegend.prototype.publish(\"dataFamily\", \"ND\", \"set\", \"Type of data\", [\"1D\", \"2D\", \"ND\", \"map\", \"graph\", \"any\"], { tags: [\"Private\"] });\nLegend.prototype.publish(\"rainbowFormat\", \",\", \"string\", \"Rainbow number formatting\", null, { tags: [\"Private\"], optional: true, disable: w => !w.isRainbow() });\nLegend.prototype.publish(\"rainbowBins\", 8, \"number\", \"Number of rainbow bins\", null, { tags: [\"Private\"], disable: w => !w.isRainbow() });\nLegend.prototype.publish(\"showSeriesTotal\", false, \"boolean\", \"Show value next to series\");\nLegend.prototype.publish(\"showLegendTotal\", false, \"boolean\", \"Show a total of the series values under the legend\", null);\nLegend.prototype.publish(\"itemPadding\", 8, \"number\", \"Padding between legend items (pixels)\");\nLegend.prototype.publish(\"shapeRadius\", 7, \"number\", \"Radius of legend shape (pixels)\");\nLegend.prototype.publish(\"fitToContent\", true, \"boolean\", \"If true, resize will simply reapply the bounding box dimensions\");\nLegend.prototype.publish(\"labelAlign\", \"start\", \"set\", \"Horizontal alignment of legend item label (for horizontal orientation only)\", [\"start\", \"middle\", \"end\"], { optional: true, disable: (w: any) => w.orientation() === \"vertical\" });\n","import { HTMLWidget, ISize, Widget } from \"@hpcc-js/common\";\n\nimport \"../src/Modal.css\";\n\nexport class Modal extends HTMLWidget {\n\n protected _widget: Widget;\n\n protected _relativeTarget: HTMLElement;\n\n protected _fade;\n protected _modal;\n protected _modalHeader;\n protected _modalBody;\n protected _modalHeaderAnnotations;\n protected _modalHeaderCloseButton;\n _close: () => void;\n\n constructor() {\n super();\n this._tag = \"div\";\n }\n\n closeModal() {\n this.visible(false);\n }\n\n getRelativeTarget() {\n let relativeTarget;\n if (this.relativeTargetId()) {\n relativeTarget = document.getElementById(this.relativeTargetId());\n if (relativeTarget) {\n return relativeTarget;\n }\n }\n if (!relativeTarget) {\n relativeTarget = this.locateAncestor(\"layout_Grid\");\n if (relativeTarget && relativeTarget.element) {\n return relativeTarget.element().node();\n }\n }\n return document.body;\n }\n\n setModalSize(): ISize {\n if (this.fixedHeight() !== null && this.fixedWidth() !== null) {\n this._modal\n .style(\"height\", this.fixedHeight())\n .style(\"width\", this.fixedWidth())\n .style(\"min-height\", null)\n .style(\"min-width\", null)\n .style(\"max-height\", null)\n .style(\"max-width\", null)\n ;\n } else if (this.minHeight() || this.minWidth()) {\n this._modal\n .style(\"min-height\", this.minHeight())\n .style(\"min-width\", this.minWidth())\n .style(\"max-height\", this.maxHeight())\n .style(\"max-width\", this.maxWidth())\n ;\n }\n const modalRect = this._modal.node().getBoundingClientRect();\n const headerRect = this._modalHeader.node().getBoundingClientRect();\n this._modalBody\n .style(\"height\", (modalRect.height - headerRect.height) + \"px\")\n .style(\"width\", modalRect.width);\n\n return modalRect;\n }\n\n setFadePosition(rect) {\n this._fade\n .style(\"top\", rect.top + \"px\")\n .style(\"left\", rect.left + \"px\")\n .style(\"width\", rect.width + \"px\")\n .style(\"height\", rect.height + \"px\")\n ;\n }\n\n setModalPosition(rect) {\n const modalRect = this.setModalSize();\n if (this.fixedTop() !== null && this.fixedLeft() !== null) {\n this._modal\n .style(\"top\", `calc(${this.fixedTop()} + ${rect.top}px)`)\n .style(\"left\", `calc(${this.fixedLeft()} + ${rect.left}px)`)\n ;\n } else if (this.fixedHeight() !== null && this.fixedWidth() !== null) {\n this._modal\n .style(\"top\", (rect.top + (rect.height / 2) - (modalRect.height / 2)) + \"px\")\n .style(\"left\", (rect.left + (rect.width / 2) - (modalRect.width / 2)) + \"px\")\n ;\n } else if (this.minHeight() || this.minWidth()) {\n const contentRect = this._modal.node().getBoundingClientRect();\n this._modal\n .style(\"top\", (rect.top + (rect.height / 2) - (contentRect.height / 2)) + \"px\")\n .style(\"left\", (rect.left + (rect.width / 2) - (contentRect.width / 2)) + \"px\")\n ;\n }\n }\n\n resize(size?: any): this {\n super.resize();\n if (this._modal) this.setModalSize();\n return this;\n }\n\n resizeBodySync(width: number, height: number): this {\n const header = this._modalHeader.node();\n const headerRect = header.getBoundingClientRect();\n\n this._modal\n .style(\"width\", width + \"px\")\n .style(\"height\", (height + headerRect.height) + \"px\")\n .style(\"min-width\", width + \"px\")\n .style(\"min-height\", (height + headerRect.height) + \"px\")\n ;\n this._modalHeader\n .style(\"width\", width + \"px\")\n ;\n this._modalBody\n .style(\"width\", width + \"px\")\n .style(\"height\", height + \"px\")\n ;\n return this\n .minWidth(width + \"px\")\n .minHeight((height + headerRect.height) + \"px\")\n .resize({\n height: height + headerRect.height,\n width\n })\n ;\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this._fade = element.append(\"div\")\n .classed(\"layout_Modal-fade\", true)\n .classed(\"layout_Modal-fadeClickable\", this.enableClickFadeToClose())\n .classed(\"layout_Modal-fade-hidden\", !this.showFade())\n ;\n const header_h = this.titleFontSize() * 2;\n this._modal = element.append(\"div\")\n .classed(\"layout_Modal-content\", true)\n ;\n this._modalHeader = this._modal.append(\"div\")\n .classed(\"layout_Modal-header\", true)\n .style(\"color\", this.titleFontColor())\n .style(\"font-size\", this.titleFontSize() + \"px\")\n .style(\"height\", header_h + \"px\")\n ;\n this._modalBody = this._modal.append(\"div\")\n .classed(\"layout_Modal-body\", true)\n .style(\"height\", `calc( 100% - ${header_h}px )`)\n .style(\"overflow-x\", this.overflowX())\n .style(\"overflow-y\", this.overflowY())\n ;\n this._modalHeader.append(\"div\")\n .classed(\"layout_Modal-title\", true)\n .style(\"line-height\", this.titleFontSize() + \"px\")\n .style(\"top\", (this.titleFontSize() / 2) + \"px\")\n .style(\"left\", (this.titleFontSize() / 2) + \"px\")\n .text(this.formattedTitle())\n ;\n\n this._modalHeaderAnnotations = this._modalHeader.append(\"div\")\n .classed(\"layout_Modal-annotations\", true)\n ;\n this._modalHeaderCloseButton = this._modalHeaderAnnotations.append(\"div\")\n .classed(\"layout_Modal-closeButton\", true)\n .html(\"<i class=\\\"fa fa-close\\\"></i>\")\n ;\n\n this._modalHeaderAnnotations\n .style(\"line-height\", this.titleFontSize() + \"px\")\n .style(\"right\", (this.titleFontSize() / 2) + \"px\")\n .style(\"top\", (this.titleFontSize() / 2) + \"px\")\n ;\n this._modalHeaderCloseButton.on(\"click\", () => {\n this.closeModal();\n });\n this._fade.on(\"click\", n => {\n if (this.enableClickFadeToClose()) {\n this.closeModal();\n }\n });\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n element.style(\"display\", this.show() ? null : \"none\");\n this._fade.classed(\"layout_Modal-fade-hidden\", !this.showFade());\n this._relativeTarget = this.getRelativeTarget();\n\n this.setModalSize();\n const rect = this._relativeTarget.getBoundingClientRect();\n this.setFadePosition(rect);\n this.setModalPosition(rect);\n\n if (this.show()) {\n if (!this._widget.target()) {\n this._widget.target(this._modalBody.node());\n }\n this._widget.resize().render();\n } else {\n this._widget\n .target(null)\n .render()\n ;\n }\n }\n\n exit(domNode, element) {\n if (this._widget) {\n this._widget.target(null);\n }\n super.exit(domNode, element);\n }\n\n formattedTitle() {\n const title = this.title_exists() ? this.title().trim() : \"\";\n if (title.length > 0 && title.slice(0, 1) === \"(\" && title.slice(-1) === \")\") {\n return title.slice(1, -1);\n }\n return this.title();\n }\n}\nModal.prototype._class += \" layout_Modal\";\n\nexport interface Modal {\n show(): boolean;\n show(_: boolean): this;\n showFade(): boolean;\n showFade(_: boolean): this;\n enableClickFadeToClose(): boolean;\n enableClickFadeToClose(_: boolean): this;\n title(): string;\n title(_: string): this;\n title_exists(): boolean;\n titleFontSize(): number;\n titleFontSize(_: number): this;\n titleFontColor(): string;\n titleFontColor(_: string): this;\n minWidth(): string;\n minWidth(_: string): this;\n minHeight(): string;\n minHeight(_: string): this;\n maxWidth(): string;\n maxWidth(_: string): this;\n maxHeight(): string;\n maxHeight(_: string): this;\n fixedWidth(): string;\n fixedWidth(_: string): this;\n fixedHeight(): string;\n fixedHeight(_: string): this;\n fixedTop(): string;\n fixedTop(_: string): this;\n fixedLeft(): string;\n fixedLeft(_: string): this;\n relativeTargetId(): string;\n relativeTargetId(_: string): this;\n widget(): Widget;\n widget(_: Widget): this;\n overflowX(): \"hidden\" | \"scroll\";\n overflowX(_: \"hidden\" | \"scroll\"): this;\n overflowY(): \"hidden\" | \"scroll\";\n overflowY(_: \"hidden\" | \"scroll\"): this;\n}\n\nModal.prototype.publish(\"title\", null, \"string\", \"title\");\nModal.prototype.publish(\"widget\", null, \"widget\", \"widget\");\nModal.prototype.publish(\"titleFontSize\", 18, \"number\", \"titleFontSize (in pixels)\");\nModal.prototype.publish(\"titleFontColor\", \"#ffffff\", \"html-color\", \"titleFontColor\");\nModal.prototype.publish(\"relativeTargetId\", null, \"string\", \"relativeTargetId\");\n\nModal.prototype.publish(\"show\", true, \"boolean\", \"show\");\nModal.prototype.publish(\"showFade\", true, \"boolean\", \"showFade\");\nModal.prototype.publish(\"enableClickFadeToClose\", true, \"boolean\", \"enableClickFadeToClose\");\n\nModal.prototype.publish(\"minWidth\", \"400px\", \"string\", \"minWidth\");\nModal.prototype.publish(\"minHeight\", \"400px\", \"string\", \"minHeight\");\nModal.prototype.publish(\"maxWidth\", \"800px\", \"string\", \"maxWidth\");\nModal.prototype.publish(\"maxHeight\", \"800px\", \"string\", \"maxHeight\");\nModal.prototype.publish(\"fixedWidth\", null, \"string\", \"fixedWidth\");\nModal.prototype.publish(\"fixedHeight\", null, \"string\", \"fixedHeight\");\nModal.prototype.publish(\"fixedTop\", null, \"string\", \"fixedTop\");\nModal.prototype.publish(\"fixedLeft\", null, \"string\", \"fixedLeft\");\nModal.prototype.publish(\"overflowX\", \"hidden\", \"string\", \"overflowX\");\nModal.prototype.publish(\"overflowY\", \"scroll\", \"string\", \"overflowY\");\n","import { IHighlight } from \"@hpcc-js/api\";\nimport { Button, Database, IconBar, ProgressBar, Spacer, SVGWidget, Text, TitleBar, ToggleButton, Utility, Widget } from \"@hpcc-js/common\";\nimport type { XYAxis } from \"@hpcc-js/chart\";\nimport { Table } from \"@hpcc-js/dgrid2\";\nimport { select as d3Select } from \"d3-selection\";\nimport { Border2 } from \"./Border2.ts\";\nimport { Carousel } from \"./Carousel.ts\";\nimport { Legend } from \"./Legend.ts\";\nimport { Modal } from \"./Modal.ts\";\n\nimport \"../src/ChartPanel.css\";\n\nexport class ChartPanel<T extends Widget = Widget> extends Border2 implements IHighlight {\n\n protected _legend = new Legend(this).enableOverflow(true);\n protected _progressBar = new ProgressBar();\n protected _autoScale = false;\n protected _resolutions = {\n tiny: { width: 100, height: 100 },\n small: { width: 300, height: 300 }\n };\n private _modal = new Modal();\n private _highlight: boolean;\n private _scale: number;\n private _orig_size: any;\n\n private _toggleInfo = new ToggleButton().faChar(\"fa-info-circle\").tooltip(\".Description\")\n .selected(false)\n .on(\"enabled\", () => {\n return this.description() !== \"\";\n })\n .on(\"click\", () => {\n if (this._toggleInfo.selected()) {\n this._modal\n .title(this.title())\n .widget(new Text().text(this.description()))\n .show(true)\n .render()\n ;\n\n const origCloseFunc = this._modal._close;\n this._modal._close = () => {\n this._toggleInfo\n .selected(false)\n .render()\n ;\n this._modal._close = origCloseFunc;\n };\n }\n })\n .on(\"mouseMove\", () => {\n /*\n this._modal.showPreview(true).render(n => {\n n.resize().render();\n });\n */\n })\n .on(\"mouseOut\", () => {\n /*\n if (this._modal.showPreview()) {\n this._modal.show(false).showPreview(false).render();\n }\n */\n });\n\n private _toggleData = new ToggleButton().faChar(\"fa-table\").tooltip(\"Data\")\n .on(\"click\", () => {\n this.dataVisible(this._toggleData.selected());\n this.render();\n });\n\n private _buttonDownload = new Button().faChar(\"fa-download\").tooltip(\"Download\")\n .on(\"click\", () => {\n this.downloadCSV();\n });\n\n private _buttonDownloadImage = new Button().faChar(\"fa-image\").tooltip(\"Download Image\")\n .on(\"click\", () => {\n this.downloadPNG();\n });\n\n private _toggleLegend = new ToggleButton().faChar(\"fa-list-ul\").tooltip(\"Legend\")\n .selected(false)\n .on(\"click\", () => {\n const selected = this._toggleLegend.selected();\n if (this.legendPosition() === \"bottom\") {\n this.showBottom(selected);\n } else if (this.legendPosition() === \"right\") {\n this.showRight(selected);\n }\n this.legendVisible(selected);\n this.render();\n });\n\n protected _spacer = new Spacer();\n\n _titleBar = new TitleBar().buttons([this._toggleData, this._buttonDownload, this._buttonDownloadImage, this._spacer, this._toggleLegend]);\n\n protected _carousel = new Carousel();\n protected _table = new Table();\n protected _widget: T;\n\n protected _hideLegendToggleList = [\"dgrid_Table\"];\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 if (this._table && this.widget_exists() && this.widget().class().indexOf(\"chart_XYAxis\") >= 0) {\n const chart = this.widget() as unknown as XYAxis;\n this._table.columns().forEach((column, idx) => {\n switch (idx === 0 ? chart.xAxisType() : chart.yAxisType()) {\n case \"linear\":\n case \"log\":\n case \"pow\":\n this._table.columnType(column, \"number\");\n break;\n case \"time\":\n this._table.columnType(column, \"time\");\n break;\n case \"ordinal\":\n default:\n this._table.columnType(column, \"string\");\n }\n this._table.columnPattern(column, idx === 0 ? chart.xAxisTypeTimePattern() : chart.yAxisTypeTimePattern());\n this._table.columnFormat(column, idx === 0 ? chart.xAxisTickFormat() : chart.yAxisTickFormat());\n });\n }\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","s","circle","text","path","d3LegendColor","n","format","d3Format","d3ScaleOrdinal","this","GridList","k","_GridList.default"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAO,MAAM,WAAW,mBACX,cAAc,SACd,gBAAgB;ACEtB,MAAM,wBAAwB,WAAW;AAAA,EAC5C,cAAc;AACJ,UAAA,GAEN,KAAK,OAAO;AAAA,EAAA;AAAA,EAGhB,MAAM,SAAS,SAAS;AACd,UAAA,MAAM,SAAS,OAAO;AAAA,EAAA;AAAA,EAGhC,OAAO,SAAS,SAAS;AACf,UAAA,OAAO,SAAS,OAAO;AAE7B,QAAI,OAAO,GACP,OAAO,GACP,QAAQ,KAAK,YAAY,GACzB,SAAS,KAAK,aAAa;AACvB,YAAA,KAAK,MAAS,GAAA;AAAA,MAClB,KAAK;AACD,eAAO,KAAK,QAAQ,GACpB,OAAO,KAAK,QAAQ,GACZ,QAAA,KAAK,kBAAkB,KAAK,QAAQ,OAAO,OAAO,KAAK,aAAa,GACnE,SAAA,KAAK,mBAAmB,KAAK,SAAS,OAAO,OAAO,KAAK,cAAc;AAChF;AAAA,MACJ,KAAK;AACM,eAAA,KAAK,QAAQ,IAAI,QAAQ,KACzB,OAAA,KAAK,QAAQ,IAAI,SAAS,KACzB,QAAA,KAAK,YAAY,MAAM,KAAK,QAAQ,OAAO,OAAO,KAAK,aAAa,IAAI,QAAQ,KAC/E,SAAA,KAAK,aAAa,MAAM,KAA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AM;AAErI,QAAQ,UAAU,QAAQ,cAAc,IAAM,WAAW,yBAAyB,MAAM,EAAE,MAAM,CAAC,OAAO,EAAA,CAAG;AAE3G,QAAQ,UAAU,QAAQ,WAAW,CAAI,GAAA,eAAe,gCAAgC,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG;AACjH,QAAQ,UAAU,QAAQ,iBAAiB,CAAI,GAAA,SAAS,uGAAuG,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG;AC5HjL,MAAM,qBAAqB,SAAS;AAAA,EACvC,cAAc;AACJ,UAAA,GACN,KAAK,oBAAoB,UAAU,GACnC,KAAK,iBAAiB,QAAQ;AAAA,EAAA;AAEtC;AACA,aAAa,UAAU,UAAU;","x_google_ignoreList":[8,9,10,11,12,13,14,15,16,17,18,19,24]}
|
|
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 = \"@hpcc-js/layout\";\nexport const PKG_VERSION = \"3.1.1\";\nexport const BUILD_VERSION = \"3.2.1\";\n","import { HTMLWidget } from \"@hpcc-js/common\";\n\nimport \"../src/AbsoluteSurface.css\";\n\nexport class AbsoluteSurface extends HTMLWidget {\n constructor() {\n super();\n\n this._tag = \"div\";\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n\n let xPos = 0;\n let yPos = 0;\n let width = this.clientWidth();\n let height = this.clientHeight();\n switch (this.units()) {\n case \"pixels\":\n xPos = this.widgetX();\n yPos = this.widgetY();\n width = this.widgetWidth() === \"\" ? width - xPos : Number(this.widgetWidth());\n height = this.widgetHeight() === \"\" ? height - yPos : Number(this.widgetHeight());\n break;\n case \"percent\":\n xPos = this.widgetX() * width / 100;\n yPos = this.widgetY() * height / 100;\n width = this.widgetWidth() === \"\" ? width - xPos : Number(this.widgetWidth()) * width / 100;\n height = this.widgetHeight() === \"\" ? height - yPos : Number(this.widgetHeight()) * height / 100;\n break;\n }\n element.style(\"opacity\", this.opacity());\n\n const widgets = element.selectAll(\"#\" + this._id + \" > .placeholder\").data(this.widget() ? [this.widget()] : [], function (d) { return d._id; });\n widgets.enter().append(\"div\")\n .attr(\"class\", \"placeholder\")\n .each(function (d) {\n d.target(this);\n })\n .merge(widgets)\n .style(\"left\", xPos + \"px\")\n .style(\"top\", yPos + \"px\")\n .style(\"width\", width + \"px\")\n .style(\"bottom\", height + \"px\")\n .each(function (d) {\n d\n .resize({ width, height })\n ;\n })\n ;\n widgets.exit().each(function (d) {\n d.target(null);\n }).remove();\n }\n\n exit(domNode, element) {\n if (this.widget()) {\n this.widget().target(null);\n }\n super.exit(domNode, element);\n }\n}\nAbsoluteSurface.prototype._class += \" layout_AbsoluteSurface\";\n\nexport interface AbsoluteSurface {\n units(): string;\n units(_: string): this;\n widgetX(): number;\n widgetX(_: number): this;\n widgetY(): number;\n widgetY(_: number): this;\n widgetWidth(): string;\n widgetWidth(_: string): this;\n widgetHeight(): string;\n widgetHeight(_: string): this;\n widget(): any;\n widget(_: any): this;\n opacity(): number;\n opacity(_: number): this;\n}\n\nAbsoluteSurface.prototype.publish(\"units\", \"percent\", \"set\", \"Units\", [\"pixels\", \"percent\"]);\nAbsoluteSurface.prototype.publish(\"widgetX\", 0, \"number\", \"Widget XPos\");\nAbsoluteSurface.prototype.publish(\"widgetY\", 0, \"number\", \"Widget YPos\");\nAbsoluteSurface.prototype.publish(\"widgetWidth\", \"100\", \"string\", \"Widget Width, omit for full\");\nAbsoluteSurface.prototype.publish(\"widgetHeight\", \"100\", \"string\", \"Widget Height, omit for full\");\nAbsoluteSurface.prototype.publish(\"widget\", null, \"widget\", \"Widget\", null, { tags: [\"Private\"] });\nAbsoluteSurface.prototype.publish(\"opacity\", 1, \"number\", \"Opacity\");\n","import { FAChar, HTMLWidget } from \"@hpcc-js/common\";\n\nimport \"../src/Accordion.css\";\n\nexport class Accordion extends HTMLWidget {\n protected _isClosed: boolean;\n titleSpan;\n iconDiv;\n ul;\n icon;\n\n constructor() {\n super();\n\n this._tag = \"div\";\n this._isClosed = false;\n }\n\n pushListItem(widget, prepend: boolean = false, protect: boolean = false) {\n const contentArr = this.content();\n\n widget._protected = protect;\n\n if (prepend) {\n contentArr.unshift(widget);\n } else {\n contentArr.push(widget);\n }\n this.content(contentArr);\n return this;\n }\n\n clearListItems() {\n const arr = [];\n for (const i in this.content()) {\n if (this.content()[i]._protected) {\n arr.push(this.content()[i]);\n }\n }\n this.content(arr);\n return this;\n }\n\n collapseClick(element) {\n if (element.classed(\"closed\")) {\n this._isClosed = false;\n element.classed(\"open\", true);\n element.classed(\"closed\", false);\n } else {\n this._isClosed = true;\n element.classed(\"open\", false);\n element.classed(\"closed\", true);\n }\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n const context = this;\n this._isClosed = this.defaultCollapsed();\n element.classed(this._isClosed ? \"closed\" : \"open\", true);\n\n this.titleSpan = element.append(\"span\").classed(\"collapsible-title\", true);\n this.iconDiv = element.append(\"div\").classed(\"collapsible-icon\", true);\n this.ul = element.append(\"ul\");\n\n this.icon = new FAChar()\n .size({ height: 24, width: 24 })\n .target(this.iconDiv.node());\n\n this.iconDiv.on(\"click\", function () {\n context.collapseClick(element);\n context.render();\n });\n this.titleSpan.on(\"click\", function () {\n context.collapseClick(element);\n context.render();\n });\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n const context = this;\n const this_id = \"\";\n this.titleSpan.text(context.title().length > 0 ? context.title() + this_id : \"Accordion [\" + context._id + \"]\" + this_id);\n const rows = this.ul.selectAll(\"#\" + context._id + \" > ul > li\").data(this.content(), function (d) {\n return d._id;\n });\n rows.enter()\n .append(function (widget) {\n const li = document.createElement(\"li\");\n if (widget._target === null) {\n const wSize = widget.size();\n if (wSize.width === 0 || wSize.height === 0) {\n const cSize = context.size();\n widget.size({\n width: cSize.width,\n height: cSize.width\n });\n }\n widget.target(li);\n } else {\n return widget._target;\n }\n return li;\n })\n ;\n rows.exit().remove();\n\n this.icon\n .text_colorFill(this.titleFontColor())\n .char(this._isClosed ? this.closedIcon() : this.openIcon()).render()\n ;\n }\n\n exit(domNode, element) {\n super.exit(domNode, element);\n }\n}\nAccordion.prototype._class += \" layout_Accordion\";\n\nexport interface Accordion {\n content(): any[];\n content(_: any[]): this;\n title(): string;\n title(_: string): this;\n openIcon(): string;\n openIcon(_: string): this;\n closedIcon(): string;\n closedIcon(_: string): this;\n titleFontColor(): string;\n titleFontColor(_: string): this;\n titleBackgroundColor(): string;\n titleBackgroundColor(_: string): this;\n\n defaultCollapsed(): boolean;\n defaultCollapsed(_: boolean): this;\n}\n\nAccordion.prototype.publish(\"content\", [], \"widgetArray\", \"Array of widgets\", null, { tags: [\"Basic\"] });\nAccordion.prototype.publish(\"title\", \"\", \"string\", \"Title of collapsible section\", null, { tags: [\"Private\"] });\nAccordion.prototype.publish(\"openIcon\", \"\\uf147\", \"string\", \"Icon to display when list is open\", null, { tags: [\"Private\"] });\nAccordion.prototype.publish(\"closedIcon\", \"\\uf196\", \"string\", \"Icon to display when list is closed\", null, { tags: [\"Private\"] });\nAccordion.prototype.publish(\"titleFontColor\", \"#FFFFFF\", \"html-color\", \"Title font color\", null, { tags: [\"Private\"] });\nAccordion.prototype.publish(\"titleBackgroundColor\", \"#333333\", \"html-color\", \"Title background color\", null, { tags: [\"Private\"] });\n\nAccordion.prototype.publish(\"defaultCollapsed\", false, \"boolean\", \"Collapsed by default if true\", null, { tags: [\"Private\"] });\n","import { HTMLWidget, Widget } from \"@hpcc-js/common\";\nimport { select as d3Select } from \"d3-selection\";\n\nimport \"../src/Surface.css\";\n\nexport class Surface extends HTMLWidget {\n _surfaceButtons;\n\n constructor() {\n super();\n\n this._tag = \"div\";\n this._surfaceButtons = [];\n }\n\n widgetSize(titleDiv, widgetDiv) {\n let width = this.clientWidth();\n let height = this.clientHeight();\n if (this.title()) {\n height -= this.calcHeight(titleDiv);\n }\n height -= this.calcFrameHeight(widgetDiv);\n width -= this.calcFrameWidth(widgetDiv);\n return { width, height };\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n }\n\n update(domNode, element2) {\n super.update(domNode, element2);\n const context = this;\n\n element2\n .classed(\"shadow2\", this.surfaceShadow())\n .style(\"border-width\", this.surfaceBorderWidth_exists() ? this.surfaceBorderWidth() + \"px\" : null)\n .style(\"border-color\", this.surfaceBorderColor())\n .style(\"border-radius\", this.surfaceBorderRadius_exists() ? this.surfaceBorderRadius() + \"px\" : null)\n .style(\"background-color\", this.surfaceBackgroundColor())\n ;\n\n const titles = element2.selectAll(\".surfaceTitle\").data(this.title() ? [this.title()] : []);\n titles.enter().insert(\"h3\", \"div\")\n .attr(\"class\", \"surfaceTitle\")\n .merge(titles)\n .text(function (d) { return d; })\n .style(\"text-align\", this.surfaceTitleAlignment())\n .style(\"color\", this.surfaceTitleFontColor())\n .style(\"font-size\", this.surfaceTitleFontSize_exists() ? this.surfaceTitleFontSize() + \"px\" : null)\n .style(\"font-family\", this.surfaceTitleFontFamily())\n .style(\"font-weight\", this.surfaceTitleFontBold() ? \"bold\" : \"normal\")\n .style(\"background-color\", this.surfaceTitleBackgroundColor())\n .style(\"padding\", this.surfaceTitlePadding_exists() ? this.surfaceTitlePadding() + \"px\" : null)\n .style(\"title\", this.altText_exists() ? this.altText() : null)\n ;\n titles.exit().remove();\n\n const surfaceTitle = element2.select(\".surfaceTitle\");\n\n const surfaceButtons = surfaceTitle.append(\"div\").attr(\"class\", \"html-button-container\").selectAll(\".surface-button\").data(this.buttonAnnotations());\n surfaceButtons.enter().append(\"button\").classed(\"surface-button\", true)\n .each(function (button, idx) {\n const el = context._surfaceButtons[idx] = d3Select(this)\n .attr(\"class\", \"surface-button\" + (button.class ? \" \" + button.class : \"\"))\n .attr(\"id\", button.id)\n .style(\"padding\", button.padding)\n .style(\"width\", button.width)\n .style(\"height\", button.height)\n .style(\"cursor\", \"pointer\");\n if (button.font === \"FontAwesome\") {\n el\n .style(\"background\", \"transparent\")\n .style(\"border\", \"none\")\n .on(\"click\", function (d) { context.click(d); })\n .append(\"i\")\n .attr(\"class\", \"fa\")\n .text(function () { return button.label; });\n } else {\n el\n .text(function () { return button.label; })\n .on(\"click\", function (d) { context.click(d); });\n }\n })\n ;\n surfaceButtons.exit()\n .each(function (_d, idx) {\n const element = d3Select(this);\n delete context._surfaceButtons[idx];\n element.remove();\n })\n ;\n const widgets = element2.selectAll(\"#\" + this._id + \" > .surfaceWidget\").data(this.widget() ? [this.widget()] : [], function (d) { return d._id; });\n\n widgets.enter().append(\"div\")\n .attr(\"class\", \"surfaceWidget\")\n .each(function (d) {\n d3Select(context.element().node().parentElement).classed(\"content-icon content-icon-\" + (d.classID().split(\"_\")[1]), true);\n d.target(this);\n })\n .merge(widgets)\n .style(\"padding\", this.surfacePadding_exists() ? this.surfacePadding() + \"px\" : null)\n .each(function (d) {\n const widgetSize = context.widgetSize(element2.select(\"h3\"), d3Select(this));\n if (widgetSize.width < 0) widgetSize.width = 0;\n if (widgetSize.height < 0) widgetSize.height = 0;\n d\n .resize({ width: widgetSize.width, height: widgetSize.height })\n ;\n })\n ;\n widgets.exit().each(function (d) {\n d.target(null);\n }).remove();\n }\n\n exit(domNode, element) {\n if (this.widget()) {\n this.widget().target(null);\n }\n super.exit(domNode, element);\n }\n\n // Events ---\n click(obj) {\n }\n}\nSurface.prototype._class += \" layout_Surface\";\n\nexport interface Surface {\n /* \n title: { (): string; (_: string): Surface; };\n altText: { (): string; (_: string): Surface; };\n altText_exists: () => boolean;\n surfaceTitlePadding: { (): number; (_: number): Surface; };\n surfaceTitlePadding_exists: () => boolean;\n surfaceTitleFontSize: { (): number; (_: number): Surface; };\n surfaceTitleFontSize_exists: () => boolean;\n surfaceTitleFontColor: { (): string; (_: string): Surface; };\n surfaceTitleFontFamily: { (): string; (_: string): Surface; };\n surfaceTitleFontBold: { (): boolean; (_: boolean): Surface; };\n surfaceTitleBackgroundColor: { (): string; (_: string): Surface; };\n surfaceTitleAlignment: { (): string; (_: string): Surface; };\n\n surfaceShadow: { (): boolean; (_: boolean): Surface; };\n surfacePadding: { (): string; (_: string): Surface; };\n surfacePadding_exists: () => boolean;\n surfaceBackgroundColor: { (): string; (_: string): Surface; };\n surfaceBorderWidth: { (): number; (_: number): Surface; };\n surfaceBorderWidth_exists: () => boolean;\n surfaceBorderColor: { (): string; (_: string): Surface; };\n surfaceBorderRadius: { (): number; (_: number): Surface; };\n surfaceBorderRadius_exists: () => boolean;\n\n buttonAnnotations: { (): any[]; (_: any[]): Surface; };\n\n widget: { (): Widget; (_: Widget): Surface; };\n */\n title(): string;\n title(_: string): this;\n altText(): string;\n altText(_: string): this;\n altText_exists(): boolean;\n surfaceTitlePadding(): number;\n surfaceTitlePadding(_: number): this;\n surfaceTitlePadding_exists(): boolean;\n surfaceTitleFontSize(): number;\n surfaceTitleFontSize(_: number): this;\n surfaceTitleFontSize_exists(): boolean;\n surfaceTitleFontColor(): string;\n surfaceTitleFontColor(_: string): this;\n surfaceTitleFontFamily(): string;\n surfaceTitleFontFamily(_: string): this;\n surfaceTitleFontBold(): boolean;\n surfaceTitleFontBold(_: boolean): this;\n surfaceTitleBackgroundColor(): string;\n surfaceTitleBackgroundColor(_: string): this;\n surfaceTitleAlignment(): string;\n surfaceTitleAlignment(_: string): this;\n\n surfaceShadow(): boolean;\n surfaceShadow(_: boolean): this;\n surfacePadding(): string;\n surfacePadding(_: string): this;\n surfacePadding_exists(): boolean;\n surfaceBackgroundColor(): string;\n surfaceBackgroundColor(_: string): this;\n surfaceBorderWidth(): number;\n surfaceBorderWidth(_: number): this;\n surfaceBorderWidth_exists(): boolean;\n surfaceBorderColor(): string;\n surfaceBorderColor(_: string): this;\n surfaceBorderRadius(): number;\n surfaceBorderRadius(_: number): this;\n surfaceBorderRadius_exists(): boolean;\n\n buttonAnnotations(): any[];\n buttonAnnotations(_: any[]): this;\n\n widget(): Widget;\n widget(_: Widget): this;\n}\n\nSurface.prototype.publish(\"title\", \"\", \"string\", \"Title\", null, { tags: [\"Intermediate\"] });\nSurface.prototype.publish(\"altText\", null, \"string\", \"Alt text\", null, { optional: true });\nSurface.prototype.publish(\"surfaceTitlePadding\", null, \"number\", \"Title Padding (px)\", null, { tags: [\"Advanced\"], disable: (w: any) => !w.title() });\nSurface.prototype.publish(\"surfaceTitleFontSize\", null, \"number\", \"Title Font Size (px)\", null, { tags: [\"Advanced\"], disable: (w: any) => !w.title() });\nSurface.prototype.publish(\"surfaceTitleFontColor\", null, \"html-color\", \"Title Font Color\", null, { tags: [\"Advanced\"], disable: (w: any) => !w.title() });\nSurface.prototype.publish(\"surfaceTitleFontFamily\", null, \"string\", \"Title Font Family\", null, { tags: [\"Advanced\"], disable: (w: any) => !w.title() });\nSurface.prototype.publish(\"surfaceTitleFontBold\", true, \"boolean\", \"Enable Bold Title Font\", null, { tags: [\"Advanced\"], disable: (w: any) => !w.title() });\nSurface.prototype.publish(\"surfaceTitleBackgroundColor\", null, \"html-color\", \"Title Background Color\", null, { tags: [\"Advanced\"], disable: (w: any) => !w.title() });\nSurface.prototype.publish(\"surfaceTitleAlignment\", \"center\", \"set\", \"Title Alignment\", [\"left\", \"right\", \"center\"], { tags: [\"Basic\"], disable: (w: any) => !w.title() });\n\nSurface.prototype.publish(\"surfaceShadow\", false, \"boolean\", \"3D Shadow\");\nSurface.prototype.publish(\"surfacePadding\", null, \"string\", \"Surface Padding (px)\", null, { tags: [\"Intermediate\"] });\nSurface.prototype.publish(\"surfaceBackgroundColor\", null, \"html-color\", \"Surface Background Color\", null, { tags: [\"Advanced\"] });\nSurface.prototype.publish(\"surfaceBorderWidth\", null, \"number\", \"Surface Border Width (px)\", null, { tags: [\"Advanced\"] });\nSurface.prototype.publish(\"surfaceBorderColor\", null, \"html-color\", \"Surface Border Color\", null, { tags: [\"Advanced\"] });\nSurface.prototype.publish(\"surfaceBorderRadius\", null, \"number\", \"Surface Border Radius (px)\", null, { tags: [\"Advanced\"] });\n\nSurface.prototype.publish(\"buttonAnnotations\", [], \"array\", \"Button Array\", null, { tags: [\"Private\"] });\n\nSurface.prototype.publish(\"widget\", null, \"widget\", \"Widget\", null, { tags: [\"Basic\"] });\n","import { Widget } from \"@hpcc-js/common\";\nimport { select as d3Select, selectAll as d3SelectAll } from \"d3-selection\";\nimport { Surface } from \"./Surface.ts\";\n\nimport \"../src/Cell.css\";\n\nexport class Cell extends Surface {\n _indicateTheseIds;\n\n constructor() {\n super();\n this._indicateTheseIds = [];\n }\n\n indicateTheseIds(): any[];\n indicateTheseIds(_: any[]): Cell;\n indicateTheseIds(_?: any[]): any[] | Cell {\n if (!arguments.length) return this._indicateTheseIds;\n this._indicateTheseIds = _;\n return this;\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n const context = this;\n element\n .classed(\"layout_Surface\", true)\n .on(\"mouseenter\", function () { context.onMouseEnter(); })\n .on(\"mouseleave\", function () { context.onMouseLeave(); })\n ;\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n }\n\n onMouseEnter() {\n const arr = this.indicateTheseIds();\n const opacity = this.indicatorOpacity();\n const indicatorBorderColor = this.indicatorBorderColor();\n const indicatorGlowColor = this.indicatorGlowColor();\n for (let i = 0; i < arr.length; i++) {\n const otherElement = d3Select(\"#\" + arr[i]);\n const otherWidget: Widget = otherElement.datum() as Widget;\n if (otherElement && otherWidget) {\n otherElement.append(\"div\")\n .attr(\"class\", \"update-indicator\")\n .style(\"width\", otherWidget.width() + \"px\")\n .style(\"height\", otherWidget.height() + \"px\")\n .style(\"opacity\", opacity)\n .style(\"border-color\", indicatorBorderColor)\n .style(\"-webkit-box-shadow\", \"inset 0px 0px 30px 0px \" + indicatorGlowColor)\n .style(\"-moz-box-shadow\", \"inset 0px 0px 30px 0px \" + indicatorGlowColor)\n .style(\"box-shadow\", \"inset 0px 0px 30px 0px \" + indicatorGlowColor)\n ;\n }\n }\n }\n\n onMouseLeave() {\n const arr = this.indicateTheseIds();\n for (let i = 0; i < arr.length; i++) {\n d3SelectAll(\"#\" + arr[i] + \" > div.update-indicator\").remove();\n }\n }\n}\nCell.prototype._class += \" layout_Cell\";\n\nexport interface Cell {\n gridRow(): number;\n gridRow(_: number): this;\n gridCol(): number;\n gridCol(_: number): this;\n gridRowSpan(): number;\n gridRowSpan(_: number): this;\n gridColSpan(): number;\n gridColSpan(_: number): this;\n\n indicatorGlowColor(): string;\n indicatorGlowColor(_: string): this;\n indicatorBorderColor(): string;\n indicatorBorderColor(_: string): this;\n indicatorOpacity(): number;\n indicatorOpacity(_: number): this;\n}\n\nCell.prototype.publish(\"gridRow\", 0, \"number\", \"Grid Row Position\", null, { tags: [\"Private\"] });\nCell.prototype.publish(\"gridCol\", 0, \"number\", \"Grid Column Position\", null, { tags: [\"Private\"] });\nCell.prototype.publish(\"gridRowSpan\", 1, \"number\", \"Grid Row Span\", null, { tags: [\"Private\"] });\nCell.prototype.publish(\"gridColSpan\", 1, \"number\", \"Grid Column Span\", null, { tags: [\"Private\"] });\n\nCell.prototype.publish(\"indicatorGlowColor\", \"#EEEE11\", \"html-color\", \"Glow color of update-indicator\", null, { tags: [\"Basic\"] });\nCell.prototype.publish(\"indicatorBorderColor\", \"#F48A00\", \"html-color\", \"Border color of update-indicator\", null, { tags: [\"Basic\"] });\nCell.prototype.publish(\"indicatorOpacity\", 0.8, \"number\", \"Opacity of update-indicator\", null, { tags: [\"Basic\"] });\n","import { d3Event, HTMLWidget, Platform, select as d3Select, selectAll as d3SelectAll, Utility } from \"@hpcc-js/common\";\nimport { drag as d3Drag } from \"d3-drag\";\nimport { Cell } from \"./Cell.ts\";\n\nimport \"../src/Border.css\";\n\nexport class Border extends HTMLWidget {\n _colCount: number;\n _rowCount: number;\n _colSize: number;\n _rowSize: number;\n _shrinkWrapBoxes;\n _watch;\n _offsetX;\n _offsetY;\n _dragCell;\n _dragCellSize;\n _dragCellStartSize;\n _handleTop;\n _handleLeft;\n _dragPrevX;\n _dragPrevY;\n _cellSizes;\n contentDiv;\n _scrollBarWidth;\n _borderHandles;\n _sectionTypeArr;\n\n constructor() {\n super();\n\n this._tag = \"div\";\n\n this._colCount = 0;\n this._rowCount = 0;\n this._colSize = 0;\n this._rowSize = 0;\n\n this._shrinkWrapBoxes = {};\n\n this.content([]);\n this.sectionTypes([]);\n }\n\n watchWidget(widget) {\n if (this._watch === undefined) {\n this._watch = {};\n }\n if (this._watch[widget.id()]) {\n this._watch[widget.id()].remove();\n delete this._watch[widget.id()];\n }\n if (widget) {\n const context = this;\n this._watch[widget.id()] = widget.monitor(function (paramId, newVal, oldVal) {\n if (oldVal !== newVal) {\n context.lazyPostUpdate();\n }\n });\n }\n }\n\n lazyPostUpdate = Utility.debounce(function () {\n this.postUpdate();\n }, 100);\n\n applyLayoutType() {\n const layoutObj = this.borderLayoutObject();\n this.content().forEach(function (cell, i) {\n cell._fixedLeft = layoutObj[this.sectionTypes()[i]].left;\n cell._fixedTop = layoutObj[this.sectionTypes()[i]].top;\n cell._fixedWidth = layoutObj[this.sectionTypes()[i]].width;\n cell._fixedHeight = layoutObj[this.sectionTypes()[i]].height;\n cell._dragHandles = this.cellSpecificDragHandles(this.sectionTypes()[i]);\n }, this);\n }\n cellSpecificDragHandles(sectionType) {\n switch (sectionType) {\n case \"top\": return [\"s\"];\n case \"right\": return [\"w\"];\n case \"bottom\": return [\"n\"];\n case \"left\": return [\"e\"];\n case \"center\": return [];\n }\n }\n\n borderLayoutObject(layoutType?) {\n const retObj = {};\n const context = this;\n let topSize;\n let topPerc;\n let bottomSize;\n let bottomPerc;\n let leftSize;\n let leftPerc;\n let rightSize;\n let rightPerc;\n\n const bcRect = this.target().getBoundingClientRect();\n const gridRect: any = {};\n gridRect.top = bcRect.top;\n gridRect.left = bcRect.left;\n gridRect.bottom = bcRect.bottom;\n gridRect.right = bcRect.right;\n if (this.target() instanceof SVGElement) {\n gridRect.width = parseFloat(this.target().getAttribute(\"width\"));\n gridRect.height = parseFloat(this.target().getAttribute(\"height\"));\n } else {\n gridRect.width = bcRect.width;\n gridRect.height = bcRect.height;\n }\n if (this.sectionTypes().indexOf(\"top\") !== -1) {\n topSize = this.topSize();\n topPerc = this.topPercentage();\n if (typeof (this._shrinkWrapBoxes[\"top\"]) !== \"undefined\") {\n topSize = this._shrinkWrapBoxes[\"top\"].height + this.gutter();\n topPerc = 0;\n }\n }\n if (this.sectionTypes().indexOf(\"bottom\") !== -1) {\n bottomSize = this.bottomSize();\n bottomPerc = this.bottomPercentage();\n if (typeof (this._shrinkWrapBoxes[\"bottom\"]) !== \"undefined\") {\n bottomSize = this._shrinkWrapBoxes[\"bottom\"].height + this.gutter();\n bottomPerc = 0;\n }\n }\n if (this.sectionTypes().indexOf(\"left\") !== -1) {\n leftSize = this.leftSize();\n leftPerc = this.leftPercentage();\n if (typeof (this._shrinkWrapBoxes[\"left\"]) !== \"undefined\") {\n leftSize = this._shrinkWrapBoxes[\"left\"].width + this.gutter();\n leftPerc = 0;\n }\n }\n if (this.sectionTypes().indexOf(\"right\") !== -1) {\n rightSize = this.rightSize();\n rightPerc = this.rightPercentage();\n if (typeof (this._shrinkWrapBoxes[\"right\"]) !== \"undefined\") {\n rightSize = this._shrinkWrapBoxes[\"right\"].width + this.gutter();\n rightPerc = 0;\n }\n }\n\n const t = _sectionPlacementObject({\n width: { \"px\": 0, \"%\": 100 },\n height: { \"px\": topSize, \"%\": topPerc },\n top: { \"px\": 0, \"%\": 0 },\n left: { \"px\": 0, \"%\": 0 }\n });\n const b = _sectionPlacementObject({\n width: { \"px\": 0, \"%\": 100 },\n height: { \"px\": bottomSize, \"%\": bottomPerc },\n top: { \"px\": 0, \"%\": 100 },\n left: { \"px\": 0, \"%\": 0 }\n });\n b.top -= b.height;\n const l = _sectionPlacementObject({\n width: { \"px\": leftSize, \"%\": leftPerc },\n height: { \"px\": -t.height - b.height, \"%\": 100 },\n top: { \"px\": t.height, \"%\": 0 },\n left: { \"px\": 0, \"%\": 0 }\n });\n const r = _sectionPlacementObject({\n width: { \"px\": rightSize, \"%\": rightPerc },\n height: { \"px\": -t.height - b.height, \"%\": 100 },\n top: { \"px\": t.height, \"%\": 0 },\n left: { \"px\": 0, \"%\": 100 }\n });\n r.left -= r.width;\n const c = _sectionPlacementObject({\n width: { \"px\": -r.width - l.width, \"%\": 100 },\n height: { \"px\": -t.height - b.height, \"%\": 100 },\n top: { \"px\": t.height, \"%\": 0 },\n left: { \"px\": l.width, \"%\": 0 }\n });\n retObj[\"top\"] = t;\n retObj[\"bottom\"] = b;\n retObj[\"right\"] = r;\n retObj[\"left\"] = l;\n retObj[\"center\"] = c;\n return retObj;\n\n function _sectionPlacementObject(obj) {\n obj.width[\"px\"] = typeof (obj.width[\"px\"]) !== \"undefined\" ? obj.width[\"px\"] : 0;\n obj.width[\"%\"] = typeof (obj.width[\"%\"]) !== \"undefined\" ? obj.width[\"%\"] : 0;\n obj.height[\"px\"] = typeof (obj.height[\"px\"]) !== \"undefined\" ? obj.height[\"px\"] : 0;\n obj.height[\"%\"] = typeof (obj.height[\"%\"]) !== \"undefined\" ? obj.height[\"%\"] : 0;\n const ret = {\n width: obj.width[\"px\"] + (obj.width[\"%\"] / 100 * context.width()),\n height: obj.height[\"px\"] + (obj.height[\"%\"] / 100 * context.height()),\n top: obj.top[\"px\"] + (obj.top[\"%\"] / 100 * context.height()) + context.gutter() / 2,\n left: obj.left[\"px\"] + (obj.left[\"%\"] / 100 * context.width()) + context.gutter() / 2\n };\n return ret;\n }\n }\n\n clearContent(sectionType) {\n if (!sectionType) {\n this.content().forEach(function (contentWidget) {\n contentWidget.target(null);\n return false;\n });\n d3Select(\"#\" + this.id() + \" > div.borderHandle\")\n .classed(\"borderHandleDisabled\", true)\n ;\n delete this._watch;\n this.content([]);\n this.sectionTypes([]);\n } else {\n const idx = this.sectionTypes().indexOf(sectionType);\n if (idx >= 0) {\n if (this._watch && this.content()[idx]) {\n delete this._watch[this.content()[idx].id()];\n }\n this.content()[idx].target(null);\n d3Select(\"#\" + this.id() + \" > div.borderHandle_\" + sectionType)\n .classed(\"borderHandleDisabled\", true)\n ;\n this.content().splice(idx, 1);\n this.sectionTypes().splice(idx, 1);\n }\n }\n }\n\n hasContent(sectionType, widget, title) {\n return this.sectionTypes().indexOf(sectionType) >= 0;\n }\n\n setContent(sectionType, widget, title?) {\n this.clearContent(sectionType);\n title = typeof (title) !== \"undefined\" ? title : \"\";\n if (widget) {\n const cell = new Cell()\n .surfaceBorderWidth(0)\n .widget(widget)\n .title(title)\n ;\n this.watchWidget(widget);\n this.content().push(cell);\n this.sectionTypes().push(sectionType);\n }\n return this;\n }\n\n getCell(id) {\n const idx = this.sectionTypes().indexOf(id);\n if (idx >= 0) {\n return this.content()[idx];\n }\n return null;\n }\n\n getContent(id) {\n const idx = this.sectionTypes().indexOf(id);\n if (idx >= 0) {\n return this.content()[idx].widget();\n }\n return null;\n }\n\n setLayoutOffsets() {\n this._offsetX = this._element.node().getBoundingClientRect().left + (this.gutter() / 2);\n this._offsetY = this._element.node().getBoundingClientRect().top + (this.gutter() / 2);\n }\n\n dragStart(handle) {\n const event = d3Event();\n event.sourceEvent.stopPropagation();\n const context = this;\n\n this._dragCell = handle;\n this._dragCellStartSize = this[handle + \"Size\"]();\n\n if (this[handle + \"ShrinkWrap\"]()) {\n this[handle + \"Percentage\"](0);\n this[handle + \"ShrinkWrap\"](false);\n }\n\n const handleElm = d3Select(\"#\" + context.id() + \" > div.borderHandle_\" + handle);\n context._handleTop = parseFloat(handleElm.style(\"top\").split(\"px\")[0]);\n context._handleLeft = parseFloat(handleElm.style(\"left\").split(\"px\")[0]);\n\n this._dragPrevX = event.sourceEvent.clientX;\n this._dragPrevY = event.sourceEvent.clientY;\n }\n dragTick(handle) {\n const context = this;\n\n const event = d3Event();\n const xDelta = this._dragPrevX - event.sourceEvent.clientX;\n const yDelta = this._dragPrevY - event.sourceEvent.clientY;\n\n switch (handle) {\n case \"top\":\n case \"bottom\":\n _moveHandles(handle, yDelta);\n break;\n case \"right\":\n case \"left\":\n _moveHandles(handle, xDelta);\n break;\n }\n\n function _moveHandles(handle2, delta) {\n if (delta === 0) return;\n const handles = d3SelectAll(\"#\" + context.id() + \" > div.borderHandle\");\n const grabbedHandle = d3Select(\"#\" + context.id() + \" > div.borderHandle_\" + handle2);\n\n if (grabbedHandle.classed(\"borderHandle_top\")) {\n grabbedHandle.style(\"top\", (context._handleTop - delta) + \"px\");\n context._cellSizes.topHeight = context._handleTop - delta;\n context._cellSizes.leftHeight = context._cellSizes.height;\n context._cellSizes.leftHeight -= context._cellSizes.topHeight;\n context._cellSizes.leftHeight -= context._cellSizes.bottomHeight;\n context._cellSizes.rightHeight = context._cellSizes.leftHeight;\n } else if (grabbedHandle.classed(\"borderHandle_right\")) {\n grabbedHandle.style(\"left\", (context._handleLeft - delta) + \"px\");\n context._cellSizes.rightWidth = context._cellSizes.width - context._handleLeft + delta;\n } else if (grabbedHandle.classed(\"borderHandle_bottom\")) {\n grabbedHandle.style(\"top\", (context._handleTop - delta) + \"px\");\n context._cellSizes.bottomHeight = context._cellSizes.height - context._handleTop + delta;\n context._cellSizes.leftHeight = context._cellSizes.height;\n context._cellSizes.leftHeight -= context._cellSizes.bottomHeight;\n context._cellSizes.leftHeight -= context._cellSizes.topHeight;\n context._cellSizes.rightHeight = context._cellSizes.leftHeight;\n } else if (grabbedHandle.classed(\"borderHandle_left\")) {\n grabbedHandle.style(\"left\", (context._handleLeft - delta) + \"px\");\n context._cellSizes.leftWidth = context._handleLeft - delta;\n }\n\n handles.each(function () {\n const handle3 = d3Select(this);\n if (handle3.classed(\"borderHandle_top\")) {\n handle3.style(\"width\", context._cellSizes.width + \"px\");\n handle3.style(\"top\", (context._cellSizes.topHeight - 3) + \"px\");\n } else if (handle3.classed(\"borderHandle_right\")) {\n handle3.style(\"left\", (context._cellSizes.width - context._cellSizes.rightWidth) + \"px\");\n handle3.style(\"top\", (context._cellSizes.topHeight + 3) + \"px\");\n handle3.style(\"height\", context._cellSizes.rightHeight + \"px\");\n } else if (handle3.classed(\"borderHandle_bottom\")) {\n handle3.style(\"width\", context._cellSizes.width + \"px\");\n handle3.style(\"top\", (context._cellSizes.height - context._cellSizes.bottomHeight - 3) + \"px\");\n } else if (handle3.classed(\"borderHandle_left\")) {\n handle3.style(\"left\", context._cellSizes.leftWidth + \"px\");\n handle3.style(\"height\", context._cellSizes.leftHeight + \"px\");\n handle3.style(\"top\", (context._cellSizes.topHeight + 3) + \"px\");\n }\n });\n }\n }\n dragEnd(handle) {\n if (handle) {\n const event = d3Event();\n const xDelta = this._dragPrevX - event.sourceEvent.clientX;\n const yDelta = this._dragPrevY - event.sourceEvent.clientY;\n\n switch (handle) {\n case \"top\":\n if (yDelta !== 0) {\n this.topPercentage(0);\n this.topSize(this.topSize() === 0 ? this.getContent(\"top\").getBBox().height - yDelta : this.topSize() - yDelta);\n }\n break;\n case \"right\":\n if (xDelta !== 0) {\n this.rightPercentage(0);\n this.rightSize(this.rightSize() === 0 ? this.getContent(\"right\").getBBox().width + xDelta : this.rightSize() + xDelta);\n }\n break;\n case \"bottom\":\n if (yDelta !== 0) {\n this.bottomPercentage(0);\n this.bottomSize(this.bottomSize() === 0 ? this.getContent(\"bottom\").getBBox().height + yDelta : this.bottomSize() + yDelta);\n }\n break;\n case \"left\":\n if (xDelta !== 0) {\n this.leftPercentage(0);\n this.leftSize(this.leftSize() === 0 ? this.getContent(\"left\").getBBox().width - xDelta : this.leftSize() - xDelta);\n }\n break;\n }\n\n this._dragPrevX = event.sourceEvent.clientX;\n this._dragPrevY = event.sourceEvent.clientY;\n }\n this.render();\n }\n\n size(_?) {\n const retVal = HTMLWidget.prototype.size.apply(this, arguments);\n if (arguments.length && this.contentDiv) {\n this.contentDiv\n .style(\"width\", this._size.width + \"px\")\n .style(\"height\", this._size.height + \"px\")\n ;\n }\n return retVal;\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n const context = this;\n element.style(\"position\", \"relative\");\n this.contentDiv = element.append(\"div\").classed(\"border-content\", true);\n this._scrollBarWidth = Platform.getScrollbarWidth();\n this._borderHandles = [\"top\", \"left\", \"right\", \"bottom\"];\n\n const handles = element.selectAll(\"div.borderHandle\").data(this._borderHandles);\n handles.enter().append(\"div\")\n .classed(\"borderHandle\", true)\n .each(function (handle) {\n const h = d3Select(this);\n h.classed(\"borderHandle_\" + handle, true)\n .classed(\"borderHandleDisabled\", context.getContent(handle) === null)\n ;\n });\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n this._sectionTypeArr = this.sectionTypes();\n const context = this;\n\n element.classed(\"design-mode\", this.designMode());\n\n this.setLayoutOffsets();\n\n const rows = this.contentDiv.selectAll(\".cell_\" + this._id).data(this.content(), function (d) { return d._id; });\n const rowsUpdate = rows.enter().append(\"div\")\n .classed(\"cell_\" + this._id, true)\n .style(\"position\", \"absolute\")\n .each(function (d, i) {\n d3Select(this).classed(\"border-cell border-cell-\" + context._sectionTypeArr[i], true);\n d.target(this);\n d3Select(\"#\" + context.id() + \" > div.borderHandle_\" + context._sectionTypeArr[i])\n .classed(\"borderHandleDisabled\", false);\n }).merge(rows);\n rowsUpdate\n .each(function (d, idx) {\n const sectionType = context.sectionTypes()[idx];\n if (typeof (context[sectionType + \"ShrinkWrap\"]) !== \"undefined\" && context[sectionType + \"ShrinkWrap\"]()) {\n d.render();\n context._shrinkWrapBoxes[sectionType] = d.widget().getBBox(true);\n } else {\n delete context._shrinkWrapBoxes[sectionType];\n }\n });\n\n const drag = d3Drag()\n .on(\"start\", function (d, i) { context.dragStart.call(context, d, i); })\n .on(\"drag\", function (d, i) { context.dragTick.call(context, d, i); })\n .on(\"end\", function (d, i) { context.dragEnd.call(context, d, i); })\n ;\n if (this.designMode()) {\n element.selectAll(\"#\" + this.id() + \" > div.borderHandle\").call(drag);\n } else {\n element.selectAll(\"#\" + this.id() + \" > div.borderHandle\").on(\".drag\", null);\n }\n\n const layoutObj = this.borderLayoutObject();\n this.content().forEach(function (cell, i) {\n cell._fixedLeft = layoutObj[this.sectionTypes()[i]].left;\n cell._fixedTop = layoutObj[this.sectionTypes()[i]].top;\n cell._fixedWidth = layoutObj[this.sectionTypes()[i]].width;\n cell._fixedHeight = layoutObj[this.sectionTypes()[i]].height;\n cell._dragHandles = [];\n }, this);\n\n rowsUpdate\n .style(\"left\", function (d) { return d._fixedLeft + \"px\"; })\n .style(\"top\", function (d) { return d._fixedTop + \"px\"; })\n .style(\"width\", function (d) { return d._fixedWidth - context.gutter() + \"px\"; })\n .style(\"height\", function (d) { return d._fixedHeight - context.gutter() + \"px\"; })\n .each(function (d) {\n d._placeholderElement\n .attr(\"draggable\", context.designMode())\n .selectAll(\".dragHandle\")\n .attr(\"draggable\", context.designMode())\n ;\n d\n .surfacePadding(context.surfacePadding())\n .resize()\n ;\n });\n rows.exit().each(function (d) {\n d.target(null);\n }).remove();\n\n this.getCellSizes();\n\n element\n .selectAll(\"#\" + this.id() + \" > div.borderHandle\")\n .each(function () {\n const handle = d3Select(this);\n if (handle.classed(\"borderHandle_top\")) {\n handle.style(\"width\", context._cellSizes.width + \"px\");\n handle.style(\"top\", (context._cellSizes.topHeight - 3) + \"px\");\n } else if (handle.classed(\"borderHandle_right\")) {\n handle.style(\"left\", (context._cellSizes.width - context._cellSizes.rightWidth) + \"px\");\n handle.style(\"top\", (context._cellSizes.topHeight + 3) + \"px\");\n handle.style(\"height\", context._cellSizes.rightHeight + \"px\");\n } else if (handle.classed(\"borderHandle_bottom\")) {\n handle.style(\"width\", context._cellSizes.width + \"px\");\n handle.style(\"top\", (context._cellSizes.height - context._cellSizes.bottomHeight - 3) + \"px\");\n } else if (handle.classed(\"borderHandle_left\")) {\n handle.style(\"left\", context._cellSizes.leftWidth + \"px\");\n handle.style(\"height\", context._cellSizes.leftHeight + \"px\");\n handle.style(\"top\", (context._cellSizes.topHeight + 3) + \"px\");\n }\n\n })\n ;\n }\n\n getCellSizes() {\n const context = this;\n context._cellSizes = {};\n const contentRect = this.element().node().getBoundingClientRect();\n context._cellSizes.width = contentRect.width;\n context._cellSizes.height = contentRect.height;\n this.element()\n .selectAll(\"#\" + this.id() + \" > div > div.border-cell\")\n .each(function () {\n const cell = d3Select(this);\n if (typeof cell.node === \"function\") {\n const rect = cell.node().getBoundingClientRect();\n if (cell.classed(\"border-cell-top\")) {\n context._cellSizes.topHeight = rect.height;\n } else if (cell.classed(\"border-cell-left\")) {\n context._cellSizes.leftWidth = rect.width;\n context._cellSizes.leftHeight = rect.height;\n } else if (cell.classed(\"border-cell-right\")) {\n context._cellSizes.rightWidth = rect.width;\n context._cellSizes.rightHeight = rect.height;\n } else if (cell.classed(\"border-cell-bottom\")) {\n context._cellSizes.bottomHeight = rect.height;\n }\n }\n });\n const sizes = [\"height\", \"width\", \"topHeight\", \"bottomHeight\", \"leftHeight\", \"rightHeight\", \"leftWidth\", \"rightWidth\"];\n sizes.forEach(function (size) {\n context._cellSizes[size] = context._cellSizes[size] === undefined ? 0 : context._cellSizes[size];\n });\n }\n\n postUpdate(domNode, element) {\n const context = this;\n this.content().forEach(function (n) {\n if (n._element.node() !== null && n.widget()) {\n const prevBox = n.widget().getBBox(false, true);\n const currBox = n.widget().getBBox(true, true);\n if (prevBox.width !== currBox.width || prevBox.height !== currBox.height) {\n context.lazyRender();\n }\n }\n });\n }\n\n exit(domNode, element) {\n this.content().forEach(w => w.target(null));\n super.exit(domNode, element);\n }\n}\nBorder.prototype._class += \" layout_Border\";\n\nexport interface Border {\n designMode(): boolean;\n designMode(_: boolean): this;\n\n content(): any[];\n content(_: any[]): this;\n\n gutter(): number;\n gutter(_: number): this;\n\n topShrinkWrap(): boolean;\n topShrinkWrap(_: boolean): this;\n leftShrinkWrap(): boolean;\n leftShrinkWrap(_: boolean): this;\n rightShrinkWrap(): boolean;\n rightShrinkWrap(_: boolean): this;\n bottomShrinkWrap(): boolean;\n bottomShrinkWrap(_: boolean): this;\n\n topSize(): number;\n topSize(_: number): this;\n leftSize(): number;\n leftSize(_: number): this;\n rightSize(): number;\n rightSize(_: number): this;\n bottomSize(): number;\n bottomSize(_: number): this;\n\n topPercentage(): number;\n topPercentage(_: number): this;\n leftPercentage(): number;\n leftPercentage(_: number): this;\n rightPercentage(): number;\n rightPercentage(_: number): this;\n bottomPercentage(): number;\n bottomPercentage(_: number): this;\n\n surfacePadding(): number;\n surfacePadding(_: number): this;\n\n sectionTypes(): any[];\n sectionTypes(_: any[]): this;\n}\n\nBorder.prototype.publish(\"designMode\", false, \"boolean\", \"Design Mode\", null, { tags: [\"Basic\"] });\n\nBorder.prototype.publish(\"content\", [], \"widgetArray\", \"widgets\", null, { tags: [\"Intermediate\"] });\n\nBorder.prototype.publish(\"gutter\", 0, \"number\", \"Gap Between Widgets\", null, { tags: [\"Basic\"] });\n\nBorder.prototype.publish(\"topShrinkWrap\", false, \"boolean\", \"'Top' Cell shrinks to fit content\", null, { tags: [\"Intermediate\"] });\nBorder.prototype.publish(\"leftShrinkWrap\", false, \"boolean\", \"'Left' Cell shrinks to fit content\", null, { tags: [\"Intermediate\"] });\nBorder.prototype.publish(\"rightShrinkWrap\", false, \"boolean\", \"'Right' Cell shrinks to fit content\", null, { tags: [\"Intermediate\"] });\nBorder.prototype.publish(\"bottomShrinkWrap\", false, \"boolean\", \"'Bottom' Cell shrinks to fit content\", null, { tags: [\"Intermediate\"] });\n\nBorder.prototype.publish(\"topSize\", 0, \"number\", \"Height of the 'Top' Cell (px)\", null, { tags: [\"Private\"] });\nBorder.prototype.publish(\"leftSize\", 0, \"number\", \"Width of the 'Left' Cell (px)\", null, { tags: [\"Private\"] });\nBorder.prototype.publish(\"rightSize\", 0, \"number\", \"Width of the 'Right' Cell (px)\", null, { tags: [\"Private\"] });\nBorder.prototype.publish(\"bottomSize\", 0, \"number\", \"Height of the 'Bottom' Cell (px)\", null, { tags: [\"Private\"] });\n\nBorder.prototype.publish(\"topPercentage\", 20, \"number\", \"Percentage (of parent) Height of the 'Top' Cell\", null, { tags: [\"Private\"] });\nBorder.prototype.publish(\"leftPercentage\", 20, \"number\", \"Percentage (of parent) Width of the 'Left' Cell\", null, { tags: [\"Private\"] });\nBorder.prototype.publish(\"rightPercentage\", 20, \"number\", \"Percentage (of parent) Width of the 'Right' Cell\", null, { tags: [\"Private\"] });\nBorder.prototype.publish(\"bottomPercentage\", 20, \"number\", \"Percentage (of parent) Height of the 'Bottom' Cell\", null, { tags: [\"Private\"] });\n\nBorder.prototype.publish(\"surfacePadding\", 0, \"number\", \"Cell Padding (px)\", null, { tags: [\"Intermediate\"] });\n\nBorder.prototype.publish(\"sectionTypes\", [], \"array\", \"Section Types sharing an index with 'content' - Used to determine position/size.\", null, { tags: [\"Private\"] });\n","import { BBox, HTMLWidget, Platform, Widget } from \"@hpcc-js/common\";\n\nimport \"../src/Border2.css\";\n\nexport type OverflowT = \"hidden\" | \"scroll\" | \"visible\" | \"auto\";\nexport type ChartPanelSectionT = \"top\" | \"right\" | \"bottom\" | \"left\" | \"center\";\nexport class WidgetDiv {\n private _div;\n private _overlay: boolean = false;\n private _overflowX: OverflowT = \"visible\";\n private _overflowY: OverflowT = \"visible\";\n private _widget: Widget;\n\n constructor(div) {\n this._div = div;\n }\n\n overlay(): boolean;\n overlay(_: boolean): this;\n overlay(_?: boolean): boolean | this {\n if (!arguments.length) return this._overlay;\n this._overlay = _;\n return this;\n }\n\n overflowX(): OverflowT;\n overflowX(_: OverflowT): this;\n overflowX(_?: OverflowT): OverflowT | this {\n if (!arguments.length) return this._overflowX;\n this._overflowX = _;\n this._div.style(\"overflow-x\", _);\n return this;\n }\n overflowY(): OverflowT;\n overflowY(_: OverflowT): this;\n overflowY(_?: OverflowT): OverflowT | this {\n if (!arguments.length) return this._overflowY;\n this._overflowY = _;\n this._div.style(\"overflow-y\", _);\n return this;\n }\n\n element() {\n return this._div;\n }\n\n node(): SVGElement | HTMLElement {\n return this._div.node();\n }\n\n widget(): Widget;\n widget(_: Widget): this;\n widget(_?: Widget): Widget | this {\n if (!arguments.length) return this._widget;\n if (this._widget !== _) {\n if (this._widget) {\n this._widget.target(null);\n }\n this._widget = _;\n if (this._widget) {\n this._widget.target(this._div.node());\n }\n }\n return this;\n }\n\n resize(size: { width: number, height: number }) {\n if (this._widget) {\n this._div\n .style(\"width\", `${size.width}px`)\n .style(\"height\", `${size.height}px`)\n ;\n this._widget.resize(size);\n }\n return this;\n }\n\n async render(getBBox?, availableHeight?: number, availableWidth?: number): Promise<BBox | undefined> {\n let overflowX = this.overflowX();\n if(!this.overlay() && overflowX === \"visible\") {\n overflowX = null;\n }\n let overflowY = this.overflowY();\n if(!this.overlay() && overflowY === \"visible\") {\n overflowY = null;\n }\n this._div\n .style(\"height\", this.overlay() ? \"0px\" : null)\n .style(\"overflow-x\", overflowX)\n .style(\"overflow-y\", overflowY)\n ;\n if (this._widget) {\n return this._widget.renderPromise().then(w => {\n if (getBBox && this._widget.visible()) {\n const retVal = this._widget.getBBox();\n retVal.width += 8;\n if (availableHeight !== undefined && retVal.height > availableHeight) {\n retVal.width += Platform.getScrollbarWidth();\n }\n if (availableWidth !== undefined && retVal.width > availableWidth) {\n retVal.height += Platform.getScrollbarWidth();\n }\n if (this.overlay()) {\n retVal.height = 0;\n } else {\n retVal.height += 4;\n }\n return retVal;\n }\n return getBBox ? { x: 0, y: 0, width: 0, height: 0 } : undefined;\n });\n } else {\n return Promise.resolve(getBBox ? { x: 0, y: 0, width: 0, height: 0 } : undefined);\n }\n }\n}\n\nexport class Border2 extends HTMLWidget {\n\n protected _bodyElement;\n\n protected _topWA: WidgetDiv;\n protected _leftWA: WidgetDiv;\n protected _centerWA: WidgetDiv;\n protected _rightWA: WidgetDiv;\n protected _bottomWA: WidgetDiv;\n protected _topPrevOverflow: OverflowT;\n protected _leftPrevOverflow: OverflowT;\n protected _rightPrevOverflow: OverflowT;\n protected _bottomPrevOverflow: OverflowT;\n\n constructor() {\n super();\n this._tag = \"div\";\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n \n const topElement = element.append(\"header\");\n\n this._bodyElement = element.append(\"div\").attr(\"class\", \"body\");\n const centerElement = this._bodyElement.append(\"div\").attr(\"class\", \"center\");\n const leftElement = this._bodyElement.append(\"div\").attr(\"class\", \"lhs\");\n const rightElement = this._bodyElement.append(\"div\").attr(\"class\", \"rhs\");\n\n const bottomElement = element.append(\"div\").attr(\"class\", \"footer\");\n\n this._topWA = new WidgetDiv(topElement);\n this._centerWA = new WidgetDiv(centerElement);\n this._leftWA = new WidgetDiv(leftElement);\n this._rightWA = new WidgetDiv(rightElement);\n this._bottomWA = new WidgetDiv(bottomElement);\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n this._topWA.element().style(\"display\", this.showTop() ? null : \"none\");\n this._rightWA.element().style(\"display\", this.showRight() ? null : \"none\");\n this._bottomWA.element().style(\"display\", this.showBottom() ? null : \"none\");\n this._leftWA.element().style(\"display\", this.showLeft() ? null : \"none\");\n if(this.topOverflowX() !== this._topWA.overflowX()) {\n this._topWA.overflowX(this.topOverflowX());\n }\n if(this.rightOverflowX() !== this._rightWA.overflowX()) {\n this._rightWA.overflowX(this.rightOverflowX());\n }\n if(this.bottomOverflowX() !== this._bottomWA.overflowX()) {\n this._bottomWA.overflowX(this.bottomOverflowX());\n }\n if(this.leftOverflowX() !== this._leftWA.overflowX()) {\n this._leftWA.overflowX(this.leftOverflowX());\n }\n if(this.topOverflowY() !== this._topWA.overflowY()) {\n this._topWA.overflowY(this.topOverflowY());\n }\n if(this.rightOverflowY() !== this._rightWA.overflowY()) {\n this._rightWA.overflowY(this.rightOverflowY());\n }\n if(this.bottomOverflowY() !== this._bottomWA.overflowY()) {\n this._bottomWA.overflowY(this.bottomOverflowY());\n }\n if(this.leftOverflowY() !== this._leftWA.overflowY()) {\n this._leftWA.overflowY(this.leftOverflowY());\n }\n this.element()\n .style(\"width\", `${this.width()}px`)\n .style(\"height\", `${this.height()}px`)\n ;\n }\n\n private targetNull(w?: Widget) {\n if (w) {\n w.target(null);\n }\n }\n\n exit(domNode, element) {\n this.targetNull(this.center());\n this.targetNull(this.bottom());\n this.targetNull(this.right());\n this.targetNull(this.left());\n this.targetNull(this.top());\n super.exit(domNode, element);\n }\n\n swap(sectionA: ChartPanelSectionT, sectionB: ChartPanelSectionT): this {\n const a = this[sectionA]();\n const b = this[sectionB]();\n this.targetNull(a);\n this.targetNull(b);\n this[`_${sectionA}WA`].widget(null);\n this[`_${sectionB}WA`].widget(null);\n this[sectionA](b);\n this[sectionB](a);\n return this;\n }\n\n render(callback?: (w: Widget) => void): this {\n const retVal = super.render(w => {\n if (this._topWA) {\n this._topWA\n .widget(this.top())\n .overlay(this.topOverlay())\n .render(true).then(async topBBox => {\n const bottomBBox: BBox = await this._bottomWA.widget(this.bottom()).render(true, undefined, this.width()) as BBox;\n const availableHeight = this.height() - (topBBox.height + bottomBBox.height);\n const leftBBox: BBox = await this._leftWA.widget(this.left()).render(true, availableHeight) as BBox;\n const rightBBox: BBox = await this._rightWA.widget(this.right()).render(true, availableHeight) as BBox;\n \n if (this.bottomHeight_exists()) {\n bottomBBox.height = this.bottomHeight();\n }\n const bodyWidth = this.width() - (leftBBox.width + rightBBox.width);\n const bodyHeight = this.height() - (topBBox.height + bottomBBox.height);\n \n const centerOverflowX = this.centerOverflowX();\n const centerOverflowY = this.centerOverflowY();\n\n const scrollCenterX = [\"auto\", \"scroll\"].indexOf(centerOverflowX) !== -1;\n const scrollCenterY = [\"auto\", \"scroll\"].indexOf(centerOverflowY) !== -1;\n if(scrollCenterX || scrollCenterY) {\n this._centerWA\n .overflowX(this.centerOverflowX())\n .overflowY(this.centerOverflowY())\n .widget(this.center())\n .resize({\n width: bodyWidth,\n height: bodyHeight\n })\n .render()\n ;\n }\n this._bodyElement.style(\"height\", `${bodyHeight}px`);\n const promises = [\n this._topWA\n .overflowX(this.topOverflowX())\n .overflowY(this.topOverflowY())\n .resize({\n width: this.width(),\n height: topBBox.height\n })\n .render(),\n this._leftWA\n .overflowX(this.leftOverflowX())\n .overflowY(this.leftOverflowY())\n .resize({\n width: leftBBox.width,\n height: bodyHeight\n })\n .render(),\n this._rightWA\n .overflowX(this.rightOverflowX())\n .overflowY(this.rightOverflowY())\n .resize({\n width: rightBBox.width,\n height: bodyHeight\n })\n .render(),\n this._centerWA\n .overflowX(this.centerOverflowX())\n .overflowY(this.centerOverflowY())\n .widget(this.center())\n .resize({\n width: bodyWidth,\n height: bodyHeight\n })\n .render(),\n this._bottomWA\n .overflowX(this.bottomOverflowX())\n .overflowY(this.bottomOverflowY())\n .resize({\n width: this.width(),\n height: bottomBBox.height\n })\n .render()\n ];\n Promise.all(promises).then(promises => {\n if (callback) {\n callback(this);\n }\n });\n })\n ;\n } else {\n if (callback) {\n callback(this);\n }\n }\n });\n return retVal;\n }\n}\nBorder2.prototype._class += \" layout_Border2\";\n\nexport interface Border2 {\n top(): Widget;\n top(_: Widget): this;\n topOverlay(): boolean;\n topOverlay(_: boolean): this;\n left(): Widget;\n left(_: Widget): this;\n center(): Widget;\n center(_: Widget): this;\n right(): Widget;\n right(_: Widget): this;\n bottom(): Widget;\n bottom(_: Widget): this;\n bottomHeight(): number;\n bottomHeight(_: number): this;\n bottomHeight_exists(): boolean;\n topOverflowX(): OverflowT;\n topOverflowX(_: OverflowT): this;\n rightOverflowX(): OverflowT;\n rightOverflowX(_: OverflowT): this;\n bottomOverflowX(): OverflowT;\n bottomOverflowX(_: OverflowT): this;\n leftOverflowX(): OverflowT;\n leftOverflowX(_: OverflowT): this;\n centerOverflowX(): OverflowT;\n centerOverflowX(_: OverflowT): this;\n topOverflowY(): OverflowT;\n topOverflowY(_: OverflowT): this;\n rightOverflowY(): OverflowT;\n rightOverflowY(_: OverflowT): this;\n bottomOverflowY(): OverflowT;\n bottomOverflowY(_: OverflowT): this;\n leftOverflowY(): OverflowT;\n leftOverflowY(_: OverflowT): this;\n centerOverflowY(): OverflowT;\n centerOverflowY(_: OverflowT): this;\n showTop(): boolean;\n showTop(_: boolean): this;\n showRight(): boolean;\n showRight(_: boolean): this;\n showBottom(): boolean;\n showBottom(_: boolean): this;\n showLeft(): boolean;\n showLeft(_: boolean): this;\n topOverflowX_default(_: OverflowT);\n rightOverflowX_default(_: OverflowT);\n bottomOverflowX_default(_: OverflowT);\n leftOverflowX_default(_: OverflowT);\n centerOverflowX_default(_: OverflowT);\n topOverflowY_default(_: OverflowT);\n rightOverflowY_default(_: OverflowT);\n bottomOverflowY_default(_: OverflowT);\n leftOverflowY_default(_: OverflowT);\n centerOverflowY_default(_: OverflowT);\n}\nBorder2.prototype.publish(\"showTop\", true, \"boolean\", \"If true, top widget adapter will display\");\nBorder2.prototype.publish(\"showRight\", true, \"boolean\", \"If true, right widget adapter will display\");\nBorder2.prototype.publish(\"showBottom\", true, \"boolean\", \"If true, bottom widget adapter will display\");\nBorder2.prototype.publish(\"showLeft\", true, \"boolean\", \"If true, left widget adapter will display\");\nBorder2.prototype.publish(\"topOverflowX\", \"visible\", \"set\", \"Sets the overflow-x css style for the top widget adapter\", [\"hidden\", \"scroll\", \"visible\", \"auto\"]);\nBorder2.prototype.publish(\"rightOverflowX\", \"visible\", \"set\", \"Sets the overflow-x css style for the right widget adapter\", [\"hidden\", \"scroll\", \"visible\", \"auto\"]);\nBorder2.prototype.publish(\"bottomOverflowX\", \"visible\", \"set\", \"Sets the overflow-x css style for the bottom widget adapter\", [\"hidden\", \"scroll\", \"visible\", \"auto\"]);\nBorder2.prototype.publish(\"leftOverflowX\", \"visible\", \"set\", \"Sets the overflow-x css style for the left widget adapter\", [\"hidden\", \"scroll\", \"visible\", \"auto\"]);\nBorder2.prototype.publish(\"centerOverflowX\", \"visible\", \"set\", \"Sets the overflow-x css style for the center widget adapter\", [\"hidden\", \"scroll\", \"visible\", \"auto\"]);\nBorder2.prototype.publish(\"topOverflowY\", \"visible\", \"set\", \"Sets the overflow-y css style for the top widget adapter\", [\"hidden\", \"scroll\", \"visible\", \"auto\"]);\nBorder2.prototype.publish(\"rightOverflowY\", \"visible\", \"set\", \"Sets the overflow-y css style for the right widget adapter\", [\"hidden\", \"scroll\", \"visible\", \"auto\"]);\nBorder2.prototype.publish(\"bottomOverflowY\", \"visible\", \"set\", \"Sets the overflow-y css style for the bottom widget adapter\", [\"hidden\", \"scroll\", \"visible\", \"auto\"]);\nBorder2.prototype.publish(\"leftOverflowY\", \"visible\", \"set\", \"Sets the overflow-y css style for the left widget adapter\", [\"hidden\", \"scroll\", \"visible\", \"auto\"]);\nBorder2.prototype.publish(\"centerOverflowY\", \"visible\", \"set\", \"Sets the overflow-y css style for the center widget adapter\", [\"hidden\", \"scroll\", \"visible\", \"auto\"]);\nBorder2.prototype.publish(\"top\", null, \"widget\", \"Top Widget\", undefined, { render: false });\nBorder2.prototype.publish(\"topOverlay\", false, \"boolean\", \"Overlay Top Widget\");\nBorder2.prototype.publish(\"left\", null, \"widget\", \"Left Widget\", undefined, { render: false });\nBorder2.prototype.publish(\"center\", null, \"widget\", \"Center Widget\", undefined, { render: false });\nBorder2.prototype.publish(\"right\", null, \"widget\", \"Right Widget\", undefined, { render: false });\nBorder2.prototype.publish(\"bottom\", null, \"widget\", \"Bottom Widget\", undefined, { render: false });\nBorder2.prototype.publish(\"bottomHeight\", null, \"number\", \"Bottom Fixed Height\", undefined, { optional: true });\n","import { HTMLWidget, Widget } from \"@hpcc-js/common\";\nimport { select as d3Select } from \"d3-selection\";\nimport \"d3-transition\";\n\nimport \"../src/Carousel.css\";\n\nexport class Carousel extends HTMLWidget {\n\n protected _prevActive: number = 0;\n protected _root;\n\n activeWidget(): Widget {\n return this.widgets()[this.active()];\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this._root = element.append(\"div\")\n .attr(\"id\", `${this.id()}_root`)\n ;\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n const active = this.active();\n const width = this.width();\n this._root\n .style(\"width\", `${width}px`)\n .style(\"height\", `${this.height()}px`)\n ;\n const widgetElements = this._root.selectAll(`#${this.id()}_root > .carouselItem`).data(this.widgets(), d => d.id());\n const update = widgetElements.enter().append(\"div\")\n .attr(\"class\", \"carouselItem\")\n .each(function (w) {\n w.target(this);\n })\n .merge(widgetElements)\n .style(\"left\", (d, i) => `${(i - this._prevActive) * width}px`)\n .style(\"width\", `${width}px`)\n ;\n if (this._prevActive !== active) {\n update\n .style(\"display\", (d, i) => i === this._prevActive || i === active ? null : \"none\") // Must be called before render callback (not inside transition)\n .transition().duration(this.transitionDuration())\n .style(\"left\", (d, i) => `${(i - active) * width}px`)\n .on(\"end\", function (d, i) {\n d3Select(this).style(\"display\", () => i === active ? null : \"none\");\n })\n ;\n this._prevActive = active;\n }\n widgetElements.exit()\n .each(function (w) {\n w.target(null);\n })\n .remove()\n ;\n }\n\n exit(domNode, element) {\n this.widgets().forEach(w => w.target(null));\n super.exit(domNode, element);\n }\n\n render(callback): this {\n return super.render(w => {\n if (!this.visible() || this.isDOMHidden()) {\n if (callback) {\n callback(w);\n }\n } else {\n const aw = this.activeWidget();\n if (aw) {\n aw\n .resize(this.size())\n .render(w2 => {\n if (callback) {\n callback(w);\n }\n })\n ;\n }\n }\n });\n }\n}\nCarousel.prototype._class += \" layout_Carousel\";\n\nexport interface Carousel {\n widgets(): Widget[];\n widgets(_: Widget[]): this;\n active(): number;\n active(_: number): this;\n transitionDuration(): Widget[];\n transitionDuration(_: Widget[]): this;\n}\n\nCarousel.prototype.publish(\"widgets\", [], \"widgetArray\", \"Widgets\", null, { render: false });\nCarousel.prototype.publish(\"active\", 0, \"number\", \"Active widget\");\nCarousel.prototype.publish(\"transitionDuration\", 500, \"number\", \"Transition duration\");\n","var pi = Math.PI,\n tau = 2 * pi,\n epsilon = 1e-6,\n tauEpsilon = tau - epsilon;\n\nfunction Path() {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n}\n\nfunction path() {\n return new Path;\n}\n\nPath.prototype = path.prototype = {\n constructor: Path,\n moveTo: function(x, y) {\n this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y);\n },\n closePath: function() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._ += \"Z\";\n }\n },\n lineTo: function(x, y) {\n this._ += \"L\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n quadraticCurveTo: function(x1, y1, x, y) {\n this._ += \"Q\" + (+x1) + \",\" + (+y1) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) {\n this._ += \"C\" + (+x1) + \",\" + (+y1) + \",\" + (+x2) + \",\" + (+y2) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n arcTo: function(x1, y1, x2, y2, r) {\n x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;\n var x0 = this._x1,\n y0 = this._y1,\n x21 = x2 - x1,\n y21 = y2 - y1,\n x01 = x0 - x1,\n y01 = y0 - y1,\n l01_2 = x01 * x01 + y01 * y01;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(\"negative radius: \" + r);\n\n // Is this path empty? Move to (x1,y1).\n if (this._x1 === null) {\n this._ += \"M\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n }\n\n // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.\n else if (!(l01_2 > epsilon));\n\n // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?\n // Equivalently, is (x1,y1) coincident with (x2,y2)?\n // Or, is the radius zero? Line to (x1,y1).\n else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {\n this._ += \"L\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n }\n\n // Otherwise, draw an arc!\n else {\n var x20 = x2 - x0,\n y20 = y2 - y0,\n l21_2 = x21 * x21 + y21 * y21,\n l20_2 = x20 * x20 + y20 * y20,\n l21 = Math.sqrt(l21_2),\n l01 = Math.sqrt(l01_2),\n l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),\n t01 = l / l01,\n t21 = l / l21;\n\n // If the start tangent is not coincident with (x0,y0), line to.\n if (Math.abs(t01 - 1) > epsilon) {\n this._ += \"L\" + (x1 + t01 * x01) + \",\" + (y1 + t01 * y01);\n }\n\n this._ += \"A\" + r + \",\" + r + \",0,0,\" + (+(y01 * x20 > x01 * y20)) + \",\" + (this._x1 = x1 + t21 * x21) + \",\" + (this._y1 = y1 + t21 * y21);\n }\n },\n arc: function(x, y, r, a0, a1, ccw) {\n x = +x, y = +y, r = +r, ccw = !!ccw;\n var dx = r * Math.cos(a0),\n dy = r * Math.sin(a0),\n x0 = x + dx,\n y0 = y + dy,\n cw = 1 ^ ccw,\n da = ccw ? a0 - a1 : a1 - a0;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(\"negative radius: \" + r);\n\n // Is this path empty? Move to (x0,y0).\n if (this._x1 === null) {\n this._ += \"M\" + x0 + \",\" + y0;\n }\n\n // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).\n else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {\n this._ += \"L\" + x0 + \",\" + y0;\n }\n\n // Is this arc empty? We’re done.\n if (!r) return;\n\n // Does the angle go the wrong way? Flip the direction.\n if (da < 0) da = da % tau + tau;\n\n // Is this a complete circle? Draw two arcs to complete the circle.\n if (da > tauEpsilon) {\n this._ += \"A\" + r + \",\" + r + \",0,1,\" + cw + \",\" + (x - dx) + \",\" + (y - dy) + \"A\" + r + \",\" + r + \",0,1,\" + cw + \",\" + (this._x1 = x0) + \",\" + (this._y1 = y0);\n }\n\n // Is this arc non-empty? Draw an arc!\n else if (da > epsilon) {\n this._ += \"A\" + r + \",\" + r + \",0,\" + (+(da >= pi)) + \",\" + cw + \",\" + (this._x1 = x + r * Math.cos(a1)) + \",\" + (this._y1 = y + r * Math.sin(a1));\n }\n },\n rect: function(x, y, w, h) {\n this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y) + \"h\" + (+w) + \"v\" + (+h) + \"h\" + (-w) + \"Z\";\n },\n toString: function() {\n return this._;\n }\n};\n\nexport default path;\n","export default function(x) {\n return function constant() {\n return x;\n };\n}\n","export var abs = Math.abs;\nexport var atan2 = Math.atan2;\nexport var cos = Math.cos;\nexport var max = Math.max;\nexport var min = Math.min;\nexport var sin = Math.sin;\nexport var sqrt = Math.sqrt;\n\nexport var epsilon = 1e-12;\nexport var pi = Math.PI;\nexport var halfPi = pi / 2;\nexport var tau = 2 * pi;\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function asin(x) {\n return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);\n}\n","import {pi, tau} from \"../math.js\";\n\nexport default {\n draw: function(context, size) {\n var r = Math.sqrt(size / pi);\n context.moveTo(r, 0);\n context.arc(0, 0, r, 0, tau);\n }\n};\n","export default {\n draw: function(context, size) {\n var r = Math.sqrt(size / 5) / 2;\n context.moveTo(-3 * r, -r);\n context.lineTo(-r, -r);\n context.lineTo(-r, -3 * r);\n context.lineTo(r, -3 * r);\n context.lineTo(r, -r);\n context.lineTo(3 * r, -r);\n context.lineTo(3 * r, r);\n context.lineTo(r, r);\n context.lineTo(r, 3 * r);\n context.lineTo(-r, 3 * r);\n context.lineTo(-r, r);\n context.lineTo(-3 * r, r);\n context.closePath();\n }\n};\n","var tan30 = Math.sqrt(1 / 3),\n tan30_2 = tan30 * 2;\n\nexport default {\n draw: function(context, size) {\n var y = Math.sqrt(size / tan30_2),\n x = y * tan30;\n context.moveTo(0, -y);\n context.lineTo(x, 0);\n context.lineTo(0, y);\n context.lineTo(-x, 0);\n context.closePath();\n }\n};\n","import {pi, tau} from \"../math.js\";\n\nvar ka = 0.89081309152928522810,\n kr = Math.sin(pi / 10) / Math.sin(7 * pi / 10),\n kx = Math.sin(tau / 10) * kr,\n ky = -Math.cos(tau / 10) * kr;\n\nexport default {\n draw: function(context, size) {\n var r = Math.sqrt(size * ka),\n x = kx * r,\n y = ky * r;\n context.moveTo(0, -r);\n context.lineTo(x, y);\n for (var i = 1; i < 5; ++i) {\n var a = tau * i / 5,\n c = Math.cos(a),\n s = Math.sin(a);\n context.lineTo(s * r, -c * r);\n context.lineTo(c * x - s * y, s * x + c * y);\n }\n context.closePath();\n }\n};\n","export default {\n draw: function(context, size) {\n var w = Math.sqrt(size),\n x = -w / 2;\n context.rect(x, x, w, w);\n }\n};\n","var sqrt3 = Math.sqrt(3);\n\nexport default {\n draw: function(context, size) {\n var y = -Math.sqrt(size / (sqrt3 * 3));\n context.moveTo(0, y * 2);\n context.lineTo(-sqrt3 * y, -y);\n context.lineTo(sqrt3 * y, -y);\n context.closePath();\n }\n};\n","var c = -0.5,\n s = Math.sqrt(3) / 2,\n k = 1 / Math.sqrt(12),\n a = (k / 2 + 1) * 3;\n\nexport default {\n draw: function(context, size) {\n var r = Math.sqrt(size / a),\n x0 = r / 2,\n y0 = r * k,\n x1 = x0,\n y1 = r * k + r,\n x2 = -x1,\n y2 = y1;\n context.moveTo(x0, y0);\n context.lineTo(x1, y1);\n context.lineTo(x2, y2);\n context.lineTo(c * x0 - s * y0, s * x0 + c * y0);\n context.lineTo(c * x1 - s * y1, s * x1 + c * y1);\n context.lineTo(c * x2 - s * y2, s * x2 + c * y2);\n context.lineTo(c * x0 + s * y0, c * y0 - s * x0);\n context.lineTo(c * x1 + s * y1, c * y1 - s * x1);\n context.lineTo(c * x2 + s * y2, c * y2 - s * x2);\n context.closePath();\n }\n};\n","import {path} from \"d3-path\";\nimport circle from \"./symbol/circle.js\";\nimport cross from \"./symbol/cross.js\";\nimport diamond from \"./symbol/diamond.js\";\nimport star from \"./symbol/star.js\";\nimport square from \"./symbol/square.js\";\nimport triangle from \"./symbol/triangle.js\";\nimport wye from \"./symbol/wye.js\";\nimport constant from \"./constant.js\";\n\nexport var symbols = [\n circle,\n cross,\n diamond,\n square,\n star,\n triangle,\n wye\n];\n\nexport default function() {\n var type = constant(circle),\n size = constant(64),\n context = null;\n\n function symbol() {\n var buffer;\n if (!context) context = buffer = path();\n type.apply(this, arguments).draw(context, +size.apply(this, arguments));\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n symbol.type = function(_) {\n return arguments.length ? (type = typeof _ === \"function\" ? _ : constant(_), symbol) : type;\n };\n\n symbol.size = function(_) {\n return arguments.length ? (size = typeof _ === \"function\" ? _ : constant(+_), symbol) : size;\n };\n\n symbol.context = function(_) {\n return arguments.length ? (context = _ == null ? null : _, symbol) : context;\n };\n\n return symbol;\n}\n","import { select } from 'd3-selection';\nimport { format, formatLocale, formatPrefix, formatSpecifier } from 'd3-format';\nimport { dispatch } from 'd3-dispatch';\nimport { scaleLinear } from 'd3-scale';\nimport { max, sum } from 'd3-array';\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n return typeof obj;\n} : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n};\n\nvar d3_identity = function d3_identity(d) {\n return d;\n};\n\nvar d3_reverse = function d3_reverse(arr) {\n var mirror = [];\n for (var i = 0, l = arr.length; i < l; i++) {\n mirror[i] = arr[l - i - 1];\n }\n return mirror;\n};\n\n//Text wrapping code adapted from Mike Bostock\nvar d3_textWrapping = function d3_textWrapping(text, width) {\n text.each(function () {\n var text = select(this),\n words = text.text().split(/\\s+/).reverse(),\n word,\n line = [],\n lineNumber = 0,\n lineHeight = 1.2,\n //ems\n y = text.attr(\"y\"),\n dy = parseFloat(text.attr(\"dy\")) || 0,\n tspan = text.text(null).append(\"tspan\").attr(\"x\", 0).attr(\"dy\", dy + \"em\");\n\n while (word = words.pop()) {\n line.push(word);\n tspan.text(line.join(\" \"));\n if (tspan.node().getComputedTextLength() > width && line.length > 1) {\n line.pop();\n tspan.text(line.join(\" \"));\n line = [word];\n tspan = text.append(\"tspan\").attr(\"x\", 0).attr(\"dy\", lineHeight + dy + \"em\").text(word);\n }\n }\n });\n};\n\nvar d3_mergeLabels = function d3_mergeLabels() {\n var gen = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n var labels = arguments[1];\n var domain = arguments[2];\n var range = arguments[3];\n var labelDelimiter = arguments[4];\n\n if ((typeof labels === \"undefined\" ? \"undefined\" : _typeof(labels)) === \"object\") {\n if (labels.length === 0) return gen;\n\n var i = labels.length;\n for (; i < gen.length; i++) {\n labels.push(gen[i]);\n }\n return labels;\n } else if (typeof labels === \"function\") {\n var customLabels = [];\n var genLength = gen.length;\n for (var _i = 0; _i < genLength; _i++) {\n customLabels.push(labels({\n i: _i,\n genLength: genLength,\n generatedLabels: gen,\n domain: domain,\n range: range,\n labelDelimiter: labelDelimiter\n }));\n }\n return customLabels;\n }\n\n return gen;\n};\n\nvar d3_linearLegend = function d3_linearLegend(scale, cells, labelFormat) {\n var data = [];\n\n if (cells.length > 1) {\n data = cells;\n } else {\n var domain = scale.domain(),\n increment = (domain[domain.length - 1] - domain[0]) / (cells - 1);\n var i = 0;\n\n for (; i < cells; i++) {\n data.push(domain[0] + i * increment);\n }\n }\n\n var labels = data.map(labelFormat);\n return {\n data: data,\n labels: labels,\n feature: function feature(d) {\n return scale(d);\n }\n };\n};\n\nvar d3_quantLegend = function d3_quantLegend(scale, labelFormat, labelDelimiter) {\n var labels = scale.range().map(function (d) {\n var invert = scale.invertExtent(d);\n return labelFormat(invert[0]) + \" \" + labelDelimiter + \" \" + labelFormat(invert[1]);\n });\n\n return {\n data: scale.range(),\n labels: labels,\n feature: d3_identity\n };\n};\n\nvar d3_ordinalLegend = function d3_ordinalLegend(scale) {\n return {\n data: scale.domain(),\n labels: scale.domain(),\n feature: function feature(d) {\n return scale(d);\n }\n };\n};\n\nvar d3_cellOver = function d3_cellOver(cellDispatcher, d, obj) {\n cellDispatcher.call(\"cellover\", obj, d);\n};\n\nvar d3_cellOut = function d3_cellOut(cellDispatcher, d, obj) {\n cellDispatcher.call(\"cellout\", obj, d);\n};\n\nvar d3_cellClick = function d3_cellClick(cellDispatcher, d, obj) {\n cellDispatcher.call(\"cellclick\", obj, d);\n};\n\nvar helper = {\n d3_drawShapes: function d3_drawShapes(shape, shapes, shapeHeight, shapeWidth, shapeRadius, path) {\n if (shape === \"rect\") {\n shapes.attr(\"height\", shapeHeight).attr(\"width\", shapeWidth);\n } else if (shape === \"circle\") {\n shapes.attr(\"r\", shapeRadius);\n } else if (shape === \"line\") {\n shapes.attr(\"x1\", 0).attr(\"x2\", shapeWidth).attr(\"y1\", 0).attr(\"y2\", 0);\n } else if (shape === \"path\") {\n shapes.attr(\"d\", path);\n }\n },\n\n d3_addText: function d3_addText(svg, enter, labels, classPrefix, labelWidth) {\n enter.append(\"text\").attr(\"class\", classPrefix + \"label\");\n var text = svg.selectAll(\"g.\" + classPrefix + \"cell text.\" + classPrefix + \"label\").data(labels).text(d3_identity);\n\n if (labelWidth) {\n svg.selectAll(\"g.\" + classPrefix + \"cell text.\" + classPrefix + \"label\").call(d3_textWrapping, labelWidth);\n }\n\n return text;\n },\n\n d3_calcType: function d3_calcType(scale, ascending, cells, labels, labelFormat, labelDelimiter) {\n var type = scale.invertExtent ? d3_quantLegend(scale, labelFormat, labelDelimiter) : scale.ticks ? d3_linearLegend(scale, cells, labelFormat) : d3_ordinalLegend(scale);\n\n //for d3.scaleSequential that doesn't have a range function\n var range = scale.range && scale.range() || scale.domain();\n type.labels = d3_mergeLabels(type.labels, labels, scale.domain(), range, labelDelimiter);\n\n if (ascending) {\n type.labels = d3_reverse(type.labels);\n type.data = d3_reverse(type.data);\n }\n\n return type;\n },\n\n d3_filterCells: function d3_filterCells(type, cellFilter) {\n var filterCells = type.data.map(function (d, i) {\n return { data: d, label: type.labels[i] };\n }).filter(cellFilter);\n var dataValues = filterCells.map(function (d) {\n return d.data;\n });\n var labelValues = filterCells.map(function (d) {\n return d.label;\n });\n type.data = type.data.filter(function (d) {\n return dataValues.indexOf(d) !== -1;\n });\n type.labels = type.labels.filter(function (d) {\n return labelValues.indexOf(d) !== -1;\n });\n return type;\n },\n\n d3_placement: function d3_placement(orient, cell, cellTrans, text, textTrans, labelAlign) {\n cell.attr(\"transform\", cellTrans);\n text.attr(\"transform\", textTrans);\n if (orient === \"horizontal\") {\n text.style(\"text-anchor\", labelAlign);\n }\n },\n\n d3_addEvents: function d3_addEvents(cells, dispatcher) {\n cells.on(\"mouseover.legend\", function (d) {\n d3_cellOver(dispatcher, d, this);\n }).on(\"mouseout.legend\", function (d) {\n d3_cellOut(dispatcher, d, this);\n }).on(\"click.legend\", function (d) {\n d3_cellClick(dispatcher, d, this);\n });\n },\n\n d3_title: function d3_title(svg, title, classPrefix, titleWidth) {\n if (title !== \"\") {\n var titleText = svg.selectAll(\"text.\" + classPrefix + \"legendTitle\");\n\n titleText.data([title]).enter().append(\"text\").attr(\"class\", classPrefix + \"legendTitle\");\n\n svg.selectAll(\"text.\" + classPrefix + \"legendTitle\").text(title);\n\n if (titleWidth) {\n svg.selectAll(\"text.\" + classPrefix + \"legendTitle\").call(d3_textWrapping, titleWidth);\n }\n\n var cellsSvg = svg.select(\".\" + classPrefix + \"legendCells\");\n var yOffset = svg.select(\".\" + classPrefix + \"legendTitle\").nodes().map(function (d) {\n return d.getBBox().height;\n })[0],\n xOffset = -cellsSvg.nodes().map(function (d) {\n return d.getBBox().x;\n })[0];\n cellsSvg.attr(\"transform\", \"translate(\" + xOffset + \",\" + yOffset + \")\");\n }\n },\n\n d3_defaultLocale: {\n format: format,\n formatPrefix: formatPrefix\n },\n\n d3_defaultFormatSpecifier: \".01f\",\n\n d3_defaultDelimiter: \"to\"\n};\n\nfunction color() {\n var scale = scaleLinear(),\n shape = \"rect\",\n shapeWidth = 15,\n shapeHeight = 15,\n shapeRadius = 10,\n shapePadding = 2,\n cells = [5],\n cellFilter = void 0,\n labels = [],\n classPrefix = \"\",\n useClass = false,\n title = \"\",\n locale = helper.d3_defaultLocale,\n specifier = helper.d3_defaultFormatSpecifier,\n labelOffset = 10,\n labelAlign = \"middle\",\n labelDelimiter = helper.d3_defaultDelimiter,\n labelWrap = void 0,\n orient = \"vertical\",\n ascending = false,\n path = void 0,\n titleWidth = void 0,\n legendDispatcher = dispatch(\"cellover\", \"cellout\", \"cellclick\");\n\n function legend(svg) {\n var type = helper.d3_calcType(scale, ascending, cells, labels, locale.format(specifier), labelDelimiter),\n legendG = svg.selectAll(\"g\").data([scale]);\n\n legendG.enter().append(\"g\").attr(\"class\", classPrefix + \"legendCells\");\n\n if (cellFilter) {\n helper.d3_filterCells(type, cellFilter);\n }\n\n var cell = svg.select(\".\" + classPrefix + \"legendCells\").selectAll(\".\" + classPrefix + \"cell\").data(type.data);\n\n var cellEnter = cell.enter().append(\"g\").attr(\"class\", classPrefix + \"cell\");\n cellEnter.append(shape).attr(\"class\", classPrefix + \"swatch\");\n\n var shapes = svg.selectAll(\"g.\" + classPrefix + \"cell \" + shape + \".\" + classPrefix + \"swatch\").data(type.data);\n\n //add event handlers\n helper.d3_addEvents(cellEnter, legendDispatcher);\n\n cell.exit().transition().style(\"opacity\", 0).remove();\n shapes.exit().transition().style(\"opacity\", 0).remove();\n\n shapes = shapes.merge(shapes);\n\n helper.d3_drawShapes(shape, shapes, shapeHeight, shapeWidth, shapeRadius, path);\n var text = helper.d3_addText(svg, cellEnter, type.labels, classPrefix, labelWrap);\n\n // we need to merge the selection, otherwise changes in the legend (e.g. change of orientation) are applied only to the new cells and not the existing ones.\n cell = cellEnter.merge(cell);\n\n // sets placement\n var textSize = text.nodes().map(function (d) {\n return d.getBBox();\n }),\n shapeSize = shapes.nodes().map(function (d) {\n return d.getBBox();\n });\n //sets scale\n //everything is fill except for line which is stroke,\n if (!useClass) {\n if (shape == \"line\") {\n shapes.style(\"stroke\", type.feature);\n } else {\n shapes.style(\"fill\", type.feature);\n }\n } else {\n shapes.attr(\"class\", function (d) {\n return classPrefix + \"swatch \" + type.feature(d);\n });\n }\n\n var cellTrans = void 0,\n textTrans = void 0,\n textAlign = labelAlign == \"start\" ? 0 : labelAlign == \"middle\" ? 0.5 : 1;\n\n //positions cells and text\n if (orient === \"vertical\") {\n (function () {\n var cellSize = textSize.map(function (d, i) {\n return Math.max(d.height, shapeSize[i].height);\n });\n\n cellTrans = function cellTrans(d, i) {\n var height = sum(cellSize.slice(0, i));\n return \"translate(0, \" + (height + i * shapePadding) + \")\";\n };\n\n textTrans = function textTrans(d, i) {\n return \"translate( \" + (shapeSize[i].width + shapeSize[i].x + labelOffset) + \", \" + (shapeSize[i].y + shapeSize[i].height / 2 + 5) + \")\";\n };\n })();\n } else if (orient === \"horizontal\") {\n cellTrans = function cellTrans(d, i) {\n return \"translate(\" + i * (shapeSize[i].width + shapePadding) + \",0)\";\n };\n textTrans = function textTrans(d, i) {\n return \"translate(\" + (shapeSize[i].width * textAlign + shapeSize[i].x) + \",\\n \" + (shapeSize[i].height + shapeSize[i].y + labelOffset + 8) + \")\";\n };\n }\n\n helper.d3_placement(orient, cell, cellTrans, text, textTrans, labelAlign);\n helper.d3_title(svg, title, classPrefix, titleWidth);\n\n cell.transition().style(\"opacity\", 1);\n }\n\n legend.scale = function (_) {\n if (!arguments.length) return scale;\n scale = _;\n return legend;\n };\n\n legend.cells = function (_) {\n if (!arguments.length) return cells;\n if (_.length > 1 || _ >= 2) {\n cells = _;\n }\n return legend;\n };\n\n legend.cellFilter = function (_) {\n if (!arguments.length) return cellFilter;\n cellFilter = _;\n return legend;\n };\n\n legend.shape = function (_, d) {\n if (!arguments.length) return shape;\n if (_ == \"rect\" || _ == \"circle\" || _ == \"line\" || _ == \"path\" && typeof d === \"string\") {\n shape = _;\n path = d;\n }\n return legend;\n };\n\n legend.shapeWidth = function (_) {\n if (!arguments.length) return shapeWidth;\n shapeWidth = +_;\n return legend;\n };\n\n legend.shapeHeight = function (_) {\n if (!arguments.length) return shapeHeight;\n shapeHeight = +_;\n return legend;\n };\n\n legend.shapeRadius = function (_) {\n if (!arguments.length) return shapeRadius;\n shapeRadius = +_;\n return legend;\n };\n\n legend.shapePadding = function (_) {\n if (!arguments.length) return shapePadding;\n shapePadding = +_;\n return legend;\n };\n\n legend.labels = function (_) {\n if (!arguments.length) return labels;\n labels = _;\n return legend;\n };\n\n legend.labelAlign = function (_) {\n if (!arguments.length) return labelAlign;\n if (_ == \"start\" || _ == \"end\" || _ == \"middle\") {\n labelAlign = _;\n }\n return legend;\n };\n\n legend.locale = function (_) {\n if (!arguments.length) return locale;\n locale = formatLocale(_);\n return legend;\n };\n\n legend.labelFormat = function (_) {\n if (!arguments.length) return legend.locale().format(specifier);\n specifier = formatSpecifier(_);\n return legend;\n };\n\n legend.labelOffset = function (_) {\n if (!arguments.length) return labelOffset;\n labelOffset = +_;\n return legend;\n };\n\n legend.labelDelimiter = function (_) {\n if (!arguments.length) return labelDelimiter;\n labelDelimiter = _;\n return legend;\n };\n\n legend.labelWrap = function (_) {\n if (!arguments.length) return labelWrap;\n labelWrap = _;\n return legend;\n };\n\n legend.useClass = function (_) {\n if (!arguments.length) return useClass;\n if (_ === true || _ === false) {\n useClass = _;\n }\n return legend;\n };\n\n legend.orient = function (_) {\n if (!arguments.length) return orient;\n _ = _.toLowerCase();\n if (_ == \"horizontal\" || _ == \"vertical\") {\n orient = _;\n }\n return legend;\n };\n\n legend.ascending = function (_) {\n if (!arguments.length) return ascending;\n ascending = !!_;\n return legend;\n };\n\n legend.classPrefix = function (_) {\n if (!arguments.length) return classPrefix;\n classPrefix = _;\n return legend;\n };\n\n legend.title = function (_) {\n if (!arguments.length) return title;\n title = _;\n return legend;\n };\n\n legend.titleWidth = function (_) {\n if (!arguments.length) return titleWidth;\n titleWidth = _;\n return legend;\n };\n\n legend.textWrap = function (_) {\n if (!arguments.length) return textWrap;\n textWrap = _;\n return legend;\n };\n\n legend.on = function () {\n var value = legendDispatcher.on.apply(legendDispatcher, arguments);\n return value === legendDispatcher ? legend : value;\n };\n\n return legend;\n}\n\nfunction size() {\n var scale = scaleLinear(),\n shape = \"rect\",\n shapeWidth = 15,\n shapePadding = 2,\n cells = [5],\n cellFilter = void 0,\n labels = [],\n classPrefix = \"\",\n title = \"\",\n locale = helper.d3_defaultLocale,\n specifier = helper.d3_defaultFormatSpecifier,\n labelOffset = 10,\n labelAlign = \"middle\",\n labelDelimiter = helper.d3_defaultDelimiter,\n labelWrap = void 0,\n orient = \"vertical\",\n ascending = false,\n path = void 0,\n titleWidth = void 0,\n legendDispatcher = dispatch(\"cellover\", \"cellout\", \"cellclick\");\n\n function legend(svg) {\n var type = helper.d3_calcType(scale, ascending, cells, labels, locale.format(specifier), labelDelimiter),\n legendG = svg.selectAll(\"g\").data([scale]);\n\n if (cellFilter) {\n helper.d3_filterCells(type, cellFilter);\n }\n\n legendG.enter().append(\"g\").attr(\"class\", classPrefix + \"legendCells\");\n\n var cell = svg.select(\".\" + classPrefix + \"legendCells\").selectAll(\".\" + classPrefix + \"cell\").data(type.data);\n var cellEnter = cell.enter().append(\"g\").attr(\"class\", classPrefix + \"cell\");\n cellEnter.append(shape).attr(\"class\", classPrefix + \"swatch\");\n\n var shapes = svg.selectAll(\"g.\" + classPrefix + \"cell \" + shape + \".\" + classPrefix + \"swatch\");\n\n //add event handlers\n helper.d3_addEvents(cellEnter, legendDispatcher);\n\n cell.exit().transition().style(\"opacity\", 0).remove();\n\n shapes.exit().transition().style(\"opacity\", 0).remove();\n shapes = shapes.merge(shapes);\n\n //creates shape\n if (shape === \"line\") {\n helper.d3_drawShapes(shape, shapes, 0, shapeWidth);\n shapes.attr(\"stroke-width\", type.feature);\n } else {\n helper.d3_drawShapes(shape, shapes, type.feature, type.feature, type.feature, path);\n }\n\n var text = helper.d3_addText(svg, cellEnter, type.labels, classPrefix, labelWrap);\n\n // we need to merge the selection, otherwise changes in the legend (e.g. change of orientation) are applied only to the new cells and not the existing ones.\n cell = cellEnter.merge(cell);\n\n //sets placement\n\n var textSize = text.nodes().map(function (d) {\n return d.getBBox();\n }),\n shapeSize = shapes.nodes().map(function (d, i) {\n var bbox = d.getBBox();\n var stroke = scale(type.data[i]);\n\n if (shape === \"line\" && orient === \"horizontal\") {\n bbox.height = bbox.height + stroke;\n } else if (shape === \"line\" && orient === \"vertical\") {\n bbox.width = bbox.width;\n }\n return bbox;\n });\n\n var maxH = max(shapeSize, function (d) {\n return d.height + d.y;\n }),\n maxW = max(shapeSize, function (d) {\n return d.width + d.x;\n });\n\n var cellTrans = void 0,\n textTrans = void 0,\n textAlign = labelAlign == \"start\" ? 0 : labelAlign == \"middle\" ? 0.5 : 1;\n\n //positions cells and text\n if (orient === \"vertical\") {\n (function () {\n var cellSize = textSize.map(function (d, i) {\n return Math.max(d.height, shapeSize[i].height);\n });\n var y = shape == \"circle\" || shape == \"line\" ? shapeSize[0].height / 2 : 0;\n cellTrans = function cellTrans(d, i) {\n var height = sum(cellSize.slice(0, i));\n\n return \"translate(0, \" + (y + height + i * shapePadding) + \")\";\n };\n\n textTrans = function textTrans(d, i) {\n return \"translate( \" + (maxW + labelOffset) + \",\\n \" + (shapeSize[i].y + shapeSize[i].height / 2 + 5) + \")\";\n };\n })();\n } else if (orient === \"horizontal\") {\n (function () {\n cellTrans = function cellTrans(d, i) {\n var width = sum(shapeSize.slice(0, i), function (d) {\n return d.width;\n });\n var y = shape == \"circle\" || shape == \"line\" ? maxH / 2 : 0;\n return \"translate(\" + (width + i * shapePadding) + \", \" + y + \")\";\n };\n\n var offset = shape == \"line\" ? maxH / 2 : maxH;\n textTrans = function textTrans(d, i) {\n return \"translate( \" + (shapeSize[i].width * textAlign + shapeSize[i].x) + \",\\n \" + (offset + labelOffset) + \")\";\n };\n })();\n }\n\n helper.d3_placement(orient, cell, cellTrans, text, textTrans, labelAlign);\n helper.d3_title(svg, title, classPrefix, titleWidth);\n\n cell.transition().style(\"opacity\", 1);\n }\n\n legend.scale = function (_) {\n if (!arguments.length) return scale;\n scale = _;\n return legend;\n };\n\n legend.cells = function (_) {\n if (!arguments.length) return cells;\n if (_.length > 1 || _ >= 2) {\n cells = _;\n }\n return legend;\n };\n\n legend.cellFilter = function (_) {\n if (!arguments.length) return cellFilter;\n cellFilter = _;\n return legend;\n };\n\n legend.shape = function (_, d) {\n if (!arguments.length) return shape;\n if (_ == \"rect\" || _ == \"circle\" || _ == \"line\") {\n shape = _;\n path = d;\n }\n return legend;\n };\n\n legend.shapeWidth = function (_) {\n if (!arguments.length) return shapeWidth;\n shapeWidth = +_;\n return legend;\n };\n\n legend.shapePadding = function (_) {\n if (!arguments.length) return shapePadding;\n shapePadding = +_;\n return legend;\n };\n\n legend.labels = function (_) {\n if (!arguments.length) return labels;\n labels = _;\n return legend;\n };\n\n legend.labelAlign = function (_) {\n if (!arguments.length) return labelAlign;\n if (_ == \"start\" || _ == \"end\" || _ == \"middle\") {\n labelAlign = _;\n }\n return legend;\n };\n\n legend.locale = function (_) {\n if (!arguments.length) return locale;\n locale = formatLocale(_);\n return legend;\n };\n\n legend.labelFormat = function (_) {\n if (!arguments.length) return legend.locale().format(specifier);\n specifier = formatSpecifier(_);\n return legend;\n };\n\n legend.labelOffset = function (_) {\n if (!arguments.length) return labelOffset;\n labelOffset = +_;\n return legend;\n };\n\n legend.labelDelimiter = function (_) {\n if (!arguments.length) return labelDelimiter;\n labelDelimiter = _;\n return legend;\n };\n\n legend.labelWrap = function (_) {\n if (!arguments.length) return labelWrap;\n labelWrap = _;\n return legend;\n };\n\n legend.orient = function (_) {\n if (!arguments.length) return orient;\n _ = _.toLowerCase();\n if (_ == \"horizontal\" || _ == \"vertical\") {\n orient = _;\n }\n return legend;\n };\n\n legend.ascending = function (_) {\n if (!arguments.length) return ascending;\n ascending = !!_;\n return legend;\n };\n\n legend.classPrefix = function (_) {\n if (!arguments.length) return classPrefix;\n classPrefix = _;\n return legend;\n };\n\n legend.title = function (_) {\n if (!arguments.length) return title;\n title = _;\n return legend;\n };\n\n legend.titleWidth = function (_) {\n if (!arguments.length) return titleWidth;\n titleWidth = _;\n return legend;\n };\n\n legend.on = function () {\n var value = legendDispatcher.on.apply(legendDispatcher, arguments);\n return value === legendDispatcher ? legend : value;\n };\n\n return legend;\n}\n\nfunction symbol() {\n var scale = scaleLinear(),\n shape = \"path\",\n shapeWidth = 15,\n shapeHeight = 15,\n shapeRadius = 10,\n shapePadding = 5,\n cells = [5],\n cellFilter = void 0,\n labels = [],\n classPrefix = \"\",\n title = \"\",\n locale = helper.d3_defaultLocale,\n specifier = helper.d3_defaultFormatSpecifier,\n labelAlign = \"middle\",\n labelOffset = 10,\n labelDelimiter = helper.d3_defaultDelimiter,\n labelWrap = void 0,\n orient = \"vertical\",\n ascending = false,\n titleWidth = void 0,\n legendDispatcher = dispatch(\"cellover\", \"cellout\", \"cellclick\");\n\n function legend(svg) {\n var type = helper.d3_calcType(scale, ascending, cells, labels, locale.format(specifier), labelDelimiter),\n legendG = svg.selectAll(\"g\").data([scale]);\n\n if (cellFilter) {\n helper.d3_filterCells(type, cellFilter);\n }\n\n legendG.enter().append(\"g\").attr(\"class\", classPrefix + \"legendCells\");\n\n var cell = svg.select(\".\" + classPrefix + \"legendCells\").selectAll(\".\" + classPrefix + \"cell\").data(type.data);\n var cellEnter = cell.enter().append(\"g\").attr(\"class\", classPrefix + \"cell\");\n cellEnter.append(shape).attr(\"class\", classPrefix + \"swatch\");\n\n var shapes = svg.selectAll(\"g.\" + classPrefix + \"cell \" + shape + \".\" + classPrefix + \"swatch\");\n\n //add event handlers\n helper.d3_addEvents(cellEnter, legendDispatcher);\n\n //remove old shapes\n cell.exit().transition().style(\"opacity\", 0).remove();\n shapes.exit().transition().style(\"opacity\", 0).remove();\n shapes = shapes.merge(shapes);\n\n helper.d3_drawShapes(shape, shapes, shapeHeight, shapeWidth, shapeRadius, type.feature);\n var text = helper.d3_addText(svg, cellEnter, type.labels, classPrefix, labelWrap);\n\n // we need to merge the selection, otherwise changes in the legend (e.g. change of orientation) are applied only to the new cells and not the existing ones.\n cell = cellEnter.merge(cell);\n\n // sets placement\n var textSize = text.nodes().map(function (d) {\n return d.getBBox();\n }),\n shapeSize = shapes.nodes().map(function (d) {\n return d.getBBox();\n });\n\n var maxH = max(shapeSize, function (d) {\n return d.height;\n }),\n maxW = max(shapeSize, function (d) {\n return d.width;\n });\n\n var cellTrans = void 0,\n textTrans = void 0,\n textAlign = labelAlign == \"start\" ? 0 : labelAlign == \"middle\" ? 0.5 : 1;\n\n //positions cells and text\n if (orient === \"vertical\") {\n (function () {\n var cellSize = textSize.map(function (d, i) {\n return Math.max(maxH, d.height);\n });\n\n cellTrans = function cellTrans(d, i) {\n var height = sum(cellSize.slice(0, i));\n return \"translate(0, \" + (height + i * shapePadding) + \" )\";\n };\n textTrans = function textTrans(d, i) {\n return \"translate( \" + (maxW + labelOffset) + \",\\n \" + (shapeSize[i].y + shapeSize[i].height / 2 + 5) + \")\";\n };\n })();\n } else if (orient === \"horizontal\") {\n cellTrans = function cellTrans(d, i) {\n return \"translate( \" + i * (maxW + shapePadding) + \",0)\";\n };\n textTrans = function textTrans(d, i) {\n return \"translate( \" + (shapeSize[i].width * textAlign + shapeSize[i].x) + \",\\n \" + (maxH + labelOffset) + \")\";\n };\n }\n\n helper.d3_placement(orient, cell, cellTrans, text, textTrans, labelAlign);\n helper.d3_title(svg, title, classPrefix, titleWidth);\n cell.transition().style(\"opacity\", 1);\n }\n\n legend.scale = function (_) {\n if (!arguments.length) return scale;\n scale = _;\n return legend;\n };\n\n legend.cells = function (_) {\n if (!arguments.length) return cells;\n if (_.length > 1 || _ >= 2) {\n cells = _;\n }\n return legend;\n };\n\n legend.cellFilter = function (_) {\n if (!arguments.length) return cellFilter;\n cellFilter = _;\n return legend;\n };\n\n legend.shapePadding = function (_) {\n if (!arguments.length) return shapePadding;\n shapePadding = +_;\n return legend;\n };\n\n legend.labels = function (_) {\n if (!arguments.length) return labels;\n labels = _;\n return legend;\n };\n\n legend.labelAlign = function (_) {\n if (!arguments.length) return labelAlign;\n if (_ == \"start\" || _ == \"end\" || _ == \"middle\") {\n labelAlign = _;\n }\n return legend;\n };\n\n legend.locale = function (_) {\n if (!arguments.length) return locale;\n locale = formatLocale(_);\n return legend;\n };\n\n legend.labelFormat = function (_) {\n if (!arguments.length) return legend.locale().format(specifier);\n specifier = formatSpecifier(_);\n return legend;\n };\n\n legend.labelOffset = function (_) {\n if (!arguments.length) return labelOffset;\n labelOffset = +_;\n return legend;\n };\n\n legend.labelDelimiter = function (_) {\n if (!arguments.length) return labelDelimiter;\n labelDelimiter = _;\n return legend;\n };\n\n legend.labelWrap = function (_) {\n if (!arguments.length) return labelWrap;\n labelWrap = _;\n return legend;\n };\n\n legend.orient = function (_) {\n if (!arguments.length) return orient;\n _ = _.toLowerCase();\n if (_ == \"horizontal\" || _ == \"vertical\") {\n orient = _;\n }\n return legend;\n };\n\n legend.ascending = function (_) {\n if (!arguments.length) return ascending;\n ascending = !!_;\n return legend;\n };\n\n legend.classPrefix = function (_) {\n if (!arguments.length) return classPrefix;\n classPrefix = _;\n return legend;\n };\n\n legend.title = function (_) {\n if (!arguments.length) return title;\n title = _;\n return legend;\n };\n\n legend.titleWidth = function (_) {\n if (!arguments.length) return titleWidth;\n titleWidth = _;\n return legend;\n };\n\n legend.on = function () {\n var value = legendDispatcher.on.apply(legendDispatcher, arguments);\n return value === legendDispatcher ? legend : value;\n };\n\n return legend;\n}\n\nvar thresholdLabels = function thresholdLabels(_ref) {\n var i = _ref.i,\n genLength = _ref.genLength,\n generatedLabels = _ref.generatedLabels,\n labelDelimiter = _ref.labelDelimiter;\n\n if (i === 0) {\n var values = generatedLabels[i].split(\" \" + labelDelimiter + \" \");\n return \"Less than \" + values[1];\n } else if (i === genLength - 1) {\n var _values = generatedLabels[i].split(\" \" + labelDelimiter + \" \");\n return _values[0] + \" or more\";\n }\n return generatedLabels[i];\n};\n\nvar legendHelpers = {\n thresholdLabels: thresholdLabels\n};\n\nvar index = {\n legendColor: color,\n legendSize: size,\n legendSymbol: symbol,\n legendHelpers: legendHelpers\n};\n\nexport { color as legendColor, size as legendSize, symbol as legendSymbol, legendHelpers };export default index;\n//# sourceMappingURL=indexRollupNext.js.map\n","import { instanceOfIHighlight } from \"@hpcc-js/api\";\nimport { Database, Palette, SVGWidget, Widget } from \"@hpcc-js/common\";\nimport { format as d3Format } from \"d3-format\";\nimport { scaleOrdinal as d3ScaleOrdinal } from \"d3-scale\";\nimport {\n symbol as d3Symbol,\n symbolCircle as d3SymbolCircle,\n symbolCross as d3SymbolCross,\n symbolDiamond as d3SymbolDiamond,\n symbolSquare as d3SymbolSquare,\n symbolStar as d3SymbolStar,\n symbolTriangle as d3SymbolTriangle,\n symbolWye as d3SymbolWye\n} from \"d3-shape\";\nimport { legendColor as d3LegendColor } from \"d3-svg-legend\";\nimport { ChartPanel } from \"./ChartPanel.ts\";\n\nexport class Legend extends SVGWidget {\n _owner: ChartPanel;\n _targetWidget: Widget;\n _targetWidgetMonitor;\n _legendOrdinal;\n _disabled: string[] = [];\n\n private _symbolTypeMap = {\n \"circle\": d3SymbolCircle,\n \"cross\": d3SymbolCross,\n \"diamond\": d3SymbolDiamond,\n \"square\": d3SymbolSquare,\n \"star\": d3SymbolStar,\n \"triangle\": d3SymbolTriangle,\n \"wye\": d3SymbolWye\n };\n\n constructor(owner: ChartPanel) {\n super();\n this._owner = owner;\n this._drawStartPos = \"origin\";\n\n const context = this;\n this._legendOrdinal = d3LegendColor()\n .shape(\"path\", d3Symbol().type(d3SymbolCircle).size(150)())\n .shapePadding(10)\n .shapeRadius(10)\n .on(\"cellclick\", function (d) {\n context.onClick(d, this);\n })\n .on(\"cellover\", (d) => {\n context.onOver(d, this);\n })\n .on(\"cellout\", (d) => {\n context.onOut(d, this);\n })\n ;\n }\n\n isDisabled(d: string | Database.Field): boolean {\n if (typeof d === \"undefined\") {\n return false;\n } else if (typeof d === \"string\") {\n return d.indexOf(\"__\") === 0 || this._disabled.indexOf(d) >= 0;\n } else if (d instanceof Database.Field) {\n return d.id().indexOf(\"__\") === 0 || this._disabled.indexOf(d.id()) >= 0;\n }\n return this._disabled.indexOf(d) >= 0;\n }\n\n filteredFields(): Database.Field[] {\n switch (this.dataFamily()) {\n case \"2D\":\n return this.fields();\n case \"ND\":\n return this.fields().filter(d => !this.isDisabled(d));\n }\n return this.fields();\n }\n\n filteredColumns(): string[] {\n switch (this.dataFamily()) {\n case \"2D\":\n return this.columns();\n case \"ND\":\n return this.columns().filter(d => !this.isDisabled(d));\n }\n return this.columns();\n }\n\n filteredData(): any[][] {\n switch (this.dataFamily()) {\n case \"2D\":\n return this.data().filter(row => !this.isDisabled(row[0]));\n case \"ND\":\n const disabledCols: { [key: number]: boolean } = {};\n let anyDisabled: boolean = false;\n this.columns().forEach((col, idx) => {\n const disabled = this.isDisabled(col);\n disabledCols[idx] = disabled;\n if (disabled) {\n anyDisabled = true;\n }\n });\n return !anyDisabled ? this.data() : this.data().map(row => {\n return row.filter((cell, idx) => !disabledCols[idx]);\n });\n }\n return this.data();\n }\n\n isRainbow() {\n const widget = this.getWidget();\n return widget && widget._palette && widget._palette.type() === \"rainbow\";\n }\n\n targetWidget(): Widget;\n targetWidget(_: Widget): this;\n targetWidget(_?: Widget): Widget | this {\n if (!arguments.length) return this._targetWidget;\n this._targetWidget = _;\n if (this._targetWidgetMonitor) {\n this._targetWidgetMonitor.remove();\n delete this._targetWidgetMonitor;\n }\n if (this._targetWidget) {\n const context = this;\n this._targetWidgetMonitor = this._targetWidget.monitor(function (key, newProp, oldProp, source) {\n switch (key) {\n case \"chart\":\n case \"columns\":\n case \"data\":\n case \"paletteID\":\n context.lazyRender();\n break;\n }\n });\n }\n return this;\n }\n\n getWidget() {\n if (this._targetWidget) {\n switch (this._targetWidget.classID()) {\n case \"composite_MultiChart\":\n return (this._targetWidget as any).chart();\n }\n }\n return this._targetWidget;\n }\n\n getPalette(): Palette.OrdinalPaletteFunc | Palette.RainbowPaletteFunc {\n const widget = this.getWidget();\n if (widget && widget._palette) {\n switch (widget._palette.type()) {\n case \"ordinal\":\n return Palette.ordinal(widget._palette.id());\n case \"rainbow\":\n return Palette.rainbow(widget._palette.id());\n }\n }\n return Palette.ordinal(\"default\");\n }\n\n getPaletteType() {\n return this.getPalette().type();\n }\n\n fillColorFunc() {\n const widget = this.getWidget();\n if (widget && widget.fillColor) {\n // Legend will render before the widget, so its possible the widgets palette will not have switched yet...\n if (widget._palette && widget.paletteID && widget._palette.name !== widget.paletteID()) {\n widget._palette = widget._palette.switch(widget.paletteID());\n }\n return (row, col, sel) => {\n return widget.fillColor(row, col, sel);\n };\n }\n const palette = Palette.ordinal(widget && widget.paletteID ? widget.paletteID() || \"default\" : \"default\");\n return (row, col, sel) => {\n return palette(col);\n };\n }\n\n fillColor(row, col, sel) {\n return this.fillColorFunc()(row, col, sel);\n }\n\n protected _g;\n enter(domNode, element) {\n super.enter(domNode, element);\n this._g = element.append(\"g\")\n .attr(\"class\", \"legendOrdinal\")\n ;\n }\n\n calcMetaData() {\n let dataArr = [];\n let total = 0;\n let maxLabelWidth = 0;\n const colLength = this.columns().length;\n\n if (this._targetWidget) {\n const columns = this.columns();\n switch (this.getPaletteType()) {\n case \"ordinal\":\n const fillColor = this.fillColorFunc();\n let val = 0;\n switch (this.dataFamily()) {\n case \"2D\":\n dataArr = this.data().map(function (n, i) {\n val = this.data()[i].slice(1, colLength).reduce((acc, n) => acc + n, 0);\n const disabled = this.isDisabled(n[0]);\n if (!disabled) total += val;\n const label = n[0] + (!disabled && this.showSeriesTotal() ? ` (${val})` : \"\");\n const textSize = this.textSize(label);\n if (maxLabelWidth < textSize.width) maxLabelWidth = textSize.width;\n return [fillColor(n, n[0], false), n[0], label];\n }, this);\n break;\n case \"ND\":\n const widgetColumns = this.columns().filter(col => col.indexOf(\"__\") !== 0);\n dataArr = widgetColumns.filter(function (n, i) { return i > 0; }).map(function (n, i) {\n val = this.data().reduce((acc, n) => acc + n[i + 1], 0);\n const disabled = this.isDisabled(columns[i + 1]);\n const label = n + (!disabled && this.showSeriesTotal() ? ` (${val})` : \"\");\n if (!disabled) total += val;\n const textSize = this.textSize(label);\n if (maxLabelWidth < textSize.width) maxLabelWidth = textSize.width;\n return [fillColor(undefined, n, false), n, label];\n }, this);\n break;\n default:\n const widgetColumns2 = this.columns();\n dataArr = widgetColumns2.map(function (n) {\n return [fillColor(undefined, n, false), n];\n }, this);\n break;\n }\n break;\n case \"rainbow\":\n const palette = this.getPalette() as Palette.RainbowPaletteFunc;\n const format = d3Format(this.rainbowFormat());\n const widget = this.getWidget();\n const steps = this.rainbowBins();\n const weightMin: number = widget._dataMinWeight;\n const weightMax: number = widget._dataMaxWeight;\n const stepWeightDiff = (weightMax - weightMin) / (steps - 1);\n dataArr.push([palette(weightMin, weightMin, weightMax), format(weightMin)]);\n for (let x = 1; x < steps - 1; ++x) {\n let mid = stepWeightDiff * x;\n if (Math.floor(mid) > parseInt(dataArr[0][1])) {\n mid = Math.floor(mid);\n }\n dataArr.push([palette(mid, weightMin, weightMax), format(mid)]);\n }\n dataArr.push([palette(weightMax, weightMin, weightMax), format(weightMax)]);\n break;\n }\n }\n return {\n dataArr,\n total,\n maxLabelWidth\n };\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n\n const { dataArr, maxLabelWidth, total } = this.calcMetaData();\n\n const radius = this.shapeRadius();\n const size = this.radiusToSymbolSize(radius);\n\n const strokeWidth = 1;\n\n let shapePadding = this.itemPadding();// + strokeWidth;\n if (this.orientation() === \"horizontal\") {\n shapePadding += maxLabelWidth - (radius * 2);\n }\n\n const ordinal = d3ScaleOrdinal()\n .domain(dataArr.map(row => row[1]))\n .range(dataArr.map(row => row[0]));\n this._legendOrdinal\n .shape(\"path\", d3Symbol().type(this._symbolTypeMap[this.symbolType()]).size(size)())\n .orient(this.orientation())\n .title(this.title())\n .labelWrap(this.labelMaxWidth())\n .labelAlign(this.labelAlign())\n .shapePadding(shapePadding)\n .scale(ordinal)\n .labels(d => dataArr[d.i][2])\n ;\n\n this._g.call(this._legendOrdinal);\n\n this.updateDisabled(element, dataArr);\n\n const legendCellsBbox = this._g.select(\".legendCells\").node().getBBox();\n let offsetX = Math.abs(legendCellsBbox.x);\n let offsetY = Math.abs(legendCellsBbox.y) + strokeWidth;\n\n if (this.orientation() === \"horizontal\") {\n if (this.labelAlign() === \"start\") {\n offsetX += strokeWidth;\n } else if (this.labelAlign() === \"end\") {\n offsetX -= strokeWidth;\n }\n if (this.width() > legendCellsBbox.width) {\n const extraWidth = this.width() - legendCellsBbox.width;\n offsetX += (extraWidth / 2);\n }\n } else if (this.orientation() === \"vertical\") {\n offsetX += strokeWidth;\n if (this._containerSize.height > legendCellsBbox.height) {\n const extraHeight = this.height() - legendCellsBbox.height;\n offsetY += (extraHeight / 2);\n }\n }\n\n this._g.attr(\"transform\", `translate(${offsetX}, ${offsetY})`);\n this.pos({\n x: 0,\n y: 0\n });\n this._legendOrdinal\n .labelOffset(this.itemPadding())\n ;\n const legendTotal = this._g.selectAll(\".legendTotal\").data(dataArr.length && this.showLegendTotal() ? [total] : []);\n const totalText = `Total: ${total}`;\n const totalOffsetX = -offsetX;\n const totalOffsetY = legendCellsBbox.height + this.itemPadding() + strokeWidth;\n this.enableOverflowScroll(false);\n this.enableOverflow(true);\n legendTotal\n .enter()\n .append(\"text\")\n .classed(\"legendTotal\", true)\n .merge(legendTotal)\n .attr(\"transform\", `translate(${totalOffsetX}, ${totalOffsetY})`)\n .text(totalText)\n ;\n legendTotal.exit().remove();\n }\n\n updateDisabled(element, dataArr) {\n element\n .style(\"cursor\", \"pointer\")\n .selectAll(\"path.swatch\").filter((d, i) => i < dataArr.length)\n .style(\"stroke\", (d, i) => dataArr[i][0])\n .style(\"fill\", (d, i) =>\n this._disabled.indexOf(d) < 0 ? dataArr[i][0] : \"white\"\n )\n ;\n }\n\n postUpdate(domNode, element) {\n let w;\n if (this._boundingBox) {\n w = this._boundingBox.width;\n this._boundingBox.width = this._size.width;\n }\n super.postUpdate(domNode, element);\n if (w !== undefined) {\n this._boundingBox.width = w;\n }\n this._parentRelativeDiv.style(\"overflow\", \"hidden\");\n }\n\n exit(domNode, element) {\n super.exit(domNode, element);\n }\n\n radiusToSymbolSize(radius) {\n const circleSize = Math.pow(radius, 2) * Math.PI;\n switch (this.symbolType()) {\n case \"star\":\n return circleSize * 0.45;\n case \"triangle\":\n return circleSize * 0.65;\n case \"cross\":\n case \"diamond\":\n case \"wye\":\n return circleSize * 0.75;\n case \"circle\":\n return circleSize;\n case \"square\":\n return circleSize * 1.3;\n }\n }\n\n onClick(d, domNode) {\n switch (this.getPaletteType()) {\n case \"ordinal\":\n switch (this.dataFamily()) {\n case \"2D\":\n case \"ND\":\n const disabledIdx = this._disabled.indexOf(d);\n if (disabledIdx < 0) {\n this._disabled.push(d);\n } else {\n this._disabled.splice(disabledIdx, 1);\n }\n this._owner.refreshColumns();\n this._owner.refreshData();\n this._owner.render();\n break;\n }\n break;\n }\n }\n\n onOver(d, domNode) {\n if (instanceOfIHighlight(this._owner)) {\n switch (this.getPaletteType()) {\n case \"ordinal\":\n switch (this.dataFamily()) {\n case \"2D\":\n case \"ND\":\n if (this._disabled.indexOf(d) < 0) {\n this._owner.highlightColumn(d);\n }\n break;\n }\n break;\n }\n }\n }\n\n onOut(d, domNode) {\n if (instanceOfIHighlight(this._owner)) {\n switch (this.getPaletteType()) {\n case \"ordinal\":\n switch (this.dataFamily()) {\n case \"2D\":\n case \"ND\":\n this._owner.highlightColumn();\n break;\n }\n break;\n }\n }\n }\n\n onDblClick(rowData, rowIdx) {\n }\n\n onMouseOver(rowData, rowIdx) {\n }\n private _containerSize;\n resize(_size?: { width: number, height: number }) {\n let retVal;\n if (this.fitToContent()) {\n this._containerSize = _size;\n const bbox = this.getBBox();\n if (_size.width > bbox.width) {\n bbox.width = _size.width;\n }\n if (_size.height > bbox.height) {\n bbox.height = _size.height;\n }\n retVal = super.resize.apply(this, [{ ...bbox }]);\n } else {\n retVal = super.resize.apply(this, arguments);\n }\n return retVal;\n }\n\n}\nLegend.prototype._class += \" layout_Legend\";\n\nexport interface Legend {\n title(): string;\n title(_: string): this;\n symbolType(): \"circle\" | \"cross\" | \"diamond\" | \"square\" | \"star\" | \"triangle\" | \"wye\";\n symbolType(_: \"circle\" | \"cross\" | \"diamond\" | \"square\" | \"star\" | \"triangle\" | \"wye\"): this;\n labelMaxWidth(): number;\n labelMaxWidth(_: number): this;\n orientation(): \"vertical\" | \"horizontal\";\n orientation(_: \"vertical\" | \"horizontal\"): this;\n orientation_exists: () => boolean;\n dataFamily(): \"1D\" | \"2D\" | \"ND\" | \"map\" | \"graph\" | \"any\";\n dataFamily(_: \"1D\" | \"2D\" | \"ND\" | \"map\" | \"graph\" | \"any\"): this;\n dataFamily_exists: () => boolean;\n rainbowFormat(): string;\n rainbowFormat(_: string): this;\n rainbowFormat_exists: () => boolean;\n rainbowBins(): number;\n rainbowBins(_: number): this;\n rainbowBins_exists: () => boolean;\n showSeriesTotal(): boolean;\n showSeriesTotal(_: boolean): this;\n showLegendTotal(): boolean;\n showLegendTotal(_: boolean): this;\n itemPadding(): number;\n itemPadding(_: number): this;\n shapeRadius(): number;\n shapeRadius(_: number): this;\n fitToContent(): boolean;\n fitToContent(_: boolean): this;\n labelAlign(): \"start\" | \"middle\" | \"end\";\n labelAlign(_: \"start\" | \"middle\" | \"end\"): this;\n}\nLegend.prototype.publish(\"title\", \"\", \"string\", \"Title\");\nLegend.prototype.publish(\"symbolType\", \"circle\", \"set\", \"Shape of each legend item\", [\"circle\", \"cross\", \"diamond\", \"square\", \"star\", \"triangle\", \"wye\"]);\nLegend.prototype.publish(\"labelMaxWidth\", null, \"number\", \"Max Label Width (pixels)\", null, { optional: true });\nLegend.prototype.publish(\"orientation\", \"vertical\", \"set\", \"Orientation of Legend rows\", [\"vertical\", \"horizontal\"], { tags: [\"Private\"] });\nLegend.prototype.publish(\"dataFamily\", \"ND\", \"set\", \"Type of data\", [\"1D\", \"2D\", \"ND\", \"map\", \"graph\", \"any\"], { tags: [\"Private\"] });\nLegend.prototype.publish(\"rainbowFormat\", \",\", \"string\", \"Rainbow number formatting\", null, { tags: [\"Private\"], optional: true, disable: w => !w.isRainbow() });\nLegend.prototype.publish(\"rainbowBins\", 8, \"number\", \"Number of rainbow bins\", null, { tags: [\"Private\"], disable: w => !w.isRainbow() });\nLegend.prototype.publish(\"showSeriesTotal\", false, \"boolean\", \"Show value next to series\");\nLegend.prototype.publish(\"showLegendTotal\", false, \"boolean\", \"Show a total of the series values under the legend\", null);\nLegend.prototype.publish(\"itemPadding\", 8, \"number\", \"Padding between legend items (pixels)\");\nLegend.prototype.publish(\"shapeRadius\", 7, \"number\", \"Radius of legend shape (pixels)\");\nLegend.prototype.publish(\"fitToContent\", true, \"boolean\", \"If true, resize will simply reapply the bounding box dimensions\");\nLegend.prototype.publish(\"labelAlign\", \"start\", \"set\", \"Horizontal alignment of legend item label (for horizontal orientation only)\", [\"start\", \"middle\", \"end\"], { optional: true, disable: (w: any) => w.orientation() === \"vertical\" });\n","import { HTMLWidget, ISize, Widget } from \"@hpcc-js/common\";\n\nimport \"../src/Modal.css\";\n\nexport class Modal extends HTMLWidget {\n\n protected _widget: Widget;\n\n protected _relativeTarget: HTMLElement;\n\n protected _fade;\n protected _modal;\n protected _modalHeader;\n protected _modalBody;\n protected _modalHeaderAnnotations;\n protected _modalHeaderCloseButton;\n _close: () => void;\n\n constructor() {\n super();\n this._tag = \"div\";\n }\n\n closeModal() {\n this.visible(false);\n }\n\n getRelativeTarget() {\n let relativeTarget;\n if (this.relativeTargetId()) {\n relativeTarget = document.getElementById(this.relativeTargetId());\n if (relativeTarget) {\n return relativeTarget;\n }\n }\n if (!relativeTarget) {\n relativeTarget = this.locateAncestor(\"layout_Grid\");\n if (relativeTarget && relativeTarget.element) {\n return relativeTarget.element().node();\n }\n }\n return document.body;\n }\n\n setModalSize(): ISize {\n if (this.fixedHeight() !== null && this.fixedWidth() !== null) {\n this._modal\n .style(\"height\", this.fixedHeight())\n .style(\"width\", this.fixedWidth())\n .style(\"min-height\", null)\n .style(\"min-width\", null)\n .style(\"max-height\", null)\n .style(\"max-width\", null)\n ;\n } else if (this.minHeight() || this.minWidth()) {\n this._modal\n .style(\"min-height\", this.minHeight())\n .style(\"min-width\", this.minWidth())\n .style(\"max-height\", this.maxHeight())\n .style(\"max-width\", this.maxWidth())\n ;\n }\n const modalRect = this._modal.node().getBoundingClientRect();\n const headerRect = this._modalHeader.node().getBoundingClientRect();\n this._modalBody\n .style(\"height\", (modalRect.height - headerRect.height) + \"px\")\n .style(\"width\", modalRect.width);\n\n return modalRect;\n }\n\n setFadePosition(rect) {\n this._fade\n .style(\"top\", rect.top + \"px\")\n .style(\"left\", rect.left + \"px\")\n .style(\"width\", rect.width + \"px\")\n .style(\"height\", rect.height + \"px\")\n ;\n }\n\n setModalPosition(rect) {\n const modalRect = this.setModalSize();\n if (this.fixedTop() !== null && this.fixedLeft() !== null) {\n this._modal\n .style(\"top\", `calc(${this.fixedTop()} + ${rect.top}px)`)\n .style(\"left\", `calc(${this.fixedLeft()} + ${rect.left}px)`)\n ;\n } else if (this.fixedHeight() !== null && this.fixedWidth() !== null) {\n this._modal\n .style(\"top\", (rect.top + (rect.height / 2) - (modalRect.height / 2)) + \"px\")\n .style(\"left\", (rect.left + (rect.width / 2) - (modalRect.width / 2)) + \"px\")\n ;\n } else if (this.minHeight() || this.minWidth()) {\n const contentRect = this._modal.node().getBoundingClientRect();\n this._modal\n .style(\"top\", (rect.top + (rect.height / 2) - (contentRect.height / 2)) + \"px\")\n .style(\"left\", (rect.left + (rect.width / 2) - (contentRect.width / 2)) + \"px\")\n ;\n }\n }\n\n resize(size?: any): this {\n super.resize();\n if (this._modal) this.setModalSize();\n return this;\n }\n\n resizeBodySync(width: number, height: number): this {\n const header = this._modalHeader.node();\n const headerRect = header.getBoundingClientRect();\n\n this._modal\n .style(\"width\", width + \"px\")\n .style(\"height\", (height + headerRect.height) + \"px\")\n .style(\"min-width\", width + \"px\")\n .style(\"min-height\", (height + headerRect.height) + \"px\")\n ;\n this._modalHeader\n .style(\"width\", width + \"px\")\n ;\n this._modalBody\n .style(\"width\", width + \"px\")\n .style(\"height\", height + \"px\")\n ;\n return this\n .minWidth(width + \"px\")\n .minHeight((height + headerRect.height) + \"px\")\n .resize({\n height: height + headerRect.height,\n width\n })\n ;\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this._fade = element.append(\"div\")\n .classed(\"layout_Modal-fade\", true)\n .classed(\"layout_Modal-fadeClickable\", this.enableClickFadeToClose())\n .classed(\"layout_Modal-fade-hidden\", !this.showFade())\n ;\n const header_h = this.titleFontSize() * 2;\n this._modal = element.append(\"div\")\n .classed(\"layout_Modal-content\", true)\n ;\n this._modalHeader = this._modal.append(\"div\")\n .classed(\"layout_Modal-header\", true)\n .style(\"color\", this.titleFontColor())\n .style(\"font-size\", this.titleFontSize() + \"px\")\n .style(\"height\", header_h + \"px\")\n ;\n this._modalBody = this._modal.append(\"div\")\n .classed(\"layout_Modal-body\", true)\n .style(\"height\", `calc( 100% - ${header_h}px )`)\n .style(\"overflow-x\", this.overflowX())\n .style(\"overflow-y\", this.overflowY())\n ;\n this._modalHeader.append(\"div\")\n .classed(\"layout_Modal-title\", true)\n .style(\"line-height\", this.titleFontSize() + \"px\")\n .style(\"top\", (this.titleFontSize() / 2) + \"px\")\n .style(\"left\", (this.titleFontSize() / 2) + \"px\")\n .text(this.formattedTitle())\n ;\n\n this._modalHeaderAnnotations = this._modalHeader.append(\"div\")\n .classed(\"layout_Modal-annotations\", true)\n ;\n this._modalHeaderCloseButton = this._modalHeaderAnnotations.append(\"div\")\n .classed(\"layout_Modal-closeButton\", true)\n .html(\"<i class=\\\"fa fa-close\\\"></i>\")\n ;\n\n this._modalHeaderAnnotations\n .style(\"line-height\", this.titleFontSize() + \"px\")\n .style(\"right\", (this.titleFontSize() / 2) + \"px\")\n .style(\"top\", (this.titleFontSize() / 2) + \"px\")\n ;\n this._modalHeaderCloseButton.on(\"click\", () => {\n this.closeModal();\n });\n this._fade.on(\"click\", n => {\n if (this.enableClickFadeToClose()) {\n this.closeModal();\n }\n });\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n element.style(\"display\", this.show() ? null : \"none\");\n this._fade.classed(\"layout_Modal-fade-hidden\", !this.showFade());\n this._relativeTarget = this.getRelativeTarget();\n\n this.setModalSize();\n const rect = this._relativeTarget.getBoundingClientRect();\n this.setFadePosition(rect);\n this.setModalPosition(rect);\n\n if (this.show()) {\n if (!this._widget.target()) {\n this._widget.target(this._modalBody.node());\n }\n this._widget.resize().render();\n } else {\n this._widget\n .target(null)\n .render()\n ;\n }\n }\n\n exit(domNode, element) {\n if (this._widget) {\n this._widget.target(null);\n }\n super.exit(domNode, element);\n }\n\n formattedTitle() {\n const title = this.title_exists() ? this.title().trim() : \"\";\n if (title.length > 0 && title.slice(0, 1) === \"(\" && title.slice(-1) === \")\") {\n return title.slice(1, -1);\n }\n return this.title();\n }\n}\nModal.prototype._class += \" layout_Modal\";\n\nexport interface Modal {\n show(): boolean;\n show(_: boolean): this;\n showFade(): boolean;\n showFade(_: boolean): this;\n enableClickFadeToClose(): boolean;\n enableClickFadeToClose(_: boolean): this;\n title(): string;\n title(_: string): this;\n title_exists(): boolean;\n titleFontSize(): number;\n titleFontSize(_: number): this;\n titleFontColor(): string;\n titleFontColor(_: string): this;\n minWidth(): string;\n minWidth(_: string): this;\n minHeight(): string;\n minHeight(_: string): this;\n maxWidth(): string;\n maxWidth(_: string): this;\n maxHeight(): string;\n maxHeight(_: string): this;\n fixedWidth(): string;\n fixedWidth(_: string): this;\n fixedHeight(): string;\n fixedHeight(_: string): this;\n fixedTop(): string;\n fixedTop(_: string): this;\n fixedLeft(): string;\n fixedLeft(_: string): this;\n relativeTargetId(): string;\n relativeTargetId(_: string): this;\n widget(): Widget;\n widget(_: Widget): this;\n overflowX(): \"hidden\" | \"scroll\";\n overflowX(_: \"hidden\" | \"scroll\"): this;\n overflowY(): \"hidden\" | \"scroll\";\n overflowY(_: \"hidden\" | \"scroll\"): this;\n}\n\nModal.prototype.publish(\"title\", null, \"string\", \"title\");\nModal.prototype.publish(\"widget\", null, \"widget\", \"widget\");\nModal.prototype.publish(\"titleFontSize\", 18, \"number\", \"titleFontSize (in pixels)\");\nModal.prototype.publish(\"titleFontColor\", \"#ffffff\", \"html-color\", \"titleFontColor\");\nModal.prototype.publish(\"relativeTargetId\", null, \"string\", \"relativeTargetId\");\n\nModal.prototype.publish(\"show\", true, \"boolean\", \"show\");\nModal.prototype.publish(\"showFade\", true, \"boolean\", \"showFade\");\nModal.prototype.publish(\"enableClickFadeToClose\", true, \"boolean\", \"enableClickFadeToClose\");\n\nModal.prototype.publish(\"minWidth\", \"400px\", \"string\", \"minWidth\");\nModal.prototype.publish(\"minHeight\", \"400px\", \"string\", \"minHeight\");\nModal.prototype.publish(\"maxWidth\", \"800px\", \"string\", \"maxWidth\");\nModal.prototype.publish(\"maxHeight\", \"800px\", \"string\", \"maxHeight\");\nModal.prototype.publish(\"fixedWidth\", null, \"string\", \"fixedWidth\");\nModal.prototype.publish(\"fixedHeight\", null, \"string\", \"fixedHeight\");\nModal.prototype.publish(\"fixedTop\", null, \"string\", \"fixedTop\");\nModal.prototype.publish(\"fixedLeft\", null, \"string\", \"fixedLeft\");\nModal.prototype.publish(\"overflowX\", \"hidden\", \"string\", \"overflowX\");\nModal.prototype.publish(\"overflowY\", \"scroll\", \"string\", \"overflowY\");\n","import { IHighlight } from \"@hpcc-js/api\";\nimport { Button, Database, IconBar, ProgressBar, Spacer, SVGWidget, Text, TitleBar, ToggleButton, Utility, Widget } from \"@hpcc-js/common\";\nimport type { XYAxis } from \"@hpcc-js/chart\";\nimport { Table } from \"@hpcc-js/dgrid\";\nimport { select as d3Select } from \"d3-selection\";\nimport { Border2 } from \"./Border2.ts\";\nimport { Carousel } from \"./Carousel.ts\";\nimport { Legend } from \"./Legend.ts\";\nimport { Modal } from \"./Modal.ts\";\n\nimport \"../src/ChartPanel.css\";\n\nexport class ChartPanel<T extends Widget = Widget> extends Border2 implements IHighlight {\n\n protected _legend = new Legend(this).enableOverflow(true);\n protected _progressBar = new ProgressBar();\n protected _autoScale = false;\n protected _resolutions = {\n tiny: { width: 100, height: 100 },\n small: { width: 300, height: 300 }\n };\n private _modal = new Modal();\n private _highlight: boolean;\n private _scale: number;\n private _orig_size: any;\n\n private _toggleInfo = new ToggleButton().faChar(\"fa-info-circle\").tooltip(\".Description\")\n .selected(false)\n .on(\"enabled\", () => {\n return this.description() !== \"\";\n })\n .on(\"click\", () => {\n if (this._toggleInfo.selected()) {\n this._modal\n .title(this.title())\n .widget(new Text().text(this.description()))\n .show(true)\n .render()\n ;\n\n const origCloseFunc = this._modal._close;\n this._modal._close = () => {\n this._toggleInfo\n .selected(false)\n .render()\n ;\n this._modal._close = origCloseFunc;\n };\n }\n })\n .on(\"mouseMove\", () => {\n /*\n this._modal.showPreview(true).render(n => {\n n.resize().render();\n });\n */\n })\n .on(\"mouseOut\", () => {\n /*\n if (this._modal.showPreview()) {\n this._modal.show(false).showPreview(false).render();\n }\n */\n });\n\n private _toggleData = new ToggleButton().faChar(\"fa-table\").tooltip(\"Data\")\n .on(\"click\", () => {\n this.dataVisible(this._toggleData.selected());\n this.render();\n });\n\n private _buttonDownload = new Button().faChar(\"fa-download\").tooltip(\"Download\")\n .on(\"click\", () => {\n this.downloadCSV();\n });\n\n private _buttonDownloadImage = new Button().faChar(\"fa-image\").tooltip(\"Download Image\")\n .on(\"click\", () => {\n this.downloadPNG();\n });\n\n private _toggleLegend = new ToggleButton().faChar(\"fa-list-ul\").tooltip(\"Legend\")\n .selected(false)\n .on(\"click\", () => {\n const selected = this._toggleLegend.selected();\n if (this.legendPosition() === \"bottom\") {\n this.showBottom(selected);\n } else if (this.legendPosition() === \"right\") {\n this.showRight(selected);\n }\n this.legendVisible(selected);\n this.render();\n });\n\n protected _spacer = new Spacer();\n\n _titleBar = new TitleBar().buttons([this._toggleData, this._buttonDownload, this._buttonDownloadImage, this._spacer, this._toggleLegend]);\n\n protected _carousel = new Carousel();\n protected _table = new Table();\n protected _widget: T;\n\n protected _hideLegendToggleList = [\"dgrid_Table\"];\n\n constructor() {\n super();\n this._tag = \"div\";\n }\n\n fields(): Database.Field[];\n fields(_: Database.Field[]): this;\n fields(_?: Database.Field[]): this | Database.Field[] {\n if (!arguments.length) return super.fields();\n super.fields(_);\n this._legend.fields(_);\n this.refreshFields();\n return this;\n }\n refreshFields() {\n this._widget.fields(this._legend.filteredFields());\n this._table.fields(this._legend.filteredFields());\n return this;\n }\n\n columns(): string[];\n columns(_: string[], asDefault?: boolean): this;\n columns(_?: string[], asDefault?: boolean): string[] | this {\n if (!arguments.length) return super.columns();\n super.columns(_, asDefault);\n this._legend.columns(_, asDefault);\n this.refreshColumns();\n return this;\n }\n refreshColumns() {\n this._widget.columns(this._legend.filteredColumns());\n this._table.columns(this._legend.filteredColumns());\n return this;\n }\n\n data(_?) {\n if (!arguments.length) return super.data();\n super.data(_);\n this._legend.data(_);\n this.refreshData();\n return this;\n }\n refreshData() {\n this._widget.data(this._legend.filteredData());\n this._table.data(this._legend.filteredData());\n return this;\n }\n\n highlight(): boolean;\n highlight(_: boolean): this;\n highlight(_?: boolean): boolean | this {\n if (!arguments.length) return this._highlight;\n this._highlight = _;\n return this;\n }\n\n startProgress() {\n this._progressBar.start();\n }\n\n finishProgress() {\n this._progressBar.finish();\n }\n\n buttons(): Widget[];\n buttons(_: Widget[]): this;\n buttons(_?: Widget[]): this | Widget[] {\n if (!arguments.length) return this._titleBar.buttons();\n this._titleBar.buttons(_);\n return this;\n }\n\n downloadCSV() {\n const namePrefix = this.downloadTitle() ? this.downloadTitle() : this.title() ? this.title() : \"data\";\n const nameSuffix = this.downloadTimestampSuffix() ? \"_\" + Utility.timestamp() : \"\";\n Utility.downloadString(\"CSV\", this._widget.export(\"CSV\"), namePrefix + nameSuffix);\n return this;\n }\n\n downloadPNG() {\n const widget = this.widget();\n if (widget instanceof SVGWidget) {\n if (!this.legendVisible()) {\n widget.downloadPNG(this.title());\n } else {\n widget.downloadPNG(this.title(), undefined, this._legend);\n }\n }\n return this;\n }\n\n highlightColumn(column?: string): this {\n if (column) {\n const cssTag = `series-${this.cssTag(column)}`;\n this._centerWA.element().selectAll(\".series\")\n .each(function () {\n const element = d3Select(this);\n const highlight = element.classed(cssTag);\n element\n .classed(\"highlight\", highlight)\n .classed(\"lowlight\", !highlight)\n ;\n })\n ;\n } else {\n this._centerWA.element().selectAll(\".series\")\n .classed(\"highlight\", false)\n .classed(\"lowlight\", false)\n ;\n }\n return this;\n }\n\n getResponsiveMode(): \"tiny\" | \"small\" | \"regular\" | \"none\" {\n if (!this.enableAutoscaling()) return \"none\";\n if (!this._autoScale) return \"regular\";\n if (this.size().width <= this._resolutions.tiny.width || this.size().height <= this._resolutions.tiny.height) {\n return \"tiny\";\n } else if (this.size().width <= this._resolutions.small.width || this.size().height <= this._resolutions.small.height) {\n return \"small\";\n }\n return \"regular\";\n }\n\n setOrigSize() {\n this._orig_size = JSON.parse(JSON.stringify(this.size()));\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this._modal\n .target(this.target())\n .relativeTargetId(this.id())\n ;\n\n this.top(this._titleBar);\n this.center(this._carousel);\n\n this._legend\n .targetWidget(this._widget)\n .orientation(\"vertical\")\n .title(\"\")\n .visible(false)\n ;\n\n this._progressBar.enter(domNode, element);\n this.setOrigSize();\n }\n\n preUpdateTiny(element) {\n element.selectAll(\"div.body,div.title-text,div.icon-bar\").style(\"display\", \"none\");\n }\n\n preUpdateSmall(element) {\n const scale_x = this._orig_size.width / this._resolutions.small.width;\n const scale_y = this._orig_size.height / this._resolutions.small.height;\n this._scale = Math.min(scale_x, scale_y);\n const x_is_smaller = this._scale === scale_x;\n this.size({\n width: x_is_smaller ? this._resolutions.small.width : this._orig_size.width * (1 / this._scale),\n height: !x_is_smaller ? this._resolutions.small.height : this._orig_size.height * (1 / this._scale)\n });\n element.select(\"div.title-icon\").style(\"position\", \"static\");\n element.selectAll(\"lhs\").style(\"display\", \"none\");\n element.selectAll(\"div.body,div.title-text,div.icon-bar\").style(\"display\", \"\");\n element.selectAll(\"div.data-count\").style(\"visibility\", \"hidden\");\n element.style(\"transform\", `scale(${this._scale})`);\n }\n\n preUpdateRegular(element) {\n element.selectAll(\"div.body,div.title-text,div.icon-bar\").style(\"display\", \"\");\n element.selectAll(\"div.data-count\").style(\"visibility\", \"hidden\");\n element.select(\"div.title-icon\").style(\"position\", \"static\");\n element.style(\"transform\", \"translate(0px,0px) scale(1)\");\n }\n\n private _prevdataVisible;\n private _prevlegendVisible;\n private _prevLegendPosition;\n private _prevChartDataFamily;\n private _prevChart;\n private _prevButtons;\n update(domNode, element) {\n super.update(domNode, element);\n }\n\n preUpdate(domNode, element) {\n\n super.preUpdate(domNode, element);\n\n if (this._prevLegendPosition !== this.legendPosition()) {\n if (this._legend.target() !== null) this._legend.target(null);\n if (this._prevLegendPosition !== undefined) {\n this.swap(this._prevLegendPosition, this.legendPosition());\n } else {\n this[this.legendPosition()](this._legend);\n }\n if (this.legendPosition() === \"right\") {\n this.rightOverflowX(\"hidden\");\n this.rightOverflowY(\"auto\");\n this.bottomOverflowX(\"visible\");\n this.bottomOverflowY(\"visible\");\n } else {\n this.rightOverflowX(\"visible\");\n this.rightOverflowY(\"visible\");\n this.bottomOverflowX(\"auto\");\n this.bottomOverflowY(\"hidden\");\n }\n this._prevLegendPosition = this.legendPosition();\n }\n\n if (this._prevdataVisible !== this.dataVisible()) {\n this._prevdataVisible = this.dataVisible();\n this._toggleData.selected(this._prevdataVisible);\n this._legend.visible(this._prevlegendVisible && !this._prevdataVisible);\n this._carousel.active(this._prevdataVisible ? 1 : 0);\n }\n\n if (this._prevlegendVisible !== this.legendVisible()) {\n this._prevlegendVisible = this.legendVisible();\n this._toggleLegend.selected(this._prevlegendVisible);\n this._legend.visible(this._prevlegendVisible && !this._prevdataVisible);\n }\n\n this._legend.orientation(this.legendPosition() === \"bottom\" ? \"horizontal\" : \"vertical\");\n\n this.showLeft(!this.left());\n\n switch (this.getResponsiveMode()) {\n case \"tiny\":\n this.preUpdateTiny(element);\n break;\n case \"small\":\n this.preUpdateSmall(element);\n break;\n case \"regular\":\n this.preUpdateRegular(element);\n break;\n }\n\n const chart = this._widget.classID() === \"composite_MultiChart\" ? this._widget[\"chart\"]() : this._widget;\n this._legend.dataFamily(chart._dataFamily || \"any\");\n\n if (this._prevChartDataFamily !== this._legend.dataFamily()) {\n this._prevChartDataFamily = this._legend.dataFamily();\n switch (this._prevChartDataFamily) {\n case \"any\":\n this._toggleLegend.selected(false);\n this._legend.visible(false);\n break;\n }\n }\n element.style(\"box-shadow\", this.highlight() ? `inset 0px 0px 0px ${this.highlightSize()}px ${this.highlightColor()}` : \"none\");\n\n if (this._hideLegendToggleList.indexOf(chart.classID()) !== -1) {\n this._spacer.visible(false);\n this._toggleLegend.visible(false);\n } else {\n this._spacer.visible(true);\n this._toggleLegend.visible(true);\n }\n if (this._prevChart !== chart) {\n this._prevChart = chart;\n const widgetIconBar = chart ? chart[\"_titleBar\"] || chart[\"_iconBar\"] : undefined;\n if (widgetIconBar && widgetIconBar instanceof IconBar) {\n this._prevButtons = this._prevButtons || [...this.buttons()];\n const buttons: Widget[] = [\n ...widgetIconBar.buttons(),\n new Spacer(),\n ...this._prevButtons\n ];\n widgetIconBar.buttons([]).render();\n this.buttons(buttons);\n } else if (this._prevButtons) {\n this.buttons(this._prevButtons);\n }\n }\n\n const hiddenButtons = [];\n if (!this.dataButtonVisible()) hiddenButtons.push(this._toggleData);\n if (!this.downloadButtonVisible()) hiddenButtons.push(this._buttonDownload);\n if (!this.downloadImageButtonVisible()) hiddenButtons.push(this._buttonDownloadImage);\n if (!this.legendButtonVisible()) hiddenButtons.push(this._toggleLegend);\n this._buttonDownloadImage.enabled(this.widget() instanceof SVGWidget);\n this._titleBar\n .hiddenButtons(hiddenButtons)\n .visible(this.titleVisible())\n ;\n this.topOverlay(this.titleOverlay() || !this.titleVisible());\n }\n\n postUpdate(domNode, element) {\n super.postUpdate(domNode, element);\n\n switch (this.getResponsiveMode()) {\n case \"tiny\":\n this.postUpdateTiny(element);\n break;\n case \"small\":\n this.postUpdateSmall(element);\n break;\n case \"regular\":\n this.postUpdateRegular(element);\n break;\n }\n }\n\n postUpdateTiny(element) {\n element.selectAll(\"div.body,div.title-text,div.icon-bar\").style(\"display\", \"none\");\n element.selectAll(\"div.data-count\")\n .style(\"visibility\", \"visible\")\n .style(\"font-size\", (this.titleIconFontSize() / 3) + \"px\")\n .style(\"line-height\", (this.titleIconFontSize() / 3) + \"px\")\n .style(\"left\", this.titleIconFontSize() + \"px\")\n .text(this.data().length)\n ;\n element.style(\"transform\", \"translate(0px,0px) scale(1)\");\n const iconDiv = element.selectAll(\"div.title-icon\");\n const _node = iconDiv.node();\n const _container = element.node().parentElement;\n const containerRect = _container.getBoundingClientRect();\n if (_node) {\n const rect = iconDiv.node().getBoundingClientRect();\n const icon_top = containerRect.height / 2;\n iconDiv\n .style(\"position\", \"absolute\")\n .style(\"left\", `calc(50% - ${rect.width / 2}px)`)\n .style(\"top\", `${icon_top - (rect.height / 2)}px`)\n ;\n element.selectAll(\"div.data-count\")\n .style(\"position\", \"absolute\")\n .style(\"left\", `calc(50% + ${rect.width / 2}px)`)\n .style(\"top\", `${icon_top - (rect.height / 2)}px`)\n ;\n }\n }\n\n postUpdateSmall(element) {\n element.selectAll(\"lhs\").style(\"display\", \"none\"); // TODO: a bug in Border2?\n element.selectAll(\"div.title-icon\").style(\"position\", \"static\");\n element.selectAll(\"div.body,div.title-text,div.icon-bar\").style(\"display\", \"\");\n element.selectAll(\"div.data-count\").style(\"visibility\", \"hidden\");\n const rect = element.node().getBoundingClientRect();\n const parentRect = element.node().parentElement.getBoundingClientRect();\n element.style(\"transform\", `translate(${parentRect.x - rect.x}px, ${parentRect.y - rect.y}px) scale(${this._scale})`);\n }\n\n postUpdateRegular(element) {\n element.selectAll(\"div.title-icon\").style(\"position\", \"static\");\n element.selectAll(\"div.body,div.title-text,div.icon-bar\").style(\"display\", \"\");\n element.selectAll(\"div.data-count\").style(\"visibility\", \"hidden\");\n }\n\n exit(domNode, element) {\n this._progressBar.exit(domNode, element);\n\n this.right(null);\n this._legend.target(null);\n this.center(null);\n this._carousel.target(null);\n this.top(null);\n this._titleBar.target(null);\n\n this._modal.target(null);\n\n delete this._prevChart;\n delete this._prevButtons;\n delete this._prevChartDataFamily;\n delete this._prevPos;\n delete this._prevdataVisible;\n delete this._prevlegendVisible;\n\n super.exit(domNode, element);\n }\n\n // Event Handlers ---\n // Events ---\n click(row, column, selected) {\n // console.log(\"Click: \" + JSON.stringify(row) + \", \" + column + \", \" + selected);\n }\n\n dblclick(row, column, selected) {\n // console.log(\"Double click: \" + JSON.stringify(row) + \", \" + column + \", \" + selected);\n }\n\n vertex_click(row, col, sel, more) {\n if (more && more.vertex) {\n // console.log(\"Vertex click: \" + more.vertex.id());\n }\n }\n\n vertex_dblclick(row, col, sel, more) {\n if (more && more.vertex) {\n // console.log(\"Vertex double click: \" + more.vertex.id());\n }\n }\n\n edge_click(row, col, sel, more) {\n if (more && more.edge) {\n // console.log(\"Edge click: \" + more.edge.id());\n }\n }\n\n edge_dblclick(row, col, sel, more) {\n if (more && more.edge) {\n // console.log(\"Edge double click: \" + more.edge.id());\n }\n }\n}\nChartPanel.prototype._class += \" layout_ChartPanel\";\n\nexport interface ChartPanel<T extends Widget = Widget> {\n title(): string;\n title(_: string): this;\n titleVisible(): boolean;\n titleVisible(_: boolean): this;\n titleOverlay(): boolean;\n titleOverlay(_: boolean): this;\n title_exists(): boolean;\n titleFontSize(): number;\n titleFontSize(_: number): this;\n titleFontSize_exists(): boolean;\n titleIconFontSize(): number;\n titleIconFontSize(_: number): this;\n titleIconFontSize_exists(): boolean;\n dataVisible(): boolean;\n dataVisible(_: boolean): this;\n dataButtonVisible(): boolean;\n dataButtonVisible(_: boolean): this;\n downloadButtonVisible(): boolean;\n downloadButtonVisible(_: boolean): this;\n downloadImageButtonVisible(): boolean;\n downloadImageButtonVisible(_: boolean): this;\n downloadTitle(): string;\n downloadTitle(_: string): this;\n downloadTimestampSuffix(): boolean;\n downloadTimestampSuffix(_: boolean): this;\n legendVisible(): boolean;\n legendVisible(_: boolean): this;\n legendButtonVisible(): boolean;\n legendButtonVisible(_: boolean): this;\n legendPosition(): \"right\" | \"bottom\";\n legendPosition(_: \"right\" | \"bottom\"): this;\n description(): string;\n description(_: string): this;\n description_exists(): boolean;\n widget(): T;\n widget(_: T): this;\n widget_exists(): boolean;\n enableAutoscaling(): boolean;\n enableAutoscaling(_: boolean): this;\n enableAutoscaling_exists(): boolean;\n highlightSize(): number;\n highlightSize(_: number): this;\n highlightSize_exists(): boolean;\n highlightColor(): string;\n highlightColor(_: string): this;\n highlightColor_exists(): boolean;\n}\n\nChartPanel.prototype.publishReset();\nChartPanel.prototype.publishProxy(\"title\", \"_titleBar\");\nChartPanel.prototype.publish(\"titleVisible\", true, \"boolean\");\nChartPanel.prototype.publish(\"titleOverlay\", false, \"boolean\");\nChartPanel.prototype.publishProxy(\"titleIcon\", \"_titleBar\");\nChartPanel.prototype.publishProxy(\"titleIconFont\", \"_titleBar\");\nChartPanel.prototype.publishProxy(\"titleFont\", \"_titleBar\");\nChartPanel.prototype.publishProxy(\"titleIconFontSize\", \"_titleBar\");\nChartPanel.prototype.publishProxy(\"titleFontSize\", \"_titleBar\");\nChartPanel.prototype.publishProxy(\"description\", \"_titleBar\");\nChartPanel.prototype.publishProxy(\"descriptionFont\", \"_titleBar\");\nChartPanel.prototype.publishProxy(\"descriptionFontSize\", \"_titleBar\");\nChartPanel.prototype.publish(\"dataVisible\", false, \"boolean\", \"Show data table\");\nChartPanel.prototype.publish(\"dataButtonVisible\", true, \"boolean\", \"Show data table button\");\nChartPanel.prototype.publish(\"downloadButtonVisible\", true, \"boolean\", \"Show data download button\");\nChartPanel.prototype.publish(\"downloadImageButtonVisible\", false, \"boolean\", \"Show image download button\");\nChartPanel.prototype.publish(\"downloadTitle\", \"\", \"string\", \"File name when downloaded\");\nChartPanel.prototype.publish(\"downloadTimestampSuffix\", true, \"boolean\", \"Use timestamp as file name suffix\");\nChartPanel.prototype.publish(\"legendVisible\", false, \"boolean\", \"Show legend\");\nChartPanel.prototype.publish(\"legendButtonVisible\", true, \"boolean\", \"Show legend button\");\nChartPanel.prototype.publish(\"legendPosition\", \"right\", \"set\", \"Position of legend\", [\"right\", \"bottom\"]);\nChartPanel.prototype.publishProxy(\"legend_labelMaxWidth\", \"_legend\", \"labelMaxWidth\");\nChartPanel.prototype.publishProxy(\"legend_showSeriesTotal\", \"_legend\", \"showSeriesTotal\");\nChartPanel.prototype.publishProxy(\"legend_showLegendTotal\", \"_legend\", \"showLegendTotal\");\nChartPanel.prototype.publishProxy(\"legend_itemPadding\", \"_legend\", \"itemPadding\");\nChartPanel.prototype.publishProxy(\"legend_shapeRadius\", \"_legend\", \"shapeRadius\");\nChartPanel.prototype.publishProxy(\"legend_symbolType\", \"_legend\", \"symbolType\");\nChartPanel.prototype.publishProxy(\"legend_labelAlign\", \"_legend\", \"labelAlign\");\nChartPanel.prototype.publish(\"widget\", null, \"widget\", \"Widget\", undefined, { render: false });\nChartPanel.prototype.publish(\"enableAutoscaling\", false, \"boolean\");\nChartPanel.prototype.publish(\"highlightSize\", 4, \"number\");\nChartPanel.prototype.publish(\"highlightColor\", \"#e67e22\", \"html-color\");\nChartPanel.prototype.publishProxy(\"progress_halfLife\", \"_progressBar\", \"halfLife\");\nChartPanel.prototype.publishProxy(\"progress_decay\", \"_progressBar\", \"decay\");\nChartPanel.prototype.publishProxy(\"progress_size\", \"_progressBar\", \"size\");\nChartPanel.prototype.publishProxy(\"progress_color\", \"_progressBar\", \"color\");\nChartPanel.prototype.publishProxy(\"progress_blurBar\", \"_progressBar\", \"blurBar\");\nChartPanel.prototype.publishProxy(\"progress_blurSize\", \"_progressBar\", \"blurSize\");\nChartPanel.prototype.publishProxy(\"progress_blurColor\", \"_progressBar\", \"blurColor\");\nChartPanel.prototype.publishProxy(\"progress_blurOpacity\", \"_progressBar\", \"blurOpacity\");\n\nChartPanel.prototype.widget = function (_?) {\n if (!arguments.length) return this._widget;\n this._carousel.widgets([_, this._table]);\n this._widget = _;\n this._widget\n .fields(this._legend.filteredFields())\n .data(this._legend.filteredData())\n ;\n\n const context = this;\n const tmpAny = this._widget as any;\n tmpAny.click = function () {\n context.click.apply(context, arguments);\n };\n tmpAny.dblclick = function () {\n context.dblclick.apply(context, arguments);\n };\n tmpAny.vertex_click = function () {\n context.vertex_click.apply(context, arguments);\n };\n tmpAny.vertex_dblclick = function () {\n context.vertex_dblclick.apply(context, arguments);\n };\n tmpAny.edge_click = function () {\n context.edge_click.apply(context, arguments);\n };\n tmpAny.edge_dblclick = function () {\n context.edge_dblclick.apply(context, arguments);\n };\n return this;\n};\n","import { HTMLWidget } from \"@hpcc-js/common\";\nimport { select as d3Select } from \"d3-selection\";\n\nimport \"../src/FlexGrid.css\";\n\nexport class FlexGrid extends HTMLWidget {\n constructor() {\n super();\n }\n enter(domNode, element) {\n super.enter(domNode, element);\n d3Select(domNode.parentNode)\n .style(\"height\", \"100%\")\n .style(\"width\", \"100%\")\n ;\n }\n update(domNode, element) {\n super.update(domNode, element);\n const context = this;\n\n const cachedSizes = [];\n this.updateFlexParent(element);\n const listItems = element.selectAll(\".FlexGrid-list-item\").data(this.widgets(), w => w.id());\n listItems.enter()\n .append(\"div\")\n .classed(\"FlexGrid-list-item\", true)\n .each(function (w) {\n w.target(this);\n })\n .merge(listItems)\n .style(\"min-height\", this.itemMinHeight() + \"px\")\n .style(\"min-width\", this.itemMinWidth() + \"px\")\n .style(\"flex-basis\", (n, i) => {\n const flexBasis = this.widgetsFlexBasis()[i];\n return typeof flexBasis !== \"undefined\" ? flexBasis : this.flexBasis();\n })\n .style(\"flex-grow\", (n, i) => {\n const flexGrow = this.widgetsFlexGrow()[i];\n return typeof flexGrow !== \"undefined\" ? flexGrow : this.flexGrow();\n })\n .style(\"border-width\", this.borderWidth() + \"px\")\n .style(\"border-color\", this.itemBorderColor())\n .each(function () {\n this.firstChild.style.display = \"none\";\n })\n .each(function () {\n const rect = this.getBoundingClientRect();\n cachedSizes.push([\n rect.width,\n rect.height\n ]);\n })\n .each(function (w, i) {\n this.firstChild.style.display = \"block\";\n w.resize({\n width: cachedSizes[i][0] - (2 * context.borderWidth()),\n height: cachedSizes[i][1] - (2 * context.borderWidth())\n });\n })\n ;\n listItems.exit().remove();\n }\n exit(domNode, element) {\n super.exit(domNode, element);\n }\n updateFlexParent(element) {\n element\n .style(\"height\", \"100%\")\n .style(\"flex-direction\", this.orientation() === \"horizontal\" ? \"row\" : \"column\")\n .style(\"flex-wrap\", this.flexWrap())\n .style(\"align-items\", this.alignItems())\n .style(\"align-content\", this.alignContent())\n .style(\"overflow-x\", () => {\n if (this.forceXScroll() || (this.orientation() === \"horizontal\" && this.flexWrap() === \"nowrap\" && !this.disableScroll())) {\n return \"scroll\";\n }\n return \"hidden\";\n })\n .style(\"overflow-y\", () => {\n if (this.forceYScroll() || (this.orientation() === \"vertical\" && this.flexWrap() === \"nowrap\" && !this.disableScroll())) {\n return \"scroll\";\n }\n return \"hidden\";\n })\n ;\n }\n}\nFlexGrid.prototype._class += \" layout_FlexGrid\";\n\nexport interface FlexGrid {\n widgets(): any;\n widgets(_: any): this;\n orientation(): \"horizontal\" | \"vertical\";\n orientation(_: \"horizontal\" | \"vertical\"): this;\n flexWrap(): \"nowrap\" | \"wrap\" | \"wrap-reverse\";\n flexWrap(_: \"nowrap\" | \"wrap\" | \"wrap-reverse\"): this;\n itemMinHeight(): number;\n itemMinHeight(_: number): this;\n itemMinWidth(): number;\n itemMinWidth(_: number): this;\n alignItems(): \"flex-start\" | \"center\" | \"flex-end\" | \"stretch\";\n alignItems(_: \"flex-start\" | \"center\" | \"flex-end\" | \"stretch\"): this;\n alignContent(): \"flex-start\" | \"center\" | \"flex-end\" | \"stretch\" | \"space-between\" | \"space-around\";\n alignContent(_: \"flex-start\" | \"center\" | \"flex-end\" | \"stretch\" | \"space-between\" | \"space-around\"): this;\n itemBorderColor(): string;\n itemBorderColor(_: string): this;\n borderWidth(): number;\n borderWidth(_: number): this;\n flexGrow(): number;\n flexGrow(_: number): this;\n widgetsFlexGrow(): number[];\n widgetsFlexGrow(_: number[]): this;\n flexBasis(): string;\n flexBasis(_: string): this;\n widgetsFlexBasis(): string[];\n widgetsFlexBasis(_: string[]): this;\n disableScroll(): boolean;\n disableScroll(_: boolean): this;\n forceXScroll(): boolean;\n forceXScroll(_: boolean): this;\n forceYScroll(): boolean;\n forceYScroll(_: boolean): this;\n}\n\nFlexGrid.prototype.publish(\"itemBorderColor\", \"transparent\", \"html-color\", \"Color of list item borders\");\nFlexGrid.prototype.publish(\"borderWidth\", 0, \"number\", \"Width of list item borders (pixels)\");\nFlexGrid.prototype.publish(\"orientation\", \"horizontal\", \"set\", \"Controls the flex-direction of the list items\", [\"horizontal\", \"vertical\"]);\nFlexGrid.prototype.publish(\"flexWrap\", \"wrap\", \"set\", \"Controls the line wrap when overflow occurs\", [\"nowrap\", \"wrap\", \"wrap-reverse\"]);\nFlexGrid.prototype.publish(\"disableScroll\", false, \"boolean\", \"If false, scrollbar will show (when flexWrap is set to 'nowrap')\", null, { disable: (w: any) => w.flexWrap() !== \"nowrap\" });\nFlexGrid.prototype.publish(\"forceXScroll\", false, \"boolean\", \"If true, horzontal scrollbar will show\");\nFlexGrid.prototype.publish(\"forceYScroll\", false, \"boolean\", \"If true, vertical scrollbar will show\");\nFlexGrid.prototype.publish(\"itemMinHeight\", 64, \"number\", \"Minimum height of a list item (pixels)\");\nFlexGrid.prototype.publish(\"itemMinWidth\", 64, \"number\", \"Minimum width of a list item (pixels)\");\nFlexGrid.prototype.publish(\"alignItems\", \"stretch\", \"set\", \"Controls normal alignment of items\", [\"flex-start\", \"center\", \"flex-end\", \"stretch\"]);\nFlexGrid.prototype.publish(\"alignContent\", \"stretch\", \"set\", \"Controls normal alignment of item rows\", [\"flex-start\", \"center\", \"flex-end\", \"stretch\", \"space-between\", \"space-around\"]);\nFlexGrid.prototype.publish(\"flexGrow\", 1, \"number\", \"Default flex-grow style for all list items\");\nFlexGrid.prototype.publish(\"flexBasis\", \"10%\", \"string\", \"Default flex-basis style for all list items\");\nFlexGrid.prototype.publish(\"widgetsFlexGrow\", [], \"array\", \"Array of flex-grow values keyed on the widgets array\");\nFlexGrid.prototype.publish(\"widgetsFlexBasis\", [], \"array\", \"Array of flex-basis values keyed on the widgets array\");\nFlexGrid.prototype.publish(\"widgets\", [], \"widgetArray\", \"Array of widgets to be rendered as list items\");\n","(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define([], factory);\n } else if (typeof exports === 'object') {\n // Node. Does not work with strict CommonJS, but\n // only CommonJS-like environments that support module.exports,\n // like Node.\n module.exports = factory();\n } else {\n // Browser globals (root is window)\n root.GridList = factory();\n }\n}(this, function() {\n\nvar GridList = function(items, options) {\n /**\n * A GridList manages the two-dimensional positions from a list of items,\n * within a virtual matrix.\n *\n * The GridList's main function is to convert the item positions from one\n * grid size to another, maintaining as much of their order as possible.\n *\n * The GridList's second function is to handle collisions when moving an item\n * over another.\n *\n * The positioning algorithm places items in columns. Starting from left to\n * right, going through each column top to bottom.\n *\n * The size of an item is expressed using the number of cols and rows it\n * takes up within the grid (w and h)\n *\n * The position of an item is express using the col and row position within\n * the grid (x and y)\n *\n * An item is an object of structure:\n * {\n * w: 3, h: 1,\n * x: 0, y: 1\n * }\n */\n\n this._options = options;\n for (var k in this.defaults) {\n if (!this._options.hasOwnProperty(k)) {\n this._options[k] = this.defaults[k];\n }\n }\n\n this.items = items;\n\n this._adjustSizeOfItems();\n\n this.generateGrid();\n};\n\nGridList.cloneItems = function(items, _items) {\n /**\n * Clone items with a deep level of one. Items are not referenced but their\n * properties are\n */\n var _item,\n i,\n k;\n if (_items === undefined) {\n _items = [];\n }\n for (i = 0; i < items.length; i++) {\n // XXX: this is good because we don't want to lose item reference, but\n // maybe we should clear their properties since some might be optional\n if (!_items[i]) {\n _items[i] = {};\n }\n for (k in items[i]) {\n _items[i][k] = items[i][k];\n }\n }\n return _items;\n};\n\nGridList.prototype = {\n\n defaults: {\n lanes: 5,\n direction: 'horizontal'\n },\n\n /**\n * Illustates grid as text-based table, using a number identifier for each\n * item. E.g.\n *\n * #| 0 1 2 3 4 5 6 7 8 9 10 11 12 13\n * --------------------------------------------\n * 0| 00 02 03 04 04 06 08 08 08 12 12 13 14 16\n * 1| 01 -- 03 05 05 07 09 10 11 11 -- 13 15 --\n *\n * Warn: Does not work if items don't have a width or height specified\n * besides their position in the grid.\n */\n toString: function() {\n var widthOfGrid = this.grid.length,\n output = '\\n #|',\n border = '\\n --',\n item,\n i,\n j;\n\n // Render the table header\n for (i = 0; i < widthOfGrid; i++) {\n output += ' ' + this._padNumber(i, ' ');\n border += '---';\n };\n output += border;\n\n // Render table contents row by row, as we go on the y axis\n for (i = 0; i < this._options.lanes; i++) {\n output += '\\n' + this._padNumber(i, ' ') + '|';\n for (j = 0; j < widthOfGrid; j++) {\n output += ' ';\n item = this.grid[j][i];\n output += item ? this._padNumber(this.items.indexOf(item), '0') : '--';\n }\n };\n output += '\\n';\n return output;\n },\n\n generateGrid: function() {\n /**\n * Build the grid structure from scratch, with the current item positions\n */\n var i;\n this._resetGrid();\n for (i = 0; i < this.items.length; i++) {\n this._markItemPositionToGrid(this.items[i]);\n }\n },\n\n resizeGrid: function(lanes) {\n var currentColumn = 0;\n\n this._options.lanes = lanes;\n this._adjustSizeOfItems();\n\n this._sortItemsByPosition();\n this._resetGrid();\n\n // The items will be sorted based on their index within the this.items array,\n // that is their \"1d position\"\n for (var i = 0; i < this.items.length; i++) {\n var item = this.items[i],\n position = this._getItemPosition(item);\n\n this._updateItemPosition(\n item, this.findPositionForItem(item, {x: currentColumn, y: 0}));\n\n // New items should never be placed to the left of previous items\n currentColumn = Math.max(currentColumn, position.x);\n }\n\n this._pullItemsToLeft();\n },\n\n findPositionForItem: function(item, start, fixedRow) {\n /**\n * This method has two options for the position we want for the item:\n * - Starting from a certain row/column number and only looking for\n * positions to its right\n * - Accepting positions for a certain row number only (use-case: items\n * being shifted to the left/right as a result of collisions)\n *\n * @param {Object<x:Number, y:Number, w:Number, h:Number} item\n * @param {Object<x:Number, y:Number} start Position from which to start\n * the search.\n * @param {Number} [fixedRow] If provided, we're going to try to find a\n * position for the new item on it. If doesn't fit there, we're going\n * to put it on the first row.\n *\n * @returns {Number[2]} x and y.\n */\n\n var x, y, position;\n\n // Start searching for a position from the horizontal position of the\n // rightmost item from the grid\n for (x = start.x; x < this.grid.length; x++) {\n if (fixedRow !== undefined) {\n position = [x, fixedRow];\n\n if (this._itemFitsAtPosition(item, position)) {\n return position;\n }\n } else {\n for (y = start.y; y < this._options.lanes; y++) {\n position = [x, y];\n\n if (this._itemFitsAtPosition(item, position)) {\n return position;\n }\n }\n }\n }\n\n // If we've reached this point, we need to start a new column\n var newCol = this.grid.length,\n newRow = 0;\n\n if (fixedRow !== undefined &&\n this._itemFitsAtPosition(item, [newCol, fixedRow])) {\n newRow = fixedRow;\n }\n\n return [newCol, newRow];\n },\n\n moveItemToPosition: function(item, newPosition) {\n var position = this._getItemPosition({\n x: newPosition[0],\n y: newPosition[1],\n w: item.w,\n h: item.h\n });\n\n this._updateItemPosition(item, [position.x, position.y]);\n this._resolveCollisions(item);\n },\n\n resizeItem: function(item, size) {\n /**\n * Resize an item and resolve collisions.\n *\n * @param {Object} item A reference to an item that's part of the grid.\n * @param {Object} size\n * @param {Number} [size.w=item.w] The new width.\n * @param {Number} [size.h=item.h] The new height.\n */\n\n var width = size.w || item.w,\n height = size.h || item.h;\n\n this._updateItemSize(item, width, height);\n\n this._resolveCollisions(item);\n\n this._pullItemsToLeft();\n },\n\n getChangedItems: function(initialItems, idAttribute) {\n /**\n * Compare the current items against a previous snapshot and return only\n * the ones that changed their attributes in the meantime. This includes both\n * position (x, y) and size (w, h)\n *\n * Since both their position and size can change, the items need an\n * additional identifier attribute to match them with their previous state\n */\n var changedItems = [];\n\n for (var i = 0; i < initialItems.length; i++) {\n var item = this._getItemByAttribute(idAttribute,\n initialItems[i][idAttribute]);\n\n if (item.x !== initialItems[i].x ||\n item.y !== initialItems[i].y ||\n item.w !== initialItems[i].w ||\n item.h !== initialItems[i].h) {\n changedItems.push(item);\n }\n }\n\n return changedItems;\n },\n\n _sortItemsByPosition: function() {\n this.items.sort(function(item1, item2) {\n var position1 = this._getItemPosition(item1),\n position2 = this._getItemPosition(item2);\n\n // Try to preserve columns.\n if (position1.x != position2.x) {\n return position1.x - position2.x;\n }\n\n if (position1.y != position2.y) {\n return position1.y - position2.y;\n }\n\n // The items are placed on the same position.\n return 0;\n }.bind(this));\n },\n\n _adjustSizeOfItems: function() {\n /**\n * Some items can have 100% height or 100% width. Those dimmensions are\n * expressed as 0. We need to ensure a valid width and height for each of\n * those items as the number of items per lane.\n */\n\n for (var i = 0; i < this.items.length; i++) {\n var item = this.items[i];\n\n // This can happen only the first time items are checked.\n // We need the property to have a value for all the items so that the\n // `cloneItems` method will merge the properties properly. If we only set\n // it to the items that need it then the following can happen:\n //\n // cloneItems([{id: 1, autoSize: true}, {id: 2}],\n // [{id: 2}, {id: 1, autoSize: true}]);\n //\n // will result in\n //\n // [{id: 1, autoSize: true}, {id: 2, autoSize: true}]\n if (item.autoSize === undefined) {\n item.autoSize = item.w === 0 || item.h === 0;\n }\n\n if (item.autoSize) {\n if (this._options.direction === 'horizontal') {\n item.h = this._options.lanes;\n } else {\n item.w = this._options.lanes;\n }\n }\n }\n },\n\n _resetGrid: function() {\n this.grid = [];\n },\n\n _itemFitsAtPosition: function(item, newPosition) {\n /**\n * Check that an item wouldn't overlap with another one if placed at a\n * certain position within the grid\n */\n\n var position = this._getItemPosition(item),\n x, y, row;\n\n // No coordonate can be negative\n if (newPosition[0] < 0 || newPosition[1] < 0) {\n return false;\n }\n\n // Make sure the item isn't larger than the entire grid\n if (newPosition[1] + position.h > this._options.lanes) {\n return false;\n }\n\n // Make sure the position doesn't overlap with an already positioned\n // item.\n for (x = newPosition[0]; x < newPosition[0] + position.w; x++) {\n var col = this.grid[x];\n\n // Surely a column that hasn't even been created yet is available\n if (!col) {\n continue;\n }\n\n for (y = newPosition[1]; y < newPosition[1] + position.h; y++) {\n // Any space occupied by an item can continue to be occupied by the\n // same item.\n if (col[y] && col[y] !== item) {\n return false;\n }\n }\n }\n\n return true;\n },\n\n _updateItemPosition: function(item, position) {\n if (item.x !== null && item.y !== null) {\n this._deleteItemPositionFromGrid(item);\n }\n\n this._setItemPosition(item, position);\n\n this._markItemPositionToGrid(item);\n },\n\n _updateItemSize: function(item, width, height) {\n /**\n * @param {Object} item A reference to a grid item.\n * @param {Number} width The new width.\n * @param {Number} height The new height.\n */\n\n if (item.x !== null && item.y !== null) {\n this._deleteItemPositionFromGrid(item);\n }\n\n item.w = width;\n item.h = height;\n\n this._markItemPositionToGrid(item);\n },\n\n _markItemPositionToGrid: function(item) {\n /**\n * Mark the grid cells that are occupied by an item. This prevents items\n * from overlapping in the grid\n */\n\n var position = this._getItemPosition(item),\n x, y;\n\n // Ensure that the grid has enough columns to accomodate the current item.\n this._ensureColumns(position.x + position.w);\n\n for (x = position.x; x < position.x + position.w; x++) {\n for (y = position.y; y < position.y + position.h; y++) {\n this.grid[x][y] = item;\n }\n }\n },\n\n _deleteItemPositionFromGrid: function(item) {\n var position = this._getItemPosition(item),\n x, y;\n\n for (x = position.x; x < position.x + position.w; x++) {\n // It can happen to try to remove an item from a position not generated\n // in the grid, probably when loading a persisted grid of items. No need\n // to create a column to be able to remove something from it, though\n if (!this.grid[x]) {\n continue;\n }\n\n for (y = position.y; y < position.y + position.h; y++) {\n // Don't clear the cell if it's been occupied by a different widget in\n // the meantime (e.g. when an item has been moved over this one, and\n // thus by continuing to clear this item's previous position you would\n // cancel the first item's move, leaving it without any position even)\n if (this.grid[x][y] == item) {\n this.grid[x][y] = null;\n }\n }\n }\n },\n\n _ensureColumns: function(N) {\n /**\n * Ensure that the grid has at least N columns available.\n */\n var i;\n for (i = 0; i < N; i++) {\n if (!this.grid[i]) {\n this.grid.push(new GridCol(this._options.lanes));\n }\n }\n },\n\n _getItemsCollidingWithItem: function(item) {\n var collidingItems = [];\n for (var i = 0; i < this.items.length; i++) {\n if (item != this.items[i] &&\n this._itemsAreColliding(item, this.items[i])) {\n collidingItems.push(i);\n }\n }\n return collidingItems;\n },\n\n _itemsAreColliding: function(item1, item2) {\n var position1 = this._getItemPosition(item1),\n position2 = this._getItemPosition(item2);\n\n return !(position2.x >= position1.x + position1.w ||\n position2.x + position2.w <= position1.x ||\n position2.y >= position1.y + position1.h ||\n position2.y + position2.h <= position1.y);\n },\n\n _resolveCollisions: function(item) {\n if (!this._tryToResolveCollisionsLocally(item)) {\n this._pullItemsToLeft(item);\n }\n this._pullItemsToLeft();\n },\n\n _tryToResolveCollisionsLocally: function(item) {\n /**\n * Attempt to resolve the collisions after moving a an item over one or more\n * other items within the grid, by shifting the position of the colliding\n * items around the moving one. This might result in subsequent collisions,\n * in which case we will revert all position permutations. To be able to\n * revert to the initial item positions, we create a virtual grid in the\n * process\n */\n var collidingItems = this._getItemsCollidingWithItem(item);\n if (!collidingItems.length) {\n return true;\n }\n var _gridList = new GridList([], this._options),\n leftOfItem,\n rightOfItem,\n aboveOfItem,\n belowOfItem;\n\n GridList.cloneItems(this.items, _gridList.items);\n _gridList.generateGrid();\n\n for (var i = 0; i < collidingItems.length; i++) {\n var collidingItem = _gridList.items[collidingItems[i]],\n collidingPosition = this._getItemPosition(collidingItem);\n\n // We use a simple algorithm for moving items around when collisions occur:\n // In this prioritized order, we try to move a colliding item around the\n // moving one:\n // 1. to its left side\n // 2. above it\n // 3. under it\n // 4. to its right side\n var position = this._getItemPosition(item);\n\n leftOfItem = [position.x - collidingPosition.w, collidingPosition.y];\n rightOfItem = [position.x + position.w, collidingPosition.y];\n aboveOfItem = [collidingPosition.x, position.y - collidingPosition.h];\n belowOfItem = [collidingPosition.x, position.y + position.h];\n\n if (_gridList._itemFitsAtPosition(collidingItem, leftOfItem)) {\n _gridList._updateItemPosition(collidingItem, leftOfItem);\n } else if (_gridList._itemFitsAtPosition(collidingItem, aboveOfItem)) {\n _gridList._updateItemPosition(collidingItem, aboveOfItem);\n } else if (_gridList._itemFitsAtPosition(collidingItem, belowOfItem)) {\n _gridList._updateItemPosition(collidingItem, belowOfItem);\n } else if (_gridList._itemFitsAtPosition(collidingItem, rightOfItem)) {\n _gridList._updateItemPosition(collidingItem, rightOfItem);\n } else {\n // Collisions failed, we must use the pullItemsToLeft method to arrange\n // the other items around this item with fixed position. This is our\n // plan B for when local collision resolving fails.\n return false;\n }\n }\n // If we reached this point it means we managed to resolve the collisions\n // from one single iteration, just by moving the colliding items around. So\n // we accept this scenario and marge the brached-out grid instance into the\n // original one\n GridList.cloneItems(_gridList.items, this.items);\n this.generateGrid();\n return true;\n },\n\n _pullItemsToLeft: function(fixedItem) {\n /**\n * Build the grid from scratch, by using the current item positions and\n * pulling them as much to the left as possible, removing as space between\n * them as possible.\n *\n * If a \"fixed item\" is provided, its position will be kept intact and the\n * rest of the items will be layed around it.\n */\n\n\n // Start a fresh grid with the fixed item already placed inside\n this._sortItemsByPosition();\n this._resetGrid();\n\n // Start the grid with the fixed item as the first positioned item\n if (fixedItem) {\n var fixedPosition = this._getItemPosition(fixedItem);\n this._updateItemPosition(fixedItem, [fixedPosition.x, fixedPosition.y]);\n }\n\n for (var i = 0; i < this.items.length; i++) {\n var item = this.items[i],\n position = this._getItemPosition(item);\n\n // The fixed item keeps its exact position\n if (fixedItem && item == fixedItem) {\n continue;\n }\n\n var x = this._findLeftMostPositionForItem(item),\n newPosition = this.findPositionForItem(\n item, {x: x, y: 0}, position.y);\n\n this._updateItemPosition(item, newPosition);\n }\n },\n\n _findLeftMostPositionForItem: function(item) {\n /**\n * When pulling items to the left, we need to find the leftmost position for\n * an item, with two considerations in mind:\n * - preserving its current row\n * - preserving the previous horizontal order between items\n */\n\n var tail = 0,\n position = this._getItemPosition(item);\n\n for (var i = 0; i < this.grid.length; i++) {\n for (var j = position.y; j < position.y + position.h; j++) {\n var otherItem = this.grid[i][j];\n\n if (!otherItem) {\n continue;\n }\n\n var otherPosition = this._getItemPosition(otherItem);\n\n if (this.items.indexOf(otherItem) < this.items.indexOf(item)) {\n tail = otherPosition.x + otherPosition.w;\n }\n }\n }\n\n return tail;\n },\n\n _getItemByAttribute: function(key, value) {\n for (var i = 0; i < this.items.length; i++) {\n if (this.items[i][key] === value) {\n return this.items[i];\n }\n }\n return null;\n },\n\n _padNumber: function(nr, prefix) {\n // Currently works for 2-digit numbers (<100)\n return nr >= 10 ? nr : prefix + nr;\n },\n\n _getItemPosition: function(item) {\n /**\n * If the direction is vertical we need to rotate the grid 90 deg to the\n * left. Thus, we simulate the fact that items are being pulled to the top.\n *\n * Since the items have widths and heights, if we apply the classic\n * counter-clockwise 90 deg rotation\n *\n * [0 -1]\n * [1 0]\n *\n * then the top left point of an item will become the bottom left point of\n * the rotated item. To adjust for this, we need to subtract from the y\n * position the height of the original item - the width of the rotated item.\n *\n * However, if we do this then we'll reverse some actions: resizing the\n * width of an item will stretch the item to the left instead of to the\n * right; resizing an item that doesn't fit into the grid will push the\n * items around it instead of going on a new row, etc.\n *\n * We found it better to do a vertical flip of the grid after rotating it.\n * This restores the direction of the actions and greatly simplifies the\n * transformations.\n */\n\n if (this._options.direction === 'horizontal') {\n return item;\n } else {\n return {\n x: item.y,\n y: item.x,\n w: item.h,\n h: item.w\n };\n }\n },\n\n _setItemPosition: function(item, position) {\n /**\n * See _getItemPosition.\n */\n\n if (this._options.direction === 'horizontal') {\n item.x = position[0];\n item.y = position[1];\n } else {\n // We're supposed to subtract the rotated item's height which is actually\n // the non-rotated item's width.\n item.x = position[1];\n item.y = position[0];\n }\n }\n};\n\nvar GridCol = function(lanes) {\n for (var i = 0; i < lanes; i++) {\n this.push(null);\n }\n};\n\n// Extend the Array prototype\nGridCol.prototype = [];\n\n// This module will have direct access to the GridList class\nreturn GridList;\n\n}));\n","import { d3Event, drag as d3Drag, HTMLWidget, Platform, select as d3Select, Utility } from \"@hpcc-js/common\";\nimport * as _GridList from \"grid-list\";\nimport { Cell } from \"./Cell.ts\";\n\nimport \"../src/Grid.css\";\n\nconst GridList = (_GridList && _GridList.default) || _GridList;\n\nexport type ICellPosition = [number, number, number, number];\n\nexport class Grid extends HTMLWidget {\n divItems;\n\n gridList;\n items;\n itemsMap;\n origItems;\n cellWidth;\n cellHeight;\n dragItem;\n dragItemPos;\n\n _d3Drag;\n _d3DragResize;\n _selectionBag;\n _scrollBarWidth;\n\n constructor() {\n super();\n\n this._tag = \"div\";\n this._selectionBag = new Utility.Selection(this);\n\n this.content([]);\n }\n\n getDimensions() {\n const size = { width: 0, height: 0 };\n this.content().forEach(function (cell) {\n if (size.width < cell.gridCol() + cell.gridColSpan()) {\n size.width = cell.gridCol() + cell.gridColSpan();\n }\n if (size.height < cell.gridRow() + cell.gridRowSpan()) {\n size.height = cell.gridRow() + cell.gridRowSpan();\n }\n }, this);\n return size;\n }\n\n clearContent(widget) {\n this.content(this.content().filter(function (contentWidget) {\n if (!widget) {\n contentWidget.target(null);\n return false;\n }\n let w: any = contentWidget;\n while (w) {\n if (widget === w) {\n contentWidget.target(null);\n return false;\n }\n w = w.widget ? w.widget() : null;\n }\n return true;\n }));\n }\n\n setContent(row, col, widget, title?, rowSpan?, colSpan?) {\n rowSpan = rowSpan || 1;\n colSpan = colSpan || 1;\n title = title || \"\";\n this.content(this.content().filter(function (contentWidget) {\n if (contentWidget.gridRow() === row && contentWidget.gridCol() === col) {\n contentWidget.target(null);\n return false;\n }\n return true;\n }));\n if (widget) {\n const cell = new Cell()\n .gridRow(row)\n .gridCol(col)\n .widget(widget)\n .title(title)\n .gridRowSpan(rowSpan)\n .gridColSpan(colSpan)\n ;\n this.content().push(cell);\n }\n return this;\n }\n\n sortedContent() {\n return this.content().sort(function (l, r) {\n if (l.gridRow() === r.gridRow()) {\n return l.gridCol() - r.gridCol();\n }\n return l.gridRow() - r.gridRow();\n });\n }\n\n getCell(row, col) {\n let retVal = null;\n this.content().some(function (cell) {\n if (row >= cell.gridRow() && row < cell.gridRow() + cell.gridRowSpan() &&\n col >= cell.gridCol() && col < cell.gridCol() + cell.gridColSpan()) {\n retVal = cell;\n return true;\n }\n return false;\n });\n return retVal;\n }\n\n getWidgetCell(id) {\n let retVal = null;\n this.content().some(function (cell) {\n if (cell.widget().id() === id) {\n retVal = cell;\n return true;\n }\n return false;\n });\n return retVal;\n }\n\n getContent(id) {\n let retVal = null;\n this.content().some(function (cell) {\n if (cell.widget().id() === id) {\n retVal = cell.widget();\n return true;\n }\n return false;\n });\n return retVal;\n }\n\n cellToGridItem(cell) {\n return {\n x: cell.gridCol(),\n y: cell.gridRow(),\n w: cell.gridColSpan(),\n h: cell.gridRowSpan(),\n id: cell.id(),\n cell\n };\n }\n\n gridItemToCell(item) {\n item.cell\n .gridCol(item.x)\n .gridRow(item.y)\n .gridColSpan(item.w)\n .gridRowSpan(item.h)\n ;\n }\n\n resetItemsPos() {\n this.origItems.forEach(function (origItem) {\n const item = this.itemsMap[origItem.id];\n item.x = origItem.x;\n item.y = origItem.y;\n }, this);\n }\n\n initGridList() {\n this.itemsMap = {};\n this.items = this.content().map(function (cell) {\n const retVal = this.cellToGridItem(cell);\n this.itemsMap[retVal.id] = retVal;\n return retVal;\n }, this);\n this.origItems = this.content().map(this.cellToGridItem);\n this.gridList = new GridList(this.items, {\n direction: this.snapping(),\n lanes: this.snapping() === \"horizontal\" ? this.snappingRows() : this.snappingColumns()\n });\n }\n\n killGridList() {\n this.gridList = null;\n delete this.items;\n delete this.itemsMap;\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n\n this._scrollBarWidth = Platform.getScrollbarWidth();\n\n const context = this;\n this._d3Drag = d3Drag()\n .subject(function (_d) {\n const d = context.cellToGridItem(_d);\n return { x: d.x * context.cellWidth, y: d.y * context.cellHeight };\n })\n .on(\"start\", function (_d: any) {\n if (!context.designMode()) return;\n d3Event().sourceEvent.stopPropagation();\n context.initGridList();\n const d = context.itemsMap[_d.id()];\n context.dragItem = element.append(\"div\")\n .attr(\"class\", \"dragging\")\n .style(\"transform\", function () { return \"translate(\" + d.x * context.cellWidth + \"px, \" + d.y * context.cellHeight + \"px)\"; })\n .style(\"width\", function () { return d.w * context.cellWidth - context.gutter() + \"px\"; })\n .style(\"height\", function () { return d.h * context.cellHeight - context.gutter() + \"px\"; })\n ;\n context.selectionBagClick(_d);\n })\n .on(\"drag\", function (_d: any) {\n if (!context.designMode()) return;\n const event = d3Event();\n event.sourceEvent.stopPropagation();\n const d = context.itemsMap[_d.id()];\n if (event.x < 0) {\n event.x = 0;\n }\n if (event.x + d.w * context.cellWidth > context.snappingColumns() * context.cellWidth) {\n event.x = context.snappingColumns() * context.cellWidth - d.w * context.cellWidth;\n }\n if (event.y < 0) {\n event.y = 0;\n }\n if (event.y + d.h * context.cellWidth > context.snappingRows() * context.cellWidth) {\n event.y = context.snappingRows() * context.cellWidth - d.h * context.cellWidth;\n }\n const pos = [Math.max(0, Math.floor((event.x + context.cellWidth / 2) / context.cellWidth)), Math.max(0, Math.floor((event.y + context.cellHeight / 2) / context.cellHeight))];\n if (d.x !== pos[0] || d.y !== pos[1]) {\n if (context.snapping() !== \"none\") {\n context.resetItemsPos();\n context.gridList.moveItemToPosition(d, pos);\n } else {\n d.x = pos[0];\n d.y = pos[1];\n }\n if (_d.gridCol() !== d.x || _d.gridRow() !== d.y) {\n context.items.forEach(context.gridItemToCell);\n context.updateGrid(false, 100);\n }\n }\n context.dragItem\n .style(\"transform\", function () { return \"translate(\" + event.x + \"px, \" + event.y + \"px)\"; })\n .style(\"width\", function () { return d.w * context.cellWidth + \"px\"; })\n .style(\"height\", function () { return d.h * context.cellHeight + \"px\"; })\n ;\n })\n .on(\"end\", function () {\n if (!context.designMode()) return;\n d3Event().sourceEvent.stopPropagation();\n context.dragItem.remove();\n context.dragItem = null;\n context.killGridList();\n })\n ;\n\n this._d3DragResize = d3Drag()\n .subject(function (_d) {\n const d = context.cellToGridItem(_d);\n return { x: (d.x + d.w - 1) * context.cellWidth, y: (d.y + d.h - 1) * context.cellHeight };\n })\n .on(\"start\", function (_d: any) {\n if (!context.designMode()) return;\n d3Event().sourceEvent.stopPropagation();\n context.initGridList();\n const d = context.itemsMap[_d.id()];\n context.dragItem = element.append(\"div\")\n .attr(\"class\", \"resizing\")\n .style(\"transform\", function () { return \"translate(\" + d.x * context.cellWidth + \"px, \" + d.y * context.cellHeight + \"px)\"; })\n .style(\"width\", function () { return d.w * context.cellWidth - context.gutter() + \"px\"; })\n .style(\"height\", function () { return d.h * context.cellHeight - context.gutter() + \"px\"; })\n ;\n context.dragItemPos = { x: d.x, y: d.y };\n })\n .on(\"drag\", function (_d: any) {\n if (!context.designMode()) return;\n const event = d3Event();\n event.sourceEvent.stopPropagation();\n const d = context.itemsMap[_d.id()];\n const pos = [Math.max(0, Math.round(event.x / context.cellWidth)), Math.max(0, Math.round(event.y / context.cellHeight))];\n const size = {\n w: Math.max(1, pos[0] - d.x + 1),\n h: Math.max(1, pos[1] - d.y + 1)\n };\n if (d.w !== size.w || d.h !== size.h) {\n if (context.snapping() !== \"none\") {\n context.resetItemsPos();\n context.gridList.resizeItem(d, size);\n } else {\n d.w = size.w;\n d.h = size.h;\n }\n if (_d.gridColSpan() !== d.w || _d.gridRowSpan() !== d.h) {\n context.items.forEach(context.gridItemToCell);\n context.updateGrid(d.id, 100);\n }\n }\n context.dragItem\n .style(\"width\", function () { return (-d.x + 1) * context.cellWidth + event.x - context.gutter() + \"px\"; })\n .style(\"height\", function () { return (-d.y + 1) * context.cellHeight + event.y - context.gutter() + \"px\"; })\n ;\n })\n .on(\"end\", function () {\n if (!context.designMode()) return;\n d3Event().sourceEvent.stopPropagation();\n context.dragItem.remove();\n context.dragItem = null;\n context.killGridList();\n })\n ;\n }\n\n updateGrid(resize, transitionDuration: number = 0, _noRender: boolean = false) {\n transitionDuration = transitionDuration || 0;\n const context = this;\n this.divItems\n .classed(\"draggable\", this.designMode())\n .transition().duration(transitionDuration)\n .style(\"left\", function (d) { return d.gridCol() * context.cellWidth + context.gutter() / 2 + \"px\"; })\n .style(\"top\", function (d) { return d.gridRow() * context.cellHeight + context.gutter() / 2 + \"px\"; })\n .style(\"width\", function (d) { return d.gridColSpan() * context.cellWidth - context.gutter() + \"px\"; })\n .style(\"height\", function (d) { return d.gridRowSpan() * context.cellHeight - context.gutter() + \"px\"; })\n .on(\"end\", function (d) {\n d\n .surfaceShadow_default(context.surfaceShadow())\n .surfacePadding_default(context.surfacePadding())\n .surfaceBorderWidth_default(context.surfaceBorderWidth())\n .surfaceBackgroundColor_default(context.surfaceBackgroundColor())\n ;\n\n if (resize === true || resize === d.id()) {\n d\n .resize()\n .lazyRender()\n ;\n }\n })\n ;\n }\n\n update(domNode, element2) {\n super.update(domNode, element2);\n\n this._placeholderElement.style(\"overflow-x\", this.fitTo() === \"width\" ? \"hidden\" : null);\n this._placeholderElement.style(\"overflow-y\", this.fitTo() === \"width\" ? \"scroll\" : null);\n const dimensions = this.getDimensions();\n const clientWidth = this.width() - (this.fitTo() === \"width\" ? this._scrollBarWidth : 0);\n this.cellWidth = clientWidth / dimensions.width;\n this.cellHeight = this.fitTo() === \"all\" ? this.height() / dimensions.height : this.cellWidth;\n if (this.designMode()) {\n const cellLaneRatio = Math.min(this.width() / this.snappingColumns(), this.height() / this.snappingRows());\n const laneWidth = Math.floor(cellLaneRatio);\n this.cellWidth = laneWidth;\n this.cellHeight = this.cellWidth;\n }\n\n // Grid ---\n const context = this;\n const divItems = element2.selectAll(\"#\" + this.id() + \" > .ddCell\").data(this.content(), function (d) { return d.id(); });\n this.divItems = divItems.enter().append(\"div\")\n .attr(\"class\", \"ddCell\")\n .each(function (d) {\n d.target(this);\n d.__grid_watch = d.monitor(function (key, newVal, oldVal) {\n if (context._renderCount && (key === \"snapping\" || key.indexOf(\"grid\") === 0) && newVal !== oldVal) {\n if (!context.gridList) {\n // API Call (only needed when not dragging) ---\n context.initGridList();\n if (context.snapping() !== \"none\") {\n context.gridList.resizeGrid(context.snapping() === \"horizontal\" ? context.snappingRows() : context.snappingColumns());\n }\n context.items.forEach(context.gridItemToCell);\n context.updateGrid(d.id(), 100);\n context.killGridList();\n }\n }\n });\n const element = d3Select(this);\n element.append(\"div\")\n .attr(\"class\", \"resizeHandle\")\n .call(context._d3DragResize)\n .append(\"div\")\n .attr(\"class\", \"resizeHandleDisplay\")\n ;\n }).merge(divItems)\n ;\n this.divItems.each(function (d) {\n const element = d3Select(this);\n if (context.designMode()) {\n element.call(context._d3Drag);\n } else {\n element\n .on(\"mousedown.drag\", null)\n .on(\"touchstart.drag\", null)\n ;\n }\n });\n this.divItems.select(\".resizeHandle\")\n .style(\"display\", this.designMode() ? null : \"none\")\n ;\n\n this.updateGrid(true);\n divItems.exit()\n .each(function (d) {\n d.target(null);\n if (d.__grid_watch) {\n d.__grid_watch.remove();\n }\n })\n .remove()\n ;\n\n // Snapping ---\n const lanesBackground = element2.selectAll(\"#\" + this.id() + \" > .laneBackground\").data(this.designMode() ? [\"\"] : []);\n lanesBackground.enter().insert(\"div\", \":first-child\")\n .attr(\"class\", \"laneBackground\")\n .style(\"left\", \"1px\")\n .style(\"top\", \"1px\")\n .on(\"click\", function () {\n context.selectionBagClear();\n })\n .merge(lanesBackground)\n .style(\"width\", (this.snappingColumns() * this.cellWidth) + \"px\")\n .style(\"height\", (this.snappingRows() * this.cellHeight) + \"px\")\n ;\n lanesBackground.exit()\n .each(function () {\n context.selectionBagClear();\n })\n .remove()\n ;\n\n const lanes = element2.selectAll(\"#\" + this.id() + \" > .lane\").data(this.designMode() ? [\"\"] : []);\n lanes.enter().append(\"div\")\n .attr(\"class\", \"lane\")\n .style(\"left\", \"1px\")\n .style(\"top\", \"1px\")\n ;\n lanes\n .style(\"display\", this.showLanes() ? null : \"none\")\n .style(\"width\", (this.snappingColumns() * this.cellWidth) + \"px\")\n .style(\"height\", (this.snappingRows() * this.cellHeight) + \"px\")\n .style(\"background-image\", \"linear-gradient(to right, grey 1px, transparent 1px), linear-gradient(to bottom, grey 1px, transparent 1px)\")\n .style(\"background-size\", this.cellWidth + \"px \" + this.cellHeight + \"px\")\n ;\n lanes.exit()\n .remove()\n ;\n }\n\n exit(domNode, element) {\n this.content().forEach(w => w.target(null));\n super.exit(domNode, element);\n }\n\n _createSelectionObject(d) {\n return {\n _id: d._id,\n element: () => {\n return d._element;\n },\n widget: d\n };\n }\n\n selection(_) {\n if (!arguments.length) return this._selectionBag.get().map(function (d) { return d._id; });\n this._selectionBag.set(_.map(function (row) {\n return this._createSelectionObject(row);\n }, this));\n return this;\n }\n\n selectionBagClear() {\n if (!this._selectionBag.isEmpty()) {\n this._selectionBag.clear();\n this.postSelectionChange();\n }\n }\n\n selectionBagClick(d) {\n if (d !== null) {\n const selectionObj = this._createSelectionObject(d);\n if (d3Event().sourceEvent.ctrlKey) {\n if (this._selectionBag.isSelected(selectionObj)) {\n this._selectionBag.remove(selectionObj);\n this.postSelectionChange();\n } else {\n this._selectionBag.append(selectionObj);\n this.postSelectionChange();\n }\n } else {\n const selected = this._selectionBag.get();\n if (selected.length === 1 && selected[0]._id === selectionObj._id) {\n this.selectionBagClear();\n } else {\n this._selectionBag.set([selectionObj]);\n }\n this.postSelectionChange();\n }\n }\n }\n\n postSelectionChange() {\n }\n\n applyLayout(layoutArr: ICellPosition[]) {\n this.divItems.each((d, i) => {\n if (layoutArr[i]) {\n const [x, y, w, h] = layoutArr[i];\n d\n .gridCol(x)\n .gridRow(y)\n .gridColSpan(w)\n .gridRowSpan(h)\n ;\n }\n });\n this.updateGrid(true);\n }\n\n vizActivation(elem) {\n }\n}\nGrid.prototype._class += \" layout_Grid\";\n\nexport interface Grid {\n designMode(): boolean;\n designMode(_: boolean): this;\n showLanes(): boolean;\n showLanes(_: boolean): this;\n fitTo(): string;\n fitTo(_: string): this;\n\n snapping(): string;\n snapping(_: string): this;\n snappingColumns(): number;\n snappingColumns(_: number): this;\n snappingRows(): number;\n snappingRows(_: number): this;\n snappingColumns_default(): number;\n snappingColumns_default(_: number): this;\n snappingRows_default(): number;\n snappingRows_default(_: number): this;\n\n gutter(): number;\n gutter(_: number): this;\n\n surfaceShadow(): boolean;\n surfaceShadow(_: boolean): this;\n surfacePadding(): string;\n surfacePadding(_: string): this;\n surfaceBorderWidth(): number;\n surfaceBorderWidth(_: number): this;\n surfaceBackgroundColor(): string;\n surfaceBackgroundColor(_: string): this;\n\n content(): Cell[];\n content(_: Cell[]): this;\n}\n\nGrid.prototype.publish(\"designMode\", false, \"boolean\", \"Design Mode\", null, { tags: [\"Basic\"] });\nGrid.prototype.publish(\"showLanes\", true, \"boolean\", \"Show snapping lanes when in design mode\", null, { tags: [\"Basic\"], disable: w => !w.designMode() });\nGrid.prototype.publish(\"fitTo\", \"all\", \"set\", \"Sizing Strategy\", [\"all\", \"width\"], { tags: [\"Basic\"] });\nGrid.prototype.publish(\"snapping\", \"vertical\", \"set\", \"Snapping Strategy\", [\"vertical\", \"horizontal\", \"none\"]);\nGrid.prototype.publish(\"snappingColumns\", 12, \"number\", \"Snapping Columns\");\nGrid.prototype.publish(\"snappingRows\", 16, \"number\", \"Snapping Rows\");\n\nGrid.prototype.publish(\"gutter\", 6, \"number\", \"Gap Between Widgets\", null, { tags: [\"Basic\"] });\n\nGrid.prototype.publish(\"surfaceShadow\", true, \"boolean\", \"3D Shadow\");\nGrid.prototype.publish(\"surfacePadding\", null, \"string\", \"Cell Padding (px)\", null, { tags: [\"Intermediate\"] });\nGrid.prototype.publish(\"surfaceBorderWidth\", 1, \"number\", \"Width (px) of Cell Border\", null, { tags: [\"Intermediate\"] });\nGrid.prototype.publish(\"surfaceBackgroundColor\", null, \"html-color\", \"Surface Background Color\", null, { tags: [\"Advanced\"] });\n\nGrid.prototype.publish(\"content\", [], \"widgetArray\", \"widgets\", null, { tags: [\"Basic\"], render: false });\n","import { FlexGrid } from \"./FlexGrid.ts\";\n\nexport class HorizontalList extends FlexGrid {\n constructor() {\n super();\n this.orientation_default(\"horizontal\");\n this.flexWrap_default(\"nowrap\");\n }\n}\nHorizontalList.prototype._class += \" layout_HorizontalList\";\n\nexport interface HorizontalList {\n orientation_default(_: \"horizontal\" | \"vertical\");\n flexWrap_default(_: \"nowrap\" | \"wrap\" | \"wrap-reverse\");\n}\n","import { HTMLWidget, Text } from \"@hpcc-js/common\";\n\nimport \"../src/Layered.css\";\n\nexport type LayerPlacement = \"default\" | \"top\" | \"right\" | \"bottom\" | \"left\" | \"center\";\n\nexport class Layered extends HTMLWidget {\n protected _contentContainer;\n _widgetPlacements;\n _widgetRatios;\n constructor() {\n super();\n\n this._tag = \"div\";\n this._widgetPlacements = [];\n this._widgetRatios = [];\n }\n\n addLayer(widget, placement: LayerPlacement = \"default\", widthRatio: number = 1, heightRatio: number = 1) {\n const widgets = this.widgets();\n widgets.push(widget ? widget : new Text().text(\"No widget defined for layer.\"));\n this.widgets(widgets);\n this._widgetPlacements.push(placement);\n this._widgetRatios.push([widthRatio, heightRatio]);\n return this;\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this._contentContainer = element.append(\"div\")\n .attr(\"class\", \"container\")\n ;\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n const context = this;\n\n element.style(\"padding\", this.surfacePadding() + \"px\");\n\n const content = this._contentContainer.selectAll(\".content.id\" + this.id()).data(this.widgets(), function (d) { return d.id(); });\n content.enter().append(\"div\")\n .attr(\"class\", \"content id\" + this.id())\n .each(function (widget, idx) {\n widget.target(this);\n })\n .merge(content)\n .each(function (widget, idx) {\n const clientSize = {\n width: context.clientWidth(),\n height: context.clientHeight()\n };\n const widgetSize = context.widgetSize(idx, clientSize);\n const widgetPosition = context.widgetPosition(idx, clientSize, widgetSize);\n this.style.top = widgetPosition.y + \"px\";\n this.style.left = widgetPosition.x + \"px\";\n widget\n .resize(widgetSize)\n .render()\n ;\n })\n ;\n content.exit()\n .each(function (widget, idx) {\n widget\n .target(null)\n ;\n })\n .remove()\n ;\n content.order();\n }\n\n widgetSize(idx, clientSize) {\n if (this._widgetPlacements[idx] === \"default\") {\n return {\n width: clientSize.width * this._widgetRatios[idx][0],\n height: clientSize.height * this._widgetRatios[idx][1]\n };\n } else {\n return {\n width: clientSize.width * this._widgetRatios[idx][0],\n height: clientSize.height * this._widgetRatios[idx][1]\n };\n }\n }\n widgetPosition(idx, clientSize, widgetSize) {\n switch (this._widgetPlacements[idx]) {\n default:\n return {\n x: 0,\n y: 0\n };\n case \"top\":\n return {\n x: (clientSize.width / 2) - (widgetSize.width / 2),\n y: 0\n };\n case \"bottom\":\n return {\n x: (clientSize.width / 2) - (widgetSize.width / 2),\n y: clientSize.height - widgetSize.height\n };\n case \"left\":\n return {\n x: 0,\n y: (clientSize.height / 2) - (widgetSize.height / 2)\n };\n case \"right\":\n return {\n x: clientSize.width - widgetSize.width,\n y: (clientSize.height / 2) - (widgetSize.height / 2)\n };\n case \"center\":\n return {\n x: (clientSize.width / 2) - (widgetSize.width / 2),\n y: (clientSize.height / 2) - (widgetSize.height / 2)\n };\n }\n }\n}\nLayered.prototype._class += \" layout_Layered\";\n\nexport interface Layered {\n surfacePadding(): number;\n surfacePadding(_: number): this;\n widgets(): any;\n widgets(_: any): this;\n}\n\nLayered.prototype.publish(\"surfacePadding\", 0, \"number\", \"Padding\");\nLayered.prototype.publish(\"widgets\", [], \"widgetArray\", \"widgets\", null, { tags: [\"Private\"] });\n","import { HTMLWidget, Widget } from \"@hpcc-js/common\";\n\nexport class Popup extends HTMLWidget {\n _surfaceButtons;\n _originalPosition;\n\n constructor() {\n super();\n this._tag = \"div\";\n this._surfaceButtons = [];\n }\n\n updateState(visible) {\n visible = visible || !this.popupState();\n this.popupState(visible).render();\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this.widget()\n .target(domNode)\n ;\n this._originalPosition = this.position();\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n element\n .style(\"visibility\", this.popupState() ? null : \"hidden\")\n .style(\"opacity\", this.popupState() ? null : 0)\n .style(\"width\", this.shrinkWrap() ? this.widget().width() + \"px\" : this._size.width + \"px\")\n .style(\"height\", this.shrinkWrap() ? this.widget().height() + \"px\" : this._size.height + \"px\")\n ;\n if (this.widget().size().height === 0) {\n this.widget().resize(this.size());\n }\n }\n\n postUpdate(domNode, element) {\n let left;\n let top;\n switch (this.centerPopup()) {\n case \"container\":\n if (this._placeholderElement) {\n left = parseInt(this._placeholderElement.style(\"width\")) / 2 - this.widget().width() / 2;\n top = parseInt(this._placeholderElement.style(\"height\")) / 2 - this.widget().height() / 2;\n }\n this.position(\"absolute\");\n break;\n\n case \"window\":\n left = window.innerWidth / 2 - this.widget().width() / 2;\n top = window.innerHeight / 2 - this.widget().height() / 2;\n this.position(\"fixed\");\n break;\n\n default:\n left = 0;\n top = 0;\n this.position(this._originalPosition);\n break;\n }\n\n this.pos({ x: left, y: top });\n\n super.postUpdate(domNode, element);\n\n element\n .style(\"position\", this.position())\n .style(\"left\", this.left() + \"px\")\n .style(\"right\", this.right() + \"px\")\n .style(\"top\", this.top() + \"px\")\n .style(\"bottom\", this.bottom() + \"px\")\n ;\n }\n\n exit(domNode, element) {\n if (this.widget()) {\n this.widget().target(null);\n }\n super.exit(domNode, element);\n }\n\n click(obj) {\n }\n}\nPopup.prototype._class += \" layout_Popup\";\n\nexport interface Popup {\n popupState(): boolean;\n popupState(_: boolean): this;\n shrinkWrap(): boolean;\n shrinkWrap(_: boolean): this;\n centerPopup(): \"none\" | \"container\" | \"window\";\n centerPopup(_: \"none\" | \"container\" | \"window\"): this;\n top(): number;\n top(_: number): this;\n bottom(): number;\n bottom(_: number): this;\n left(): number;\n left(_: number): this;\n right(): number;\n right(_: number): this;\n position(): string;\n position(_: string): this;\n\n widget(): Widget;\n widget(_: Widget): this;\n}\n\nPopup.prototype.publish(\"popupState\", false, \"boolean\", \"State of the popup, visible (true) or hidden (false)\", null, {});\nPopup.prototype.publish(\"shrinkWrap\", false, \"boolean\", \"The popup parent container either shrinks to the size of its contents (true) or expands to fit thge popup's parentDiv (false)\", null, {});\nPopup.prototype.publish(\"centerPopup\", \"none\", \"set\", \"Center the widget in its container element (target) or in the window\", [\"none\", \"container\", \"window\"], {});\nPopup.prototype.publish(\"top\", null, \"number\", \"Top position property of popup\", null, {});\nPopup.prototype.publish(\"bottom\", null, \"number\", \"Bottom position property of popup\", null, {});\nPopup.prototype.publish(\"left\", null, \"number\", \"Left position property of popup\", null, {});\nPopup.prototype.publish(\"right\", null, \"number\", \"Right position property of popup\", null, {});\nPopup.prototype.publish(\"position\", \"relative\", \"set\", \"Value of the 'position' property\", [\"absolute\", \"relative\", \"fixed\", \"static\", \"initial\", \"inherit\"], { tags: [\"Private\"] });\n\nPopup.prototype.publish(\"widget\", null, \"widget\", \"Widget\", null, { tags: [\"Private\"] });\n","import { HTMLWidget, Text, Widget } from \"@hpcc-js/common\";\nimport { select as d3Select } from \"d3-selection\";\nimport { Surface } from \"./Surface.ts\";\n\nimport \"../src/Tabbed.css\";\n\nexport class Tabbed extends HTMLWidget {\n _tabContainer;\n _contentContainer;\n\n constructor() {\n super();\n\n this._tag = \"div\";\n }\n\n clearTabs() {\n this.labels([]);\n this.widgets([]);\n return this;\n }\n\n addTab(widget, label, isActive?, callback?) {\n const widgetSize = widget.size();\n if (widgetSize.width === 0 && widgetSize.height === 0) {\n widget.size({ width: \"100%\", height: \"100%\" });\n }\n const labels = this.labels();\n const widgets = this.widgets();\n if (isActive) {\n this.activeTabIdx(this.widgets().length);\n }\n labels.push(label);\n const surface = new Surface().widget(widget ? widget : new Text().text(\"No widget defined for tab\"));\n widgets.push(surface);\n this.labels(labels);\n this.widgets(widgets);\n if (callback) {\n callback(surface);\n }\n return this;\n }\n\n widgetSize(widgetDiv) {\n const width = this.clientWidth();\n let height = this.clientHeight();\n\n const tcBox = this._tabContainer.node().getBoundingClientRect();\n if (typeof (tcBox.height) !== \"undefined\") {\n height -= tcBox.height;\n }\n return { width, height };\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this._tabContainer = element.append(\"div\");\n this._contentContainer = element.append(\"div\");\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n const context = this;\n\n element.style(\"padding\", this.surfacePadding_exists() ? this.surfacePadding() + \"px\" : null);\n\n const tabs = this._tabContainer.selectAll(\".tab-button.id\" + this.id()).data(this.showTabs() ? this.labels() : [], function (d) { return d; });\n tabs.enter().append(\"span\")\n .attr(\"class\", \"tab-button id\" + this.id())\n .style(\"cursor\", \"pointer\")\n .on(\"click\", function (d, idx) {\n context.click(context.widgets()[idx].widget(), d, idx);\n context\n .activeTabIdx(idx)\n .render()\n ;\n }).merge(tabs)\n .classed(\"active\", function (d, idx) { return context.activeTabIdx() === idx; })\n .text(function (d) { return d; })\n ;\n tabs.exit().remove();\n\n const content = this._contentContainer.selectAll(\".tab-content.id\" + this.id()).data(this.widgets(), function (d) { return d.id(); });\n content.enter().append(\"div\")\n .attr(\"class\", \"tab-content id\" + this.id())\n .each(function (widget, idx) {\n widget.target(this);\n }).merge(content)\n .classed(\"active\", function (d, idx) { return context.activeTabIdx() === idx; })\n .style(\"display\", function (d, idx) { return context.activeTabIdx() === idx ? \"block\" : \"none\"; })\n .each(function (surface, idx) {\n surface.visible(context.activeTabIdx() === idx);\n if (context.activeTabIdx() === idx) {\n const wSize = context.widgetSize(d3Select(this));\n surface\n .surfaceBorderWidth(context.showTabs() ? null : 0)\n .surfacePadding(context.showTabs() ? null : 0)\n .resize(wSize)\n ;\n }\n })\n ;\n content.exit()\n .each(function (widget, idx) {\n widget\n .target(null)\n ;\n })\n .remove();\n\n switch (this.tabLocation()) {\n case \"bottom\":\n this._tabContainer\n .attr(\"class\", \"on_bottom\")\n .style(\"top\", (this._contentContainer.node().offsetHeight + this.surfacePadding()) + \"px\")\n .style(\"position\", \"absolute\")\n ;\n this._contentContainer\n .style(\"top\", this.surfacePadding_exists() ? this.surfacePadding() + \"px\" : null)\n .style(\"position\", \"absolute\")\n ;\n break;\n default:\n this._tabContainer\n .attr(\"class\", \"on_top\")\n .style(\"top\", null)\n .style(\"position\", \"relative\")\n ;\n this._contentContainer\n .style(\"top\", (this._tabContainer.node().offsetHeight + this.surfacePadding()) + \"px\")\n .style(\"position\", \"absolute\")\n ;\n break;\n }\n }\n\n click(widget, column, idx) {\n }\n}\nTabbed.prototype._class += \" layout_Tabbed\";\n\nexport interface Tabbed {\n showTabs(): boolean;\n showTabs(_: boolean): this;\n surfacePadding(): number;\n surfacePadding(_: number): this;\n surfacePadding_exists(): boolean;\n activeTabIdx(): number;\n activeTabIdx(_: number): this;\n\n labels(): string[];\n labels(_: string[]): this;\n tabLocation(): \"top\" | \"bottom\";\n tabLocation(_: \"top\" | \"bottom\"): this;\n widgets(): any[];\n widgets(_: any[]): this;\n}\n\nTabbed.prototype.publish(\"showTabs\", true, \"boolean\", \"Show Tabs\", null, {});\nTabbed.prototype.publish(\"surfacePadding\", 4, \"number\", \"Padding\");\nTabbed.prototype.publish(\"activeTabIdx\", 0, \"number\", \"Index of active tab\", null, {});\n\nTabbed.prototype.publish(\"labels\", [], \"array\", \"Array of tab labels sharing an index with \", null, { tags: [\"Private\"] });\nTabbed.prototype.publish(\"tabLocation\", \"top\", \"set\", \"Position the tabs at the bottom of the widget\", [\"top\", \"bottom\"], { tags: [\"Private\"] });\nTabbed.prototype.publish(\"widgets\", [], \"widgetArray\", \"widgets\", null, { tags: [\"Private\"] });\n","import { HTMLWidget, Widget } from \"@hpcc-js/common\";\nimport { select as d3Select } from \"d3-selection\";\n\nimport \"../src/Toolbar.css\";\n\nexport class Toolbar extends HTMLWidget {\n\n constructor() {\n super();\n this._tag = \"div\";\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n const context = this;\n\n element\n .attr(\"title\", context.title())\n .style(\"background-color\", this.backgroundColor())\n ;\n\n const title = element.selectAll(\"div.toolbar-title\")\n .data(this.title() ? [this.title()] : []);\n title.enter().append(\"div\")\n .classed(\"toolbar-title\", true)\n .append(\"span\")\n ;\n title.selectAll(\"div.toolbar-title > span\")\n .style(\"font-size\", this.fontSize_exists() ? this.fontSize() + \"px\" : null)\n .style(\"color\", this.fontColor_exists() ? this.fontColor() : null)\n .style(\"font-family\", this.fontFamily_exists() ? this.fontFamily() : null)\n .style(\"font-weight\", this.fontBold_exists() ? (this.fontBold() ? \"bold\" : \"normal\") : null)\n .style(\"background-color\", this.backgroundColor_exists() ? this.backgroundColor() : null)\n .text(context.title())\n ;\n title.exit().remove();\n\n const childWidgets = element.selectAll(\"div.toolbar-child\")\n .data(this.widgets() !== null ? this.widgets() : [], function (d) { return d.id(); });\n\n childWidgets.enter().insert(\"div\", \"div.toolbar-title\")\n .each(function (d, i) {\n const widgetClass = context.widgetClasses()[i] ? context.widgetClasses()[i] + \" toolbar-child\" : \"toolbar-child\";\n d3Select(this).classed(widgetClass, true);\n d.target(this);\n });\n childWidgets.exit().each(function (d) {\n d.target(null);\n }).remove();\n childWidgets.order();\n }\n\n render(callback?: (w: Widget) => void): this {\n const context = this;\n return super.render(function (w) {\n const toolbarBBox = context.element().node().getBoundingClientRect();\n let minX = toolbarBBox.left + toolbarBBox.width;\n context.element().selectAll(\"div.toolbar-child\")\n .each(function (d, i) {\n const childBBox = this.getBoundingClientRect();\n if (minX > childBBox.left)\n minX = childBBox.left;\n })\n ;\n context.element().select(\".toolbar-title\")\n .style(\"width\", (minX - toolbarBBox.left - 4) + \"px\")\n ;\n if (callback) {\n callback(w);\n }\n });\n }\n\n exit(domNode, element) {\n this.widgets().forEach(function (w) {\n w.target(null);\n });\n super.exit(domNode, element);\n }\n}\nToolbar.prototype._class += \" layout_Toolbar\";\n\nexport interface Toolbar {\n title(): string;\n title(_: string): this;\n\n fontSize(): number;\n fontSize(_: number): this;\n fontSize_exists(): boolean;\n fontColor(): string;\n fontColor(_: string): this;\n fontColor_exists(): boolean;\n fontFamily(): string;\n fontFamily(_: string): this;\n fontFamily_exists(): boolean;\n fontBold(): boolean;\n fontBold(_: boolean): this;\n fontBold_exists(): boolean;\n backgroundColor(): string;\n backgroundColor(_: string): this;\n backgroundColor_exists(): boolean;\n\n responsive(): boolean;\n responsive(_: boolean): this;\n\n widgets(): any[];\n widgets(_: any[]): this;\n widgetClasses(): string[];\n widgetClasses(_: string[]): this;\n}\n\nToolbar.prototype.publish(\"title\", \"\", \"string\", \"Title\", null, { tags: [\"Intermediate\"] });\n\nToolbar.prototype.publish(\"fontSize\", null, \"number\", \"Title Font Size (px)\", null, { tags: [\"Advanced\"], optional: true });\nToolbar.prototype.publish(\"fontColor\", null, \"html-color\", \"Title Font Color\", null, { tags: [\"Advanced\"], optional: true });\nToolbar.prototype.publish(\"fontFamily\", null, \"string\", \"Title Font Family\", null, { tags: [\"Advanced\"], optional: true });\nToolbar.prototype.publish(\"fontBold\", true, \"boolean\", \"Enable Bold Title Font\", null, { tags: [\"Advanced\"], optional: true });\nToolbar.prototype.publish(\"backgroundColor\", null, \"html-color\", \"Background Color\", null, { tags: [\"Intermediate\"], optional: true });\n\nToolbar.prototype.publish(\"responsive\", true, \"boolean\", \"Adapts to pixel width\", null, { tags: [\"Basic\"] });\n\nToolbar.prototype.publish(\"widgets\", [], \"widgetArray\", \"Child widgets of the toolbar\", null, { tags: [\"Basic\"] });\nToolbar.prototype.publish(\"widgetClasses\", [], \"array\", \"Array of Html Element classes to be assigned to the child widgets (shares index with widgets param)\", null, { tags: [\"Basic\"] });\n","import { FlexGrid } from \"./FlexGrid.ts\";\n\nexport class VerticalList extends FlexGrid {\n constructor() {\n super();\n this.orientation_default(\"vertical\");\n this.flexWrap_default(\"nowrap\");\n }\n}\nVerticalList.prototype._class += \" layout_VerticalList\";\n\nexport interface VerticalList {\n orientation_default(_: \"horizontal\" | \"vertical\");\n flexWrap_default(_: \"nowrap\" | \"wrap\" | \"wrap-reverse\");\n}\n"],"names":["d3Select","d3SelectAll","c","drag","d3Drag","a","promises","pi","tau","s","circle","text","path","d3LegendColor","n","format","d3Format","d3ScaleOrdinal","this","GridList","k","_GridList.default"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAO,MAAM,WAAW,mBACX,cAAc,SACd,gBAAgB;ACEtB,MAAM,wBAAwB,WAAW;AAAA,EAC5C,cAAc;AACV,UAAA,GAEA,KAAK,OAAO;AAAA,EAAA;AAAA,EAGhB,MAAM,SAAS,SAAS;AACpB,UAAM,MAAM,SAAS,OAAO;AAAA,EAAA;AAAA,EAGhC,OAAO,SAAS,SAAS;AACrB,UAAM,OAAO,SAAS,OAAO;AAE7B,QAAI,OAAO,GACP,OAAO,GACP,QAAQ,KAAK,YAAA,GACb,SAAS,KAAK,aAAA;AAClB,YAAQ,KAAK,SAAM;AAAA,MACf,KAAK;AACD,eAAO,KAAK,QAAA,GACZ,OAAO,KAAK,QAAA,GACZ,QAAQ,KAAK,kBAAkB,KAAK,QAAQ,OAAO,OAAO,KAAK,aAAa,GAC5E,SAAS,KAAK,mBAAmB,KAAK,SAAS,OAAO,OAAO,KAAK,cAAc;AAChF;AAAA,MACJ,KAAK;AACD,eAAO,KAAK,QAAA,IAAY,QAAQ,KAChC,OAAO,KAAK,QAAA,IAAY,SAAS,KACjC,QAAQ,KAAK,YAAA,MAAkB,KAAK,QAAQ,OAAO,OAAO,KAAK,aAAa,IAAI,QAAQ,KACxF,SAAS,KAAK,aAAA,MAAmB,KAAK,SAAS,OAAO,OAAO,KAAK,cAAc,IAAI,SAAS;AAC7F;AAAA,IAAA;AAER,YAAQ,MAAM,WAAW,KAAK,QAAA,CAAS;AAEvC,UAAM,UAAU,QAAQ,UAAU,MAAM,KAAK,MAAM,iBAAiB,EAAE,KAAK,KAAK,WAAW,CAAC,KAAK,OAAA,CAAQ,IAAI,CAAA,GAAI,S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