Timeplot: Is it possible to change the range of a time_geometry?

32 views
Skip to first unread message

stefan_2009

unread,
Oct 8, 2009, 10:03:48 AM10/8/09
to SIMILE Widgets
Hello,

I'm working with Timeplot and got a question.
Is it possible to change the time-range of a time_geometry with
setRange()?

Let me tell you a use case:
- I have displayed the data of a year from january till december.
- Is it now possible to set the range only from march till september
on the same data
(without reloading a file). Can I do this with setRange(range)?

1) If yes, how can I create the range?

2) If not, could it be a useful function for Timeplot?

Thank You,
stefan.

S@nT0$

unread,
Nov 1, 2009, 3:55:22 AM11/1/09
to SIMILE Widgets
Hi,

Have you managed to figure out how to achieve this? I am looking for a
solution to this problem, too.

Thanks in advance,
S@nT0$

On Oct 8, 3:03 pm, stefan_2009 <stefan.jaeni...@gmx.de> wrote:
> Hello,
>
> I'm working with Timeplot and got a question.
> Is it possible to change the time-rangeof a time_geometry with
> setRange()?
>
> Let me tell you a use case:
> - I have displayed the data of a year from january till december.
> - Is it now possible to set therangeonly from march till september

stefan_2009

unread,
Nov 5, 2009, 2:59:04 PM11/5/09
to SIMILE Widgets
Not really with the old function, I just wrote a new function to
manage this problem.
I think the implemented function is not useful for the case I wrote.
To manage this,
you can add the following function into
"Timeplot.DefaultTimeGeometry.prototype"
of a local version of timeplot:

setTimeRange: function( min, max ) {
this._earliestDate = min;
this._latestDate = max;
this._clearLabels();
this.reset();
}

Therefore you just put in the new minimum (which is >= old minimum)
and the new maximum date!

I hope this will help you!

Stefan.

On 1 Nov., 09:55, "S@nT0$" <santos.sw...@gmail.com> wrote:
> Hi,
>
> Have you managed to figure out how to achieve this? I am looking for a
> solution to this problem, too.
>
> Thanks in advance,
> S@nT0$
>
> On Oct 8, 3:03 pm, stefan_2009 <stefan.jaeni...@gmx.de> wrote:
>
> > Hello,
>
> > I'm working withTimeplotand got a question.

S@nT0$

unread,
Nov 5, 2009, 5:06:35 PM11/5/09
to SIMILE Widgets
Hi,

I added setTimeRange to geometry.js within
Timeplot.DefaultTimeGeometry.prototype and now I can see that both the
time axis labels and the plot values are correctly updated. However:
- the old time axis labels still show up (mixed with the new ones)
- the value axis range doesn't get updated

So I am wondering if in your case adding (and calling) the
setTimeRange function was enough to make this work.

Btw, _clearLabels() does not exist for
Timeplot.DefaultTimeGeometry.prototype and reset() didn't change
anything. So I replaced lines
this._clearLabels();
this.reset();
by
this._timeplot.repaint();

S@nT0$
Reply all
Reply to author
Forward
0 new messages