anchor.diff:      get(comet_pid) ! add_chart;
   
   event({delete_chart, Id}) ->
  -    get(comet_pid) ! {delete_chart, Id}.
  -
  +    get(comet_pid) ! {delete_chart, Id};
  +
  +event(terminate) ->
  +    ok.
  +
  
positive.code: -spec error_message(Message :: binary()) -> ok.
  %% ====================================================================
  error_message(Message) ->
      Error = #panel{id = <<"error_message">>, style = <<"width: 100%; margin-bottom: 0px;">>, class = <<"dialog dialog-danger">>, body = [Message]},
      gui_jq:insert_before("main_table", Error),
      gui_comet:flush().
  
  
  
negative.code:                 catch
                      _:Error -> ?error("Can not update chart ~p: ~p", [Id, Error])
                  end,
                  PageState;
  
              {delete_chart, Id} ->
                  gui_jq:wire(<<"deleteChart(\"", (integer_to_binary(Id))/binary, "\");">>),
                  gui_comet:flush(),
                  PageState#page_state{charts = proplists:delete(Id, Charts)}
  
          end
                     catch Type:Msg ->
                         ?debug_stacktrace("~p ~p", [Type, Msg]),
                         error_message(<<"There has been an error in comet process. Please refresh the page.">>),
                         {error, Msg}
                     end,
      ?MODULE:comet_loop(NewPageState).
  
  
  %% error_message/1
  