-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Wik feature progressmeter (#137) * Merged the latest master into v0.2 * Using ProgressMeter * VideoIO to render mp4 without saving temp frames (#138) * first version of VideoIO with mp4 * fixing links in documentation (#144) (#145) * fixing links in documentation (#144) * first version of HowTo (#142) * Using Animations.jl (#125) * first version of Animations.jl * don't allow v2.5 of Luxor because of transposing (#149) * Wik documentation howto (#148) * made review changes for HowTo * docstrings for structs (#150) * Forgot to push sethue to Animations.jl (#153) * allow sethue in Animations.jl * allow 2.5.1 of Luxor * added extra line for an example of `sethue` * merge master in v0.2 * Format file for the repository * Removing old contributing file * Added info on dependencies and JuliaFormatter * Revert "merge master in v0.2" This reverts commit a853a0f. * Revert files to a853a0f * Tutorial animations (#157) * Animation tutorial * Wik feature morphing v2 (#154) * ability to morph with fill. * [WIP] Live Preview (#119) * Starting proof of concept on live preview * Reverted Javis.jl to previous formatting * Began work on proof of concept * Beginning of the javis image viewer * Continued work on trying to preview images * Barebones example of GTK image viewer * get_javis_frame function * Added compat for images and updated authors * Proof of concept javis viewer signal emission * Temporary fix for Image compat * Added buttons and todos * Added functionality for buttons * Fixed up Project TOML for compat with Images * Fixed merge conflict logic bug * Got proof of concept of live viewer working * Beginning clean up of javis image viewer * Added ColorTypes and color conversion for frames * Added ColorTypes dependency * Cleaned up and adding documentation strings * Exported get_javis_frame function * Prepped javis viewer for full integration into Javis * Added Gtk and GtkReactive deps * Added liveview kwarg * Finished prototype of javis viewer * Updated boundaries for deps * Clarified docstrings * Added arrow key navigation through frames * Updated boundaries per Ole suggestion * Fixed up formatting for CI * Made live rendering faster * Added loop around functionality * Adjusted boundaries of deps * Increased speed of image preview display * Functionalized repeated code snippets * Bug in javis viewer - identification attempt * Made javis viewer work completely * Reversion to a6fa540 * Made short circuit eval of live viewer * Documented javis viewer thoroughly * Added docstring * Qualified usage of LightXML.value func * Qualified textbox usage * Formatting... 👀 * test with xvfb on ubuntu * without --project * try with project=. * different idea using DISPLAY * fix Documentation CI * Added documentation for get_javis_frame * Reduced code reuse * Added some clarifications * Removed export of get_javis_frame * Changed returns for testing * Added GtkReactive to Project * Tests for javis_viewer * Formatting again * Final test case for increment/decrement tests * Formatting test file * Final clean up to javis viewer Co-authored-by: Ole Kröger <[email protected]> * removed possibility to set the fontsize inside the latex function (#180) * removed possibility to set the fontsize inside the latex function * ability to animate text (#162) * ability to animate text * Let us follow a path (#163) * Let us follow a path * push preview (#182) * Update Change Log (#183) * Added info about live viewer and javis frame * Added info about drawing text * Improved Action Error Msg (#185) * Added error msg about defining Video first * Added unit test and cleaned up code * How To: draw_text, follow_path and liveview (#184) * added draw_text, follow_path and liveview in HowTo * return 1.0 in interpolation for single frame (#188) * [Bugfix] scaling to 0 (#191) * don't ever scale to 0 :D * [Bugfix] Follow path starting after first frame (#192) * bugfix for follow_path if not on first frame * Drafted showcase table for README * Images for drafted showcase * Formatted tables for showcase * Wik examples follow path (#198) * first version of an examples folder: drawing a car * convert frame only once (#199) * no need to convert to ARGB32 * refactoring (#194) * refactoring * merge fix renaming * resolved typos * Added back headers for table * Update for Tutorial 5 (#200) * Remove any files stored in test/images (#195) * Remove any files stored in test/images * Removed file check and created it as a unit test * Unit test for test/images dir to check for additional files * Added formatting * Began update of tutorial 5 * Updated gifs * Fixed gifs * Added additional explanation on SubAction * Merged unit with v0.2 * Added example of drawing a path * Resized gif to 350 x 350 * fixed tutorial links in readme * Changed compat entries to allow more (#202) * changed compat entries to allow more * changelog ready for merge * Tutorial overhaul (#201) * explaining Action and Scaling and fixing some others * removed some "The" * emoji fixes and some other small things * Corrected grammar and some light editing * Fixed some grammar issues Co-authored-by: Jacob Zelko <[email protected]> * Added Examples Page (#203) * Added examples page link * Added bezier path gif * Drafted first table for examples * Rendered examples properly * Added explanation for example * Fixed reference Co-authored-by: Jacob Zelko <[email protected]>
- Loading branch information
1 parent
d59f1ae
commit 5932888
Showing
86 changed files
with
3,334 additions
and
1,050 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ | |
Manifest.toml | ||
.vscode/ | ||
test.png | ||
test/current/ | ||
test/current/ | ||
.commit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,34 @@ | ||
name = "Javis" | ||
uuid = "78b212ba-a7f9-42d4-b726-60726080707e" | ||
authors = ["Ole Kröger <[email protected]>", "Jacob Zelko <[email protected]>"] | ||
version = "0.1.5" | ||
version = "0.2.0" | ||
|
||
[deps] | ||
Animations = "27a7e980-b3e6-11e9-2bcd-0b925532e340" | ||
Cairo = "159f3aea-2a34-519c-b102-8c37f9878175" | ||
ColorTypes = "3da002f7-5984-5a60-b8a6-cbb66c0b333f" | ||
FFMPEG = "c87230d0-a227-11e9-1b43-d7ebe4e7570a" | ||
Gtk = "4c0ca9eb-093a-5379-98c5-f87ac0bbbf44" | ||
GtkReactive = "27996c0f-39cd-5cc1-a27a-05f136f946b6" | ||
Images = "916415d5-f1e6-5110-898d-aaa5f9f070e0" | ||
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f" | ||
LightXML = "9c8b4983-aa76-5018-a973-4c85ecc9e179" | ||
Luxor = "ae8d54c2-7ccd-5906-9d76-62fc9837b5bc" | ||
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca" | ||
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" | ||
VideoIO = "d6d074c3-1acf-5d4c-9a43-ef38773959a2" | ||
|
||
[compat] | ||
Animations = "0.4" | ||
Cairo = "1" | ||
ColorTypes = "0.10" | ||
FFMPEG = "0.3, 0.4" | ||
Gtk = "1.1" | ||
GtkReactive = "1.0.3" | ||
Images = "0.20, 0.21, 0.22" | ||
LaTeXStrings = "1.1" | ||
LightXML = "0.9" | ||
Luxor = "2" | ||
ProgressMeter = "1" | ||
VideoIO = "0.6, 0.7, 0.8" | ||
julia = "1.4" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
## Examples | ||
|
||
Aside from tutorials which take you step by step on how to create a tutorial, we also felt that it useful to show additional examples on things you can make with `Javis`! | ||
These animations do not have an accompanying tutorial but rather, scripts that you can examine, tweak, and modify to suit your own purposes. | ||
If you have an interesting example that you would like to share with us, open an issue (check out our [Contributing Guide](contributing.md) on how to do this) and we'd be happy to add your example to this page! | ||
|
||
| Example | Link | Details | | ||
|------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| ![](assets/follow_bezier_path.gif) | [Follow a Path](https://github.com/Wikunia/Javis.jl/blob/master/examples/follow_path.jl) | This creates a bezier curve to draw the outline of a car and have a circle go around that outlined path. [`follow_path`](@ref), `makebezierpath`, and [`appear`](@ref) were used to create this animation. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,215 @@ | ||
# How To? | ||
|
||
This is a list of frequently ask questions answering basic "How to do X, Y, Z?" questions. | ||
|
||
For all the questions below you need to start with: | ||
|
||
```julia | ||
using Javis | ||
|
||
function ground(args...) | ||
background("black") | ||
sethue("white") | ||
end | ||
|
||
video = Video(500, 500) | ||
|
||
javis(video, [ | ||
BackgroundAction(1:100, ground), | ||
SNIPPETS_GO_HERE # Replace this line with the provided snippet! | ||
]; pathname="how_to.gif") | ||
``` | ||
|
||
Each of the code snippets should replace the variable `SNIPPETS_GO_HERE`. | ||
|
||
## How can I move a circle from A to B? | ||
|
||
First of all you need to define an [`Action`](@ref) which draws a circle. | ||
|
||
```julia | ||
Action(1:100, (args...)->circle(O, 50, :fill)) | ||
``` | ||
|
||
and then you need the [`Translation`](@ref) command to move the circle. | ||
|
||
```julia | ||
Action(1:100, (args...)->circle(O, 50, :fill), Translation(O, Point(100, 100)) | ||
``` | ||
The circle then moves from the origin (center of frame) 100 px down and to the right. | ||
## How can I define frames? | ||
There are currently three different ways to define frames inside Javis. | ||
The simplest one is to define the `UnitRange` like `1:100` as above such that the action is called for every frame from `1` to `100`. | ||
**Examples:** | ||
```julia | ||
Action(1:100, (args...)->circle(O, 50, :fill)), | ||
Action(1:50, (args...)->circle(O, 70, :stroke)) | ||
``` | ||
It is relatively often the case that the following action should work with the same frames as the previous action this can be done with. | ||
**Examples:** | ||
```julia | ||
Action(1:100, (args...)->circle(O, 50, :fill)), | ||
Action(:same, (args...)->circle(Point(100, 100), 20, :stroke)), | ||
Action((args...)->circle(Point(-100, 100), 20, :stroke)) | ||
``` | ||
so either use the symbol `:same` or just don't mention frames. | ||
The last option is to define frames relative to the previous frame. More precisely the end of the last frame. | ||
**Examples:** | ||
```julia | ||
Action(1:50, (args...)->circle(O, 50, :fill)), | ||
Action(Rel(1:50), (args...)->circle(Point(100, 100), 20, :stroke)), | ||
``` | ||
This is the same as: | ||
```julia | ||
Action(1:50, (args...)->circle(O, 50, :fill)), | ||
Action(51:100, (args...)->circle(Point(100, 100), 20, :stroke)), | ||
``` | ||
## How can I make an object fade in from the background? | ||
Let's make the standard circle we used before appear from the background. | ||
```julia | ||
Action(1:100, (args...)->circle(O, 50, :fill); subactions=[ | ||
SubAction(1:50, appear(:fade)) | ||
]), | ||
``` | ||
this is using a change in opacity to show the circle. | ||
There are two other options `:scale` and `:fade_line_width`. `:scale` also works for every kind of [`Action`](@ref) whereas `:fade_line_width` only works if you only draw the stroke instead of using fill. | ||
**Example:** | ||
```julia | ||
Action(1:100, (args...)->circle(O, 50, :stroke); subactions=[ | ||
SubAction(1:50, appear(:fade_line_width)) | ||
]), | ||
``` | ||
Additionally you can use all of these three options for the [`disappear`](@ref) functionality. | ||
> **NOTE:** A [`SubAction`](@ref) gets also called for frames after the last specified subaction frame such that disappeared objects stay disappeared. | ||
## How can I move one object based on another object? | ||
In this case we need to define our own `circ` function which draws the circle and returns the center point of the circle. | ||
```julia | ||
function circ(point, radius, action) | ||
circle(point, radius, action) | ||
return point | ||
end | ||
``` | ||
Now we define two actions: | ||
1. Drawing a circle and saving the position inside `:my_circle` | ||
2. Drawing a rectangle above the circle | ||
```julia | ||
Action(1:100, :my_circle, (args...)->circ(O, 50, :stroke), Translation(Point(100,100))), | ||
Action(1:100, (args...)->rect(pos(:my_circle)+Point(-10, -100), 20, 20, :fill)) | ||
``` | ||
In this animation the position of the circle is saved inside `:my_circle` and can be used with `pos(:my_circle)` inside the `rect` function. | ||
## How can I show a text being drawn? | ||
A `text` can appear as *any* other object with `appear(:fade)` and `appear(:scale)`, However, it also has a special [`appear`](@ref) functionality called | ||
`:draw_text`. | ||
You can use | ||
```julia | ||
Action( | ||
1:100, | ||
(args...) -> text("Hello World!"; halign = :center); | ||
subactions = [ | ||
SubAction(1:15, sineio(), appear(:draw_text)), | ||
SubAction(76:100, sineio(), disappear(:draw_text)), | ||
] | ||
) | ||
``` | ||
to let the text `"Hello World!"` appear from left to right in an animated way. | ||
## How can I have an object follow a path? | ||
We need to create a path by providing a list of points that the object can follow. | ||
All objects that return a list of points can be used directly like `star` and `poly` for others a list of points must be provided as the input. | ||
An action can look like this: | ||
```julia | ||
Action( | ||
1:150 | ||
(args...) -> star(O, 20, 5, 0.5, 0, :fill); | ||
subactions = [ | ||
SubAction(1:150, follow_path(star(O, 300))), | ||
], | ||
) | ||
``` | ||
in this case a star is following the path of a bigger star. | ||
> **NOTE:** the star inside [`follow_path`](@ref) should have the `action=:none` which is the default for most Luxor functions. | ||
> **NOTE:** Unfortunately the above currently only works for some Luxor functions like `ngon` and `star` but not for `circle` and `rect` as they return `true` instead of the points. | ||
In that case you need to define a function like: | ||
```julia | ||
function ground(args...) | ||
background("white") | ||
sethue("black") | ||
end | ||
|
||
function luxor2poly(func::Function) | ||
newpath() | ||
func() | ||
closepath() | ||
return pathtopoly()[1] | ||
end | ||
|
||
video = Video(600, 400) | ||
javis(video, [ | ||
BackgroundAction(1:150, ground), | ||
Action( | ||
1:150, | ||
(args...) -> star(O, 20, 5, 0.5, 0, :fill); | ||
subactions = [ | ||
SubAction(1:150, follow_path(luxor2poly(()->rect(O, 100, 100, :path)))) | ||
] | ||
) | ||
]; pathname="follow_path.gif") | ||
``` | ||
Another possibility is to specify a vector of points like this: | ||
```julia | ||
Action( | ||
1:150 | ||
(args...) -> star(O, 20, 5, 0.5, 0, :fill); | ||
subactions = [ | ||
SubAction(1:150, sineio(), follow_path([Point(100, 200), Point(-20, -250), Point(-80, -10)]; closed=false)), | ||
], | ||
) | ||
``` | ||
In this case I want the star to follow a path consisting of two edges and I use `; closed=false` to specify that it's just two edges and not a closed triangle. | ||
An interesting possibility is to define paths using Bézier curves which can be defined with Luxor see: [Polygons to Bézier paths and back again](https://juliagraphics.github.io/Luxor.jl/stable/polygons/#Polygons-to-B%C3%A9zier-paths-and-back-again) | ||
## How can I see a live view of the animation? | ||
A live view of the animation can be useful for creating an animation where one doesn't need the overhead of building a gif or mp4 all the time. It also has the advantage that it's very easy to jump to a specific frame. | ||
The live viewer can be called with adding `; liveview=true` to the [`javis`](@ref) call. | ||
> **NOTE:** If `liveview=true` the `tempdirectory` and `pathname` arguments are ignored. |
Oops, something went wrong.