From 2b247d181bfa0f2d7093970bb56964d311ffa1e8 Mon Sep 17 00:00:00 2001 From: ElenaPochernina Date: Thu, 6 Apr 2017 10:52:26 +0300 Subject: [PATCH] Release 0.2.4 --- dist/Table.js | 5 + dist/angara.tablejs.css | 452 ++++++++++ dist/angara.tablejs.d.ts | 142 +++ dist/angara.tablejs.js | 1497 ++++++++++++++++++++++++++++++++ dist/angara.tablejs.min.js | 2 + dist/angara.tablejs.min.js.map | 1 + dist/img/back.png | Bin 0 -> 248 bytes dist/img/forward.png | Bin 0 -> 256 bytes dist/img/round_off.png | Bin 0 -> 1629 bytes dist/img/round_on.png | Bin 0 -> 1635 bytes 10 files changed, 2099 insertions(+) create mode 100644 dist/Table.js create mode 100644 dist/angara.tablejs.css create mode 100644 dist/angara.tablejs.d.ts create mode 100644 dist/angara.tablejs.js create mode 100644 dist/angara.tablejs.min.js create mode 100644 dist/angara.tablejs.min.js.map create mode 100644 dist/img/back.png create mode 100644 dist/img/forward.png create mode 100644 dist/img/round_off.png create mode 100644 dist/img/round_on.png diff --git a/dist/Table.js b/dist/Table.js new file mode 100644 index 0000000..35cc0d3 --- /dev/null +++ b/dist/Table.js @@ -0,0 +1,5 @@ +define(["jquery", "angara.tablejs", "exports"], function ($, TableViewer, exports) { + exports.Show = function (tableSource, container) { + TableViewer.show(container, tableSource); + }; +}); diff --git a/dist/angara.tablejs.css b/dist/angara.tablejs.css new file mode 100644 index 0000000..653c378 --- /dev/null +++ b/dist/angara.tablejs.css @@ -0,0 +1,452 @@ +.tableviewer_container { + height: 90%; + height: calc(100% - 45px); + overflow: auto; + width: 100%; +} + +.summary-numeric { + display: none; + background-color: transparent; +} + +.summary-nonnumeric { + display: none; + background-color: transparent; +} + +.content-chart { + height: 120px; + z-index: 0; +} + +.titleCommand { + margin-right: 10px; + margin-left: 20px; + color: black; + font-weight: normal; + cursor: pointer; +} + + .titleCommand:hover { + color: black; + } + +.titleCommand-on { + margin-right: 10px; + margin-left: 20px; + color: black; + font-weight: bold; + cursor: pointer; +} + +.notImportantText { + color: gray; +} + +table.dataTable { + width: auto; + margin: 0; +} + +.dataTables_wrapper { + display: inline-block; +} + +.dataTables_length { + margin-bottom: 10px; + float: left; +} + +.table-correlationView { +} + + .table-correlationView .figure { + min-width: 600px; + height: 600px; + float: left; + margin-right: 20px; + margin-bottom: 20px; + } + + .table-correlationView .legend { + margin-top: 20px; + margin-bottom: 20px; + } + + .table-correlationView .highlighted { + font-weight: bold; + } + + .table-correlationView .error { + color: red; + } + + .table-correlationView .hint { + font-style: italic; + color: gray; + } + + .table-correlationView .horz-axis-item-container { + width: 100px; + height: 20px; + text-align: left; + transform: rotate(-90deg); + transform-origin: 50% 50%; + overflow: hidden; + text-overflow: ellipsis; + margin-bottom: 38px; + } + + .table-correlationView .horz-axis-item { + width: 100%; + font-size: 10pt; + background-color: white; + } + + .table-correlationView .vert-axis-item { + width: 70px; + font-size: 10pt; + text-overflow: ellipsis; + background-color: white; + } + +.table-tableView { + margin: 20px; + height: 95%; + height: calc(100% - 85px); + width: 95%; + width: calc(100% - 40px); +} + +.table-tileView { +} + +.table-tileView-panel { + clear: both; +} + + .table-tileView-panel ul { + padding-left: 0pt; + } + + .table-tileView-panel ul li { + display: inline-block; + list-style-type: none; + vertical-align: top; + } + +.table-tile { + overflow: hidden; + margin: 5px 5px 5px 5px; + padding: 5px 5px 5px 5px; + width: 290px; + height: 190px; + border: 1px solid #727272; + cursor: default; +} + + .table-tile:hover { + /*background-color: #F1F9FF;*/ + border-color: black; + } + + .table-tile .header { + overflow: hidden; + height: 31px; + position: relative; + /*border: 1px solid red;*/ + } + + .table-tile .header .name { + position: absolute; + left: 0; + top: 0; + width: 200px; + height: 31px; + text-align: start; + -ms-text-overflow: clip; + -o-text-overflow: clip; + text-overflow: clip; + overflow-x: hidden; + font-size: 24px; + /*border: 1px solid red;*/ + } + + .table-tile .header .rightContainer { + position: absolute; + right: 0px; + top: 0px; + height: 31px; + text-align: start; + background-color: white; + font-size: 10pt; + } + + .table-tile .header .rightContainer .type { + text-align: right; + /*border: 1px solid red;*/ + } + + .table-tile .content-summary { + margin-top: 3px; + display: block; + overflow: hidden; + width: 280px; + font-size: 10pt; + -moz-column-count: 1; + -webkit-column-count: 1; + column-count: 1; + z-index: 1; + /*border: 1px solid red;*/ + } + + .table-tile .chart { + display: block; + overflow: hidden; + margin-top: 0px; + width: 280px; + height: 130px; + /*border: 1px solid red;*/ + } + + .table-tile .boxplot { + width: 280px; + height: 25px; + /*border: 1px solid red;*/ + } + + +.auto_format_on +{ + background: url('img/round_on.png') no-repeat top left; +} +.auto_format_off +{ + background: url('img/round_off.png') no-repeat top left; +} + +.round_btn { + margin-left: 10px; + padding-top: 3px; + width: 20px; + height: 20px; + vertical-align: central; + float: left; +} + +.headerExponent { + display: inline; + margin-left: 5px; +} + +/* + * Table + */ +table.dataTable { + clear: both; + /*width: 100%;*/ + margin-bottom: 10px; +} + + table.dataTable thead th { + background-color: #365C95; + color: white; + text-align: center; + padding: 3px 28px 3px 20px; + border-bottom: 1px solid black; + font-weight: bold; + cursor: pointer; + *cursor: hand; + } + + table.dataTable tfoot th { + padding: 3px 28px 3px 20px; + border-top: 1px solid black; + font-weight: bold; + } + + table.dataTable td { + padding: 3px 28px 3px 20px; + } + + table.dataTable td.center, + table.dataTable td.dataTables_empty { + text-align: center; + } + + table.dataTable tr.odd { + background-color: #F1F9FF; + } + + table.dataTable tr.even { + background-color: white; + } + + table.dataTable tr td.active { + animation-duration: 2s; + animation-name: showActive; + } + +@keyframes showActive { + from { + background: none; + } + + 30% { + background: #ECFFB3; + } + + to { + background: none; + } +} + +table.dataTable tr:hover, +table.dataTable tr td.highlighted { + background-color: #ECFFB3; +} + + +table.dataTable tr.odd td.sorting_1 { + background-color: #E0F2FF; +} + +table.dataTable tr.odd td.sorting_2 { + background-color: #F1F9FF; +} + +table.dataTable tr.odd td.sorting_3 { + background-color: #E0E2FF; +} + +table.dataTable tr.even td.sorting_1 { + background-color: #F4FAFF; +} + +table.dataTable tr.even td.sorting_2 { + background-color: #F2F3FF; +} + +table.dataTable tr.even td.sorting_3 { + background-color: #F9F9FF; +} +/* + * Table information + */ +.dataTables_info { + clear: both; + float: left; + margin-right: 10px; +} +/* + * Processing indicator + */ +.dataTables_processing { + position: absolute; + top: 50%; + left: 50%; + width: 250px; + height: 30px; + margin-left: -125px; + margin-top: -15px; + padding: 14px 0 2px 0; + border: 1px solid #ddd; + text-align: center; + color: #999; + font-size: 14px; + background-color: white; +} + +/* + * Pagination + */ +.dataTables_paginate { + float: right; + text-align: right; +} + +/* Two button pagination - previous / next */ +.paginate_disabled_previous, +.paginate_enabled_previous, +.paginate_disabled_next, +.paginate_enabled_next { + height: 19px; + float: left; + cursor: pointer; + *cursor: hand; + color: #111 !important; +} +.paginate_disabled_previous:hover, +.paginate_enabled_previous:hover, +.paginate_disabled_next:hover, +.paginate_enabled_next:hover { + text-decoration: none !important; +} +.paginate_disabled_previous:active, +.paginate_enabled_previous:active, +.paginate_disabled_next:active, +.paginate_enabled_next:active { + outline: none; +} + +.paginate_disabled_previous, +.paginate_disabled_next { + color: #666 !important; +} +.paginate_disabled_previous, +.paginate_enabled_previous { + padding-left: 18px; + margin-left: 5px; +} +.paginate_disabled_next, +.paginate_enabled_next { + padding-right: 18px; + margin-left: 10px; +} + +.paginate_enabled_previous { background: url('img/back.png') no-repeat top left; opacity: 0.8 } +.paginate_enabled_previous:hover { background: url('img/back.png') no-repeat top left; opacity: 1.0 } +.paginate_disabled_previous { background: url('img/back.png') no-repeat top left; opacity: 0.3 } + +.paginate_enabled_next { background: url('img/forward.png') no-repeat top right; opacity: 0.8 } +.paginate_enabled_next:hover { background: url('img/forward.png') no-repeat top right; opacity: 1.0 } +.paginate_disabled_next { background: url('img/forward.png') no-repeat top right; opacity: 0.3 } + +/* Full number pagination */ +.paging_full_numbers { + height: 22px; + line-height: 22px; +} +.paging_full_numbers a:active { + outline: none +} +.paging_full_numbers a:hover { + text-decoration: none; +} + +.paging_full_numbers a.paginate_button, +.paging_full_numbers a.paginate_active { + border: 1px solid #aaa; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; + padding: 2px 5px; + margin: 0 3px; + cursor: pointer; + *cursor: hand; + color: #333 !important; +} + +.paging_full_numbers a.paginate_button { + background-color: #ddd; +} + +.paging_full_numbers a.paginate_button:hover { + background-color: #ccc; + text-decoration: none !important; +} + +.paging_full_numbers a.paginate_active { + background-color: #99B3FF; +} diff --git a/dist/angara.tablejs.d.ts b/dist/angara.tablejs.d.ts new file mode 100644 index 0000000..526aff3 --- /dev/null +++ b/dist/angara.tablejs.d.ts @@ -0,0 +1,142 @@ +declare module TableViewer { + type JQueryPromise = any; + + type ColumnDefinition = { + name: string; + type: string; + } + + type TableChangedEventArgs = { + /** Possible values are 'data' or 'schema'. + If 'data' each column raised onChanged event, + if 'schema' new columns were created. + */ + changeType: string; + } + + type TableChangedEventDelegate = (args: TableChangedEventArgs) => void; + + type RealColumnSummary = { + /** Column name */ + name: string; + /** Column element type */ + type: string; + /** Number of elements in the column */ + totalCount: number; + /** Number of data elements in the column (ignoring NaN) */ + count: number; + /** Maximum value of the column */ + max: number; + /** Minimum value of the column */ + min: number; + mean: number; + median: number; + variance: number; + lb68: number; + ub68: number; + lb95: number; + ub95: number; + } + + type BooleanColumnSummary = { + /** Column name */ + name: string; + /** Column element type (always "bool") */ + type: string; + /** Number of true elements */ + true: number; + /** Number of false elements */ + false: number; + } + + type ComparableColumnSummary = { + /** Column name */ + name: string; + /** Column element type ("date" or "string") */ + type: string; + /** Number of elements in the column */ + totalCount: number; + /** Number of data elements in the column (ignoring null strings) */ + count: number; + /** Maximum value of the column */ + max: number; + /** Minimum value of the column */ + min: number; + } + + type ColumnSummary = RealColumnSummary | BooleanColumnSummary | ComparableColumnSummary; + + /** Contains probability density function computed for a table column */ + type ColumnPdf = { + f: number[]; + x: number[]; + } + + /** Contains Pearson's correlations between all numeric columns of a table. */ + type Correlation = { + /** Names of columns for which the correlations are computed (in original order) */ + c: string[]; + /** Array of Arrays of Pearson's correlations. + * Each Array has correlation values of a column with same index with other columns of less index */ + r: number[][]; + } + + type TableDescription = { + /** Number of rows in the table */ + count: number; + /** Describes each column of the table */ + summary: ColumnSummary[]; + /** Contains data array for each column of the table */ + data: (number[] | Boolean[] | Date[] | String[])[]; + /** Contains probability density function (if applicable) or null (otherwise), + * for each column of the table. */ + pdf: ColumnPdf[]; + /** Contains Pearson's correlations between all numeric columns of a table. */ + correlation: Correlation; + } + + /** Represent a data source for the TableViewer control. + * It is assumed that this type instance wraps a table and metadata collection. */ + interface TableSource { + /** The callback must be called when either schema or data of the table is changed. */ + onChanged: TableChangedEventDelegate; + /** Number of rows in the table */ + totalRows: number; + /** Schema of columns */ + columns: ColumnDefinition[]; + /** Asynchronously request a part of all columns data arrays. + * Response is an array of data columns, where each data column is an array with an element type depending on the column type.*/ + getDataAsync(startRow: number, rows: number): JQueryPromise; + getSummaryAsync(columnNumber: number): JQueryPromise; + getPdfAsync(columnNumber: number): JQueryPromise; + getCorrelationAsync(): JQueryPromise; + saveAttribute(key: string, value: any); + getAttributeAsync(key: string): JQueryPromise; + /** Rejects all in-progress requests of the instance (i.e. all incomplete get###() methods) */ + cancelRequests(): void; + } + + interface TableSourceFactory { + new (tableDescription: TableDescription): TableSource; + } + + interface Viewer { + dispose(): void; + } + + interface Factory { + /** Shows the table using the given HTML element as a summary, grid and a correlation matrix. */ + show(domElement: HTMLElement, tableSource: TableSource): Viewer; + /** Shows the table columns as a collection of tiles with summary. */ + showSummary(domElement: HTMLElement, tableSource: TableSource): Viewer; + /** Shows the table as a grid of columns and rows. */ + showGrid(domElement: HTMLElement, tableSource: TableSource): Viewer; + /** Shows the table as a grid of columns and rows, and highlights one of the columns. */ + showGrid(domElement: HTMLElement, tableSource: TableSource, activeColumnName: string): Viewer; + /** Shows the table as a matrix of correlations between numeric columns. */ + showCorrelations(domElement: HTMLElement, tableSource: TableSource): Viewer; + /** Takes an object of specific schema and creates + / * a table source object that can be used to create the table viewer.*/ + TableSource: TableSourceFactory; + } +} \ No newline at end of file diff --git a/dist/angara.tablejs.js b/dist/angara.tablejs.js new file mode 100644 index 0000000..5deb39d --- /dev/null +++ b/dist/angara.tablejs.js @@ -0,0 +1,1497 @@ +(function(window, undefined) { +(function(factory) { + // Define as an AMD module if possible + if ( typeof define === 'function' && define.amd ) + { + define( ['jquery', 'idd', 'jquery.dataTables', 'css!jquery.dataTables-css', 'css!idd-css', 'css!angara.tablejs'], function($, Charting){ + var TableViewer = factory ({}, $, Charting.InteractiveDataDisplay); + return TableViewer; + }); + } + /* Define using browser globals otherwise + */ + else if ( window.jQuery && window.InteractiveDataDisplay ) + { + window.TableViewer = factory({}, window.jQuery, window.InteractiveDataDisplay ); + } +}) +(function(TableViewer, $, InteractiveDataDisplay){ // factory, returns "TableViewer" + +(function (TableViewer) { + + TableViewer.MathUtils = typeof (TableViewer.MathUtils) === 'undefined' ? {} : TableViewer.MathUtils; + + TableViewer.MathUtils.escapeHtml = function (s) { + var t = typeof s; + if (s == null || t === "number" || t === "undefined") return s; + + return s.toString().replace(/[\u00A0-\u9999<>\&]/gim, function (i) { + return '&#' + i.charCodeAt(0) + ';'; + }); + } + + TableViewer.MathUtils.power10 = function (p) { + if (p >= 0) { + var n = 1; + for (var i = 0; i < p; i++) + n *= 10; + return n; + } else { + var n = 1.0; + for (var i = 0; i < -p; i++) + n *= 0.1; + return n; + } + } + + TableViewer.MathUtils.getPrintFormat = function (min, max, std) { + var extraPrec = 2; + var posmax = Math.max(Math.abs(min), Math.abs(max)); + if (posmax === Infinity || std === Infinity || std === -Infinity || isNaN(posmax) || isNaN(std)) { + return { + toString: function (x) { + return x; + } + }; + } + var log10 = Math.LN10; + var p = posmax > 1e-12 ? Math.log(posmax) / log10 : 0; + var alpha; + if (std > 1e-12) + alpha = Math.floor(Math.log(std) / log10) - extraPrec; + else + alpha = Math.floor(p - extraPrec); + + if (alpha < 0) { // i.e. nnnnn.ffff___ + var p2 = Math.floor(p); + if (alpha <= -2 && p2 <= -4) { // 0.0000nn___ -> 0.nn x 10^-mmm + var c1 = this.power10(-p2); + return { + toString: function (x) { + return (x * c1).toFixed(-alpha + p2); + }, + + exponent: p2 + }; + } + else // nnnnn.nn__ -> nnnnn.nn + return { + toString: function (x) { + return x.toFixed(-alpha); + } + }; + } + else { // alpha >=0, i.e. nnnn___.___ + if (alpha >= 2 && p > 5) { // nnnnnn.___ -> nnnn x 10^mmm + var c1 = this.power10(-alpha - extraPrec); + return { + toString: function (x) { + return (x * c1).toFixed(extraPrec); + }, + + exponent: alpha + extraPrec + }; + } + else // alpha in [0,2), p in [alpha, 5], i.e. nnnnn.___ -> nnnnn. + return { + toString: function (x) { + var y = x.toFixed(); + if (x != y) y += "."; + return y; + } + }; + } + } +}(TableViewer)); +(function (TableViewer, InteractiveDataDisplay, $, undefined) { + TableViewer.BoxPlot = function (jqDiv, master) { + this.base = InteractiveDataDisplay.CanvasPlot; + this.base(jqDiv, master); + + var _l95, _r95, _l68, _r68, _median, _min, _max; + var _height; + var _thickness = 1; + var _stroke = 'black'; + + this.draw = function (data) { + _l95 = data.l95; + _r95 = data.r95; + _l68 = data.l68; + _r68 = data.r68; + _median = data.median; + _min = data.min; + _max = data.max; + _height = data.height; + + this.invalidateLocalBounds(); + + this.requestNextFrameOrUpdate(); + this.fireAppearanceChanged(); + }; + + // Returns a rectangle in the plot plane. + this.computeLocalBounds = function () { + return undefined; + }; + + // Returns 4 margins in the screen coordinate system + this.getLocalPadding = function () { + var padding = 0; + return { left: padding, right: padding, top: padding, bottom: padding }; + }; + + this.renderCore = function (plotRect, screenSize) { + var t = this.getTransform(); + var dataToScreenX = t.dataToScreenX; + var dataToScreenY = t.dataToScreenY; + + var context = this.getContext(true); + context.beginPath(); + context.strokeStyle = _stroke; + + // Horizontal line + var xmin_s = dataToScreenX(_min); + var xmax_s = dataToScreenX(_max); + var xl68_s = dataToScreenX(_l68); + var xl95_s = dataToScreenX(_l95); + var xr68_s = dataToScreenX(_r68); + var xr95_s = dataToScreenX(_r95); + var xmedian_x = dataToScreenX(_median); + + var yc_s = dataToScreenY(0); + var yt_s = yc_s - _height / 2; + var yb_s = yc_s + _height / 2; + + var yt2_s = yc_s - _height / 6; + var yb2_s = yc_s + _height / 6; + + var rad = 5; + + context.moveTo(xl95_s, yc_s); + context.lineTo(xl68_s, yc_s); + context.moveTo(xr95_s, yc_s); + context.lineTo(xr68_s, yc_s); + + context.moveTo(xmedian_x, yt_s); + context.lineTo(xmedian_x, yb_s); + + context.moveTo(xl95_s, yt2_s); + context.lineTo(xl95_s, yb2_s); + + context.moveTo(xr95_s, yt2_s); + context.lineTo(xr95_s, yb2_s); + context.stroke(); + + context.strokeRect(xl68_s, yt_s, xr68_s - xl68_s, _height); + + context.beginPath(); + context.arc(xmin_s, yc_s, rad, 0, 2 * Math.PI); + context.stroke(); + context.beginPath(); + context.arc(xmax_s, yc_s, rad, 0, 2 * Math.PI); + context.stroke(); + } + }; + TableViewer.BoxPlot.prototype = new InteractiveDataDisplay.CanvasPlot; + + $(document).ready(function () { + InteractiveDataDisplay.register('boxplot', function (jqDiv, master) { return new TableViewer.BoxPlot(jqDiv, master); }); + }); +}(TableViewer, InteractiveDataDisplay, $)); +(function (TableViewer, InteractiveDataDisplay, $, undefined) { + TableViewer.SelectedCellPlot = function (jqDiv, master) { + this.base = InteractiveDataDisplay.CanvasPlot; + this.base(jqDiv, master); + + var x, y, n; + + this.draw = function (data) { + this.x = data.x; + this.y = data.y; + this.n = data.n; + this.requestNextFrameOrUpdate(); + } + + this.renderCore = function (plotRect, screenSize) { + var context = this.getContext(true); + if (this.y >= 0 && this.x >= 0) { + context.strokeStyle = "black"; + + var t = this.getTransform(); + var dataToScreenX = t.dataToScreenX; + var dataToScreenY = t.dataToScreenY; + var hs1 = t.dataToScreenY(this.y); + var hs2 = t.dataToScreenY(this.y + 1); + var ws1 = t.dataToScreenX(this.x); + var ws2 = t.dataToScreenX(this.x + 1); + context.strokeRect(ws1, hs1, ws2 - ws1, hs2 - hs1); + + var n = this.n; + hs1 = t.dataToScreenY(n - this.x - 1); + hs2 = t.dataToScreenY(n - this.x); + ws1 = t.dataToScreenX(n - this.y - 1); + ws2 = t.dataToScreenX(n - this.y); + context.strokeRect(ws1, hs1, ws2 - ws1, hs2 - hs1); + } + } + }; + + TableViewer.SelectedCellPlot.prototype = new InteractiveDataDisplay.CanvasPlot; + + $(document).ready(function () { + InteractiveDataDisplay.register('selectedCell', function (jqDiv, master) { return new TableViewer.SelectedCellPlot(jqDiv, master); }); + }); +}(TableViewer, InteractiveDataDisplay, $)); +(function (TableViewer, InteractiveDataDisplay, $, undefined) { + TableViewer.PiesMarker = { + prepare : function(data) { + // y + if(data.y == undefined || data.y == null) throw "The mandatory property 'y' is undefined or null"; + if(!InteractiveDataDisplay.Utils.isArray(data.y)) throw "The property 'y' must be an array of numbers"; + var n = data.y.length; + + var mask = new Int8Array(n); + InteractiveDataDisplay.Utils.maskNaN(mask, data.y); + + // x + if(data.x == undefined || data.x == null) throw "The mandatory property 'x' is undefined or null"; + else if (!InteractiveDataDisplay.Utils.isArray(data.x)) throw "The property 'x' must be an array of numbers"; + else if (data.x.length != n) throw "Length of the array which is a value of the property 'x' differs from lenght of 'y'" + else InteractiveDataDisplay.Utils.maskNaN(mask, data.x); + + if(InteractiveDataDisplay.Utils.isArray(data.color)) { + if(data.color.length != n) throw "Length of the array 'color' is different than length of the array 'y'" + var palette = data.colorPalette; + if (palette != undefined && palette.isNormalized) { + var r = InteractiveDataDisplay.Utils.getMinMax(data.color); + r = InteractiveDataDisplay.Utils.makeNonEqual(r); + data.colorPalette = palette = palette.absolute(r.min, r.max); + } + var colors = new Array(n); + for (var i = 0; i < n; i++){ + var color = data.color[i]; + if(color != color) // NaN + mask[i] = 1; + else { + var rgba = palette.getRgba(color); + colors[i] = "rgba(" + rgba.r + "," + rgba.g + "," + rgba.b + "," + rgba.a + ")"; + } + } + data.color = colors; + } + + // Filtering out missing values + var m = 0; + for(var i = 0; i < n; i++) if(mask[i] === 1) m++; + if(m > 0){ // there are missing values + m = n - m; + data.x = InteractiveDataDisplay.Utils.applyMask(mask, data.x, m); + data.y = InteractiveDataDisplay.Utils.applyMask(mask, data.y, m); + data.color = InteractiveDataDisplay.Utils.applyMask(mask, data.color, m); + } + }, + + // marker: + // x, y is a center of a circle + // radius + // value (between -1 and 1) -> angle + // color + // colorPalette + draw: function (marker, plotRect, screenSize, transform, context) { + var xs = transform.dataToScreenX(marker.x); + var ys = transform.dataToScreenY(marker.y); + var rs = transform.dataToScreenX(marker.x + marker.radius) - xs; + var value = marker.value; + + if (value == 0 || xs + rs < 0 || xs - rs > screenSize.width || ys + rs < 0 || ys - rs > screenSize.height) + return; + + context.beginPath(); + context.strokeStyle = "gray"; + context.fillStyle = marker.color; + context.moveTo(xs, ys); + context.lineTo(xs, ys - rs); + context.arc(xs, ys, rs, -Math.PI / 2, Math.PI * (2 * value - 0.5), value < 0); + context.lineTo(xs, ys); + context.closePath(); + context.fill(); + context.stroke(); + + context.beginPath(); + context.arc(xs, ys, rs, 0, 2 * Math.PI); + context.stroke(); + }, + + hitTest: function (marker, transform, ps, pd) { + var r = marker.radius; + return (pd.x - marker.x) * (pd.x - marker.x) + (pd.y - marker.y) * (pd.y - marker.y) <= r * r; + } + }; +}(TableViewer, InteractiveDataDisplay, $)); +// TaskQueue sequentially executes asynchronous functions queued through the queue() method. +// It allows cancelling all (including running) functions through the clear() method. +// queue() returns a promise which is done when the function execution successfully completes and gets the function's result as an argument. +// is failed when the function execution fails and gets the fail reason as an argument +// or when the function execution is cancelled and gets the value returned by TaskQueue.cancelStatus() as an argument. +(function (TableViewer, $, undefined) { + TableViewer.TaskQueue = function () { + // each task is + // { + // func is a function () -> promise given by a user, + // response is a 'deferred' which allows to indicate the status + // response may fail or succeed, if it fails it contains the reason as { reason: R }, where R is 'cancelled' if the task was cancelled + // if it succeeds it contains the result of the func invocation. + // status is one of the following: waiting, running, cancelling, cancelled, completed, failed + // priority is a number, tasks with lower value are selected to run + // } + var tasks = []; + var runningTask; + var cancelStatus = 'Task is cancelled'; + + var Task = function (func) { + return { + func: func, + response: $.Deferred(), + status: 'waiting' + } + } + + var tryRunNextTask = function () { + runningTask = undefined; + if (tasks.length > 0) // running a task from the queue + { + var task = tasks.shift(); // takes first task + runTask(task); + } + } + + var onTaskCancelled = function (task) { + task.status = 'cancelled'; + task.response.reject(cancelStatus); + } + + var onTaskFailed = function (task, arg) { + if (task.status == 'running') { + task.status = 'failed'; + task.response.reject(arg); + } + else if (task.status == 'cancelling') { + onTaskCancelled(task); + } + } + + var onTaskCompleted = function (task, arg) { + if (task.status == 'running') { + task.status = 'completed'; + task.response.resolve(arg); + } + else if (task.status == 'cancelling') { + onTaskCancelled(task); + } + } + + // Gets the task, changes its state to 'running' and runs it; updates the 'runningTask' variable. + var runTask = function (task) { + task.status = 'running'; + runningTask = task; + + try { + task.func() + .done(function (arg) { // task function completed + tryRunNextTask(); + onTaskCompleted(task, arg); + }) + .fail(function (arg) { // task function failed + tryRunNextTask(); + onTaskFailed(task, arg); + }); + } catch (e) { + tryRunNextTask(); + onTaskFailed(task, e); + } + } + + return { + isRunning: function () { + return runningTask !== undefined; + }, + + taskCount: function () { + return tasks.length; + }, + + // returns a promise which indicates that the task is complete, failed or cancelled. + queue: function (func, priority) { + var task = new Task(func, priority !== undefined ? 1 : priority); + if (this.isRunning()) { + var len = tasks.length; + for (var i = 0; i < len; i++) + { + if (tasks[i].priority > task.priority) { + tasks.splice(i, 0, task); + break; + } + } + if (len == tasks.length) tasks.push(task); + } + else { + runTask(task); + } + return task.response.promise(); + }, + + clear: function () { + if (runningTask !== undefined) { + runningTask.status = 'cancelling'; + runningTask = undefined; + } + if (tasks.length > 0) { + for (var i = 0; i < tasks.length; i++) { + onTaskCancelled(tasks[i]); + } + tasks.splice(0, tasks.length); + } + }, + + // returns a constant string which is passed as an argument to task's fail() continuation when it is cancelled. + cancelStatus: function () { return cancelStatus; } + }; + } +}(TableViewer, $)); +(function (TableViewer) { + /** Takes an object of specific schema and creates + / * a table source object that can be used to create the table viewer. */ + function TableSource(tableDescription) { + var columns = []; + for(var i = 0; i < tableDescription.summary.length; i++) + columns.push({name: tableDescription.summary[i].name, type: tableDescription.summary[i].type}); + this.totalRows = tableDescription.summary && tableDescription.summary.length > 0 ? tableDescription.summary[0].totalCount : 0; + this.columns = columns; + this.summary = tableDescription.summary; + this.pdf = tableDescription.pdf; + this.dataByCols = tableDescription.data; + this.correlation = tableDescription.correlation; + this.onChanged = undefined; + this.metadata = {}; + } + TableSource.prototype.getDataAsync = function (startRow, rows) { + var p = $.Deferred(); + var slices = this.dataByCols.map(function (col) { + return Array.prototype.slice.apply(col, [startRow, startRow + rows - 1]); + }); + p.resolve(slices); + return p.promise(); + }; + TableSource.prototype.getSummaryAsync = function (columnNumber) { + var res = $.Deferred(); + res.resolve(this.summary[columnNumber]); + return res.promise(); + }; + TableSource.prototype.getPdfAsync = function (columnNumber) { + var res = $.Deferred(); + if (this.pdf && this.pdf.length > columnNumber) + res.resolve(this.pdf[columnNumber]); + else + res.reject("no data"); + return res.promise(); + }; + TableSource.prototype.getCorrelationAsync = function () { + var res = $.Deferred(); + res.resolve(this.correlation); + return res.promise(); + }; + TableSource.prototype.saveAttribute = function (key, value) { + this.metadata[key] = value; + }; + TableSource.prototype.getAttributeAsync = function (key) { + var res = $.Deferred(); + res.resolve(this.metadata[key]); + return res.promise(); + }; + TableSource.prototype.cancelRequests = function () { + }; + TableViewer.TableSource = TableSource; +})(TableViewer); + +(function (TableViewer) { + var TableColumnViewModel = (function () { + function TableColumnViewModel(number, name, type, table) { + this.number = number; + this.name = name; + this.type = type; + this.table = table; + } + TableColumnViewModel.prototype.getSummaryAsync = function () { + return this.table.getSummaryAsync(this.number); + }; + TableColumnViewModel.prototype.getPdfAsync = function () { + return this.table.getPdfAsync(this.number); + }; + return TableColumnViewModel; + })(); + var TableViewModel = (function () { + function TableViewModel(table) { + this.table = table; + this.columns = []; + var that = this; + table.onChanged = function (args) { + if (args.changeType == "schema") { + that.updateColumns(); + } + else { + that.columns.forEach(function (c) { + if (c.onChanged) c.onChanged(); + }); + } + if (that.onColumnsChanged) { + that.onColumnsChanged(args); + } + }; + this.updateColumns(); + } + TableViewModel.prototype.updateColumns = function () { + var that = this; + this.columns = this.table.columns.map(function (colDef, index) { + return new TableColumnViewModel(index, colDef.name, colDef.type, that); + }); + }; + Object.defineProperty(TableViewModel.prototype, "totalRows", { + get: function () { + return this.table.totalRows; + }, + enumerable: true, + configurable: true + }); + TableViewModel.prototype.getDataAsync = function (startRow, rows) { + return this.table.getDataAsync(startRow, rows); + }; + TableViewModel.prototype.getSummaryAsync = function (columnNumber) { + return this.table.getSummaryAsync(columnNumber); + }; + TableViewModel.prototype.getPdfAsync = function (columnNumber) { + return this.table.getPdfAsync(columnNumber); + }; + TableViewModel.prototype.getCorrelationAsync = function () { + return this.table.getCorrelationAsync(); + }; + TableViewModel.prototype.saveAttribute = function (key, value) { + this.table.saveAttribute(key, value); + }; + TableViewModel.prototype.getAttribute = function (key) { + return this.table.getAttributeAsync(key); + }; + TableViewModel.prototype.saveView = function (value) { + this.saveAttribute("$view", value); + }; + TableViewModel.prototype.getView = function () { + return this.getAttributeAsync("$view"); + }; + TableViewModel.prototype.cancelAllRequests = function () { + this.table.cancelRequests(); + }; + return TableViewModel; + })(); + TableViewer.TableViewModel = TableViewModel; +})(TableViewer); + +(function (TableViewer, $, undefined) { + var typeToText = function (typeName) { + if (typeName.indexOf("System.") == 0) + typeName = typeName.substr(7); + typeName = typeName.toLowerCase(); + if (typeName === "real") typeName = "float"; // F# notation + else if (typeName === "int32") typeName = "int"; + return typeName; + } + + TableViewer.TableTile = function(htmlElement, column /* TableColumnViewModel */) { + var element = $(htmlElement); + var chart= null; + var bandPlot= null; + var boxplot= null; + var plotsBinding= null; + + InteractiveDataDisplay.Padding = 2; + InteractiveDataDisplay.tickLength = 5; + + element + .bind('mouseenter.' + name, function () { mouseOverBox = true; }) + .bind('mouseleave.' + name, function () { mouseOverBox = false; }); + + element.html("
Name
" + + "
" + + "
" + + "
" + + "
" + + "
min/max: 
lb95/ub95: " + + "
lb68/ub68: 
mean/std: " + + "
median: 
" + + "
" + + "
"); + + var contentChart = element.find(".content-chart"); + var chart = InteractiveDataDisplay.asPlot(contentChart.find(".chart")); + + var d3Chart = chart; + var div = $("
") + .attr("data-idd-name", "bplot") + .attr("data-idd-plot", "area") + .appendTo(d3Chart.host); + var plot = new InteractiveDataDisplay.Area(div, d3Chart.master); + d3Chart.addChild(plot); + bandPlot = plot; + + boxplot = InteractiveDataDisplay.asPlot(contentChart.find(".boxplot")); + + chart.navigation.setVisibleRect({ x: 0, y: 0, width: 1, height: 1 }); + boxplot.navigation.setVisibleRect({ x: 0, y: -0.5, width: 1, height: 1 }); + + chart.navigation.gestureSource = undefined;//InteractiveDataDisplay.Gestures.getGesturesStream(chart.host); + + var _drawSummary = function (summary) { + var type = typeToText(column.type); + if(column.type == "bool") + type = type + "[" + (summary.true + summary.false) + "]"; + else + type = type + "[" + (summary.totalCount === summary.count ? summary.totalCount : summary.totalCount + "/" + summary.count + "") + "]"; + element.find(".type").html(type); + + if(column.type == "bool"){ + $(".summary-numeric", element).css("display", "none"); + $(".summary-nonnumeric", element).css("display", "block"); + + element.find(".summary-nonnumeric").html("
true:" + summary.true + "
false:" + summary.false + "
"); + if (chart.isVisible) { + boxplot.isVisible = false; + chart.isVisible = false; + contentChart.css("display", "none"); + } + } else if (typeof (summary.min) === 'undefined') { + $(".summary-numeric", element).css("display", "none"); + $(".summary-nonnumeric", element).css("display", "none"); + if (chart.isVisible) { + boxplot.isVisible = false; + chart.isVisible = false; + contentChart.css("display", "none"); + } + } else if (typeof (summary.variance) === 'undefined') { + $(".summary-numeric", element).css("display", "none"); + $(".summary-nonnumeric", element).css("display", "block"); + + if (summary.totalCount == 1) + element.find(".summary-nonnumeric").html("
" + summary.min + "
"); + else if (summary.totalCount == 2) + element.find(".summary-nonnumeric").html("
" + summary.min + "
" + summary.max + "
"); + if (summary.totalCount > 2) + element.find(".summary-nonnumeric").html("
" + summary.min + "
...
" + summary.max + "
"); + if (chart.isVisible) { + boxplot.isVisible = false; + chart.isVisible = false; + contentChart.css("display", "none"); + } + } else { + $(".summary-numeric", element).css("display", "block"); + $(".summary-nonnumeric", element).css("display", "none"); + + var std = Math.sqrt(summary.variance); + var formatter = TableViewer.MathUtils.getPrintFormat(summary.min, summary.max, std); + var f = formatter.toString; + + element.find(".minmax").html(f(summary.min) + "/" + f(summary.max)); + element.find(".meanstd").html(f(summary.mean) + "/" + f(std)); + element.find(".median").html(f(summary.median)); + element.find(".b68").html(f(summary.lb68) + "/" + f(summary.ub68)); + element.find(".b95").html(f(summary.lb95) + "/" + f(summary.ub95)); + + if (formatter.exponent) { + element.find(".minmax-exp").html("×10" + formatter.exponent + ""); + element.find(".meanstd-exp").html("×10" + formatter.exponent + ""); + element.find(".median-exp").html("×10" + formatter.exponent + ""); + element.find(".b68-exp").html("×10" + formatter.exponent + ""); + element.find(".b95-exp").html("×10" + formatter.exponent + ""); + } + + var range = summary.max - summary.min; + if (!chart.isVisible) { + contentChart.css("display", "block"); + boxplot.isVisible = true; + chart.isVisible = true; + } + var h = 15; + boxplot.draw({ + min: summary.min, + l95: summary.lb95, + l68: summary.lb68, + median: summary.median, + r68: summary.ub68, + r95: summary.ub95, + max: summary.max, + y: 0, height: h + }); + + if (range == 0) range = 1.0; + var left = summary.min - range / 10; + var right = summary.max + range / 10; + + var vr = chart.visibleRect; + chart.navigation.setVisibleRect({ x: left, y: vr.y, width: right - left, height: vr.height }); + boxplot.navigation.setVisibleRect({ x: left, y: -0.5, width: right - left, height: 1 }); + } + }; + + var _drawPdf = function (pdf) { + // it is called only after the _drawSummary which makes initial settings for the 'chart', too. + if (pdf) { + var drawArgs = {}; + drawArgs.fill = "#E8F3FF"; + + if (typeof (pdf.x) === 'undefined' || typeof (pdf.f) === 'undefined') { + drawArgs.y1 = []; + drawArgs.y2 = []; + drawArgs.x = []; + bandPlot.draw(drawArgs); + } + else { + var y1 = new Array(pdf.x.length); + for(var i=0; i < y1.length; i++) y1[i] = 0; + drawArgs.y1 = y1; + drawArgs.y2 = pdf.f; + drawArgs.x = pdf.x; + bandPlot.draw(drawArgs); + } + chart.fitToViewY(); + } + } + + var _onChanged = function () { + column.getSummaryAsync() + .done(function (summary) { // updating summary + _drawSummary(summary); + column.getPdfAsync() + .done(function (pdf) { // updating summary + _drawPdf(pdf); + }) + .fail(function (reason) { + if (reason != 'Task is canceled') { + // todo: show the error message + } + }); + }) + .fail(function (reason) { + if (reason != 'Task is canceled') { + // todo: show the error message + } + }); + }; + + column.onChanged = function () { + _onChanged(); + } + element.find(".name").text(column.name); + element.find(".type").text(typeToText(column.type) + "[]"); + _onChanged(); + return { + dispose: function () { + element.empty(); + column.onChanged = undefined; + column = undefined; + } + } + }; +}(TableViewer, $)); + +(function (TableViewer, $, undefined) { + // TableTileView is a UI control which displays the given TableViewer.Table as a collection of tiles (TableTile control), + // where each tile corresponds to a single table column. + TableViewer.showSummary = function (htmlElement, tableSource) { + var table = new TableViewer.TableViewModel(tableSource); + var element = $(htmlElement); + var tiles = []; + element + .empty() + .addClass("table-tileView") + .bind('mouseenter.' + name, function () { + mouseOverBox = true; + }) + .bind('mouseleave.' + name, function () { + mouseOverBox = false; + }); + + var panel = $("
") + .appendTo(element) + .addClass("table-tileView-panel"); + + var panel_ul = $("
    ") + .appendTo(panel); + + var _onColumnsChanged = function () { + var ul = panel_ul; + ul.empty(); + + if (table && table.columns) { + var columns = table.columns; + var bindTile = function (tileDiv, column) { + tileDiv.bind("click", function (event) { + tileDiv.trigger("tileSelected", column.name); + }); + } + tiles = []; + for (var n = columns.length, i = 0; i < n; i++) { + var column = columns[i]; + var li = $("
  • ") + .appendTo(ul); + var tileDiv = $("
    ") + .appendTo(li) + var tile = TableViewer.TableTile(tileDiv, column); + tiles.push(tile); + bindTile(tileDiv, column); + } + } + } + + table.onColumnsChanged = function (args) { if (args.changeType === 'schema') _onColumnsChanged(); } + _onColumnsChanged(); + + return { + dispose: function () { + tiles.forEach(function (t) { t.dispose(); }); + element + .empty() + .removeClass("table-tileView"); + table.onColumnsChanged = undefined; + table = undefined; + options = undefined; + } + }; + }; +}(TableViewer, $)); +(function (TableViewer, $, undefined) { + $.fn.scrollView = function () { + return each(function () { + $('html, body').animate({ + scrollLeft: $(this).offset().left + }, 1000); + }); + }; + $.fn.dataTableExt.oPagination.four_button = { + "fnInit": function (oSettings, nPaging, fnCallbackDraw) { + var nFirst = document.createElement('span'); + var nPrevious = document.createElement('span'); + var nNext = document.createElement('span'); + var nLast = document.createElement('span'); + + nFirst.appendChild(document.createTextNode(oSettings.oLanguage.oPaginate.sFirst)); + nPrevious.appendChild(document.createTextNode(oSettings.oLanguage.oPaginate.sPrevious)); + nNext.appendChild(document.createTextNode(oSettings.oLanguage.oPaginate.sNext)); + nLast.appendChild(document.createTextNode(oSettings.oLanguage.oPaginate.sLast)); + + nFirst.className = "paginate_button first"; + nPrevious.className = "paginate_button previous"; + nNext.className = "paginate_button next"; + nLast.className = "paginate_button last"; + + nPaging.appendChild(nFirst); + nPaging.appendChild(nPrevious); + nPaging.appendChild(nNext); + nPaging.appendChild(nLast); + + $(nFirst).click(function () { + oSettings.oApi._fnPageChange(oSettings, "first"); + fnCallbackDraw(oSettings); + }); + + $(nPrevious).click(function () { + oSettings.oApi._fnPageChange(oSettings, "previous"); + fnCallbackDraw(oSettings); + }); + + $(nNext).click(function () { + oSettings.oApi._fnPageChange(oSettings, "next"); + fnCallbackDraw(oSettings); + }); + + $(nLast).click(function () { + oSettings.oApi._fnPageChange(oSettings, "last"); + fnCallbackDraw(oSettings); + }); + + /* Disallow text selection */ + $(nFirst).bind('selectstart', function () { return false; }); + $(nPrevious).bind('selectstart', function () { return false; }); + $(nNext).bind('selectstart', function () { return false; }); + $(nLast).bind('selectstart', function () { return false; }); + }, + + + "fnUpdate": function (oSettings, fnCallbackDraw) { + if (!oSettings.aanFeatures.p) { + return; + } + + /* Loop over each instance of the pager */ + var an = oSettings.aanFeatures.p; + for (var i = 0, iLen = an.length ; i < iLen ; i++) { + var buttons = an[i].getElementsByTagName('span'); + if (oSettings._iDisplayStart === 0) { + buttons[0].className = "paginate_disabled_previous"; + buttons[1].className = "paginate_disabled_previous"; + } + else { + buttons[0].className = "paginate_enabled_previous"; + buttons[1].className = "paginate_enabled_previous"; + } + + if (oSettings.fnDisplayEnd() == oSettings.fnRecordsDisplay()) { + buttons[2].className = "paginate_disabled_next"; + buttons[3].className = "paginate_disabled_next"; + } + else { + buttons[2].className = "paginate_enabled_next"; + buttons[3].className = "paginate_enabled_next"; + } + } + } + }; + + // TableTileView is a UI control which displays the given TableViewer.Table as a table. + TableViewer.showGrid = function(htmlElement, tableSource, activeColumn) { + var table = new TableViewer.TableViewModel(tableSource); + var element = $(htmlElement); + var tableui = null; + var formatters = []; + var isAutoFormatEnabled = true; + + element + .empty() + .addClass("table-tableView") + .bind('mouseenter.' + name, function () { + mouseOverBox = true; + }) + .bind('mouseleave.' + name, function () { + mouseOverBox = false; + }); + + var panel = $("
    ") + .appendTo(element) + .addClass("table-tableView-panel"); + + var _getTableData = function (sSource, aoData, fnCallback, oSettings) { + // method is called by jquery.datatables plugin + // see http://datatables.net/ref#fnServerData + // {string}: HTTP source to obtain the data from (sAjaxSource) + // {array}: A key/value pair object containing the data to send to the server + // {function}: to be called on completion of the data get process will draw the data on the page. + // {object}: DataTables settings object + var fnGetKey = function (aoData, sKey) { + for (var i = 0, iLen = aoData.length ; i < iLen ; i++) { + if (aoData[i].name == sKey) { + return aoData[i].value; + } + } + return null; + } + + var startRow = fnGetKey(aoData, "iDisplayStart"); + var rows = fnGetKey(aoData, "iDisplayLength"); + var sEcho = fnGetKey(aoData, "sEcho"); + + table.getDataAsync(startRow, rows).done(function (result) { + var data = result; + var total = table.totalRows; + var coldata = []; + for (var i in data) { + coldata.push(data[i]);//Is typed array OK here? To the first glance it appears to be working + } + var n = coldata.length;//number of columns + var m = coldata[n - 1].length; //number of rows + + var aaData = new Array(m); + var response = { + sEcho: sEcho, + iTotalRecords: total, + iTotalDisplayRecords: total, + aaData: aaData + }; + + for (var k = 0; k < m; k++) { // rows + var row = new Array(n); + for (var col = 0; col < n; col++) { // columns + row[col] = TableViewer.MathUtils.escapeHtml(coldata[col][k]); + } + aaData[k] = row; + } + + fnCallback(response); + }) + .fail(function () { + alert('table data request failed'); + }); + }; + + var _enableAutoFormat = function () { + if (!tableui) return; + + var round_btn = panel.find(".round_btn"); + round_btn[0].className = "round_btn auto_format_on"; + round_btn[0].title = "Auto format is ON"; + + isAutoFormatEnabled = true; + var _formatters = formatters; + var setFormat = function (table, i, colName, tableui) { + table.getSummaryAsync(i).done(function (summary) { + if (typeof (summary.min) !== 'undefined' && typeof (summary.max) !== 'undefined' && typeof (summary.variance) !== 'undefined') { + var formatter = TableViewer.MathUtils.getPrintFormat(summary.min, summary.max, Math.sqrt(summary.variance)); + _formatters[i] = formatter; + + var colHeader = $('th:nth-child(' + (i + 1) + ')', tableui); + if (colHeader.length) { + var title = _getColumnTitle(colName, formatter); + colHeader.html(title); + } + tableui.fnDraw(false); + } + }); + }; + var n = table.columns.length; + for (var i = 0; i < n; i++) { + var colName = table.columns[i].name; + var colType = table.columns[i].type; + if (colType != "System.String" && colType != "System.DateTime") + setFormat(table, i, colName, tableui); + } + }; + + var _getColumnTitle = function (columnName, formatter) { + var title = $(""); + $("").appendTo(title).text(columnName); + if (formatter && formatter.exponent) { + $("×10" + formatter.exponent + "").appendTo(title); + } + return title; + }; + + var _disableAutoFormat = function () { + if (!tableui) return; + + var round_btn = panel.find(".round_btn"); + round_btn[0].className = "round_btn auto_format_off"; + round_btn[0].title = "Auto format is OFF"; + + isAutoFormatEnabled = false; + + $('.headerExponent', tableui).remove(); + tableui.fnDraw(false); + }; + + var _onColumnsChanged = function (activeColumnName, changeType) { + panel.empty(); + panel_table = $("
    ").appendTo(panel); + + var tbl = panel_table; + + if (table && table.columns && table.columns.length > 0) { + var columns = table.columns; + var thead = $("").appendTo(tbl) + var tr = $("").appendTo(thead); + + var n = table.columns.length; + var _formatters; + if (changeType == 'schema' || !formatters) + _formatters = formatters = new Array(n); + else + _formatters = formatters; + + var colDefs = new Array(n); + var def = function (j, colName) { + colDefs[j] = { + sClass: activeColumnName && activeColumnName == colName ? "active" : undefined, + mData: function (source, type, val) { + if (type === "set") { + return; + } else if (type === "display") { + var val = source[j]; + var formatter = _formatters[j] + if (isAutoFormatEnabled && val && formatter) { + return formatter.toString(val); + } + return val; + } + return source[j]; + } + }; + }; + + for (var i = 0; i < n; i++) { + var formatter = _formatters[i] + var th = $("").appendTo(tr); + var colName = columns[i].name; + var title = _getColumnTitle(colName, formatter); + th.html(title); + + if (activeColumnName && activeColumnName == columns[i].name) { + th.scrollView(); + } + def(i, columns[i].name); + } + var tbody = $("").appendTo(tbl); + + tableui = tbl.dataTable({ + bFilter: false, + bSort: false, + bAutoWidth: true, + bSortClasses: false, + bProcessing: true, + bServerSide: true, + sAjaxSource: "-na-", + sDom: 'l<"toolbar">fr', + sPaginationType: "four_button", + fnServerData: function (sSource, aoData, fnCallback, oSettings) { + _getTableData(sSource, aoData, fnCallback, oSettings); + }, + bStateSave: true, + fnStateSave: function (oSettings, oData) { + var settings = { + "start": oData.iStart, + "length": oData.iLength + }; + table.saveAttribute("$view-table", JSON.stringify(settings)); + }, + aoColumns: colDefs, + iDisplayLength: tableSettings.length || 10, + iDisplayStart: tableSettings.start || 0, + oLanguage: { + oPaginate: { + sFirst: "first", + sLast: "last", + sNext: "next", + sPrevious: "previous" + }, + sEmptyTable: "no data available in table", + sInfo: "showing _START_ to _END_ of _TOTAL_ entries", + sInfoEmpty: "showing 0 to 0 of 0 entries", + sLengthMenu: "show _MENU_ entries", + sLoadingRecords: "loading...", + sProcessing: "processing..." + } + }); + + tbody.on("mouseenter", "td", function () { + var iCol = $('td', this.parentNode).index(this); + $('td:nth-child(' + (iCol + 1) + ')', tableui.$('tr')).addClass('highlighted'); + }); + tbody.on("mouseleave", "td", function () { + tableui.$('td.highlighted').removeClass('highlighted'); + }); + + // Turn auto format on/off + var round_btn = $("div.toolbar").html('').find(".round_btn"); + round_btn.css("background-size", "contain"); + round_btn.click(function (e) { + if (isAutoFormatEnabled) + _disableAutoFormat(); + else + _enableAutoFormat(); + }); + if (isAutoFormatEnabled) + _enableAutoFormat(); + else + _disableAutoFormat(); + } + }; + + table.getAttribute("$view-table").done(function (value) { + try { + tableSettings = value ? JSON.parse(value) : {}; + } catch (x) { + tableSettings = {}; + } + table.onColumnsChanged = function (e) { _onColumnsChanged(null, e.changeType); } + _onColumnsChanged(activeColumn, 'schema'); + }); + + return { + dispose: function () { + element + .empty() + .removeClass("table-tableView"); + table.onColumnsChanged = undefined; + table = undefined; + options = undefined; + } + }; + } +}(TableViewer, $)); + +(function (TableViewer, $, undefined) { + $.fn.scrollView = function () { + return this.each(function () { + $('html, body').animate({ + scrollLeft: $(this).offset().left + }, 1000); + }); + } + + TableViewer.showCorrelations = function (htmlElement /*HTMLElement*/, tableSource /*TableSource*/) { + var table = new TableViewer.TableViewModel(tableSource); + var element = $(htmlElement); + var axisLeft = null; + var axisTop = null; + var varsN = 0; // number of variables in the matrix (can be less than number of columns) + var pcc = null; + var selectedCellIndex = { i: -1, j: -1, isInverted: false }; + var colorPalette = InteractiveDataDisplay.ColorPalette.parse("-1=Red,White=0,Blue=1"); + var reqId = 0; // allows to order async getCorrelation responses + + element.empty().addClass("table-correlationView"); + var correlationViewContainer = $("
    "); + element.append(correlationViewContainer); + var msgDiv = $("
    "); + element.append(msgDiv); + + var figureDiv = $("
    "); + figureDiv.html('
    '); + correlationViewContainer.append(figureDiv); + var figure = InteractiveDataDisplay.asPlot(figureDiv); + figure.isToolTipEnabled = false; + figure.navigation.gestureSource = InteractiveDataDisplay.Gestures.getGesturesStream(figureDiv); + + var legendDiv = $("
    ") + correlationViewContainer.append(legendDiv); + var heatmap = figure.get("Correlation"); + heatmap.legend = new InteractiveDataDisplay.Legend(heatmap, legendDiv); + + correlationViewContainer.append($("
    click on a cell to see details here
    ")); + + var _showDetailsFor = function (i, j, isInverted) { + selectedCellIndex = { i: i, j: j, isInverted: isInverted }; + var selectedCell = figure.get("selectedCell"); + if (i >= 0 && j >= 0 && table && pcc && varsN > 0) { + var n = varsN; + if (isInverted) j = n - 1 - j; + if (i != j && i < n && j < n && i >= 0 && j >= 0) { + if (isInverted) + selectedCell.draw({ x: i, y: n - 1 - j, n: n }); + else + selectedCell.draw({ x: i, y: j, n: n }); + var varX = table.columns[i].name; + var varY = table.columns[j].name; + element.find(".selectedPair2").text(varX); + element.find(".selectedPair1").text(varY); + if (i > j) { var l = i; i = j; j = l; } + element.find(".selectedPair-PCC").text(pcc[i][j - i - 1].toFixed(4)); + element.find(".selectedPair").css("display", "block"); + element.find(".legendHint").css("display", "none"); + return; + } + } + element.find(".selectedPair").css("display", "none"); + element.find(".legendHint").css("display", "block"); + selectedCell.draw({ x: -1, y: -1 }); + }; + + var _onColumnsChanged = function (isSchemaChanged) { + pcc = null; // obsolete data + var cols = table.columns; + if (cols && cols.length > 0) { + var myReqId = ++reqId; + msgDiv.css("display", "block").text("processing...").addClass("hint").removeClass("error"); + table.getCorrelationAsync() + .done(function (result) { + if (myReqId != reqId) return; // obsolete response + if (!result || !result.r || !result.c) { + varsN = 0; + correlationViewContainer.css("display", "none"); + msgDiv.css("display", "block").text("there is nothing to display").addClass("hint").removeClass("error"); + return; + } + msgDiv.css("display", "none"); + var r = result.r; + pcc = result.r; + var heatmap = figure.get("Correlation"); + var pies = figure.get("pies"); + var n = Object.keys(r).length + 1 //r.length + 1; + varsN = n; + if (n < 2) { + correlationViewContainer.css("display", "none"); + } else { + correlationViewContainer.css("display", "block"); + + var x = new Array(n + 1); + var f = new Array(n); + var xp = new Array(n * (n - 1) / 2); + var yp = new Array(n * (n - 1) / 2); + var fp = new Array(n * (n - 1) / 2); + for (var i = 0; i < n; i++) { + var fi = f[i] = new Array(n); + var ri = r[i]; + for (var j = 0; j < n; j++) { + if (i == j) fi[n - 1 - j] = 0; + else if (i < j) fi[n - 1 - j] = 0; + else fi[n - 1 - j] = r[j][i - j - 1]; + + if (i < j) { + fp[i * n + j] = ri[j - i - 1]; + xp[i * n + j] = i + 0.5; + yp[i * n + j] = n - 1 - j + 0.5; + } + } + } + for (var i = 0; i <= n; i++) { + x[i] = i; + } + + heatmap.draw({ x: x, y: x, values: f, colorPalette: colorPalette }); + pies.draw({ x: xp, y: yp, value: fp, color: fp, colorPalette: colorPalette, radius: 0.45, shape: TableViewer.PiesMarker }); + + if (isSchemaChanged) { + var labels = new Array(n); + var labelsHor = new Array(n); + + for (var i = 0; i < n; i++) { + var colName = TableViewer.MathUtils.escapeHtml(result.c[i]); + labels[i] = colName; + labelsHor[i] = colName; + } + + if (axisLeft) axisLeft.axis.remove(); + axisLeft = figure.addAxis("left", "labels", + { labels: labels, ticks: x, rotate: false }); + if (axisTop) axisTop.axis.remove(); + axisTop = figure.addAxis("top", "labels", + { labels: labelsHor, ticks: x, rotate: false }); + axisLeft.axis.FontSize = 14; + axisTop.axis.FontSize = 14; + figure.updateLayout(); + var grid = figure.get("grid"); + grid.xAxis = axisTop.axis; + grid.yAxis = axisLeft.axis; + axisLeft.axis.dataTransform = new InteractiveDataDisplay.DataTransform( + function (x) { return n - x; }, + function (y) { return n - y; }); + + _showDetailsFor(-1, -1); + figure.fitToView(); + } else { + _showDetailsFor(selectedCellIndex.i, selectedCellIndex.j, selectedCellIndex.isInverted); + } + } // n >= 2 + }) + .fail(function (err) { + varsN = 0; + correlationViewContainer.css("display", "none"); + msgDiv.css("display", "block").text("Error: " + err).addClass("error").removeClass("hint"); + }); + } + } + + + table.onColumnsChanged = function (args) { _onColumnsChanged(args.changeType === 'schema'); } + _onColumnsChanged(true); + + heatmap.onClick = function (origin_s, origin_p) { + _showDetailsFor(Math.floor(origin_p.x), Math.floor(origin_p.y), true); + }; + + return { dispose: function () { + element + .empty() + .removeClass("table-correlationView"); + table.onColumnsChanged = undefined; + figure = undefined; + options = undefined; + }}; + }; +}(TableViewer, $)); + +(function (TableViewer, $) { + TableViewer.show = function (htmlElement /*HTMLElement*/, content /*TableSource or TableDescription*/) { + var tableSource; + if(typeof content["getDataAsync"] !== "undefined") // TableSource + tableSource = content; + else // TableDescription + tableSource = new TableViewer.TableSource(content); + + var jqDiv = $(htmlElement); + jqDiv.html("
    summary" + + "datacorrelation
    Initializing...
    "); + var container = jqDiv.find(".tableviewer_container"); + jqDiv.find(".summary").click(function () { showSummary() }); + jqDiv.find(".data").click(function () { showData() }); + jqDiv.find(".correlation").click(function () { showCorrelation() }); + + var _activePage = undefined; // "summary", "data", or "correlation" (must be equal to id of the button elements) + var _destroyActiveControl; + var switchUI = function () { + if (_destroyActiveControl) { + _destroyActiveControl(); + _destroyActiveControl = undefined; + } + + var commands = jqDiv.find(".titleCommand, .titleCommand-on"); + var on = commands.filter("." + _activePage); + var off = commands.filter(":not(." + _activePage + ")"); + on.addClass("titleCommand-on").removeClass("titleCommand"); + off.addClass("titleCommand").removeClass("titleCommand-on"); + } + var showSummary = function () { + if (_activePage != "summary") { + _activePage = "summary"; + switchUI(); + showTileView(); + } + } + var showData = function (activeColumn) { + if (_activePage != "data") { + _activePage = "data"; + switchUI(); + showTableView(activeColumn); + } + } + var showCorrelation = function () { + if (_activePage != "correlation") { + _activePage = "correlation"; + switchUI(); + showCorrelationView(); + } + } + var showTileView = function () { + tableSource.cancelRequests(); + var control = TableViewer.showSummary(container, tableSource); + tableSource.saveAttribute("$view", "tiles"); + _destroyActiveControl = function () { + if (container.is('.table-tileView')) control.dispose(); + }; + container.on("tileSelected", function (event, columnName) { + showData(columnName); + }); + } + var showTableView = function (columnName) { + tableSource.cancelRequests(); + var control = TableViewer.showGrid(container, tableSource, columnName); + tableSource.saveAttribute("$view", "table"); + _destroyActiveControl = function () { + if (container.is('.table-tableView')) control.dispose(); + }; + } + var showCorrelationView = function () { + tableSource.cancelRequests(); + var control = TableViewer.showCorrelations(container, tableSource); + tableSource.saveAttribute("$view", "correlation"); + _destroyActiveControl = function () { + if (container.is('.table-correlationView')) control.dispose(); + }; + } + showSummary(); + return { + dispose: function () { + if (_destroyActiveControl) _destroyActiveControl(); + jqDiv.html(""); + } + }; + } +}(TableViewer, $)); + +return TableViewer; +}); // end of the factory function +}(window)); diff --git a/dist/angara.tablejs.min.js b/dist/angara.tablejs.min.js new file mode 100644 index 0000000..ff99676 --- /dev/null +++ b/dist/angara.tablejs.min.js @@ -0,0 +1,2 @@ +!function(a,b){!function(b){"function"==typeof define&&define.amd?define(["jquery","idd","jquery.dataTables","css!jquery.dataTables-css","css!idd-css","css!angara.tablejs"],function(a,c){return b({},a,c.InteractiveDataDisplay)}):a.jQuery&&a.InteractiveDataDisplay&&(a.TableViewer=b({},a.jQuery,a.InteractiveDataDisplay))}(function(a,c,d){return function(a){a.MathUtils=void 0===a.MathUtils?{}:a.MathUtils,a.MathUtils.escapeHtml=function(a){var b=typeof a;return null==a||"number"===b||"undefined"===b?a:a.toString().replace(/[\u00A0-\u9999<>\&]/gim,function(a){return"&#"+a.charCodeAt(0)+";"})},a.MathUtils.power10=function(a){if(a>=0){for(var b=1,c=0;c1e-12?Math.log(e)/g:0;if((f=c>1e-12?Math.floor(Math.log(c)/g)-d:Math.floor(h-d))<0){var i=Math.floor(h);if(f<=-2&&i<=-4){var j=this.power10(-i);return{toString:function(a){return(a*j).toFixed(-f+i)},exponent:i}}return{toString:function(a){return a.toFixed(-f)}}}if(f>=2&&h>5){var j=this.power10(-f-d);return{toString:function(a){return(a*j).toFixed(d)},exponent:f+d}}return{toString:function(a){var b=a.toFixed();return a!=b&&(b+="."),b}}}}(a),function(a,b,c,d){a.BoxPlot=function(a,c){this.base=b.CanvasPlot,this.base(a,c);var e,f,g,h,i,j,k,l;this.draw=function(a){e=a.l95,f=a.r95,g=a.l68,h=a.r68,i=a.median,j=a.min,k=a.max,l=a.height,this.invalidateLocalBounds(),this.requestNextFrameOrUpdate(),this.fireAppearanceChanged()},this.computeLocalBounds=function(){return d},this.getLocalPadding=function(){var a=0;return{left:a,right:a,top:a,bottom:a}},this.renderCore=function(a,b){var c=this.getTransform(),d=c.dataToScreenX,m=c.dataToScreenY,n=this.getContext(!0);n.beginPath(),n.strokeStyle="black";var o=d(j),p=d(k),q=d(g),r=d(e),s=d(h),t=d(f),u=d(i),v=m(0),w=v-l/2,x=v+l/2,y=v-l/6,z=v+l/6,A=5;n.moveTo(r,v),n.lineTo(q,v),n.moveTo(t,v),n.lineTo(s,v),n.moveTo(u,w),n.lineTo(u,x),n.moveTo(r,y),n.lineTo(r,z),n.moveTo(t,y),n.lineTo(t,z),n.stroke(),n.strokeRect(q,w,s-q,l),n.beginPath(),n.arc(o,v,A,0,2*Math.PI),n.stroke(),n.beginPath(),n.arc(p,v,A,0,2*Math.PI),n.stroke()}},a.BoxPlot.prototype=new b.CanvasPlot,c(document).ready(function(){b.register("boxplot",function(b,c){return new a.BoxPlot(b,c)})})}(a,d,c),function(a,b,c,d){a.SelectedCellPlot=function(a,c){this.base=b.CanvasPlot,this.base(a,c);this.draw=function(a){this.x=a.x,this.y=a.y,this.n=a.n,this.requestNextFrameOrUpdate()},this.renderCore=function(a,b){var c=this.getContext(!0);if(this.y>=0&&this.x>=0){c.strokeStyle="black";var d=this.getTransform(),e=(d.dataToScreenX,d.dataToScreenY,d.dataToScreenY(this.y)),f=d.dataToScreenY(this.y+1),g=d.dataToScreenX(this.x),h=d.dataToScreenX(this.x+1);c.strokeRect(g,e,h-g,f-e);var i=this.n;e=d.dataToScreenY(i-this.x-1),f=d.dataToScreenY(i-this.x),g=d.dataToScreenX(i-this.y-1),h=d.dataToScreenX(i-this.y),c.strokeRect(g,e,h-g,f-e)}}},a.SelectedCellPlot.prototype=new b.CanvasPlot,c(document).ready(function(){b.register("selectedCell",function(b,c){return new a.SelectedCellPlot(b,c)})})}(a,d,c),function(a,b,c,d){a.PiesMarker={prepare:function(a){if(a.y==d||null==a.y)throw"The mandatory property 'y' is undefined or null";if(!b.Utils.isArray(a.y))throw"The property 'y' must be an array of numbers";var c=a.y.length,e=new Int8Array(c);if(b.Utils.maskNaN(e,a.y),a.x==d||null==a.x)throw"The mandatory property 'x' is undefined or null";if(!b.Utils.isArray(a.x))throw"The property 'x' must be an array of numbers";if(a.x.length!=c)throw"Length of the array which is a value of the property 'x' differs from lenght of 'y'";if(b.Utils.maskNaN(e,a.x),b.Utils.isArray(a.color)){if(a.color.length!=c)throw"Length of the array 'color' is different than length of the array 'y'";var f=a.colorPalette;if(f!=d&&f.isNormalized){var g=b.Utils.getMinMax(a.color);g=b.Utils.makeNonEqual(g),a.colorPalette=f=f.absolute(g.min,g.max)}for(var h=new Array(c),i=0;i0&&(l=c-l,a.x=b.Utils.applyMask(e,a.x,l),a.y=b.Utils.applyMask(e,a.y,l),a.color=b.Utils.applyMask(e,a.color,l))},draw:function(a,b,c,d,e){var f=d.dataToScreenX(a.x),g=d.dataToScreenY(a.y),h=d.dataToScreenX(a.x+a.radius)-f,i=a.value;0==i||f+h<0||f-h>c.width||g+h<0||g-h>c.height||(e.beginPath(),e.strokeStyle="gray",e.fillStyle=a.color,e.moveTo(f,g),e.lineTo(f,g-h),e.arc(f,g,h,-Math.PI/2,Math.PI*(2*i-.5),i<0),e.lineTo(f,g),e.closePath(),e.fill(),e.stroke(),e.beginPath(),e.arc(f,g,h,0,2*Math.PI),e.stroke())},hitTest:function(a,b,c,d){var e=a.radius;return(d.x-a.x)*(d.x-a.x)+(d.y-a.y)*(d.y-a.y)<=e*e}}}(a,d),function(a,b,c){a.TaskQueue=function(){var a,d=[],e="Task is cancelled",f=function(a){return{func:a,response:b.Deferred(),status:"waiting"}},g=function(){if(a=c,d.length>0){var b=d.shift();k(b)}},h=function(a){a.status="cancelled",a.response.reject(e)},i=function(a,b){"running"==a.status?(a.status="failed",a.response.reject(b)):"cancelling"==a.status&&h(a)},j=function(a,b){"running"==a.status?(a.status="completed",a.response.resolve(b)):"cancelling"==a.status&&h(a)},k=function(b){b.status="running",a=b;try{b.func().done(function(a){g(),j(b,a)}).fail(function(a){g(),i(b,a)})}catch(c){g(),i(b,c)}};return{isRunning:function(){return a!==c},taskCount:function(){return d.length},queue:function(a,b){var e=new f(a,b!==c?1:b);if(this.isRunning()){for(var g=d.length,h=0;he.priority){d.splice(h,0,e);break}g==d.length&&d.push(e)}else k(e);return e.response.promise()},clear:function(){if(a!==c&&(a.status="cancelling",a=c),d.length>0){for(var b=0;b0?a.summary[0].totalCount:0,this.columns=c,this.summary=a.summary,this.pdf=a.pdf,this.dataByCols=a.data,this.correlation=a.correlation,this.onChanged=b,this.metadata={}}d.prototype.getDataAsync=function(a,b){var d=c.Deferred(),e=this.dataByCols.map(function(c){return Array.prototype.slice.apply(c,[a,a+b-1])});return d.resolve(e),d.promise()},d.prototype.getSummaryAsync=function(a){var b=c.Deferred();return b.resolve(this.summary[a]),b.promise()},d.prototype.getPdfAsync=function(a){var b=c.Deferred();return this.pdf&&this.pdf.length>a?b.resolve(this.pdf[a]):b.reject("no data"),b.promise()},d.prototype.getCorrelationAsync=function(){var a=c.Deferred();return a.resolve(this.correlation),a.promise()},d.prototype.saveAttribute=function(a,b){this.metadata[a]=b},d.prototype.getAttributeAsync=function(a){var b=c.Deferred();return b.resolve(this.metadata[a]),b.promise()},d.prototype.cancelRequests=function(){},a.TableSource=d}(a),function(a){var b=function(){function a(a,b,c,d){this.number=a,this.name=b,this.type=c,this.table=d}return a.prototype.getSummaryAsync=function(){return this.table.getSummaryAsync(this.number)},a.prototype.getPdfAsync=function(){return this.table.getPdfAsync(this.number)},a}(),c=function(){function a(a){this.table=a,this.columns=[];var b=this;a.onChanged=function(a){"schema"==a.changeType?b.updateColumns():b.columns.forEach(function(a){a.onChanged&&a.onChanged()}),b.onColumnsChanged&&b.onColumnsChanged(a)},this.updateColumns()}return a.prototype.updateColumns=function(){var a=this;this.columns=this.table.columns.map(function(c,d){return new b(d,c.name,c.type,a)})},Object.defineProperty(a.prototype,"totalRows",{get:function(){return this.table.totalRows},enumerable:!0,configurable:!0}),a.prototype.getDataAsync=function(a,b){return this.table.getDataAsync(a,b)},a.prototype.getSummaryAsync=function(a){return this.table.getSummaryAsync(a)},a.prototype.getPdfAsync=function(a){return this.table.getPdfAsync(a)},a.prototype.getCorrelationAsync=function(){return this.table.getCorrelationAsync()},a.prototype.saveAttribute=function(a,b){this.table.saveAttribute(a,b)},a.prototype.getAttribute=function(a){return this.table.getAttributeAsync(a)},a.prototype.saveView=function(a){this.saveAttribute("$view",a)},a.prototype.getView=function(){return this.getAttributeAsync("$view")},a.prototype.cancelAllRequests=function(){this.table.cancelRequests()},a}();a.TableViewModel=c}(a),function(a,b,c){var e=function(a){return 0==a.indexOf("System.")&&(a=a.substr(7)),a=a.toLowerCase(),"real"===a?a="float":"int32"===a&&(a="int"),a};a.TableTile=function(f,g){var h=b(f),i=null,j=null,k=null;d.Padding=2,d.tickLength=5,h.bind("mouseenter."+name,function(){mouseOverBox=!0}).bind("mouseleave."+name,function(){mouseOverBox=!1}),h.html("
    Name
    min/max: 
    lb95/ub95: 
    lb68/ub68: 
    mean/std: 
    median: 
    ");var l=h.find(".content-chart"),i=d.asPlot(l.find(".chart")),m=i,n=b("
    ").attr("data-idd-name","bplot").attr("data-idd-plot","area").appendTo(m.host),o=new d.Area(n,m.master);m.addChild(o),j=o,k=d.asPlot(l.find(".boxplot")),i.navigation.setVisibleRect({x:0,y:0,width:1,height:1}),k.navigation.setVisibleRect({x:0,y:-.5,width:1,height:1}),i.navigation.gestureSource=c;var p=function(c){var d=e(g.type);if(d="bool"==g.type?d+"["+(c.true+c.false)+"]":d+"["+(c.totalCount===c.count?c.totalCount:c.totalCount+"/"+c.count+"")+"]",h.find(".type").html(d),"bool"==g.type)b(".summary-numeric",h).css("display","none"),b(".summary-nonnumeric",h).css("display","block"),h.find(".summary-nonnumeric").html("
    true:"+c.true+"
    false:"+c.false+"
    "),i.isVisible&&(k.isVisible=!1,i.isVisible=!1,l.css("display","none"));else if(void 0===c.min)b(".summary-numeric",h).css("display","none"),b(".summary-nonnumeric",h).css("display","none"),i.isVisible&&(k.isVisible=!1,i.isVisible=!1,l.css("display","none"));else if(void 0===c.variance)b(".summary-numeric",h).css("display","none"),b(".summary-nonnumeric",h).css("display","block"),1==c.totalCount?h.find(".summary-nonnumeric").html("
    "+c.min+"
    "):2==c.totalCount&&h.find(".summary-nonnumeric").html("
    "+c.min+"
    "+c.max+"
    "),c.totalCount>2&&h.find(".summary-nonnumeric").html("
    "+c.min+"
    ...
    "+c.max+"
    "),i.isVisible&&(k.isVisible=!1,i.isVisible=!1,l.css("display","none"));else{b(".summary-numeric",h).css("display","block"),b(".summary-nonnumeric",h).css("display","none");var f=Math.sqrt(c.variance),j=a.MathUtils.getPrintFormat(c.min,c.max,f),m=j.toString;h.find(".minmax").html(m(c.min)+"/"+m(c.max)),h.find(".meanstd").html(m(c.mean)+"/"+m(f)),h.find(".median").html(m(c.median)),h.find(".b68").html(m(c.lb68)+"/"+m(c.ub68)),h.find(".b95").html(m(c.lb95)+"/"+m(c.ub95)),j.exponent&&(h.find(".minmax-exp").html("×10"+j.exponent+""),h.find(".meanstd-exp").html("×10"+j.exponent+""),h.find(".median-exp").html("×10"+j.exponent+""),h.find(".b68-exp").html("×10"+j.exponent+""),h.find(".b95-exp").html("×10"+j.exponent+""));var n=c.max-c.min;i.isVisible||(l.css("display","block"),k.isVisible=!0,i.isVisible=!0);var o=15;k.draw({min:c.min,l95:c.lb95,l68:c.lb68,median:c.median,r68:c.ub68,r95:c.ub95,max:c.max,y:0,height:o}),0==n&&(n=1);var p=c.min-n/10,q=c.max+n/10,r=i.visibleRect;i.navigation.setVisibleRect({x:p,y:r.y,width:q-p,height:r.height}),k.navigation.setVisibleRect({x:p,y:-.5,width:q-p,height:1})}},q=function(a){if(a){var b={};if(b.fill="#E8F3FF",void 0===a.x||void 0===a.f)b.y1=[],b.y2=[],b.x=[],j.draw(b);else{for(var c=new Array(a.x.length),d=0;d
    ").appendTo(g).addClass("table-tileView-panel"),j=b("
      ").appendTo(i),k=function(){var c=j;if(c.empty(),f&&f.columns){var d=f.columns,e=function(a,b){a.bind("click",function(c){a.trigger("tileSelected",b.name)})};h=[];for(var g=d.length,i=0;i").appendTo(c),m=b("
      ").appendTo(l),n=a.TableTile(m,k);h.push(n),e(m,k)}}};return f.onColumnsChanged=function(a){"schema"===a.changeType&&k()},k(),{dispose:function(){h.forEach(function(a){a.dispose()}),g.empty().removeClass("table-tileView"),f.onColumnsChanged=c,f=c,options=c}}}}(a,c),function(a,b,c){b.fn.scrollView=function(){return each(function(){b("html, body").animate({scrollLeft:b(this).offset().left},1e3)})},b.fn.dataTableExt.oPagination.four_button={fnInit:function(a,c,d){var e=document.createElement("span"),f=document.createElement("span"),g=document.createElement("span"),h=document.createElement("span");e.appendChild(document.createTextNode(a.oLanguage.oPaginate.sFirst)),f.appendChild(document.createTextNode(a.oLanguage.oPaginate.sPrevious)),g.appendChild(document.createTextNode(a.oLanguage.oPaginate.sNext)),h.appendChild(document.createTextNode(a.oLanguage.oPaginate.sLast)),e.className="paginate_button first",f.className="paginate_button previous",g.className="paginate_button next",h.className="paginate_button last",c.appendChild(e),c.appendChild(f),c.appendChild(g),c.appendChild(h),b(e).click(function(){a.oApi._fnPageChange(a,"first"),d(a)}),b(f).click(function(){a.oApi._fnPageChange(a,"previous"),d(a)}),b(g).click(function(){a.oApi._fnPageChange(a,"next"),d(a)}),b(h).click(function(){a.oApi._fnPageChange(a,"last"),d(a)}),b(e).bind("selectstart",function(){return!1}),b(f).bind("selectstart",function(){return!1}),b(g).bind("selectstart",function(){return!1}),b(h).bind("selectstart",function(){return!1})},fnUpdate:function(a,b){if(a.aanFeatures.p)for(var c=a.aanFeatures.p,d=0,e=c.length;d
      ").appendTo(h).addClass("table-tableView-panel"),m=function(b,c,d,e){var f=function(a,b){for(var c=0,d=a.length;c");return b("").appendTo(d).text(a),c&&c.exponent&&b("×10"+c.exponent+"").appendTo(d),d},p=function(){if(i){var a=l.find(".round_btn");a[0].className="round_btn auto_format_off",a[0].title="Auto format is OFF",k=!1,b(".headerExponent",i).remove(),i.fnDraw(!1)}},q=function(a,d){l.empty(),panel_table=b("
      ").appendTo(l);var e=panel_table;if(g&&g.columns&&g.columns.length>0){var f,h=g.columns,q=b("").appendTo(e),r=b("").appendTo(q),s=g.columns.length;f="schema"!=d&&j?j:j=new Array(s);for(var t=new Array(s),u=function(b,d){t[b]={sClass:a&&a==d?"active":c,mData:function(a,c,d){if("set"!==c){if("display"===c){var d=a[b],e=f[b];return k&&d&&e?e.toString(d):d}return a[b]}}}},v=0;v").appendTo(r),y=h[v].name,z=o(y,w);x.html(z),a&&a==h[v].name&&x.scrollView(),u(v,h[v].name)}var A=b("").appendTo(e);i=e.dataTable({bFilter:!1,bSort:!1,bAutoWidth:!0,bSortClasses:!1,bProcessing:!0,bServerSide:!0,sAjaxSource:"-na-",sDom:'l<"toolbar">fr',sPaginationType:"four_button",fnServerData:function(a,b,c,d){m(a,b,c,d)},bStateSave:!0,fnStateSave:function(a,b){var c={start:b.iStart,length:b.iLength};g.saveAttribute("$view-table",JSON.stringify(c))},aoColumns:t,iDisplayLength:tableSettings.length||10,iDisplayStart:tableSettings.start||0,oLanguage:{oPaginate:{sFirst:"first",sLast:"last",sNext:"next",sPrevious:"previous"},sEmptyTable:"no data available in table",sInfo:"showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"showing 0 to 0 of 0 entries",sLengthMenu:"show _MENU_ entries",sLoadingRecords:"loading...",sProcessing:"processing..."}}),A.on("mouseenter","td",function(){var a=b("td",this.parentNode).index(this);b("td:nth-child("+(a+1)+")",i.$("tr")).addClass("highlighted")}),A.on("mouseleave","td",function(){i.$("td.highlighted").removeClass("highlighted")});var B=b("div.toolbar").html('').find(".round_btn");B.css("background-size","contain"),B.click(function(a){k?p():n()}),k?n():p()}};return g.getAttribute("$view-table").done(function(a){try{tableSettings=a?JSON.parse(a):{}}catch(b){tableSettings={}}g.onColumnsChanged=function(a){q(null,a.changeType)},q(f,"schema")}),{dispose:function(){h.empty().removeClass("table-tableView"),g.onColumnsChanged=c,g=c,options=c}}}}(a,c),function(a,b,c){b.fn.scrollView=function(){return this.each(function(){b("html, body").animate({scrollLeft:b(this).offset().left},1e3)})},a.showCorrelations=function(e,f){var g=new a.TableViewModel(f),h=b(e),i=null,j=null,k=0,l=null,m={i:-1,j:-1,isInverted:!1},n=d.ColorPalette.parse("-1=Red,White=0,Blue=1"),o=0;h.empty().addClass("table-correlationView");var p=b("
      ");h.append(p);var q=b("
      ");h.append(q);var r=b("
      ");r.html('
      '),p.append(r);var s=d.asPlot(r);s.isToolTipEnabled=!1,s.navigation.gestureSource=d.Gestures.getGesturesStream(r);var t=b("
      ");p.append(t);var u=s.get("Correlation");u.legend=new d.Legend(u,t),p.append(b("
      click on a cell to see details here
      "));var v=function(a,b,c){m={i:a,j:b,isInverted:c};var d=s.get("selectedCell");if(a>=0&&b>=0&&g&&l&&k>0){var e=k;if(c&&(b=e-1-b),a!=b&&a=0&&b>=0){c?d.draw({x:a,y:e-1-b,n:e}):d.draw({x:a,y:b,n:e});var f=g.columns[a].name,i=g.columns[b].name;if(h.find(".selectedPair2").text(f),h.find(".selectedPair1").text(i),a>b){var j=a;a=b,b=j}return h.find(".selectedPair-PCC").text(l[a][b-a-1].toFixed(4)),h.find(".selectedPair").css("display","block"),void h.find(".legendHint").css("display","none")}}h.find(".selectedPair").css("display","none"),h.find(".legendHint").css("display","block"),d.draw({x:-1,y:-1})},w=function(b){l=null;var c=g.columns;if(c&&c.length>0){var e=++o;q.css("display","block").text("processing...").addClass("hint").removeClass("error"),g.getCorrelationAsync().done(function(c){if(e==o){if(!c||!c.r||!c.c)return k=0,p.css("display","none"),void q.css("display","block").text("there is nothing to display").addClass("hint").removeClass("error");q.css("display","none");var f=c.r;l=c.r;var g=s.get("Correlation"),h=s.get("pies"),r=Object.keys(f).length+1;if(k=r,r<2)p.css("display","none");else{p.css("display","block");for(var t=new Array(r+1),u=new Array(r),w=new Array(r*(r-1)/2),x=new Array(r*(r-1)/2),y=new Array(r*(r-1)/2),z=0;zsummarydatacorrelation
      Initializing...
      ");var h=g.find(".tableviewer_container");g.find(".summary").click(function(){l()}),g.find(".data").click(function(){m()}),g.find(".correlation").click(function(){n()});var i,j=b,k=function(){i&&(i(),i=b);var a=g.find(".titleCommand, .titleCommand-on"),c=a.filter("."+j),d=a.filter(":not(."+j+")");c.addClass("titleCommand-on").removeClass("titleCommand"),d.addClass("titleCommand").removeClass("titleCommand-on")},l=function(){"summary"!=j&&(j="summary",k(),o())},m=function(a){"data"!=j&&(j="data",k(),p(a))},n=function(){"correlation"!=j&&(j="correlation",k(),q())},o=function(){f.cancelRequests();var b=a.showSummary(h,f);f.saveAttribute("$view","tiles"),i=function(){h.is(".table-tileView")&&b.dispose()},h.on("tileSelected",function(a,b){m(b)})},p=function(b){f.cancelRequests();var c=a.showGrid(h,f,b);f.saveAttribute("$view","table"),i=function(){h.is(".table-tableView")&&c.dispose()}},q=function(){f.cancelRequests();var b=a.showCorrelations(h,f);f.saveAttribute("$view","correlation"),i=function(){h.is(".table-correlationView")&&b.dispose()}};return l(),{dispose:function(){i&&i(),g.html("")}}}}(a,c),a})}(window); +//# sourceMappingURL=angara.tablejs.min.js.map \ No newline at end of file diff --git a/dist/angara.tablejs.min.js.map b/dist/angara.tablejs.min.js.map new file mode 100644 index 0000000..bc700b0 --- /dev/null +++ b/dist/angara.tablejs.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["angara.tablejs.js"],"names":["window","undefined","factory","define","amd","$","Charting","InteractiveDataDisplay","jQuery","TableViewer","MathUtils","escapeHtml","s","t","toString","replace","i","charCodeAt","power10","p","n","getPrintFormat","min","max","std","extraPrec","posmax","Math","abs","Infinity","isNaN","x","alpha","log10","LN10","log","floor","p2","c1","this","toFixed","exponent","y","BoxPlot","jqDiv","master","base","CanvasPlot","_l95","_r95","_l68","_r68","_median","_min","_max","_height","draw","data","l95","r95","l68","r68","median","height","invalidateLocalBounds","requestNextFrameOrUpdate","fireAppearanceChanged","computeLocalBounds","getLocalPadding","padding","left","right","top","bottom","renderCore","plotRect","screenSize","getTransform","dataToScreenX","dataToScreenY","context","getContext","beginPath","strokeStyle","xmin_s","xmax_s","xl68_s","xl95_s","xr68_s","xr95_s","xmedian_x","yc_s","yt_s","yb_s","yt2_s","yb2_s","rad","moveTo","lineTo","stroke","strokeRect","arc","PI","prototype","document","ready","register","SelectedCellPlot","hs1","hs2","ws1","ws2","PiesMarker","prepare","Utils","isArray","length","mask","Int8Array","maskNaN","color","palette","colorPalette","isNormalized","r","getMinMax","makeNonEqual","absolute","colors","Array","rgba","getRgba","g","b","a","m","applyMask","marker","transform","xs","ys","rs","radius","value","width","fillStyle","closePath","fill","hitTest","ps","pd","TaskQueue","runningTask","tasks","cancelStatus","Task","func","response","Deferred","status","tryRunNextTask","task","shift","runTask","onTaskCancelled","reject","onTaskFailed","arg","onTaskCompleted","resolve","done","fail","e","isRunning","taskCount","queue","priority","len","splice","push","promise","clear","TableSource","tableDescription","columns","summary","name","type","totalRows","totalCount","pdf","dataByCols","correlation","onChanged","metadata","getDataAsync","startRow","rows","slices","map","col","slice","apply","getSummaryAsync","columnNumber","res","getPdfAsync","getCorrelationAsync","saveAttribute","key","getAttributeAsync","cancelRequests","TableColumnViewModel","number","table","TableViewModel","that","args","changeType","updateColumns","forEach","c","onColumnsChanged","colDef","index","Object","defineProperty","get","enumerable","configurable","getAttribute","saveView","getView","cancelAllRequests","typeToText","typeName","indexOf","substr","toLowerCase","TableTile","htmlElement","column","element","chart","bandPlot","boxplot","Padding","tickLength","bind","mouseOverBox","html","contentChart","find","asPlot","d3Chart","div","attr","appendTo","host","plot","Area","addChild","navigation","setVisibleRect","gestureSource","_drawSummary","true","false","count","css","isVisible","sqrt","variance","formatter","f","mean","lb68","ub68","lb95","ub95","range","h","vr","visibleRect","_drawPdf","drawArgs","y1","y2","fitToViewY","_onChanged","reason","text","dispose","empty","showSummary","tableSource","tiles","addClass","panel","panel_ul","_onColumnsChanged","ul","bindTile","tileDiv","event","trigger","li","tile","removeClass","options","fn","scrollView","each","animate","scrollLeft","offset","dataTableExt","oPagination","four_button","fnInit","oSettings","nPaging","fnCallbackDraw","nFirst","createElement","nPrevious","nNext","nLast","appendChild","createTextNode","oLanguage","oPaginate","sFirst","sPrevious","sNext","sLast","className","click","oApi","_fnPageChange","fnUpdate","aanFeatures","an","iLen","buttons","getElementsByTagName","_iDisplayStart","fnDisplayEnd","fnRecordsDisplay","showGrid","activeColumn","tableui","formatters","isAutoFormatEnabled","_getTableData","sSource","aoData","fnCallback","fnGetKey","sKey","sEcho","result","total","coldata","aaData","iTotalRecords","iTotalDisplayRecords","k","row","alert","_enableAutoFormat","round_btn","title","_formatters","setFormat","colName","colHeader","_getColumnTitle","fnDraw","colType","columnName","_disableAutoFormat","remove","activeColumnName","panel_table","tbl","thead","tr","colDefs","def","j","sClass","mData","source","val","th","tbody","dataTable","bFilter","bSort","bAutoWidth","bSortClasses","bProcessing","bServerSide","sAjaxSource","sDom","sPaginationType","fnServerData","bStateSave","fnStateSave","oData","settings","start","iStart","iLength","JSON","stringify","aoColumns","iDisplayLength","tableSettings","iDisplayStart","sEmptyTable","sInfo","sInfoEmpty","sLengthMenu","sLoadingRecords","sProcessing","on","iCol","parentNode","parse","showCorrelations","axisLeft","axisTop","varsN","pcc","selectedCellIndex","isInverted","ColorPalette","reqId","correlationViewContainer","append","msgDiv","figureDiv","figure","isToolTipEnabled","Gestures","getGesturesStream","legendDiv","heatmap","legend","Legend","_showDetailsFor","selectedCell","varX","varY","l","isSchemaChanged","cols","myReqId","pies","keys","xp","yp","fp","fi","ri","values","shape","labels","labelsHor","axis","addAxis","ticks","rotate","FontSize","updateLayout","grid","xAxis","yAxis","dataTransform","DataTransform","fitToView","err","onClick","origin_s","origin_p","show","content","container","showData","showCorrelation","_destroyActiveControl","_activePage","switchUI","commands","filter","off","showTileView","showTableView","showCorrelationView","control","is"],"mappings":"CAAC,SAASA,EAAQC,IAClB,SAAUC,GAEc,kBA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L,EAAIxM,SAAS,gBAAgBW,YAAY,oBAEzCd,EAAc,WACK,WAAfuM,IACAA,EAAc,UACdC,IACAI,MAGJR,EAAW,SAAU5I,GACF,QAAf+I,IACAA,EAAc,OACdC,IACAK,EAAcrJ,KAGlB6I,EAAkB,WACC,eAAfE,IACAA,EAAc,cACdC,IACAM,MAGJF,EAAe,WACf3M,EAAYpF,gBACZ,IAAIkS,GAAU5e,EAAY6R,YAAYmM,EAAWlM,EACjDA,GAAYvF,cAAc,QAAS,SACnC4R,EAAwB,WAChBH,EAAUa,GAAG,oBAAoBD,EAAQjN,WAEjDqM,EAAU9D,GAAG,eAAgB,SAAU3H,EAAO4E,GAC1C8G,EAAS9G,MAGbuH,EAAgB,SAAUvH,GAC1BrF,EAAYpF,gBACZ,IAAIkS,GAAU5e,EAAYoV,SAAS4I,EAAWlM,EAAaqF,EAC3DrF,GAAYvF,cAAc,QAAS,SACnC4R,EAAwB,WAChBH,EAAUa,GAAG,qBAAqBD,EAAQjN,YAGlDgN,EAAsB,WACtB7M,EAAYpF,gBACZ,IAAIkS,GAAU5e,EAAYsa,iBAAiB0D,EAAWlM,EACtDA,GAAYvF,cAAc,QAAS,eACnC4R,EAAwB,WAChBH,EAAUa,GAAG,2BAA2BD,EAAQjN,WAI5D,OADAE,MAEIF,QAAS,WACDwM,GAAuBA,IAC3Bhc,EAAM8M,KAAK,QAIzBjP,EAAaJ,GAERI,KAELT","file":"angara.tablejs.min.js"} \ No newline at end of file diff --git a/dist/img/back.png b/dist/img/back.png new file mode 100644 index 0000000000000000000000000000000000000000..d60722a4ec77613a85255df52eceaae21e49fcc1 GIT binary patch literal 248 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+1|-AI^@Rf|mUKs7M+SzC{oH>NS%G}c0*}aI z1_r)EAj~ML;ne^XlqhkHC<)F_D=AMbN@XZW%*-p%%S$a$Fwry6v&=EB^8>0W^K@|x zvG8Ae(Nd^ELBJ)@X6CU9&HRT&kus|!PCZS2=X>pWm@m$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