i have changed three things in the current timeplot code from svn:
o Changed global 'unit' variable to be of local scope
o Added support for entity of a value to be displayed in tooltip, see
example:
http://gpsvision.biz/timeplot.png
o Workaround for stale mouseevents
Note: this is no fix but a workaround only, I have reported the bug
in a previous mail
Is it possible to apply this to the current svn?
Thank you for all
Marcel
********* timeplot-svn-2009-08-15.patch ***********
Index: scripts/geometry.js
===================================================================
--- scripts/geometry.js (Revision 2043)
+++ scripts/geometry.js (Arbeitskopie)
@@ -589,11 +589,10 @@
if (p == 0) return grid;
+ var unit = time.MILLENNIUM;
// find the time units nearest to the time period
- if (p > time.gregorianUnitLengths[time.MILLENNIUM]) {
- unit = time.MILLENNIUM;
- } else {
- for (var unit = time.MILLENNIUM; unit > 0; unit--) {
+ if (p <= time.gregorianUnitLengths[time.MILLENNIUM]) {
+ for (; unit > 0; unit--) {
if (time.gregorianUnitLengths[unit-1] <= p && p <
time.gregorianUnitLengths[unit]) {
unit--;
break;
Index: scripts/timeplot.js
===================================================================
--- scripts/timeplot.js (Revision 2043)
+++ scripts/timeplot.js (Arbeitskopie)
@@ -51,7 +51,8 @@
roundValues: ("roundValues" in params) ?
params.roundValues : true,
valuesOpacity: ("valuesOpacity" in params) ?
params.valuesOpacity : 75,
bubbleWidth: ("bubbleWidth" in params) ?
params.bubbleWidth : 300,
- bubbleHeight: ("bubbleHeight" in params) ?
params.bubbleHeight : 200
+ bubbleHeight: ("bubbleHeight" in params) ?
params.bubbleHeight : 200,
+ valueEntity: ("valueEntity" in params) ?
params.valueEntity : ""
};
};
Index: scripts/plot.js
===================================================================
--- scripts/plot.js (Revision 2043)
+++ scripts/plot.js (Arbeitskopie)
@@ -66,7 +66,8 @@
var month = 30 * day;
var mouseMoveHandler = function(elmt, evt, target) {
- if (typeof SimileAjax != "undefined" &&
plot._plotInfo.showValues) {
+ if (typeof SimileAjax != "undefined" &&
plot._plotInfo.showValues
+ && plot._dataSource != null) {
var c = plot._canvas;
var x =
Math.round(SimileAjax.DOM.getEventRelativeCoordinates(evt,plot._canvas).x);
if (x > c.width) x = c.width;
@@ -78,10 +79,12 @@
}
var validTime =
plot._dataSource.getClosestValidTime(t);
+ if (validTime == 0) // event from removed DataSource?!
+ return;
x = plot._timeGeometry.toScreen(validTime);
var v = plot._dataSource.getValue(validTime);
if (plot._plotInfo.roundValues) v = Math.round(v);
- plot._valueFlag.innerHTML = new String(v);
+ plot._valueFlag.innerHTML = new String(v +
plot._plotInfo.valueEntity); // 80 km/h
var d = new Date(validTime);
var p = plot._timeGeometry.getPeriod();
if (p < day) {
what is the correct way to send patches?
Who shall I contact best?
Thank you
Marcel
It's probably best to attach the patches to an issue on google code than
sending them via email. Things tend to get lost more here.
Also, I'm still the timeplot maintainer but I'm terribly swamped at the
moment, so I don't know when I'll be able to get to it, sorry.
--
Stefano Mazzocchi Application Catalyst
Metaweb Technologies, Inc. ste...@metaweb.com
-------------------------------------------------------------------
thank you for all your excellent work.
If you give me write permissions I can commit it myself,
else I do as suggested,
regards
Marcel
Stefano Mazzocchi schrieb:
> ruffm...@gmail.com wrote:
>
>> Hi again,
>>
>> what is the correct way to send patches?
>> Who shall I contact best?
>>
>
> It's probably best to attach the patches to an issue on google code than
> sending them via email. Things tend to get lost more here.
>
> Also, I'm still the timeplot maintainer but I'm terribly swamped at the
> moment, so I don't know when I'll be able to get to it, sorry.
>
>
--
Marcel Ruff
http://www.xmlBlaster.org
http://watchee.net
Phone: +49 7551 309371
http://code.google.com/p/simile-widgets/issues/detail?id=311
http://code.google.com/p/simile-widgets/issues/detail?id=312 <http://code.google.com/p/simile-widgets/issues/detail?id=311>
thanks
Marcel