0.0.24 • Published 4 years ago

liminoid-react v0.0.24

Weekly downloads
7
License
MIT
Repository
github
Last release
4 years ago

Like react-live that can run the scientific Python stack... powered by liminoid-js

Installation

$ yarn add liminoid-react

or

$ npm install --save liminoid-react

Usage

For a more comprehensive guide to using the package see the documentation or browse the examples.

// easiest to use ES6 imports from the UNPKG CDN
import Liminoid from 'https://cdn.liminoid.io/liminoid-react/index.js';

//import { Repl } from 'https://cdn.liminoid.io/liminoid-js/index.js';
// import { Repl } from https://cdn.liminoid.io/liminoid-js@x.x.x/index.js

const placeholder = `
from sklearn import svm
from sklearn import datasets
clf = svm.SVC()
X, y = datasets.load_iris(return_X_y=True)
clf.fit(X, y)
clf.predict(X[0:1])
`;

<Liminoid
  packages={['scikit-learn']}
  console={true}
  edit={true}
  scope={false}
  onResult={res => console.log(res)}
  code={placeholder}
/>

props

namedefaultvaluesdescription
packages[]Array: package names currently avalable in PyodideUses Pyodide's loadPackage() to preload packages
consoletrueBoolean: true or falsefalse disables the HTML console which displays the results.
edittrueBoolean: true or falsefalse disables the textarea input while still allowing the embedded code to be run.
scopefalseBoolean: true or falsetrue creates a new Repl() for the component with its own Python context. false shares the Repl() context between editors globally, i.e. one editor can reference variables from another.
onResultundefinedFunction: function expression or referencecallback function that receives the results when the code is run. (res, err) => { ... }
codeundefinedString or template literalplaceholder code that populates the editor component on initialization.

Contributing/Requests

Open an issue or post a message in the chatroom. If you would like to contribute to the project (code, documentation, tutorials, etc.) see the contributing guide for how to get started 🙌

Citing

While not required, when using (or extending) Liminoid for academic work, citations are appreciated 🙏

@software{liminoid,
  author = {Jonathan Dinu},
  title = {Liminoid: Web assembly toolkit for building local-first interactive analytics applications},
  month = {March},
  year = {2020},
  version = {0.0.1},
  doi = {10.5281/zenodo.3754953},
  url = {https://github.com/liminoid},
}

License

All original work licensed under either of:

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

0.0.24

4 years ago

0.0.23

4 years ago

0.0.22

4 years ago

0.0.21

4 years ago

0.0.20

4 years ago

0.0.18

4 years ago

0.0.19

4 years ago

0.0.17

4 years ago

0.0.16

4 years ago

0.0.14

4 years ago

0.0.15

4 years ago

0.0.13

4 years ago

0.0.12

4 years ago

0.0.11

4 years ago

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago