Skip to content

Consider narrowing TreemapConfig to omit irrelevant MarkConfig properties #9785

@kanitw

Description

@kanitw

Context

TreemapConfig<ES> currently extends MarkConfig<ES> in full (src/mark.ts), inheriting ~35 properties that have no meaning for treemap marks. This is consistent with how all other mark configs (RectConfig, LineConfig, AreaConfig, TickConfig) extend MarkConfig without narrowing, but treemap is arguably a bigger departure from the standard mark model.

Irrelevant inherited properties

  • Text: font, fontSize, fontStyle, fontWeight, text, align, baseline, dir, dx, dy, ellipsis, limit, lineBreak, lineHeight, angle
  • Arc/polar: startAngle, endAngle, padAngle, theta, theta2, radius, radius2, innerRadius, outerRadius
  • Line/area: interpolate, tension, orient, order
  • Symbol: shape, size
  • Image: aspect, url, smooth
  • Other: timeUnitBandPosition, timeUnitBandSize, invalid

Considerations

  • No existing mark config narrows MarkConfig — this would set a new pattern
  • MarkDef uses an intersection of all mark configs including TreemapConfig; narrowing would need compatibility checks
  • AnyMarkConfig is a union that includes TreemapConfig
  • The extra properties are harmless at runtime (ignored by the treemap compiler)
  • Could use Omit (exclude irrelevant) or Pick (include only relevant)

Suggested approach

Use Omit to remove clearly irrelevant categories. This is less maintenance than Pick and still removes the bulk of nonsensical props from the schema/autocomplete.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions