@hpcc-js/layout 2.46.0 → 2.46.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../node_modules/tslib/tslib.es6.js","../../../node_modules/style-inject/dist/style-inject.es.js","../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/src/legend.js","../src/Legend.ts","../../../node_modules/d3-svg-legend/src/color.js","../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","../src/__package__.ts"],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","__extends","TypeError","String","__","this","constructor","create","__assign","assign","t","s","i","n","arguments","length","apply","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","__generator","body","f","y","g","_","label","sent","trys","ops","verb","throw","return","Symbol","iterator","v","op","pop","push","__spreadArray","to","from","pack","ar","l","slice","concat","styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","AbsoluteSurface","_this","_super","_tag","enter","domNode","element","update","xPos","yPos","width","clientWidth","height","clientHeight","units","widgetX","widgetY","widgetWidth","Number","widgetHeight","opacity","widgets","selectAll","_id","data","widget","append","attr","each","target","merge","resize","exit","remove","HTMLWidget","_class","publish","tags","Accordion","_isClosed","pushListItem","prepend","protect","contentArr","content","_protected","unshift","clearListItems","arr","collapseClick","classed","context","defaultCollapsed","titleSpan","iconDiv","ul","icon","FAChar","size","node","on","render","text","title","rows","li","_target","wSize","cSize","text_colorFill","titleFontColor","char","closedIcon","openIcon","Surface","_surfaceButtons","widgetSize","titleDiv","widgetDiv","calcHeight","calcFrameHeight","calcFrameWidth","element2","surfaceShadow","surfaceBorderWidth_exists","surfaceBorderWidth","surfaceBorderColor","surfaceBorderRadius_exists","surfaceBorderRadius","surfaceBackgroundColor","titles","insert","surfaceTitleAlignment","surfaceTitleFontColor","surfaceTitleFontSize_exists","surfaceTitleFontSize","surfaceTitleFontFamily","surfaceTitleFontBold","surfaceTitleBackgroundColor","surfaceTitlePadding_exists","surfaceTitlePadding","altText_exists","altText","surfaceButtons","select","buttonAnnotations","button","idx","el","d3Select","class","id","padding","font","click","_d","parentElement","classID","split","surfacePadding_exists","surfacePadding","obj","console","log","optional","disable","w","Cell","_indicateTheseIds","indicateTheseIds","onMouseEnter","onMouseLeave","indicatorOpacity","indicatorBorderColor","indicatorGlowColor","otherElement","otherWidget","datum","d3SelectAll","Border","lazyPostUpdate","Utility","debounce","postUpdate","_colCount","_rowCount","_colSize","_rowSize","_shrinkWrapBoxes","sectionTypes","watchWidget","undefined","_watch","context_1","monitor","paramId","newVal","oldVal","applyLayoutType","layoutObj","borderLayoutObject","forEach","cell","_fixedLeft","left","_fixedTop","top","_fixedWidth","_fixedHeight","_dragHandles","cellSpecificDragHandles","sectionType","layoutType","topSize","topPerc","bottomSize","bottomPerc","leftSize","leftPerc","rightSize","rightPerc","retObj","bcRect","getBoundingClientRect","gridRect","bottom","right","SVGElement","parseFloat","getAttribute","indexOf","topPercentage","gutter","bottomPercentage","leftPercentage","rightPercentage","_sectionPlacementObject","px","%","r","c","clearContent","splice","contentWidget","hasContent","setContent","getCell","getContent","setLayoutOffsets","_offsetX","_element","_offsetY","dragStart","handle","event","d3Event","sourceEvent","stopPropagation","_dragCell","_dragCellStartSize","handleElm","_handleTop","_handleLeft","_dragPrevX","clientX","_dragPrevY","clientY","dragTick","xDelta","yDelta","_moveHandles","handle2","delta","handles","grabbedHandle","_cellSizes","topHeight","leftHeight","bottomHeight","rightHeight","rightWidth","leftWidth","handle3","dragEnd","event_1","getBBox","retVal","contentDiv","_size","_scrollBarWidth","Platform","getScrollbarWidth","_borderHandles","_sectionTypeArr","designMode","rowsUpdate","drag","d3Drag","_placeholderElement","getCellSizes","contentRect","rect","prevBox","currBox","lazyRender","WidgetDiv","div","_overlay","_overflowX","_overflowY","_div","overlay","overflowX","overflowY","_widget","availableHeight","availableWidth","renderPromise","visible","x","Border2","topElement","_bodyElement","centerElement","leftElement","rightElement","bottomElement","_topWA","_centerWA","_leftWA","_rightWA","_bottomWA","showTop","showRight","showBottom","showLeft","topOverflowX","rightOverflowX","bottomOverflowX","leftOverflowX","topOverflowY","rightOverflowY","bottomOverflowY","leftOverflowY","targetNull","center","swap","sectionA","sectionB","a","callback","topOverlay","topBBox","bottomBBox","_a","leftBBox","rightBBox","bottomHeight_exists","bodyWidth","bodyHeight","centerOverflowX","centerOverflowY","scrollCenterX","scrollCenterY","promises","all","Carousel","_prevActive","activeWidget","active","_root","widgetElements","transition","duration","transitionDuration","isDOMHidden","aw","w2","pi","Math","PI","tau","tauEpsilon","Path","_x0","_y0","_x1","_y1","path","constant","moveTo","closePath","lineTo","quadraticCurveTo","x1","y1","bezierCurveTo","x2","y2","arcTo","x0","y0","x21","y21","x01","y01","l01_2","Error","abs","x20","y20","l21_2","l20_2","l21","sqrt","l01","tan","acos","t01","t21","arc","a0","a1","ccw","dx","cos","dy","sin","cw","da","h","toString","d3SymbolCircle","draw","d3SymbolCross","tan30","tan30_2","d3SymbolDiamond","kr","kx","ky","d3SymbolStar","d3SymbolSquare","sqrt3","d3SymbolTriangle","k","d3SymbolWye","d3Symbol","circle","symbol","buffer","d3_identity","d3_reverse","mirror","d3_textWrapping","word","words","reverse","line","tspan","join","getComputedTextLength","helper","shape","shapes","shapeHeight","shapeWidth","shapeRadius","svg","labels","classPrefix","labelWidth","scale","ascending","cells","labelFormat","labelDelimiter","invertExtent","range","map","invert","d3_quantLegend","ticks","domain","increment","d3_linearLegend","d3_ordinalLegend","gen","_typeof","customLabels","genLength","d3_mergeLabels","cellFilter","filterCells","filter","dataValues","labelValues","orient","cellTrans","textTrans","labelAlign","dispatcher","cellDispatcher","titleWidth","cellsSvg","yOffset","nodes","xOffset","Legend","owner","_disabled","_symbolTypeMap","cross","diamond","square","star","triangle","wye","_owner","_drawStartPos","_legendOrdinal","scaleLinear","shapePadding","useClass","locale","d3_defaultLocale","specifier","d3_defaultFormatSpecifier","labelOffset","d3_defaultDelimiter","labelWrap","legendDispatcher","dispatch","legend","d3_calcType","format","d3_filterCells","cellEnter","d3_addEvents","d3_drawShapes","d3_addText","textSize","shapeSize","feature","cellSize","textAlign","max","sum","d3_placement","d3_title","formatLocale","formatSpecifier","toLowerCase","textWrap","d3LegendColor","onClick","onOver","onOut","isDisabled","Database","Field","filteredFields","dataFamily","fields","filteredColumns","columns","filteredData","row","disabledCols_1","anyDisabled_1","col","disabled","isRainbow","getWidget","_palette","targetWidget","_targetWidget","_targetWidgetMonitor","key","newProp","oldProp","source","chart","getPalette","Palette","ordinal","rainbow","getPaletteType","fillColorFunc","fillColor","paletteID","name","switch","sel","palette","_g","calcMetaData","dataArr","total","maxLabelWidth","colLength","columns_1","fillColor_1","val_1","reduce","acc","showSeriesTotal","d3Format","rainbowFormat","steps","rainbowBins","weightMin","_dataMinWeight","weightMax","_dataMaxWeight","stepWeightDiff","mid","floor","parseInt","radius","radiusToSymbolSize","itemPadding","orientation","d3ScaleOrdinal","symbolType","labelMaxWidth","updateDisabled","legendCellsBbox","offsetX","offsetY","_containerSize","pos","legendTotal","showLegendTotal","totalText","totalOffsetX","totalOffsetY","enableOverflowScroll","enableOverflow","_boundingBox","_parentRelativeDiv","circleSize","pow","disabledIdx","refreshColumns","refreshData","instanceOfIHighlight","highlightColumn","onDblClick","rowData","rowIdx","onMouseOver","fitToContent","bbox","SVGWidget","Modal","closeModal","getRelativeTarget","relativeTarget","relativeTargetId","getElementById","locateAncestor","setModalSize","fixedHeight","fixedWidth","_modal","minHeight","minWidth","maxHeight","maxWidth","modalRect","headerRect","_modalHeader","_modalBody","setFadePosition","_fade","setModalPosition","fixedTop","fixedLeft","resizeBodySync","enableClickFadeToClose","showFade","header_h","titleFontSize","formattedTitle","_modalHeaderAnnotations","_modalHeaderCloseButton","html","show","_relativeTarget","title_exists","trim","ChartPanel","_legend","_progressBar","ProgressBar","_autoScale","_resolutions","tiny","small","_toggleInfo","ToggleButton","faChar","tooltip","selected","description","Text","origCloseFunc_1","_close","_toggleData","dataVisible","_buttonDownload","Button","downloadCSV","_buttonDownloadImage","downloadPNG","_toggleLegend","legendPosition","legendVisible","_spacer","Spacer","_titleBar","TitleBar","buttons","_carousel","_table","Table","_hideLegendToggleList","refreshFields","asDefault","highlight","_highlight","startProgress","start","finishProgress","finish","namePrefix","downloadTitle","nameSuffix","downloadTimestampSuffix","timestamp","downloadString","export","column","cssTag_1","cssTag","getResponsiveMode","enableAutoscaling","setOrigSize","_orig_size","JSON","parse","stringify","preUpdateTiny","preUpdateSmall","scale_x","scale_y","_scale","min","x_is_smaller","preUpdateRegular","preUpdate","_prevLegendPosition","_prevdataVisible","_prevlegendVisible","_dataFamily","_prevChartDataFamily","highlightSize","highlightColor","_prevChart","widgetIconBar","IconBar","_prevButtons","hiddenButtons","dataButtonVisible","downloadButtonVisible","downloadImageButtonVisible","legendButtonVisible","enabled","titleVisible","titleOverlay","postUpdateTiny","postUpdateSmall","postUpdateRegular","titleIconFontSize","_node","containerRect","icon_top","parentRect","_prevPos","dblclick","vertex_click","more","vertex","vertex_dblclick","edge_click","edge","edge_dblclick","publishReset","publishProxy","tmpAny","FlexGrid","parentNode","cachedSizes","updateFlexParent","listItems","itemMinHeight","itemMinWidth","flexBasis","widgetsFlexBasis","flexGrow","widgetsFlexGrow","borderWidth","itemBorderColor","display","flexWrap","alignItems","alignContent","forceXScroll","disableScroll","forceYScroll","module","exports","GridList","items","options","_options","defaults","_adjustSizeOfItems","generateGrid","cloneItems","_items","lanes","direction","item","j","widthOfGrid","grid","output","border","_padNumber","_resetGrid","_markItemPositionToGrid","resizeGrid","currentColumn","_sortItemsByPosition","position","_getItemPosition","_updateItemPosition","findPositionForItem","_pullItemsToLeft","fixedRow","_itemFitsAtPosition","newCol","newRow","moveItemToPosition","newPosition","_resolveCollisions","resizeItem","_updateItemSize","getChangedItems","initialItems","idAttribute","changedItems","_getItemByAttribute","sort","item1","item2","position1","position2","bind","autoSize","_deleteItemPositionFromGrid","_setItemPosition","_ensureColumns","N","GridCol","_getItemsCollidingWithItem","collidingItems","_itemsAreColliding","_tryToResolveCollisionsLocally","leftOfItem","rightOfItem","aboveOfItem","belowOfItem","_gridList","collidingItem","collidingPosition","fixedItem","fixedPosition","_findLeftMostPositionForItem","tail","otherItem","otherPosition","nr","prefix","factory","_GridList","_GridList.default","Grid","_selectionBag","Selection","getDimensions","gridCol","gridColSpan","gridRow","gridRowSpan","rowSpan","colSpan","sortedContent","some","getWidgetCell","cellToGridItem","gridItemToCell","resetItemsPos","origItems","origItem","itemsMap","initGridList","gridList","snapping","snappingRows","snappingColumns","killGridList","_d3Drag","subject","cellWidth","cellHeight","dragItem","selectionBagClick","updateGrid","_d3DragResize","dragItemPos","round","_noRender","divItems","surfaceShadow_default","surfacePadding_default","surfaceBorderWidth_default","surfaceBackgroundColor_default","fitTo","dimensions","cellLaneRatio","laneWidth","__grid_watch","_renderCount","lanesBackground","selectionBagClear","showLanes","_createSelectionObject","selection","set","get","isEmpty","clear","postSelectionChange","selectionObj","ctrlKey","isSelected","applyLayout","layoutArr","vizActivation","elem","HorizontalList","orientation_default","flexWrap_default","Layered","_widgetPlacements","_widgetRatios","addLayer","placement","widthRatio","heightRatio","_contentContainer","clientSize","widgetPosition","order","Popup","updateState","popupState","_originalPosition","shrinkWrap","centerPopup","window","innerWidth","innerHeight","Tabbed","clearTabs","addTab","isActive","activeTabIdx","surface","tcBox","_tabContainer","tabs","showTabs","tabLocation","offsetHeight","Toolbar","backgroundColor","fontSize_exists","fontSize","fontColor_exists","fontColor","fontFamily_exists","fontFamily","fontBold_exists","fontBold","backgroundColor_exists","childWidgets","widgetClass","widgetClasses","toolbarBBox","minX","childBBox","VerticalList"],"mappings":"mZAgBIA,EAAgB,SAASC,EAAGC,GAI5B,OAHAF,EAAgBG,OAAOC,gBAClB,CAAEC,UAAW,cAAgBC,OAAS,SAAUL,EAAGC,GAAKD,EAAEI,UAAYH,IACvE,SAAUD,EAAGC,GAAK,IAAK,IAAIK,KAAKL,EAAOC,OAAOK,UAAUC,eAAeC,KAAKR,EAAGK,KAAIN,EAAEM,GAAKL,EAAEK,MAC3EN,EAAGC,IAGrB,SAASS,EAAUV,EAAGC,GACzB,GAAiB,mBAANA,GAA0B,OAANA,EAC3B,MAAM,IAAIU,UAAU,uBAAyBC,OAAOX,GAAK,iCAE7D,SAASY,IAAOC,KAAKC,YAAcf,EADnCD,EAAcC,EAAGC,GAEjBD,EAAEO,UAAkB,OAANN,EAAaC,OAAOc,OAAOf,IAAMY,EAAGN,UAAYN,EAAEM,UAAW,IAAIM,GAG5E,IAAII,EAAW,WAQlB,OAPAA,EAAWf,OAAOgB,QAAU,SAAkBC,GAC1C,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAIf,KADTc,EAAIG,UAAUF,GACOnB,OAAOK,UAAUC,eAAeC,KAAKW,EAAGd,KAAIa,EAAEb,GAAKc,EAAEd,IAE9E,OAAOa,IAEKM,MAAMX,KAAMS,YA8BzB,SAASG,EA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F,UAAU4I,QAAQ,SAAUnC,GAC7BA,EAAEjG,OAAO,4BC5Fb,SAAAk7B,IAAA,IAAA98B,EACIC,EAAA/E,KAAAK,OAAOA,YACPyE,EAAK25B,oBAAoB,YACzB35B,EAAK45B,iBAAiB,YAE9B,OANkCz+B,EAAA2hC,EAAA78B,GAMlC68B,GANkCtN,GAOlCsN,GAAa9hC,UAAUkH,QAAU,yECPJ,8JAFL,gCACG","sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || from);\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\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\n units: { (): string; (_: string): AbsoluteSurface; };\n widgetX: { (): number; (_: number): AbsoluteSurface; };\n widgetY: { (): number; (_: number): AbsoluteSurface; };\n widgetWidth: { (): string; (_: string): AbsoluteSurface; };\n widgetHeight: { (): string; (_: string): AbsoluteSurface; };\n widget: { (): any; (_: any): AbsoluteSurface; };\n opacity: { (): number; (_: number): AbsoluteSurface; };\n}\nAbsoluteSurface.prototype._class += \" layout_AbsoluteSurface\";\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\n content: { (): any[]; (_: any[]): Accordion; };\n title: { (): string; (_: string): Accordion; };\n openIcon: { (): string; (_: string): Accordion; };\n closedIcon: { (): string; (_: string): Accordion; };\n titleFontColor: { (): string; (_: string): Accordion; };\n titleBackgroundColor: { (): any; (_: any): Accordion; };\n defaultCollapsed: { (): boolean; (_: boolean): Accordion; };\n}\nAccordion.prototype._class += \" layout_Accordion\";\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 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 // Events ---\n click(obj) {\n console.log(\"Clicked: \" + obj.id);\n }\n}\nSurface.prototype._class += \" layout_Surface\";\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\";\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\n title: { (): string; (_: string): Cell; };\n widget: { (): Widget; (_: Widget): Cell; };\n\n gridRow: { (): number; (_: number): Cell; };\n gridCol: { (): number; (_: number): Cell; };\n gridRowSpan: { (): number; (_: number): Cell; };\n gridColSpan: { (): number; (_: number): Cell; };\n\n indicatorGlowColor: { (): string; (_: string): Cell; };\n indicatorBorderColor: { (): string; (_: string): Cell; };\n indicatorOpacity: { (): number; (_: number): Cell; };\n\n}\nCell.prototype._class += \" layout_Cell\";\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\";\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\n designMode: { (): boolean; (_: boolean): Border; };\n\n content: { (): any[]; (_: any[]): Border; };\n\n gutter: { (): number; (_: number): Border; };\n\n topShrinkWrap: { (): boolean; (_: boolean): Border; };\n leftShrinkWrap: { (): boolean; (_: boolean): Border; };\n rightShrinkWrap: { (): boolean; (_: boolean): Border; };\n bottomShrinkWrap: { (): boolean; (_: boolean): Border; };\n\n topSize: { (): number; (_: number): Border; };\n leftSize: { (): number; (_: number): Border; };\n rightSize: { (): number; (_: number): Border; };\n bottomSize: { (): number; (_: number): Border; };\n\n topPercentage: { (): number; (_: number): Border; };\n leftPercentage: { (): number; (_: number): Border; };\n rightPercentage: { (): number; (_: number): Border; };\n bottomPercentage: { (): number; (_: number): Border; };\n\n surfacePadding: { (): number; (_: number): Border; };\n\n sectionTypes: { (): any[]; (_: any[]): Border; };\n}\nBorder.prototype._class += \" layout_Border\";\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, formatPrefix } from 'd3-format'\n\nconst d3_identity = (d) => d\n\nconst d3_reverse = (arr) => {\n const mirror = [];\n for (let 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\nconst 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, //ems\n y = text.attr(\"y\"),\n dy = parseFloat(text.attr(\"dy\")) || 0,\n tspan = text.text(null)\n .append(\"tspan\")\n .attr(\"x\", 0)\n .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\")\n .attr(\"x\", 0)\n .attr(\"dy\", lineHeight + dy + \"em\").text(word);\n }\n }\n });\n}\n\n\nconst d3_mergeLabels = (gen=[], labels, domain, range) => {\n\n if (typeof labels === \"object\"){\n if(labels.length === 0) return gen;\n\n let 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 const customLabels = []\n const genLength = gen.length\n for (let i=0; i < genLength; i++){\n customLabels.push(labels({\n i,\n genLength,\n generatedLabels : gen,\n domain,\n range }))\n }\n return customLabels\n }\n\n return gen;\n }\n\nconst d3_linearLegend = (scale, cells, labelFormat) => {\n let data = [];\n\n if (cells.length > 1){\n data = cells;\n\n } else {\n const domain = scale.domain(),\n increment = (domain[domain.length - 1] - domain[0])/(cells - 1)\n let i = 0;\n\n for (; i < cells; i++){\n data.push(domain[0] + i*increment);\n }\n }\n\n const labels = data.map(labelFormat);\n return {data: data,\n labels: labels,\n feature: d => scale(d)};\n}\n\nconst d3_quantLegend = (scale, labelFormat, labelDelimiter) => {\n const labels = scale.range().map( d => {\n const invert = scale.invertExtent(d);\n return labelFormat(invert[0]) + \" \" + labelDelimiter + \" \" + labelFormat(invert[1]);\n });\n\n return {data: scale.range(),\n labels: labels,\n feature: d3_identity\n };\n}\n\nconst d3_ordinalLegend= scale => ({data: scale.domain(),\n labels: scale.domain(),\n feature: d => scale(d) }\n)\n\nconst d3_cellOver = (cellDispatcher, d, obj) => {\n cellDispatcher.call(\"cellover\", obj, d);\n}\n\nconst d3_cellOut = (cellDispatcher, d, obj) => {\n cellDispatcher.call(\"cellout\", obj, d);\n}\n\nconst d3_cellClick = (cellDispatcher, d, obj) => {\n cellDispatcher.call(\"cellclick\", obj, d);\n}\n\n\nexport default {\n\n d3_drawShapes: (shape, shapes, shapeHeight, shapeWidth, shapeRadius, path) => {\n if (shape === \"rect\"){\n shapes.attr(\"height\", shapeHeight)\n .attr(\"width\", shapeWidth);\n\n } else if (shape === \"circle\") {\n shapes.attr(\"r\", shapeRadius)\n\n } else if (shape === \"line\") {\n shapes.attr(\"x1\", 0).attr(\"x2\", shapeWidth).attr(\"y1\", 0).attr(\"y2\", 0);\n\n } else if (shape === \"path\") {\n shapes.attr(\"d\", path);\n }\n },\n\n d3_addText: function (svg, enter, labels, classPrefix, labelWidth){\n enter.append(\"text\").attr(\"class\", classPrefix + \"label\");\n const text = svg.selectAll(`g.${classPrefix}cell text.${classPrefix}label`)\n .data(labels)\n .text(d3_identity);\n\n if (labelWidth){\n svg.selectAll(`g.${classPrefix}cell text.${classPrefix}label`)\n .call(d3_textWrapping, labelWidth)\n }\n\n return text\n },\n\n d3_calcType: function (scale, ascending, cells, labels, labelFormat, labelDelimiter){\n const type = scale.invertExtent ?\n d3_quantLegend(scale, labelFormat, labelDelimiter) : scale.ticks ?\n d3_linearLegend(scale, cells, labelFormat) : d3_ordinalLegend(scale);\n\n //for d3.scaleSequential that doesn't have a range function\n const range = scale.range && scale.range() || scale.domain()\n type.labels = d3_mergeLabels(type.labels, labels, scale.domain(), range);\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: (type, cellFilter) => {\n let filterCells = type.data.map((d, i) => ({ data: d, label: type.labels[i] }))\n .filter(cellFilter)\n const dataValues = filterCells.map(d => d.data)\n const labelValues = filterCells.map(d => d.label)\n type.data = type.data.filter(d => dataValues.indexOf(d) !== -1)\n type.labels = type.labels.filter(d => labelValues.indexOf(d) !== -1)\n return type\n },\n\n 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(cells, dispatcher){\n cells.on(\"mouseover.legend\", function (d) { d3_cellOver(dispatcher, d, this); })\n .on(\"mouseout.legend\", function (d) { d3_cellOut(dispatcher, d, this); })\n .on(\"click.legend\", function (d) { d3_cellClick(dispatcher, d, this); });\n },\n\n d3_title: (svg, title, classPrefix, titleWidth) => {\n if (title !== \"\"){\n\n const titleText = svg.selectAll('text.' + classPrefix + 'legendTitle');\n\n titleText.data([title])\n .enter()\n .append('text')\n .attr('class', classPrefix + 'legendTitle');\n\n svg.selectAll('text.' + classPrefix + 'legendTitle')\n .text(title)\n\n if (titleWidth){\n svg.selectAll('text.' + classPrefix + 'legendTitle')\n .call(d3_textWrapping, titleWidth)\n }\n\n const cellsSvg = svg.select('.' + classPrefix + 'legendCells')\n const yOffset = svg.select('.' + classPrefix + 'legendTitle').nodes()\n .map(d => d.getBBox().height)[0],\n\n xOffset = -cellsSvg.nodes().map(function(d) { return d.getBBox().x})[0];\n cellsSvg.attr('transform', 'translate(' + xOffset + ',' + (yOffset) + ')');\n\n }\n },\n\n d3_defaultLocale: {\n format,\n formatPrefix\n },\n\n d3_defaultFormatSpecifier: '.01f',\n\n d3_defaultDelimiter: 'to'\n}\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\";\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 console.log(\"Legend onDblClick method\");\n console.log(\"rowData: \" + rowData);\n console.log(\"rowIdx: \" + rowIdx);\n }\n\n onMouseOver(rowData, rowIdx) {\n console.log(\"Legend onMouseOver method\");\n console.log(\"rowData: \" + rowData);\n console.log(\"rowIdx: \" + 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 helper from \"./legend\"\nimport { dispatch } from \"d3-dispatch\"\nimport { scaleLinear } from \"d3-scale\"\nimport { formatLocale, formatSpecifier } from \"d3-format\"\n\nimport { sum } from \"d3-array\"\n\nexport default function color() {\n let scale = scaleLinear(),\n shape = \"rect\",\n shapeWidth = 15,\n shapeHeight = 15,\n shapeRadius = 10,\n shapePadding = 2,\n cells = [5],\n cellFilter,\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,\n orient = \"vertical\",\n ascending = false,\n path,\n titleWidth,\n legendDispatcher = dispatch(\"cellover\", \"cellout\", \"cellclick\")\n\n function legend(svg) {\n const type = helper.d3_calcType(\n scale,\n ascending,\n cells,\n labels,\n locale.format(specifier),\n labelDelimiter\n ),\n legendG = svg.selectAll(\"g\").data([scale])\n\n legendG\n .enter()\n .append(\"g\")\n .attr(\"class\", classPrefix + \"legendCells\")\n\n if (cellFilter) {\n helper.d3_filterCells(type, cellFilter)\n }\n\n let cell = svg\n .select(\".\" + classPrefix + \"legendCells\")\n .selectAll(\".\" + classPrefix + \"cell\")\n .data(type.data)\n\n const cellEnter = cell\n .enter()\n .append(\"g\")\n .attr(\"class\", classPrefix + \"cell\")\n cellEnter.append(shape).attr(\"class\", classPrefix + \"swatch\")\n\n let shapes = svg\n .selectAll(\n \"g.\" + classPrefix + \"cell \" + shape + \".\" + classPrefix + \"swatch\"\n )\n .data(type.data)\n\n //add event handlers\n helper.d3_addEvents(cellEnter, legendDispatcher)\n\n cell\n .exit()\n .transition()\n .style(\"opacity\", 0)\n .remove()\n shapes\n .exit()\n .transition()\n .style(\"opacity\", 0)\n .remove()\n\n shapes = shapes.merge(shapes)\n\n helper.d3_drawShapes(\n shape,\n shapes,\n shapeHeight,\n shapeWidth,\n shapeRadius,\n path\n )\n const text = helper.d3_addText(\n svg,\n cellEnter,\n type.labels,\n classPrefix,\n labelWrap\n )\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 const textSize = text.nodes().map(d => d.getBBox()),\n shapeSize = shapes.nodes().map(d => d.getBBox())\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\", d => `${classPrefix}swatch ${type.feature(d)}`)\n }\n\n let cellTrans,\n textTrans,\n textAlign = labelAlign == \"start\" ? 0 : labelAlign == \"middle\" ? 0.5 : 1\n\n //positions cells and text\n if (orient === \"vertical\") {\n const cellSize = textSize.map((d, i) =>\n Math.max(d.height, shapeSize[i].height)\n )\n\n cellTrans = (d, i) => {\n const height = sum(cellSize.slice(0, i))\n return `translate(0, ${height + i * shapePadding})`\n }\n\n textTrans = (d, i) =>\n `translate( ${shapeSize[i].width +\n shapeSize[i].x +\n labelOffset}, ${shapeSize[i].y + shapeSize[i].height / 2 + 5})`\n } else if (orient === \"horizontal\") {\n cellTrans = (d, i) =>\n `translate(${i * (shapeSize[i].width + shapePadding)},0)`\n textTrans = (d, i) => `translate(${shapeSize[i].width * textAlign +\n shapeSize[i].x},\n ${shapeSize[i].height + shapeSize[i].y + labelOffset + 8})`\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 (\n _ == \"rect\" ||\n _ == \"circle\" ||\n _ == \"line\" ||\n (_ == \"path\" && typeof d === \"string\")\n ) {\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 const value = legendDispatcher.on.apply(legendDispatcher, arguments)\n return value === legendDispatcher ? legend : value\n }\n\n return legend\n}\n","import { HTMLWidget, ISize, Widget } from \"@hpcc-js/common\";\n\nimport \"../src/Modal.css\";\n\nexport class Modal extends HTMLWidget {\n\n protected _widget: Widget;\n\n protected _relativeTarget: HTMLElement;\n\n protected _fade;\n protected _modal;\n protected _modalHeader;\n protected _modalBody;\n protected _modalHeaderAnnotations;\n protected _modalHeaderCloseButton;\n _close: () => void;\n\n constructor() {\n super();\n this._tag = \"div\";\n }\n\n closeModal() {\n this.visible(false);\n }\n\n getRelativeTarget() {\n let relativeTarget;\n if (this.relativeTargetId()) {\n relativeTarget = document.getElementById(this.relativeTargetId());\n if (relativeTarget) {\n return relativeTarget;\n }\n }\n if (!relativeTarget) {\n relativeTarget = this.locateAncestor(\"layout_Grid\");\n if (relativeTarget && relativeTarget.element) {\n return relativeTarget.element().node();\n }\n }\n return document.body;\n }\n\n setModalSize(): ISize {\n if (this.fixedHeight() !== null && this.fixedWidth() !== null) {\n this._modal\n .style(\"height\", this.fixedHeight())\n .style(\"width\", this.fixedWidth())\n .style(\"min-height\", null)\n .style(\"min-width\", null)\n .style(\"max-height\", null)\n .style(\"max-width\", null)\n ;\n } else if (this.minHeight() || this.minWidth()) {\n this._modal\n .style(\"min-height\", this.minHeight())\n .style(\"min-width\", this.minWidth())\n .style(\"max-height\", this.maxHeight())\n .style(\"max-width\", this.maxWidth())\n ;\n }\n const modalRect = this._modal.node().getBoundingClientRect();\n const headerRect = this._modalHeader.node().getBoundingClientRect();\n this._modalBody\n .style(\"height\", (modalRect.height - headerRect.height) + \"px\")\n .style(\"width\", modalRect.width);\n\n return modalRect;\n }\n\n setFadePosition(rect) {\n this._fade\n .style(\"top\", rect.top + \"px\")\n .style(\"left\", rect.left + \"px\")\n .style(\"width\", rect.width + \"px\")\n .style(\"height\", rect.height + \"px\")\n ;\n }\n\n setModalPosition(rect) {\n const modalRect = this.setModalSize();\n if (this.fixedTop() !== null && this.fixedLeft() !== null) {\n this._modal\n .style(\"top\", `calc(${this.fixedTop()} + ${rect.top}px)`)\n .style(\"left\", `calc(${this.fixedLeft()} + ${rect.left}px)`)\n ;\n } else if (this.fixedHeight() !== null && this.fixedWidth() !== null) {\n this._modal\n .style(\"top\", (rect.top + (rect.height / 2) - (modalRect.height / 2)) + \"px\")\n .style(\"left\", (rect.left + (rect.width / 2) - (modalRect.width / 2)) + \"px\")\n ;\n } else if (this.minHeight() || this.minWidth()) {\n const contentRect = this._modal.node().getBoundingClientRect();\n this._modal\n .style(\"top\", (rect.top + (rect.height / 2) - (contentRect.height / 2)) + \"px\")\n .style(\"left\", (rect.left + (rect.width / 2) - (contentRect.width / 2)) + \"px\")\n ;\n }\n }\n\n resize(size?: any): this {\n super.resize();\n if (this._modal) this.setModalSize();\n return this;\n }\n\n resizeBodySync(width: number, height: number): this {\n const header = this._modalHeader.node();\n const headerRect = header.getBoundingClientRect();\n\n this._modal\n .style(\"width\", width + \"px\")\n .style(\"height\", (height + headerRect.height) + \"px\")\n .style(\"min-width\", width + \"px\")\n .style(\"min-height\", (height + headerRect.height) + \"px\")\n ;\n this._modalHeader\n .style(\"width\", width + \"px\")\n ;\n this._modalBody\n .style(\"width\", width + \"px\")\n .style(\"height\", height + \"px\")\n ;\n return this\n .minWidth(width + \"px\")\n .minHeight((height + headerRect.height) + \"px\")\n .resize({\n height: height + headerRect.height,\n width\n })\n ;\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this._fade = element.append(\"div\")\n .classed(\"layout_Modal-fade\", true)\n .classed(\"layout_Modal-fadeClickable\", this.enableClickFadeToClose())\n .classed(\"layout_Modal-fade-hidden\", !this.showFade())\n ;\n const header_h = this.titleFontSize() * 2;\n this._modal = element.append(\"div\")\n .classed(\"layout_Modal-content\", true)\n ;\n this._modalHeader = this._modal.append(\"div\")\n .classed(\"layout_Modal-header\", true)\n .style(\"color\", this.titleFontColor())\n .style(\"font-size\", this.titleFontSize() + \"px\")\n .style(\"height\", header_h + \"px\")\n ;\n this._modalBody = this._modal.append(\"div\")\n .classed(\"layout_Modal-body\", true)\n .style(\"height\", `calc( 100% - ${header_h}px )`)\n .style(\"overflow-x\", this.overflowX())\n .style(\"overflow-y\", this.overflowY())\n ;\n this._modalHeader.append(\"div\")\n .classed(\"layout_Modal-title\", true)\n .style(\"line-height\", this.titleFontSize() + \"px\")\n .style(\"top\", (this.titleFontSize() / 2) + \"px\")\n .style(\"left\", (this.titleFontSize() / 2) + \"px\")\n .text(this.formattedTitle())\n ;\n\n this._modalHeaderAnnotations = this._modalHeader.append(\"div\")\n .classed(\"layout_Modal-annotations\", true)\n ;\n this._modalHeaderCloseButton = this._modalHeaderAnnotations.append(\"div\")\n .classed(\"layout_Modal-closeButton\", true)\n .html(\"<i class=\\\"fa fa-close\\\"></i>\")\n ;\n\n this._modalHeaderAnnotations\n .style(\"line-height\", this.titleFontSize() + \"px\")\n .style(\"right\", (this.titleFontSize() / 2) + \"px\")\n .style(\"top\", (this.titleFontSize() / 2) + \"px\")\n ;\n this._modalHeaderCloseButton.on(\"click\", () => {\n this.closeModal();\n });\n this._fade.on(\"click\", n => {\n if (this.enableClickFadeToClose()) {\n this.closeModal();\n }\n });\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n element.style(\"display\", this.show() ? null : \"none\");\n this._fade.classed(\"layout_Modal-fade-hidden\", !this.showFade());\n this._relativeTarget = this.getRelativeTarget();\n\n this.setModalSize();\n const rect = this._relativeTarget.getBoundingClientRect();\n this.setFadePosition(rect);\n this.setModalPosition(rect);\n\n if (this.show()) {\n if (!this._widget.target()) {\n this._widget.target(this._modalBody.node());\n }\n this._widget.resize().render();\n } else {\n this._widget\n .target(null)\n .render()\n ;\n }\n }\n\n exit(domNode, element) {\n if (this._widget) {\n this._widget.target(null);\n }\n super.exit(domNode, element);\n }\n\n formattedTitle() {\n const title = this.title_exists() ? this.title().trim() : \"\";\n if (title.length > 0 && title.slice(0, 1) === \"(\" && title.slice(-1) === \")\") {\n return title.slice(1, -1);\n }\n return this.title();\n }\n}\nModal.prototype._class += \" layout_Modal\";\n\nexport interface Modal {\n show(): boolean;\n show(_: boolean): this;\n showFade(): boolean;\n showFade(_: boolean): this;\n enableClickFadeToClose(): boolean;\n enableClickFadeToClose(_: boolean): this;\n title(): string;\n title(_: string): this;\n title_exists(): boolean;\n titleFontSize(): number;\n titleFontSize(_: number): this;\n titleFontColor(): string;\n titleFontColor(_: string): this;\n minWidth(): string;\n minWidth(_: string): this;\n minHeight(): string;\n minHeight(_: string): this;\n maxWidth(): string;\n maxWidth(_: string): this;\n maxHeight(): string;\n maxHeight(_: string): this;\n fixedWidth(): string;\n fixedWidth(_: string): this;\n fixedHeight(): string;\n fixedHeight(_: string): this;\n fixedTop(): string;\n fixedTop(_: string): this;\n fixedLeft(): string;\n fixedLeft(_: string): this;\n relativeTargetId(): string;\n relativeTargetId(_: string): this;\n widget(): Widget;\n widget(_: Widget): this;\n overflowX(): \"hidden\" | \"scroll\";\n overflowX(_: \"hidden\" | \"scroll\"): this;\n overflowY(): \"hidden\" | \"scroll\";\n overflowY(_: \"hidden\" | \"scroll\"): this;\n}\n\nModal.prototype.publish(\"title\", null, \"string\", \"title\");\nModal.prototype.publish(\"widget\", null, \"widget\", \"widget\");\nModal.prototype.publish(\"titleFontSize\", 18, \"number\", \"titleFontSize (in pixels)\");\nModal.prototype.publish(\"titleFontColor\", \"#ffffff\", \"html-color\", \"titleFontColor\");\nModal.prototype.publish(\"relativeTargetId\", null, \"string\", \"relativeTargetId\");\n\nModal.prototype.publish(\"show\", true, \"boolean\", \"show\");\nModal.prototype.publish(\"showFade\", true, \"boolean\", \"showFade\");\nModal.prototype.publish(\"enableClickFadeToClose\", true, \"boolean\", \"enableClickFadeToClose\");\n\nModal.prototype.publish(\"minWidth\", \"400px\", \"string\", \"minWidth\");\nModal.prototype.publish(\"minHeight\", \"400px\", \"string\", \"minHeight\");\nModal.prototype.publish(\"maxWidth\", \"800px\", \"string\", \"maxWidth\");\nModal.prototype.publish(\"maxHeight\", \"800px\", \"string\", \"maxHeight\");\nModal.prototype.publish(\"fixedWidth\", null, \"string\", \"fixedWidth\");\nModal.prototype.publish(\"fixedHeight\", null, \"string\", \"fixedHeight\");\nModal.prototype.publish(\"fixedTop\", null, \"string\", \"fixedTop\");\nModal.prototype.publish(\"fixedLeft\", null, \"string\", \"fixedLeft\");\nModal.prototype.publish(\"overflowX\", \"hidden\", \"string\", \"overflowX\");\nModal.prototype.publish(\"overflowY\", \"scroll\", \"string\", \"overflowY\");\n","import { IHighlight } from \"@hpcc-js/api\";\nimport { Button, Database, IconBar, ProgressBar, Spacer, SVGWidget, Text, TitleBar, ToggleButton, Utility, Widget } from \"@hpcc-js/common\";\nimport { Table } from \"@hpcc-js/dgrid\";\nimport { select as d3Select } from \"d3-selection\";\nimport { Border2 } from \"./Border2\";\nimport { Carousel } from \"./Carousel\";\nimport { Legend } from \"./Legend\";\nimport { Modal } from \"./Modal\";\n\nimport \"../src/ChartPanel.css\";\n\nexport class ChartPanel 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: Widget;\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._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);\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 {\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(): Widget;\n widget(_: Widget): 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\";\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\";\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 console.log(\"widgetPosition\", widgetPosition);\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\n surfacePadding: { (): number; (_: string): Layered; };\n widgets: { (): any[]; (_: any[]): Layered; };\n}\nLayered.prototype._class += \" layout_Layered\";\n\nLayered.prototype.publish(\"surfacePadding\", 0, \"number\", \"Padding\");\nLayered.prototype.publish(\"widgets\", [], \"widgetArray\", \"widgets\", null, { tags: [\"Private\"] });\n","import { HTMLWidget } 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 console.log(\"Clicked: \" + obj.id);\n }\n\n popupState: { (): boolean; (_: boolean): Popup; };\n shrinkWrap: { (): boolean; (_: boolean): Popup; };\n centerPopup: { (): string; (_: string): Popup; };\n top: { (): number; (_: number): Popup; };\n bottom: { (): number; (_: number): Popup; };\n left: { (): number; (_: number): Popup; };\n right: { (): number; (_: number): Popup; };\n position: { (): string; (_: string): Popup; };\n\n widget: { (): any; (_: any): Popup; };\n}\nPopup.prototype._class += \" layout_Popup\";\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 } from \"@hpcc-js/common\";\nimport { select as d3Select } from \"d3-selection\";\nimport { Surface } from \"./Surface\";\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\n showTabs: { (): boolean; (_: boolean): Tabbed; };\n surfacePadding: { (): number; (_: number): Tabbed; };\n surfacePadding_default: { (): number; (_: number): Tabbed; };\n surfacePadding_exists: () => boolean;\n activeTabIdx: { (): number; (_: number): Tabbed; };\n\n labels: { (): string[]; (_: string[]): Tabbed; };\n tabLocation: { (): string; (_: string): Tabbed; };\n widgets: { (): any[]; (_: any[]): Tabbed; };\n}\nTabbed.prototype._class += \" layout_Tabbed\";\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 } from \"@hpcc-js/common\";\nimport { select as d3Select } from \"d3-selection\";\n\nimport \"../src/Toolbar.css\";\n\nfunction Toolbar() {\n HTMLWidget.call(this);\n\n this._tag = \"div\";\n}\nToolbar.prototype = Object.create(HTMLWidget.prototype);\nToolbar.prototype.constructor = Toolbar;\nToolbar.prototype._class += \" layout_Toolbar\";\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\nToolbar.prototype.enter = function (domNode, element) {\n HTMLWidget.prototype.enter.apply(this, arguments);\n};\n\nToolbar.prototype.update = function (domNode, element) {\n HTMLWidget.prototype.update.apply(this, arguments);\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\nToolbar.prototype.render = function (callback) {\n const context = this;\n HTMLWidget.prototype.render.call(this, 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\nToolbar.prototype.exit = function (domNode, element) {\n HTMLWidget.prototype.exit.apply(this, arguments);\n this.widgets().forEach(function (w) {\n w.target(null);\n });\n};\n\nexport {\n Toolbar\n};\n","import { FlexGrid } from \"./FlexGrid\";\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","export const PKG_NAME = \"@hpcc-js/layout\";\r\nexport const PKG_VERSION = \"2.46.0\";\r\nexport const BUILD_VERSION = \"2.101.0\";\r\n"]}
1
+ {"version":3,"sources":["../../../node_modules/tslib/tslib.es6.js","../../../node_modules/style-inject/dist/style-inject.es.js","../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/src/legend.js","../src/Legend.ts","../../../node_modules/d3-svg-legend/src/color.js","../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","../src/__package__.ts"],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","__extends","TypeError","String","__","this","constructor","create","__assign","assign","t","s","i","n","arguments","length","apply","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","__generator","body","f","y","g","_","label","sent","trys","ops","verb","throw","return","Symbol","iterator","v","op","pop","push","__spreadArray","to","from","pack","ar","l","slice","concat","styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","AbsoluteSurface","_this","_super","_tag","enter","domNode","element","update","xPos","yPos","width","clientWidth","height","clientHeight","units","widgetX","widgetY","widgetWidth","Number","widgetHeight","opacity","widgets","selectAll","_id","data","widget","append","attr","each","target","merge","resize","exit","remove","HTMLWidget","_class","publish","tags","Accordion","_isClosed","pushListItem","prepend","protect","contentArr","content","_protected","unshift","clearListItems","arr","collapseClick","classed","context","defaultCollapsed","titleSpan","iconDiv","ul","icon","FAChar","size","node","on","render","text","title","rows","li","_target","wSize","cSize","text_colorFill","titleFontColor","char","closedIcon","openIcon","Surface","_surfaceButtons","widgetSize","titleDiv","widgetDiv","calcHeight","calcFrameHeight","calcFrameWidth","element2","surfaceShadow","surfaceBorderWidth_exists","surfaceBorderWidth","surfaceBorderColor","surfaceBorderRadius_exists","surfaceBorderRadius","surfaceBackgroundColor","titles","insert","surfaceTitleAlignment","surfaceTitleFontColor","surfaceTitleFontSize_exists","surfaceTitleFontSize","surfaceTitleFontFamily","surfaceTitleFontBold","surfaceTitleBackgroundColor","surfaceTitlePadding_exists","surfaceTitlePadding","altText_exists","altText","surfaceButtons","select","buttonAnnotations","button","idx","el","d3Select","class","id","padding","font","click","_d","parentElement","classID","split","surfacePadding_exists","surfacePadding","obj","console","log","optional","disable","w","Cell","_indicateTheseIds","indicateTheseIds","onMouseEnter","onMouseLeave","indicatorOpacity","indicatorBorderColor","indicatorGlowColor","otherElement","otherWidget","datum","d3SelectAll","Border","lazyPostUpdate","Utility","debounce","postUpdate","_colCount","_rowCount","_colSize","_rowSize","_shrinkWrapBoxes","sectionTypes","watchWidget","undefined","_watch","context_1","monitor","paramId","newVal","oldVal","applyLayoutType","layoutObj","borderLayoutObject","forEach","cell","_fixedLeft","left","_fixedTop","top","_fixedWidth","_fixedHeight","_dragHandles","cellSpecificDragHandles","sectionType","layoutType","topSize","topPerc","bottomSize","bottomPerc","leftSize","leftPerc","rightSize","rightPerc","retObj","bcRect","getBoundingClientRect","gridRect","bottom","right","SVGElement","parseFloat","getAttribute","indexOf","topPercentage","gutter","bottomPercentage","leftPercentage","rightPercentage","_sectionPlacementObject","px","%","r","c","clearContent","splice","contentWidget","hasContent","setContent","getCell","getContent","setLayoutOffsets","_offsetX","_element","_offsetY","dragStart","handle","event","d3Event","sourceEvent","stopPropagation","_dragCell","_dragCellStartSize","handleElm","_handleTop","_handleLeft","_dragPrevX","clientX","_dragPrevY","clientY","dragTick","xDelta","yDelta","_moveHandles","handle2","delta","handles","grabbedHandle","_cellSizes","topHeight","leftHeight","bottomHeight","rightHeight","rightWidth","leftWidth","handle3","dragEnd","event_1","getBBox","retVal","contentDiv","_size","_scrollBarWidth","Platform","getScrollbarWidth","_borderHandles","_sectionTypeArr","designMode","rowsUpdate","drag","d3Drag","_placeholderElement","getCellSizes","contentRect","rect","prevBox","currBox","lazyRender","WidgetDiv","div","_overlay","_overflowX","_overflowY","_div","overlay","overflowX","overflowY","_widget","availableHeight","availableWidth","renderPromise","visible","x","Border2","topElement","_bodyElement","centerElement","leftElement","rightElement","bottomElement","_topWA","_centerWA","_leftWA","_rightWA","_bottomWA","showTop","showRight","showBottom","showLeft","topOverflowX","rightOverflowX","bottomOverflowX","leftOverflowX","topOverflowY","rightOverflowY","bottomOverflowY","leftOverflowY","targetNull","center","swap","sectionA","sectionB","a","callback","topOverlay","topBBox","bottomBBox","_a","leftBBox","rightBBox","bottomHeight_exists","bodyWidth","bodyHeight","centerOverflowX","centerOverflowY","scrollCenterX","scrollCenterY","promises","all","Carousel","_prevActive","activeWidget","active","_root","widgetElements","transition","duration","transitionDuration","isDOMHidden","aw","w2","pi","Math","PI","tau","tauEpsilon","Path","_x0","_y0","_x1","_y1","path","constant","moveTo","closePath","lineTo","quadraticCurveTo","x1","y1","bezierCurveTo","x2","y2","arcTo","x0","y0","x21","y21","x01","y01","l01_2","Error","abs","x20","y20","l21_2","l20_2","l21","sqrt","l01","tan","acos","t01","t21","arc","a0","a1","ccw","dx","cos","dy","sin","cw","da","h","toString","d3SymbolCircle","draw","d3SymbolCross","tan30","tan30_2","d3SymbolDiamond","kr","kx","ky","d3SymbolStar","d3SymbolSquare","sqrt3","d3SymbolTriangle","k","d3SymbolWye","d3Symbol","circle","symbol","buffer","d3_identity","d3_reverse","mirror","d3_textWrapping","word","words","reverse","line","tspan","join","getComputedTextLength","helper","shape","shapes","shapeHeight","shapeWidth","shapeRadius","svg","labels","classPrefix","labelWidth","scale","ascending","cells","labelFormat","labelDelimiter","invertExtent","range","map","invert","d3_quantLegend","ticks","domain","increment","d3_linearLegend","d3_ordinalLegend","gen","_typeof","customLabels","genLength","d3_mergeLabels","cellFilter","filterCells","filter","dataValues","labelValues","orient","cellTrans","textTrans","labelAlign","dispatcher","cellDispatcher","titleWidth","cellsSvg","yOffset","nodes","xOffset","Legend","owner","_disabled","_symbolTypeMap","cross","diamond","square","star","triangle","wye","_owner","_drawStartPos","_legendOrdinal","scaleLinear","shapePadding","useClass","locale","d3_defaultLocale","specifier","d3_defaultFormatSpecifier","labelOffset","d3_defaultDelimiter","labelWrap","legendDispatcher","dispatch","legend","d3_calcType","format","d3_filterCells","cellEnter","d3_addEvents","d3_drawShapes","d3_addText","textSize","shapeSize","feature","cellSize","textAlign","max","sum","d3_placement","d3_title","formatLocale","formatSpecifier","toLowerCase","textWrap","d3LegendColor","onClick","onOver","onOut","isDisabled","Database","Field","filteredFields","dataFamily","fields","filteredColumns","columns","filteredData","row","disabledCols_1","anyDisabled_1","col","disabled","isRainbow","getWidget","_palette","targetWidget","_targetWidget","_targetWidgetMonitor","key","newProp","oldProp","source","chart","getPalette","Palette","ordinal","rainbow","getPaletteType","fillColorFunc","fillColor","paletteID","name","switch","sel","palette","_g","calcMetaData","dataArr","total","maxLabelWidth","colLength","columns_1","fillColor_1","val_1","reduce","acc","showSeriesTotal","d3Format","rainbowFormat","steps","rainbowBins","weightMin","_dataMinWeight","weightMax","_dataMaxWeight","stepWeightDiff","mid","floor","parseInt","radius","radiusToSymbolSize","itemPadding","orientation","d3ScaleOrdinal","symbolType","labelMaxWidth","updateDisabled","legendCellsBbox","offsetX","offsetY","_containerSize","pos","legendTotal","showLegendTotal","totalText","totalOffsetX","totalOffsetY","enableOverflowScroll","enableOverflow","_boundingBox","_parentRelativeDiv","circleSize","pow","disabledIdx","refreshColumns","refreshData","instanceOfIHighlight","highlightColumn","onDblClick","rowData","rowIdx","onMouseOver","fitToContent","bbox","SVGWidget","Modal","closeModal","getRelativeTarget","relativeTarget","relativeTargetId","getElementById","locateAncestor","setModalSize","fixedHeight","fixedWidth","_modal","minHeight","minWidth","maxHeight","maxWidth","modalRect","headerRect","_modalHeader","_modalBody","setFadePosition","_fade","setModalPosition","fixedTop","fixedLeft","resizeBodySync","enableClickFadeToClose","showFade","header_h","titleFontSize","formattedTitle","_modalHeaderAnnotations","_modalHeaderCloseButton","html","show","_relativeTarget","title_exists","trim","ChartPanel","_legend","_progressBar","ProgressBar","_autoScale","_resolutions","tiny","small","_toggleInfo","ToggleButton","faChar","tooltip","selected","description","Text","origCloseFunc_1","_close","_toggleData","dataVisible","_buttonDownload","Button","downloadCSV","_buttonDownloadImage","downloadPNG","_toggleLegend","legendPosition","legendVisible","_spacer","Spacer","_titleBar","TitleBar","buttons","_carousel","_table","Table","_hideLegendToggleList","refreshFields","asDefault","highlight","_highlight","startProgress","start","finishProgress","finish","namePrefix","downloadTitle","nameSuffix","downloadTimestampSuffix","timestamp","downloadString","export","column","cssTag_1","cssTag","getResponsiveMode","enableAutoscaling","setOrigSize","_orig_size","JSON","parse","stringify","preUpdateTiny","preUpdateSmall","scale_x","scale_y","_scale","min","x_is_smaller","preUpdateRegular","preUpdate","_prevLegendPosition","_prevdataVisible","_prevlegendVisible","_dataFamily","_prevChartDataFamily","highlightSize","highlightColor","_prevChart","widgetIconBar","IconBar","_prevButtons","hiddenButtons","dataButtonVisible","downloadButtonVisible","downloadImageButtonVisible","legendButtonVisible","enabled","titleVisible","titleOverlay","postUpdateTiny","postUpdateSmall","postUpdateRegular","titleIconFontSize","_node","containerRect","icon_top","parentRect","_prevPos","dblclick","vertex_click","more","vertex","vertex_dblclick","edge_click","edge","edge_dblclick","publishReset","publishProxy","tmpAny","FlexGrid","parentNode","cachedSizes","updateFlexParent","listItems","itemMinHeight","itemMinWidth","flexBasis","widgetsFlexBasis","flexGrow","widgetsFlexGrow","borderWidth","itemBorderColor","display","flexWrap","alignItems","alignContent","forceXScroll","disableScroll","forceYScroll","module","exports","GridList","items","options","_options","defaults","_adjustSizeOfItems","generateGrid","cloneItems","_items","lanes","direction","item","j","widthOfGrid","grid","output","border","_padNumber","_resetGrid","_markItemPositionToGrid","resizeGrid","currentColumn","_sortItemsByPosition","position","_getItemPosition","_updateItemPosition","findPositionForItem","_pullItemsToLeft","fixedRow","_itemFitsAtPosition","newCol","newRow","moveItemToPosition","newPosition","_resolveCollisions","resizeItem","_updateItemSize","getChangedItems","initialItems","idAttribute","changedItems","_getItemByAttribute","sort","item1","item2","position1","position2","bind","autoSize","_deleteItemPositionFromGrid","_setItemPosition","_ensureColumns","N","GridCol","_getItemsCollidingWithItem","collidingItems","_itemsAreColliding","_tryToResolveCollisionsLocally","leftOfItem","rightOfItem","aboveOfItem","belowOfItem","_gridList","collidingItem","collidingPosition","fixedItem","fixedPosition","_findLeftMostPositionForItem","tail","otherItem","otherPosition","nr","prefix","factory","_GridList","_GridList.default","Grid","_selectionBag","Selection","getDimensions","gridCol","gridColSpan","gridRow","gridRowSpan","rowSpan","colSpan","sortedContent","some","getWidgetCell","cellToGridItem","gridItemToCell","resetItemsPos","origItems","origItem","itemsMap","initGridList","gridList","snapping","snappingRows","snappingColumns","killGridList","_d3Drag","subject","cellWidth","cellHeight","dragItem","selectionBagClick","updateGrid","_d3DragResize","dragItemPos","round","_noRender","divItems","surfaceShadow_default","surfacePadding_default","surfaceBorderWidth_default","surfaceBackgroundColor_default","fitTo","dimensions","cellLaneRatio","laneWidth","__grid_watch","_renderCount","lanesBackground","selectionBagClear","showLanes","_createSelectionObject","selection","set","get","isEmpty","clear","postSelectionChange","selectionObj","ctrlKey","isSelected","applyLayout","layoutArr","vizActivation","elem","HorizontalList","orientation_default","flexWrap_default","Layered","_widgetPlacements","_widgetRatios","addLayer","placement","widthRatio","heightRatio","_contentContainer","clientSize","widgetPosition","order","Popup","updateState","popupState","_originalPosition","shrinkWrap","centerPopup","window","innerWidth","innerHeight","Tabbed","clearTabs","addTab","isActive","activeTabIdx","surface","tcBox","_tabContainer","tabs","showTabs","tabLocation","offsetHeight","Toolbar","backgroundColor","fontSize_exists","fontSize","fontColor_exists","fontColor","fontFamily_exists","fontFamily","fontBold_exists","fontBold","backgroundColor_exists","childWidgets","widgetClass","widgetClasses","toolbarBBox","minX","childBBox","VerticalList"],"mappings":"mZAgBIA,EAAgB,SAASC,EAAGC,GAI5B,OAHAF,EAAgBG,OAAOC,gBAClB,CAAEC,UAAW,cAAgBC,OAAS,SAAUL,EAAGC,GAAKD,EAAEI,UAAYH,IACvE,SAAUD,EAAGC,GAAK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,OAAOJ,KAAK,SAAUlH,GAC/BA,EAAEmH,OAAO,QACVI,SACHw6B,EAAajC,SAGjBsB,GAAQ7gC,UAAU4I,OAAS,SAAUyP,GACjC,IAAMnQ,EAAU3H,KAChB0G,EAAAA,WAAWjH,UAAU4I,OAAO1I,KAAKK,KAAM,SAAUsM,GAC7C,IAAM80B,EAAcz5B,EAAQ7C,UAAUqD,OAAO4H,wBACzCsxB,EAAOD,EAAYxyB,KAAOwyB,EAAYl8B,MAC1CyC,EAAQ7C,UAAUgB,UAAU,qBACvBM,KAAK,SAAUlH,EAAGqB,GACf,IAAM+gC,EAAYthC,KAAK+P,wBACnBsxB,EAAOC,EAAU1yB,OACjByyB,EAAOC,EAAU1yB,QAG7BjH,EAAQ7C,UAAUkG,OAAO,kBACpBjH,MAAM,QAAUs9B,EAAOD,EAAYxyB,KAAO,EAAK,MAEhDkJ,GACAA,EAASxL,MAKrBg0B,GAAQ7gC,UAAU+G,KAAO,SAAU3B,EAASC,GACxC4B,EAAAA,WAAWjH,UAAU+G,KAAK7F,MAAMX,KAAMS,WACtCT,KAAK6F,UAAU4I,QAAQ,SAAUnC,GAC7BA,EAAEjG,OAAO,4BC5Fb,SAAAk7B,IAAA,IAAA98B,EACIC,EAAA/E,KAAAK,OAAOA,YACPyE,EAAK25B,oBAAoB,YACzB35B,EAAK45B,iBAAiB,YAE9B,OANkCz+B,EAAA2hC,EAAA78B,GAMlC68B,GANkCtN,GAOlCsN,GAAa9hC,UAAUkH,QAAU,yECPJ,8JAFL,gCACG","sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || from);\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\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\n units: { (): string; (_: string): AbsoluteSurface; };\n widgetX: { (): number; (_: number): AbsoluteSurface; };\n widgetY: { (): number; (_: number): AbsoluteSurface; };\n widgetWidth: { (): string; (_: string): AbsoluteSurface; };\n widgetHeight: { (): string; (_: string): AbsoluteSurface; };\n widget: { (): any; (_: any): AbsoluteSurface; };\n opacity: { (): number; (_: number): AbsoluteSurface; };\n}\nAbsoluteSurface.prototype._class += \" layout_AbsoluteSurface\";\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\n content: { (): any[]; (_: any[]): Accordion; };\n title: { (): string; (_: string): Accordion; };\n openIcon: { (): string; (_: string): Accordion; };\n closedIcon: { (): string; (_: string): Accordion; };\n titleFontColor: { (): string; (_: string): Accordion; };\n titleBackgroundColor: { (): any; (_: any): Accordion; };\n defaultCollapsed: { (): boolean; (_: boolean): Accordion; };\n}\nAccordion.prototype._class += \" layout_Accordion\";\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 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 // Events ---\n click(obj) {\n console.log(\"Clicked: \" + obj.id);\n }\n}\nSurface.prototype._class += \" layout_Surface\";\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\";\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\n title: { (): string; (_: string): Cell; };\n widget: { (): Widget; (_: Widget): Cell; };\n\n gridRow: { (): number; (_: number): Cell; };\n gridCol: { (): number; (_: number): Cell; };\n gridRowSpan: { (): number; (_: number): Cell; };\n gridColSpan: { (): number; (_: number): Cell; };\n\n indicatorGlowColor: { (): string; (_: string): Cell; };\n indicatorBorderColor: { (): string; (_: string): Cell; };\n indicatorOpacity: { (): number; (_: number): Cell; };\n\n}\nCell.prototype._class += \" layout_Cell\";\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\";\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\n designMode: { (): boolean; (_: boolean): Border; };\n\n content: { (): any[]; (_: any[]): Border; };\n\n gutter: { (): number; (_: number): Border; };\n\n topShrinkWrap: { (): boolean; (_: boolean): Border; };\n leftShrinkWrap: { (): boolean; (_: boolean): Border; };\n rightShrinkWrap: { (): boolean; (_: boolean): Border; };\n bottomShrinkWrap: { (): boolean; (_: boolean): Border; };\n\n topSize: { (): number; (_: number): Border; };\n leftSize: { (): number; (_: number): Border; };\n rightSize: { (): number; (_: number): Border; };\n bottomSize: { (): number; (_: number): Border; };\n\n topPercentage: { (): number; (_: number): Border; };\n leftPercentage: { (): number; (_: number): Border; };\n rightPercentage: { (): number; (_: number): Border; };\n bottomPercentage: { (): number; (_: number): Border; };\n\n surfacePadding: { (): number; (_: number): Border; };\n\n sectionTypes: { (): any[]; (_: any[]): Border; };\n}\nBorder.prototype._class += \" layout_Border\";\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, formatPrefix } from 'd3-format'\n\nconst d3_identity = (d) => d\n\nconst d3_reverse = (arr) => {\n const mirror = [];\n for (let 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\nconst 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, //ems\n y = text.attr(\"y\"),\n dy = parseFloat(text.attr(\"dy\")) || 0,\n tspan = text.text(null)\n .append(\"tspan\")\n .attr(\"x\", 0)\n .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\")\n .attr(\"x\", 0)\n .attr(\"dy\", lineHeight + dy + \"em\").text(word);\n }\n }\n });\n}\n\n\nconst d3_mergeLabels = (gen=[], labels, domain, range) => {\n\n if (typeof labels === \"object\"){\n if(labels.length === 0) return gen;\n\n let 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 const customLabels = []\n const genLength = gen.length\n for (let i=0; i < genLength; i++){\n customLabels.push(labels({\n i,\n genLength,\n generatedLabels : gen,\n domain,\n range }))\n }\n return customLabels\n }\n\n return gen;\n }\n\nconst d3_linearLegend = (scale, cells, labelFormat) => {\n let data = [];\n\n if (cells.length > 1){\n data = cells;\n\n } else {\n const domain = scale.domain(),\n increment = (domain[domain.length - 1] - domain[0])/(cells - 1)\n let i = 0;\n\n for (; i < cells; i++){\n data.push(domain[0] + i*increment);\n }\n }\n\n const labels = data.map(labelFormat);\n return {data: data,\n labels: labels,\n feature: d => scale(d)};\n}\n\nconst d3_quantLegend = (scale, labelFormat, labelDelimiter) => {\n const labels = scale.range().map( d => {\n const invert = scale.invertExtent(d);\n return labelFormat(invert[0]) + \" \" + labelDelimiter + \" \" + labelFormat(invert[1]);\n });\n\n return {data: scale.range(),\n labels: labels,\n feature: d3_identity\n };\n}\n\nconst d3_ordinalLegend= scale => ({data: scale.domain(),\n labels: scale.domain(),\n feature: d => scale(d) }\n)\n\nconst d3_cellOver = (cellDispatcher, d, obj) => {\n cellDispatcher.call(\"cellover\", obj, d);\n}\n\nconst d3_cellOut = (cellDispatcher, d, obj) => {\n cellDispatcher.call(\"cellout\", obj, d);\n}\n\nconst d3_cellClick = (cellDispatcher, d, obj) => {\n cellDispatcher.call(\"cellclick\", obj, d);\n}\n\n\nexport default {\n\n d3_drawShapes: (shape, shapes, shapeHeight, shapeWidth, shapeRadius, path) => {\n if (shape === \"rect\"){\n shapes.attr(\"height\", shapeHeight)\n .attr(\"width\", shapeWidth);\n\n } else if (shape === \"circle\") {\n shapes.attr(\"r\", shapeRadius)\n\n } else if (shape === \"line\") {\n shapes.attr(\"x1\", 0).attr(\"x2\", shapeWidth).attr(\"y1\", 0).attr(\"y2\", 0);\n\n } else if (shape === \"path\") {\n shapes.attr(\"d\", path);\n }\n },\n\n d3_addText: function (svg, enter, labels, classPrefix, labelWidth){\n enter.append(\"text\").attr(\"class\", classPrefix + \"label\");\n const text = svg.selectAll(`g.${classPrefix}cell text.${classPrefix}label`)\n .data(labels)\n .text(d3_identity);\n\n if (labelWidth){\n svg.selectAll(`g.${classPrefix}cell text.${classPrefix}label`)\n .call(d3_textWrapping, labelWidth)\n }\n\n return text\n },\n\n d3_calcType: function (scale, ascending, cells, labels, labelFormat, labelDelimiter){\n const type = scale.invertExtent ?\n d3_quantLegend(scale, labelFormat, labelDelimiter) : scale.ticks ?\n d3_linearLegend(scale, cells, labelFormat) : d3_ordinalLegend(scale);\n\n //for d3.scaleSequential that doesn't have a range function\n const range = scale.range && scale.range() || scale.domain()\n type.labels = d3_mergeLabels(type.labels, labels, scale.domain(), range);\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: (type, cellFilter) => {\n let filterCells = type.data.map((d, i) => ({ data: d, label: type.labels[i] }))\n .filter(cellFilter)\n const dataValues = filterCells.map(d => d.data)\n const labelValues = filterCells.map(d => d.label)\n type.data = type.data.filter(d => dataValues.indexOf(d) !== -1)\n type.labels = type.labels.filter(d => labelValues.indexOf(d) !== -1)\n return type\n },\n\n 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(cells, dispatcher){\n cells.on(\"mouseover.legend\", function (d) { d3_cellOver(dispatcher, d, this); })\n .on(\"mouseout.legend\", function (d) { d3_cellOut(dispatcher, d, this); })\n .on(\"click.legend\", function (d) { d3_cellClick(dispatcher, d, this); });\n },\n\n d3_title: (svg, title, classPrefix, titleWidth) => {\n if (title !== \"\"){\n\n const titleText = svg.selectAll('text.' + classPrefix + 'legendTitle');\n\n titleText.data([title])\n .enter()\n .append('text')\n .attr('class', classPrefix + 'legendTitle');\n\n svg.selectAll('text.' + classPrefix + 'legendTitle')\n .text(title)\n\n if (titleWidth){\n svg.selectAll('text.' + classPrefix + 'legendTitle')\n .call(d3_textWrapping, titleWidth)\n }\n\n const cellsSvg = svg.select('.' + classPrefix + 'legendCells')\n const yOffset = svg.select('.' + classPrefix + 'legendTitle').nodes()\n .map(d => d.getBBox().height)[0],\n\n xOffset = -cellsSvg.nodes().map(function(d) { return d.getBBox().x})[0];\n cellsSvg.attr('transform', 'translate(' + xOffset + ',' + (yOffset) + ')');\n\n }\n },\n\n d3_defaultLocale: {\n format,\n formatPrefix\n },\n\n d3_defaultFormatSpecifier: '.01f',\n\n d3_defaultDelimiter: 'to'\n}\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\";\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 console.log(\"Legend onDblClick method\");\n console.log(\"rowData: \" + rowData);\n console.log(\"rowIdx: \" + rowIdx);\n }\n\n onMouseOver(rowData, rowIdx) {\n console.log(\"Legend onMouseOver method\");\n console.log(\"rowData: \" + rowData);\n console.log(\"rowIdx: \" + 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 helper from \"./legend\"\nimport { dispatch } from \"d3-dispatch\"\nimport { scaleLinear } from \"d3-scale\"\nimport { formatLocale, formatSpecifier } from \"d3-format\"\n\nimport { sum } from \"d3-array\"\n\nexport default function color() {\n let scale = scaleLinear(),\n shape = \"rect\",\n shapeWidth = 15,\n shapeHeight = 15,\n shapeRadius = 10,\n shapePadding = 2,\n cells = [5],\n cellFilter,\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,\n orient = \"vertical\",\n ascending = false,\n path,\n titleWidth,\n legendDispatcher = dispatch(\"cellover\", \"cellout\", \"cellclick\")\n\n function legend(svg) {\n const type = helper.d3_calcType(\n scale,\n ascending,\n cells,\n labels,\n locale.format(specifier),\n labelDelimiter\n ),\n legendG = svg.selectAll(\"g\").data([scale])\n\n legendG\n .enter()\n .append(\"g\")\n .attr(\"class\", classPrefix + \"legendCells\")\n\n if (cellFilter) {\n helper.d3_filterCells(type, cellFilter)\n }\n\n let cell = svg\n .select(\".\" + classPrefix + \"legendCells\")\n .selectAll(\".\" + classPrefix + \"cell\")\n .data(type.data)\n\n const cellEnter = cell\n .enter()\n .append(\"g\")\n .attr(\"class\", classPrefix + \"cell\")\n cellEnter.append(shape).attr(\"class\", classPrefix + \"swatch\")\n\n let shapes = svg\n .selectAll(\n \"g.\" + classPrefix + \"cell \" + shape + \".\" + classPrefix + \"swatch\"\n )\n .data(type.data)\n\n //add event handlers\n helper.d3_addEvents(cellEnter, legendDispatcher)\n\n cell\n .exit()\n .transition()\n .style(\"opacity\", 0)\n .remove()\n shapes\n .exit()\n .transition()\n .style(\"opacity\", 0)\n .remove()\n\n shapes = shapes.merge(shapes)\n\n helper.d3_drawShapes(\n shape,\n shapes,\n shapeHeight,\n shapeWidth,\n shapeRadius,\n path\n )\n const text = helper.d3_addText(\n svg,\n cellEnter,\n type.labels,\n classPrefix,\n labelWrap\n )\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 const textSize = text.nodes().map(d => d.getBBox()),\n shapeSize = shapes.nodes().map(d => d.getBBox())\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\", d => `${classPrefix}swatch ${type.feature(d)}`)\n }\n\n let cellTrans,\n textTrans,\n textAlign = labelAlign == \"start\" ? 0 : labelAlign == \"middle\" ? 0.5 : 1\n\n //positions cells and text\n if (orient === \"vertical\") {\n const cellSize = textSize.map((d, i) =>\n Math.max(d.height, shapeSize[i].height)\n )\n\n cellTrans = (d, i) => {\n const height = sum(cellSize.slice(0, i))\n return `translate(0, ${height + i * shapePadding})`\n }\n\n textTrans = (d, i) =>\n `translate( ${shapeSize[i].width +\n shapeSize[i].x +\n labelOffset}, ${shapeSize[i].y + shapeSize[i].height / 2 + 5})`\n } else if (orient === \"horizontal\") {\n cellTrans = (d, i) =>\n `translate(${i * (shapeSize[i].width + shapePadding)},0)`\n textTrans = (d, i) => `translate(${shapeSize[i].width * textAlign +\n shapeSize[i].x},\n ${shapeSize[i].height + shapeSize[i].y + labelOffset + 8})`\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 (\n _ == \"rect\" ||\n _ == \"circle\" ||\n _ == \"line\" ||\n (_ == \"path\" && typeof d === \"string\")\n ) {\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 const value = legendDispatcher.on.apply(legendDispatcher, arguments)\n return value === legendDispatcher ? legend : value\n }\n\n return legend\n}\n","import { HTMLWidget, ISize, Widget } from \"@hpcc-js/common\";\n\nimport \"../src/Modal.css\";\n\nexport class Modal extends HTMLWidget {\n\n protected _widget: Widget;\n\n protected _relativeTarget: HTMLElement;\n\n protected _fade;\n protected _modal;\n protected _modalHeader;\n protected _modalBody;\n protected _modalHeaderAnnotations;\n protected _modalHeaderCloseButton;\n _close: () => void;\n\n constructor() {\n super();\n this._tag = \"div\";\n }\n\n closeModal() {\n this.visible(false);\n }\n\n getRelativeTarget() {\n let relativeTarget;\n if (this.relativeTargetId()) {\n relativeTarget = document.getElementById(this.relativeTargetId());\n if (relativeTarget) {\n return relativeTarget;\n }\n }\n if (!relativeTarget) {\n relativeTarget = this.locateAncestor(\"layout_Grid\");\n if (relativeTarget && relativeTarget.element) {\n return relativeTarget.element().node();\n }\n }\n return document.body;\n }\n\n setModalSize(): ISize {\n if (this.fixedHeight() !== null && this.fixedWidth() !== null) {\n this._modal\n .style(\"height\", this.fixedHeight())\n .style(\"width\", this.fixedWidth())\n .style(\"min-height\", null)\n .style(\"min-width\", null)\n .style(\"max-height\", null)\n .style(\"max-width\", null)\n ;\n } else if (this.minHeight() || this.minWidth()) {\n this._modal\n .style(\"min-height\", this.minHeight())\n .style(\"min-width\", this.minWidth())\n .style(\"max-height\", this.maxHeight())\n .style(\"max-width\", this.maxWidth())\n ;\n }\n const modalRect = this._modal.node().getBoundingClientRect();\n const headerRect = this._modalHeader.node().getBoundingClientRect();\n this._modalBody\n .style(\"height\", (modalRect.height - headerRect.height) + \"px\")\n .style(\"width\", modalRect.width);\n\n return modalRect;\n }\n\n setFadePosition(rect) {\n this._fade\n .style(\"top\", rect.top + \"px\")\n .style(\"left\", rect.left + \"px\")\n .style(\"width\", rect.width + \"px\")\n .style(\"height\", rect.height + \"px\")\n ;\n }\n\n setModalPosition(rect) {\n const modalRect = this.setModalSize();\n if (this.fixedTop() !== null && this.fixedLeft() !== null) {\n this._modal\n .style(\"top\", `calc(${this.fixedTop()} + ${rect.top}px)`)\n .style(\"left\", `calc(${this.fixedLeft()} + ${rect.left}px)`)\n ;\n } else if (this.fixedHeight() !== null && this.fixedWidth() !== null) {\n this._modal\n .style(\"top\", (rect.top + (rect.height / 2) - (modalRect.height / 2)) + \"px\")\n .style(\"left\", (rect.left + (rect.width / 2) - (modalRect.width / 2)) + \"px\")\n ;\n } else if (this.minHeight() || this.minWidth()) {\n const contentRect = this._modal.node().getBoundingClientRect();\n this._modal\n .style(\"top\", (rect.top + (rect.height / 2) - (contentRect.height / 2)) + \"px\")\n .style(\"left\", (rect.left + (rect.width / 2) - (contentRect.width / 2)) + \"px\")\n ;\n }\n }\n\n resize(size?: any): this {\n super.resize();\n if (this._modal) this.setModalSize();\n return this;\n }\n\n resizeBodySync(width: number, height: number): this {\n const header = this._modalHeader.node();\n const headerRect = header.getBoundingClientRect();\n\n this._modal\n .style(\"width\", width + \"px\")\n .style(\"height\", (height + headerRect.height) + \"px\")\n .style(\"min-width\", width + \"px\")\n .style(\"min-height\", (height + headerRect.height) + \"px\")\n ;\n this._modalHeader\n .style(\"width\", width + \"px\")\n ;\n this._modalBody\n .style(\"width\", width + \"px\")\n .style(\"height\", height + \"px\")\n ;\n return this\n .minWidth(width + \"px\")\n .minHeight((height + headerRect.height) + \"px\")\n .resize({\n height: height + headerRect.height,\n width\n })\n ;\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this._fade = element.append(\"div\")\n .classed(\"layout_Modal-fade\", true)\n .classed(\"layout_Modal-fadeClickable\", this.enableClickFadeToClose())\n .classed(\"layout_Modal-fade-hidden\", !this.showFade())\n ;\n const header_h = this.titleFontSize() * 2;\n this._modal = element.append(\"div\")\n .classed(\"layout_Modal-content\", true)\n ;\n this._modalHeader = this._modal.append(\"div\")\n .classed(\"layout_Modal-header\", true)\n .style(\"color\", this.titleFontColor())\n .style(\"font-size\", this.titleFontSize() + \"px\")\n .style(\"height\", header_h + \"px\")\n ;\n this._modalBody = this._modal.append(\"div\")\n .classed(\"layout_Modal-body\", true)\n .style(\"height\", `calc( 100% - ${header_h}px )`)\n .style(\"overflow-x\", this.overflowX())\n .style(\"overflow-y\", this.overflowY())\n ;\n this._modalHeader.append(\"div\")\n .classed(\"layout_Modal-title\", true)\n .style(\"line-height\", this.titleFontSize() + \"px\")\n .style(\"top\", (this.titleFontSize() / 2) + \"px\")\n .style(\"left\", (this.titleFontSize() / 2) + \"px\")\n .text(this.formattedTitle())\n ;\n\n this._modalHeaderAnnotations = this._modalHeader.append(\"div\")\n .classed(\"layout_Modal-annotations\", true)\n ;\n this._modalHeaderCloseButton = this._modalHeaderAnnotations.append(\"div\")\n .classed(\"layout_Modal-closeButton\", true)\n .html(\"<i class=\\\"fa fa-close\\\"></i>\")\n ;\n\n this._modalHeaderAnnotations\n .style(\"line-height\", this.titleFontSize() + \"px\")\n .style(\"right\", (this.titleFontSize() / 2) + \"px\")\n .style(\"top\", (this.titleFontSize() / 2) + \"px\")\n ;\n this._modalHeaderCloseButton.on(\"click\", () => {\n this.closeModal();\n });\n this._fade.on(\"click\", n => {\n if (this.enableClickFadeToClose()) {\n this.closeModal();\n }\n });\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n element.style(\"display\", this.show() ? null : \"none\");\n this._fade.classed(\"layout_Modal-fade-hidden\", !this.showFade());\n this._relativeTarget = this.getRelativeTarget();\n\n this.setModalSize();\n const rect = this._relativeTarget.getBoundingClientRect();\n this.setFadePosition(rect);\n this.setModalPosition(rect);\n\n if (this.show()) {\n if (!this._widget.target()) {\n this._widget.target(this._modalBody.node());\n }\n this._widget.resize().render();\n } else {\n this._widget\n .target(null)\n .render()\n ;\n }\n }\n\n exit(domNode, element) {\n if (this._widget) {\n this._widget.target(null);\n }\n super.exit(domNode, element);\n }\n\n formattedTitle() {\n const title = this.title_exists() ? this.title().trim() : \"\";\n if (title.length > 0 && title.slice(0, 1) === \"(\" && title.slice(-1) === \")\") {\n return title.slice(1, -1);\n }\n return this.title();\n }\n}\nModal.prototype._class += \" layout_Modal\";\n\nexport interface Modal {\n show(): boolean;\n show(_: boolean): this;\n showFade(): boolean;\n showFade(_: boolean): this;\n enableClickFadeToClose(): boolean;\n enableClickFadeToClose(_: boolean): this;\n title(): string;\n title(_: string): this;\n title_exists(): boolean;\n titleFontSize(): number;\n titleFontSize(_: number): this;\n titleFontColor(): string;\n titleFontColor(_: string): this;\n minWidth(): string;\n minWidth(_: string): this;\n minHeight(): string;\n minHeight(_: string): this;\n maxWidth(): string;\n maxWidth(_: string): this;\n maxHeight(): string;\n maxHeight(_: string): this;\n fixedWidth(): string;\n fixedWidth(_: string): this;\n fixedHeight(): string;\n fixedHeight(_: string): this;\n fixedTop(): string;\n fixedTop(_: string): this;\n fixedLeft(): string;\n fixedLeft(_: string): this;\n relativeTargetId(): string;\n relativeTargetId(_: string): this;\n widget(): Widget;\n widget(_: Widget): this;\n overflowX(): \"hidden\" | \"scroll\";\n overflowX(_: \"hidden\" | \"scroll\"): this;\n overflowY(): \"hidden\" | \"scroll\";\n overflowY(_: \"hidden\" | \"scroll\"): this;\n}\n\nModal.prototype.publish(\"title\", null, \"string\", \"title\");\nModal.prototype.publish(\"widget\", null, \"widget\", \"widget\");\nModal.prototype.publish(\"titleFontSize\", 18, \"number\", \"titleFontSize (in pixels)\");\nModal.prototype.publish(\"titleFontColor\", \"#ffffff\", \"html-color\", \"titleFontColor\");\nModal.prototype.publish(\"relativeTargetId\", null, \"string\", \"relativeTargetId\");\n\nModal.prototype.publish(\"show\", true, \"boolean\", \"show\");\nModal.prototype.publish(\"showFade\", true, \"boolean\", \"showFade\");\nModal.prototype.publish(\"enableClickFadeToClose\", true, \"boolean\", \"enableClickFadeToClose\");\n\nModal.prototype.publish(\"minWidth\", \"400px\", \"string\", \"minWidth\");\nModal.prototype.publish(\"minHeight\", \"400px\", \"string\", \"minHeight\");\nModal.prototype.publish(\"maxWidth\", \"800px\", \"string\", \"maxWidth\");\nModal.prototype.publish(\"maxHeight\", \"800px\", \"string\", \"maxHeight\");\nModal.prototype.publish(\"fixedWidth\", null, \"string\", \"fixedWidth\");\nModal.prototype.publish(\"fixedHeight\", null, \"string\", \"fixedHeight\");\nModal.prototype.publish(\"fixedTop\", null, \"string\", \"fixedTop\");\nModal.prototype.publish(\"fixedLeft\", null, \"string\", \"fixedLeft\");\nModal.prototype.publish(\"overflowX\", \"hidden\", \"string\", \"overflowX\");\nModal.prototype.publish(\"overflowY\", \"scroll\", \"string\", \"overflowY\");\n","import { IHighlight } from \"@hpcc-js/api\";\nimport { Button, Database, IconBar, ProgressBar, Spacer, SVGWidget, Text, TitleBar, ToggleButton, Utility, Widget } from \"@hpcc-js/common\";\nimport { Table } from \"@hpcc-js/dgrid\";\nimport { select as d3Select } from \"d3-selection\";\nimport { Border2 } from \"./Border2\";\nimport { Carousel } from \"./Carousel\";\nimport { Legend } from \"./Legend\";\nimport { Modal } from \"./Modal\";\n\nimport \"../src/ChartPanel.css\";\n\nexport class ChartPanel 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: Widget;\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._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);\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 {\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(): Widget;\n widget(_: Widget): 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\";\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\";\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 console.log(\"widgetPosition\", widgetPosition);\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\n surfacePadding: { (): number; (_: string): Layered; };\n widgets: { (): any[]; (_: any[]): Layered; };\n}\nLayered.prototype._class += \" layout_Layered\";\n\nLayered.prototype.publish(\"surfacePadding\", 0, \"number\", \"Padding\");\nLayered.prototype.publish(\"widgets\", [], \"widgetArray\", \"widgets\", null, { tags: [\"Private\"] });\n","import { HTMLWidget } 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 console.log(\"Clicked: \" + obj.id);\n }\n\n popupState: { (): boolean; (_: boolean): Popup; };\n shrinkWrap: { (): boolean; (_: boolean): Popup; };\n centerPopup: { (): string; (_: string): Popup; };\n top: { (): number; (_: number): Popup; };\n bottom: { (): number; (_: number): Popup; };\n left: { (): number; (_: number): Popup; };\n right: { (): number; (_: number): Popup; };\n position: { (): string; (_: string): Popup; };\n\n widget: { (): any; (_: any): Popup; };\n}\nPopup.prototype._class += \" layout_Popup\";\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 } from \"@hpcc-js/common\";\nimport { select as d3Select } from \"d3-selection\";\nimport { Surface } from \"./Surface\";\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\n showTabs: { (): boolean; (_: boolean): Tabbed; };\n surfacePadding: { (): number; (_: number): Tabbed; };\n surfacePadding_default: { (): number; (_: number): Tabbed; };\n surfacePadding_exists: () => boolean;\n activeTabIdx: { (): number; (_: number): Tabbed; };\n\n labels: { (): string[]; (_: string[]): Tabbed; };\n tabLocation: { (): string; (_: string): Tabbed; };\n widgets: { (): any[]; (_: any[]): Tabbed; };\n}\nTabbed.prototype._class += \" layout_Tabbed\";\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 } from \"@hpcc-js/common\";\nimport { select as d3Select } from \"d3-selection\";\n\nimport \"../src/Toolbar.css\";\n\nfunction Toolbar() {\n HTMLWidget.call(this);\n\n this._tag = \"div\";\n}\nToolbar.prototype = Object.create(HTMLWidget.prototype);\nToolbar.prototype.constructor = Toolbar;\nToolbar.prototype._class += \" layout_Toolbar\";\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\nToolbar.prototype.enter = function (domNode, element) {\n HTMLWidget.prototype.enter.apply(this, arguments);\n};\n\nToolbar.prototype.update = function (domNode, element) {\n HTMLWidget.prototype.update.apply(this, arguments);\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\nToolbar.prototype.render = function (callback) {\n const context = this;\n HTMLWidget.prototype.render.call(this, 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\nToolbar.prototype.exit = function (domNode, element) {\n HTMLWidget.prototype.exit.apply(this, arguments);\n this.widgets().forEach(function (w) {\n w.target(null);\n });\n};\n\nexport {\n Toolbar\n};\n","import { FlexGrid } from \"./FlexGrid\";\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","export const PKG_NAME = \"@hpcc-js/layout\";\r\nexport const PKG_VERSION = \"2.46.1\";\r\nexport const BUILD_VERSION = \"2.101.2\";\r\n"]}