Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jjcarstens/scenic_loader
When you just need to show a loading spinner in scenic
https://github.com/jjcarstens/scenic_loader
Last synced: 5 days ago
JSON representation
When you just need to show a loading spinner in scenic
- Host: GitHub
- URL: https://github.com/jjcarstens/scenic_loader
- Owner: jjcarstens
- Created: 2020-02-27T16:42:51.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-02-27T19:47:13.000Z (almost 5 years ago)
- Last Synced: 2024-12-19T00:17:31.056Z (about 1 month ago)
- Language: Elixir
- Size: 192 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Scenic.Loader
![loader](assets/loader.gif)
A simple loading spinner. Under the hood, it is just an arc that gets
some fancy animation. It takes no data, so any argument to `add_to_graph/3` is
ignored, but it accepts all the options of `Scenic.Primitive.Arc` as they are
just passed in directly.```elixir
Scenic.Loader.add_to_graph(graph, t: {200, 400}, stroke: {50, :red})
```Or, for that syntactic sugar, you can import the component for `loader/2`
```elixir
loader(graph, t: {200, 400}, stroke: {50, :red})
```If you don't supply an `id`, then it will default to `:loader`. Once you're done
doing "work", you can just delete the loader from the scene (or replace it).
There is also a helper for that:Via module:
```elixir
Scenic.Loader.stop()
```Via imported helper functions:
```elixir
stop_loader(:my_id)
```