我已经为我的Jupyter笔记本创建了一个javascript扩展,它将为我绘制一些数据.现在我在扩展程序中对数据进行了硬编码.我的问题:有没有办法访问笔记本中存在的数据对象?
例如,下面是扩展的一些示例代码:
define([
    'base/js/namespace'
], function(
    Jupyter
) {
  function test_second_extension() {
    var handler = function () {
      console.log(
          'This is the current notebook application instance:',
          Jupyter.notebook
      );
      var data = [{"x": 1, "y": 5}, {"x": 2, "y":12}, {"x": 3, "y": 27}];
      console.log(data);
    };
    var action = {
        icon: 'fa-comment-o', // a font-awesome class used on buttons, etc
        help    : 'Print notebook instance',
        help_index : 'zz',
        handler : handler
    };
    var prefix = 'test_second_extension';
    var action_name = 'show-alert';
    var full_action_name …Run Code Online (Sandbox Code Playgroud)