<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />In JMP 11 I am writing a plotting application that allows the user to customize the legends by selecting the grouping column that defines the row states. This requires deleting the old legend (by deleting the parent border box) and adding in a new legend. However I have found that if automatic recalc is set on the bivariate or variability platforms (I hen't tested other platforms), that this will causave a copy of the old legend to re-appear in addition to the new one, when the new one is generated with the FrameBox<
I have also looked at using the <Re: Automatic Recalc(1) causes old legends to reappear after deleting parent border box.
Oh what I ended up doing eventually is using the dt<Re: Automatic Recalc(1) causes old legends to reappear after deleting parent border box.
So I have been playing around alot with it and I eventually was able to recreate this behavior, even using one of the built-in datasets. The following code will cause some kind of memory leak which will cause JMP to crash.
Here is how you recreate the bug:
(1) create a platform inside a window that has automatic recalc set to 1
(2) add some legends
(3) exclude some rows
(4) add in another legend..even after deleting one or both of the original legend/s and JMP will freeze
The bug manifests itself as gradually increasing memory usage (~10 MB/s) by jmp as it works through some infinite memory leak.
This bug can be avoided by setting the excluded state to 0 for all rows in the table (i.e. For Each Row(Excluded(RowState()) = 0).
Another quirk that is turned on by automatic recalc is the fact that legends will not delete unless there is a forced time delay before deleting the legend after it is created. If automatic recalc is set to 0 then the deletion happens without a problem.
//code that crashes
Names Default To Here( 1 );
Try(CLose(dt,nosave));
dt = Open( "$SAMPLE_DATA/Big Class.jmp",invisible );
dt<
obj = NewWindow("test",biv_container = HListbox(biv = Bivariate( Y( :weight ), X( :height ),Automatic Recalc(1))));
/*
data_filter_container = ScrollBox(Size(200,500),data_filter = dt << Data Filter( Add Filter( columns( :Sex, :Age, :Name, :Height, :Weight ) )));
data_filter<
obj[OutlineBox("Bivariate Fit of weight By height")]<
obj[OutlineBox("Bivariate Fit of weight By height")][FrameBox(1)]<
obj[OutlineBox("Bivariate Fit of weight By height")][FrameBox(1)]<
obj[OutlineBox("Bivariate Fit of weight By height")][FrameBox(1)]<
dt<
//Show(For Each Row(Excluded(RowState()) = 0));
//dt<
wait(0.1);//forced time delay necessary to delete the color legend
obj[OutlineBox("Bivariate Fit of weight By height")][BorderBox(2)]<
obj[OutlineBox("Bivariate Fit of weight By height")][FrameBox(1)]<Re: Automatic Recalc(1) causes old legends to reappear after deleting parent border box.
Ok so I came up with a simple workaround: I turned off automatic recalc on the platform object in question (by using <