SHA256
Связи: доводка – «По группам», клавиши, значки в чипах
- «По группам»: маленькой группе – не меньше десятой части круга (10 близких больше не вытягиваются в одну линию), подписи секторов не уходят за край экрана; - клавиши на компьютере: «/» – поиск, «+»/«−» – масштаб, «0» – вся карта; - значок в чипе всегда размером с текст (без этого «Друзья друзей» раздувал весь ряд); - в «Как читать карту» – «официальный аккаунт», как в профиле.
This commit is contained in:
+1
-1
@@ -39,7 +39,7 @@
|
||||
}());
|
||||
</script>
|
||||
<script>
|
||||
window.__SHINE_BUILD_HASH__ = '20261013053000';
|
||||
window.__SHINE_BUILD_HASH__ = '20261013060000';
|
||||
window.__SHINE_CLIENT_VERSION__ = '1.2.10';
|
||||
</script>
|
||||
<script>
|
||||
|
||||
@@ -1332,9 +1332,25 @@ export function render({ navigate, route, chrome } = {}) {
|
||||
}
|
||||
|
||||
function onKeydown(event) {
|
||||
if (event.key !== 'Escape' || !selectedId || noteSheet || legendSheet || search) return;
|
||||
if (document.querySelector('.dropdown-portal')) return;
|
||||
selectNode('');
|
||||
const typing = event.target instanceof HTMLElement && event.target.closest('input, textarea, [contenteditable="true"]');
|
||||
const overlayOpen = Boolean(noteSheet || legendSheet || document.querySelector('.dropdown-portal, .modal'));
|
||||
if (event.key === 'Escape') {
|
||||
if (!selectedId || overlayOpen || search) return;
|
||||
selectNode('');
|
||||
return;
|
||||
}
|
||||
// Клавиши для компьютера: «/» – поиск, «+»/«−» – масштаб, «0» – вся карта.
|
||||
if (typing || overlayOpen || event.ctrlKey || event.metaKey || event.altKey) return;
|
||||
if (event.key === '/') {
|
||||
event.preventDefault();
|
||||
openSearch();
|
||||
} else if (viewMode === 'map' && (event.key === '+' || event.key === '=')) {
|
||||
engine.zoomBy(1.35);
|
||||
} else if (viewMode === 'map' && (event.key === '-' || event.key === '_')) {
|
||||
engine.zoomBy(1 / 1.35);
|
||||
} else if (viewMode === 'map' && event.key === '0') {
|
||||
engine.fit();
|
||||
}
|
||||
}
|
||||
document.addEventListener('keydown', onKeydown);
|
||||
const overlayObserver = typeof ResizeObserver === 'function' ? new ResizeObserver(() => placeOverlays()) : null;
|
||||
|
||||
@@ -337,12 +337,15 @@ function placeSectors(list, out, seed, stretch, preferred) {
|
||||
return { group, items };
|
||||
})
|
||||
.filter((row) => row.items.length);
|
||||
const weightSum = groups.reduce((sum, row) => sum + Math.max(2, row.items.length), 0);
|
||||
// Маленькой группе – хотя бы десятая часть круга, иначе она вытягивается в одну «спицу».
|
||||
const totalCount = groups.reduce((sum, row) => sum + row.items.length, 0);
|
||||
const weightOf = (row) => Math.max(2, row.items.length, totalCount * 0.1);
|
||||
const weightSum = groups.reduce((sum, row) => sum + weightOf(row), 0);
|
||||
const gap = groups.length > 1 ? 0.22 : 0;
|
||||
let angle = -Math.PI / 2 - (hash01(`${seed}|sectors`) - 0.5) * 0.6;
|
||||
const sectors = [];
|
||||
for (const row of groups) {
|
||||
const span = (Math.PI * 2 - gap * groups.length) * (Math.max(2, row.items.length) / weightSum);
|
||||
const span = (Math.PI * 2 - gap * groups.length) * (weightOf(row) / weightSum);
|
||||
let radius = 120;
|
||||
let placed = 0;
|
||||
while (placed < row.items.length) {
|
||||
@@ -1033,6 +1036,8 @@ export function createGraphCanvas({ stage, onSelect, onNodeMoved, getInsets } =
|
||||
if (p.y < -20 || p.y > height + 20 || p.x < -200 || p.x > width + 200) continue;
|
||||
const text = `${item.caption} · ${item.count}`;
|
||||
const w = ctx.measureText(text).width + 16;
|
||||
// Подпись не уходит за край экрана.
|
||||
p.x = clamp(p.x, w / 2 + 6, width - w / 2 - 6);
|
||||
reserve(p.x - w / 2, p.y - 10, w, 20);
|
||||
ctx.fillStyle = rgba(colors.background, 0.92);
|
||||
ctx.strokeStyle = rgba(colors.textSecondary, colors.dark ? 0.28 : 0.32);
|
||||
|
||||
@@ -70,3 +70,5 @@
|
||||
.chip--toggle { border-style: dashed; }
|
||||
.chip--toggle[aria-pressed='true'] { border-style: solid; color: var(--accent); }
|
||||
.chip--toggle svg { flex: 0 0 auto; }
|
||||
/* Значок в чипе – по размеру текста, что бы ни задала страница. */
|
||||
.chip svg { flex: 0 0 auto; width: 16px; height: 16px; }
|
||||
|
||||
@@ -57,6 +57,10 @@
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
.net-chips__fof {
|
||||
margin-left: var(--space-1);
|
||||
}
|
||||
|
||||
/* Список: свой скролл (страница «Связей» не прокручивается), отступы сверху и снизу
|
||||
* под чипы и нижнее меню задаёт JS. */
|
||||
.net-list {
|
||||
|
||||
Reference in New Issue
Block a user