Skip to main content
replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/
Source Link

In answering Dynamic ClipPlanes calculated from current ViewPointDynamic ClipPlanes calculated from current ViewPoint Kuba and I got into a brief exchange regarding how Option values wrapped in Dynamic should be handled. For background John Fultz wrotewrote:

In answering Dynamic ClipPlanes calculated from current ViewPoint Kuba and I got into a brief exchange regarding how Option values wrapped in Dynamic should be handled. For background John Fultz wrote:

In answering Dynamic ClipPlanes calculated from current ViewPoint Kuba and I got into a brief exchange regarding how Option values wrapped in Dynamic should be handled. For background John Fultz wrote:

correct my correction :-p
Source Link
Mr.Wizard
  • 273.1k
  • 34
  • 595
  • 1.4k

The case of AxesLabel is somewhat ambiguous as its elements are explicitly displayed, therefore individual Dynamic labels being converted into DynamicBox expressions might be appropriate. However there are problems.

In version 10.1.0 under Windows using this initially works but closing the Notebook in which it resides hangs Mathematicathe FrontEnd:

This howeverlikewise works correctlyinitially but hangs the FrontEnd on close:

(*  THIS CODE MAY HANG THE FRONT-END

ColorSlider @ Dynamic[x]

Graphics[Disk[],
  Axes -> True,
  AxesLabel -> {Dynamic[x]}
]

*)

Adding RawBoxes to a bare Dynamic does not work wellright:

This implies an explanation for Box conversion: in GraphicsBox the value of AxesLabel needs to be in Box form. By placing Attempting this conversion inside our force-fed Dynamic we also get a working valueonce again produces an initial result but hangs on close:

(*  THIS CODE MAY HANG THE FRONT-END

ColorSlider @ Dynamic[x]

Graphics[Disk[],
  Axes -> True,
  AxesLabel -> RawBoxes @ Dynamic @ ToBoxes @ x
] 

*)

enter image description here

It is goodThere clearly seems to see that individual Dynamic labels are handled correctly, butbe a bug AxesLabel -> Dynamic[x] should not hang(in 10.1.0) with the Front Enduse of dynamic values in my opinion so there is room for improvement hereAxesLabel.

The case of AxesLabel is somewhat ambiguous as its elements are explicitly displayed, therefore individual Dynamic labels being converted into DynamicBox expressions might be appropriate.

In version 10.1.0 under Windows using this hangs Mathematica:

This however works correctly:

ColorSlider @ Dynamic[x]

Graphics[Disk[],
  Axes -> True,
  AxesLabel -> {Dynamic[x]}
]

Adding RawBoxes to a bare Dynamic does not work well:

This implies an explanation for Box conversion: in GraphicsBox the value of AxesLabel needs to be in Box form. By placing this conversion inside our force-fed Dynamic we also get a working value:

ColorSlider @ Dynamic[x]

Graphics[Disk[],
  Axes -> True,
  AxesLabel -> RawBoxes @ Dynamic @ ToBoxes @ x
]

enter image description here

It is good to see that individual Dynamic labels are handled correctly, but AxesLabel -> Dynamic[x] should not hang the Front End in my opinion so there is room for improvement here.

The case of AxesLabel is somewhat ambiguous as its elements are explicitly displayed, therefore individual Dynamic labels being converted into DynamicBox expressions might be appropriate. However there are problems.

In version 10.1.0 under Windows this initially works but closing the Notebook in which it resides hangs the FrontEnd:

This likewise works initially but hangs the FrontEnd on close:

(*  THIS CODE MAY HANG THE FRONT-END

ColorSlider @ Dynamic[x]

Graphics[Disk[],
  Axes -> True,
  AxesLabel -> {Dynamic[x]}
]

*)

Adding RawBoxes to a bare Dynamic does not work right:

This implies an explanation for Box conversion: in GraphicsBox the value of AxesLabel needs to be in Box form. Attempting this conversion inside our force-fed Dynamic once again produces an initial result but hangs on close:

(*  THIS CODE MAY HANG THE FRONT-END

ColorSlider @ Dynamic[x]

Graphics[Disk[],
  Axes -> True,
  AxesLabel -> RawBoxes @ Dynamic @ ToBoxes @ x
] 

*)

There clearly seems to be a bug (in 10.1.0) with the use of dynamic values in AxesLabel.

correct and clarify AxesLabel case
Source Link
Mr.Wizard
  • 273.1k
  • 34
  • 595
  • 1.4k

The case of AxesLabel is somewhat ambiguous as in some way it isits elements are explicitly displayed, therefore individual Dynamic labels being converted into DynamicBox expressions might be appropriate. However in

In version 10.1.0 under Windows using this hangs Mathematica:

This however works correctly:

ColorSlider @ Dynamic[x]

Graphics[Disk[],
  Axes -> True,
  AxesLabel -> {Dynamic[x]}
]

Adding RawBoxes by itself doesn'tto a bare Dynamic does not work right eitherwell:

This implies an explanation for Box conversion: in GraphicsBox the value of AxesLabel needs to be in Box form. By placing this conversion inside our force-fed Dynamic we also get a working value:

To give values for both axes we need individual Box conversion:

ColorSlider @ Dynamic[x]

Graphics[Disk[],
  Axes -> True,
  AxesLabel -> RawBoxes @ Dynamic[ToBoxes /@ {x, Darker @ x}]
]

enter image description here

It is cleargood to see that individual Dynamic labels are handled correctly, but AxesLabel -> Dynamic[x] should not hang the Front End in my opinion so there is some complicationroom for improvement here but it seems to me that this could still be handled better by default.

The case of AxesLabel is somewhat ambiguous as in some way it is explicitly displayed, therefore individual Dynamic labels being converted into DynamicBox expressions might be appropriate. However in version 10.1.0 under Windows using this hangs Mathematica:

Adding RawBoxes by itself doesn't work right either:

This implies an explanation for Box conversion: in GraphicsBox the value of AxesLabel needs to be in Box form. By placing this conversion inside our force-fed Dynamic we get a working value:

To give values for both axes we need individual Box conversion:

ColorSlider @ Dynamic[x]

Graphics[Disk[],
  Axes -> True,
  AxesLabel -> RawBoxes @ Dynamic[ToBoxes /@ {x, Darker @ x}]
]

enter image description here

It is clear that there is some complication here but it seems to me that this could still be handled better by default.

The case of AxesLabel is somewhat ambiguous as its elements are explicitly displayed, therefore individual Dynamic labels being converted into DynamicBox expressions might be appropriate.

In version 10.1.0 under Windows using this hangs Mathematica:

This however works correctly:

ColorSlider @ Dynamic[x]

Graphics[Disk[],
  Axes -> True,
  AxesLabel -> {Dynamic[x]}
]

Adding RawBoxes to a bare Dynamic does not work well:

This implies an explanation for Box conversion: in GraphicsBox the value of AxesLabel needs to be in Box form. By placing this conversion inside our force-fed Dynamic we also get a working value:

It is good to see that individual Dynamic labels are handled correctly, but AxesLabel -> Dynamic[x] should not hang the Front End in my opinion so there is room for improvement here.

edited body
Source Link
Mr.Wizard
  • 273.1k
  • 34
  • 595
  • 1.4k
Loading
added 3089 characters in body
Source Link
Mr.Wizard
  • 273.1k
  • 34
  • 595
  • 1.4k
Loading
Tweeted twitter.com/StackMma/status/743788596897976320
deleted 8 characters in body
Source Link
Mr.Wizard
  • 273.1k
  • 34
  • 595
  • 1.4k
Loading
added 1 character in body
Source Link
Mr.Wizard
  • 273.1k
  • 34
  • 595
  • 1.4k
Loading
Source Link
Mr.Wizard
  • 273.1k
  • 34
  • 595
  • 1.4k
Loading