如何将工具提示/悬停框添加到jupyter实验室扩展



悬停示例

如何将悬停文本添加到jupyterlab中的自定义扩展中,如上图所示。我正在jupyter实验室中使用react进行扩展,但我想在悬停框中添加扩展的描述。但是我想不通。

要在扩展中添加悬停框,必须将值传递给[widgetInstance].title.cation例如:

const extension: JupyterFrontEndPlugin<void> = {
id: 'some-id',
autoStart: true || false,
activate: async(app: JupyterFrontEnd, palette: ICommandPalette) => {
const { commands } = app;
let widget1: widget= new widget(); // create the widget
widget1.id = 'widget1-id';
widget1.title.label = 'widget Label';
widget1.title.caption="widget hovering text description"; // this will show the text when you hover over an extension
app.shell.add(widget1, 'right', { rank: 1 });
...
...
... rest of your code ...
}

最新更新