Enlarge the character glyph set for nicer-looking diagrams

Open
#8,452 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
22/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
devtools

Research direction

The discussion centres on the character lookup tables (Normal, Bold, Doubled, ASCII and NORMAL_THEN_DOUBLED_MIXED_BOX_CHARS) and the pick_charset() function, which is where the optional style parameters would go. Read those first to see how the existing tables are keyed. Done means the maintainers have agreed on which styles to add and how the tables are organised, before any implementation starts.

Written by the indexing model from the issue text.

Description

area/visualization kind/design-issue status/needs-agreed-design triage/accepted

Is your design idea/issue related to a use case or problem? Please explain

Currently, the character glyph set used for text diagrams is limited to the existing character sets (Normal, Bold, Doubled, and ASCII). Expanding the available glyphs could allow for more visually appealing and customizable diagrams. This request is related to a request discussed previously with the Cirq maintainers (with our club, the Disruption Lab at UIUC).

Describe your design idea/issue

I propose expanding the available character glyphs to include rounded corners, dashed lines, and additional characters such as dots.

There are a few design decisions I'd like to discuss before implementing this:

  1. Which characters and styles should we support?

    • I'm currently planning to add rounded corners, dashed lines, and some additional characters (e.g., dots).
    • Are there any other characters or styles that would be useful?
  2. How should the new characters be organized?

    • Should we introduce new lookup tables for the additional styles?
    • Alternatively, should we extend the existing lookup tables (Normal, Bold, Doubled, and ASCII) to include these characters?
  3. How should we handle missing Unicode characters?

    • NORMAL_THEN_DOUBLED_MIXED_BOX_CHARS currently has missing entries because Unicode does not provide characters for certain combinations of single and double lines.
    • Should we leave these entries as they are, or consider alternative representations?
Proposed implementation

My current plan is to introduce new lookup tables for rounded corners, dashed lines, and any other agreed-upon styles. I would also extend pick_charset() with optional parameters to select these styles while preserving the existing default behavior.

I'd appreciate feedback on the proposed approach, particularly which styles to support and how best to organize the lookup tables.

Dominant language
Python
Stars
5.1k
Forks
1.3k
Avg merge
1d 12h
Merged PRs (30d)
48

Getting set up

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 quantumlib/Cirq

All issues in quantumlib/Cirq

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.