Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .JuliaFormatter.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
annotate_untyped_fields_with_any = false
always_for_in = true
whitespace_in_kwargs = true
whitespace_ops_in_indices = true
always_use_return = false
51 changes: 51 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG] "
labels: bug
assignees: ''

---

<!--Before Filing a Report-->

<!--1. Did I read the Documentation and/or docstrings?-->
<!--2. Did I search the JavisViewer GitHub to see if this bug has already been reported?-->
<!--3. Do I have the latest version of Javis installed? -->
<!--4. Do I have the latest version of JavisViewer installed? -->

**Describe the bug**

A clear and concise description of what the bug is.

**To Reproduce**

1. Julia Version (i.e. output of `julia -v`):

2. Operating system (Mac, Linux, Windows):

3. Javis version (i.e output of `] status Javis` in the REPL)

4. JavisNB version (i.e output of `] status JavisNB` in the REPL)

5. Notebook type (Jupyter/Pluto):

6. Notebook package version (i.e. output of `] status [NAME OF NOTEBOOK PACKAGE USED]`):

7. Minimum working code example that led to bug:

**Expected Behavior and Actual Behavior**

<!--A clear and concise description of what you expected to happen followed up with an explanation of what actually happened.-->

**Stacktrace (If Applicable):**

<!--If the stacktrace includes some ffmpeg error please set the kwarg `ffmpeg_loglevel` to `"info"` i.e `render(your_video, "your_animation.gif", ffmpeg_loglevel = "info")`-->

**Screenshots**

<!--If applicable, add your gif or drawing to help explain your problem.-->

**Additional context**

<!--Add any other context about the problem here.-->
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please explain.**

<!--A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]-->

**Describe the solution you'd like**

<!--A clear and concise description of what you would like to do and how you would like to do it. Maybe a minimal example of the user interface you imagine for this feature.-->

**Describe alternatives you've considered**

<!--A clear and concise description of any alternative solutions or features you've considered.-->

**Additional context**

<!--Add any other context or screenshots about the feature request here.-->
14 changes: 14 additions & 0 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: CompatHelper
on:
schedule:
- cron: 0 0 * * *
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Pkg.add("CompatHelper")
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
- name: CompatHelper.main()
run: julia -e 'using CompatHelper; CompatHelper.main()'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15 changes: 15 additions & 0 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: TagBot
on:
issue_comment:
types:
- created
workflow_dispatch:
jobs:
TagBot:
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
runs-on: ubuntu-latest
steps:
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
ssh: ${{ secrets.DOCUMENTER_KEY }}
64 changes: 64 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: CI
on:
- push
- pull_request
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
version:
- '1.6'
- '1'
os:
- ubuntu-latest
- macOS-latest
- windows-latest
arch:
- x64
steps:
- uses: actions/checkout@v2
- run: sudo apt-get install xvfb && Xvfb :99 &
if: matrix.os == 'ubuntu-latest'
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v1
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-runtest@latest
env:
DISPLAY: :99
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
with:
file: lcov.info
# docs:
# name: Documentation
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - run: sudo apt-get install xvfb && Xvfb :99 &
# - uses: julia-actions/setup-julia@v1
# with:
# version: '1.6'
# - run: |
# julia --project=docs -e '
# using Pkg
# Pkg.develop(PackageSpec(path=pwd()))
# Pkg.instantiate()'
# - run: julia --project=docs docs/make.jl
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
# DISPLAY: :99
40 changes: 40 additions & 0 deletions .github/workflows/format_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: format-check

on:
push:
branches:
- 'main'
tags: '*'
pull_request:

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
julia-version: [1.5.0]
julia-arch: [x86]
os: [ubuntu-latest]
steps:
- uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.julia-version }}

- uses: actions/checkout@master
- name: Install JuliaFormatter and format
run: |
julia -e 'using Pkg; Pkg.add("JuliaFormatter")'
julia -e 'using JuliaFormatter; format(".", annotate_untyped_fields_with_any=false, always_for_in=true, whitespace_in_kwargs=true, whitespace_ops_in_indices=true)'
- name: Format check
run: |
julia -e '
out = Cmd(`git diff --name-only`) |> read |> String
if out == ""
exit(0)
else
@error "Some files have not been formatted !!!"
write(stdout, out)
exit(1)
end'


9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*.jl.*.cov
*.jl.cov
*.jl.mem
/docs/build/
Manifest.toml
.vscode/
test.png
test/current/
.commit
4 changes: 3 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name = "JavisViewer"
uuid = "e61f6c88-b8cc-4c5a-97f7-b7cb93a9aa5a"
authors = ["Jacob Zelko <jacobszelko@gmail.com>"]
authors = ["Jacob Zelko <jacobszelko@gmail.com>", "Giovanni Puccetti <g.puccetti92@gmail.com>"]
version = "0.0.0"

[deps]
Cairo = "159f3aea-2a34-519c-b102-8c37f9878175"
Gtk = "4c0ca9eb-093a-5379-98c5-f87ac0bbbf44"
GtkReactive = "27996c0f-39cd-5cc1-a27a-05f136f946b6"
Javis = "78b212ba-a7f9-42d4-b726-60726080707e"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
4 changes: 4 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Javis = "78b212ba-a7f9-42d4-b726-60726080707e"
JavisViewer = "e61f6c88-b8cc-4c5a-97f7-b7cb93a9aa5a"
24 changes: 24 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
push!(LOAD_PATH, "../")

using Documenter, JavisViewer

makedocs(sitename = "JavisViewer.jl")

makedocs(;
modules = [JavisViewer],
authors = "Giovanni Puccetti <g.puccetti92@gmail.com>, Jacob Zelko <jacobszelko@gmail.com> and contributors",
repo = "https://github.com/JuliaAnimators/JavisNB.jl/blob/{commit}{path}#L{line}",
sitename = "JavisViewer.jl",
format = Documenter.HTML(;
prettyurls = get(ENV, "CI", "false") == "true",
canonical = "https://JuliaAnimators.github.io/JavisViewer.jl",
assets = String[],
),
pages = ["Home" => "index.md", "References" => "references.md"],
)

deploydocs(;
repo = "github.com/JuliaAnimators/JavisViewer.jl",
push_preview = true,
devbranch = "main",
)
Binary file added docs/src/assets/JavisViewer_demonstration.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# JavisViewer

## How to use JavisViewer

`JavisViewer` is a small package for use [Javis.jl](https://juliaanimators.github.io/Javis.jl/stable/) with a liveviewer based on `Gtk.jl` and `GtkInteractive.jl`.

It is very straightforward to use.
First write all your code for an animation just like you would with `Javis` and then replace `Javis.render` with `JavisViewer.liveview`.

For example, if you copy these lines in the julia REPL, or copy them to a file called `javisviewer_test.jl` and then run `include(javisviewer_test.jl)` alongside sending the rendered animation to a file, the gif will be shown in a liveviewer.

```julia
using Javis, JavisViewer

vid = Video(500, 500)
Background(1:200, (args...)->background("black"))
o1 = Object(JCircle(Point(100, 0), 30, color="green", action=:fill))
act!(o1, Action(anim_translate(Point(-200, 0))))
act!(o1, Action(1:100, anim_translate(Point(0, 200))))
act!(o1, Action(101:200, anim_translate(Point(0, -200))))
o2 = Object(JCircle(Point(100, 0), 10, action=:fill, color="red"))
p = Point(10, 0)
act!(o2, Action(anim_rotate_around(2π, p)))
o3 = Object(JCircle(p, 20, color="blue", action=:fill))
liveview(vid, pathname="javisviewer_example.gif")
```

You will find the file `javisviewer_example.gif` containing the gif and
at the same time a window will pop-up allowing to scroll through the gif
frames.

![](assets/JavisViewer_demonstration.gif)
17 changes: 17 additions & 0 deletions docs/src/references.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
```@meta
CurrentModule = JavisViewer
```

# Public functions

```@autodocs
Modules = [JavisViewer]
Private = false
```

# Private functions

```@autodocs
Modules = [JavisViewer]
Public = false
```
Loading