Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OLAT CI-CD Testing Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lars Oliver Dam
OLAT CI-CD Testing Project
Commits
f6e8bb1c
Commit
f6e8bb1c
authored
8 years ago
by
srosse
Browse files
Options
Downloads
Patches
Plain Diff
OO-2057: the dots follow the curve during transition
parent
100deaa7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/webapp/static/js/jquery/openolat/jquery.timeline.js
+18
-37
18 additions, 37 deletions
src/main/webapp/static/js/jquery/openolat/jquery.timeline.js
with
18 additions
and
37 deletions
src/main/webapp/static/js/jquery/openolat/jquery.timeline.js
+
18
−
37
View file @
f6e8bb1c
...
...
@@ -109,65 +109,45 @@
slideUp
=
function
()
{
endTime
=
endTime
+
(
365
*
24
*
60
*
60
*
1000
);
startTime
=
startTime
+
(
365
*
24
*
60
*
60
*
1000
);
updateTimeline
();
updateTimeline
(
true
);
}
slideDown
=
function
()
{
endTime
=
endTime
-
(
365
*
24
*
60
*
60
*
1000
);
startTime
=
startTime
-
(
365
*
24
*
60
*
60
*
1000
);
updateTimeline
();
updateTimeline
(
false
);
}
updateTimeline
=
function
()
{
updateTimeline
=
function
(
up
)
{
curveY
.
domain
([
startTime
,
endTime
]);
y
.
domain
([
startTime
,
endTime
]);
drawAxis
();
//drawCurve();
drawDots
();
drawDots
(
up
);
}
drawAxis
=
function
()
{
svg
.
select
(
'
.y
'
).
call
(
yAxis
);
}
drawDots
=
function
()
{
drawDots
=
function
(
up
)
{
var
dots
=
svg
.
selectAll
(
'
.dot
'
)
.
data
(
data
,
idKey
);
dots
.
transition
()
.
attr
(
"
cx
"
,
function
(
d
)
{
return
lineX
(
curvedX
(
curveY
(
d
.
time
)));
})
.
duration
(
1000
)
.
ease
(
"
linear
"
)
.
attrTween
(
"
cx
"
,
function
(
d
)
{
return
function
(
t
)
{
var
delta
=
(
1.0
-
t
)
*
(
365
*
24
*
60
*
60
*
1000
);
var
time
=
up
?
(
d
.
time
+
delta
)
:
(
d
.
time
-
delta
);
return
lineX
(
curvedX
(
curveY
(
time
)));
};
})
//.attr("cx", function(d) { return lineX(curvedX(curveY(d.time))); })
.
attr
(
"
cy
"
,
function
(
d
)
{
return
y
(
d
.
time
);
});
}
translateAlong
=
function
translateAlong
(
path
)
{
var
l
=
path
.
getTotalLength
();
return
function
(
i
)
{
return
function
(
t
)
{
var
p
=
path
.
getPointAtLength
(
t
*
l
);
return
"
translate(
"
+
p
.
x
+
"
,
"
+
p
.
y
+
"
)
"
;
//Move marker
}
}
}
var
lineData
=
[];
var
linePath
;
drawCurve
=
function
()
{
var
numOfData
=
lineData
.
length
;
for
(
var
i
=
numOfData
;
i
<
numOfData
+
(
maxCurveY
*
20
);
i
++
)
{
lineData
.
push
({
y
:
(
i
==
0
?
0
:
i
/
20.0
)});
}
var
linePath
=
svg
.
append
(
"
path
"
)
.
data
([
lineData
])
.
attr
(
"
d
"
,
lineGenerator
)
.
attr
(
"
class
"
,
"
o_timeline_curve
"
);
}
timelineItems
=
function
(
$obj
,
settings
)
{
// x-axis
...
...
@@ -188,12 +168,13 @@
.
attr
(
"
dx
"
,
"
-.71em
"
)
.
style
(
"
text-anchor
"
,
"
end
"
)
.
text
(
"
Date
"
);
var
lineData
=
[];
for
(
var
i
=
0
;
i
<
(
maxCurveY
*
20
);
i
++
)
{
lineData
.
push
({
y
:
(
i
==
0
?
0
:
i
/
20.0
)});
}
linePath
=
svg
.
append
(
"
path
"
)
var
linePath
=
svg
.
append
(
"
path
"
)
.
data
([
lineData
])
.
attr
(
"
d
"
,
lineGenerator
)
.
attr
(
"
class
"
,
"
o_timeline_curve
"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment