Releases: stevenpetryk/mafs
v0.6.0: MovablePoint and setPoint!
MovablePoint can now be used directly
No longer are users stuck using useMovablePoint
—now you can bypass that abstraction and use MovablePoint
itself.
const [point, setPoint] = useState([0, 0])
<MovablePoint
point={point}
onMove={setPoint}
/>
useMovablePoint
was only ever a nice wrapper around useState
for movable points.
setPoint
Similarly, useMovablePoint
now exposes a setPoint
function to make it easy to move your point programmatically!
const point = useMovablePoint([0, 0])
function onClick() {
point.setPoint([1, 0])
}
v0.5.1: Transpiled bundle for compatibility
This is a minor update that tells SWC to transpile out some overly-futuristic syntax.
v0.5.0: Smooth interpolation for parametric functions
The Function.Parametric
sampling algorithm now dynamically increases the number of samples depending on the roughness of the function. The samples
(the raw number of samples) prop has been deprecated in favor of minimumSamplingDepth
(the minimum amount of subdivisions to evaluate the function with).
See PR #37.
v0.4.4: Improved keyboard accessibility
Fixes an issue where, given certain constrain functions in useMovablePoint, using the keyboard to move points didn't work (see PR #23). Also, keyboard movement was generally broken in certain cases.
v0.4.3: Firefox fix
Axis labels are no longer misaligned in Firefox.
v0.4.2: Dependency cleanup
Mafs no longer has a runtime dependency on gl-matrix-invert
, gl-mat2
, gl-mat3
, or gl-mat4
. It was only using one small function from that whole suite of packages, so it has now been inlined into Mafs' code directly. Less to download is always nice.
It also no longer depends on classnames
.
Additionally, Mafs no longer depends on React ^16.8
, instead depending on React >=16.8
. From a real compatibility standpoint, it always worked with React 17, but just had a bad semver string (oops).
v0.4.1: Keeping VectorField's prop types honest
The TypeScript types for VectorField
no longer (erroneously) require the xyOpacity
and opacityStep
props.
v0.4.0: Line segments!
New features
- Added
Line.Segment
- Added Bezier curve example
Bug fixes
FunctionGraph.Parametric
now supports decreasing values oft
, enabling functions to be evaluated "backwards".