Halogen integration for Hylograph force simulations.
Provides utilities for integrating Hylograph force simulations with Halogen applications, including event emitters that work with Halogen's subscription system.
spago install hylograph-simulation-halogenimport Hylograph.ForceEngine.Halogen (toHalogenEmitter)
handleAction Initialize = do
{ handle, events } <- liftEffect $ runSimulation config
halogenEmitter <- liftEffect $ toHalogenEmitter events
void $ H.subscribe $ halogenEmitter <#> SimEvent
handleAction (SimEvent (Tick { alpha })) =
H.modify_ _ { alpha = alpha }For a simulation made directly with Hylograph.ForceEngine.Simulation.createWithCallbacks,
subscribeToSimulation gives a Halogen emitter of the engine's own events
(Tick, Started, Stopped, AlphaDecayed).
Changed in 0.6.0. This package no longer depends on hylograph-d3-kernel.
subscribeToSimulation takes the simulation of hylograph-simulation 1.x,
not the D3 kernel's; D3SimulationEvent and D3SimulationCallbacks are now
SimulationEvent and SimulationCallbacks, re-exported from
Hylograph.ForceEngine.Events; and subscribeToGroup is gone, with the
kernel that had groups (step several Hylograph.Simulation.Stepped handles
from one animation loop instead).
Hylograph.ForceEngine.Halogen- Halogen emitter adapter
- hylograph-simulation-halogen - Halogen integration (this package)
- hylograph-simulation - Core simulation API
- hylograph-forces - the force kernel, in PureScript
MIT