# Avoid Makie as a dependency?

**URL:** <https://discourse.julialang.org/t/avoid-makie-as-a-dependency/77063>\
**Category:** General Usage\
**Tags:** question, dependencies, makie\
**Created:** [February 25, 2022, 12:56pm UTC](https://discourse.julialang.org/t/avoid-makie-as-a-dependency/77063 "2022-02-25T12:56:48Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![BambOoxX](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bambooxx/32/22179_2.png) [@BambOoxX](https://discourse.julialang.org/u/BambOoxX)\
**Post date:** [February 25, 2022, 12:56pm UTC](https://discourse.julialang.org/t/avoid-makie-as-a-dependency/77063/1 "2022-02-25T12:56:49Z")

</div>

I know that in order to avoid having a package depend on `Plots` I can depend on `RecipesBase` and write some recipes.

In `Makie`, there is a [recipe mechanism](https://makie.juliaplots.org/v0.15/documentation/recipes/index.html) too, but in its current form it seems to rely on `Makie` itself.  
This allows to extend `Makie` but does not help with dependencies.

Given [this previous (unanswered) post](https://discourse.julialang.org/t/makie-recipe-usage/54292) I guess I’m not the only one with issues understanding the process…

Could someone clarify if there is a way do develop a package depending on `Makie` without actually needing it as a dependency ?

I thought of an alternative way based on `Requires`, that would only load `Makie` dependent code upon a `Makie` load in addition to my package, but I did not test it so far.

---

<div class="post-metadata">

**Author:** ![xzackli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xzackli/32/38301_2.png) [@xzackli](https://discourse.julialang.org/u/xzackli)\
**Post date:** [February 25, 2022, 1:03pm UTC](https://discourse.julialang.org/t/avoid-makie-as-a-dependency/77063/2 "2022-02-25T13:03:33Z")

</div>

One solution, if you want to cater to users who don’t use Makie, is to make a separate package for your recipes, i.e. `YourPackageMakie.jl`. For example, [GraphMakie](https://github.com/JuliaPlots/GraphMakie.jl) is a recipe package that has Makie as a dependency.

---

<div class="post-metadata">

**Author:** ![henry2004y](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henry2004y/32/9284_2.png) [@henry2004y](https://discourse.julialang.org/u/henry2004y)\
**Post date:** [February 25, 2022, 1:21pm UTC](https://discourse.julialang.org/t/avoid-makie-as-a-dependency/77063/3 "2022-02-25T13:21:11Z")

</div>

This is what I end up doing for my package as well, which seems to be the only option right now.

---

<div class="post-metadata">

**Author:** ![rikh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rikh/32/204104_2.png) [@rikh](https://discourse.julialang.org/u/rikh)\
**Post date:** [February 25, 2022, 1:40pm UTC](https://discourse.julialang.org/t/avoid-makie-as-a-dependency/77063/4 "2022-02-25T13:40:32Z")

</div>

An alternative is to use Requires.jl ([https://github.com/JuliaPackaging/Requires.jl](https://github.com/JuliaPackaging/Requires.jl)).

---

<div class="post-metadata">

**Author:** ![BambOoxX](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bambooxx/32/22179_2.png) [@BambOoxX](https://discourse.julialang.org/u/BambOoxX)\
**Post date:** [February 26, 2022, 12:17am UTC](https://discourse.julialang.org/t/avoid-makie-as-a-dependency/77063/5 "2022-02-26T00:17:59Z")

</div>

> [@rikh](#):
>
> An alternative is to use Requires.jl ([GitHub - JuliaPackaging/Requires.jl: Lazy code loading for Julia](https://github.com/JuliaPackaging/Requires.jl))

I guess that confirms my last thought…

@sdanisch Would you mind giving an _official_ best practice ?

---

<div class="post-metadata">

**Author:** ![rikh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rikh/32/204104_2.png) [@rikh](https://discourse.julialang.org/u/rikh)\
**Post date:** [February 26, 2022, 8:36am UTC](https://discourse.julialang.org/t/avoid-makie-as-a-dependency/77063/6 "2022-02-26T08:36:41Z")

</div>

Ah sorry I missed that

---

<div class="post-metadata">

**Author:** ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Post date:** [May 9, 2022, 6:10am UTC](https://discourse.julialang.org/t/avoid-makie-as-a-dependency/77063/7 "2022-05-09T06:10:26Z")

</div>

I would be interested in that too!

---

<div class="post-metadata">

**Author:** ![hexaeder](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hexaeder/32/24403_2.png) [@hexaeder](https://discourse.julialang.org/u/hexaeder)\
**Post date:** [May 9, 2022, 6:41am UTC](https://discourse.julialang.org/t/avoid-makie-as-a-dependency/77063/8 "2022-05-09T06:41:35Z")

</div>

There is a plan to move the recipe functionalities to the [`MakieCore.jl` package](https://github.com/JuliaPlots/Makie.jl/tree/master/MakieCore) with minimal dependencies (just `Observables.jl`). I am not sure if this is fully functional yet but you can try it.

---

<div class="post-metadata">

**Author:** ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Post date:** [May 9, 2022, 7:57am UTC](https://discourse.julialang.org/t/avoid-makie-as-a-dependency/77063/9 "2022-05-09T07:57:22Z")

</div>

Thanks! Also posting this issue for future reference  
[https://github.com/JuliaPlots/Makie.jl/issues/996](https://github.com/JuliaPlots/Makie.jl/issues/996)
