【问题标题】:plotly fig object to redis将无花果对象绘制到redis
【发布时间】:2019-05-02 18:15:13
【问题描述】:

我有一个绘图对象(类型:类'plotly.graph_objs._figure.Figure'),我需要将其转换为可以从redis数据库存储和检索的其他数据类型。

我正在使用 python。请帮助我了解如何转换类型

【问题讨论】:

    标签: python redis plotly plotly-dash


    【解决方案1】:

    这可能是您需要的,来自文档here

      get_data(self, flatten=False)
          Returns the JSON for the plot with non-data elements stripped.
    
          Flattening may increase the utility of the result.
    
          :param (bool) flatten: {'a': {'b': ''}} --> {'a.b': ''}
          :returns: (dict|list) Depending on (flat|unflat)
    
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-12-14
      • 2020-07-09
      • 2012-04-11
      • 2020-10-14
      • 2013-09-23
      • 2019-03-12
      相关资源
      最近更新 更多