Closed GoogleCodeExporter closed 8 years ago
Initial refactoring of zoom links checked in (r186). No functional changes at
this point. LegendAxisRenderer
now relies on ZoomIntervals container to obtain the list of zoom intervals
("1d", "1m", etc.) to render.
Original comment by chadtaka...@gmail.com
on 2 Jul 2008 at 12:35
r199: Zoom links whose intervals are too large to have an effect on a given set
of datasets are now omitted
(although the "max" zoom link is exempt from filtering and is always present).
E.g. if the min/max timestamps
across all datasets is 1/1/1970 - 1/1/1974, then the '5y' and '10y' links will
not display.
Original comment by chadtaka...@gmail.com
on 3 Jul 2008 at 12:44
The zoom links and date range now incrementally shrink to fit their container
as of r211. Here are the basic
rules:
Zoom link panel:
"ideal" mode: Looks like it always has.
"compact" mode: Space between each link reduced to 2px. "Zoom:" prefix omitted.
Date range panel:
"Ideal" mode: Looks like it always has (i.e. "mm/dd/yyyy - mm/dd/yyyy")
"compact" mode: Uses 2-digit years (i.e. "mm/dd/yy/ - mm/dd/yy")
Layout Steps:
1) initialize both zoom link and date range panels to "ideal" mode.
2) If both zoom links and daterange panels fit within the bounds of the LegendAxis, then great.
3) If not, use the compact daterange be retain the ideal zoom links.
4) If still not, use compact zoom links and ideal daterange.
5) If still not, use compact zoom links and compact daterange.
To witness the different layouts, run ChartDemo.java in hosted mode and use
each of the following
chartWidth values: [500, 450, 420, 350] (see line 53).
Also introduced a Panel interface and created 2 concrete classes: ZoomLinkPanel
and DateRangePanel.
LegendAxisRenderer can now treat both of these panels in a more generic fashion
w.r.t. layout.
Next step will be to convert the legend labels into a panel so that
LegendAxisRenderer will be just a host for
the panels (vs. containing drawing and hit detection code).
Original comment by chadtaka...@gmail.com
on 4 Jul 2008 at 10:46
Added 6th step to layout algorithm (see previous comment), which simply hides
the zoom link panel altogether if
it encroaches on the date range panel.
Original comment by chadtaka...@gmail.com
on 15 Jul 2008 at 11:05
r228 contains the final changes to layout algorithm (see previous comment).
Original comment by chadtaka...@gmail.com
on 15 Jul 2008 at 11:07
Isn't there a pathological case here? If the dataset spans say, 1 million years
down to milliseconds, then there
will be oodles of zoom links, and it will always be hidden practically. It
seems rather than hide it immediately,
you could selectively remove zoom links until it fits, or until some heuristic
says to hide it (e.g. there must be
atleast 3 links)
Another option would be to always keep the smallest zoom link, and the largest,
plus max. And remove from
the next to last, as an example:
10ms 50ms 100ms 500ms 1s 10s 1m 5m 15m 1hr 6hr 12hr 24hr max
we keep 10ms, 24hr, and max. If that doesn't fit, hide the panel. Then, start
removing 12hr, 6 hr, etc until the
panel fits.
Original comment by cromwell...@gmail.com
on 15 Jul 2008 at 11:19
Original issue reported on code.google.com by
chadtaka...@gmail.com
on 1 Jul 2008 at 7:06Attachments: