@darkroom.engineering/elastica
Advanced tools
Comparing version 0.0.12 to 0.0.13
{ | ||
"name": "@darkroom.engineering/elastica", | ||
"version": "0.0.12", | ||
"version": "0.0.13", | ||
"scripts": { | ||
@@ -5,0 +5,0 @@ "dev:engine": "npm run dev --prefix ./packages/engine", |
# Elastica | ||
### ⚠️ Still in development mode - API might change ⚠️ | ||
### ⚠️ Still in development mode - API might change ⚠️ | ||
<br/> | ||
[Demo](https://elastica.darkroom.engineering/) | ||
@@ -13,6 +13,2 @@ ## Introduction | ||
### JavaScript | ||
using a package manager: | ||
```bash | ||
@@ -22,8 +18,4 @@ npm i @darkroom.engineering/elastica | ||
<br/> | ||
## Setup | ||
### React | ||
```js | ||
@@ -39,2 +31,4 @@ import Elastica, { | ||
`Elastica` will wrap your component getting the dimensions for borders calculations and the grid size for collisions. | ||
```js | ||
@@ -57,2 +51,4 @@ <Elastica | ||
`AxisAlignedBoundaryBox` will wray your elements getting their size for collisions and positioning. | ||
## API | ||
@@ -66,11 +62,12 @@ | ||
| `className` | `string` | N/A | Specifies a CSS class for styling the `ReactElastica` container, allowing custom styling and theming. | | ||
| `showHashGrid` | `boolean` | `false` | Shows the hash grid for measuing correct grid size. | | ||
| `config` | `object` | See below | Configuration object controlling various aspects of the physics simulation. | | ||
| └─ `gridSize` | `number` | `8` | Defines the size of the hash grid, bigger grid reduces number of computation by collisions. | | ||
| └─ `gridSize` | `number` | `8` | Defines the size of the hash grid, bigger grid reduces number of computation by collisions but should not be smaller than biggest element. | | ||
| └─ `collisions` | `boolean` | `true` | Enables or disables collision detection between elements. | | ||
| └─ `borders` | `string` | `'rigid'` | Defines the border behavior. `'rigid'` indicates immovable borders, preventing objects from passing through the container's edges. `'Periodic'` translates elements to opposite border when reaching limit. | | ||
| └─ `containerOffsets` | `object` | See below | Specifies the offsets from the container's edges for the simulation area, allowing for padding or margins. | | ||
| └─ `top` | `number` | `0` | Top offset. | | ||
| └─ `bottom` | `number` | `0` | Bottom offset. | | ||
| └─ `left` | `number` | `0` | Left offset. | | ||
| └─ `right` | `number` | `0` | Right offset. | | ||
| └── `top` | `number` | `0` | Top offset. | | ||
| └── `bottom` | `number` | `0` | Bottom offset. | | ||
| └── `left` | `number` | `0` | Left offset. | | ||
| └── `right` | `number` | `0` | Right offset. | | ||
| `initialCondition` | `function` | `() => {}` | Function to set the initial conditions of the simulation, such as starting positions and velocities of elements. It is called once when the component mounts. Engine instance Class passed as props | | ||
@@ -103,2 +100,2 @@ | `update` | `function` | `() => {}` | Callback function called on each simulation update, where cinematic equations have to be applied to each element. Engine instance Class passed as props. | | ||
For more examples check [elastica](https://elastica.darkroom.engineering/) | ||
For more examples check [demo github](<https://github.com/darkroomengineering/elastica/tree/main/website/app/(pages)/home/(componentes)/>) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
131101
340
96