V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
shinession
V2EX  ›  Python

有没用过 dash 的大佬指点下网页 caching 清空

  •  
  •   shinession · 2022-03-11 16:46:09 +08:00 · 2123 次点击
    这是一个创建于 748 天前的主题,其中的信息可能已经有所发展或是发生改变。

    小弟在制造业,做了一些数据可视化的内部网站,用的是 python dash 网页框架,目前有个问题是使用 echarts 或者 tabulator 的时候,缓存没办法清除干净。 举个例子,echarts 图表 bar chart 有 5 个 series data ,用户点击后图表更改显示 3 个 series data ,这时候 dash 会仍然显示 5 个 series data ,多出来的就是旧的缓存,目前我的做法是把减少的 series data 数据设置为 0 ,就不会显示了。 最近又使用了 tabulator ,发现 options= {'groupBy': groupby1, "selectable": 1} 更改后不会立即反应在网页上,也是和 echarts 一样的问题,会读取上次的缓存,想请教下大佬又没什么方法解决?

    2 条回复    2022-03-11 19:00:29 +08:00
    gadfly3173
        1
    gadfly3173  
       2022-03-11 18:13:24 +08:00
    正确的操作应该是每次切换就直接销毁容器( dispose ),重新 init
    shinession
        2
    shinession  
    OP
       2022-03-11 19:00:29 +08:00
    @gadfly3173 大佬指点一下,echarts js 源码可以 echarts. dispose ,但是 dash 官方文档里面没有,python 该如何写?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5403 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 06:56 · PVG 14:56 · LAX 23:56 · JFK 02:56
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.