From c257a54a0a06c2a5a0dc2f2879819a9f69effc24 Mon Sep 17 00:00:00 2001 From: Sebastien Jourdain Date: Fri, 21 Oct 2022 15:50:40 -0600 Subject: [PATCH] docs(example): add stats to pv/wavelet example --- examples/07_paraview/Wavelet/app.py | 30 ++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/examples/07_paraview/Wavelet/app.py b/examples/07_paraview/Wavelet/app.py index b81fd283..2d6cac12 100644 --- a/examples/07_paraview/Wavelet/app.py +++ b/examples/07_paraview/Wavelet/app.py @@ -4,7 +4,7 @@ from trame.app import get_server, asynchronous from trame.ui.vuetify import SinglePageWithDrawerLayout -from trame.widgets import vuetify, trame, html, paraview +from trame.widgets import vuetify, trame, html, paraview, rca # ----------------------------------------------------------------------------- # Global helpers @@ -501,14 +501,26 @@ def ui_state_target_fps_change(self, target_fps, **kwargs): classes="text-caption", ) vuetify.VDivider() - # with vuetify.VCardText(style="height: 150px"): - # rca.StatisticsDisplay( - # name="view", - # fps_delta=1.5, - # stat_window_size=10, - # history_window_size=30, - # reset_ms_threshold=100, - # ) + with vuetify.VCardText(style="height: 150px"): + rca.StatisticsDisplay( + name="view", + fps_delta=1.5, + stat_window_size=10, + history_window_size=30, + reset_ms_threshold=100, + ws_topic="viewport.image.push.subscription", + packet_decorator=( + """ + (v) => { + return { + name: 'view', + serverTime: Date.now(), + contentSize: v.memsize, + }; + } + """, + ), + ) with vuetify.VCard(classes="my-2 mx-1"): with vuetify.VCardTitle(classes="py-0"):