anchor.diff:  
   config_lookup(Id, Key, ReportCfg) ->
       case lists:keyfind(Id, 1, ReportCfg) of
  -        false     -> false;
  -        {Id, Cfg} -> lists:keyfind(Key, 1, Cfg)
  +        false     -> lists:keyfind(Key, 1, config_defaults());
  +        {Id, Cfg} ->
  +            case lists:keyfind(Key, 1, Cfg) of
  +                false    -> lists:keyfind(Key, 1, config_defaults());
  +                CfgTuple -> CfgTuple
  +            end
       end.
  +
  +%% Generate a link that will trigger appropriate config update actions
  +%% in config_update above.
  +config_link(Id, Key, Data) ->
  +    lists:concat([Id, ".", Key, ".", Data]).
  +
  +%% Default settings for ReportCfg keys to use in case they are missing.
  +config_defaults() ->
  +    [ {sort, 1, ascending}
  +    , {show_table, false}
  +    ].
   
   invert_dir(ascending) -> descending;
   invert_dir(descending) -> ascending.
  
positive.code: -ifdef(TEST).
  
  config_lookup_test() ->
      ?assertEqual(false, config_lookup(myframeid, sort, [])),
      ?assertEqual(false, config_lookup(myframeid, sort, [{myframeid, []}])),
      ?assertEqual({sort, 3, ascending},
                   config_lookup(myframeid, sort,
                                 [{myframeid, [{sort, 3, ascending}]}])).
  
negative.code: report_ext(atom,_Ext,_ReportCfg) -> []; % used as Samples in the common report
  report_ext(binary, Ext, ReportCfg) -> report_ext(bitstring, Ext, ReportCfg);
  report_ext(bitstring, Ext, ReportCfg) ->
      histogram(size_dist, "Bit size histogram", Ext, ReportCfg);
  report_ext(nonempty_list, Ext, ReportCfg) ->
      histogram(length_dist, "List length histogram", Ext, ReportCfg);
  report_ext(_Class, Ext,_ReportCfg) ->
      [{font, [{size, "+2"}], [br, {str, "Extended data (raw)"}, br, br]},
       {term, Ext}].
  
  histogram(Id, Title, Ext, ReportCfg) ->
      {show_table, ShowTable} = config_lookup(Id, show_table, ReportCfg),
      {width, Width} = config_lookup(report, width, ReportCfg),
      PngFile = ds_graphics:histogram_graph([{xsize, Width-36}], %% FIXME
                                            Ext),
      ds_graphics:gc_image_file(PngFile, ?IMAGE_GC_TIMEOUT),
      Link = config_link(Id, show_table, not ShowTable),
      LinkText = case ShowTable of
                     true  -> "[Hide table]";
                     false -> "[Show table]"
                 end,
      [{table, [{width, "100%"},
                {cellspacing, 0}],
       [{tr, [], [{td, [], [br]}]}, % vskip
        {tr, [],
         [{th, [{align, left}],
           [{font, [{size, "+1"}], [{str, Title}]}]}]},
        {tr, [{bgcolor, ?COLOR_PTHEAD}],
         [{th, [{align, left}],
           [{a, [{href, Link}], [{str, LinkText}]}]}]},
        {tr, [],
         [{td, [],
           [{img, [{src, PngFile}], []}]}]},
        {tr, [],
         [{td, [],
           [{table, [{cellspacing, 0}],
             histogram_data_table(ShowTable, Id, Ext, ReportCfg)}]}]}]}].
  
  histogram_data_table(false,_Id,_Data,_ReportCfg) -> [];
  histogram_data_table(true, Id, Data, ReportCfg) ->
      frame(Id, stats_headers(false), Data, fun stats_display_f/1, ReportCfg).
  
  %% A frame shows tabular data and allows the user to click on headers
  %% to sort the data according to a certain column.
  