Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document color specification #1374

Closed
ben-schulz opened this issue Dec 25, 2019 · 10 comments · Fixed by #1388
Closed

document color specification #1374

ben-schulz opened this issue Dec 25, 2019 · 10 comments · Fixed by #1388

Comments

@ben-schulz
Copy link
Contributor

it would be helpful if the docs at http://gadflyjl.org listed the allowed color values e.g. as a table, so that it would be evident whether a usage is valid.

e.g. is there a reference i could use to check whether Theme( default_color="foo" ) or Scale.lab_gradient("foo", "bar", "baz") produces a valid style element?

i saw that a related issue (#254) had been opened and closed back in 2014. i also noticed this mention in the tutorial:

Color scales in Gadfly by default are produced from perceptually uniform colorspaces (LUV/LCHuv or LAB/LCHab), though it supports RGB, HSV, HLS, XYZ, and converts arbitrarily between these. Of course, CSS/X11 named colors work too: "old lace", anyone?

which gives a hint of where i might look -- but it felt like a circuitous path to take just to find out whether, for example, "cyan" or "darkred" were recognizable values.

@kimikage
Copy link

kimikage commented Dec 27, 2019

The documents of Colors.jl provide the named color charts.
http://juliagraphics.github.io/Colors.jl/v0.9/namedcolors/
http://juliagraphics.github.io/Colors.jl/stable/namedcolors/

However, there is currently an issue regarding whether the color names with spaces (e.g. "old lace") are valid. (cf. #1368, JuliaGraphics/Colors.jl#386, JuliaGraphics/Colors.jl#388)

@ben-schulz
Copy link
Contributor Author

thanks! i had noticed mention of `Colors.jl, but wasn't sure which ones were suitable to use as the single point of truth.

the document behind the link is exactly what i was looking for; i only wish the Gadfly docs had made it more evident where to look.

@kimikage
Copy link

On new Colors.jl (i.e. v0.10 or later), the color names with spaces are not recommended. (cf. #1368 (comment))
Therefore, "old lace" is no longer suitable as a tutorial and Gadfly's docs should be updated. However, I am not good at English, and do not really understand where newbies struggle. If no one updates the documentation, I will sluggishly do it after tackling some issues.

@ben-schulz
Copy link
Contributor Author

i think this is a fairly minor, low-priority change; it would be nice to have, but could easily wait.

@bjarthur
Copy link
Member

@ben-schulz care to make a PR pointing to GiovineItalia/Compose.jl#380 (comment) ?

@ben-schulz
Copy link
Contributor Author

@bjarthur : i have a patch, but i seem to be having some trouble building the docs, so i haven't made a PR yet.

is there somewhere i could check the status of the doc build, or are there special instructions for building the docs of this project? i'm getting a ton of warnings from the code blocks, ending in an uncaught error that appears to originate outside of the modified text.

this is my first time building the docs ( following the generic instructions for Documenter ), so i may very well be doing something wrong -- though i admit that i'm unsure what.

@bjarthur
Copy link
Member

see the gadfly specific instructions. shouldn't be much different the the generic ones though.

did you do this in a clean environment? if not, perhaps you're got incompatible packages installed.

@ben-schulz
Copy link
Contributor Author

@bjarthur : thanks for the pointer! unfortunately, i've tried it, and still running into the same issue.

more explicitly, running the Julia 1.3.1 binary for Linux/x86, i did the following:

rm -Rf ~/.julia/*

julia -e 'using Pkg; Pkg.add(PackageSpec(name="Compose", rev="master"))'

julia --color=yes --project=docs -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'

julia --color=yes --project=docs docs/make.jl

i'm totally willing to admit that i might be making some noob mistake somewhere in here -- but the commands above look to me like they should clean the existing Julia packages and instantiate the environment specified in the docs project manifest. unfortunately, the script fails for me, with this stack trace:

ERROR: LoadError: MethodError: no method matching Compose.Table(::Int32, ::Int64, ::UnitRange{Int32}, ::UnitRange{Int64}; x_prop=[1.0, 1.0, 1.0], y_prop=[1.0], fixed_configs=Any[Tuple{Int32,Int32}[(1, 1)], Tuple{Int32,Int32}[(1, 2)], Tuple{Int32,Int64}[(2, 3), (2, 4), (2, 5)], Tuple{Int32,Int64}[(3, 3), (3, 4), (3, 5)]])
Closest candidates are:
  Compose.Table(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any) at /home/slowpoke/.julia/packages/Compose/aVZwV/src/table.jl:7 got unsupported keyword arguments "x_prop", "y_prop", "fixed_configs"
  Compose.Table(::Integer, ::Integer, ::UnitRange{Int32}, ::UnitRange{Int32}; y_prop, x_prop, aspect_ratio, units, order, withjs, withoutjs, fixed_configs) at /home/slowpoke/.julia/packages/Compose/aVZwV/src/table.jl:46
  Compose.Table(::Array{Array{Context,1},2}, ::UnitRange{Int32}, ::UnitRange{Int32}, ::Union{Nothing, Array{Float64,1}}, ::Union{Nothing, Array{Float64,1}}, ::Union{Nothing, Float64}, ::Array{T,1} where T, ::Union{Nothing, UnitBox}, ::Int32, ::Bool, ::Bool) at /home/slowpoke/.julia/packages/Compose/aVZwV/src/table.jl:7 got unsupported keyword arguments "x_prop", "y_prop", "fixed_configs"
Stacktrace:
 [1] render(::Gadfly.Geom.SubplotGrid, ::Theme, ::Gadfly.Aesthetics, ::Array{Gadfly.Aesthetics,1}, ::Array{Gadfly.Data,1}, ::Dict{Symbol,Gadfly.ScaleElement}) at /home/slowpoke/sandbox/Gadfly.jl/src/geom/subplot.jl:262
 [2] (::Gadfly.var"#108#109"{Dict{Symbol,Gadfly.ScaleElement}})(::Tuple{Layer,Gadfly.Aesthetics,Array{Gadfly.Aesthetics,1},Array{Gadfly.Data,1},Theme}) at ./none:0
 [3] collect(::Base.Generator{Base.Iterators.Zip{Tuple{Array{Layer,1},Array{Gadfly.Aesthetics,1},Array{Array{Gadfly.Aesthetics,1},1},Array{Array{Gadfly.Data,1},1},Array{Theme,1}}},Gadfly.var"#108#109"{Dict{Symbol,Gadfly.ScaleElement}}}) at ./generator.jl:47
 [4] #render_prepared#107(::Bool, ::Bool, ::typeof(Gadfly.render_prepared), ::Plot, ::Gadfly.Coord.SubplotGrid, ::Gadfly.Aesthetics, ::Array{Gadfly.Aesthetics,1}, ::Array{Array{Gadfly.StatisticElement,1},1}, ::Array{Array{Gadfly.Aesthetics,1},1}, ::Array{Array{Gadfly.Data,1},1}, ::Dict{Symbol,Gadfly.ScaleElement}, ::Array{Gadfly.GuideElement,1}) at /home/slowpoke/sandbox/Gadfly.jl/src/Gadfly.jl:824
 [5] render_prepared(::Plot, ::Gadfly.Coord.SubplotGrid, ::Gadfly.Aesthetics, ::Array{Gadfly.Aesthetics,1}, ::Array{Array{Gadfly.StatisticElement,1},1}, ::Array{Array{Gadfly.Aesthetics,1},1}, ::Array{Array{Gadfly.Data,1},1}, ::Dict{Symbol,Gadfly.ScaleElement}, ::Array{Gadfly.GuideElement,1}) at /home/slowpoke/sandbox/Gadfly.jl/src/Gadfly.jl:813
 [6] render(::Plot) at /home/slowpoke/sandbox/Gadfly.jl/src/Gadfly.jl:759
 [7] draw at /home/slowpoke/sandbox/Gadfly.jl/src/Gadfly.jl:864 [inlined]
 [8] show(::Base.GenericIOBuffer{Array{UInt8,1}}, ::MIME{Symbol("text/html")}, ::Plot) at /home/slowpoke/sandbox/Gadfly.jl/src/Gadfly.jl:954
 [9] __binrepr at ./multimedia.jl:157 [inlined]
 [10] _textrepr at ./multimedia.jl:149 [inlined]
 [11] #stringmime#6(::Nothing, ::typeof(Base64.stringmime), ::MIME{Symbol("text/html")}, ::Plot) at /buildworker/worker/package_linux32/build/usr/share/julia/stdlib/v1.3/Base64/src/Base64.jl:43
 [12] stringmime(::MIME{Symbol("text/html")}, ::Plot) at /buildworker/worker/package_linux32/build/usr/share/julia/stdlib/v1.3/Base64/src/Base64.jl:43
 [13] display_dict(::Plot) at /home/slowpoke/.julia/packages/Documenter/Eayks/src/Utilities/Utilities.jl:652
 [14] #invokelatest#1 at ./essentials.jl:709 [inlined]
 [15] invokelatest at ./essentials.jl:708 [inlined]
 [16] runner(::Type{Documenter.Expanders.ExampleBlocks}, ::Markdown.Code, ::Documenter.Documents.Page, ::Documenter.Documents.Document) at /home/slowpoke/.julia/packages/Documenter/Eayks/src/Expanders.jl:571
 [17] dispatch(::Type{Documenter.Expanders.ExpanderPipeline}, ::Markdown.Code, ::Vararg{Any,N} where N) at /home/slowpoke/.julia/packages/Documenter/Eayks/src/Utilities/Selectors.jl:167
 [18] expand(::Documenter.Documents.Document) at /home/slowpoke/.julia/packages/Documenter/Eayks/src/Expanders.jl:30
 [19] runner(::Type{Documenter.Builder.ExpandTemplates}, ::Documenter.Documents.Document) at /home/slowpoke/.julia/packages/Documenter/Eayks/src/Builder.jl:179
 [20] dispatch(::Type{Documenter.Builder.DocumentPipeline}, ::Documenter.Documents.Document) at /home/slowpoke/.julia/packages/Documenter/Eayks/src/Utilities/Selectors.jl:167
 [21] #3 at /home/slowpoke/.julia/packages/Documenter/Eayks/src/Documenter.jl:287 [inlined]
 [22] cd(::Documenter.var"#3#8"{Documenter.Documents.Document}, ::String) at ./file.jl:104
 [23] #makedocs#1(::Bool, ::Documenter.Writers.HTMLWriter.HTML, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Base.Iterators.Pairs{Symbol,Any,NTuple{4,Symbol},NamedTuple{(:modules, :clean, :sitename, :pages),Tuple{Array{Module,1},Bool,String,Array{Any,1}}}}, ::typeof(makedocs)) at /home/slowpoke/.julia/packages/Documenter/Eayks/src/Documenter.jl:286
 [24] (::Documenter.var"#kw##makedocs")(::NamedTuple{(:modules, :clean, :sitename, :pages),Tuple{Array{Module,1},Bool,String,Array{Any,1}}}, ::typeof(makedocs)) at ./none:0
 [25] top-level scope at /home/slowpoke/sandbox/Gadfly.jl/docs/make.jl:3
 [26] include at ./boot.jl:328 [inlined]
 [27] include_relative(::Module, ::String) at ./loading.jl:1105
 [28] include(::Module, ::String) at ./Base.jl:31
 [29] exec_options(::Base.JLOptions) at ./client.jl:287
 [30] _start() at ./cliendt.jl:460
in expression starting at /home/slowpoke/sandbox/Gadfly.jl/docs/make.jl:3

does Julia stash package artifacts anywhere besides the .julia directory, that i've failed to clean up? or could there be an unrelated issue in the build?

@kimikage
Copy link

running the Julia 1.3.1 binary for Linux/x86

This seems to be a potential bug on the 32-bit version.
no method matching Compose.Table(::Int32, ::Int64, ::UnitRange{Int32}, ::UnitRange{Int64};...

function Table(m::Integer, n::Integer, y_focus::UnitRange{Int}, x_focus::UnitRange{Int};
               y_prop=nothing, x_prop=nothing,
               aspect_ratio=nothing,
               units=nothing, order=0, withjs=false, withoutjs=false,
               fixed_configs=Any[])

https://github.com/GiovineItalia/Compose.jl/blob/3c15da737fc2bc15d2759374dd092db7d142464b/src/table.jl#L40-L44

@ben-schulz
Copy link
Contributor Author

ben-schulz commented Jan 20, 2020

thanks for advising; i'll try building from source, and also open an issue on Compose.jl, since this seems like an unexpected platform-specific behavior.

ben-schulz added a commit to ben-schulz/Gadfly.jl that referenced this issue Jan 21, 2020
add hyperlink to color table in `Colors.jl`,
and reference as the source for
permissible color names.
ben-schulz added a commit to ben-schulz/Gadfly.jl that referenced this issue Jan 21, 2020
add hyperlink to color table
in `Colors.jl`, and reference
that library as the point-of-truth.
ben-schulz added a commit to ben-schulz/Gadfly.jl that referenced this issue Jan 21, 2020
add hyperlink to table in `Colors.jl`,
and note that library as
the point-of-truth.

incorporate revision suggested by @Mattriks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants