第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

散景:顯示/隱藏?cái)?shù)字的小工具

散景:顯示/隱藏?cái)?shù)字的小工具

喵喵時(shí)光機(jī) 2021-06-18 18:39:27
希望按照 UI 的方式做一些事情,如下所示:Bokeh:使用復(fù)選框小部件隱藏和顯示繪圖,其中我可以選擇性地在一列圖形中顯示/隱藏整個(gè)圖形。我可以選擇顯示哪些圖(假設(shè)我可以命名數(shù)字)的下拉菜單(帶有多個(gè)選擇的 OptionMenu)會(huì)更可取。我對(duì)JS不熟悉,有什么指導(dǎo)嗎?(提前致謝)我希望圖像不再可見(jiàn),下一個(gè)圖形會(huì)像這樣跳起來(lái):例如:我在生成為的列中有多個(gè)數(shù)字:from bokeh.io import output_file, showfrom bokeh.layouts import columnfrom bokeh.plotting import figureoutput_file("layout.html")x = list(range(11))y0 = xy1 = [10 - i for i in x]y2 = [abs(i - 5) for i in x]# create a new plots1 = figure(plot_width=250, plot_height=250, title=None)s1.circle(x, y0, size=10, color="navy", alpha=0.5)# create another ones2 = figure(plot_width=250, plot_height=250, title=None)s2.triangle(x, y1, size=10, color="firebrick", alpha=0.5)# create and anothers3 = figure(plot_width=250, plot_height=250, title=None)s3.square(x, y2, size=10, color="olive", alpha=0.5)# put the results in a column and showshow(column(s1, s2, s3))
查看完整描述

2 回答

?
交互式愛(ài)情

TA貢獻(xiàn)1712條經(jīng)驗(yàn) 獲得超3個(gè)贊

s1.tags, s2.tags, s3.tags = ['Foo'], ['Bar'], ['Arr'] # name your plots

plots = [s1, s2, s3]

labels = [(plots[i].tags[0]) for i in range(len(plots))]

active = list(range(0, len(plots)))


chkbx = CheckboxButtonGroup(labels=labels, active=active)


callback = CustomJS(args=dict(plots=plots, chkbx=chkbx), code="""

    for (let i = 0; i < plots.length; i++){

        plots[i].visible = chkbx.active.includes(i)

    }

    """)


chkbx.js_on_click(callback)


show(column([chkbx] + plots))

感謝@bigreddot 和他們?yōu)檫@個(gè)解決方案奠定基礎(chǔ)的答案。


查看完整回答
反對(duì) 回復(fù) 2021-06-22
  • 2 回答
  • 0 關(guān)注
  • 105 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)