2

I am trying to load d3 and dimple.js in ipython notebook but its throwing error. I have tried require as well but not able to load please provide me some way out of it

1
  • You need node.js kernel to run your notenook. Commented Apr 7, 2017 at 15:01

1 Answer 1

6
  1. Run this in the notebook to find out your jupyter directory:

    from jupyter_core.paths import jupyter_config_dir
    jupyter_dir = jupyter_config_dir()
    jupyter_dir
    
  2. Create folder named 'custom' under jupyter directory found from above /custom

  3. Create custom.js file under /custom/custom.js and add following

    requirejs.config({
    paths: {
        d3: 'd3.min',
    }
    });
    
  4. Open jupyter_notebook_config.py created for your profile. if it is not created ,use the following to create one from the command line/terminal

    jupyter notebook --generate-config
    
  5. Modify static path for your js folder in jupyter_notebook_config.py(created from generate-config command) like below

    c.NotebookApp.extra_static_paths = ["C:\your-js-folder"]
    
  6. Drop your external js file under C:\your-js-folder and stop and start jupyter notebook

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.