Skip to content
This repository was archived by the owner on Jun 1, 2025. It is now read-only.

Commit 9d38386

Browse files
committed
visual changes after feedback session
1 parent a15f1ce commit 9d38386

2 files changed

Lines changed: 28 additions & 17 deletions

File tree

src/index.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@
4747
visibility: hidden;
4848
position: absolute;
4949
z-index: 2;
50-
width: 60vw;
50+
width: 40vw;
5151
height: 90vh;
52-
left: 0;
53-
right: 0;
52+
/* left: 0; */
53+
right: 5vw;
5454
top: 0;
5555
bottom: 0;
5656
margin: auto;
@@ -73,11 +73,12 @@
7373
top: 20px;
7474
left: 220px;
7575
font-size: x-small;
76+
display: none;
7677
}
7778

7879
#chart {
7980
position: relative; /* for annotation */
80-
background-color: aqua;
81+
background-color: white;
8182
width: 100%;
8283
height: 100%;
8384
}
@@ -120,10 +121,9 @@
120121

121122
<!-- article -->
122123
<div id="article" class="content">
123-
<strong>Article</strong>
124-
<p>
125-
Lorem ipsum dolor sit amet, consectetur adipiscing elit
126-
</p>
124+
<button id="article-close">✖ Close</button>
125+
<button id="article-open">⬈ Open tab</button>
126+
<div id="article-content"></div>
127127
</div>
128128

129129
<!-- chart -->

src/js/main.js

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function clusterCategoryIdToText(clusterCategoryId) {
3737
}
3838

3939
function clusterCategoryPalette() {
40-
const alpha = 0.75;
40+
const alpha = 1.0;
4141
return [
4242
[0.875, 0.125, 0.125, alpha],
4343
[0.875, 0.5341, 0.125, alpha],
@@ -262,13 +262,6 @@ function onClick(x, y) {
262262
disableArticle();
263263
} else {
264264
enableArticle(closestPoint);
265-
266-
const article = document.getElementById("article");
267-
article.innerHTML =
268-
"<iframe src='https://sciencemap.eto.tech/cluster/?version=2&cluster_id=" +
269-
closestPoint.clusterId +
270-
"' width='100%' height='100%'></iframe>";
271-
272265
// window.open(
273266
// "https://sciencemap.eto.tech/cluster/?version=2&cluster_id=" +
274267
// closestPoint.clusterId,
@@ -357,7 +350,25 @@ function disableAnnotation() {
357350
isAnnotationEnabled = false;
358351
}
359352

360-
function buildArticle(dataPoint) {}
353+
function buildArticle(dataPoint) {
354+
const article = document.getElementById("article-content");
355+
const url =
356+
"https://sciencemap.eto.tech/cluster/?version=2&cluster_id=" +
357+
dataPoint.clusterId;
358+
359+
article.innerHTML =
360+
"<iframe src='" + url + "' width='100%' height='100%'></iframe>";
361+
362+
const articleClose = document.getElementById("article-close");
363+
articleClose.onclick = () => {
364+
disableArticle();
365+
};
366+
367+
const articleOpen = document.getElementById("article-open");
368+
articleOpen.onclick = () => {
369+
window.open(url, "_blank");
370+
};
371+
}
361372

362373
function disableArticle() {
363374
const article = document.getElementById("article");

0 commit comments

Comments
 (0)