# liminoid-react

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

Latest version **0.0.24** (published 2020-05-20) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install liminoid-react
pnpm add liminoid-react
yarn add liminoid-react
bun add liminoid-react
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.0.24 |
| Published | 2020-05-20 |
| First published | 2020-03-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 449 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jonathan Dinu |
| Maintainers | clearspandex |
| Keywords | javascript, web assembly, python, pyodide, repl, react, liminoid, component |

## Links

- npm: https://www.npmjs.com/package/liminoid-react
- Repository: https://github.com/liminoid/liminoid-react
- Issues: https://github.com/liminoid/liminoid-react/issues
- npm.io page: https://npm.io/package/liminoid-react

## Dependencies (1)

- [postcss-nested](https://npm.io/package/postcss-nested.md) ^4.2.1

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.0.24 (latest) — 2020-05-20
- 0.0.23 — 2020-04-18
- 0.0.22 — 2020-04-17
- 0.0.21 — 2020-04-17
- 0.0.20 — 2020-04-17
- 0.0.19 — 2020-04-17
- 0.0.18 — 2020-04-16
- 0.0.17 — 2020-04-16
- 0.0.16 — 2020-04-15
- 0.0.15 — 2020-04-14
- 0.0.14 — 2020-04-13
- 0.0.13 — 2020-04-13
- 0.0.12 — 2020-04-09
- 0.0.11 — 2020-04-04
- 0.0.10 — 2020-04-04
- … 9 more at https://npm.io/package/liminoid-react/versions

## README

<div align="center">

  <h1>🔵🔴 &lt;Liminoid /> 🔴🔵</h1>

<strong>Like [`react-live`](https://github.com/FormidableLabs/react-live) that can run the scientific Python stack... powered by [liminoid-js](https://github.com/liminoid/liminoid-js)</strong>

</div>

<div align="center">
  <h4>
    <a href="https://liminoid.io/reference/react/">
      Documentation
    </a>
    <span> | </span>
    <a href="https://discord.gg/s6WQ9RS">
      Chatroom
    </a>
    <span> | </span>
    <a href="https://twitter.com/liminoid_io">
      Twitter
    </a>
    <span> | </span>
    <a href="https://stackoverflow.com/questions/tagged/liminoid">
      Stack Overflow
    </a>
    <span> | </span>
    <a href="https://liminoid.io/contributing/">
      Contributing
    </a>
  </h4>
</div>

## Installation

```sh
$ yarn add liminoid-react
```

or

```sh
$ npm install --save liminoid-react
```

## Usage

For a more comprehensive guide to using the package see the [documentation](https://liminoid.io/reference/react/) or browse the [examples](examples).

<!-- prettier-ignore -->
```jsx
// 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`

<!-- prettier-ignore -->
|  name  | default |   values  |  description  |
| :--------: | :-----: | :------: | :---------: |
| `packages` |  `[]`   | `Array`: [package names currently avalable](https://github.com/iodide-project/pyodide/tree/master/packages) in Pyodide   |  Uses Pyodide's [`loadPackage()`](https://pyodide.readthedocs.io/en/latest/using_pyodide_from_webworker.html#loading-packages) to preload packages   |
|  `console`  | `true`  | `Boolean`: `true` or `false` | `false` disables the HTML console which displays the results. |
|   `edit`   | `true`  |  `Boolean`: `true` or `false`   |  `false` disables the `textarea` input while still allowing the embedded code to be run. |
|   `scope`   | `false`  |  `Boolean`: `true` or `false`   |  `true` 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. |
|   `onResult`   | `undefined`  |  `Function`: [function expression][f_exp] or reference  |  callback function that receives the results when the code is run. `(res, err) => { ... }` |
|   `code`   | `undefined`  |  `String` or `template literal` | placeholder code that populates the editor component on initialization. |

[f_exp]: https://developer.mozilla.org/en-US/docs/web/JavaScript/Reference/Operators/function

## Contributing/Requests

Open an [issue](https://github.com/liminoid/liminoid-react/issues) or post a message in the [chatroom](https://discord.gg/s6WQ9RS). If you would like to contribute to the project (code, documentation, tutorials, etc.) see the [contributing guide](https://liminoid.io/contributing/) 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:

- [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0)
- [MIT license](http://opensource.org/licenses/MIT)

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.

---
_Source: https://npm.io/package/liminoid-react · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
