Skip to content

feat(chart): limit the chart by source reliability (QUAY) - #41

Open
device25 wants to merge 6 commits into
mainfrom
feat/chart-source-quality
Open

device25 wants to merge 6 commits into
mainfrom
feat/chart-source-quality

Conversation

@device25

@device25 device25 commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

What

A new setting, «Люди на схеме: надёжность не ниже» (All, 0, 1, 2, 3), limits the chart by the QUAY of each person's citations. At All, the default, the chart is drawn exactly as without the setting.

  • A person passes with a citation of their own at the chosen level: on the person, their names, events, associations (ASSO) or notes on those.
  • A citation without QUAY counts only at All.
  • People below the threshold leave the chart. Those needed to link someone shown to the root stay as a pale, dashed box. The ways are chosen along the walk topola actually makes, and pale people the others can do without are then taken out. Their number isn't guaranteed to be the smallest possible.
  • The root is always shown, and is pale too if it doesn't pass.
  • With a threshold, the «На схеме N из M» and kinship level counts match the boxes drawn, and the legend explains the pale box. Pale boxes have their own label for screen readers.
  • If the selected person isn't on the chart, the view goes to the root, including when fitting a chart too big for the smallest scale. Their card stays open.
  • Person cards, «Сводка» and the checks still show everything.

The logic is chartPeople, chartWalk and withoutNeedless in src/model/scope.ts. chartWalk restates how topola's relatives chart walks the data, so a change in topola could break it; src/chart/chart-people.test.ts compares it with what topola really draws.

Known limits

  • Citations only on a FAM, such as on a marriage, don't count for the spouses or the children.

  • Citations on NO structures don't count, although the card lists them.

  • If QUAY is rare in a file, the chart can shrink a lot: at threshold 3 the demo keeps 1 person of 10.

  • The chart doesn't refit after the threshold changes, so part of it can end up off screen. The selected person, or else the root, stays in view.

  • A link with both id and root to a person hidden by the threshold opens their card without a box on the chart. Choosing such a person in the app, or a link without root, makes them the root.

  • A person above the threshold whom the chart doesn't draw at All either, such as a half-sibling through an ancestor's other marriage, isn't shown. At All the counts still include such people, as they do on main.

  • A needless pale person can stay in two cases: when the root has several marriages and dropping one would make topola climb to the remaining spouse's parents, and on very tangled charts, where the tries stop at a limit. With 30% of marriages among relatives on a 10,000-person tree that left about 10% more pale people; on trees without such marriages the count matched an unlimited run.

  • With a threshold the chart can get extra copies of people: when a root's other marriage drops out, topola climbs to the remaining spouse's parents.

  • The threshold costs time on big trees (generated trees, root in the last generation, level «все», model only):

    Tree At All: one chart / all five level counts With a threshold: one chart / all five
    10,000 people, no marriages among relatives 17–26 ms / 57–61 ms 58–72 ms / 125–166 ms
    50,000 people, no marriages among relatives 150–161 ms / 441–443 ms 394–538 ms / 938–1,077 ms
    50,000 people, 5% among relatives 170–187 ms / 447–494 ms 566–813 ms / 1,166–1,383 ms
    50,000 people, 30% among relatives 355–442 ms / 642–762 ms 980–2,173 ms / 1,548–2,927 ms

    One chart is computed on each selection. Without a threshold nothing changes.

  • One-sided FAMS links, where a person points at a family that doesn't list them, can leave someone counted but not drawn, and a review reported a case that makes the chart fail to draw. main fails on similar data at All.

  • The legend is hidden on phones, so the pale box isn't explained there.

Testing

  • npm run check:all passed on macOS on the final code: 614 unit, 130 e2e and 7 visual tests, with 8 e2e and 1 visual skipped. No new skips were added.
  • New tests compare chartPeople with real topola drawings: marriages among relatives, adoptions, second marriages and random trees. Taking out any pale person must lose someone who passes, except for roots with several marriages. One-off runs on 5,500 random trees also matched.
  • The random trees don't cover cousins2, DISPROVEN links, single parents or shuffled marriage order. A review's own generator did cover them against the previous commit and found no mismatch with the drawing; that wasn't repeated after withoutNeedless was added.
  • New e2e tests for a selected person hidden by the threshold, including fitting a chart too wide to fit; both fail without their fixes. tests/e2e/source-quality.spec.ts also includes an axe check with the threshold on.
  • Reference snapshots didn't change. Linux snapshots are checked only by this PR's CI run.
  • Styles were last changed before the reviews. A review ran axe in the dark theme without violations.

🤖 Generated with Claude Code

device25 and others added 6 commits November 5, 2026 03:02
A setting hides people with no citation of their own at the chosen
level. Those who link the rest to the root stay, drawn pale, and the
root is always shown. A citation without QUAY counts only at "All", the
default, so the chart doesn't change until the setting is used. Person
cards still list every source.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The threshold looked for ways to the root over every link in the data,
but topola doesn't walk all of them: someone above it could be counted
and not drawn, or an unneeded person kept pale. Now the walk is the one
topola takes, with the fewest people below the threshold on the way.

At «all» the chart gets no second limit, so it is drawn as before. When
the selected person isn't on the chart, the view goes to the root.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each person's way to the root was the cheapest alone, but together the
ways could keep someone needless: a father without citations stayed for
a sibling the mother links as well. They are now tried one by one, after
ruling out those every way leads through, up to a limit that keeps
tangled charts from taking seconds.

Fitting a chart too wide to fit now centres on the root when the selected
person isn't on it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
They draw hundreds of charts and went over the default 5 seconds there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant