Skip to content

Commit

Permalink
Merge pull request #1020 from JuliaPlots/sd/monorepo
Browse files Browse the repository at this point in the history
turn Makie into a mono repo with all backends etc
  • Loading branch information
SimonDanisch authored Jun 12, 2021
2 parents 04c7dd7 + faa801f commit e59f4f0
Show file tree
Hide file tree
Showing 204 changed files with 17,757 additions and 1,042 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
- name: CompatHelper.main()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: julia -e 'using CompatHelper; CompatHelper.main()'
run: julia -e 'using CompatHelper; CompatHelper.main(; subdirs=["", "CairoMakie", "GLMakie", "MakieCore", "WGLMakie"])'
63 changes: 63 additions & 0 deletions .github/workflows/cairomakie.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: CairoMakie CI
on:
pull_request:
paths-ignore:
- 'docs/**'
- '*.md'
branches:
- master
push:
paths-ignore:
- 'docs/**'
- '*.md'
branches:
- master
tags: '*'
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- '1.5'
- '1.6'
os:
- ubuntu-latest
arch:
- x64
steps:
- name: Checkout
uses: actions/checkout@v2
- 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 }}-
- name: Install Julia dependencies
shell: julia --project=monorepo {0}
run: |
using Pkg;
# dev mono repo versions
pkg"dev . MakieCore CairoMakie ReferenceTests"
- name: Run the tests
run: julia --project=monorepo -e 'using Pkg; Pkg.test("CairoMakie", coverage=true)'
- name: Upload test Artifacts
uses: actions/upload-artifact@v2
with:
name: ReferenceImages
path: ./test/recorded
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
with:
file: lcov.info
14 changes: 10 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: Makie CI
on:
pull_request:
paths-ignore:
Expand All @@ -21,7 +21,7 @@ jobs:
fail-fast: false
matrix:
version:
- '1.3'
- '1.5'
- '1.6'
os:
- ubuntu-latest
Expand All @@ -44,8 +44,14 @@ jobs:
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- name: Install Julia dependencies
shell: julia --project=monorepo {0}
run: |
using Pkg;
# dev mono repo versions
pkg"dev . MakieCore"
Pkg.test("Makie"; coverage=true)
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ jobs:
# force the most recent registry to avoid older cached versions
pkg"registry add https://github.com/JuliaRegistries/General";
pkg"registry up General";
Pkg.develop(PackageSpec(path=pwd()));
pkg"add Documenter#master; instantiate"'
# dev mono repo versions
pkg"dev . MakieCore CairoMakie WGLMakie GLMakie; add Documenter#master; instantiate"'
- name: Build and deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
66 changes: 66 additions & 0 deletions .github/workflows/glmakie.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: GLMakie CI
on:
pull_request:
paths-ignore:
- 'docs/**'
- '*.md'
branches:
- master
push:
paths-ignore:
- 'docs/**'
- '*.md'
branches:
- master
tags: '*'
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- '1.5'
- '1.6'
os:
- ubuntu-18.04
arch:
- x64
steps:
- name: Checkout
uses: actions/checkout@v2
- 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 }}-
- 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
- name: Install Julia dependencies
shell: julia --project=monorepo {0}
run: |
using Pkg;
# dev mono repo versions
pkg"dev . MakieCore GLMakie ReferenceTests"
- name: Run the tests
run: DISPLAY=:0 xvfb-run -s '-screen 0 1024x768x24' julia --project=monorepo -e 'using Pkg; Pkg.test("GLMakie", coverage=true)'
- name: Upload test Artifacts
uses: actions/upload-artifact@v2
with:
name: ReferenceImages
path: |
./test/recorded
./test/recorded_glmakie
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
with:
file: lcov.info
64 changes: 64 additions & 0 deletions .github/workflows/wglmakie.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: WGLMakie CI
on:
pull_request:
paths-ignore:
- 'docs/**'
- '*.md'
branches:
- master
push:
paths-ignore:
- 'docs/**'
- '*.md'
branches:
- master
tags: '*'
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- '1.5'
- '1.6'
os:
- ubuntu-latest
arch:
- x64
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- 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
- name: Install Julia dependencies
shell: julia --project=monorepo {0}
run: |
using Pkg;
# dev mono repo versions
pkg"dev . MakieCore WGLMakie ReferenceTests"
- name: Run the tests
run: DISPLAY=:0 xvfb-run -s '-screen 0 1024x768x24' julia --project=monorepo -e 'using Pkg; Pkg.test("WGLMakie", coverage=true)'
- name: Upload test Artifacts
uses: actions/upload-artifact@v2
with:
name: ReferenceImages
path: ./test/recorded
- 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-processcoverage@v1
- uses: codecov/codecov-action@v1
with:
file: lcov.info
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ src/.cache
src/logo.png
**/._*
Manifest.toml
!docs/Manifest.toml
/build

\.DS_Store
CairoMakie/src/display.*

WGLMakie/test/recorded/
GLMakie/test/recorded/
GLMakie/test/recorded_glmakie/
CairoMakie/test/recorded/
monorepo
22 changes: 22 additions & 0 deletions CairoMakie/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
The CairoMakie.jl package is licensed under the MIT "Expat" License:

> Copyright (c) 2017: SimonDanisch.
>
> Permission is hereby granted, free of charge, to any person obtaining a copy
> of this software and associated documentation files (the "Software"), to deal
> in the Software without restriction, including without limitation the rights
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> copies of the Software, and to permit persons to whom the Software is
> furnished to do so, subject to the following conditions:
>
> The above copyright notice and this permission notice shall be included in all
> copies or substantial portions of the Software.
>
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
> SOFTWARE.
>
36 changes: 36 additions & 0 deletions CairoMakie/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name = "CairoMakie"
uuid = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
author = ["Simon Danisch <[email protected]>"]
version = "0.6"

[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
Cairo = "159f3aea-2a34-519c-b102-8c37f9878175"
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
FreeType = "b38be410-82b0-50bf-ab77-7b57e271db43"
GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"

[compat]
Cairo = "1.0.4"
Colors = "0.10, 0.11, 0.12"
FFTW = "1"
FileIO = "1.1"
FreeType = "3, 4.0"
GeometryBasics = "0.2, 0.3"
Makie = "=0.14.0"
StaticArrays = "0.12, 1.0"
julia = "1.3"

[extras]
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
ReferenceTests = "d37af2e0-5618-4e00-9939-d430db56ee94"

[targets]
test = ["Test", "Pkg", "ReferenceTests"]
49 changes: 49 additions & 0 deletions CairoMakie/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# CairoMakie

The Cairo Backend for Makie

Read the docs for Makie and it's backends [here](http://makie.juliaplots.org/.dev)


## Issues

Please file all issues in [Makie.jl](https://github.com/JuliaPlots/Makie.jl/issues/new), and mention CairoMakie in the issue text.

## Limitations

CairoMakie is intended as a backend for static vector graphics at publication quality. Therefore, it does not support the interactive features of GLMakie and is slower when visualizing large amounts data. 3D plots are currently not available because of the inherent limitations of 2D vector graphics.

## Saving

Makie overloads the FileIO interface, so you can save a Scene `scene` as `save("filename.extension", scene)`. CairoMakie supports saving to PNG, PDF, SVG and EPS.

You can scale the size of the output figure, without changing its appearance by passing keyword arguments to `save`. PNGs can be scaled by `px_per_unit` (default 1) and vector graphics (SVG, PDF, EPS) can be scaled by `pt_per_unit`.

```julia
save("plot.svg", scene, pt_per_unit = 0.5) # halve the dimensions of the resulting SVG
save("plot.png", scene, px_per_unit = 2) # double the resolution of the resulting PNG
```

## Using CairoMakie with Gtk.jl

You can render onto a GtkCanvas using Gtk, and use that as a display for your scenes.

```julia
using Gtk, CairoMakie, Makie

canvas = @GtkCanvas()
window = GtkWindow(canvas, "Makie", 500, 500)

function drawonto(canvas, scene)
@guarded draw(canvas) do _
resize!(scene, Gtk.width(canvas), Gtk.height(canvas))
screen = CairoMakie.CairoScreen(scene, Gtk.cairo_surface(canvas), getgc(canvas), nothing)
CairoMakie.cairo_draw(screen, scene)
end
end

scene = heatmap(rand(50, 50)) # or something

drawonto(canvas, scene)
show(canvas); # trigger rendering
```
Loading

12 comments on commit e59f4f0

@SimonDanisch
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 register subdir=CairoMakie
@JuliaRegistrator register subdir=WGLMakie
@JuliaRegistrator register subdir=GLMakie
@JuliaRegistrator register subdir=MakieCore
@JuliaRegistrator register

@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/38737

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 CairoMakie-v0.6.0 -m "<description of version>" e59f4f0785a190146623ff235eeeacc56b04de6c
git push origin CairoMakie-v0.6.0

@SimonDanisch
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 register subdir=WGLMakie

@SimonDanisch
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 register subdir=GLMakie

@SimonDanisch
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 register subdir=MakieCore

@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/38738

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 WGLMakie-v0.4.0 -m "<description of version>" e59f4f0785a190146623ff235eeeacc56b04de6c
git push origin WGLMakie-v0.4.0

@SimonDanisch
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/38739

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 GLMakie-v0.4.0 -m "<description of version>" e59f4f0785a190146623ff235eeeacc56b04de6c
git push origin GLMakie-v0.4.0

@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/38740

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 MakieCore-v0.1.3 -m "<description of version>" e59f4f0785a190146623ff235eeeacc56b04de6c
git push origin MakieCore-v0.1.3

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Error while trying to register: "Tag with name v0.14.0 already exists and points to a different commit"

@SimonDanisch
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/38741

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.14.0 -m "<description of version>" e59f4f0785a190146623ff235eeeacc56b04de6c
git push origin v0.14.0

Please sign in to comment.