@zambezi/grid
Advanced tools
Comparing version 0.14.0-horizontal-stacking-grid.2 to 0.14.0-horizontal-stacking-grid.3
{ | ||
"name": "@zambezi/grid", | ||
"version": "0.14.0-horizontal-stacking-grid.2", | ||
"version": "0.14.0-horizontal-stacking-grid.3", | ||
"description": "D3 component for drawing financial grids.", | ||
@@ -15,2 +15,3 @@ "keywords": [ | ||
"test": "mocha", | ||
"start": "npm run watch", | ||
"pretest": "npm run clean && npm run build", | ||
@@ -37,8 +38,9 @@ "prepublish": "npm test" | ||
"rimraf": "2.5.3", | ||
"rollup": "0.26.3", | ||
"rollup": "0.34.10", | ||
"rollup-plugin-babel": "2.3.9", | ||
"rollup-plugin-postcss": "0.1.1" | ||
"rollup-plugin-postcss": "0.1.1", | ||
"rollup-watch": "^2.5.0" | ||
}, | ||
"dependencies": { | ||
"@zambezi/d3-utils": "^3.3.0", | ||
"@zambezi/d3-utils": "3.4.0", | ||
"@zambezi/fun": "^2.0.1", | ||
@@ -45,0 +47,0 @@ "d3-array": "^1.0.1", |
@@ -260,10 +260,10 @@ import { columnDragTargetLayout as dragTargetLayout } from './column-drag-target-layout' | ||
} | ||
function clearHighlightTransition(d, i) { | ||
if (this !== s.node()) return | ||
sheet( | ||
cellSelector(d.column) | ||
, { animationName: '', webkitAnimationName: '' } | ||
) | ||
} | ||
} | ||
function clearHighlightTransition(d, i) { | ||
sheet( | ||
cellSelector(d.column) | ||
, { animationName: '', webkitAnimationName: '' } | ||
) | ||
} | ||
} | ||
@@ -270,0 +270,0 @@ |
@@ -85,3 +85,3 @@ import { calculateColumnLayout } from './calculate-column-layout' | ||
, grid = compose( | ||
call(() => dispatchDraw.call('draw')) | ||
each(doDispatchDraw) | ||
, call(runExternalComponents) | ||
@@ -116,2 +116,6 @@ , call(createScrollers()) | ||
return api(autodirty(redraw(throttle(throttleToAnimationFrame(skipWhenHidden(grid)), 10)))) | ||
function doDispatchDraw() { | ||
dispatchDraw.call('draw', this) | ||
} | ||
} |
@@ -20,3 +20,3 @@ import { appendIfMissing, each, rebind } from '@zambezi/d3-utils' | ||
, appendMaster = appendIfMissing('div.grid-page.master-grid') | ||
, api = rebind().from(masterGrid, 'columns', 'resizeColumnsByDefault', 'dragColumnsByDefault') | ||
, api = rebind().from(masterGrid, 'columns', 'resizeColumnsByDefault', 'dragColumnsByDefault', 'groupings') | ||
, sheet = createGridSheet() | ||
@@ -48,3 +48,3 @@ | ||
.on('column-resized.recalculate-width', () => pageWidth = calculatePageWidth()) | ||
.on('column-resized.update', () => updatePageWidthStyles(id, pageWidth)) | ||
.on('column-resized.update', () => updatePageWidthStyles(id)) | ||
.on('scroll.redraw', debounce(draw, 50, false)) | ||
@@ -55,3 +55,3 @@ | ||
updatePageWidthStyles(id, pageWidth) | ||
updatePageWidthStyles(id) | ||
draw() | ||
@@ -81,11 +81,21 @@ | ||
, { width } = target.node().getBoundingClientRect() | ||
, minLeft = scrollLeft | ||
, maxLeft = scrollLeft + width | ||
, left = scrollLeft | ||
, right = scrollLeft + width | ||
update.exit().remove() | ||
update.exit() | ||
.dispatch('destroy') | ||
.remove() | ||
update.merge(enter) | ||
const merge = update.merge(enter) | ||
merge | ||
.select(inView) | ||
.each(drawGridSlavePage) | ||
merge | ||
.select(not(inView)) | ||
.classed('is-visible', false) | ||
.dispatch('destroy') | ||
.html('') | ||
gridPool.length = chunks.length | ||
@@ -103,12 +113,18 @@ | ||
function not(f) { | ||
return function () { | ||
return !!f.apply(this, arguments) ? null : this | ||
} | ||
} | ||
function inView(d, i) { | ||
const leftEdge = (i + 1) * pageWidth | ||
, rightEdge = leftEdge + pageWidth | ||
, skip = (rightEdge < minLeft) || (leftEdge > maxLeft) | ||
, skip = (rightEdge < left) || (leftEdge > right) | ||
return skip ? null : this | ||
return skip ? null : this | ||
} | ||
function drawGridSlavePage(d, i) { | ||
const grid = gridPool[i] || createGrid() | ||
const grid = gridPool[i] || createGrid().on('draw.make-visible', makeVisible) | ||
@@ -140,3 +156,3 @@ select(this).call( | ||
function updatePageWidthStyles(id, pageWidth) { | ||
function updatePageWidthStyles(id) { | ||
const width = px(pageWidth) | ||
@@ -146,1 +162,5 @@ sheet( `#${id} .grid-page` , { width }) | ||
} | ||
function makeVisible() { | ||
select(this).classed('is-visible', true) | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
5574
445134
14
+ Added@zambezi/d3-utils@3.4.0(transitive)
- Removed@zambezi/d3-utils@3.5.1(transitive)
Updated@zambezi/d3-utils@3.4.0