Skip to content

Plotly introduces errors with magic syntax highlighting in Jupyter #427

Closed
@msftristew

Description

@msftristew

It looks like the init_notebook_mode() function introduces some conflicts with Jupyter that causes magics syntax highlighting in IPython to not work correctly. The issue is that Plotly seems to conflict with the mechanism that Jupyter uses for magics syntax highlighting.

Repro steps:

  1. Make a simple IPython wrapper kernel and configure it to use syntax highlighting for a non-Python language in a cell with a particular cell magic, e.g. SQL syntax highlighting after the %%sql magic
  2. Run init_notebook_mode in a cell
  3. Try to run a cell with the %%sql magic; syntax highlighting will not work and errors will be logged to the JS console

Here are some screenshots for my machine. Syntax highlighting gets turned off after I run init_notebook_mode:

image

When I type %%sql in the cell, these errors get logged:

image

... so it looks like the call to init_notebook_mode is interfering with Jupyter's require.js machinery in some way.

I am wondering if this issue is related to issue 90 or if it happens to have been solved in this commit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions