Skip to main content

bugs - Dynamic's SynchronousUpdating->False broken in Graphics


Bug reproduced in V10.4.1 and persisting through V11.2



A support case with the identification [CASE:3699190] was created.





[...] It does appear that SynchronousUpdating -> False is not interacting with CacheGraphics properly. I have forwarded an incident report to our developers with the information you provided. [...]





When Dynamic content is bigger, the updating is broken:


data = RandomReal[{-1, 1}, {10^4, 2}];
show = False;

Checkbox[Dynamic@show]


Dynamic[
If[ TrueQ@show, Length[data], "not shown"],
SynchronousUpdating -> False
]

Graphics[{
Dynamic[
If[TrueQ@show, Line[data], {}],
SynchronousUpdating -> False

]},
PlotRange -> 1, Frame -> True]

enter image description here


As we can see Length is updated correctly while the plot remains populated and only flashes during next switch.


It won't happen if data is smaller, e.g 10^2.



Answer



It seems to be another "feature" related to CacheGraphics, this will work correctly:


Graphics[{
Dynamic[

If[TrueQ @ show, Line[data], {}],
SynchronousUpdating -> False
]},
PlotRange -> 1,
Frame -> True,
BaseStyle -> CacheGraphics -> False
]

enter image description here


Another because we already know that: Transparent bitmaps or graphics in gui objects initially appear wrong



Comments