'Widget-render entry point for S3Summary.
@param r: the S3Request
@param method: the widget method
@param widget_id: the widget ID
@param visible: whether the widget is initially visible
@param attr: controller attributes'

def widget(self, r, method=None, widget_id=None, visible=True, **attr):

    resource = self.get_target(r)
    (report_vars, get_vars) = self.get_options(r, resource)
    timestamp = get_vars.get('timestamp')
    (event_start, event_end) = self.parse_timestamp(timestamp)
    fact = get_vars.get('fact')
    try:
        facts = S3TimeSeriesFact.parse(fact)
    except SyntaxError:
        r.error(400, sys.exc_info()[1])
    baseline = get_vars.get('baseline')
    rows = get_vars.get('rows')
    cols = get_vars.get('cols')
    start = get_vars.get('start')
    end = get_vars.get('end')
    slots = get_vars.get('slots')
    if visible:
        ts = S3TimeSeries(resource, start=start, end=end, slots=slots, event_start=event_start, event_end=event_end, rows=rows, cols=cols, facts=facts, baseline=baseline)
        data = ts.as_dict()
    else:
        data = None
    if (r.representation in ('html', 'iframe')):
        ajax_vars = Storage(r.get_vars)
        ajax_vars.update(get_vars)
        filter_url = r.url(method='', representation='', vars=ajax_vars.fromkeys((k for k in ajax_vars if (k not in report_vars))))
        ajaxurl = attr.get('ajaxurl', r.url(method='timeplot', representation='json', vars=ajax_vars))
        output = S3TimePlotForm(resource).html(data, get_vars=get_vars, filter_widgets=None, ajaxurl=ajaxurl, filter_url=filter_url, widget_id=widget_id)
        view = self._view(r, 'timeplot.html')
        output['title'] = None
        output = XML(current.response.render(view, output))
    else:
        r.error(415, current.ERROR.BAD_FORMAT)
    return output
