13
$\begingroup$

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.

$\endgroup$
2
  • 1
    $\begingroup$ I just have checked on Windows 7 x64 with Mathematica 11.2.0 and can't reproduce the bug with data = RandomReal[{-1, 1}, {10^4, 2}];, but with version 8.0.4 on the same machine it is present. It indeed appears when with version 11.2.0 I set data = RandomReal[{-1, 1}, {10^5, 2}];. $\endgroup$ Nov 21, 2017 at 14:20
  • $\begingroup$ @AlexeyPopkov yes, 10^4 does not always show this for me either, I guess it is related to FE memory consumption etc. $\endgroup$
    – Kuba
    Nov 21, 2017 at 14:31

1 Answer 1

11
$\begingroup$

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

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.