react-constraint
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

Constraint Core

Lets say you have the LayoutDefinition object, which contains the information about an entire view, this is used with createLayoutComponent to create the Component that will be showed in the client, this component requires width and height props to work; this is a Functional Component, so each re-render would basically compute everything again.

Then with the LayoutDefinition we must generate ComponentInstance's, with this we can generate all our ConstraintInstance's.

Each ComponentInstance holds information about the component name, and defined positions for each side, it starts with unknown definitions, and the work involves knowing this definitions.

Each ConstraintInstance holds information about a constraint between two from and to components, including sides for each component involved, and distance involved, also mantains the state of if it's resolver or not.

The ResolveConstraint is the function that tries to resolve a constraint.

The ResolveLayout is the function that given the definition, width and height creates the ComponentInstance's and the ConstraintInstance's, resolves them and returns the ComponentInstance's or throws if there exists an error.

Readme

Keywords

none

Package Sidebar

Install

npm i react-constraint

Weekly Downloads

0

Version

0.0.4

License

none

Unpacked Size

46.2 kB

Total Files

18

Last publish

Collaborators

  • briancraig