Skip to content

Commit

Permalink
Road to plots 2.0 (#4866)
Browse files Browse the repository at this point in the history
* remove deprecated backends

* move GR to extension

* make plot3d work

* make heatmap work

* factor components into modules

* finish Surface module

* export is_horizontal from Fonts

* start refactoring Plot, Subplot, etc. components

* change version

* continue module shuffling

* continued refactoring

* remove orientation

* minimal usable state

* format

* remove makekw

* anything up to Segments

* move series stuff from utils

* use Arrows

* create Colorbars module

* move axes stuff (precompiling state)

* let's relax deps and add them back later if needed (macOS issue)

* only 2 tests fail now

* restructure extension logic

* remove unicode for now

* GR extension

* update deps

* init step of gr

* proper init of GR

* for now manually activate the backend

* road to fixing gr

* revert some changes

* fix import exports

* fix measures

* clarify name space

* might need to be reverted, shape->Shape (too confusing_

* return lost wrap

* types and modules

* fix more things

* add gr function

* remove stale and fix naming

* added unicode backend

* unicodeplots works

* update runtests

* only use explicitly imported names in backends

* rename wrap to protect

* remove pre post imports, move to alignment jl

* alignment jl

* remove comments

* fix typo

* finally fix InputWrapper, misc changes

* import overloaded, namespace fix

* fixing per backend exceptions

* alost all tests are passing

* fix exports

* trying to fix project toml

* try to resolve deps

* move other backends to the extensions

* start pgfplotsx

* add backends to weakdeps

* recover

* already defined

* fix GR plot area method overload

* plotarea methods are overloaded in layouts.jl

* more fixes

* fix test

* namespace fixes

* fix namespaces

* revert later

* rm pyplot

* remove requires

* add PGFPlotsX imports

* bump julia compat

* create runtime functions for all backends

* improve error handling

* pgfplotsx loading

* get tests running

* fix names, skip StatsPlots examples

* test on 1.10

* remove pyplot remainings

* don't test julia < 1.9

* run julia formatter

* add pythonplotbackend

* fix init python plot

* gaston working

* reorganize plotly backends

* update kaleido compat

* format

* remove PlotlyBase compat

* make default backend functional

* make plotly functional

* naming and PlotlyJS

* get gaston running

* run more tests

* move dev in ci

* dev both at the same time

* fix syntax

* don't dev twice

* only load Gtk if not on CI

* add missing using statement for PlotlyJS

* more imports

* move merge_with_base_supported to Commons

* make Plotly module

* skip non-working tests

* fix filtering

* format

* invert filter

* fix pgfplotsx warning

* don't test Gaston

* fix cgrad missing

* format

---------

Co-authored-by: Simon Christ <[email protected]>
Co-authored-by: Simon Christ <[email protected]>
Co-authored-by: = <=>
  • Loading branch information
3 people authored Mar 12, 2024
1 parent 0d95673 commit c91872b
Show file tree
Hide file tree
Showing 95 changed files with 8,177 additions and 9,938 deletions.
29 changes: 14 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,17 @@ jobs:
fail-fast: false
matrix:
version:
- '1.6' # LTS (minimal declared julia compat in `Project.toml`)
- '1.9' # latest stable
- '1.9' # (minimal declared julia compat in `Project.toml`)
- '1.10' # latest stable
os: [ubuntu-latest, windows-latest, macos-latest]
arch: [x64]
include:
- os: ubuntu-latest
prefix: xvfb-run # julia-actions/julia-runtest/blob/master/README.md
- os: ubuntu-latest
prefix: xvfb-run
version: '1.7' # only test intermediate release on `ubuntu` to spare resources
- os: ubuntu-latest
prefix: xvfb-run
version: '1.8' # only test intermediate release on `ubuntu` to spare resources
- os: ubuntu-latest
prefix: xvfb-run
version: '~1.10.0-0' # upcoming julia version, next `rc`
# - os: ubuntu-latest
# prefix: xvfb-run
# version: '1.9' # only test intermediate release on `ubuntu` to spare resources
# - os: ubuntu-latest
# prefix: xvfb-run
# version: '~1.11.0-0' # upcoming julia version, next `rc`
- os: ubuntu-latest
prefix: xvfb-run
version: 'nightly'
Expand All @@ -67,14 +62,19 @@ jobs:
with:
version: ${{ matrix.version }}
- uses: julia-actions/cache@v1
- name: Use local RecipesBase/RecipesPipeline
shell: julia --project=@. --color=yes {0}
run: |
using Pkg
Pkg.develop([(; path="./RecipesBase"), (; path="./RecipesPipeline")])
- uses: julia-actions/julia-buildpkg@latest

- name: Run upstream RecipesBase & RecipesPipeline tests
shell: julia --project=@. --color=yes {0}
run: |
using Pkg
foreach(("RecipesBase", "RecipesPipeline")) do name
Pkg.develop(path=name); Pkg.test(name; coverage=true)
Pkg.test(name; coverage=true)
end
- name: Install conda based matplotlib
Expand All @@ -98,7 +98,6 @@ jobs:
end
CondaPkg.PkgREPL.add([libgcc..., "matplotlib"])
CondaPkg.status()
- uses: julia-actions/julia-runtest@latest
timeout-minutes: 60
with:
Expand Down
16 changes: 16 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@

# Plots.jl NEWS

## Breaking changes
---

## v2

- deprecated backends `pgfplots` and `pyplot` removed
- deprecated keyword `orientation` removed
- backends are extensions now so the backend code must be explicitly loaded using `import` with the backend package, e.g. ```julia
using Plots
import GR # loads backend code

```
- Types are no longer part of the Plots API this affects
- `Shape`, which is now `shape`
---
#### notes on release changes, ongoing development, and future planned work
## NOTE: this file is deprecated, see the [TagBot](https://github.com/marketplace/actions/julia-tagbot) auto-generated changelogs instead
Expand Down
195 changes: 99 additions & 96 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,135 +1,138 @@
name = "Plots"
uuid = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
author = ["Tom Breloff (@tbreloff)"]
version = "1.39.0-dev"
uuid = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
version = "2.0.0-dev"

[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
Contour = "d38c429a-6771-53c6-b99e-75d170b6e991"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
FFMPEG = "c87230d0-a227-11e9-1b43-d7ebe4e7570a"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Showoff = "992d4aef-0814-514b-bc4d-f2e9a6c4116f"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
FixedPointNumbers = "53c48c17-4a7d-5ca2-90c5-79b7896eea93"
GR = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71"
JLFzf = "1019f520-868f-41f5-a6de-eb00f4b6a39c"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
Latexify = "23fbe1c1-3f47-55db-b15f-69d7ec21a316"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Measures = "442fdcdd-2543-5da2-b0f3-8c86c306513e"
NaNMath = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
PlotThemes = "ccf2f8ad-2431-5c83-bf29-c5338b663b6a"
PlotUtils = "995b91a9-d308-5afd-9ec6-746e21dbc043"
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
Preferences = "21216c6a-2e73-6563-6e65-726566657250"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Unzip = "41fe7b60-77ed-43a1-b4f0-825fd5a5650d"
REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
UnitfulLatexify = "45397f5d-5981-4c77-b2b3-fc36d6e9b728"
RecipesPipeline = "01d81517-befc-4cb6-b9ec-a95719d0359c"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
PlotUtils = "995b91a9-d308-5afd-9ec6-746e21dbc043"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
RelocatableFolders = "05181044-ff0b-4ac5-8273-598c1e38db00"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
Scratch = "6c6a2e73-6563-6170-7368-637461726353"
Showoff = "992d4aef-0814-514b-bc4d-f2e9a6c4116f"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
Latexify = "23fbe1c1-3f47-55db-b15f-69d7ec21a316"
Preferences = "21216c6a-2e73-6563-6e65-726566657250"
FFMPEG = "c87230d0-a227-11e9-1b43-d7ebe4e7570a"
Measures = "442fdcdd-2543-5da2-b0f3-8c86c306513e"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
UnicodeFun = "1cfade01-22cf-5700-b092-accc4b62d6e1"
UnitfulLatexify = "45397f5d-5981-4c77-b2b3-fc36d6e9b728"
Unzip = "41fe7b60-77ed-43a1-b4f0-825fd5a5650d"
PlotThemes = "ccf2f8ad-2431-5c83-bf29-c5338b663b6a"
Contour = "d38c429a-6771-53c6-b99e-75d170b6e991"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
NaNMath = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3"

[weakdeps]
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
[extras]
PlotlyKaleido = "f2990250-8cf9-495f-b13a-cce12b45703c"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Gaston = "4b11ee91-296f-5714-9832-002c20994614"
GR = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71"
OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881"
PGFPlotsX = "8314cec4-20b6-5062-9cdb-752b83310925"
VisualRegressionTests = "34922c18-7c2a-561c-bac1-01e79b2c4c92"
PythonPlot = "274fc56d-3b97-40fa-a1cd-1b4a50311bf9"
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
FreeType = "b38be410-82b0-50bf-ab77-7b57e271db43"
HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
Images = "916415d5-f1e6-5110-898d-aaa5f9f070e0"
LibGit2 = "76f85450-5226-5b5a-8eaa-529ad045b433"
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
PyPlot = "d330b81b-6aea-500a-939a-2ce795aea3ee"
RDatasets = "ce6b1742-4840-55fa-b093-852dadbb1d8b"
TestImages = "5e47fb64-e119-507b-a336-dd2b206d9990"
GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
IJulia = "7073ff75-c697-5162-941a-fcdaad2a7d2a"
ImageInTerminal = "d8c32880-2388-543b-8c61-d9f865259254"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"

[extensions]
FileIOExt = "FileIO"
GeometryBasicsExt = "GeometryBasics"
IJuliaExt = "IJulia"
ImageInTerminalExt = "ImageInTerminal"
UnitfulExt = "Unitful"
FilePathsBase = "48062228-2e41-5def-b9a4-89aafe57970f"
UnicodePlots = "b8865327-cd53-5732-bb35-84acbb429228"
PlotlyJS = "f0f68f2c-4968-5e81-91da-67840de0976a"
InspectDR = "d0351b0e-4b05-5898-87b3-e2a8edfddd1d"
SentinelArrays = "91c51154-3ec4-41a3-a24f-3f23e20d615c"
Gtk = "4c0ca9eb-093a-5379-98c5-f87ac0bbbf44"

[compat]
Aqua = "0.8"
Contour = "0.5 - 0.6"
Downloads = "1"
FFMPEG = "0.2 - 0.4"
FixedPointNumbers = "0.6 - 0.8"
NaNMath = "0.3, 1"
Showoff = "0.3.1, 1"
GR = "0.69.5 - 0.73"
Gaston = "1"
HDF5 = "0.16"
InspectDR = "0.4"
FixedPointNumbers = "0.6 - 0.8"
JLFzf = "0.1"
JSON = "0.21, 1"
LaTeXStrings = "1"
Latexify = "0.14 - 0.15, 0.16"
Measures = "0.3"
NaNMath = "0.3, 1"
PGFPlots = "3"
PGFPlotsX = "1"
PlotThemes = "2, 3"
PlotUtils = "1"
PlotlyBase = "0.7 - 0.8"
PlotlyJS = "0.18"
PlotlyKaleido = "1"
PrecompileTools = "1"
Preferences = "1"
PyPlot = "2"
PGFPlotsX = "1"
Unzip = "0.1 - 0.2"
PythonPlot = "1 - 1.0.2"
RecipesBase = "1.3.1"
RecipesPipeline = "0.6.10"
Reexport = "0.2, 1"
UnitfulLatexify = "1"
RecipesPipeline = "1"
LaTeXStrings = "1"
PlotUtils = "1"
JSON = "0.21, 1"
StatsBase = "0.33, 0.34"
HDF5 = "0.16"
RelocatableFolders = "0.3, 1"
Requires = "1"
Scratch = "1"
Showoff = "0.3.1, 1"
Statistics = "1"
StatsBase = "0.33, 0.34"
Latexify = "0.14 - 0.15, 0.16"
Preferences = "1"
FFMPEG = "0.2 - 0.4"
Measures = "0.3"
julia = "1.9"
RecipesBase = "1.3.1"
UnicodeFun = "0.4"
UnicodePlots = "3.4"
UnitfulLatexify = "1"
Unzip = "0.1 - 0.2"
julia = "1.6"
PlotThemes = "2, 3"
Contour = "0.5 - 0.6"
PlotlyJS = "0.18"
PlotlyKaleido = "2.2.2"
Reexport = "0.2, 1"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
[weakdeps]
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
FilePathsBase = "48062228-2e41-5def-b9a4-89aafe57970f"
FreeType = "b38be410-82b0-50bf-ab77-7b57e271db43"
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
IJulia = "7073ff75-c697-5162-941a-fcdaad2a7d2a"
ImageInTerminal = "d8c32880-2388-543b-8c61-d9f865259254"
InspectDR = "d0351b0e-4b05-5898-87b3-e2a8edfddd1d"
Gaston = "4b11ee91-296f-5714-9832-002c20994614"
GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
Gtk = "4c0ca9eb-093a-5379-98c5-f87ac0bbbf44"
HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
ImageMagick = "6218d12a-5da1-5696-b52f-db25d2ecc6d1"
Images = "916415d5-f1e6-5110-898d-aaa5f9f070e0"
InspectDR = "d0351b0e-4b05-5898-87b3-e2a8edfddd1d"
LibGit2 = "76f85450-5226-5b5a-8eaa-529ad045b433"
OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881"
PGFPlots = "3b7a836e-365b-5785-a47d-02c71176b4aa"
GR = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71"
PGFPlotsX = "8314cec4-20b6-5062-9cdb-752b83310925"
PlotlyBase = "a03496cd-edff-5a9b-9e67-9cda94a718b5"
PlotlyJS = "f0f68f2c-4968-5e81-91da-67840de0976a"
PlotlyKaleido = "f2990250-8cf9-495f-b13a-cce12b45703c"
PyPlot = "d330b81b-6aea-500a-939a-2ce795aea3ee"
PythonPlot = "274fc56d-3b97-40fa-a1cd-1b4a50311bf9"
RDatasets = "ce6b1742-4840-55fa-b093-852dadbb1d8b"
SentinelArrays = "91c51154-3ec4-41a3-a24f-3f23e20d615c"
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
StatsPlots = "f3b207a7-027a-5e70-b257-86293d7955fd"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TestImages = "5e47fb64-e119-507b-a336-dd2b206d9990"
UnicodePlots = "b8865327-cd53-5732-bb35-84acbb429228"
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
VisualRegressionTests = "34922c18-7c2a-561c-bac1-01e79b2c4c92"

[targets]
test = ["Aqua", "Colors", "Distributions", "FileIO", "FilePathsBase", "FreeType", "Gaston", "GeometryBasics", "Gtk", "ImageMagick", "Images", "InspectDR", "LibGit2", "OffsetArrays", "PGFPlotsX", "PlotlyJS", "PlotlyBase", "PyPlot", "PythonPlot", "PlotlyKaleido", "HDF5", "RDatasets", "SentinelArrays", "StableRNGs", "StaticArrays", "StatsPlots", "Test", "TestImages", "UnicodePlots", "Unitful", "VisualRegressionTests"]
test = ["Aqua", "Colors", "Distributions", "FileIO", "FilePathsBase", "FreeType", "Gaston", "GeometryBasics", "Gtk", "GR", "Images", "LibGit2", "OffsetArrays", "PGFPlotsX", "PlotlyJS", "PythonPlot", "PlotlyKaleido", "HDF5", "RDatasets", "SentinelArrays", "StableRNGs", "StaticArrays", "Test", "TestImages", "UnicodePlots", "Unitful", "VisualRegressionTests"]

[extensions]
FileIOExt = "FileIO"
UnitfulExt = "Unitful"
GeometryBasicsExt = "GeometryBasics"
IJuliaExt = "IJulia"
ImageInTerminalExt = "ImageInTerminal"
PlotsGRExt = "GR"
PlotsUnicodePlotsExt = "UnicodePlots"
PlotsPGFPlotsXExt = "PGFPlotsX"
PlotsPythonPlotExt = "PythonPlot"
PlotsPlotlyJSExt = "PlotlyJS"
PlotsPlotlyKaleidoExt = "PlotlyKaleido"
PlotsInspectDRExt = "InspectDR"
PlotsGastonExt = "Gaston"
4 changes: 2 additions & 2 deletions RecipesPipeline/Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "RecipesPipeline"
uuid = "01d81517-befc-4cb6-b9ec-a95719d0359c"
authors = ["Michael Krabbe Borregaard <[email protected]>"]
version = "0.6.12"
version = "1.0.0"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand All @@ -15,7 +15,7 @@ NaNMath = "0.3, 1"
PlotUtils = "0.6.5, 1"
RecipesBase = "1.3.1"
PrecompileTools = "1"
julia = "1.6"
julia = "1.9"

[extras]
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
Expand Down
20 changes: 10 additions & 10 deletions RecipesPipeline/src/RecipesPipeline.jl
Original file line number Diff line number Diff line change
Expand Up @@ -127,22 +127,22 @@ using PrecompileTools
mats = (Int[1 2; 3 4], Float64[1 2; 3 4])
surfs = Surface.(mats)
vols = Volume(ones(Int, 1, 2, 3)), Volume(ones(Float64, 1, 2, 3))
for pl_attr in plotattributes
_series_data_vector(1, pl_attr)
_series_data_vector([1], pl_attr)
_series_data_vector(["a"], pl_attr)
_series_data_vector([1 2], pl_attr)
_series_data_vector(["a" "b"], pl_attr)
_series_data_vector.(surfs, Ref(pl_attr))
_apply_type_recipe.(Ref(pl_attr), surfs, Ref(:x))
_apply_type_recipe.(Ref(pl_attr), mats, Ref(:x))
for pl_attrs in plotattributes
_series_data_vector(1, pl_attrs)
_series_data_vector([1], pl_attrs)
_series_data_vector(["a"], pl_attrs)
_series_data_vector([1 2], pl_attrs)
_series_data_vector(["a" "b"], pl_attrs)
_series_data_vector.(surfs, Ref(pl_attrs))
_apply_type_recipe.(Ref(pl_attrs), surfs, Ref(:x))
_apply_type_recipe.(Ref(pl_attrs), mats, Ref(:x))
_map_funcs(identity, [1, 2])
_map_funcs([identity, identity], [1, 2])
unzip([(1.0, 1.0)])
unzip([(1, 1)])
unzip([(1, 1.0)])
unzip([([1.0], [2.0])])
# _process_seriesrecipe(nothing, pl_attr)
# _process_seriesrecipe(nothing, pl_attrs)
# recipe_pipeline!(plt, [1, 2], ["foo", "bar"])
end
end
Expand Down
Loading

0 comments on commit c91872b

Please sign in to comment.