Skip to content

Commit

Permalink
Merge pull request #1 from e4st-dev/release
Browse files Browse the repository at this point in the history
Prepare for release
  • Loading branch information
Ethan-Russell authored Oct 24, 2023
2 parents bdde88b + a7dbeb9 commit 7f5bf7e
Show file tree
Hide file tree
Showing 7 changed files with 122 additions and 15 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: TagBot
on:
issue_comment:
types:
- created
workflow_dispatch:
inputs:
lookback:
default: 3
permissions:
actions: read
checks: read
contents: write
deployments: read
issues: read
discussions: read
packages: read
pages: read
pull-requests: read
repository-projects: read
security-events: read
statuses: read
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 }}
# Edit the following line to reflect the actual name of the GitHub Secret containing your private key
# ssh: ${{ secrets.DOCUMENTER_KEY }}
# ssh: ${{ secrets.NAME_OF_MY_SSH_PRIVATE_KEY_SECRET }}
45 changes: 45 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CI
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
env:
CODECOV_TOKEN: 6b63b55f-caba-4243-9007-28c0fb8b5981
jobs:
test:
if: "!contains(github.event.head_commit.message, 'skip ci')"
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- '1'
os:
- windows-latest
arch:
- x64
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v2
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
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
with:
file: lcov.info
15 changes: 15 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@ authors = ["Ethan Russell <[email protected]>"]
version = "0.1.0"

[deps]
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"

[compat]
Colors = "0.12"
Makie = "0.19"
Random = "1"
Reexport = "1"
julia = "1.6"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ and then install it into julia.
# Usage
```julia
using RFFMakie
using CairoMakie
set_theme!(theme_rff())
example_plot()
fig = example_plot()
save("example.svg", fig) # or .png or .pdf
```
![example_plot](assets/example_plot.png)
Binary file added assets/example_plot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 14 additions & 12 deletions src/RFFMakie.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ Exports `theme_rff` to be used with Makie using the `set_theme!` function.
Theming and color guidance comes from `https://media.rff.org/documents/RFFDigitalBrand-Guidelines.pdf`
"""
module RFFMakie
using Reexport

using Makie
using Colors
@reexport using Makie
@reexport using Colors
@reexport using CairoMakie
using Random

export theme_rff, rff_colors, example_plot
Expand Down Expand Up @@ -165,19 +167,19 @@ function theme_rff()
end

function example_plot()
set_theme!(theme_rff())
Random.seed!(1)
f = Figure()
for i in 1:2, j in 1:2
Axis(f[i,j], title="My Title ($i, $j)")
lines!(f[i, j], 1:50, cumsum(randn(50)), label="My thing 1")
lines!(f[i, j], 1:50, cumsum(randn(50)), label="My thing 2")
lines!(f[i, j], 1:50, cumsum(randn(50)), label="My thing 3")
lines!(f[i, j], 1:50, cumsum(randn(50)), label="My thing 4")
scatter!(f[i,j], 1:5:50, zeros(length(1:5:50)), label="My other 1")
scatter!(f[i,j], 1:5:50, 3*ones(length(1:5:50)), label="My other 2")
axislegend(position=:lb)
end
ax = f[1,1] = Axis(f, title="My Title")
lines!(ax, 1:50, cumsum(randn(50)), label="My thing 1")
lines!(ax, 1:50, cumsum(randn(50)), label="My thing 2")
lines!(ax, 1:50, cumsum(randn(50)), label="My thing 3")
lines!(ax, 1:50, cumsum(randn(50)), label="My thing 4")
scatter!(ax, 1:5:50, zeros(length(1:5:50)), label="My other 1")
scatter!(ax, 1:5:50, 3*ones(length(1:5:50)), label="My other 2")
f[1,2] = Legend(f, ax, "Legend")
f
end
export example_plot

end # module
12 changes: 12 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using Test, RFFMakie

@testset "Testing RFFMakie" begin

f = example_plot()

for file_name in ["example.png", "example.svg", "example.pdf"]
save(file_name, f)
@test isfile(file_name)
rm(file_name)
end
end

3 comments on commit 7f5bf7e

@Ethan-Russell
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ethan-Russell
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/94036

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.0 -m "<description of version>" 7f5bf7ee49ae472a9d582d08d5eb956d1a1cbe65
git push origin v0.1.0

Please sign in to comment.