Skip to content

Commit 6ac442c

Browse files
committed
Fix some minor issues
1 parent 6d02a3d commit 6ac442c

3 files changed

Lines changed: 16 additions & 5 deletions

File tree

docs/index.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,10 @@
243243
<div class="activity-context-bar compare">
244244
<span id="activity-compare-context-label">Comparison port</span>
245245
</div>
246+
<div class="rp-section">
247+
<div class="section-title">Monthly Activity</div>
248+
<div class="chart-wrap"><div id="chart-monthly-compare"></div></div>
249+
</div>
246250
<div class="rp-section">
247251
<div class="section-title">Hourly Activity</div>
248252
<div class="chart-wrap"><div id="chart-hourly-compare"></div></div>

docs/js/charts.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const Charts = (() => {
66
d3.select(el).selectAll("*").remove();
77
}
88

9-
const CHART_HEIGHTS = { "chart-monthly": 100, "chart-hourly": 110, "chart-hourly-compare": 110, "chart-sog": 90, "chart-sog-compare": 90, "chart-types": 160, "chart-types-compare": 160, "chart-status": 130, "chart-status-compare": 130, "chart-radar": 230 };
9+
const CHART_HEIGHTS = { "chart-monthly": 100, "chart-monthly-compare": 100, "chart-hourly": 110, "chart-hourly-compare": 110, "chart-sog": 90, "chart-sog-compare": 90, "chart-types": 160, "chart-types-compare": 160, "chart-status": 130, "chart-status-compare": 130, "chart-radar": 230 };
1010
const MONTH_ABBR = ["", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
1111

1212
function getSize(el) {
@@ -17,8 +17,8 @@ const Charts = (() => {
1717
return { w: Math.max(w, 180), h: Math.max(h, fallbackH) };
1818
}
1919

20-
function drawMonthly(data, highlightMonth = null) {
21-
const el = sel("chart-monthly");
20+
function drawMonthly(data, highlightMonth = null, targetId = "chart-monthly") {
21+
const el = sel(targetId);
2222
if (!el) return;
2323
clearSvg(el);
2424
const { w, h } = getSize(el);

docs/js/main.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,12 @@ function setViewMode(isPortView) {
241241
}
242242
updateViewButtons(isPortView);
243243

244+
const rightPanel = $("right-panel");
245+
if (rightPanel) {
246+
rightPanel.style.opacity = isPortView ? "1" : "0.35";
247+
rightPanel.style.pointerEvents = isPortView ? "" : "none";
248+
}
249+
244250
const legend = $("map-legend");
245251
if (!legend) return;
246252
if (isPortView) {
@@ -504,6 +510,7 @@ function updateActivityCharts() {
504510
if (compare) {
505511
if (compareLabel) compareLabel.textContent = `Comparison: ${compare.name}`;
506512
if (compareGroup) compareGroup.classList.add("visible");
513+
Charts.drawMonthly(computePortMonthly(compare.id), null, "chart-monthly-compare");
507514
Charts.drawHourly(computePortHourly(compare.id), highlightHour, "chart-hourly-compare");
508515
Charts.drawSog(computePortSog(compare.id), "chart-sog-compare");
509516
Charts.drawStatus(computePortPatternStatus(compare.id), "chart-status-compare", "Pattern");
@@ -556,8 +563,8 @@ function computePortPatternStatus(portId) {
556563
function getPortStats(port) {
557564
const trajs = _filterTrajs(port.id);
558565
return {
559-
vessels: fmt(port.n_unique_vessels),
560-
records: fmt(port.n_records),
566+
vessels: fmt(new Set(trajs.map(t => t.mmsi)).size),
567+
records: fmt(trajs.length),
561568
inbound: trajs.filter(t => t.pattern === "inbound").length,
562569
outbound: trajs.filter(t => t.pattern === "outbound").length,
563570
anchored: trajs.filter(t => t.pattern === "anchored").length,

0 commit comments

Comments
 (0)