Skip to content

Commit e5acab1

Browse files
authored
3.0.1 (#80)
* Tweak animations * Fix focus ring draw next to sticky row * Icon * Update readme * Update license * Shhhhhhhhh * Boo github taking away all the fun
1 parent 54f8ecc commit e5acab1

File tree

6 files changed

+12
-10
lines changed

6 files changed

+12
-10
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 typeguard, Inc.
3+
Copyright (c) 2021 typeguard, Inc.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<h1 align="center">
2-
<b>Glide <span style="color: #30CC5C">Data</span> Grid</b>
2+
<img src="./icon.png" width="224px"/><br/>
3+
<b>Glide Data Grid</b>
34
</h1>
45
<p align="center">A relatively small HTML5 Canvas based data editor supporting <b>millions</b> of rows, <b>rapid</b> updating, and fully <b>native scrolling</b>. We built <a href="https://grid.glideapps.com" target="_blank">Data Grid</a> as the basis for the <a href="https://docs.glideapps.com/all/reference/data-editor/introduction-to-the-data-editor" target="_blank">Glide Data Editor</a>.</p>
56

6-
<p align="center"><a href="https://github.com/glideapps/glide-data-grid/releases" target="_blank"><img src="https://img.shields.io/badge/version-v3.0.0-blue?style=for-the-badge&logo=none" alt="grid version" /></a>&nbsp;<a href="https://reactjs.org/" target="_blank"><img src="https://img.shields.io/badge/React-16+-00ADD8?style=for-the-badge&logo=react" alt="react version" /></a>&nbsp;<a href="https://www.typescriptlang.org/" target="_blank"><img src="https://img.shields.io/badge/Typescript-grey?style=for-the-badge&logo=typescript" alt="react version" /></a>&nbsp;<a href="https://bundlephobia.com/package/@glideapps/glide-data-grid" target="_blank"><img src="https://img.shields.io/badge/Bundle_Size-48.7kb-success?style=for-the-badge&logo=none" alt="go cover" /></a>&nbsp;<img src="https://img.shields.io/badge/license-mit-red?style=for-the-badge&logo=none" alt="license" /></p>
7+
<p align="center"><a href="https://github.com/glideapps/glide-data-grid/releases" target="_blank"><img src="https://img.shields.io/badge/version-v3.0.0-blue?style=for-the-badge&logo=none" alt="grid version" /></a>&nbsp;<a href="https://reactjs.org/" target="_blank"><img src="https://img.shields.io/badge/React-16+-00ADD8?style=for-the-badge&logo=react" alt="react version" /></a>&nbsp;<a href="https://www.typescriptlang.org/" target="_blank"><img src="https://img.shields.io/badge/Typescript-grey?style=for-the-badge&logo=typescript" alt="react version" /></a>&nbsp;<a href="https://bundlephobia.com/package/@glideapps/glide-data-grid" target="_blank"><img src="https://img.shields.io/badge/Bundle_Size-48.7kb-success?style=for-the-badge&logo=none" alt="go cover" /></a>&nbsp;<img src="https://img.shields.io/badge/license-mit-red?style=for-the-badge&logo=none" alt="license" />&nbsp;<a href="https://www.glideapps.com/jobs" target="_blank"><img src="https://img.shields.io/badge/❤_Made_by-Glide-11CCE5?style=for-the-badge&logo=none" alt="glide" /></a></p>
78

89
![Data Grid](./data-grid.jpg)
910

icon.png

12.1 KB
Loading

src/data-grid/animation-manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ type StateItem = { item: Item; hoverAmount: number };
55
export type HoverValues = readonly Readonly<StateItem>[];
66
export type StepCallback = (values: HoverValues) => void;
77

8-
const hoverTime = 120;
8+
const hoverTime = 80;
99
const epsilon = 1e-6;
1010

1111
// Ported from webkit

src/data-grid/data-grid-lib.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,19 +197,20 @@ export function drawNewRowCell(
197197
const lineSize = isFirst ? finalLineSize : hoverAmount * finalLineSize;
198198
const xTranslate = isFirst ? 0 : (1 - hoverAmount) * finalLineSize * 0.5;
199199

200+
const padPlus = cellXPad + 4;
200201
if (lineSize > 0) {
201-
ctx.moveTo(x + cellXPad + xTranslate, y + height / 2);
202-
ctx.lineTo(x + cellXPad + xTranslate + lineSize, y + height / 2);
203-
ctx.moveTo(x + cellXPad + xTranslate + lineSize * 0.5, y + height / 2 - lineSize * 0.5 - 0.5);
204-
ctx.lineTo(x + cellXPad + xTranslate + lineSize * 0.5, y + height / 2 + lineSize * 0.5 + 0.5);
202+
ctx.moveTo(x + padPlus + xTranslate, y + height / 2);
203+
ctx.lineTo(x + padPlus + xTranslate + lineSize, y + height / 2);
204+
ctx.moveTo(x + padPlus + xTranslate + lineSize * 0.5, y + height / 2 - lineSize * 0.5);
205+
ctx.lineTo(x + padPlus + xTranslate + lineSize * 0.5, y + height / 2 + lineSize * 0.5);
205206
ctx.lineWidth = 2;
206207
ctx.strokeStyle = theme.bgIconHeader;
207208
ctx.lineCap = "round";
208209
ctx.stroke();
209210
}
210211

211212
ctx.fillStyle = theme.textMedium;
212-
ctx.fillText(data, 16 + x + cellXPad + 0.5, y + height / 2 + 4.5);
213+
ctx.fillText(data, 24 + x + cellXPad + 0.5, y + height / 2 + 4.5);
213214
ctx.beginPath();
214215
}
215216

src/data-grid/data-grid-render.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ function drawFocusRing(
823823
const [targetCol, targetRow] = selectedCell.cell;
824824

825825
const isStickyRow = lastRowSticky && targetRow === rows - 1;
826-
const stickRowHeight = lastRowSticky && !isStickyRow ? getRowHeight(rows - 1) : 0;
826+
const stickRowHeight = lastRowSticky && !isStickyRow ? getRowHeight(rows - 1) - 1 : 0;
827827

828828
ctx.beginPath();
829829
ctx.rect(0, headerHeight, width, height - headerHeight - stickRowHeight);

0 commit comments

Comments
 (0)