GiovineItalia / Compose.jl

Declarative vector graphics
http://giovineitalia.github.io/Compose.jl/latest/
Other
248 stars 83 forks source link

Compose not working on OS X? #207

Closed ckaran closed 8 years ago

ckaran commented 8 years ago

I'm following the examples at http://composejl.org/ to learn how to use compose. Here is my output:

Cems-Mac-Pro:~ crossbar$ julia
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.4.5 (2016-03-18 00:58 UTC)
 _/ |\__'_|_|_|\__'_|  |  
|__/                   |  x86_64-apple-darwin13.4.0

julia> using Compose

julia> compose(compose(context(), rectangle()), fill("tomato"))
Compose.Context(Measures.BoundingBox{Tuple{Measures.Length{:w,Float64},Measures.Length{:h,Float64}},Tuple{Measures.Length{:w,Float64},Measures.Length{:h,Float64}}}((0.0w,0.0h),(1.0w,1.0h)),Nullable{Compose.UnitBox{S,T,U,V}}(),Nullable{Compose.Rotation{P<:NTuple{N,Measures.Measure}}}(),Nullable{Compose.Mirror}(),Compose.ListNull{Compose.Container}(),Compose.ListNode{Compose.Form{P<:Compose.FormPrimitive}}(Compose.Form{Compose.RectanglePrimitive{Tuple{Measures.Length{:w,Float64},Measures.Length{:h,Float64}},Measures.Length{:w,Float64},Measures.Length{:h,Float64}}}([Compose.RectanglePrimitive{Tuple{Measures.Length{:w,Float64},Measures.Length{:h,Float64}},Measures.Length{:w,Float64},Measures.Length{:h,Float64}}((0.0w,0.0h),1.0w,1.0h)],symbol("")),Compose.ListNull{Compose.Form{P<:Compose.FormPrimitive}}()),Compose.ListNode{Compose.Property{P<:Compose.PropertyPrimitive}}(Compose.Property{Compose.FillPrimitive}([Compose.FillPrimitive(RGBA{Float64}(1.0,0.38823529411764707,0.2784313725490196,1.0))]),Compose.ListNull{Compose.Property{P<:Compose.PropertyPrimitive}}()),0,false,false,false,false,nothing,nothing,0.0,symbol(""))

I don't get the colored square that is shown in the example. Am I doing something wrong?

My system info is:

Cems-Mac-Pro:~ crossbar$ uname -a
Darwin Cems-Mac-Pro.local 13.4.0 Darwin Kernel Version 13.4.0: Mon Jan 11 18:17:34 PST 2016; root:xnu-2422.115.15~1/RELEASE_X86_64 x86_64

And I'm running OS X 10.9.5.

lobingera commented 8 years ago

if your call to compose returns data, you are doing nothing wrong. But you need some output medium to draw/render to

julia> c = compose(compose(context(), rectangle()), fill("tomato"));

julia> draw(SVG("a.svg",4inch,4inch),c);
ckaran commented 8 years ago

Got it. Would you mind changing the examples so that they are complete? That is, so that users can just copy/paste into a Julia REPL and have them work? It might save some headaches.