def plotly_figure(figure, id: str):
    """
    :param figure: plotly graph object or px figure
    :param id: unique id string of format 'id_xxx' with x representin a number
    :return: html style string containing a plotly figure
    """
    json_figure = figure.to_json()
    html = """
        <div id="""+id+"""></div>
        <script>
            var plotly_data = {}
            Plotly.react("""+id+""", plotly_data.data, plotly_data.layout);
        </script>
    """
    local_text = html.format(json_figure)
    return local_text