Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mark-web
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container 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
cylab
mark-web
Commits
a199703f
Commit
a199703f
authored
3 years ago
by
Georgi
Browse files
Options
Downloads
Patches
Plain Diff
Updated the values for the radar circles to correctly go from 0 to 1 instead of 0 to 10
parent
be9b4103
No related branches found
Branches containing commit
No related tags found
1 merge request
!7
Radar chart
Pipeline
#7233
failed
3 years ago
Stage: test
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
resources/views/app/radar.blade.php
+6
-7
6 additions, 7 deletions
resources/views/app/radar.blade.php
with
6 additions
and
7 deletions
resources/views/app/radar.blade.php
+
6
−
7
View file @
a199703f
...
...
@@ -3,14 +3,13 @@
@
section
(
'content'
)
<
h1
class
=
"text-center"
>
{{
$label
}}
</
h1
>
<
svg
width
=
"
6
00"
height
=
"
6
00"
></
svg
>
<
svg
width
=
"
8
00"
height
=
"
8
00"
></
svg
>
<
script
src
=
"https://cdnjs.cloudflare.com/ajax/libs/d3/7.1.1/d3.min.js"
integrity
=
"sha512-COTaPOlz12cG4fSfcBsxZsjauBAyldqp+8FQUM/dZHm+ts/jR4AFoJhCqxy8K10Jrf3pojfsbq7fAPTb1XaVkg=="
crossorigin
=
"anonymous"
referrerpolicy
=
"no-referrer"
></
script
>
<
script
>
var
url
=
"/app/ranking/{{
$label
}}/json"
;
d3
.
json
(
url
)
.
then
(
data
=>
{
console
.
log
(
data
);
let
radar_data
=
[];
let
features
=
[];
...
...
@@ -19,7 +18,7 @@
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
var
subject
=
data
[
i
]
.
subject
.
name
;
features
.
push
(
subject
);
point
[
subject
]
=
data
[
i
]
.
score
*
10
;
point
[
subject
]
=
data
[
i
]
.
score
;
};
radar_data
.
push
(
point
);
console
.
log
(
radar_data
);
...
...
@@ -28,8 +27,8 @@
width
=
+
svg
.
attr
(
"width"
),
height
=
+
svg
.
attr
(
"height"
);
let
radialScale
=
d3
.
scaleLinear
()
.
domain
([
0
,
1
0
])
.
range
([
0
,
250
]);
let
ticks
=
[
2
,
4
,
6
,
8
,
1
0
];
let
radialScale
=
d3
.
scaleLinear
()
.
domain
([
0
,
1
])
.
range
([
0
,
250
]);
let
ticks
=
[
0.
2
,
0.
4
,
0.
6
,
0.
8
,
1
];
//draw grid lines (circles)
ticks
.
forEach
(
t
=>
...
...
@@ -58,8 +57,8 @@
for
(
var
i
=
0
;
i
<
features
.
length
;
i
++
)
{
let
ft_name
=
features
[
i
];
let
angle
=
(
Math
.
PI
/
2
)
+
(
2
*
Math
.
PI
*
i
/
features
.
length
);
let
line_coordinate
=
angleToCoordinate
(
angle
,
1
0
);
let
label_coordinate
=
angleToCoordinate
(
angle
,
1
0.5
);
let
line_coordinate
=
angleToCoordinate
(
angle
,
1
);
let
label_coordinate
=
angleToCoordinate
(
angle
,
1
.1
);
svg
.
append
(
"line"
)
.
attr
(
"x1"
,
300
)
.
attr
(
"y1"
,
300
)
...
...
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