Skip to content

Commit

Permalink
Clarify api narrowing
Browse files Browse the repository at this point in the history
  • Loading branch information
manzt committed Sep 2, 2024
1 parent f798689 commit f5c4ebd
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions papers/manz_anywidget/main.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,14 +219,17 @@ export default {
```
An anywidget front-end module (AFM) with initialization and rendering lifecycle
methods. For familiarity, AFM methods use naming conventions from traditional
Jupyter Widgets; however, AFM narrows down the APIs. _Methods_: The
`initialize` and `render` methods correspond to different stages in the
widget's lifecycle. During model initialization, a front-end model is created
and synchronized with the kernel. In the rendering stage, each notebook cell
displaying a widget object renders an independent view based on the synced
model state. _Arguments_: The interface of `model` is restricted to a minimal
set of methods for communicating with the kernel (retrieving, updating, and
responding to value changes). The `el` argument is a standard web
Jupyter Widgets; however, AFM [narrows down the
APIs](https://observablehq.com/@manzt/afm-narrowing-widget-front-end-apis)
provided to these methods, making it easier to load and execute AFMs in
new environments. _Methods_: The `initialize` and `render` methods correspond
to different stages in the widget's lifecycle. During model initialization, a
front-end model is created and synchronized with the kernel. In the rendering
stage, each notebook cell displaying a widget object renders an independent
view based on the synced model state. _Arguments_: The interface of `model` is
restricted to a minimal set of methods for communicating with the kernel
(retrieving, updating, and responding to value changes). The `el` argument is a
standard web
[`HTMLElement`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element).
:::

Expand Down

0 comments on commit f5c4ebd

Please sign in to comment.