Skip to content

Commit

Permalink
chore: release v0.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
nonzzz committed Jan 28, 2025
1 parent 88fcc75 commit 8b392ba
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.3.1

Add render fallback.

## 0.3.0

Happy New year. This version improves performance and provides a smooth UI.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "squarified",
"version": "0.3.0",
"version": "0.3.1",
"description": "squarified tree map",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down
3 changes: 3 additions & 0 deletions src/primitives/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ export class RenderCache extends Canvas implements Cache {
resetLayout(treemap, width * a, height * d)
drawGraphIntoCanvas(treemap, { c: this.canvas, ctx: this.ctx, dpr: devicePixelRatio })
this.$memory = true
if (this.ctx.isContextLost()) {
this.$memory = false
}
}
destroy() {
this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height)
Expand Down
10 changes: 7 additions & 3 deletions src/primitives/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,6 @@ export class TreemapEvent extends DOMEvent {
private onwheel(ctx: TreemapEventContext, metadata: DOMEventMetadata<'wheel'>) {
ctx.treemap.renderCache.destroy()

this.silent('mousedown')
this.exposedEvent.silent('mousemove')
this.silent('mousemove')
const { native } = metadata
const { treemap } = ctx
// @ts-expect-error safe
Expand All @@ -306,6 +303,11 @@ export class TreemapEvent extends DOMEvent {
const translateX = offsetX - (offsetX - this.matrix.e) * delta
const translateY = offsetY - (offsetY - this.matrix.f) * delta
runEffect((progress, cleanup) => {
this.silent('mousedown')
this.exposedEvent.silent('mousemove')
this.silent('mousemove')
this.silent('click')
this.exposedEvent.silent('click')
cleanup()
treemap.highlight.reset()
treemap.highlight.setZIndexForHighlight()
Expand Down Expand Up @@ -335,6 +337,8 @@ export class TreemapEvent extends DOMEvent {
this.active('mousedown')
this.active('mousemove')
this.exposedEvent.active('mousemove')
this.active('click')
this.exposedEvent.active('click')
}
})
}
Expand Down

0 comments on commit 8b392ba

Please sign in to comment.