# expo-graphics-rnge

> Tools for building universal graphic based components in Expo

Latest version **1.2.0** (published 2019-07-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install expo-graphics-rnge
pnpm add expo-graphics-rnge
yarn add expo-graphics-rnge
bun add expo-graphics-rnge
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2019-07-11 |
| First published | 2019-07-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 23.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Boris Berak |
| Maintainers | bberak |
| Keywords | react, native, expo, exponent, game, gl, graphics, opengl |

## Links

- npm: https://www.npmjs.com/package/expo-graphics-rnge
- Repository: https://github.com/bberak/expo-graphics-rnge
- Homepage: https://github.com/bberak/expo-graphics-rnge#readme
- Issues: https://github.com/bberak/expo-graphics-rnge/issues
- npm.io page: https://npm.io/package/expo-graphics-rnge

## 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

- 1.2.0 (latest) — 2019-07-11

## README

[![NPM](https://nodei.co/npm/expo-graphics.png)](https://nodei.co/npm/expo-graphics/)

---

# expo-graphics

Tools to help simplify and manage GL/AR state.

### Installation

```bash
yarn add expo-graphics
```

### Usage

Import the library into your JavaScript file:

```bash
import ExpoGraphics from 'expo-graphics';
```

## Components

### `ExpoGraphics.View`

A view that assists with common GL and AR tasks.

#### Props

| Property                |                             Type                             | Default | Description                                                                                                         |
| ----------------------- | :----------------------------------------------------------: | :-----: | ------------------------------------------------------------------------------------------------------------------- |
| isArEnabled             |                           ?boolean                           |  null   | Enables an ARKit context: **iOS Only**                                                                              |
| isArRunningStateEnabled |                           ?boolean                           |  null   | Adds a toggle for ARKit running state: **iOS Only**                                                                 |
| isArCameraStateEnabled  |                           ?boolean                           |  null   | Renders information related to ARKit the tracking state: **iOS Only**                                               |
| arTrackingConfiguration |                  ?AR.TrackingConfiguration                   |  null   | Enables an ARKit context: **iOS Only**                                                                              |
| arRunningProps          |                           ?object                            |   {}    | Props for optional ARRunningState: **iOS Only**                                                                     |
| arCameraProps           |                           ?object                            |   {}    | Props for optional ARCameraState: **iOS Only**                                                                      |
| isShadowsEnabled        |                           ?boolean                           |  false  | Overrides the render buffer allowing for shadows, this works by default on Android: **iOS Only**                    |
| onContextCreate         | ({gl, canvas?, width, height, scale, arSession?}) => Promise |  null   | Called with the newly created GL context, and optional arSession                                                    |
| onShouldReloadContext   |                        () => boolean                         |  null   | A delegate function that requests permission to reload the GL context when the app returns to the foreground        |
| onResize                |                   (layout: Layout) => void                   |  null   | Invoked when the view changes size, or the device orientation changes, returning the `{x, y, width, height, scale}` |
| shouldIgnoreSafeGuards  |                           ?boolean                           |  null   | This prevents the app from stopping when run in a simulator, or when AR is run in devices that don't support AR     |

### `ExpoGraphics.ARCameraState`

Information related to the AR camera's tracking state.

#### Props

| Property                                       |              Type               |                                     Default                                      | Description                                       |
| ---------------------------------------------- | :-----------------------------: | :------------------------------------------------------------------------------: | ------------------------------------------------- |
| titleStyle                                     |             ?object             |                                       null                                       | The style of the title Text                       |
| subtitleStyle                                  |             ?object             |                                       null                                       | The style of the subtitle Text                    |
| trackingStateStyles                            |  ?{[AR.TrackingState]: object}  |                                       null                                       | The title text style used with each TrackingState |
| [AR.TrackingStateReason.None]                 | {title:string, subtitle:string} |                   { title: 'Having trouble collecting data' }                    | Used when the AR camera isn't available           |
| [AR.TrackingStateReason.Initializing]         | {title:string, subtitle:string} | { title: 'Initializing, subtitle: 'Move the camera around for better results' }  | The camera is starting to collect data            |
| [AR.TrackingStateReason.ExcessiveMotion]      | {title:string, subtitle:string} |     { title: 'Excessive motion', subtitle: 'Try moving your camera slower' }     | The device is moving too fast                     |
| [AR.TrackingStateReason.InsufficientFeatures] | {title:string, subtitle:string} | {title: 'insufficient features', subtitle: 'Try moving your camera around more'} | The camera hasn't collected enough data           |
| [AR.TrackingStateReason.Relocalizing]         | {title:string, subtitle:string} |                   { title: 'Having trouble collecting data' }                    | The camera is reseting                            |

### `ExpoGraphics.ARRunningState`

A button used for toggling the AR state

#### Props

| Property |   Type    | Default | Description                            |
| -------- | :-------: | :-----: | -------------------------------------- |
| onPress  | ?Function |  null   | Called whenever the button is toggled. |

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