holoviews

Customize edge color based on node selection Holoviews/Bokeh Chord diagram

旧时模样 提交于 2021-02-11 17:01:22
问题 I have created a holoviews chord plot where each node is associated with particular group(community). I have a requirement that whenever I tap on a particular node all the edge associated with it should be same color as the color of the node. For example in this chord diagram example chord If I select a blue node the edge color should be same as node color(i.e blue). But Here when I click on a blue node I am getting few edges of of blue and few edges of orange color(basically the edge takes

Holoviews .to Interface: How To Attribute cmap and range according to an input parameter

霸气de小男生 提交于 2021-02-11 15:31:16
问题 Using the dataset ds defined below how can I attribute one colormap and its associated range per value of channels when rendering the holomap? import numpy as np import holoviews as hv from holoviews import opts hv.extension('bokeh', 'matplotlib') data = np.random.rand(100, 100, 3,20) times = np.arange(0,10,.5) channels = ['a','b','c'] ds = hv.Dataset((times,channels, np.linspace(0., 1., 100), np.linspace(0., 1., 100), data), kdims=['t', 'channel', 'y', 'x'], vdims=hv.Dimension('T', range=(0,

How to create custom hover tool with value mapping

本小妞迷上赌 提交于 2021-02-05 12:13:34
问题 I am trying to create a custom hover tool using which takes the y-value of the plot and maps the value to different value. The code I could come up with so far to achieve this functionality is from bokeh.models import HoverTool import holoviews as hv df = pd.DataFrame( { "zero": [0, 0, 0, 0, 0, 0, 0], "one": [1, 1, 1, 1, 1, 1, 1], "two": [2, 2, 2, 2, 2, 2, 2], } ) mapping = {i: c for i, c in enumerate(df.columns)} def col_mapping(num): return mapping[int(num)] hover = HoverTool(tooltips=[("x"

How to create custom hover tool with value mapping

╄→尐↘猪︶ㄣ 提交于 2021-02-05 12:11:55
问题 I am trying to create a custom hover tool using which takes the y-value of the plot and maps the value to different value. The code I could come up with so far to achieve this functionality is from bokeh.models import HoverTool import holoviews as hv df = pd.DataFrame( { "zero": [0, 0, 0, 0, 0, 0, 0], "one": [1, 1, 1, 1, 1, 1, 1], "two": [2, 2, 2, 2, 2, 2, 2], } ) mapping = {i: c for i, c in enumerate(df.columns)} def col_mapping(num): return mapping[int(num)] hover = HoverTool(tooltips=[("x"

Why is my plot updated by panel (twice) when I change a button setting that shouldn't trigger any updates? (Panel Holoviz)

 ̄綄美尐妖づ 提交于 2021-01-29 08:34:37
问题 I made a class to explore and train models. When I change the value of dropdown 'choose_model_type' in the code example below, I would expect nothing to change in my dashboard, since there are no @param.depends('choose_model_type', watch=True) in my class. However, my dashboard gets updated, when I change the value of dropdown 'choose_model_type'. In this case function plot_y() gets triggered twice if I look at the logs: 2019-09-26 11:24:42,802 starting plot_y 2019-09-26 11:24:42,825 starting

How to display Dataset labels inside a HoverTool in a Sankey diagram using Holoviews and Bokeh

匆匆过客 提交于 2021-01-29 08:01:01
问题 I am using Holoviews to display a Sankey Diagram and would like to customize the information displayed when positioning a cursor over the diagram. However, I don't know how to display the correct labels. Taking the 2nd example from the docs, I can add a custom HoverTool import holoviews as hv from holoviews import opts from bokeh.models import HoverTool nodes = ["PhD", "Career Outside Science", "Early Career Researcher", "Research Staff", "Permanent Research Staff", "Professor", "Non-Academic

How to properly handle datetime and categorical axes in bokeh/holoviews heatmap plot?

☆樱花仙子☆ 提交于 2021-01-29 04:48:59
问题 I'm trying to plot a simple heatmap using bokeh/holoviews. My data (pandas dataframe) has categoricals (on y) and datetime (on x). The problem is that the number of categorical elements is >3000 and the resulting plot appears with messed overlapped tickers on the y axis that makes it totally useless. Currently, is there a reliable way in bokeh to select only a subset of the tickers based on the zoom level? I've already tried plotly and the result looks perfect but however I need to use bokeh

Can't Save Bokeh Plot with Panel from PyViz Example

99封情书 提交于 2021-01-28 05:05:40
问题 I have been working through the tutorials on pyviz.org. specifically the dashboard one If I setup the example here: http://pyviz.org/tutorial/A2_Dashboard_Workflow.html The save icon in the bokeh plot appears to be disabled. If I click area zoom, wheel zoom,or the reset icon they behave as expected. But the save button does nothing. Is this intentional, able to be reset, or a bug on my side? Ben 回答1: This is a fundamental limitation of browsers, the issue is that the map tiles in the

Can't Save Bokeh Plot with Panel from PyViz Example

让人想犯罪 __ 提交于 2021-01-28 05:03:57
问题 I have been working through the tutorials on pyviz.org. specifically the dashboard one If I setup the example here: http://pyviz.org/tutorial/A2_Dashboard_Workflow.html The save icon in the bokeh plot appears to be disabled. If I click area zoom, wheel zoom,or the reset icon they behave as expected. But the save button does nothing. Is this intentional, able to be reset, or a bug on my side? Ben 回答1: This is a fundamental limitation of browsers, the issue is that the map tiles in the

How to render a GraphViz Dot file via holoviz and NetworkX?

混江龙づ霸主 提交于 2021-01-27 14:34:37
问题 So I look onto docs and see that they use Graphviz, yet do not use any files... And I have a 4mil+ .dot (70mb) graph file I want to render. How to open and render GraphViz Dot file via holoviz and NetworkX? ##Update: Tested @GijsWobben sample: shows nada on even small 6kb file Something similar was expected for the small file: 回答1: How about this: import hvplot.networkx as hvnx import networkx as nx import holoviews as hv # Read the file G = nx.drawing.nx_agraph.read_dot("./figure.dot") #