       console.log("Unexpected data: " + data)
 
   activate: (state) ->
+    window.protoReplCharts = this
     @registerExtension()
 
     @subscriptions = new CompositeDisposable

      pane = atom.workspace.paneForItem(item)
      @handleActivePaneItemChanged(pane, item)


    # TODO if you close a chart view and then rerun the code then it doesn't reopen it.
    # no exception occurs
    atom.workspace.onDidDestroyPaneItem (event)=>
      item = event.item
      pane = event.pane


      return unless protocol == PROTOCOL

      name = pathname.substr(1)
      if host == "chart"
        new ChartView(name)
      else if host == "table"
        new TableView(name)
      else
        console.log("Unexpected host #{host} in #{uriToOpen}")

