Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
frag.jetzt SWTP 2022
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Privacy
Imprint
Contact
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Marc Tröll
frag.jetzt SWTP 2022
Commits
6d8c2178
Commit
6d8c2178
authored
3 years ago
by
Fabian Gruenwald
Browse files
Options
Downloads
Patches
Plain Diff
color fix
parent
22335f0f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/app/components/shared/tag-cloud/tag-cloud.component.ts
+19
-16
19 additions, 16 deletions
src/app/components/shared/tag-cloud/tag-cloud.component.ts
with
19 additions
and
16 deletions
src/app/components/shared/tag-cloud/tag-cloud.component.ts
+
19
−
16
View file @
6d8c2178
...
...
@@ -11,17 +11,19 @@ import {Rescale} from "../../../models/rescale";
class
TagComment
implements
CloudData
{
constructor
(
public
color
:
string
,
public
external
:
boolean
,
public
link
:
string
,
public
position
:
Position
,
public
rotate
:
number
,
public
text
:
string
,
public
tooltip
:
string
,
public
weight
:
number
)
{
public
color
:
string
,
public
external
:
boolean
,
public
link
:
string
,
public
position
:
Position
,
public
rotate
:
number
,
public
text
:
string
,
public
tooltip
:
string
,
public
weight
:
number
)
{
}
}
}
const
COLOR
:
string
[]
=
[
"
red
"
,
"
green
"
,
"
blue
"
,
"
yellow
"
,
"
orange
"
];
@
Component
({
selector
:
'
app-tag-cloud
'
,
templateUrl
:
'
./tag-cloud.component.html
'
,
...
...
@@ -29,7 +31,7 @@ const COLOR: string[] = ["red", "green", "blue", "yellow", "orange"];
})
export
class
TagCloudComponent
implements
OnInit
{
@
ViewChild
(
TagCloudComponent
,
{
static
:
false
})
child
:
TagCloudComponent
;
@
ViewChild
(
TagCloudComponent
,
{
static
:
false
})
child
:
TagCloudComponent
;
roomId
:
string
;
options
:
CloudOptions
=
{
// if width is between 0 and 1 it will be set to the width of the upper element multiplied by the value
...
...
@@ -45,7 +47,7 @@ export class TagCloudComponent implements OnInit {
};
data
:
CloudData
[]
=
[];
data
:
CloudData
[]
=
[];
constructor
(
private
commentService
:
CommentService
,
private
spacyService
:
SpacyService
)
{
...
...
@@ -64,17 +66,18 @@ export class TagCloudComponent implements OnInit {
this
.
spacyService
.
analyse
(
commentsConcatenated
,
"
de
"
).
subscribe
((
res
:
Result
)
=>
{
this
.
data
=
res
.
words
.
filter
(
w
=>
w
.
tag
===
"
NE
"
||
w
.
tag
===
"
NN
"
||
w
.
tag
===
"
NMP
"
||
w
.
tag
==
"
NNE
"
).
map
(
w
=>
this
.
data
=
res
.
words
.
filter
(
w
=>
w
.
tag
===
"
NE
"
||
w
.
tag
===
"
NN
"
||
w
.
tag
===
"
NMP
"
||
w
.
tag
==
"
NNE
"
).
map
(
w
=>
new
TagComment
(
COLOR
[
Math
.
floor
(
Math
.
random
()
*
(
COLOR
.
length
-
1
))],
Math
.
random
()
*
(
COLOR
.
length
-
1
))],
true
,
null
,
null
,
Math
.
floor
(
Math
.
random
()
*
30
-
15
),
w
.
text
,
"
todo
"
,
Math
.
floor
(
Math
.
random
()
*
10
)
+
1
)
)
Math
.
floor
(
Math
.
random
()
*
30
-
15
),
w
.
text
,
"
todo
"
,
Math
.
floor
(
Math
.
random
()
*
10
)
+
1
)
)
}
);
}
tagClicked
(
clicked
:
CloudData
)
{
console
.
log
(
clicked
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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