Skip to content

Commit

Permalink
chore: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
nonzzz committed Jan 29, 2025
1 parent 8b392ba commit 2c46916
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Squarified

`squarified` is a mini treemap component.
`squarified` is a minimal and powerful treemap component.

![display](./data.gif)

Expand Down
Binary file modified data.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion src/primitives/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ function drawHighlight(treemap: TreemapLayout, evt: TreemapEvent) {

// TODO: Do we need turn off internal events?
export class TreemapEvent extends DOMEvent {
private exposedEvent: _Event<ExposedEventDefinition>
exposedEvent: _Event<ExposedEventDefinition>
state: TreemapEventState
zoom: ReturnType<typeof createOnZoom>
constructor(app: App, treemap: TreemapLayout) {
Expand Down Expand Up @@ -382,6 +382,8 @@ function createOnZoom(treemap: TreemapLayout, evt: TreemapEvent) {
const translateY = (boundingClientRect.height / 2) - (my + mh / 2) * factor
runEffect((progress, cleanup) => {
cleanup()
evt.silent('mousemove')
evt.exposedEvent.silent('mousemove')
treemap.fontCache.flush(treemap, evt.matrix)
const easedProgress = easing.cubicInOut(progress)
const scale = (targetScale - evt.matrix.a) * easedProgress
Expand All @@ -399,6 +401,8 @@ function createOnZoom(treemap: TreemapLayout, evt: TreemapEvent) {
duration: ANIMATION_DURATION,
onStop: () => {
evt.state.isZooming = false
evt.active('mousemove')
evt.exposedEvent.active('mousemove')
}
})
}
Expand Down

0 comments on commit 2c46916

Please sign in to comment.