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.
Context
TreemapConfig<ES>currently extendsMarkConfig<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) extendMarkConfigwithout narrowing, but treemap is arguably a bigger departure from the standard mark model.Irrelevant inherited properties
font,fontSize,fontStyle,fontWeight,text,align,baseline,dir,dx,dy,ellipsis,limit,lineBreak,lineHeight,anglestartAngle,endAngle,padAngle,theta,theta2,radius,radius2,innerRadius,outerRadiusinterpolate,tension,orient,ordershape,sizeaspect,url,smoothtimeUnitBandPosition,timeUnitBandSize,invalidConsiderations
MarkConfig— this would set a new patternMarkDefuses an intersection of all mark configs includingTreemapConfig; narrowing would need compatibility checksAnyMarkConfigis a union that includesTreemapConfigOmit(exclude irrelevant) orPick(include only relevant)Suggested approach
Use
Omitto remove clearly irrelevant categories. This is less maintenance thanPickand still removes the bulk of nonsensical props from the schema/autocomplete.