Skip to content

cleaner area line option (WIP)#2405

Closed
Fil wants to merge 6 commits intofil/area-linefrom
fil/area-line-updates
Closed

cleaner area line option (WIP)#2405
Fil wants to merge 6 commits intofil/area-linefrom
fil/area-line-updates

Conversation

@Fil
Copy link
Copy Markdown
Contributor

@Fil Fil commented Apr 4, 2026

This still needs updates to the tests (to actually test that the line and fill options are going to the right place).

for #2133.

@Fil Fil mentioned this pull request Apr 4, 2026
Copy link
Copy Markdown
Member

@mbostock mbostock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a step in the right direction. I think we’ll probably want to lump the display attributes into three categories: (1) shared attributes that apply to both the area and line path, (2) attributes that only apply to the area path, and (3) attributes that only apply to the line path.

This branch currently produces something like:

<g>
  <g>
    <path aria-label="area" fill="#3ca951" d="M40,189.819L52.6,192.692…Z">
      <title>8 - Track Tape</title>
    </path>
    <path aria-label="area" fill="none" stroke="white" stroke-linejoin="round" stroke-linecap="round" transform="translate(0.5,0.5)" d="M40,189.819L52.6,192.692…">
      <title>8 - Track Tape</title>
    </path>
  </g>
</g>

But I think we are going to want something like:

<g aria-label="area">
  <g>
    <path fill="#3ca951" d="M40,189.819L52.6,192.692…Z"></path>
    <path fill="none" stroke="white" stroke-linejoin="round" stroke-linecap="round" transform="translate(0.5,0.5)" d="M40,189.819L52.6,192.692…"></path>
    <title>8 - Track Tape</title>
  </g>
</g>

In other words:

  • Constant attributes such as aria-label should be moved up to the mark’s root G element.
  • Shared attributes attributes such as mix-blend-mode and opacity should be on the G element that contains the per-instance area and line paths; this G element should also contain a singular TITLE element; the clip would also be applied here.
  • Attributes that are specific to the area and line paths go on the path elements.

@mbostock mbostock mentioned this pull request Apr 5, 2026
@mbostock
Copy link
Copy Markdown
Member

mbostock commented Apr 6, 2026

Superseded by #2407.

@mbostock mbostock closed this Apr 6, 2026
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.

2 participants