Skip to content

Commit

Permalink
Fix deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
femtocleaner[bot] committed Aug 21, 2018
1 parent ad8d448 commit c5d903d
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 26 deletions.
4 changes: 2 additions & 2 deletions deps/find_attr_groups.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ function main()
_SRC_ATTRS = collect(filter(x -> endswith(string(x), "src"), nms))

open(joinpath(@__DIR__, "src_attrs.csv"), "w") do f
writecsv(f, map(string, _SRC_ATTRS))
writedlm(f, map(string, _SRC_ATTRS))
end

open(joinpath(@__DIR__, "underscore_attrs.csv"), "w") do f
writecsv(f, map(string, _UNDERSCORE_ATTRS))
writedlm(f, map(string, _UNDERSCORE_ATTRS))
end

_UNDERSCORE_ATTRS, _SRC_ATTRS
Expand Down
13 changes: 8 additions & 5 deletions docs/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,22 @@ There are three core types for representing a visualization (not counting the
two abstract types):

```julia
abstract AbstractTrace
abstract AbstractLayout
abstract type AbstractTrace
end
abstract type AbstractLayout

end

type GenericTrace{T<:AbstractDict{Symbol,Any}} <: AbstractTrace
mutable struct GenericTrace{T<:AbstractDict{Symbol,Any}} <: AbstractTrace
kind::ASCIIString
fields::T
end

type Layout{T<:AbstractDict{Symbol,Any}} <: AbstractLayout
mutable struct Layout{T<:AbstractDict{Symbol,Any}} <: AbstractLayout
fields::T
end

type Plot{TT<:AbstractTrace}
mutable struct Plot{TT<:AbstractTrace}
data::Vector{TT}
layout::AbstractLayout
divid::Base.Random.UUID
Expand Down
4 changes: 2 additions & 2 deletions docs/building_traces_layouts.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ A `Plot` instance will have a vector of `trace`s. These should each be a subtype
PlotlyJS.jl defines one such subtype:

```julia
type GenericTrace{T<:AbstractDict{Symbol,Any}} <: AbstractTrace
mutable struct GenericTrace{T<:AbstractDict{Symbol,Any}} <: AbstractTrace
kind::ASCIIString
fields::T
end
Expand Down Expand Up @@ -239,7 +239,7 @@ julia> println(JSON.json(t1, 2))
The `Layout` type is defined as

```julia
type Layout{T<:AbstractDict{Symbol,Any}} <: AbstractLayout
mutable struct Layout{T<:AbstractDict{Symbol,Any}} <: AbstractLayout
fields::T
end
```
Expand Down
2 changes: 1 addition & 1 deletion docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ For example, if we wanted to add an example of a scatter plot of the sin functio

```julia
function sin_scatter()
x = linspace(0, 2*pi, 50)
x = range(0, stop=2*pi, length=50)
y = sin(x)
plot(scatter(x=x, y=y, marker_symbol="line-nw", mode="markers+symbols"))
end
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/3d.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ function meshcube()
i=[7, 0, 0, 0, 4, 4, 6, 6, 4, 0, 3, 2],
j=[3, 4, 1, 2, 5, 6, 5, 2, 0, 1, 6, 3],
k=[0, 7, 2, 3, 6, 7, 1, 1, 5, 5, 7, 6],
intensity=linspace(0, 1, 8),
intensity=range(0, stop=1, length=8),
colorscale=[
[0, "rgb(255, 0, 255)"],
[0.5, "rgb(0, 255, 0)"],
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/box_plots.md
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ box9()
```julia
function box10()
n_box = 30
colors = ["hsl($i, 50%, 50%)" for i in linspace(0, 360, n_box)]
colors = ["hsl($i, 50%, 50%)" for i in range(0, stop=360, length=n_box)]

gen_y_data(i) =
3.5*sin(pi*i/n_box) + i/n_box + (1.5+0.5*cos(pi*i/n_box)).*rand(10)
Expand Down
10 changes: 6 additions & 4 deletions docs/syncplots.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ We'll also discuss how to integrate with various frontends
Recall that the definition of the `Plot` object is

```julia
type Plot{TT<:AbstractTrace}
mutable struct Plot{TT<:AbstractTrace}
data::Vector{TT}
layout::AbstractLayout
divid::Base.Random.UUID
Expand Down Expand Up @@ -124,7 +124,9 @@ To do this in a simple and reliable way we introduce the concept of a
`SyncPlot`, which is defined as:

```julia
abstract AbstractPlotlyDisplay
abstract type AbstractPlotlyDisplay

end

struct SyncPlot{TD<:AbstractPlotlyDisplay}
plot::Plot
Expand Down Expand Up @@ -179,7 +181,7 @@ A convenient typealias has been defined for `SyncPlot`s with the
`ElectronDisplay` frontend:

```julia
typealias ElectronPlot SyncPlot{ElectronDisplay}
const ElectronPlot = SyncPlot{ElectronDisplay}
```

Please note that the Electron frontend also allows PlotlyJS.jl figures to be
Expand All @@ -201,7 +203,7 @@ for the plot as well as registering Julia functions as callbacks.
A `SyncPlot` with a `JupyterDisplay` also has a typealias:

```julia
typealias JupyterPlot SyncPlot{JupyterDisplay}
const JupyterPlot = SyncPlot{JupyterDisplay}
```

Please note that the `JupyterPlot` frontend also allows PlotlyJS.jl figures to
Expand Down
2 changes: 1 addition & 1 deletion examples/3d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ function meshcube()
i=[7, 0, 0, 0, 4, 4, 6, 6, 4, 0, 3, 2],
j=[3, 4, 1, 2, 5, 6, 5, 2, 0, 1, 6, 3],
k=[0, 7, 2, 3, 6, 7, 1, 1, 5, 5, 7, 6],
intensity=linspace(0, 1, 8),
intensity=range(0, stop=1, length=8),
colorscale=[
[0, "rgb(255, 0, 255)"],
[0.5, "rgb(0, 255, 0)"],
Expand Down
2 changes: 1 addition & 1 deletion examples/box_plots.jl
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ end

function box10()
n_box = 30
colors = ["hsl($i, 50%, 50%)" for i in linspace(0, 360, n_box)]
colors = ["hsl($i, 50%, 50%)" for i in range(0, stop=360, length=n_box)]

gen_y_data(i) =
3.5*sin(pi*i/n_box) + i/n_box + (1.5+0.5*cos(pi*i/n_box)).*rand(10)
Expand Down
2 changes: 1 addition & 1 deletion examples/heatmaps.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using PlotlyJS
srand(42)
Random.seed!(42)

function heatmap1()
plot(heatmap(z=[1 20 30; 20 1 60; 30 60 1]))
Expand Down
2 changes: 0 additions & 2 deletions src/PlotlyJS.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
__precompile__()

module PlotlyJS

using Reexport
Expand Down
8 changes: 4 additions & 4 deletions src/util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ JSON.lower(sp::SyncPlot) = JSON.lower(sp.plot)
PlotlyBase._is3d(p::SyncPlot) = _is3d(p.plot)

# subplot methods on syncplot
Base.hcat{TP<:SyncPlot}(sps::TP...) = TP(hcat([sp.plot for sp in sps]...))
Base.vcat{TP<:SyncPlot}(sps::TP...) = TP(vcat([sp.plot for sp in sps]...))
Base.vect{TP<:SyncPlot}(sps::TP...) = vcat(sps...)
Base.hvcat{TP<:SyncPlot}(rows::Tuple{Vararg{Int}}, sps::TP...) =
Base.hcat(sps::TP...) where {TP<:SyncPlot} = TP(hcat([sp.plot for sp in sps]...))
Base.vcat(sps::TP...) where {TP<:SyncPlot} = TP(vcat([sp.plot for sp in sps]...))
Base.vect(sps::TP...) where {TP<:SyncPlot} = vcat(sps...)
Base.hvcat(rows::Tuple{Vararg{Int}}, sps::TP...) where {TP<:SyncPlot} =
TP(hvcat(rows, [sp.plot for sp in sps]...))


Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module PlotlyJSTest
using TestSetExtensions

using Base.Test
using Test

using PlotlyJS
const M = PlotlyJS
Expand Down

0 comments on commit c5d903d

Please sign in to comment.