Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
F
flot
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
HS-public
flot
Commits
e1684b46
Commit
e1684b46
authored
May 27, 2013
by
David Schnur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove trailing white-space.
parent
68337794
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
103 additions
and
103 deletions
+103
-103
jquery.colorhelpers.js
jquery.colorhelpers.js
+9
-9
jquery.flot.categories.js
jquery.flot.categories.js
+12
-12
jquery.flot.crosshair.js
jquery.flot.crosshair.js
+9
-9
jquery.flot.image.js
jquery.flot.image.js
+15
-15
jquery.flot.navigate.js
jquery.flot.navigate.js
+21
-21
jquery.flot.resize.js
jquery.flot.resize.js
+3
-3
jquery.flot.selection.js
jquery.flot.selection.js
+10
-10
jquery.flot.stack.js
jquery.flot.stack.js
+11
-11
jquery.flot.symbol.js
jquery.flot.symbol.js
+2
-2
jquery.flot.threshold.js
jquery.flot.threshold.js
+10
-10
jquery.flot.time.js
jquery.flot.time.js
+1
-1
No files found.
jquery.colorhelpers.js
View file @
e1684b46
...
...
@@ -36,13 +36,13 @@
o
[
c
.
charAt
(
i
)]
+=
d
;
return
o
.
normalize
();
};
o
.
scale
=
function
(
c
,
f
)
{
for
(
var
i
=
0
;
i
<
c
.
length
;
++
i
)
o
[
c
.
charAt
(
i
)]
*=
f
;
return
o
.
normalize
();
};
o
.
toString
=
function
()
{
if
(
o
.
a
>=
1.0
)
{
return
"rgb("
+
[
o
.
r
,
o
.
g
,
o
.
b
].
join
(
","
)
+
")"
;
...
...
@@ -55,7 +55,7 @@
function
clamp
(
min
,
value
,
max
)
{
return
value
<
min
?
min
:
(
value
>
max
?
max
:
value
);
}
o
.
r
=
clamp
(
0
,
parseInt
(
o
.
r
,
10
),
255
);
o
.
g
=
clamp
(
0
,
parseInt
(
o
.
g
,
10
),
255
);
o
.
b
=
clamp
(
0
,
parseInt
(
o
.
b
,
10
),
255
);
...
...
@@ -86,10 +86,10 @@
// catch Safari's way of signalling transparent
if
(
c
==
"rgba(0, 0, 0, 0)"
)
c
=
"transparent"
;
return
$
.
color
.
parse
(
c
);
};
// parse CSS color string (like "rgb(10, 32, 43)" or "#fff"),
// returns color object, if parsing failed, you get black (0, 0,
// 0) out
...
...
@@ -100,12 +100,12 @@
res
=
/rgb
\(\s
*
([
0-9
]{1,3})\s
*,
\s
*
([
0-9
]{1,3})\s
*,
\s
*
([
0-9
]{1,3})\s
*
\)
/
.
exec
(
str
);
if
(
res
)
return
m
(
parseInt
(
res
[
1
],
10
),
parseInt
(
res
[
2
],
10
),
parseInt
(
res
[
3
],
10
));
// Look for rgba(num,num,num,num)
res
=
/rgba
\(\s
*
([
0-9
]{1,3})\s
*,
\s
*
([
0-9
]{1,3})\s
*,
\s
*
([
0-9
]{1,3})\s
*,
\s
*
([
0-9
]
+
(?:\.[
0-9
]
+
)?)\s
*
\)
/
.
exec
(
str
);
if
(
res
)
return
m
(
parseInt
(
res
[
1
],
10
),
parseInt
(
res
[
2
],
10
),
parseInt
(
res
[
3
],
10
),
parseFloat
(
res
[
4
]));
// Look for rgb(num%,num%,num%)
res
=
/rgb
\(\s
*
([
0-9
]
+
(?:\.[
0-9
]
+
)?)\%\s
*,
\s
*
([
0-9
]
+
(?:\.[
0-9
]
+
)?)\%\s
*,
\s
*
([
0-9
]
+
(?:\.[
0-9
]
+
)?)\%\s
*
\)
/
.
exec
(
str
);
if
(
res
)
...
...
@@ -115,7 +115,7 @@
res
=
/rgba
\(\s
*
([
0-9
]
+
(?:\.[
0-9
]
+
)?)\%\s
*,
\s
*
([
0-9
]
+
(?:\.[
0-9
]
+
)?)\%\s
*,
\s
*
([
0-9
]
+
(?:\.[
0-9
]
+
)?)\%\s
*,
\s
*
([
0-9
]
+
(?:\.[
0-9
]
+
)?)\s
*
\)
/
.
exec
(
str
);
if
(
res
)
return
m
(
parseFloat
(
res
[
1
])
*
2.55
,
parseFloat
(
res
[
2
])
*
2.55
,
parseFloat
(
res
[
3
])
*
2.55
,
parseFloat
(
res
[
4
]));
// Look for #a0b1c2
res
=
/#
([
a-fA-F0-9
]{2})([
a-fA-F0-9
]{2})([
a-fA-F0-9
]{2})
/
.
exec
(
str
);
if
(
res
)
...
...
@@ -136,7 +136,7 @@
return
m
(
res
[
0
],
res
[
1
],
res
[
2
]);
}
};
var
lookupColors
=
{
aqua
:[
0
,
255
,
255
],
azure
:[
240
,
255
,
255
],
...
...
jquery.flot.categories.js
View file @
e1684b46
...
...
@@ -52,7 +52,7 @@ as "categories" on the axis object, e.g. plot.getAxes().xaxis.categories.
categories
:
null
}
};
function
processRawData
(
plot
,
series
,
data
,
datapoints
)
{
// if categories are enabled, we need to disable
// auto-transformation to numbers so the strings are intact
...
...
@@ -60,7 +60,7 @@ as "categories" on the axis object, e.g. plot.getAxes().xaxis.categories.
var
xCategories
=
series
.
xaxis
.
options
.
mode
==
"categories"
,
yCategories
=
series
.
yaxis
.
options
.
mode
==
"categories"
;
if
(
!
(
xCategories
||
yCategories
))
return
;
...
...
@@ -81,14 +81,14 @@ as "categories" on the axis object, e.g. plot.getAxes().xaxis.categories.
format
[
format
.
length
-
1
].
x
=
true
;
}
}
datapoints
.
format
=
format
;
}
for
(
var
m
=
0
;
m
<
format
.
length
;
++
m
)
{
if
(
format
[
m
].
x
&&
xCategories
)
format
[
m
].
number
=
false
;
if
(
format
[
m
].
y
&&
yCategories
)
format
[
m
].
number
=
false
;
}
...
...
@@ -96,7 +96,7 @@ as "categories" on the axis object, e.g. plot.getAxes().xaxis.categories.
function
getNextIndex
(
categories
)
{
var
index
=
-
1
;
for
(
var
v
in
categories
)
if
(
categories
[
v
]
>
index
)
index
=
categories
[
v
];
...
...
@@ -116,11 +116,11 @@ as "categories" on the axis object, e.g. plot.getAxes().xaxis.categories.
return
res
;
}
function
setupCategoriesForAxis
(
series
,
axis
,
datapoints
)
{
if
(
series
[
axis
].
options
.
mode
!=
"categories"
)
return
;
if
(
!
series
[
axis
].
categories
)
{
// parse options
var
c
=
{},
o
=
series
[
axis
].
options
.
categories
||
{};
...
...
@@ -132,7 +132,7 @@ as "categories" on the axis object, e.g. plot.getAxes().xaxis.categories.
for
(
var
v
in
o
)
c
[
v
]
=
o
[
v
];
}
series
[
axis
].
categories
=
c
;
}
...
...
@@ -142,7 +142,7 @@ as "categories" on the axis object, e.g. plot.getAxes().xaxis.categories.
transformPointsOnAxis
(
datapoints
,
axis
,
series
[
axis
].
categories
);
}
function
transformPointsOnAxis
(
datapoints
,
axis
,
categories
)
{
// go through the points, transforming them
var
points
=
datapoints
.
points
,
...
...
@@ -154,7 +154,7 @@ as "categories" on the axis object, e.g. plot.getAxes().xaxis.categories.
for
(
var
i
=
0
;
i
<
points
.
length
;
i
+=
ps
)
{
if
(
points
[
i
]
==
null
)
continue
;
for
(
var
m
=
0
;
m
<
ps
;
++
m
)
{
var
val
=
points
[
i
+
m
];
...
...
@@ -165,7 +165,7 @@ as "categories" on the axis object, e.g. plot.getAxes().xaxis.categories.
categories
[
val
]
=
index
;
++
index
;
}
points
[
i
+
m
]
=
categories
[
val
];
}
}
...
...
@@ -180,7 +180,7 @@ as "categories" on the axis object, e.g. plot.getAxes().xaxis.categories.
plot
.
hooks
.
processRawData
.
push
(
processRawData
);
plot
.
hooks
.
processDatapoints
.
push
(
processDatapoints
);
}
$
.
plot
.
plugins
.
push
({
init
:
init
,
options
:
options
,
...
...
jquery.flot.crosshair.js
View file @
e1684b46
...
...
@@ -66,7 +66,7 @@ The plugin also adds four public methods:
lineWidth
:
1
}
};
function
init
(
plot
)
{
// position of crosshair in pixels
var
crosshair
=
{
x
:
-
1
,
y
:
-
1
,
locked
:
false
};
...
...
@@ -79,12 +79,12 @@ The plugin also adds four public methods:
crosshair
.
x
=
Math
.
max
(
0
,
Math
.
min
(
o
.
left
,
plot
.
width
()));
crosshair
.
y
=
Math
.
max
(
0
,
Math
.
min
(
o
.
top
,
plot
.
height
()));
}
plot
.
triggerRedrawOverlay
();
};
plot
.
clearCrosshair
=
plot
.
setCrosshair
;
// passes null for pos
plot
.
lockCrosshair
=
function
lockCrosshair
(
pos
)
{
if
(
pos
)
plot
.
setCrosshair
(
pos
);
...
...
@@ -108,18 +108,18 @@ The plugin also adds four public methods:
function
onMouseMove
(
e
)
{
if
(
crosshair
.
locked
)
return
;
if
(
plot
.
getSelection
&&
plot
.
getSelection
())
{
crosshair
.
x
=
-
1
;
// hide the crosshair while selecting
return
;
}
var
offset
=
plot
.
offset
();
crosshair
.
x
=
Math
.
max
(
0
,
Math
.
min
(
e
.
pageX
-
offset
.
left
,
plot
.
width
()));
crosshair
.
y
=
Math
.
max
(
0
,
Math
.
min
(
e
.
pageY
-
offset
.
top
,
plot
.
height
()));
plot
.
triggerRedrawOverlay
();
}
plot
.
hooks
.
bindEvents
.
push
(
function
(
plot
,
eventHolder
)
{
if
(
!
plot
.
getOptions
().
crosshair
.
mode
)
return
;
...
...
@@ -134,7 +134,7 @@ The plugin also adds four public methods:
return
;
var
plotOffset
=
plot
.
getPlotOffset
();
ctx
.
save
();
ctx
.
translate
(
plotOffset
.
left
,
plotOffset
.
top
);
...
...
@@ -166,7 +166,7 @@ The plugin also adds four public methods:
eventHolder
.
unbind
(
"mousemove"
,
onMouseMove
);
});
}
$
.
plot
.
plugins
.
push
({
init
:
init
,
options
:
options
,
...
...
jquery.flot.image.js
View file @
e1684b46
...
...
@@ -69,11 +69,11 @@ Google Maps).
var
urls
=
[],
points
=
[];
var
defaultShow
=
options
.
series
.
images
.
show
;
$
.
each
(
series
,
function
(
i
,
s
)
{
if
(
!
(
defaultShow
||
s
.
images
.
show
))
return
;
if
(
s
.
data
)
s
=
s
.
data
;
...
...
@@ -95,7 +95,7 @@ Google Maps).
callback
();
});
};
$
.
plot
.
image
.
load
=
function
(
urls
,
callback
)
{
var
missing
=
urls
.
length
,
loaded
=
{};
if
(
missing
==
0
)
...
...
@@ -104,9 +104,9 @@ Google Maps).
$
.
each
(
urls
,
function
(
i
,
url
)
{
var
handler
=
function
()
{
--
missing
;
loaded
[
url
]
=
this
;
if
(
missing
==
0
)
callback
(
loaded
);
};
...
...
@@ -114,16 +114,16 @@ Google Maps).
$
(
'<img />'
).
load
(
handler
).
error
(
handler
).
attr
(
'src'
,
url
);
});
};
function
drawSeries
(
plot
,
ctx
,
series
)
{
var
plotOffset
=
plot
.
getPlotOffset
();
if
(
!
series
.
images
||
!
series
.
images
.
show
)
return
;
var
points
=
series
.
datapoints
.
points
,
ps
=
series
.
datapoints
.
pointsize
;
for
(
var
i
=
0
;
i
<
points
.
length
;
i
+=
ps
)
{
var
img
=
points
[
i
],
x1
=
points
[
i
+
1
],
y1
=
points
[
i
+
2
],
...
...
@@ -147,7 +147,7 @@ Google Maps).
y2
=
y1
;
y1
=
tmp
;
}
// if the anchor is at the center of the pixel, expand the
// image by 1/2 pixel in each direction
if
(
series
.
images
.
anchor
==
"center"
)
{
...
...
@@ -158,7 +158,7 @@ Google Maps).
y1
-=
tmp
;
y2
+=
tmp
;
}
// clip
if
(
x1
==
x2
||
y1
==
y2
||
x1
>=
xaxis
.
max
||
x2
<=
xaxis
.
min
||
...
...
@@ -185,12 +185,12 @@ Google Maps).
sy1
+=
(
sy1
-
sy2
)
*
(
yaxis
.
max
-
y2
)
/
(
y2
-
y1
);
y2
=
yaxis
.
max
;
}
x1
=
xaxis
.
p2c
(
x1
);
x2
=
xaxis
.
p2c
(
x2
);
y1
=
yaxis
.
p2c
(
y1
);
y2
=
yaxis
.
p2c
(
y2
);
// the transformation may have swapped us
if
(
x1
>
x2
)
{
tmp
=
x2
;
...
...
@@ -226,12 +226,12 @@ Google Maps).
{
y
:
true
,
number
:
true
,
required
:
true
}
];
}
function
init
(
plot
)
{
plot
.
hooks
.
processRawData
.
push
(
processRawData
);
plot
.
hooks
.
drawSeries
.
push
(
drawSeries
);
}
$
.
plot
.
plugins
.
push
({
init
:
init
,
options
:
options
,
...
...
jquery.flot.navigate.js
View file @
e1684b46
...
...
@@ -87,7 +87,7 @@ can set the default in the options.
jquery.event.drag.js ~ v1.5 ~ Copyright (c) 2008, Three Dub Media (http://threedubmedia.com)
Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-LICENSE.txt
*/
(
function
(
a
){
function
e
(
h
){
var
k
,
j
=
this
,
l
=
h
.
data
||
{};
if
(
l
.
elem
)
j
=
h
.
dragTarget
=
l
.
elem
,
h
.
dragProxy
=
d
.
proxy
||
j
,
h
.
cursorOffsetX
=
l
.
pageX
-
l
.
left
,
h
.
cursorOffsetY
=
l
.
pageY
-
l
.
top
,
h
.
offsetX
=
h
.
pageX
-
h
.
cursorOffsetX
,
h
.
offsetY
=
h
.
pageY
-
h
.
cursorOffsetY
;
else
if
(
d
.
dragging
||
l
.
which
>
0
&&
h
.
which
!=
l
.
which
||
a
(
h
.
target
).
is
(
l
.
not
))
return
;
switch
(
h
.
type
){
case
"mousedown"
:
return
a
.
extend
(
l
,
a
(
j
).
offset
(),{
elem
:
j
,
target
:
h
.
target
,
pageX
:
h
.
pageX
,
pageY
:
h
.
pageY
}),
b
.
add
(
document
,
"mousemove mouseup"
,
e
,
l
),
i
(
j
,
!
1
),
d
.
dragging
=
null
,
!
1
;
case
!
d
.
dragging
&&
"mousemove"
:
if
(
g
(
h
.
pageX
-
l
.
pageX
)
+
g
(
h
.
pageY
-
l
.
pageY
)
<
l
.
distance
)
break
;
h
.
target
=
l
.
target
,
k
=
f
(
h
,
"dragstart"
,
j
),
k
!==!
1
&&
(
d
.
dragging
=
j
,
d
.
proxy
=
h
.
dragProxy
=
a
(
k
||
j
)[
0
]);
case
"mousemove"
:
if
(
d
.
dragging
){
if
(
k
=
f
(
h
,
"drag"
,
j
),
c
.
drop
&&
(
c
.
drop
.
allowed
=
k
!==!
1
,
c
.
drop
.
handler
(
h
)),
k
!==!
1
)
break
;
h
.
type
=
"mouseup"
}
case
"mouseup"
:
b
.
remove
(
document
,
"mousemove mouseup"
,
e
),
d
.
dragging
&&
(
c
.
drop
&&
c
.
drop
.
handler
(
h
),
f
(
h
,
"dragend"
,
j
)),
i
(
j
,
!
0
),
d
.
dragging
=
d
.
proxy
=
l
.
elem
=!
1
}
return
!
0
}
function
f
(
b
,
c
,
d
){
b
.
type
=
c
;
var
e
=
a
.
event
.
dispatch
.
call
(
d
,
b
);
return
e
===!
1
?
!
1
:
e
||
b
.
result
}
function
g
(
a
){
return
Math
.
pow
(
a
,
2
)}
function
h
(){
return
d
.
dragging
===!
1
}
function
i
(
a
,
b
){
a
&&
(
a
.
unselectable
=
b
?
"off"
:
"on"
,
a
.
onselectstart
=
function
(){
return
b
},
a
.
style
&&
(
a
.
style
.
MozUserSelect
=
b
?
""
:
"none"
))}
a
.
fn
.
drag
=
function
(
a
,
b
,
c
){
return
b
&&
this
.
bind
(
"dragstart"
,
a
),
c
&&
this
.
bind
(
"dragend"
,
c
),
a
?
this
.
bind
(
"drag"
,
b
?
b
:
a
):
this
.
trigger
(
"drag"
)};
var
b
=
a
.
event
,
c
=
b
.
special
,
d
=
c
.
drag
=
{
not
:
":input"
,
distance
:
0
,
which
:
1
,
dragging
:
!
1
,
setup
:
function
(
c
){
c
=
a
.
extend
({
distance
:
d
.
distance
,
which
:
d
.
which
,
not
:
d
.
not
},
c
||
{}),
c
.
distance
=
g
(
c
.
distance
),
b
.
add
(
this
,
"mousedown"
,
e
,
c
),
this
.
attachEvent
&&
this
.
attachEvent
(
"ondragstart"
,
h
)},
teardown
:
function
(){
b
.
remove
(
this
,
"mousedown"
,
e
),
this
===
d
.
dragging
&&
(
d
.
dragging
=
d
.
proxy
=!
1
),
i
(
this
,
!
0
),
this
.
detachEvent
&&
this
.
detachEvent
(
"ondragstart"
,
h
)}};
c
.
dragstart
=
c
.
dragend
=
{
setup
:
function
(){},
teardown
:
function
(){}}})(
jQuery
);
//
(function(a){function e(h){var k,j=this,l=h.data||{};if(l.elem)j=h.dragTarget=l.elem,h.dragProxy=d.proxy||j,h.cursorOffsetX=l.pageX-l.left,h.cursorOffsetY=l.pageY-l.top,h.offsetX=h.pageX-h.cursorOffsetX,h.offsetY=h.pageY-h.cursorOffsetY;else if(d.dragging||l.which>0&&h.which!=l.which||a(h.target).is(l.not))return;switch(h.type){case"mousedown":return a.extend(l,a(j).offset(),{elem:j,target:h.target,pageX:h.pageX,pageY:h.pageY}),b.add(document,"mousemove mouseup",e,l),i(j,!1),d.dragging=null,!1;case!d.dragging&&"mousemove":if(g(h.pageX-l.pageX)+g(h.pageY-l.pageY)<l.distance)break;h.target=l.target,k=f(h,"dragstart",j),k!==!1&&(d.dragging=j,d.proxy=h.dragProxy=a(k||j)[0]);case"mousemove":if(d.dragging){if(k=f(h,"drag",j),c.drop&&(c.drop.allowed=k!==!1,c.drop.handler(h)),k!==!1)break;h.type="mouseup"}case"mouseup":b.remove(document,"mousemove mouseup",e),d.dragging&&(c.drop&&c.drop.handler(h),f(h,"dragend",j)),i(j,!0),d.dragging=d.proxy=l.elem=!1}return!0}function f(b,c,d){b.type=c;var e=a.event.dispatch.call(d,b);return e===!1?!1:e||b.result}function g(a){return Math.pow(a,2)}function h(){return d.dragging===!1}function i(a,b){a&&(a.unselectable=b?"off":"on",a.onselectstart=function(){return b},a.style&&(a.style.MozUserSelect=b?"":"none"))}a.fn.drag=function(a,b,c){return b&&this.bind("dragstart",a),c&&this.bind("dragend",c),a?this.bind("drag",b?b:a):this.trigger("drag")};var b=a.event,c=b.special,d=c.drag={not:":input",distance:0,which:1,dragging:!1,setup:function(c){c=a.extend({distance:d.distance,which:d.which,not:d.not},c||{}),c.distance=g(c.distance),b.add(this,"mousedown",e,c),this.attachEvent&&this.attachEvent("ondragstart",h)},teardown:function(){b.remove(this,"mousedown",e),this===d.dragging&&(d.dragging=d.proxy=!1),i(this,!0),this.detachEvent&&this.detachEvent("ondragstart",h)}};c.dragstart=c.dragend={setup:function(){},teardown:function(){}}})(jQuery);
/* jquery.mousewheel.min.js
* Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net)
...
...
@@ -100,7 +100,7 @@ Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-L
*
* Requires: 1.2.2+
*/
(
function
(
d
){
function
e
(
a
){
var
b
=
a
||
window
.
event
,
c
=
[].
slice
.
call
(
arguments
,
1
),
f
=
0
,
e
=
0
,
g
=
0
,
a
=
d
.
event
.
fix
(
b
);
a
.
type
=
"mousewheel"
;
b
.
wheelDelta
&&
(
f
=
b
.
wheelDelta
/
120
);
b
.
detail
&&
(
f
=-
b
.
detail
/
3
);
g
=
f
;
void
0
!==
b
.
axis
&&
b
.
axis
===
b
.
HORIZONTAL_AXIS
&&
(
g
=
0
,
e
=-
1
*
f
);
void
0
!==
b
.
wheelDeltaY
&&
(
g
=
b
.
wheelDeltaY
/
120
);
void
0
!==
b
.
wheelDeltaX
&&
(
e
=-
1
*
b
.
wheelDeltaX
/
120
);
c
.
unshift
(
a
,
f
,
e
,
g
);
return
(
d
.
event
.
dispatch
||
d
.
event
.
handle
).
apply
(
this
,
c
)}
var
c
=
[
"DOMMouseScroll"
,
"mousewheel"
];
if
(
d
.
event
.
fixHooks
)
for
(
var
h
=
c
.
length
;
h
;)
d
.
event
.
fixHooks
[
c
[
--
h
]]
=
d
.
event
.
mouseHooks
;
d
.
event
.
special
.
mousewheel
=
{
setup
:
function
(){
if
(
this
.
addEventListener
)
for
(
var
a
=
c
.
length
;
a
;)
this
.
addEventListener
(
c
[
--
a
],
e
,
!
1
);
else
this
.
onmousewheel
=
e
},
teardown
:
function
(){
if
(
this
.
removeEventListener
)
for
(
var
a
=
c
.
length
;
a
;)
this
.
removeEventListener
(
c
[
--
a
],
e
,
!
1
);
else
this
.
onmousewheel
=
null
}};
d
.
fn
.
extend
({
mousewheel
:
function
(
a
){
return
a
?
this
.
bind
(
"mousewheel"
,
a
):
this
.
trigger
(
"mousewheel"
)},
unmousewheel
:
function
(
a
){
return
this
.
unbind
(
"mousewheel"
,
a
)}})})(
jQuery
);
//
(function(d){function e(a){var b=a||window.event,c=[].slice.call(arguments,1),f=0,e=0,g=0,a=d.event.fix(b);a.type="mousewheel";b.wheelDelta&&(f=b.wheelDelta/120);b.detail&&(f=-b.detail/3);g=f;void 0!==b.axis&&b.axis===b.HORIZONTAL_AXIS&&(g=0,e=-1*f);void 0!==b.wheelDeltaY&&(g=b.wheelDeltaY/120);void 0!==b.wheelDeltaX&&(e=-1*b.wheelDeltaX/120);c.unshift(a,f,e,g);return(d.event.dispatch||d.event.handle).apply(this,c)}var c=["DOMMouseScroll","mousewheel"];if(d.event.fixHooks)for(var h=c.length;h;)d.event.fixHooks[c[--h]]=d.event.mouseHooks;d.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=c.length;a;)this.addEventListener(c[--a],e,!1);else this.onmousewheel=e},teardown:function(){if(this.removeEventListener)for(var a=c.length;a;)this.removeEventListener(c[--a],e,!1);else this.onmousewheel=null}};d.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery);
...
...
@@ -139,7 +139,7 @@ Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-L
onZoomClick
(
e
,
delta
<
0
);
return
false
;
}
var
prevCursor
=
'default'
,
prevPageX
=
0
,
prevPageY
=
0
,
panTimeout
=
null
;
...
...
@@ -164,7 +164,7 @@ Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-L
top
:
prevPageY
-
e
.
pageY
});
prevPageX
=
e
.
pageX
;
prevPageY
=
e
.
pageY
;
panTimeout
=
null
;
},
1
/
frameRate
*
1000
);
}
...
...
@@ -174,12 +174,12 @@ Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-L
clearTimeout
(
panTimeout
);
panTimeout
=
null
;
}
plot
.
getPlaceholder
().
css
(
'cursor'
,
prevCursor
);
plot
.
pan
({
left
:
prevPageX
-
e
.
pageX
,
top
:
prevPageY
-
e
.
pageY
});
}
function
bindEvents
(
plot
,
eventHolder
)
{
var
o
=
plot
.
getOptions
();
if
(
o
.
zoom
.
interactive
)
{
...
...
@@ -197,25 +197,25 @@ Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-L
plot
.
zoomOut
=
function
(
args
)
{
if
(
!
args
)
args
=
{};
if
(
!
args
.
amount
)
args
.
amount
=
plot
.
getOptions
().
zoom
.
amount
;
args
.
amount
=
1
/
args
.
amount
;
plot
.
zoom
(
args
);
};
plot
.
zoom
=
function
(
args
)
{
if
(
!
args
)
args
=
{};
var
c
=
args
.
center
,
amount
=
args
.
amount
||
plot
.
getOptions
().
zoom
.
amount
,
w
=
plot
.
width
(),
h
=
plot
.
height
();
if
(
!
c
)
c
=
{
left
:
w
/
2
,
top
:
h
/
2
};
var
xf
=
c
.
left
/
w
,
yf
=
c
.
top
/
h
,
minmax
=
{
...
...
@@ -238,7 +238,7 @@ Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-L
if
(
zr
===
false
)
// no zooming on this axis
return
;
min
=
axis
.
c2p
(
min
);
max
=
axis
.
c2p
(
max
);
if
(
min
>
max
)
{
...
...
@@ -263,14 +263,14 @@ Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-L
((
zr
[
0
]
!=
null
&&
range
<
zr
[
0
])
||
(
zr
[
1
]
!=
null
&&
range
>
zr
[
1
])))
return
;
opts
.
min
=
min
;
opts
.
max
=
max
;
});
plot
.
setupGrid
();
plot
.
draw
();
if
(
!
args
.
preventEvent
)
plot
.
getPlaceholder
().
trigger
(
"plotzoom"
,
[
plot
,
args
]);
};
...
...
@@ -296,7 +296,7 @@ Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-L
var
pr
=
opts
.
panRange
;
if
(
pr
===
false
)
// no panning on this axis
return
;
if
(
pr
)
{
// check whether we hit the wall
if
(
pr
[
0
]
!=
null
&&
pr
[
0
]
>
min
)
{
...
...
@@ -304,21 +304,21 @@ Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-L
min
+=
d
;
max
+=
d
;
}
if
(
pr
[
1
]
!=
null
&&
pr
[
1
]
<
max
)
{
d
=
pr
[
1
]
-
max
;
min
+=
d
;
max
+=
d
;
}
}
opts
.
min
=
min
;
opts
.
max
=
max
;
});
plot
.
setupGrid
();
plot
.
draw
();
if
(
!
args
.
preventEvent
)
plot
.
getPlaceholder
().
trigger
(
"plotpan"
,
[
plot
,
args
]);
};
...
...
@@ -332,11 +332,11 @@ Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-L
if
(
panTimeout
)
clearTimeout
(
panTimeout
);
}
plot
.
hooks
.
bindEvents
.
push
(
bindEvents
);
plot
.
hooks
.
shutdown
.
push
(
shutdown
);
}
$
.
plot
.
plugins
.
push
({
init
:
init
,
options
:
options
,
...
...
jquery.flot.resize.js
View file @
e1684b46
...
...
@@ -38,7 +38,7 @@ can just fix the size of their placeholders.
plot
.
setupGrid
();
plot
.
draw
();
}
function
bindEvents
(
plot
,
eventHolder
)
{
plot
.
getPlaceholder
().
resize
(
onResize
);
}
...
...
@@ -46,11 +46,11 @@ can just fix the size of their placeholders.
function
shutdown
(
plot
,
eventHolder
)
{
plot
.
getPlaceholder
().
unbind
(
"resize"
,
onResize
);
}
plot
.
hooks
.
bindEvents
.
push
(
bindEvents
);
plot
.
hooks
.
shutdown
.
push
(
shutdown
);
}
$
.
plot
.
plugins
.
push
({
init
:
init
,
options
:
options
,
...
...
jquery.flot.selection.js
View file @
e1684b46
...
...
@@ -94,11 +94,11 @@ The plugin allso adds the following methods to the plot object:
var
savedhandlers
=
{};
var
mouseUpHandler
=
null
;
function
onMouseMove
(
e
)
{
if
(
selection
.
active
)
{
updateSelection
(
e
);
plot
.
getPlaceholder
().
trigger
(
"plotselecting"
,
[
getSelection
()
]);
}
}
...
...
@@ -106,7 +106,7 @@ The plugin allso adds the following methods to the plot object:
function
onMouseDown
(
e
)
{
if
(
e
.
which
!=
1
)
// only accept left-click
return
;
// cancel out any text selections
document
.
body
.
focus
();
...
...
@@ -127,13 +127,13 @@ The plugin allso adds the following methods to the plot object:
// this is a bit silly, but we have to use a closure to be
// able to whack the same handler again
mouseUpHandler
=
function
(
e
)
{
onMouseUp
(
e
);
};
$
(
document
).
one
(
"mouseup"
,
mouseUpHandler
);
}
function
onMouseUp
(
e
)
{
mouseUpHandler
=
null
;
// revert drag stuff for old-school browsers
if
(
document
.
onselectstart
!==
undefined
)
document
.
onselectstart
=
savedhandlers
.
onselectstart
;
...
...
@@ -158,7 +158,7 @@ The plugin allso adds the following methods to the plot object:
function
getSelection
()
{
if
(
!
selectionIsSane
())
return
null
;
if
(
!
selection
.
show
)
return
null
;
var
r
=
{},
c1
=
selection
.
first
,
c2
=
selection
.
second
;
...
...
@@ -252,10 +252,10 @@ The plugin allso adds the following methods to the plot object:
from
=
to
;
to
=
tmp
;
}
return
{
from
:
from
,
to
:
to
,
axis
:
axis
};
}
function
setSelection
(
ranges
,
preventEvent
)
{
var
axis
,
range
,
o
=
plot
.
getOptions
();
...
...
@@ -333,11 +333,11 @@ The plugin allso adds the following methods to the plot object:
ctx
.
restore
();
}
});
plot
.
hooks
.
shutdown
.
push
(
function
(
plot
,
eventHolder
)
{
eventHolder
.
unbind
(
"mousemove"
,
onMouseMove
);
eventHolder
.
unbind
(
"mousedown"
,
onMouseDown
);
if
(
mouseUpHandler
)
$
(
document
).
unbind
(
"mouseup"
,
mouseUpHandler
);
});
...
...
jquery.flot.stack.js
View file @
e1684b46
...
...
@@ -39,21 +39,21 @@ charts or filled areas).
var
options
=
{
series
:
{
stack
:
null
}
// or number/string
};
function
init
(
plot
)
{
function
findMatchingSeries
(
s
,
allseries
)
{
var
res
=
null
;
for
(
var
i
=
0
;
i
<
allseries
.
length
;
++
i
)
{
if
(
s
==
allseries
[
i
])
break
;
if
(
allseries
[
i
].
stack
==
s
.
stack
)
res
=
allseries
[
i
];
}
return
res
;
}
function
stackData
(
plot
,
s
,
datapoints
)
{
if
(
s
.
stack
==
null
||
s
.
stack
===
false
)
return
;
...
...
@@ -118,7 +118,7 @@ charts or filled areas).
newpoints
[
l
+
accumulateOffset
]
+=
qy
;
bottom
=
qy
;
i
+=
ps
;
j
+=
otherps
;
}
...
...
@@ -142,22 +142,22 @@ charts or filled areas).
i
+=
ps
;
continue
;
}
for
(
m
=
0
;
m
<
ps
;
++
m
)
newpoints
.
push
(
points
[
i
+
m
]);
// we might be able to interpolate a point below,
// this can give us a better y
if
(
withlines
&&
j
>
0
&&
otherpoints
[
j
-
otherps
]
!=
null
)
bottom
=
qy
+
(
otherpoints
[
j
-
otherps
+
accumulateOffset
]
-
qy
)
*
(
px
-
qx
)
/
(
otherpoints
[
j
-
otherps
+
keyOffset
]
-
qx
);
newpoints
[
l
+
accumulateOffset
]
+=
bottom
;
i
+=
ps
;
}
fromgap
=
false
;
if
(
l
!=
newpoints
.
length
&&
withbottom
)
newpoints
[
l
+
2
]
+=
bottom
;
}
...
...
@@ -175,10 +175,10 @@ charts or filled areas).
datapoints
.
points
=
newpoints
;
}
plot
.
hooks
.
processDatapoints
.
push
(
stackData
);
}
$
.
plot
.
plugins
.
push
({
init
:
init
,
options
:
options
,
...
...
jquery.flot.symbol.js
View file @
e1684b46
...
...
@@ -58,11 +58,11 @@ The symbols are accessed as strings through the standard symbol options:
if
(
handlers
[
s
])
series
.
points
.
symbol
=
handlers
[
s
];
}
function
init
(
plot
)
{
plot
.
hooks
.
processDatapoints
.
push
(
processRawData
);
}
$
.
plot
.
plugins
.
push
({
init
:
init
,
name
:
'symbols'
,
...
...
jquery.flot.threshold.js
View file @
e1684b46
...
...
@@ -46,7 +46,7 @@ You may need to check for this in hover events.
var
options
=
{
series
:
{
threshold
:
null
}
// or { below: number, color: color spec}
};
function
init
(
plot
)
{
function
thresholdData
(
plot
,
s
,
datapoints
,
below
,
color
)
{
var
ps
=
datapoints
.
pointsize
,
i
,
x
,
y
,
p
,
prevp
,
...
...
@@ -58,7 +58,7 @@ You may need to check for this in hover events.
thresholded
.
threshold
=
null
;
thresholded
.
originSeries
=
s
;
thresholded
.
data
=
[];
var
origpoints
=
datapoints
.
points
,
addCrossingPoints
=
s
.
lines
.
show
;
...
...
@@ -83,7 +83,7 @@ You may need to check for this in hover events.
prevp
.
push
(
below
);
for
(
m
=
2
;
m
<
ps
;
++
m
)
prevp
.
push
(
origpoints
[
i
+
m
]);
p
.
push
(
null
);
// start new segment
p
.
push
(
null
);
for
(
m
=
2
;
m
<
ps
;
++
m
)
...
...
@@ -102,25 +102,25 @@ You may need to check for this in hover events.
datapoints
.
points
=
newpoints
;
thresholded
.
datapoints
.
points
=
threspoints
;
if
(
thresholded
.
datapoints
.
points
.
length
>
0
)
{
var
origIndex
=
$
.
inArray
(
s
,
plot
.
getData
());
// Insert newly-generated series right after original one (to prevent it from becoming top-most)
plot
.
getData
().
splice
(
origIndex
+
1
,
0
,
thresholded
);
}
// FIXME: there are probably some edge cases left in bars
}
function
processThresholds
(
plot
,
s
,
datapoints
)
{
if
(
!
s
.
threshold
)
return
;
if
(
s
.
threshold
instanceof
Array
)
{
s
.
threshold
.
sort
(
function
(
a
,
b
)
{
return
a
.
below
-
b
.
below
;
});
$
(
s
.
threshold
).
each
(
function
(
i
,
th
)
{
thresholdData
(
plot
,
s
,
datapoints
,
th
.
below
,
th
.
color
);
});
...
...
@@ -129,10 +129,10 @@ You may need to check for this in hover events.
thresholdData
(
plot
,
s
,
datapoints
,
s
.
threshold
.
below
,
s
.
threshold
.
color
);
}
}
plot
.
hooks
.
processDatapoints
.
push
(
processThresholds
);
}
$
.
plot
.
plugins
.
push
({
init
:
init
,
options
:
options
,
...
...
jquery.flot.time.js
View file @
e1684b46
...
...
@@ -158,7 +158,7 @@ API.txt for details.
return
makeUtcWrapper
(
new
Date
(
ts
));
}
}
// map of app. size of time units in milliseconds
var
timeUnitSize
=
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment