MakieOrg / Makie.jl

Interactive data visualizations and plotting in Julia
https://docs.makie.org/stable
MIT License
2.37k stars 302 forks source link

`IntervalsBetween` cannot be used for Theming because it lives in Makie.jl #3836

Closed Moelf closed 4 months ago

Moelf commented 4 months ago

It's quite useful to have IntervalsBetween as part of the default theme, right now one needs to depend on Makie.jl which is a bit too large.

asinghvi17 commented 4 months ago

Is this still an issue now that package extensions can be used, though?

Moelf commented 4 months ago

kind of, because the themes are usually a variable, and you can't introduce new identifiers into the namespace with Pkg extension

asinghvi17 commented 4 months ago

Wouldn't a pattern like this solve that though?

# MyModule.jl
function mytheme end
# MyModuleMakieExt.jl
import MyModule: mytheme
mytheme() = ...

Also themes (at least in Makie/MakieThemes) are usually functions as far as I've seen?

SimonDanisch commented 4 months ago

We kind of want to remove MakieCore, so maybe we should make an issue where we collect, if there's anything important that can't be done without a MakieExt, or any other disadvantage.

Moelf commented 4 months ago

I don't think we can define new functions in Extension, so it would be nice to keep recipe magic macros in MakieCore

asinghvi17 commented 4 months ago

That's also solvable by defining function stubs and importing them into the extension.

Moelf commented 4 months ago

yes, I mean, everything is solvable -- but at the entry-level, it increases code repetition (a bit like C++ declaration and definition).

In the end one could argue because this is developer-facing it's fine, although I think "defining plotting" is so common we want to make the common case as simple as possible

jkrumbiegel commented 4 months ago

Having MakieCore is not necessarily simple though, as this example also shows. It's hard to define some arbitrary boundary and it also complicates development a bit to have multiple packages where one would do.