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
d1552e39
Commit
d1552e39
authored
4 years ago
by
Klaus-Dieter Quibeldey-Cirkel
Browse files
Options
Downloads
Plain Diff
Merge branch 'tag-cloud' of git.thm.de:arsnova/topic-cloud into tag-cloud
parents
fffe9d31
6d8c2178
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/app/components/shared/tag-cloud/tag-cloud.component.html
+12
-11
12 additions, 11 deletions
src/app/components/shared/tag-cloud/tag-cloud.component.html
src/app/components/shared/tag-cloud/tag-cloud.component.ts
+24
-23
24 additions, 23 deletions
src/app/components/shared/tag-cloud/tag-cloud.component.ts
with
36 additions
and
34 deletions
src/app/components/shared/tag-cloud/tag-cloud.component.html
+
12
−
11
View file @
d1552e39
...
@@ -4,17 +4,18 @@
...
@@ -4,17 +4,18 @@
</ars-row>
</ars-row>
<ars-fill
ars-flex-box
>
<ars-fill
ars-flex-box
style=
"width:100%;height:100%;"
>
<angular-tag-cloud
<angular-tag-cloud
[data]=
"data"
[data]=
"data"
[width]=
"options.width"
[width]=
"options.width"
[height]=
"options.height"
[height]=
"options.height"
[overflow]=
"options.overflow"
[overflow]=
"options.overflow"
[zoomOnHover]=
"zoomOnHoverOptions"
[zoomOnHover]=
"zoomOnHoverOptions"
(clicked)=
"tagClicked($event)"
(clicked)=
"tagClicked($event)"
[log]=
'"debug"'
>
[log]=
'"debug"'
>
</angular-tag-cloud>
</angular-tag-cloud>
</ars-fill>
</ars-fill>
...
...
This diff is collapsed.
Click to expand it.
src/app/components/shared/tag-cloud/tag-cloud.component.ts
+
24
−
23
View file @
d1552e39
...
@@ -9,19 +9,20 @@ import {Result, SpacyService} from "../../../services/http/spacy.service";
...
@@ -9,19 +9,20 @@ import {Result, SpacyService} from "../../../services/http/spacy.service";
import
{
Comment
}
from
"
../../../models/comment
"
;
import
{
Comment
}
from
"
../../../models/comment
"
;
import
{
Rescale
}
from
"
../../../models/rescale
"
;
import
{
Rescale
}
from
"
../../../models/rescale
"
;
const
COLORS
:
string
[]
=
[
"
blue
"
,
"
red
"
,
"
yellow
"
,
"
green
"
]
class
TagComment
implements
CloudData
{
class
TagComment
implements
CloudData
{
constructor
(
public
color
:
string
,
constructor
(
public
external
:
boolean
,
public
color
:
string
,
public
link
:
string
,
public
external
:
boolean
,
public
position
:
Position
,
public
link
:
string
,
public
rotate
:
number
,
public
position
:
Position
,
public
text
:
string
,
public
rotate
:
number
,
public
tooltip
:
string
,
public
text
:
string
,
public
weight
:
number
)
{
public
tooltip
:
string
,
public
weight
:
number
)
{
}
}
}
}
const
COLOR
:
string
[]
=
[
"
red
"
,
"
green
"
,
"
blue
"
,
"
yellow
"
,
"
orange
"
];
@
Component
({
@
Component
({
selector
:
'
app-tag-cloud
'
,
selector
:
'
app-tag-cloud
'
,
...
@@ -30,7 +31,7 @@ class TagComment implements CloudData {
...
@@ -30,7 +31,7 @@ class TagComment implements CloudData {
})
})
export
class
TagCloudComponent
implements
OnInit
{
export
class
TagCloudComponent
implements
OnInit
{
@
ViewChild
(
TagCloudComponent
,
{
static
:
false
})
child
:
TagCloudComponent
;
@
ViewChild
(
TagCloudComponent
,
{
static
:
false
})
child
:
TagCloudComponent
;
roomId
:
string
;
roomId
:
string
;
options
:
CloudOptions
=
{
options
:
CloudOptions
=
{
// if width is between 0 and 1 it will be set to the width of the upper element multiplied by the value
// if width is between 0 and 1 it will be set to the width of the upper element multiplied by the value
...
@@ -45,8 +46,8 @@ export class TagCloudComponent implements OnInit {
...
@@ -45,8 +46,8 @@ export class TagCloudComponent implements OnInit {
delay
:
0.4
// Zoom will take affect after 0.8 seconds
delay
:
0.4
// Zoom will take affect after 0.8 seconds
};
};
data
:
CloudData
[]
=
[];
data
:
CloudData
[]
=
[];
constructor
(
private
commentService
:
CommentService
,
private
spacyService
:
SpacyService
)
{
constructor
(
private
commentService
:
CommentService
,
private
spacyService
:
SpacyService
)
{
...
@@ -54,7 +55,6 @@ export class TagCloudComponent implements OnInit {
...
@@ -54,7 +55,6 @@ export class TagCloudComponent implements OnInit {
}
}
ngOnInit
():
void
{
ngOnInit
():
void
{
this
.
commentService
.
getAckComments
(
this
.
roomId
).
subscribe
((
comments
:
Comment
[])
=>
{
this
.
commentService
.
getAckComments
(
this
.
roomId
).
subscribe
((
comments
:
Comment
[])
=>
{
this
.
analyse
(
comments
)
this
.
analyse
(
comments
)
});
});
...
@@ -62,21 +62,22 @@ export class TagCloudComponent implements OnInit {
...
@@ -62,21 +62,22 @@ export class TagCloudComponent implements OnInit {
analyse
(
comments
:
Comment
[])
{
analyse
(
comments
:
Comment
[])
{
const
commentsConcatenated
=
comments
.
map
(
c
=>
c
.
body
).
join
(
"
"
)
const
commentsConcatenated
=
comments
.
map
(
c
=>
c
.
body
).
join
(
"
"
)
;
console
.
log
(
commentsConcatenated
)
this
.
spacyService
.
analyse
(
commentsConcatenated
,
"
de
"
).
subscribe
((
res
:
Result
)
=>
{
this
.
spacyService
.
analyse
(
commentsConcatenated
,
"
de
"
).
subscribe
((
res
:
Result
)
=>
{
res
.
words
.
forEach
(
console
.
log
);
this
.
data
=
res
.
words
.
filter
(
w
=>
w
.
tag
===
"
NE
"
||
w
.
tag
===
"
NN
"
||
w
.
tag
===
"
NMP
"
||
w
.
tag
==
"
NNE
"
).
map
(
w
=>
res
.
arcs
.
forEach
(
console
.
log
);
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
(
new
TagComment
(
COLORS
[
0
],
true
,
"
www.google.com
"
,
null
,
0
,
w
.
text
,
"
comment.creatorId
"
,
Math
.
random
())
Math
.
random
()
*
(
COLOR
.
length
-
1
))],
)
true
,
null
,
null
,
Math
.
floor
(
Math
.
random
()
*
30
-
15
),
w
.
text
,
"
todo
"
,
Math
.
floor
(
Math
.
random
()
*
10
)
+
1
)
)
}
}
);
);
}
}
tagClicked
(
clicked
:
CloudData
)
{
tagClicked
(
clicked
:
CloudData
)
{
console
.
log
(
clicked
);
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