Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,31 @@
name: TagBot
on:
schedule:
- cron: 0 * * * *
issue_comment:
types:
- created
workflow_dispatch:
inputs:
lookback:
default: 3
permissions:
actions: read
checks: read
contents: write
deployments: read
issues: read
discussions: read
packages: read
pages: read
pull-requests: read
repository-projects: read
security-events: read
statuses: read
jobs:
TagBot:
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
runs-on: ubuntu-latest
steps:
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
ssh: ${{ secrets.DOCUMENTER_KEY }}
41 changes: 0 additions & 41 deletions .github/workflows/ci-master-workflow.yml

This file was deleted.

40 changes: 0 additions & 40 deletions .github/workflows/ci-pr-workflow.yml

This file was deleted.

49 changes: 49 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: CI

on:
pull_request:
push:
branches: [master]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- 'lts'
- '1'
arch: [x64]
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-latest
prefix: xvfb-run

steps:
- name: Ubuntu dependencies
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt -y update
sudo apt -y install lynx # for debugging electron
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-runtest@latest
with:
prefix: ${{ matrix.prefix }}
- uses: julia-actions/julia-processcoverage@latest
- uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
file: lcov.info
6 changes: 5 additions & 1 deletion .github/workflows/deploy_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ on:
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
docdeploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-docdeploy@latest
env:
Expand Down
11 changes: 0 additions & 11 deletions .github/workflows/label.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ PlotlyKaleido = "2.2.5"
Reexport = "0.2, 1"
Requires = "1.0"
WebIO = "0.8"
julia = "1.3, 1.4, 1.5, 1.6"
julia = "1.6"

[extras]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
Expand Down
23 changes: 22 additions & 1 deletion src/PlotlyJS.jl
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,25 @@ for k in [:add_hrect!, :add_hline!, :add_vrect!, :add_vline!, :add_shape!, :add_
end
end

end # module
function unsafe_electron(deb=false) # https://github.com/JuliaGizmos/Blink.jl/issues/325#issuecomment-2252670794
# workaround for github.com/JuliaGizmos/Blink.jl/issues/325
# inspired from github.com/Eben60/PackageMaker.jl/commit/297219f5c14845bf75de4475cabab4dbf6e6599d
@eval Blink.AtomShell Window(args...; kwargs...) = Window(shell(; debug = $deb), args...; kwargs...)

@eval Blink.AtomShell function init(; debug = $deb)
electron() # Check path exists
p, dp = port(), port()
debug && inspector(dp)
dbg = debug ? "--inspect=$dp" : []
# vvvvvvvvvvvv begin addition
cmd = `$(electron()) --no-sandbox $dbg $mainjs port $p`
# ^^^^^^^^^^^^ end addition
proc = (debug ? run_rdr : run)(cmd; wait = false)
conn = try_connect(ip"127.0.0.1", p)
shell = Electron(proc, conn)
initcbs(shell)
return shell
end
end

end # module
4 changes: 1 addition & 3 deletions src/display.jl
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,7 @@ function SyncPlot(
SyncPlot(p, scope, nothing)
end

function plot(args...; kwargs...)
SyncPlot(Plot(args...; kwargs...))
end
plot(args...; kwargs...) = SyncPlot(Plot(args...; kwargs...))

# Add some basic Julia API methods on SyncPlot that just forward onto the Plot
Base.size(sp::SyncPlot) = size(sp.plot)
Expand Down
3 changes: 2 additions & 1 deletion test/blink.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
using Blink, WebIO

t() = scatter(y=rand(10))

p = plot([t(), t(), t(), t()])
w = Blink.Window()
body!(w, p.scope)
sleep(3.0) # make sure we give time for svg to render
sleep(5) # make sure we give time for svg to render

# hook up testing observables
on(p.scope["__gd_contents"]) do x end
Expand Down
2 changes: 1 addition & 1 deletion test/kaleido.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ end
continue
end
fn = tempname() * "." * ext
@show func, fn
# @show func, fn
myplot(fn, func) == fn
@test isfile(fn)
rm(fn)
Expand Down
16 changes: 6 additions & 10 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
module PlotlyJSTest
using Test

using PlotlyJS
const M = PlotlyJS

# using Blink
# !Blink.AtomShell.isinstalled() && Blink.AtomShell.install()
using Test

# include("blink.jl")
if Sys.islinux()
debug = Base.get_bool_env("CI", false) ? false : true
PlotlyJS.unsafe_electron(debug)
include("blink.jl")
end
include("kaleido.jl")

# these are public API
@test isfile(PlotlyJS._js_path)
@test !isempty(PlotlyJS._js_version)
@test !startswith(PlotlyJS._js_version, "v")

end
Loading