I wish I had more control over the way context is displayed. For example, if the page title is "2000-01-09" then it is sufficient to report "00:17:42" to indicate the datum 2000-01-09T00:17:42
You can have a title like %{CONTEXT}, but maybe it would work to have %{CONTEXT,externalContext=2001-01-09} so the user can assert that to report just the less significant digits of hour, minute and second.
Connor was wanting to change the label generated from the context from pitch_angle=85 to α=85. I should revisit this. To make it print the value without the "pitch_angle=" would be fairly easy.
Last edit: Jeremy Faden 2023-12-07
%{CONTEXT;format=$H:$M} would work for the above (externalContext) case. What might be tricky would be parsing %{CONTEXT;format=%.2f}, since there are multiple percents...
This seems to work fine. I was already using a regular expression to pull out the arguments, so this has effectively been in place for a while. The first argument supported is format, so
%{CONTEXT,format=$H:$M}and
%{CONTEXT,format=%d}and
%{CONTEXT,format=%.3f}have been shown to work, and will be available in the next development release. This only works when there is one context, and it is a datum (rank 0 dataset) or datum range (rank 1, two-element dataset).
Last edit: Jeremy Faden 2023-12-06
I have a nagging feeling I was doing something like this recently, where formats were supported, and I have to check for %d and %x (hex) and truncate this to an int before passing it to string.format. I need to remind myself where this was (resolution of times, I think) and make sure this is consistent.
This same argument should be made to work for other macros, like %{USER_PROPERTIES} and %{TIMERANGE}.
I added the parameter "name" so that when there are a bunch of context variables, one can be selected.
%{CONTEXT,name=phi,format=%.3f}Last edit: Jeremy Faden 2023-12-06
There should also be a tab added to the GrannyTextRenderer where Autoplot can offer its macros.
When this is used for annotations, data set updates aren't detected, as the title properly does.
1. load https://github.com/autoplot/dev/blob/master/demos/vaps/slices-context.vap,
2. add annotation
3. copy the title to the annotation
4. see that adjusting the slice updates the title but not the annotation.