Skip to content

Commit

Permalink
Documented / validated plot attributes (#3626)
Browse files Browse the repository at this point in the history
* add second `@recipe` method

* rename function

* implement recipe and keyword validation

* fix some bugs

* rename for clarity

* change Scatter recipe

* use argument symbols correctly

* change Lines

* change linesegments

* do a bunch of plots more

* fix text bugs

* splice in internal attribute after mesh creation

* add allowlist

* fix text

* add attribute deprecation mechanism

* add explanation

* remove `text` for GLMakie

* fix contour volume attributes

* add rasterize to allowlist

* add `enable_depth` to volume

* add `matcap` to mesh

* set `fxaa = false` on scatter, lines, linesegments, text

* move fxaa after mixins

* fix keywords

* remove markersize attribute

* remove invalid markersize

* add depthsorting to attributes for scatter

* fix forwarded attributes

* add absorption to volume

* don't use `used_attributes` for datashader canvas convert

* fix positional args

* image

* add better printing and rudimentary tests

* make allowlist a tuple for fewer allocations

* attribute names tuple instead of set

* make deprecations also a tuple

* avoid intermediate vector to speed up attribute creation

* apply same optimization to blocks

* implement mechanism to augment user docstring

* delete manually written out attribute docs

* use funcsym in docstring

* incorporate attribute docs into docstring again

* use equal

* add changelog

* introduce `DocumentedAttributes` with macro

* add function to access `DocumentedAttributes` of a recipe

* fix module mutation problem for now

* move definition behind PlotType

* return Attributes instead of Dict

* convert wireframe recipe

* close over reference

* don't include prereleases in benchmark, failed with 1.11 alpha

* stringify default expr

* convert arrows

* add docs

* directly convert default exprs to strings

* convert ablines

* print wrong attribute in red

* convert annotations

* convert arc

* remove attributes in arrows docstring

* convert band

* fix escaping issue

* convert barplot

* convert bracket

* fix barplot usage in hist

* convert contourf

* typo

* convert contour

* fix waterfall

* comment out arrows test

* convert datashader

* convert errorbar and rangebar

* convert hvlines

* convert hvspan

* convert pie

* convert rainclouds

* convert scatterlines

* convert series

* convert spy

* convert stairs

* convert stem

* convert streamplot

* convert timeseries

* convert tooltip

* convert tricontourf

* add transformation to allowlist

* convert triplot

* convert volumeslices

* convert voronoiplot

* convert waterfall

* convert boxplot

* convert crossbar

* convert density

* convert qqplot and qqnorm

* convert ecdfplot

* convert hexbin

* convert hist

* convert violin

* improve error message printing

* add docstrings for mutating functions and plot types

* add missing docstrings

* reconnect lines docstring

* move functions out of macro

* fix arrows example and adjust docs

* put necessary functions back into macro

---------

Co-authored-by: Simon <sdanisch@protonmail.com>
  • Loading branch information
jkrumbiegel and SimonDanisch authored Mar 5, 2024
1 parent 9d10308 commit 51da2c6
Show file tree
Hide file tree
Showing 55 changed files with 1,815 additions and 1,555 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/compilation-benchmark.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- uses: julia-actions/setup-julia@v1
with:
version: '1'
include-all-prereleases: true
# include-all-prereleases: true
arch: x64
- uses: julia-actions/cache@v1
- name: Benchmark
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

- Remove StableHashTraits in favor of calculating hashes directly with CRC32c [#3667](https://github.com/MakieOrg/Makie.jl/pull/3667).

- **Breaking (sort of)** Added a new `@recipe` variant which allows documenting attributes directly where they are defined and validating that all attributes are known whenever a plot is created. This is not breaking in the sense that the API changes, but user code is likely to break because of misspelled attribute names etc. that have so far gone unnoticed.
- **Breaking** Reworked line shaders in GLMakie and WGLMakie [#3558](https://github.com/MakieOrg/Makie.jl/pull/3558)
- GLMakie: Removed support for per point linewidths
- GLMakie: Adjusted dots (e.g. with `linestyle = :dot`) to bend across a joint
Expand Down
1 change: 1 addition & 0 deletions GLMakie/src/GLAbstraction/GLTypes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ function RenderObject(
try
data[k] = gl_convert(v)
catch e
@error "gl_convert for key `$k` failed"
rethrow(e)
end

Expand Down
Loading

0 comments on commit 51da2c6

Please sign in to comment.