Skip to content

Commit

Permalink
touch up references to figures
Browse files Browse the repository at this point in the history
  • Loading branch information
manzt committed Jun 6, 2024
1 parent 39dee42 commit 4473b94
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions paper/paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,7 @@ interactive visualizations across computational notebooks.

The **Anywidget Front-End Module (AFM)** is a specification for widget
front-end code based on ECMAScript (ES) modules, the built-in module system for
web browsers. Widget behavior is defined through methods for managing a
widget’s lifecycle, such as initialization, rendering, and destruction (Figure
2). Running AFM requires a host platform to load the module and call each of
these lifecycle methods with a set of required interfaces. These interfaces
include minimal APIs for the AFM to communicate with the host and modify the
output user interface (UI).
web browsers.

```js
export default {
Expand All @@ -105,10 +100,11 @@ export default {
};
```

> The Anywidget Front-End Module. Widget behavior is defined through different
> life-cycle methods. The `model` parameter is a reference to the widget model,
> an object that facilitates communication with the host platform. The `el`
> parameter is a reference to the DOM element where the widget is rendered.
Widget behavior is defined through methods for managing a widget’s lifecycle,
such as initialization, rendering, and destruction. Running AFM requires a host
platform to load the module and call each of these lifecycle methods with a set
of required interfaces. These interfaces include minimal APIs for the AFM to
communicate with the host and modify the output user interface (UI).

Importantly, AFM does not impose specific implementations for widget state or
UI management. By making host requirements explicit, it decouples widget
Expand All @@ -117,7 +113,7 @@ front-end code from host implementations, thereby improving widget portability
module, either inline or in a separate file, without a build process
(\autoref{fig:afm-and-anywidget} a, top). For better ergonomics when creating
UIs, developers can introduce a build step targeting AFM to utilize advanced
tools (\autoref{fig:afm-and-anywidget} a, bottom).
tools (\autoref{fig:afm-and-anywidget}a, bottom).

![AFM (a) is either authored in web-standard ECMAScript (top) or using a
front-end framework bridge (bottom). (b) The anywidget Python package allows
Expand All @@ -130,7 +126,7 @@ uses front-end frameworks, such as React or Svelte, which introduce
non-standard syntax and unique paradigms for UI and state management. Rather
than incorporate such frameworks into the AFM specification, the anywidget
project provides several _framework bridges_ to make it easier to author AFMs
using frameworks (\autoref{fig:afm-and-anywidget} a, bottom). These libraries
using frameworks (\autoref{fig:afm-and-anywidget}a, bottom). These libraries
provide utilities to use idiomatic APIs and constructs to manage widget state
and to wrap those constructs into the AFM lifecycle methods used by host
platforms. For example, anywidget’s React bridge exposes a React-based
Expand All @@ -152,18 +148,19 @@ the AFM specification, meaning that changes cannot break host compatibility.

The main library for the project is `anywidget`, a Python package that
simplifies the authoring and distribution of custom Jupyter Widgets using AFM
(\autoref{fig:afm-and-anywidget} b, top). Jupyter Widgets [@ipywidgets] are
the official framework from Jupyter to extend notebooks with interactive views
and controls for objects that reside in the kernel. Since widgets are integral
to Jupyter's architecture, they enjoy broad support across Jupyter-compatible
(\autoref{fig:afm-and-anywidget}b, top). Jupyter Widgets [@ipywidgets] are the
official framework from Jupyter to extend notebooks with interactive views and
controls for objects that reside in the kernel. Since widgets are integral to
Jupyter's architecture, they enjoy broad support across Jupyter-compatible
platforms (JCPs) such as JupyterLab, Google Colab, and Visual Studio Code.
However, developing and distributing cross-JCP widgets is complex and
error-prone [@scipy]. Anywidget addresses this complexity by providing the glue
code to turn each JCP into an AFM-compatible host. This compatibility layer
aligns AFM with Jupyter Widgets and the Python ecosystem, making anywidget a
powerful tool for creating and distributing interactive widgets across
platforms. Anywidgets can be remixed and reused with other custom Jupyter
Widgets in notebooks, standalone HTML pages, and dashboarding frameworks.
Widgets in notebooks, standalone HTML pages, and dashboarding frameworks
(\autoref{fig:afm-and-anywidget}b, bottom).

### Tooling for authorship and distribution

Expand Down

0 comments on commit 4473b94

Please sign in to comment.