Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 17:10
    darynwhite closed #3918
  • 17:10
    darynwhite commented #3918
  • 17:04
    ehudkr commented #189
  • 16:37
    philippjfr commented #3562
  • 15:54
    cbarokk commented #3562
  • 15:53
    cbarokk commented #3562
  • 15:53
    cbarokk commented #3562
  • 15:46
    cbarokk commented #3562
  • 15:42
    philippjfr labeled #613
  • 15:42
    philippjfr opened #613
  • 15:38
    philippjfr labeled #612
  • 15:38
    philippjfr unlabeled #612
  • 15:38
    philippjfr milestoned #612
  • 15:38
    philippjfr labeled #612
  • 15:38
    philippjfr opened #612
  • 15:35
    philippjfr milestoned #219
  • 15:21
    jbednar commented #3921
  • 14:56
    poplarShift commented #611
  • 14:47
    ahuang11 edited #3922
  • 14:47
    ahuang11 edited #3922
orkun
@orkun
Hi,
I want to change the axes of the plot with respect to DynamicMap which returns a selected point. Then I will have zoomed area that contains the point.
I tried this. But axes never changed. What am I doing wrong?
def cb_hast_sel ( index  ):
       ...
       x_range = (lon -10000,lon +10000 )
       y_range = (lat -10000,lat +10000 )
       points = hv.Points (coords_df , kdims=['lon', 'lat']).redim.range (x=x_range , y=y_range  ).options(color='blue', size= 30 ,fill_alpha = 0.8 ,line_color="yellow", marker='^' , scaling_factor=4  )
       return points

hast_sel_point = hv.DynamicMap( cb_hast_sel ,  streams= [hast_sel_stream] )

#
buffer_dmap =  bmap * fay_paths_12  * frame_path * hv.DynamicMap(buffer_cb, streams=[pipe_buf]).opts(plot=plot_opts_buf , style=style_opts_buf) * hast_point_dmap  * okul_point_dmap * hast_sel_point  #   selected point here
Philipp Rudiger
@philippjfr
Should be redim.range(lon=x_range, lat=y_range)
Abhilash Chandran
@Abhilash-Chandran
Any help would be great!... Should I run a bokeh serve for every new plot for which the underlyring data is different.? Like if I have ten files based on which I want to show a line plot for each of them separately.
Abhilash Chandran
@Abhilash-Chandran
image.png
I am new to bokeh and holoviews so please bear my silly questions. In my case I want same user be able to view two or more files at the same time.
sameerCoder
@sameerCoder

@philippjfr @jbednar
Hi am deploying my holoviews plot with bokeh server , so that other user can access my plot from there pc/system,
some how i am able to get plot with dynamic data update with http://localhost:63006/ in new tab , but when i reload the page dynamic data update get lost and i am trying to access this plot by other pc/system by giving my ipaddress:63006 then the plot is not coming,
can you please tell me how i can access my plot from another pc / system by url .

finalplot=tiles*rasterize(hmap1).options(**opts)*hmap2
finalplot

renderer = hv.renderer('bokeh').instance(mode='server')
server=renderer.app(finalplot,show=True,new_window=True)

After reloading the webpage http://localhost:63006/ i am getting an error :-

tornado.application - ERROR - Exception in callback functools.partial(<bound method IOLoop._discard_future_result of <tornado.platform.asyncio.AsyncIOMainLoop object at 0x0000013C98A42080>>, <Future finished exception=AbbreviatedException(<class 'RuntimeError'>, RuntimeError('_pending_writes should be non-None when we have a document lock, and we should have the lock when the document changes'), <traceback object at 0x0000013CBDF0C088>)>)
Traceback (most recent call last):
  File "C:\Users\walps\Anaconda3\envs\plotenv\lib\site-packages\holoviews\plotting\bokeh\element.py", line 1286, in _update_glyphs
    self._update_glyph(renderer, properties, mapping, glyph, source, data)
  File "C:\Users\walps\Anaconda3\envs\plotenv\lib\site-packages\holoviews\plotting\bokeh\element.py", line 1134, in _update_glyph
    self._update_datasource(source, data)
  File "C:\Users\walps\Anaconda3\envs\plotenv\lib\site-packages\holoviews\plotting\bokeh\plot.py", line 264, in _update_datasource
    source.data.update(data)
  File "C:\Users\walps\Anaconda3\envs\plotenv\lib\site-packages\bokeh\core\property\wrappers.py", line 393, in update
    descriptor._notify_mutated(owner, old, hint=hint)
  File "C:\Users\walps\Anaconda3\envs\plotenv\lib\site-packages\bokeh\core\property\descriptors.py", line 875, in _notify_mutated
    self._real_set(obj, old, value, hint=hint)
  File "C:\Users\walps\Anaconda3\envs\plotenv\lib\site-packages\bokeh\core\property\descriptors.py", line 838, in _real_set
    self._trigger(obj, old, value, hint=hint, setter=setter)
  File "C:\Users\walps\Anaconda3\envs\plotenv\lib\site-packages\bokeh\core\property\descriptors.py", line 915, in _trigger
    obj.trigger(self.name, old, value, hint, setter)
  File "C:\Users\walps\Anaconda3\envs\plotenv\lib\site-packages\bokeh\model.py", line 704, in trigger
    super(Model, self).trigger(attr, old, new, hint=hint, setter=setter)
  File "C:\Users\walps\Anaconda3\envs\plotenv\lib\site-packages\bokeh\util\callback_manager.py", line 161, in trigger
    self._document._notify_change(self, attr, old, new, hint, setter, invoke)
  File "C:\Users\walps\Anaconda3\envs\plotenv\lib\site-packages\bokeh\document\document.py", line 1005, in _notify_change
    self._trigger_on_change(event)
  File "C:\Users\walps\Anaconda3\envs\plotenv\lib\site-packages\bokeh\document\document.py", line 1100, in _trigger_on_change
    self._with_self_as_curdoc(invoke_callbacks)
  File "C:\Users\walps\Anaconda3\envs\plotenv\lib\site-packages\bokeh\document\document.py", line 1113, in _with_self_as_curdoc
    return f()
  File "C:\Users\walps\Anaconda3\envs\plotenv\lib\site-packages\bokeh\document\document.py", line 1099, in invoke_callbacks
    cb(event)
  File "C:\Users\walps\Anaconda3\envs\plotenv\lib\site-packages\bokeh\document\document.py", line 669, in <lambda>
    self._callbacks[receiver] = lambda event: event.dispatch(receiver)
  File "C:\Users\walps\Anaconda3\envs\plotenv\lib\site-packages\bokeh\document\events.py", line 244, in dispatch
    super(ModelChangedEvent, self).dispatch(receiver)
  File "C:\Users\walps\Anaconda3\envs\plotenv\lib\site-packages\bokeh\document\events.py", line 126, in dispatch
    receiver._document_patched(self)
  File "C:\Users\walps\Anaconda3\envs\plotenv\lib\site-packages\bokeh\server\session.py", line 214, in _document_patched
File "C:\Users\walps\Anaconda3\envs\plotenv\lib\site-packages\bokeh\server\session.py", line 214, in _document_patched
    raise RuntimeError("_pending_writes should be non-None when we have a document lock, and we should have the lock when the document changes")
RuntimeError: _pending_writes should be non-None when we have a document lock, and we should have the lock when the document changes

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\walps\Anaconda3\envs\plotenv\lib\site-packages\tornado\ioloop.py", line 743, in _run_callback
    ret = callback()
  File "C:\Users\walps\Anaconda3\envs\plotenv\lib\site-packages\tornado\ioloop.py", line 767, in _discard_future_result
    future.result()
  File "C:\Users\walps\Anaconda3\envs\plotenv\lib\site-packages\tornado\gen.py", line 742, in run
    yielded = self.gen.send(value)
  File "C:\Users\walps\Anaconda3\envs\plotenv\lib\site-packages\bokeh\server\session.py", line 70, in _needs_document_lock_wrapper
    result = yield yield_for_all_futures(func(self, *args, **kwargs))
  File "C:\Users\walps\Anaconda3\envs\plotenv\lib\site-packages\bokeh\server\session.py", line 191, in with_document_locked
    return func(*args, **kwargs)
  File "C:\Users\walps\Anaconda3\envs\plotenv\lib\site-packages\bokeh\document\document.py", line 1127, in wrapper
    return doc._with_self_as_curdoc(invoke)
  File "C:\Users\walps\Anaconda3\envs\plotenv\lib\site-packages\bokeh\document\document.py", line 1113, in _with_self_as_curdoc
    return f()
  File "C:\Users\walps\Anaconda3\envs\plotenv\lib\site-packages\bokeh\document\document.py", line 1126, in invoke
    return f(*args, **kwargs)
  File "C:\Users\walps\Anaconda3\envs\plotenv\lib\site-packages\bokeh\document\document.py", line 916, in remove_then_invoke
    return callback(*args, **kwargs)
  File "C:\Users\walps\Anaconda3\envs\plotenv\lib\site-packages\holoviews\plotting\bokeh\callbacks.py", line 381, in process_on_change
    self.on_msg(msg)
  File "C:\Users\walps\Anaconda3\envs\plotenv\lib\site-packages\holoviews\plotting\bokeh\callbacks.py", line 132, in on_msg
    raise e
  File "C:\Users\walps\Anaconda3\envs\plotenv\lib\site-packages\holoviews\plotting\bokeh\callbacks.py", line 130, in on_msg
    Stream.trigger(streams)
  File "C:\Users\walps\Anaconda3\envs\plotenv\lib\site-packages\holoviews\streams.py", line 158, in trigger
    subscriber(**dict(union))
  File "C:\Users\walps\Anaconda3\envs\plotenv\lib\site-packages\holoviews\plotting\plot.py", line 615, in refresh
    self._trigger_refresh(stream_key)
  File "C:\Users\walps\Anaconda3\envs\plotenv\lib\site-packages\holoviews\plotting\plot.py", line 624, in _trigger_refresh
    self.update(key)
  File "C:\Users\walps\Anaconda3\envs\plotenv\lib\site-packages\holoviews\plotting\plot.py", line 596, in update
    item = self.__getitem__(key)
  File "C:\Users\walps\Anaconda3\envs\plotenv\lib\site-packages\holoviews\plotting\plot.py", line 261, in __getitem__
    self.update_frame(frame)
  File "C:\Users\walps\Anaconda3\envs\plotenv\lib\site-packages\holoviews\plotting\bokeh\element.py", line 2148, in update_frame
    subplot.update_frame(key, ranges, element=el)
  File "C:\Users\walps\Anaconda3\envs\plotenv\lib\site-packages\holoviews\plotting\bokeh\element.py", line 1334, in update_frame
    self._update_glyphs(element, ranges, self.style[self.cyclic_index])
  File "C:\Users\walps\Anaconda3\envs\plotenv\lib\site-packages\holoviews\plotting\bokeh\element.py", line 1286, in _update_glyphs
    self._update_glyph(renderer, properties, mapping, glyph, source, data)
  File "C:\Users\walps\Anaconda3\envs\plotenv\lib\site-packages\holoviews\core\options.py", line 200, in __exit__
    raise AbbreviatedException(etype, value, traceback)
holoviews.core.options.AbbreviatedException: RuntimeError: _pending_writes should be non-None when we have a document lock, and we should have the lock when the document changes

To view the original traceback, catch this exception and call print_traceback() method.
‚Äč
Abhilash Chandran
@Abhilash-Chandran
@sameerCoder This blog could perhaps give you some hint. https://www.rbtechblog.com/blog/deploy_bokeh_app
you will have to serve your plots by embedding into an html page and serve it using a server(wsgi or asgi) . A simple bokeh serve command will expect the http requests are originating from the same system in your case localhost. But when your colleagues want to access it, they will access it using your ip address where your plot is hosted. In that case you will have to add your ipaddress in to the allow_websocket_origin parameter. Also here is a git hub repo where you have examples of bokeh apps embeded into different server frameworks. https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed
sameerCoder
@sameerCoder
I want to access my holoviews plot from another user PC / System.
sameerCoder
@sameerCoder
suppose i am getting my plot result at url localhost:12345
1- when i am trying to access my plot result by giving url - myipaddress:12345 than Bokeh Application as title of webpage is coming but the plot is not coming.
2- When i am in localhost:12345 webpage and do reload of webpage and than try to do zoom in than dynamic data is not coming.
Philipp Rudiger
@philippjfr
@Abhilash-Chandran You could use URL parameters to choose the dataset you want.
Try supplying a URL parameter and then look at pn.state.session_args
Abhilash Chandran
@Abhilash-Chandran
@philippjfr even if i get a new request i a new file, how do i show the user this new file without disturbing the file he is already viewing. In my understanding this new file has to be served via another bokeh serve right.?
Philipp Rudiger
@philippjfr
Each request should launch a new session.
Abhilash Chandran
@Abhilash-Chandran
Let me check the documents once again of I missed something about a creating a new session. I thought a new session is only for the same app with same datasource. If I could parameterize which datasource I should use for every new plot then perhaps my problem is nearly solved. Any hints where to look for would be helpful. Thank you @philippjfr
Philipp Rudiger
@philippjfr

Right, that's what I'm saying you could use URL parameters to parameterize it:

your-app-url?dataset='some_dataset'

And then in your code you would get that parameter from pn.state.session_args.

Abhilash Chandran
@Abhilash-Chandran
@philippjfr Regarding the parameters my doubt is not on how i receive it.. but rather how I create a new session with this new parameters. Because I am using graphql for client server communication where in will add aditional information other than the file name like no of samples to plot, user info etc. Request query params could be an issue later when i deploy the app :)
Philipp Rudiger
@philippjfr
Hmm, so you're embedding the app somehow?
Abhilash Chandran
@Abhilash-Chandran
Yes.. Into a flutter-web based UI. so I that I can port it to even desktop later.
Embedding is the direction I am going towards.
https://bokeh.pydata.org/en/latest/docs/reference/client.html ?? will this section help..? anyway going to read it.... :)
Andrew Tolmie
@DancingQuanta
Gah ran into No plotting class for HoloMap found for complex dataset. The output I got is
:HoloMap   [type]
   :HoloMap   [glue,loss,component]
      :NdOverlay   [conc]
         :Scatter   [Nominal_Field]   (Moment)
Andrew Tolmie
@DancingQuanta
Oh forgot I am using uncertainties so converted to float and tried again.
Andrew
@IAteAnDrew1_twitter
import holoviews as hv
hv.extension('matplotlib')
hv.Bars([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]).opts(xticks=3)
is there a way to only show a few tick labels for a categorical chart
Andrew Tolmie
@DancingQuanta
How do I enable scientific notation in hv.Table?
Andrew Tolmie
@DancingQuanta
Anyone know how to use to() to specify one kdim is holomap and other overlay?
Philipp Rudiger
@philippjfr
Add both to the initial groupby and then do .overlay('overlay_kdim')
Andrew Tolmie
@DancingQuanta
i get Exception: Supplied dimensions component not found.
Philipp Rudiger
@philippjfr
I'd have to see the actual code you executed.
Andrew Tolmie
@DancingQuanta
Yes, but I won't be able to make an example tonight. Will come back to this.
later*
Philipp Rudiger
@philippjfr
Did you include both dimensions in the original groupby in the .to call?
Andrew Tolmie
@DancingQuanta
in a list, yes
.to(hv.Curve, ['index', 'component']).overlay('component')
Omitting the component generates a dropdown menu.
Philipp Rudiger
@philippjfr
I don't understand what you're trying to do. You can't have component on the yaxis and group by it.
Andrew Tolmie
@DancingQuanta
It is not y-axis though. I am using a Dataarray and so I expect that to be y-axis.
Philipp Rudiger
@philippjfr
.to(hv.Curve, x-dimension, y-dimension, holomap+overlay dimensions).overlay(overlay dimensions)
Andrew Tolmie
@DancingQuanta
I do not know how to specify y-dimension because I am using a dataArray.
Philipp Rudiger
@philippjfr
What's the repr of your hv.Dataset?
It'll tell you.
print(dataset)
Andrew Tolmie
@DancingQuanta
:Dataset [mpms_index,sample,component] (Moment)
Philipp Rudiger
@philippjfr
.to(hv.Curve, 'mpms_index', 'Moment').overlay('component')
Andrew Tolmie
@DancingQuanta
That works when I removed the square bracket..., I throught a list specify kdims without using keywords!
Philipp Rudiger
@philippjfr
A Curve has one kdim and one vdim, if you specify a single one it gets upgraded to a list.
Andrew Tolmie
@DancingQuanta
Thank you but I still have other questions like scientific notation for hv.table
Andrew
@IAteAnDrew1_twitter
you probably have to use hooks and find the bokeh table object and set the formatter
https://bokeh.pydata.org/en/latest/docs/reference/models/widgets.tables.html
Andrew
@IAteAnDrew1_twitter
is there a way to assign one color for one colorbar tick interval
import xarray as xr
import hvplot.xarray
import holoviews as hv
hv.extension('matplotlib')

ds = xr.tutorial.open_dataset('air_temperature').isel(time=0)
ds.hvplot.contourf('lon', 'lat', levels=[230, 231, 232, 240, 250]).opts(cbar_ticks=[230, 231, 232, 240, 250], color_levels=4)
image.png