v1.3
Livewire Reactivity on Chart JS Options
Package users can now add Livewire inputs that dynamically control Chart JS options. This allows for more interactive end-user experiences such as changing a tooltip.
Wire Ignore
Remove wire ignore on main div to allow more reactivity. That removes the need for manual change update function. Chart update was bounded (which is good for single responsibility), but the bounding was too intermingled with Livewire, Alpine and the package Builder. Disadvantage of this new approach is that it’s more ‘global’ but it’s worth it for the additional reactivity. We’ve effectively moved the wire ignore to the canvas element which is actually just ignoring default livewire re-rendering. This is so that we get control of who is doing the rendering ie Chart JS.
Options Object
Alpine was working with the “Chart Data” but really only using an init call. Instead we are making Alpine explicitly responsible for the dataset and options objects. For example, this means we don’t need to explicitly account for Treemap chart types in Alpine because the dataset and options provide a rich enough context to to manage this out of the box. Options is now a first class object so Alpine can just work on the object itself.
Laravel Blade @js Helper
Single quotes and double quotes nesting can catch the JSON encode or json as string transit. The @ JS helper uses the browser / javascript native parser. Which sounds very similar to the backend JSON encode / decode but is subtly different. We may they and use @js more over time.
What's Changed
- Support updating options in Livewire by @jasonlbeggs in #17
- Allow livewire to update all datasets by @LuizCristino in #18
New Contributors
- @LuizCristino made their first contribution in #18
Full Changelog: v1.2.2...v1.3