Git Product home page Git Product logo

react-jupyter-notebook's Introduction

Joeyonng

This repository hosts my personal website where I primarily used to share my summaries on general machine learning methods (Knowledge) and my reading notes of the related papers (Notes).

My goal is to make my notes formal, comprehensive and most importantly, easy-to-read.

This repository is far from complete and I will continue to cover more topics as I learn more in my PhD journey.

Feel free to point any error you found in my notes. Any suggestions will be much appreciated!.

react-jupyter-notebook's People

Contributors

joeyonng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

react-jupyter-notebook's Issues

Can't apply .join('') to text

For a file in which the output block has the "text/plain" field of a string, the demo page gives error

TypeError: o.text/plain.join is not a function

When writing Jest test cases, throws error

Please see the code below

import React from 'react';
import JupyterViewer from "react-jupyter-notebook";

export default function Ipynb({file_content}) {
    return (
        <div className="jupternotebook" style={{position:'relative', left: '-15px'}}>
            <JupyterViewer rawIpynb={JSON.parse(file_content)}/>
        </div>
    );
};

It works fine with in the UI. it renders as expected.

But When I try to implement test case using jest.

It throws below error. could you please help me if you know.

image

Thanks.

Suggestion: Put the syntax as a prop

Hello, thanks a lot for sharing this amazing tool. I added it into a portfolio template website and it came out amazing. After fiddling around with the build code, I found the place in your code to choose which syntax to use. After messing with that and the background, I got the exact visual that I wanted. Could you please put which syntax to use as a prop for the component? Here are the list for the prism syntax colors. I can't thank you enough for this share.

Exact way to pass dark theme to codeBlockStyles prop

Hi,

First of Thanks a million for making such a great Library.

Just one question, I am passing dark theme to codeBlockStyles prop as below but its not changing the code theme. Probably I am missing something here.

import { dark } from "react-syntax-highlighter/dist/esm/styles/prism"

...

<JupyterViewer
          rawIpynb={nb_test}
          displaySource="show"
          displayOutput="show"
          codeBlockStyles={{ style: dark }}
        />

Doesn't work

When I place a <JupyterViewer> anywhere in my application, I get the error
Uncaught TypeError: Cannot read properties of undefined (reading 'map') from style-inject.es.js:26
If I remove the element, the error disappears instantly.

Stack trace:

at JupyterViewer (style-inject.es.js:26:1)
    at renderWithHooks (react-dom.development.js:14985:1)
    at mountIndeterminateComponent (react-dom.development.js:17811:1)
    at beginWork (react-dom.development.js:19049:1)
    at HTMLUnknownElement.callCallback (react-dom.development.js:3945:1)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:3994:1)
    at invokeGuardedCallback (react-dom.development.js:4056:1)
    at beginWork$1 (react-dom.development.js:23964:1)
    at performUnitOfWork (react-dom.development.js:22776:1)
    at workLoopSync (react-dom.development.js:22707:1)

react & react-dom should be declared in peerDependencies section

We are currently using this package on react 18 / react-dom 18, but our package manager decides to install a duplicate react 17 / react-dom 17 because the version spec in the package.json has restricted the react major version to be 17

https://github.com/Joeyonng/react-jupyter-notebook/blob/deddebcce78180818ba0d8479edf09f86f42f9ed/package.json#L34-35

Could you please

  1. Loosen the react version spec from ^17.0.1 to >=17.0.1
  2. Declare dependency to react / react-dom in peerDependencies section?

issue when using library with Next.js

When i try to use this library i get the following error:

./node_modules/react-jupyter-notebook/node_modules/katex/dist/katex.min.css
Global CSS cannot be imported from within node_modules.
Read more: https://nextjs.org/docs/messages/css-npm
Location: node_modules/react-jupyter-notebook/dist/index.js

it looks like this library library is incorrectly publishing css imports to npm.

relevant links:

Missing License file

This component works well, but for broader use I need to consider the license it is distributed under. Please consider adding a license file.

Markdown Options

Is it possible to expose options for react markdown.
So html can be allowed etc

Compatibility with svg outputs

Thank you for your amazing work with this component, which will be super useful for my blog. I was wondering if there was an easy way for the rendered notebook to also display vectorial images. I.e. have a cell like this actually display the output:

import matplotlib.pyplot as plt
import matplotlib_inline.backend_inline as backend_inline 
backend_inline.set_matplotlib_formats('svg')
plt.plot([1, 2, 3, 4])
plt.show()

I'm asking because vectorial rendering is much prettier on any modern screen.
Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.