2024-04-04 21:27:51 +02:00
|
|
|
<!----------------------------------------------------
|
|
|
|
File: ResearcherProfile.vue
|
|
|
|
Author: Maxime Bartha
|
|
|
|
Scope: Extension Publicatons scientifiquess
|
|
|
|
Description: Researcher Profile Page containing his articles and his statistics
|
|
|
|
----------------------------------------------------->
|
|
|
|
|
2024-03-29 15:32:08 +01:00
|
|
|
<script setup>
|
2024-04-05 09:44:41 +02:00
|
|
|
import { ref, reactive } from "vue";
|
2024-04-04 15:01:10 +02:00
|
|
|
const input = ref("");
|
|
|
|
const statsOf = ref("");
|
|
|
|
const statsBy = ref("");
|
2024-04-05 09:44:41 +02:00
|
|
|
let chart;
|
2024-04-04 15:01:10 +02:00
|
|
|
|
2024-04-04 21:27:51 +02:00
|
|
|
const jsonMockViewsByYears= [
|
|
|
|
{label: "2004", y:4},
|
|
|
|
{label: "2005", y:99},
|
|
|
|
{label: "2007", y:555},
|
|
|
|
{label: "2009", y:22},
|
|
|
|
{label: "2011", y:1666},
|
|
|
|
]
|
2024-04-04 15:01:10 +02:00
|
|
|
|
|
|
|
function inputKeyUp() {
|
|
|
|
let filter, ul, li, a, txtValue;
|
|
|
|
filter = input.value.toUpperCase();
|
|
|
|
if (document.getElementById("myUL") != null) {
|
|
|
|
ul = document.getElementById("myUL");
|
|
|
|
li = ul.getElementsByTagName("li");
|
|
|
|
|
|
|
|
// Loop through all list items, and hide those who don't match the search query
|
|
|
|
for (let i = 0; i < li.length; i++) {
|
|
|
|
a = li[i].getElementsByTagName("a")[0];
|
|
|
|
txtValue = a.textContent || a.innerText;
|
|
|
|
if (txtValue.toUpperCase().indexOf(filter) > -1) {
|
|
|
|
li[i].style.display = "";
|
|
|
|
} else {
|
|
|
|
li[i].style.display = "none";
|
2024-04-01 19:13:39 +02:00
|
|
|
}
|
2024-04-04 15:01:10 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-03-30 12:23:56 +01:00
|
|
|
|
2024-04-05 09:44:41 +02:00
|
|
|
const options = reactive({
|
2024-04-04 15:01:10 +02:00
|
|
|
backgroundColor:null,
|
|
|
|
theme: "light2",
|
|
|
|
animationEnabled: true,
|
|
|
|
title: {
|
|
|
|
fontColor: "white",
|
2024-04-04 21:27:51 +02:00
|
|
|
text : "please select options",
|
2024-04-04 15:01:10 +02:00
|
|
|
},
|
|
|
|
data: [
|
|
|
|
{
|
|
|
|
type: "pie",
|
|
|
|
indexLabel: "{label} (#percent%)",
|
|
|
|
yValueFormatString: "#,##0",
|
|
|
|
indexLabelFontColor: "white",
|
|
|
|
toolTipContent:
|
|
|
|
"<span style='\"'color: {color};'\"'>{label}</span> {y}(#percent%)",
|
2024-04-05 09:44:41 +02:00
|
|
|
}]
|
|
|
|
});
|
|
|
|
|
|
|
|
function update(){
|
|
|
|
options.title = {
|
2024-04-04 16:14:19 +02:00
|
|
|
fontColor: "white",
|
|
|
|
text: statsOf.value + " By "+ statsBy.value,
|
|
|
|
}
|
2024-04-04 21:27:51 +02:00
|
|
|
if (statsOf.value === "views" && statsBy.value === "years") {
|
2024-04-05 09:44:41 +02:00
|
|
|
options.data[0].dataPoints = jsonMockViewsByYears;
|
2024-04-04 21:27:51 +02:00
|
|
|
}
|
|
|
|
|
2024-04-05 09:44:41 +02:00
|
|
|
options.title.text = statsOf.value + " By "+ statsBy.value;
|
|
|
|
chart.render()
|
2024-04-04 15:01:10 +02:00
|
|
|
}
|
2024-03-29 15:32:08 +01:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2024-04-04 15:01:10 +02:00
|
|
|
<div id="main">
|
|
|
|
<div id="profilePicture">
|
|
|
|
<img src="/Clyde.png" />
|
2024-03-29 15:32:08 +01:00
|
|
|
</div>
|
2024-04-04 15:01:10 +02:00
|
|
|
<div id="researcherInfos">
|
|
|
|
<div class="surrounded">John Doe</div>
|
|
|
|
<div class="surrounded">Orcid : 12144-2144-12336-B</div>
|
|
|
|
<div class="surrounded">Email : John.Doe@umons.ac.be</div>
|
|
|
|
|
|
|
|
<div class="surrounded">
|
|
|
|
site :
|
|
|
|
<a href="http://localhost:5173" style="color: #007aff">here</a>
|
|
|
|
</div>
|
|
|
|
<div class="surrounded">Domain : physics, IT</div>
|
|
|
|
<div id="coAuthorList" class="surrounded">Co-authors list : D</div>
|
2024-03-29 15:32:08 +01:00
|
|
|
</div>
|
2024-04-04 15:01:10 +02:00
|
|
|
<div id="stats">
|
|
|
|
<div class="surrounded">
|
|
|
|
Stat type :
|
2024-04-05 09:44:41 +02:00
|
|
|
<select @change="update()" id="stats-select" v-model="statsOf">
|
2024-04-04 15:01:10 +02:00
|
|
|
<option value="views">Views</option>
|
|
|
|
<option value="co-authors">Co-authors</option>
|
|
|
|
<option value="articles">Articles</option>
|
|
|
|
<option value="language">Languages</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<div class="surrounded">
|
|
|
|
Class by:
|
2024-04-05 09:44:41 +02:00
|
|
|
<select @change="update()" id="classed-select" v-model="statsBy">
|
2024-04-04 15:01:10 +02:00
|
|
|
<option selected="selected" value="years">Years</option>
|
|
|
|
<option value="months">Months</option>
|
|
|
|
<option value="topics">Topics</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<div id="statsPie">
|
2024-04-05 09:44:41 +02:00
|
|
|
<CanvasJSChart :options="options" id=chart @chart-ref="c => chart = c "/>
|
2024-04-04 15:01:10 +02:00
|
|
|
</div>
|
2024-03-29 15:32:08 +01:00
|
|
|
</div>
|
2024-04-04 15:01:10 +02:00
|
|
|
<div id="articles">
|
|
|
|
<input
|
|
|
|
type="text"
|
|
|
|
id="search-input"
|
2024-04-05 09:44:41 +02:00
|
|
|
@keyup="inputKeyUp()"
|
2024-04-04 15:01:10 +02:00
|
|
|
placeholder="search articles"
|
|
|
|
v-model="input"
|
|
|
|
/>
|
|
|
|
<ul id="myUL">
|
|
|
|
<li><a href="#">Adele</a></li>
|
|
|
|
<li><a href="#">Agnes</a></li>
|
|
|
|
|
|
|
|
<li><a href="#">Billy</a></li>
|
|
|
|
<li><a href="#">Bob</a></li>
|
|
|
|
|
|
|
|
<li><a href="#">Calvin</a></li>
|
|
|
|
<li><a href="#">Christina</a></li>
|
|
|
|
<li><a href="#">Cindy</a></li>
|
|
|
|
</ul>
|
2024-03-29 15:32:08 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
#main {
|
|
|
|
display: grid;
|
|
|
|
grid-template-columns: 22% auto;
|
|
|
|
grid-template-rows: 26% auto;
|
|
|
|
height: 100%;
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
#profilePicture {
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
}
|
2024-04-04 15:01:10 +02:00
|
|
|
|
|
|
|
#profilePicture img {
|
2024-03-29 15:32:08 +01:00
|
|
|
align-self: center;
|
|
|
|
justify-self: center;
|
2024-04-04 15:01:10 +02:00
|
|
|
width: 60%;
|
2024-03-29 15:32:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
#researcherInfos {
|
|
|
|
display: grid;
|
|
|
|
grid-template-columns: auto auto auto;
|
|
|
|
column-gap: 5px;
|
2024-04-04 15:01:10 +02:00
|
|
|
grid-template-rows: auto auto;
|
2024-03-29 15:32:08 +01:00
|
|
|
}
|
2024-04-04 15:01:10 +02:00
|
|
|
|
2024-03-29 15:32:08 +01:00
|
|
|
.surrounded {
|
2024-04-04 15:01:10 +02:00
|
|
|
border: 2px solid black;
|
|
|
|
color: white;
|
2024-03-29 15:32:08 +01:00
|
|
|
font-size: x-large;
|
|
|
|
align-self: center;
|
|
|
|
text-align: center;
|
|
|
|
background-color: rgba(255, 255, 255, 0.09);
|
2024-04-04 15:01:10 +02:00
|
|
|
border-radius: 20px;
|
|
|
|
margin-bottom: 10px;
|
2024-03-29 15:32:08 +01:00
|
|
|
}
|
|
|
|
|
2024-03-30 12:23:56 +01:00
|
|
|
.surrounded select {
|
|
|
|
margin-top: 2px;
|
|
|
|
margin-bottom: 2px;
|
|
|
|
border: 1px solid black;
|
|
|
|
color: white;
|
2024-04-04 15:01:10 +02:00
|
|
|
background-color: rgb(255, 255, 255, 0.1);
|
2024-03-30 12:23:56 +01:00
|
|
|
font-size: large;
|
|
|
|
align-self: center;
|
|
|
|
text-align: center;
|
|
|
|
}
|
|
|
|
|
2024-04-04 15:01:10 +02:00
|
|
|
#statsPie {
|
2024-03-30 12:23:56 +01:00
|
|
|
|
2024-03-29 15:32:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
#articles {
|
|
|
|
background-color: orange;
|
|
|
|
}
|
2024-04-04 15:01:10 +02:00
|
|
|
|
|
|
|
#search-input {
|
2024-04-01 19:13:39 +02:00
|
|
|
width: 60%;
|
|
|
|
font-size: 16px;
|
|
|
|
padding: 12px 20px 12px 40px;
|
|
|
|
border: 1px solid #ddd;
|
|
|
|
margin-bottom: 12px;
|
|
|
|
}
|
2024-04-04 15:01:10 +02:00
|
|
|
|
|
|
|
#myUL {
|
2024-04-01 19:13:39 +02:00
|
|
|
list-style-type: none;
|
|
|
|
padding: 0;
|
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
#myUL li a {
|
2024-04-04 15:01:10 +02:00
|
|
|
border: 1px solid #ddd;
|
|
|
|
/* Add a border to all links */
|
|
|
|
margin-top: -1px;
|
|
|
|
/* Prevent double borders */
|
|
|
|
background-color: #f6f6f6;
|
|
|
|
/* Grey background color */
|
|
|
|
padding: 12px;
|
|
|
|
/* Add some padding */
|
|
|
|
text-decoration: none;
|
|
|
|
/* Remove default text underline */
|
|
|
|
font-size: 18px;
|
|
|
|
/* Increase the font-size */
|
|
|
|
color: black;
|
|
|
|
/* Add a black text color */
|
|
|
|
display: block;
|
|
|
|
/* Make it into a block element to fill the whole list */
|
2024-04-01 19:13:39 +02:00
|
|
|
}
|
2024-04-04 15:01:10 +02:00
|
|
|
|
2024-04-01 19:13:39 +02:00
|
|
|
#myUL li a:hover:not(.header) {
|
|
|
|
background-color: #eee;
|
|
|
|
}
|
2024-04-05 09:44:41 +02:00
|
|
|
|
|
|
|
#Chart{
|
|
|
|
width: "100%";
|
|
|
|
height: "100%";
|
|
|
|
}
|
2024-04-01 19:13:39 +02:00
|
|
|
</style>
|