Skip to content

Derive edge arrow icons from cytoscape arrow geometry#1983

Draft
kmcginnes wants to merge 1 commit into
mainfrom
derive-arrow-icons
Draft

Derive edge arrow icons from cytoscape arrow geometry#1983
kmcginnes wants to merge 1 commit into
mainfrom
derive-arrow-icons

Conversation

@kmcginnes

@kmcginnes kmcginnes commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Description

The 11 hand-drawn Arrow* SVG icons (ArrowTriangle, ArrowVee, ArrowCircle, ArrowDiamond, ArrowSquare, ArrowTee, ArrowNone, ArrowTriangleTee, ArrowTriangleCross, ArrowTriangleCircle, ArrowTriangleBackCurve) were a second, hand-maintained copy of geometry that arrowShapes.ts already derives (a verbatim port of cytoscape's arrow shapes). Replaced all 11 with a single ArrowStyleIcon that renders the resolved geometry for any ArrowStyle, so the picker glyphs are guaranteed to match the canvas. The 11 icon files and their barrel exports are deleted.

Supporting: ArrowPrimitiveShape (the polygon/path/circle primitive renderer) is extracted from EdgePreview so it can be shared with ArrowStyleIcon.

How to read

  1. ArrowStyleIcon.tsx — the picker/detail icon, drawn from resolveArrowGeometry
  2. ArrowPrimitiveShape.tsx — the extracted shared primitive renderer
  3. arrowsStyling.tsx — picker rewired to pass ArrowStyle values
  4. Deleted components/icons/Arrow*.tsx — the 11 hand-drawn glyphs ArrowStyleIcon replaces

Validation

  • pnpm checks passes (types, lint, format); pnpm test passes
  • New tests: ArrowStyleIcon.test.tsx — shared viewBox, shaft, per-style head counts, tip-shift math
  • Arrow glyphs verified in the running app across the styling picker and edge detail sidebar

Related Issues

Check List

  • I confirm that my contribution is made under the terms of the Apache 2.0 license.
  • I have verified pnpm checks passes with no errors.
  • I have verified pnpm test passes with no failures.
  • I have covered new added functionality with unit tests if necessary.
  • I have updated documentation if necessary.

@kmcginnes
kmcginnes force-pushed the derive-arrow-icons branch 2 times, most recently from 6bc0a0e to 8fc7405 Compare July 24, 2026 17:14
@kmcginnes kmcginnes changed the title Derive edge arrow icons from cytoscape arrow geometry Derive edge arrow icons and share the edge line rendering Jul 24, 2026
The 11 hand-drawn Arrow* icons duplicated the arrow-head geometry that
arrowShapes.ts already ports verbatim from cytoscape. Replace them with a
single ArrowStyleIcon that renders the resolved geometry for any ArrowStyle,
so the picker and edge details always match what the canvas draws.

- Add ArrowStyleIcon: a short edge line ending in the arrow head, with a
  shared viewBox so line thickness and zoom are constant and head trailing
  edges align across styles; line length varies with head depth.
- Extract ArrowPrimitiveShape from EdgePreview as the shared primitive
  renderer for both the preview and the icon.
- Rewire the arrow-style picker and EdgeDetail to ArrowStyleIcon; delete the
  11 Arrow* icon files and their barrel exports.
@kmcginnes
kmcginnes force-pushed the derive-arrow-icons branch from 8fc7405 to 7bfaa02 Compare July 24, 2026 20:58
@kmcginnes kmcginnes changed the title Derive edge arrow icons and share the edge line rendering Derive edge arrow icons from cytoscape arrow geometry Jul 24, 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.

Derive edge arrow-style icons from cytoscape arrow geometry

1 participant