Skip to content

Commit 4c7ad9a

Browse files
authored
Rename pixelratio -> ratio, send close event (#13)
* Send close event and fix show/hide timestamp key * Also rename pixelratio -> ratio * update date
1 parent 2aabf22 commit 4c7ad9a

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

src/renderview.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,11 @@ class BaseRenderView {
177177
this.wrapperElement.innerHTML = ''
178178
this.wrapperElement = null
179179
}
180+
const event = {
181+
type: 'close',
182+
timestamp: getTimestamp()
183+
}
184+
this.onEvent(event)
180185
}
181186

182187
/**
@@ -395,7 +400,7 @@ class BaseRenderView {
395400
this._isVisible = isVisible
396401
const event = {
397402
type: isVisible ? 'show' : 'hide',
398-
t: getTimestamp()
403+
timestamp: getTimestamp()
399404
}
400405
this.onEvent(event)
401406
}
@@ -461,7 +466,7 @@ class BaseRenderView {
461466
height: logicalHeight,
462467
pwidth: physicalWidth,
463468
pheight: physicalHeight,
464-
pixelratio: ratio,
469+
ratio,
465470
timestamp: getTimestamp()
466471
}
467472
this.onEvent(event)

src/spec.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
A protocol for interactive rendering surfaces.
55

6-
*Last update: 18-03-2026*
6+
*Last update: 19-03-2026*
77

88
*This spec was previously known as the jupyter_rfb event spec, but was rolled into a separate project.*
99

@@ -70,7 +70,7 @@ Fields:
7070
* `height`: The height in logical pixels.
7171
* `pwidth`: The width in physical pixels.
7272
* `pheight`: The height in physical pixels.
73-
* `pixelratio`: The pixel ratio between logical and physical pixels.
73+
* `ratio`: The pixel ratio between logical and physical pixels.
7474
* `timestamp`: A timestamp in seconds.
7575

7676

0 commit comments

Comments
 (0)