Skip to content

Commit

Permalink
Remove Compat and all @compats
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitvarkey committed Nov 5, 2015
1 parent c9808a0 commit 341346d
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 65 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ main(window) = begin
mesh(0.0, 0.0, 0.0) <<
[
ThreeJS.box(1.0, 1.0, 1.0),
material(@compat(Dict(:kind=>"lambert",:color=>"red")))
material(Dict(:kind=>"lambert",:color=>"red"))
],
pointlight(3.0, 3.0, 3.0),
camera(0.0, 0.0, 10.0)
Expand Down
1 change: 0 additions & 1 deletion REQUIRE
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
julia 0.4
Colors
Compat
Patchwork
5 changes: 2 additions & 3 deletions src/ThreeJS.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
module ThreeJS
module ThreeJS

import Patchwork
import Patchwork.Elem
using Compat

export outerdiv, initscene

Expand All @@ -11,7 +10,7 @@ include("properties.jl")

"Outer div to keep the three-js tag in."
function outerdiv(w::AbstractString="100%", h::AbstractString="600px")
Elem(:div, style=@compat Dict(:width=>w, :height=>h))
Elem(:div, style=Dict(:width=>w, :height=>h))
end

"Initiates a three-js scene"
Expand Down
46 changes: 23 additions & 23 deletions src/render.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ function mesh(
)
Elem(
:"three-js-mesh",
attributes = (@compat Dict(
attributes = Dict(
:x => x, :y => y, :z => z, :rx => rx, :ry => ry, :rz => rz
))
)
)
end

Expand All @@ -33,23 +33,23 @@ Creates a Box geometry of width `w`, height `h` and depth `d`.
Should be put in a `mesh` along with another material Elem to render.
"""
function box(w::Float64,h::Float64,d::Float64)
Elem(:"three-js-box", attributes = @compat Dict(:w=>w, :h=>h, :d=>d))
Elem(:"three-js-box", attributes = Dict(:w=>w, :h=>h, :d=>d))
end

"""
Creates a Sphere geometry of radius `r`.
Should be put in a `mesh` along with another material Elem to render.
"""
function sphere(r::Float64)
Elem(:"three-js-sphere", attributes = @compat Dict(:r=>r))
Elem(:"three-js-sphere", attributes = Dict(:r=>r))
end

"""
Creates a square base Pyramid geometry of base `b` and height `h`.
Should be put in a `mesh` along with another material Elem to render.
"""
function pyramid(b::Float64,h::Float64)
Elem(:"three-js-pyramid", attributes = @compat Dict(:base => b, :height => h))
Elem(:"three-js-pyramid", attributes = Dict(:base => b, :height => h))
end

"""
Expand All @@ -60,7 +60,7 @@ Should be put in a `mesh` along with another material Elem to render.
function cylinder(top::Float64,bottom::Float64,height::Float64)
Elem(
:"three-js-cylinder",
attributes = @compat Dict(:top => top, :bottom => bottom, :height => height)
attributes = Dict(:top => top, :bottom => bottom, :height => height)
)
end

Expand All @@ -71,7 +71,7 @@ Should be put in a `mesh` along with another material Elem to render.
function torus(radius::Float64,tube::Float64)
Elem(
:"three-js-torus",
attributes = @compat Dict(:r => radius, :tube => tube)
attributes = Dict(:r => radius, :tube => tube)
)
end

Expand All @@ -82,7 +82,7 @@ Should be put in a `mesh` along with another material Elem to render.
function dodecahedron(radius::Float64)
Elem(
:"three-js-dodecahedron",
attributes = @compat Dict(:r => radius)
attributes = Dict(:r => radius)
)
end

Expand All @@ -93,7 +93,7 @@ Should be put in a `mesh` along with another material Elem to render.
function icosahedron(radius::Float64)
Elem(
:"three-js-icosahedron",
attributes = @compat Dict(:r => radius)
attributes = Dict(:r => radius)
)
end

Expand All @@ -104,7 +104,7 @@ Should be put in a `mesh` along with another material Elem to render.
function octahedron(radius::Float64)
Elem(
:"three-js-octahedron",
attributes = @compat Dict(:r => radius)
attributes = Dict(:r => radius)
)
end

Expand All @@ -115,7 +115,7 @@ Should be put in a `mesh` along with another material Elem to render.
function tetrahedron(radius::Float64)
Elem(
:"three-js-tetrahedron",
attributes = @compat Dict(:r => radius)
attributes = Dict(:r => radius)
)
end

Expand All @@ -127,7 +127,7 @@ Should be put in a `mesh` along with another material Elem to render.
function plane(width::Float64, height::Float64)
Elem(
:"three-js-plane",
attributes = @compat Dict(:w => width, :h => height)
attributes = Dict(:w => width, :h => height)
)
end

Expand All @@ -154,7 +154,7 @@ function geometry(
end
geom = Elem(
:"three-js-geometry",
attributes = @compat Dict(
attributes = Dict(
:x => x,
:y => y,
:z => z,
Expand Down Expand Up @@ -198,7 +198,7 @@ function parametric{T<:Colors.Color}(
]
geom = Elem(
:"three-js-parametric",
attributes = @compat Dict(
attributes = Dict(
:slices => slices,
:stacks => stacks,
:x => xs,
Expand Down Expand Up @@ -254,7 +254,7 @@ end
"""
Creates a material tag with properties passed in as a dictionary.
"""
function material(props::Dict=@compat Dict())
function material(props::Dict=Dict())
Elem(:"three-js-material", attributes = props)
end

Expand All @@ -274,7 +274,7 @@ function camera(
)
Elem(
:"three-js-camera",
attributes = @compat Dict(
attributes = Dict(
:x => x, :y => y,:z => z,
:fov => fov,:aspect => aspect, :near => near, :far => far
)
Expand All @@ -298,7 +298,7 @@ function pointlight(
colorString = string("#"*hex(color))
Elem(
:"three-js-light",
attributes = @compat Dict(
attributes = Dict(
:x => x, :y => y, :z => z,
:kind => "point",
:color => colorString,
Expand Down Expand Up @@ -330,7 +330,7 @@ function spotlight(
colorString = string("#"*hex(color))
Elem(
:"three-js-light",
attributes = @compat Dict(
attributes = Dict(
:x => x, :y => y, :z => z,
:kind => "spot",
:color => colorString,
Expand All @@ -352,7 +352,7 @@ function ambientlight(color::Colors.RGB{U8}=colorant"white")
colorString = string("#"*hex(color))
Elem(
:"three-js-light",
attributes = @compat Dict(:kind => "ambient", :color => colorString)
attributes = Dict(:kind => "ambient", :color => colorString)
)
end

Expand Down Expand Up @@ -392,7 +392,7 @@ function line(
colors = map(x -> "#"*hex(x), vertexcolors)
Elem(
:"three-js-line",
attributes = @compat Dict(
attributes = Dict(
:xs => xs,
:ys => ys,
:zs => zs,
Expand Down Expand Up @@ -457,7 +457,7 @@ for more details.
These properties should be passed in as a `Dict`.
"""
function linematerial(props = @compat Dict())
function linematerial(props = Dict())
Elem(:"three-js-line-material", attributes = props)
end

Expand All @@ -482,10 +482,10 @@ function grid(
rz::Float64 = 0.0,
colorcenter::Colors.RGB{U8}=colorant"black",
colorgrid::Colors.RGB{U8}=colorant"black"
)
)
Elem(
:"three-js-grid",
attributes = @compat Dict(
attributes = Dict(
:size => size,
:step => step,
:x => x,
Expand Down

0 comments on commit 341346d

Please sign in to comment.