Skip to content

Commit 97e833c

Browse files
committed
Tighten RemotePlot signature
1 parent 771bac9 commit 97e833c

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/Plotly.jl

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,14 @@ const default_opts = Dict{Symbol,Any}(:origin => "plot",
2525

2626
## Taken from https://github.com/johnmyleswhite/Vega.jl/blob/master/src/Vega.jl#L51
2727
# Open a URL in a browser
28-
function openurl(url::ASCIIString)
29-
@osx_only run(`open $url`)
30-
@windows_only run(`start $url`)
31-
@linux_only run(`xdg-open $url`)
28+
function openurl(url::String)
29+
if is_apple()
30+
run(`open $url`)
31+
elseif is_windows()
32+
run(`start $url`)
33+
elseif is_unix()
34+
run(`xdg-open $url`)
35+
end
3236
end
3337

3438
openurl(url::URI) = openurl(string(url))
@@ -41,7 +45,7 @@ Proxy for a plot stored on the Plotly cloud.
4145
immutable RemotePlot
4246
url::URI
4347
end
44-
RemotePlot(url) = RemotePlot(URI(url))
48+
RemotePlot(url::String) = RemotePlot(URI(url))
4549

4650
"""
4751
Display a plot stored in the Plotly cloud in a browser window.

0 commit comments

Comments
 (0)