Skip to content

add constructors to mark class types#2425

Open
Fil wants to merge 2 commits intomainfrom
fil/mark-constructor-types
Open

add constructors to mark class types#2425
Fil wants to merge 2 commits intomainfrom
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
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

1 participant