# the-ar

> AR of the-component

Latest version **2.1.0** (published 2017-08-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install the-ar
pnpm add the-ar
yarn add the-ar
bun add the-ar
```

## 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 | 2.1.0 |
| Published | 2017-08-17 |
| First published | 2017-07-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6 |
| Dependencies | 6 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Taka Okunishi |
| Maintainers | okunishinishi |
| Keywords | the, react-component |

## Links

- npm: https://www.npmjs.com/package/the-ar
- Repository: https://github.com/the-labo/the-ar
- Homepage: https://github.com/the-labo/the-ar#readme
- Issues: https://github.com/the-labo/the-ar/issues
- npm.io page: https://npm.io/package/the-ar

## Dependencies (6)

- [ar.js](https://npm.io/package/ar.js.md) ^1.4.10
- [the-style](https://npm.io/package/the-style.md) ^1.2.4
- [classnames](https://npm.io/package/classnames.md) ^2.2.5
- [prop-types](https://npm.io/package/prop-types.md) ^15.5.10
- [the-window](https://npm.io/package/the-window.md) ^4.0.3
- [the-component-util](https://npm.io/package/the-component-util.md) ^1.4.1

## Alternatives

- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads
- [escher-request](https://npm.io/package/escher-request.md) — 545 weekly downloads

## Recent versions

- 2.1.0 (latest) — 2017-08-17
- 1.2.1 — 2017-08-16
- 1.2.0 — 2017-08-16
- 1.1.0 — 2017-08-16
- 1.0.3 — 2017-07-10
- 1.0.2 — 2017-07-10
- 1.0.1 — 2017-07-08
- 1.0.0 — 2017-07-07

## README

the-ar
==========

<!---
This file is generated by ape-tmpl. Do not update manually.
--->

<!-- Badge Start -->
<a name="badges"></a>

[![Build Status][bd_travis_shield_url]][bd_travis_url]
[![npm Version][bd_npm_shield_url]][bd_npm_url]
[![JS Standard][bd_standard_shield_url]][bd_standard_url]

[bd_repo_url]: https://github.com/the-labo/the-ar
[bd_travis_url]: http://travis-ci.org/the-labo/the-ar
[bd_travis_shield_url]: http://img.shields.io/travis/the-labo/the-ar.svg?style=flat
[bd_travis_com_url]: http://travis-ci.com/the-labo/the-ar
[bd_travis_com_shield_url]: https://api.travis-ci.com/the-labo/the-ar.svg?token=
[bd_license_url]: https://github.com/the-labo/the-ar/blob/master/LICENSE
[bd_codeclimate_url]: http://codeclimate.com/github/the-labo/the-ar
[bd_codeclimate_shield_url]: http://img.shields.io/codeclimate/github/the-labo/the-ar.svg?style=flat
[bd_codeclimate_coverage_shield_url]: http://img.shields.io/codeclimate/coverage/github/the-labo/the-ar.svg?style=flat
[bd_gemnasium_url]: https://gemnasium.com/the-labo/the-ar
[bd_gemnasium_shield_url]: https://gemnasium.com/the-labo/the-ar.svg
[bd_npm_url]: http://www.npmjs.org/package/the-ar
[bd_npm_shield_url]: http://img.shields.io/npm/v/the-ar.svg?style=flat
[bd_standard_url]: http://standardjs.com/
[bd_standard_shield_url]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg

<!-- Badge End -->


<!-- Description Start -->
<a name="description"></a>

AR of the-component

<!-- Description End -->


<!-- Overview Start -->
<a name="overview"></a>



<!-- Overview End -->


<!-- Sections Start -->
<a name="sections"></a>

<!-- Section from "doc/guides/01.Installation.md.hbs" Start -->

<a name="section-doc-guides-01-installation-md"></a>

Installation
-----

```bash
$ npm install the-ar --save
```


<!-- Section from "doc/guides/01.Installation.md.hbs" End -->

<!-- Section from "doc/guides/02.Usage.md.hbs" Start -->

<a name="section-doc-guides-02-usage-md"></a>

Usage
---------

```javascript
'use strict'

import React from 'react'

import { TheAr, TheArStyle } from 'the-ar'

class ExampleComponent extends React.PureComponent {
  render () {
    const s = this
    return (
      <div>
        <script src={TheAr.THREE_JS_URL}></script>
        <script src={TheAr.AR_JS_URL}></script>
        <TheArStyle/>
        <TheAr onReady={(context) => s.handleReady(context)}
               onDraw={(context) => s.handleDraw(context)}
        />
      </div>

    )
  }

  handleReady ({ THREE, scene, renderer }) {
    const s = this
    s.drawHandlers = []
    {

      const geometry = new THREE.CubeGeometry(1, 1, 1)
      const material = new THREE.MeshNormalMaterial({
        transparent: true,
        opacity: 0.5,
        side: THREE.DoubleSide
      })
      const mesh = new THREE.Mesh(geometry, material)
      mesh.position.y = geometry.parameters.height / 2
      scene.add(mesh)
    }
    {
      const geometry = new THREE.TorusKnotGeometry(0.3, 0.1, 64, 16)
      const material = new THREE.MeshNormalMaterial()
      const mesh = new THREE.Mesh(geometry, material)
      mesh.position.y = 0.5
      scene.add(mesh)
      s.drawHandlers.push((delta) => {
        mesh.rotation.x += Math.PI * delta
      })
    }
  }

  handleDraw ({ scene, renderer, delta }) {
    const s = this
    for (let handler of s.drawHandlers) {
      handler(delta)
    }
  }

}

export default ExampleComponent

```


<!-- Section from "doc/guides/02.Usage.md.hbs" End -->

<!-- Section from "doc/guides/03.Components.md.hbs" Start -->

<a name="section-doc-guides-03-components-md"></a>

Components
-----------

### TheAr

AR of the-component

**Props**

| Name | Type | Description | Default |
| --- | --- | ---- | ---- |
| `cameraParametersUrl` | string  | Camera parameter url | `'https://jeromeetienne.github.io/AR.js/data/data/camera_para.dat'` |
| `markerPatternUrl` | string  | Pattern of marker | `'https://jeromeetienne.github.io/AR.js/data/data/patt.hiro'` |
| `width` | number  | Display width | `640` |
| `height` | number  | Display height | `480` |
| `onReady` | func  | Callback for draw ready | `` |
| `onDraw` | func  | Handle draw ar | `` |
| `sourceType` | enum  | Type of ar source | `'webcam'` |
| `sourceUrl` | string  | Source URL for image/video source type | `null` |
| `canvasRef` | func  | Ref to canvas element | `null` |
| `videoRef` | func  | Ref to video element | `null` |

### TheArStyle

Style for TheAr

**Props**

| Name | Type | Description | Default |
| --- | --- | ---- | ---- |
| `options` | object  | Style options | `{}` |



<!-- Section from "doc/guides/03.Components.md.hbs" End -->


<!-- Sections Start -->


<!-- LICENSE Start -->
<a name="license"></a>

License
-------
This software is released under the [MIT License](https://github.com/the-labo/the-ar/blob/master/LICENSE).

<!-- LICENSE End -->


<!-- Links Start -->
<a name="links"></a>

Links
------

+ [THE Labo][t_h_e_labo_url]

[t_h_e_labo_url]: https://github.com/the-labo

<!-- Links End -->

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