Skip to content

Commit

Permalink
Merge branch 'master' into fa/axis3-ticksize
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonDanisch authored Jul 20, 2023
2 parents 5ecdb55 + 51cbc99 commit cd5a25f
Show file tree
Hide file tree
Showing 223 changed files with 28,832 additions and 3,824 deletions.
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report-.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: 'Bug report '
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

- [ ] are you running newest version (version from docs) ?
- [ ] can you reproduce the bug with a fresh environment ? (`]activate --temp; add Makie`)
- [ ] What platform + GPU are you on?
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---

### Feature description

### For plot types, please add an image of how it should look like
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
24 changes: 8 additions & 16 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,18 @@
name: CompatHelper

on:
schedule:
- cron: '00 * * * *'
issues:
types: [opened, reopened]

- cron: '0 0 * * *' # Everyday at midnight
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
julia-version: [1.2.0]
julia-arch: [x86]
os: [ubuntu-latest]
CompatHelper:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.julia-version }}
- name: Pkg.add("CompatHelper")
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
- name: CompatHelper.main()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: julia -e 'using CompatHelper; CompatHelper.main(; subdirs=["", "CairoMakie", "GLMakie", "MakieCore", "WGLMakie"])'
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
run: julia -e 'using CompatHelper; CompatHelper.main()'
6 changes: 3 additions & 3 deletions .github/workflows/Docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
persist-credentials: false
# NOTE: Python is necessary for the pre-rendering (minification) step
- name: Install python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install binary dependencies
Expand All @@ -46,7 +46,7 @@ jobs:
DISPLAY=:0 xvfb-run -s '-screen 0 1024x768x24'
julia --color=yes makedocs.jl
- name: Upload site as artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: Docs build
path: ./docs/__site
6 changes: 3 additions & 3 deletions .github/workflows/cairomakie.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- x64
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
Expand All @@ -54,14 +54,14 @@ jobs:
julia --color=yes --project=monorepo -e 'using Pkg; Pkg.test("CairoMakie", coverage=true)'
&& echo "TESTS_SUCCESSFUL=true" >> $GITHUB_ENV
- name: Upload test Artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ReferenceImages_${{ matrix.os }}_${{ matrix.arch }}_${{ matrix.version }}
path: ./CairoMakie/test/recorded_reference_images/
- name: Fail after artifacts if tests failed
if: ${{ env.TESTS_SUCCESSFUL != 'true' }}
run: exit 1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v3
with:
file: lcov.info
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- x64
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
Expand All @@ -51,6 +51,6 @@ jobs:
Pkg.test("Makie"; coverage=true)
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v3
with:
file: lcov.info
2 changes: 1 addition & 1 deletion .github/workflows/compilation-benchmark.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- WGLMakie
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Install xvfb
run: sudo apt-get update && sudo apt-get install -y xorg-dev mesa-utils xvfb libgl1 freeglut3-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev
- uses: julia-actions/setup-julia@v1
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/glmakie.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- x64
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
Expand All @@ -59,7 +59,7 @@ jobs:
&& echo "TESTS_SUCCESSFUL=true" >> $GITHUB_ENV
- name: Comment if there are missing refimages
if: matrix.version == '1' && steps.referencetests.outputs.n_missing_refimages != '0'
uses: mshick/add-pr-comment@v1
uses: mshick/add-pr-comment@v2
with:
message: |
## Missing reference images
Expand All @@ -68,7 +68,7 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}
allow-repeats: true
- name: Upload test Artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ReferenceImages_${{ matrix.os }}_${{ matrix.arch }}_${{ matrix.version }}
path: |
Expand All @@ -77,6 +77,6 @@ jobs:
if: ${{ env.TESTS_SUCCESSFUL != 'true' }}
run: exit 1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v3
with:
file: lcov.info
6 changes: 3 additions & 3 deletions .github/workflows/rprmakie.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- x64
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
Expand All @@ -53,14 +53,14 @@ jobs:
julia --color=yes --project=monorepo -e 'using Pkg; Pkg.test("RPRMakie", coverage=true)'
&& echo "TESTS_SUCCESSFUL=true" >> $GITHUB_ENV
- name: Upload test Artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ReferenceImages_${{ matrix.os }}_${{ matrix.arch }}_${{ matrix.version }}
path: ./RPRMakie/test/recorded
- name: Fail after artifacts if tests failed
if: ${{ env.TESTS_SUCCESSFUL != 'true' }}
run: exit 1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v3
with:
file: lcov.info
2 changes: 1 addition & 1 deletion .github/workflows/stale_preview_removal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout gh-pages branch
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: gh-pages
- uses: julia-actions/setup-julia@v1
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/wglmakie.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- x64
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
Expand All @@ -55,14 +55,14 @@ jobs:
DISPLAY=:0 xvfb-run -s '-screen 0 1024x768x24' julia --color=yes --project=monorepo -e 'using Pkg; Pkg.test("WGLMakie", coverage=true)'
&& echo "TESTS_SUCCESSFUL=true" >> $GITHUB_ENV
- name: Upload test Artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ReferenceImages_${{ matrix.os }}_${{ matrix.arch }}_${{ matrix.version }}
path: ./WGLMakie/test/recorded_reference_images/
- name: Fail after artifacts if tests failed
if: ${{ env.TESTS_SUCCESSFUL != 'true' }}
run: exit 1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v3
with:
file: lcov.info
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*.jl.mem
src/.cache
src/logo.png
*.bundled.js

**/._*
Manifest.toml
Expand Down
2 changes: 1 addition & 1 deletion CITATION.bib
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ @article{DanischKrumbiegel2021
number = {65},
pages = {3349},
author = {Simon Danisch and Julius Krumbiegel},
title = {Makie.jl: Flexible high-performance data visualization for Julia},
title = {{Makie.jl}: Flexible high-performance data visualization for {Julia}},
journal = {Journal of Open Source Software}
}
8 changes: 4 additions & 4 deletions CairoMakie/Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "CairoMakie"
uuid = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
author = ["Simon Danisch <sdanisch@gmail.com>"]
version = "0.10.2"
version = "0.10.6"

[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
Expand All @@ -14,7 +14,7 @@ GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"
SnoopPrecompile = "66db9d55-30c0-4569-8b51-7e840670fc0c"
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"

[compat]
Cairo = "1.0.4"
Expand All @@ -23,8 +23,8 @@ FFTW = "1"
FileIO = "1.1"
FreeType = "3, 4.0"
GeometryBasics = "0.4.1"
Makie = "=0.19.2"
SnoopPrecompile = "1.0"
Makie = "=0.19.6"
PrecompileTools = "1.0"
julia = "1.3"

[extras]
Expand Down
1 change: 1 addition & 0 deletions CairoMakie/src/cairo-extension.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ function set_miter_limit(ctx, limit)
end

function get_render_type(surface::Cairo.CairoSurface)
@assert surface.ptr != C_NULL
typ = ccall((:cairo_surface_get_type, Cairo.libcairo), Cint, (Ptr{Nothing},), surface.ptr)
typ == Cairo.CAIRO_SURFACE_TYPE_PDF && return PDF
typ == Cairo.CAIRO_SURFACE_TYPE_PS && return EPS
Expand Down
49 changes: 37 additions & 12 deletions CairoMakie/src/infrastructure.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function cairo_draw(screen::Screen, scene::Scene)
Cairo.save(screen.context)
draw_background(screen, scene)

allplots = get_all_plots(scene)
allplots = Makie.collect_atomic_plots(scene; is_atomic_plot = is_cairomakie_atomic_plot)
zvals = Makie.zvalue2d.(allplots)
permute!(allplots, sortperm(zvals))

Expand All @@ -23,10 +23,12 @@ function cairo_draw(screen::Screen, scene::Scene)

Cairo.save(screen.context)
for p in allplots
to_value(get(p, :visible, true)) || continue
check_parent_plots(p) do plot
to_value(get(plot, :visible, true))
end || continue
# only prepare for scene when it changes
# this should reduce the number of unnecessary clipping masks etc.
pparent = p.parent::Scene
pparent = Makie.parent_scene(p)
pparent.visible[] || continue
if pparent != last_scene
Cairo.restore(screen.context)
Expand All @@ -36,11 +38,13 @@ function cairo_draw(screen::Screen, scene::Scene)
end
Cairo.save(screen.context)

# This is a bit of a hack for now. When a plot is too large to save with
# a reasonable file size on a vector backend, the user can choose to
# rasterize it when plotting to vector backends, by using the `rasterize`
# keyword argument. This can be set to a Bool or an Int which describes
# When a plot is too large to save with a reasonable file size on a vector backend,
# the user can choose to rasterize it when plotting to vector backends, by using the
# `rasterize` keyword argument. This can be set to a Bool or an Int which describes
# the density of rasterization (in terms of a direct scaling factor.)
# TODO: In future, this can also be set to a Tuple{Module, Int} which describes
# the backend module which should be used to render the scene, and the pixel density
# at which it should be rendered.
if to_value(get(p, :rasterize, false)) != false && should_rasterize
draw_plot_as_image(pparent, screen, p, p[:rasterize][])
else # draw vector
Expand All @@ -52,12 +56,33 @@ function cairo_draw(screen::Screen, scene::Scene)
return
end

function get_all_plots(scene, plots = AbstractPlot[])
append!(plots, scene.plots)
for c in scene.children
get_all_plots(c, plots)
"""
is_cairomakie_atomic_plot(plot::Combined)::Bool
Returns whether the plot is considered atomic for the CairoMakie backend.
This is overridden for `Poly`, `Band`, and `Tricontourf` so we can apply
CairoMakie can treat them as atomic plots and render them directly.
Plots with children are by default recursed into. This can be overridden
by defining specific dispatches for `is_cairomakie_atomic_plot` for a given plot type.
"""
is_cairomakie_atomic_plot(plot::Combined) = isempty(plot.plots) || to_value(get(plot, :rasterize, false)) != false

"""
check_parent_plots(f, plot::Combined)::Bool
Returns whether the plot's parent tree satisfies the predicate `f`.
`f` must return a `Bool` and take a plot as its only argument.
"""
function check_parent_plots(f, plot::Combined)
if f(plot)
check_parent_plots(f, parent(plot))
else
return false
end
plots
end

function check_parent_plots(f, scene::Scene)
return true
end

function prepare_for_scene(screen::Screen, scene::Scene)
Expand Down
Loading

0 comments on commit cd5a25f

Please sign in to comment.