Skip to content

add constructors to mark class types#2425

Merged
Fil merged 2 commits into
mainfrom
fil/mark-constructor-types
May 16, 2026
Merged

add constructors to mark class types#2425
Fil merged 2 commits into
mainfrom
fil/mark-constructor-types

Conversation

@Fil
Copy link
Copy Markdown
Contributor

@Fil Fil commented Apr 13, 2026

Mark classes (Rect, Dot, Line, etc.) were missing constructor declarations in their TypeScript definitions.

Also declare RenderableMark.render as a method rather than a property so subclasses can override it and call super.render(). See https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-3.html#checks-for-super-property-accesses-on-instance-fields

The example/snapshot test adds a "rotate" option to an extended Rect mark, which is not supported by the base Rect.

image

Fixes #2422

Related discussion #2424

@Fil Fil requested a review from mbostock April 13, 2026 09:12
@Fil Fil merged commit 356f579 into main May 16, 2026
1 check passed
@Fil Fil deleted the fil/mark-constructor-types branch May 16, 2026 12:17
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.

TypeScript definitions are out of sync with the JavaScript implementation

2 participants