# visualizer-machines

> A Visualizer for finite Machines.

Latest version **1.0.0** (published 2020-07-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install visualizer-machines
pnpm add visualizer-machines
yarn add visualizer-machines
bun add visualizer-machines
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2020-07-04 |
| First published | 2020-07-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 51 |
| Unpacked size | 311.7 KB |
| Known vulnerabilities | 0 (+3 in 2 direct dependencies) |
| Install scripts | yes |
| Author | Filipe Prado |
| Maintainers | filiperethink |

## Links

- npm: https://www.npmjs.com/package/visualizer-machines
- Repository: https://github.com/smiles-sa/smiles-react-machine-visualizer
- Homepage: https://github.com/smiles-sa/smiles-react-machine-visualizer#readme
- Issues: https://github.com/smiles-sa/smiles-react-machine-visualizer/issues
- npm.io page: https://npm.io/package/visualizer-machines

## Dependencies (51)

- [ncp](https://npm.io/package/ncp.md) ^2.0.0
- [brace](https://npm.io/package/brace.md) ^0.11.1
- [husky](https://npm.io/package/husky.md) ^4.2.5
- [immer](https://npm.io/package/immer.md) ^3.3.0
- [react](https://npm.io/package/react.md) ^16.13.1
- [eslint](https://npm.io/package/eslint.md) ^6.8.0
- [rollup](https://npm.io/package/rollup.md) ^0.66.6
- [xstate](https://npm.io/package/xstate.md) ^4.7.8
- [date-fns](https://npm.io/package/date-fns.md) ^1.30.1
- [fs-extra](https://npm.io/package/fs-extra.md) ^9.0.1
- [gh-pages](https://npm.io/package/gh-pages.md) ^2.2.0
- [prettier](https://npm.io/package/prettier.md) ^2.0.4
- [cross-env](https://npm.io/package/cross-env.md) ^7.0.2
- [react-ace](https://npm.io/package/react-ace.md) ^6.6.0
- [react-dom](https://npm.io/package/react-dom.md) ^16.13.1
- [typescript](https://npm.io/package/typescript.md) ^3.7.5
- [@types/jest](https://npm.io/package/@types/jest.md) ^25.1.4
- [@types/node](https://npm.io/package/@types/node.md) ^12.12.38
- [npm-run-all](https://npm.io/package/npm-run-all.md) ^4.1.5
- [@types/react](https://npm.io/package/@types/react.md) ^16.9.36
- [babel-eslint](https://npm.io/package/babel-eslint.md) ^10.0.3
- [concurrently](https://npm.io/package/concurrently.md) ^4.1.2
- [query-string](https://npm.io/package/query-string.md) ^6.11.0
- [@xstate/graph](https://npm.io/package/@xstate/graph.md) ^1.1.0
- [@xstate/react](https://npm.io/package/@xstate/react.md) ^0.6.1
- [react-scripts](https://npm.io/package/react-scripts.md) ^3.4.1
- [microbundle-crl](https://npm.io/package/microbundle-crl.md) ^0.13.10
- [@types/react-dom](https://npm.io/package/@types/react-dom.md) ^16.9.7
- [create-react-app](https://npm.io/package/create-react-app.md) ^2.1.8
- [styled-components](https://npm.io/package/styled-components.md) ^4.4.1
- [eslint-plugin-node](https://npm.io/package/eslint-plugin-node.md) ^11.0.0
- [eslint-plugin-react](https://npm.io/package/eslint-plugin-react.md) ^7.17.0
- [eslint-plugin-import](https://npm.io/package/eslint-plugin-import.md) ^2.18.2
- [rollup-plugin-terser](https://npm.io/package/rollup-plugin-terser.md) ^3.0.0
- [eslint-plugin-promise](https://npm.io/package/eslint-plugin-promise.md) ^4.2.1
- [rollup-plugin-replace](https://npm.io/package/rollup-plugin-replace.md) ^2.2.0
- [@testing-library/react](https://npm.io/package/@testing-library/react.md) ^9.5.0
- [eslint-config-prettier](https://npm.io/package/eslint-config-prettier.md) ^6.7.0
- [eslint-config-standard](https://npm.io/package/eslint-config-standard.md) ^14.1.0
- [eslint-plugin-prettier](https://npm.io/package/eslint-plugin-prettier.md) ^3.1.1
- [eslint-plugin-standard](https://npm.io/package/eslint-plugin-standard.md) ^4.0.1
- [rollup-plugin-filesize](https://npm.io/package/rollup-plugin-filesize.md) ^5.0.1
- [@types/styled-components](https://npm.io/package/@types/styled-components.md) ^5.1.0
- [react-syntax-highlighter](https://npm.io/package/react-syntax-highlighter.md) ^10.3.5
- [@testing-library/jest-dom](https://npm.io/package/@testing-library/jest-dom.md) ^4.2.4
- [@typescript-eslint/parser](https://npm.io/package/@typescript-eslint/parser.md) ^2.26.0
- [rollup-plugin-typescript2](https://npm.io/package/rollup-plugin-typescript2.md) ^0.17.2
- [@testing-library/user-event](https://npm.io/package/@testing-library/user-event.md) ^7.2.1
- [eslint-config-standard-react](https://npm.io/package/eslint-config-standard-react.md) ^9.2.0
- [@types/react-syntax-highlighter](https://npm.io/package/@types/react-syntax-highlighter.md) ^11.0.4
- [@typescript-eslint/eslint-plugin](https://npm.io/package/@typescript-eslint/eslint-plugin.md) ^2.26.0

## Recent versions

- 1.0.0 (latest) — 2020-07-04

## README

# Visualizer Machines for Xstate

# IMPORTANT

| Dentro da pasta `src/utils/lib` estão 3 arquivos necessarios para o funcionamento, ao instalar a lib em seu projeto copie e cole os 3 arquivos dentro da pasta em seu `node_modules/xstate/lib`

### HOW TO IMPORT

```css
import { Visualizer } from "smiles-react-machine-visualizer"

const CustomMachine = Machine({
  ...
})

<Visualizer machine={CustomMachine} theme={DEFAULT_COLORS}>
```

### COLORS PATTERN

```js
const DEFAULT_COLORS = {
  smiles_base: '#FFFFF3',
  smiles_active: '#F17F42',
  smiles_disabled: '#E0E3DA',
  smiles_details: '#30A9DE'
}
```

### MACHINE PATTERN

```ts
| Example:

// Machine Schema
interface DefaultMachineStateSchema {
  states: {
    idle: {};
    loading: {};
    success: {};
    failure: {};
  };
}

// Machine Events
type DefaultMachineEvents =
  | { type: 'FETCH' }
  | { type: 'RETRY';  search: string };

// Machine Context
interface DefaultMachineContext {
  search: string | undefined;
  error: string | undefined;
  data: string[] | undefined;
}
```

#### HOW TO INSTALL

`npm install`

`cd example && npm install`

#### HOW TO RUN

`cd .. npm start` - Aguardar o bundle

`cd example && npm start` - Automaticamente abre a pagina no navegador

### Default Scripts

```js
   "build": "npx microbundle-crl --no-compress --format modern,cjs",
     "start": "npx microbundle-crl watch --no-compress --format modern,cjs",
     "prepare": "run-s build",
     "test": "run-s test:unit test:lint test:build",
     "test:build": "run-s build",
     "test:lint": "eslint .",
     "test:unit": "cross-env CI=1 react-scripts test --env=jsdom",
     "test:watch": "react-scripts test --env=jsdom",
     "predeploy": "cd example && npm install && npm run build",
     "deploy": "gh-pages -d example/build",
     "commit": "npx git-cz"
```

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