Let pictures send their own legend text: what each piece is and what each color means for the problem

Open
#962 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
28/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
csharp, json

Research direction

Start with Documentation/Visualizations (PICTURE-TYPES.md and ADDING-A-VISUALIZATION.md) and the visualization base classes that pictures derive from. The change adds an optional legend field to picture payloads, so find where payloads are serialized and confirm what the API JSON actually emits. Done means the field is documented, a serialization test checks the real JSON, and a picture without a legend serializes exactly as before.

Written by the indexing model from the issue text.

Description

enhancement

Summary

Let each picture send optional legend text that says, in the problem's own words, what its pieces are and what each color means. Today the frontend can only show generic wording such as "Solution (answer)" and "Covered (rule met)", because the pictures say which state each piece is in but not what that state means for the problem.

Why

The Board G problem page (ReduxISU/Redux_Frontend#303) has a legend under each picture. The mockup's legend reads like this:

  • 3SAT: "True literal", "Clause has no true literal", "Variable (filled once set)", "¬ marks a negated literal".
  • Vertex Cover: "In the cover", "Edge not covered".

Only the picture's C# code knows this. It already decides what each piece is and which state it gets. Putting the wording there keeps one source of truth, gives every client the same legend (Redux_Frontend, Redux_GUI, the API), and lets a contributor who adds a picture write its legend in the same place, with no frontend change.

SPADE (#851) doesn't cover this on its own:

  • Its part list names the instance's parts (Nodes, Edges, K), but not what the colors mean.
  • It doesn't cover pieces a picture creates itself: clause circles, table rows, search-tree nodes, gadgets.
  • 3SAT, SAT and Vertex Cover have no grammar yet.

Proposal

  1. An optional legend field on picture payloads (frames and the picture types), additive only, so Redux_GUI and existing clients are unaffected.
    • pieces: what the drawn pieces are, each with the piece kind it describes (node, edge, group, row, chip, …) and text. Example: "Circle: a clause; the dots inside are its literals".
    • states: the problem's wording for each picture state it uses. Example: Solution → "In the cover", False → "Clause has no true literal".
    • Both are optional. Anything missing falls back to today's generic wording on the frontend.
  2. Reuse #851's part labels where a piece is an instance part. When #851's part list exists, a piece that draws a part (for example a dot for each node) takes its label from there instead of repeating it. Until then, the picture writes the label itself. This issue doesn't wait on SPADE.
  3. A small helper in the visualization base classes, so declaring a legend is a few lines per picture.
  4. Document it in Documentation/Visualizations (PICTURE-TYPES.md, ADDING-A-VISUALIZATION.md) and the visualization implementation guide (draft PR #729).
  5. First pictures: 3SAT (Grouped Graph, Formula), Clique and Vertex Cover (Graph), and their reductions' target pictures. These are the ones the director will look at. The others follow problem by problem.

Done when

  • The field exists, is documented, and has an endpoint/serialization test. API JSON leaks public fields and skips default interface members, so check the actual JSON, not just the build.
  • 3SAT, Clique and Vertex Cover send legends, with snapshot tests.
  • A picture with no legend serializes exactly as it does today.

Related

  • ReduxISU/Redux_Frontend#304: showing the legend on the frontend.
  • #851: instance parts from SPADE (piece labels).
  • ReduxISU/Redux_Frontend#303: Board G problem page.
Dominant language
C#
Stars
9
Forks
34
Avg merge
3d 2h
Merged PRs (30d)
41

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ReduxISU/Redux

All issues in ReduxISU/Redux

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.