0

パネルを埋め込み HTML ファイルとして保存しようとしており、.save("file_name.html," embed=True)を使用しています。しかし、それは機能していません。パネル python でパラメーター化されたアクション ボタンを埋め込み HTML ファイルとして保存する方法。

コード:

class ActionExample(param.Parameterized):   

    action = param.Action(lambda x: x.param.trigger('action'), label='Click here!')
    
    number = param.Integer(default=0)
        
    @param.depends('action')
    def get_number(self):
        self.number += 1
        return self.number
    
action_example = ActionExample()

component = pn.Column(
    pn.Row(
        pn.Column(pn.panel(action_example, show_name=False, margin=0, widgets={"action": {"button_type": "primary"}, "number": {"disabled": True}}),
            '**Click the button** to trigger an update in the output.'),
        pn.panel(action_example.get_number, width=300), max_width=600)
)
component

今、私はそれを次のように保存しようとしています:

component.save('file_name.html',embed=True)

file_name.html で動作していません。それを機能させる方法はありますか?ありがとう!

4

0 に答える 0