fin-hypergrid
Advanced tools
Comparing version 2.1.8 to 2.1.9
{ | ||
"name": "fin-hypergrid", | ||
"version": "2.1.8", | ||
"version": "2.1.9", | ||
"description": "Canvas-based high-performance grid", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -11,3 +11,3 @@ [![Build Status](https://travis-ci.org/openfin/fin-hypergrid.svg?branch=develop)](https://travis-ci.org/openfin/fin-hypergrid) | ||
## Table of Contents | ||
* [Current Release](#current-release-217---14-april-2018) | ||
* [Current Release](#current-release-219---1-may-2018) | ||
* [Demos](#demos) | ||
@@ -20,5 +20,5 @@ * [Features](#features) | ||
### Current Release (2.1.8 - 24 April 2018) | ||
### Current Release (2.1.9 - 1 May 2018) | ||
**Hypergrid 2.1.8** includes bug fixes. | ||
**Hypergrid 2.1.9** includes bug fixes. | ||
@@ -57,3 +57,3 @@ _For a complete list of changes, see the [release notes](https://github.com/fin-hypergrid/core/releases)._ | ||
We also maintain versioned [online API documentation](https://fin-hypergrid.github.io/core/2.1.8/doc/Hypergrid.html) for all public objects and modules. This documentation is necessarily an on-going work-in-progress. | ||
We also maintain versioned [online API documentation](https://fin-hypergrid.github.io/core/2.1.9/doc/Hypergrid.html) for all public objects and modules. This documentation is necessarily an on-going work-in-progress. | ||
@@ -64,3 +64,3 @@ (Cell editor information can be found [here](https://github.com/fin-hypergrid/core/wiki/Cell-Editors).) | ||
Hypergrid global configurations can be found [here](https://fin-hypergrid.github.io/core/2.1.8/doc/module-defaults.html). | ||
Hypergrid global configurations can be found [here](https://fin-hypergrid.github.io/core/2.1.9/doc/module-defaults.html). | ||
@@ -67,0 +67,0 @@ ### Roadmap |
@@ -513,2 +513,26 @@ 'use strict'; | ||
/** | ||
* When {@link module:defaults.gridLinesV} is truthy, determines if lines render in the column headers area. | ||
* @type {boolean} | ||
* @default | ||
* @memberOf module:defaults | ||
*/ | ||
gridLinesColumnHeader: true, | ||
/** | ||
* When {@link module:defaults.gridLinesH} is truthy, determines if lines render in the row headers area. | ||
* @type {boolean} | ||
* @default | ||
* @memberOf module:defaults | ||
*/ | ||
gridLinesRowHeader: true, | ||
/** | ||
* When {@link module:defaults.gridLinesV} or {@link module:defaults.gridLinesH} are truthy, determines if lines render in the user data area. | ||
* @type {boolean} | ||
* @default | ||
* @memberOf module:defaults | ||
*/ | ||
gridLinesUserDataArea: true, | ||
/** | ||
* Set canvas's CSS border to this string as well as `gridBorderLeft`, `gridBorderRight`, `gridBorderTop`, and `gridBorderBottom`. | ||
@@ -664,2 +688,3 @@ * If set to `true`, uses current `lineWidth` and `lineColor`. | ||
/** | ||
* Normally multiple calls to {@link Hypergrid#repaint grid.repaint()}, {@link Hypergrid#reindex grid.reindex()}, {@link Hypergrid#behaviorShapeChanged grid.behaviorShapeChanged()}, and/or {@link Hypergrid#behaviorStateChanged grid.behaviorStateChanged()} defer their actions until just before the next scheduled render. For debugging purposes, set `repaintImmediately` to truthy to carry out these actions immediately while leaving the paint loop running for when you resume execution. Alternatively, call {@link Canvas#stopPaintLoop grid.canvas.stopPaintLoop()}. Caveat: Both these modes are for debugging purposes only and may not render the grid perfectly for all interactions. | ||
* @default | ||
@@ -666,0 +691,0 @@ * @type {boolean} |
@@ -184,3 +184,3 @@ /* eslint-env browser */ | ||
var self = this; | ||
this.dirty = true; | ||
this.requestRepaint(); | ||
this.tickPainter = function(now) { | ||
@@ -529,4 +529,12 @@ self.tickPaint(now); | ||
paintLoopRunning: function() { | ||
return !!paintRequest; | ||
}, | ||
requestRepaint: function() { | ||
this.dirty = true; | ||
}, | ||
repaint: function() { | ||
this.dirty = true; | ||
this.requestRepaint(); | ||
if (!paintRequest || this.component.properties.repaintIntervalRate === 0) { | ||
@@ -533,0 +541,0 @@ this.paintNow(); |
@@ -843,11 +843,12 @@ /* eslint-env browser */ | ||
paintGridlines: function(gc) { | ||
var visibleColumns = this.visibleColumns, C = visibleColumns.length, c, vc, | ||
visibleRows = this.visibleRows, R = visibleRows.length, r, vr; | ||
var visibleColumns = this.visibleColumns, C = visibleColumns.length, | ||
visibleRows = this.visibleRows, R = visibleRows.length; | ||
if (C && R) { | ||
var gridProps = this.properties, | ||
viewWidth = visibleColumns[C - 1].right, | ||
viewHeight = visibleRows[R - 1].bottom, | ||
gridLinesVWidth = gridProps.gridLinesVWidth, | ||
gridLinesHWidth = gridProps.gridLinesHWidth, | ||
C1 = C - 1, | ||
R1 = R - 1, | ||
rowHeader, | ||
viewWidth = visibleColumns[C1].right, | ||
viewHeight = visibleRows[R1].bottom, | ||
gridLinesVColor = gridProps.gridLinesVColor, | ||
@@ -857,29 +858,42 @@ gridLinesHColor = gridProps.gridLinesHColor, | ||
if (gridProps.gridLinesV) { | ||
if (gridProps.gridLinesV && (gridProps.gridLinesColumnHeader || gridProps.gridLinesUserDataArea)) { | ||
var gridLinesVWidth = gridProps.gridLinesVWidth, | ||
top = gridProps.gridLinesColumnHeader ? 0 : visibleRows[this.grid.getHeaderRowCount()].top, | ||
bottom = gridProps.gridLinesUserDataArea ? viewHeight : visibleRows[this.grid.getHeaderRowCount() - 1].bottom; | ||
gc.cache.fillStyle = gridLinesVColor; | ||
for ( | ||
c = -1, vc = visibleColumns[c - 1]; // initial c = -2 is the row number column | ||
c < C; | ||
vc = visibleColumns[c++] | ||
) { | ||
if (vc) { // row number column and/or tree column may not be defined | ||
var x = vc.right; | ||
visibleColumns.forEachWithNeg(function(vc, c) { | ||
if ( | ||
vc && // tree column may not be defined | ||
c < C1 // don't draw rule after last column | ||
) { | ||
var x = vc.right, | ||
lineTop = Math.max(top, vc.top || 0), // vc.top may be set by grouped headers plug-in | ||
height = bottom - lineTop; | ||
if (borderBox) { x -= gridLinesVWidth; } | ||
gc.fillRect(x, 0, gridLinesVWidth, viewHeight); | ||
gc.fillRect(x, lineTop, gridLinesVWidth, height); | ||
} | ||
} | ||
}); | ||
} | ||
if (gridProps.gridLinesH) { | ||
if ( | ||
gridProps.gridLinesH && ( | ||
gridProps.gridLinesUserDataArea || | ||
(rowHeader = gridProps.gridLinesRowHeader && (visibleColumns[-1] || visibleColumns[-2])) | ||
) | ||
) { | ||
var gridLinesHWidth = gridProps.gridLinesHWidth, | ||
left = gridProps.gridLinesRowHeader ? 0 : visibleColumns[0].left, | ||
right = gridProps.gridLinesUserDataArea ? viewWidth : rowHeader.right; | ||
gc.cache.fillStyle = gridLinesHColor; | ||
for ( | ||
r = 1, vr = visibleRows[r - 1]; // initial r = 0 is the top row | ||
r < R; | ||
vr = visibleRows[r++] | ||
) { | ||
var y = vr.bottom; | ||
if (borderBox) { y -= gridLinesHWidth; } | ||
gc.fillRect(0, y, viewWidth, gridLinesHWidth); | ||
} | ||
visibleRows.forEach(function(vr, r) { | ||
if (r < R1) { // don't draw rule below last row | ||
var y = vr.bottom; | ||
if (borderBox) { y -= gridLinesHWidth; } | ||
gc.fillRect(left, y, right - left, gridLinesHWidth); | ||
} | ||
}); | ||
} | ||
@@ -1257,3 +1271,3 @@ | ||
this.visibleColumns.length = 0; | ||
this.visibleColumns.gap = undefined; | ||
this.visibleColumns.gap = this.visibleColumns[-1] = this.visibleColumns[-2] = undefined; | ||
@@ -1260,0 +1274,0 @@ this.visibleRows.length = 0; |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
724569
18353