How to use the @jupyter-widgets/output.OUTPUT_WIDGET_VERSION function in @jupyter-widgets/output

To help you get started, we’ve selected a few @jupyter-widgets/output examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github voila-dashboards / voila / js / output.js View on Github external
*                                                                          *
* The full license is in the file LICENSE, distributed with this software. *
****************************************************************************/

// This is mostly copied from
// https://github.com/jupyter-widgets/ipywidgets/blob/master/packages/jupyterlab-manager/src/output.ts

import * as outputBase from '@jupyter-widgets/output';

import { DOMWidgetView, JupyterPhosphorWidget } from '@jupyter-widgets/base';

import { Panel } from '@phosphor/widgets';

import { OutputAreaModel, OutputArea } from '@jupyterlab/outputarea';

const OUTPUT_WIDGET_VERSION = outputBase.OUTPUT_WIDGET_VERSION;

export
class OutputModel extends outputBase.OutputModel {
    defaults() {
        return {
            ...super.defaults(),
            msg_id: ''
        };
    }

    initialize(attributes, options) {
        super.initialize(attributes, options)
        // The output area model is trusted since widgets are
        // only rendered in trusted contexts.
        this._outputs = new OutputAreaModel({trusted: true});
        this.listenTo(this, 'change:msg_id', this.onMsgIdChange);
github pbugnion / ipywidgets_server / js / output.js View on Github external
// This is mostly copied from
// https://github.com/jupyter-widgets/ipywidgets/blob/master/packages/jupyterlab-manager/src/output.ts

import * as outputBase from '@jupyter-widgets/output';

import { DOMWidgetView, JupyterPhosphorWidget } from '@jupyter-widgets/base';

import { Panel } from '@phosphor/widgets';

import { OutputAreaModel, OutputArea } from '@jupyterlab/outputarea';

import { renderMime } from './renderMime'

const OUTPUT_WIDGET_VERSION = outputBase.OUTPUT_WIDGET_VERSION;

export
class OutputModel extends outputBase.OutputModel {
    defaults() {
        return {
            ...super.defaults(),
            msg_id: ''
        };
    }

    initialize(attributes, options) {
        super.initialize(attributes, options)
        // The output area model is trusted since widgets are
        // only rendered in trusted contexts.
        this._outputs = new OutputAreaModel({trusted: true});
        this.listenTo(this, 'change:msg_id', this.onMsgIdChange);
github jupyter-widgets / ipywidgets / packages / jupyterlab-manager / src / output.ts View on Github external
import {
  OutputAreaModel, OutputArea
} from '@jupyterlab/outputarea';

import {
  nbformat
} from '@jupyterlab/coreutils';

import {
  KernelMessage, Session
} from '@jupyterlab/services';

import $ from 'jquery';

export
const OUTPUT_WIDGET_VERSION = outputBase.OUTPUT_WIDGET_VERSION;

export
class OutputModel extends outputBase.OutputModel {
  defaults() {
    return {...super.defaults(),
      msg_id: '',
      outputs: []
    };
  }

  initialize(attributes: any, options: any) {
    super.initialize(attributes, options);
    // The output area model is trusted since widgets are only rendered in trusted contexts.
    this._outputs = new OutputAreaModel({trusted: true});
    this._msgHook = (msg) => {
      this.add(msg);
github minrk / thebelab / src / output.js View on Github external
// This is mostly copied from
// https://github.com/jupyter-widgets/ipywidgets/blob/master/packages/jupyterlab-manager/src/output.ts

import * as outputBase from "@jupyter-widgets/output";

import { DOMWidgetView, JupyterPhosphorWidget } from "@jupyter-widgets/base";

import { Panel } from "@phosphor/widgets";

import { OutputAreaModel, OutputArea } from "@jupyterlab/outputarea";

const OUTPUT_WIDGET_VERSION = outputBase.OUTPUT_WIDGET_VERSION;

export class OutputModel extends outputBase.OutputModel {
  defaults() {
    return Object.assign({}, super.defaults(), {
      msg_id: "",
    });
  }

  initialize(attributes, options) {
    super.initialize(attributes, options);
    // The output area model is trusted since widgets are
    // only rendered in trusted contexts.
    this._outputs = new OutputAreaModel({ trusted: true });
    this.listenTo(this, "change:msg_id", this.onMsgIdChange);
    this.onMsgIdChange();
  }
github nteract / nteract / packages / jupyter-widgets / src / renderer / output.tsx View on Github external
import {
  KernelOutputError,
  Media,
  Output,
  RichMedia,
  StreamText
} from "@nteract/outputs";

import WidgetManager from "../manager/widget-manager";

import { Outputs } from "@nteract/presentational-components";

import Immutable from "immutable";

export const OUTPUT_WIDGET_VERSION = output.OUTPUT_WIDGET_VERSION;

export class OutputModel extends output.OutputModel {
  private _outputs: any;
  initialize(attributes: any, options: any) {
    console.log(options);
    const { model_id } = options;
    const outputs = options.widget_manager.outputsByModelId(model_id);
    this.model_id = model_id;
    this._outputs = outputs;
    this.comm = options.comm;
    this.widget_manager = options.widget_manager;
  }

  callbacks() {
    return super.callbacks();
  }

@jupyter-widgets/output

Jupyter widget wrapping cell output

BSD-3-Clause
Latest version published 4 months ago

Package Health Score

84 / 100
Full package analysis

Similar packages