Add conflictology map mode and fix graph rendering reliability.

Support conflict types, involvement sizing, and map-type toggles while keeping polar sector layout; improve GraphView init retries and edge matching on network maps.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-25 11:51:06 +03:00
co-authored by Cursor
parent e80d0d0e88
commit 85b8b2e9b8
29 changed files with 744 additions and 132 deletions
+16 -2
View File
@@ -2,8 +2,8 @@ from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
from core.choices import (
ALL_RELATION_TYPES,
INTERACTION_INTENSITY,
RELATION_TYPES,
)
@@ -35,6 +35,10 @@ class NetworkMapType(models.Model):
sectors = models.JSONField(default=list, verbose_name='Секторы')
circles = models.JSONField(default=list, verbose_name='Круги')
is_default = models.BooleanField(default=False, verbose_name='Тип по умолчанию')
conflictology_enabled = models.BooleanField(
default=False,
verbose_name='Режим конфликтологии',
)
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
@@ -58,6 +62,11 @@ class NetworkMap(models.Model):
related_name='maps',
verbose_name='Тип карты',
)
conflict_subject = models.CharField(
max_length=255,
blank=True,
verbose_name='Предмет конфликта (центр карты)',
)
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
@@ -100,6 +109,11 @@ class NetworkMapMembership(models.Model):
validators=[MinValueValidator(1), MaxValueValidator(5)],
verbose_name='Важность (15)',
)
conflict_involvement = models.PositiveSmallIntegerField(
default=3,
validators=[MinValueValidator(1), MaxValueValidator(5)],
verbose_name='Вовлечённость в конфликт (1–5)',
)
map_angle = models.FloatField(null=True, blank=True, verbose_name='Угол позиции на карте')
map_radius_ratio = models.FloatField(
null=True,
@@ -136,7 +150,7 @@ class Relation(models.Model):
)
relation_type = models.CharField(
max_length=50,
choices=RELATION_TYPES,
choices=ALL_RELATION_TYPES,
default='acquaintance',
verbose_name='Тип связи',
)