Improve search page

This commit is contained in:
2021-02-08 12:27:45 +01:00
parent 3e09cb0b66
commit 8dedc4eb94
9 changed files with 1289 additions and 12 deletions
+2 -7
View File
@@ -95,13 +95,8 @@
<!-- most searched word-->
<div class="most-searched-words" *ngIf="!showDocuments">
<p class="title ion-text-center">Palavras mais pesquisadas</p>
<div>
<angular-tag-cloud class="world-cloud"
[data]="data"
[width]=width
[height]=height
[overflow]=true>
</angular-tag-cloud>
<div class="most-searched-word-container">
123
</div>
</div>
+5
View File
@@ -197,6 +197,11 @@ ion-slide{
text-align: center;
color: black;
}
.most-searched-word-container{
width: 441px;
height: 400px;
}
}
}
+31 -1
View File
@@ -1,13 +1,15 @@
import { Component, OnInit } from '@angular/core';
import { ModalController } from '@ionic/angular';
import { ProcessesService } from 'src/app/services/processes.service';
import { SearchService } from "../../services/search.service";
import { SearchService, } from "../../services/search.service";
import { SearchCategory } from "src/app/models/search-category";
import { SearchDocument } from "src/app/models/search-document";
import { formatDate } from '@angular/common';
import { CloudData, CloudOptions } from 'angular-tag-cloud-module';
import { SenderPage } from 'src/app/pages/search/sender/sender.page';
import { OrganicEntityPage } from 'src/app/pages/search/organic-entity/organic-entity.page';
import WordCloud from 'src/plugin/wordcloud2.js'
import { NgModel } from '@angular/forms';
@Component({
@@ -54,12 +56,40 @@ export class SearchPage implements OnInit {
speed: 400,
}
list = []
constructor(private modalController: ModalController,
private search: SearchService) {
this.ordinance = "recent";
}
ngOnInit() {
this.search.mostSeachWord("10").subscribe(res=>{
let list = []
res.forEach(element => {
list.push(Object.values(element))
});
this.list = list
const elem = document.documentElement.querySelector('.most-searched-word-container');
WordCloud(
elem,
{
list: this.list,
Family: 'Times, serif',
gridSize: 15
},
);
});
}
close(){