0.0.4 • Published 4 years ago

react-constraint v0.0.4

Weekly downloads
13
License
-
Repository
github
Last release
4 years ago

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.

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago