Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
Poulpe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
octobus
Poulpe
Commits
970acab72161
Commit
970acab72161
authored
2 years ago
by
Raphaël Gomès
Browse files
Options
Downloads
Patches
Plain Diff
web-ui: add changeset information in tooltip and allow clipboard copy
parent
b851950e15a2
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
web-ui/src/lib/Graph.svelte
+29
-7
29 additions, 7 deletions
web-ui/src/lib/Graph.svelte
with
29 additions
and
7 deletions
web-ui/src/lib/Graph.svelte
+
29
−
7
View file @
970acab7
...
...
@@ -26,7 +26,6 @@
onMount
(()
=>
{
const
ctx
=
myChart
.
getContext
(
"
2d
"
);
const
labels
=
[];
const
datasets
=
[];
const
[
repoName
,
results
]
=
data
;
...
...
@@ -30,6 +29,5 @@
const
datasets
=
[];
const
[
repoName
,
results
]
=
data
;
console
.
log
(
repoName
);
let
graphData
=
[];
for
(
let
result
of
results
)
{
...
...
@@ -34,9 +32,10 @@
let
graphData
=
[];
for
(
let
result
of
results
)
{
labels
.
push
(
result
[
"
bin-env-vars
"
][
"
hg
"
][
"
version
"
].
split
(
"
+
"
)[
0
]
);
graphData
.
push
(
result
[
"
result
"
][
"
time
"
][
"
median
"
]);
graphData
.
push
({
x
:
result
[
"
bin-env-vars
"
][
"
hg
"
][
"
version
"
].
split
(
"
+
"
)[
0
],
y
:
result
[
"
result
"
][
"
time
"
][
"
median
"
],
node
:
result
[
"
bin-env-vars
"
][
"
hg
"
][
"
changeset
"
][
"
node
"
],
});
}
datasets
.
push
({
label
:
repoName
,
...
...
@@ -49,7 +48,6 @@
new
Chart
(
ctx
,
{
type
:
"
line
"
,
data
:
{
labels
:
labels
,
datasets
:
datasets
,
},
options
:
{
...
...
@@ -53,8 +51,11 @@
datasets
:
datasets
,
},
options
:
{
interaction
:
{
mode
:
"
point
"
,
},
scales
:
{
y
:
{
beginAtZero
:
true
,
},
},
...
...
@@ -56,8 +57,29 @@
scales
:
{
y
:
{
beginAtZero
:
true
,
},
},
plugins
:
{
tooltip
:
{
callbacks
:
{
footer
:
(
items
)
=>
{
return
items
.
map
((
item
)
=>
item
.
raw
[
"
node
"
]).
join
(
"
\n
"
);
},
},
},
},
onClick
:
(
e
,
elements
)
=>
{
const
nodes
=
elements
.
map
((
el
)
=>
{
const
datasetIndex
=
el
.
datasetIndex
;
const
index
=
el
.
index
;
return
e
.
chart
.
data
.
datasets
[
datasetIndex
].
data
[
index
][
"
node
"
];
})
.
join
(
"
+
"
);
if
(
navigator
&&
navigator
.
clipboard
&&
navigator
.
clipboard
.
writeText
)
return
navigator
.
clipboard
.
writeText
(
nodes
);
},
},
});
});
...
...
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