Skip to content

Commit

Permalink
update the sample code and link to a live CodePen example
Browse files Browse the repository at this point in the history
  • Loading branch information
trusktr authored Jan 25, 2024
1 parent a6ad344 commit 282ba66
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,17 @@ compiler).

## Index

- [Demo](#demo)
- [Install](#install)
- [Usage](#usage)
- [Documentation](#documentation)
- [Benchmarks](#benchmarks)
- [Tests](#tests)

## Demo

[Live demo on CodePen.](https://codepen.io/trusktr/pen/abMLVxa?editors=1010)

## Install

Install using NPM:
Expand Down Expand Up @@ -76,6 +81,16 @@ solver.addConstraint(new kiwi.Constraint(new kiwi.Expression([-1, right], left,
solver.updateVariables()

console.assert(right.value() === 500)

// later, update the constraints and re-calculate
setTimeout(() => {
solver.suggestValue(left, 200)
solver.suggestValue(width, 600)

solver.updateVariables() // update

console.assert(right.value() === 800)
}, 2000)
```

## Documentation
Expand Down

0 comments on commit 282ba66

Please sign in to comment.