# sanity-plugin-pdb-input

> An input component for Protein Data Bank models

Latest version **0.1.0** (published 2020-04-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install sanity-plugin-pdb-input
pnpm add sanity-plugin-pdb-input
yarn add sanity-plugin-pdb-input
bun add sanity-plugin-pdb-input
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2020-04-22 |
| First published | 2020-04-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 268.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Sanity.io |
| Maintainers | rbotten |
| Keywords | sanity, video, protein data bank, pdb, 3d |

## Links

- npm: https://www.npmjs.com/package/sanity-plugin-pdb-input
- Repository: https://github.com/sanity-io/sanity-plugin-pdb-input
- Homepage: https://github.com/sanity-io/sanity-plugin-pdb-input#readme
- Issues: https://github.com/sanity-io/sanity-plugin-pdb-input/issues
- npm.io page: https://npm.io/package/sanity-plugin-pdb-input

## Dependencies (2)

- [react-icons](https://npm.io/package/react-icons.md) ^3.10.0
- [lodash.debounce](https://npm.io/package/lodash.debounce.md) ^4.0.8

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2020-04-22

## README

# Protein Data Bank Sanity Plugin

This is a plugin which adds an object type `protein` to your Sanity schema, and provides a custom input component to let you select a PDB protein model in a predefined list and adjust the starting camera position and zoom.

Not familiar with Sanity? [Visit www.sanity.io](https://www.sanity.io/)

## Quick start

- While in your project folder, run `sanity install pdb-input`.
  Read more about [using plugins in Sanity here](https://www.sanity.io/docs/plugins).

## Usage

Use it in your schema types:

```js
// [...]
{
  fields: [
    // [...]
    {
      name: "proteinModel",
      title: "A PDB 3d model",
      type: "protein",
    },
  ];
}
```

Note that the above only works if you import and use the `all:part:@sanity/base/schema-type` part in your schema. This is the most common way. If you are not importing the base types in this manner, you may import the `schemas/pdb.js` and `schemas/pdbCamera.js` and include them in your schema manually.

Read more about [schemas in Sanity here](https://www.sanity.io/docs/the-schema).

## Data model example

```js
{
  "_type": "protein",
  "camera": {
    "rotation": [
      0.4790152907371521,
      -0.8654894232749939,
      -0.14653077721595764,
      0,
      -0.14660295844078064,
      -0.24346202611923218,
      0.958766520023346,
      0,
      -0.8654779195785522,
      -0.43778201937675476,
      -0.24350611865520477,
      0,
      0,
      0,
      0,
      1
    ],
    "center": [
      -15.685999870300293,
      22.24799919128418,
      -6.605999946594238
    ],
    "zoom": 36.5915087377568
  },
  "pdb": "4HHB"
}
```

# Displaying the PDB models in your web frontend

This plugin uses bio-pv node module to let the editor manipulate the camera settings. You may use the same library for displaying interactive PDB models in your web frontend. You can find it [here](https://www.npmjs.com/package/bio-pv)

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