cjdoris / Bokeh.jl

Interactive plotting made easy
https://cjdoris.github.io/Bokeh.jl
Other
77 stars 3 forks source link

VS-Code support #24

Closed oschulz closed 1 year ago

oschulz commented 1 year ago

Would it be possible to support VS-Code?

cjdoris commented 1 year ago

Good question - turns out the answer is an easy yes! I've pushed it to the main branch. Try it out with pkg> add Bokeh#main.

oschulz commented 1 year ago

Wow, thanks a lot @cjdoris !

CC @theHenks

oschulz commented 1 year ago

I have Bokeh#main installed, but VS-code doesn't show the plot.

Works great!

RoyiAvital commented 1 month ago

I tried on the latest VS Code Extension + Bokeh and I don't see the output in the plots panel:

using Bokeh;
hF = figure(tooltips = [("x", "\$x"), ("y", "\$y")]);
numPts = 1_000_000;
plot!(hF, Scatter, x = randn(numPts), y = randn(numPts));
display(hF);

I tried also:

using Bokeh;
hF = figure(tooltips = [("x", "\$x"), ("y", "\$y")]);
numPts = 1_000_000;
plot!(hF, Scatter, x = randn(numPts), y = randn(numPts));
hF

What I get is:

Figure:
  below = [
    LinearAxis: (blank)
  ]
  center = [
    Grid:
      axis = ...
      dimension = 0
    Grid:
      axis = LinearAxis: (blank)
      dimension = 1
  ]
  left = [
    ...
  ]
  renderers = [
    GlyphRenderer:
      data_source = ColumnDataSource:
        data = Dict(
          "x" => [
            0.047218730879338484
            0.3371817777795867
            -0.6078247938847209
            -0.6664937825224468
            -1.6427951412814774
            ...
          ]
          "y" => [
            -0.8682703513109037
            -0.31971273708943954
            -0.7279602741241682
            -2.1904784163490674
            0.6724763893560851
            ...
          ]
        )
      glyph = Scatter:
        x = Field("x")
        y = Field("y")
      view = CDSView:
        source = ...
  ]
  toolbar = Toolbar:
    tools = [
      PanTool: (blank)
      BoxZoomTool: (blank)
      WheelZoomTool: (blank)
      SaveTool: (blank)
      ResetTool: (blank)
      ...
    ]
  x_range = DataRange1d: (blank)
  x_scale = LinearScale: (blank)
  y_range = DataRange1d: (blank)
  y_scale = LinearScale: (blank)

julia> hF
Figure:
  below = [
    LinearAxis: (blank)
  ]
  center = [
    Grid:
      axis = ...
      dimension = 0
    Grid:
      axis = LinearAxis: (blank)
      dimension = 1
  ]
  left = [
    ...
  ]
  renderers = [
    GlyphRenderer:
      data_source = ColumnDataSource:
        data = Dict(
          "x" => [
            0.047218730879338484
            0.3371817777795867
            -0.6078247938847209
            -0.6664937825224468
            -1.6427951412814774
            ...
          ]
          "y" => [
            -0.8682703513109037
            -0.31971273708943954
            -0.7279602741241682
            -2.1904784163490674
            0.6724763893560851
            ...
          ]
        )
      glyph = Scatter:
        x = Field("x")
        y = Field("y")
      view = CDSView:
        source = ...
  ]
  toolbar = Toolbar:
    tools = [
      PanTool: (blank)
      BoxZoomTool: (blank)
      WheelZoomTool: (blank)
      SaveTool: (blank)
      ResetTool: (blank)
      ...
    ]
  x_range = DataRange1d: (blank)
  x_scale = LinearScale: (blank)
  y_range = DataRange1d: (blank)
  y_scale = LinearScale: (blank)

Yet nothing is rendered.

cjdoris commented 4 weeks ago

Looks like I never made a release since adding this feature. Will do that soon. In the meantime you can install the unreleased version with pkg> add Bokeh#main.

cjdoris commented 2 weeks ago

v0.4.4 being released now https://github.com/JuliaRegistries/General/pull/110615