Agents & OrchestrationSûr100100/100
Extend Tanstack Charts (TanStack)
Implement TanStack Charts custom marks, scale-value contracts, final-bounds layouts, renderer-neutral scene nodes, renderers, hosts, controls, or composed views after built-in primitives are exhausted.
ou envoie-le directement à ton agent.
Installer dans ton projet
$ curl -fsSL https://arboristhree.xyz/cli/install-skill.mjs -o /tmp/arboris-install-skill.mjs && node /tmp/arboris-install-skill.mjs extend-tanstack-charts__tanstack-charts__packages-charts-core-skills-6eaef827489eTanStack
TanStack/charts
Contenu à copier
---
name: extend-tanstack-charts
description: >
Implement TanStack Charts custom marks, scale-value contracts,
final-bounds layouts, renderer-neutral scene nodes, renderers, hosts,
controls, or composed views after built-in primitives are exhausted.
metadata:
origin: TanStack
type: core
library: '@tanstack/charts'
library_version: '1.1.0'
requires:
- compose-marks-and-views
sources:
- 'TanStack/charts:docs/guides/custom-marks-and-renderers.md'
- 'TanStack/charts:docs/reference/custom-extensions.md'
- 'TanStack/charts:packages/charts-core/src/mark.ts'
- 'TanStack/charts:packages/charts-core/src/mark-with-scale-values.ts'
---
# Extend TanStack Charts
Use **trigger → inspect → decide → build → verify**. Extend the narrowest ownership boundary after proving built-in marks, first-party layouts, transforms, facets, views, and controlled behaviors cannot express the required semantics.
## Setup
Create a renderer-neutral mark with declared scale values and deterministic scene keys:
```ts
import { createMark, defineChart } from '@tanstack/charts'
import { scaleLinear } from '@tanstack/charts/scales/linear'
interface ThresholdDatum {
id: string
value: number
}
const threshold = createMark<ThresholdDatum, never, number>(({ markIndex }) => {
const datum: ThresholdDatum = { id: 'target', value: 75 }
return {
id: `threshold-${markIndex}`,
channels: { y: { scale: 'y', values: [datum.value] } },
render({ chart, scales, theme }) {
const y = scales.y.map(datum.value)
return {
nodes: [
{
kind: 'rule',
key: datum.id,
x1: chart.x,
x2: chart.x + chart.width,
y1: y,
y2: y,
style: { stroke: theme.foreground, strokeOpacity: 0.55 },
},
],
}
},
}
})
export const chart = defineChart({
marks: [threshold],
scales: {
x: null,
y: { scale: scaleLinear },
},
})
```
This mark is decorative, so it emits no fake interaction point.
## Core Patterns
### Escalate through extension boundaries
1. Built-in or first-party composite mark.
2. Several built-in marks.
3. Facet or named view composition.
4. D3/application-prepared semantic rows.
5. `compositeMark` for a reusable group of ordinary marks.
6. `createMark` for new renderer-neutral geometry.
7. `resolveLayout` only for final-bounds topology or collision.
8. Custom control for reusable semantic behavior.
9. Custom renderer/host for a different platform surface.
Read [the extension protocol matrix](references/extension-protocols.md) before choosing a boundary.
### Materialize values before rendering
Initialization declares every semantic value that must establish x, y, or color domains. Rendering maps those values through resolved scales. Never infer a private positional domain inside `render`.
### Emit honest interaction points
Only emit points for semantic targets. Each point keeps the original datum, stable key, semantic values, resolved coordinates, and group/color identity. Attach the same point object to the scene primitive it paints. Use focus anchors for reveal-only geometry and focus guides for data-less cursor presentation.
### Use final-layout callbacks only for final-layout work
Use `resolveLayout` for binning, collision, packing, or topology that depends on resolved scales and inner bounds. Keep semantic row transforms eager and outside render. Keep layout callbacks synchronous, pure, and deterministic because margin solving can call them more than once.
## Common Mistakes
### CRITICAL Reading or mutating the DOM during scene generation
Wrong: query text, append SVG, or inspect browser layout in `initialize`, `resolveLayout`, or `render`.
Correct: consume the supplied bounds, scales, theme, text layout, and scene contracts; put platform lifecycle in a renderer or host extension.
Scene compilation must remain deterministic for SSR, Canvas, native, export, and tests.
Source: `docs/guides/custom-marks-and-renderers.md`; `packages/charts-core/src/mark.ts`
### CRITICAL Inferring a private positional domain in render
Wrong: derive a local domain and scale after chart scales have resolved.
Correct: materialize positional channel values during initialization, then map with `context.scales`.
Private domains prevent coordinated guides, layers, focus, and views.
Source: `docs/reference/custom-extensions.md`; archived custom-mark notes
### HIGH Conflating interaction and scale values
Wrong:
```ts
createMark<Datum, PointX, PointY>(initialize)
```
Correct:
```ts
createMarkWithScaleValues<Datum, PointX, PointY, ScaleX, ScaleY>(initialize)
```
Use the exceptional factory when an interval or layout focuses one semantic value but materializes different endpoint types on its scales.
Source: `API-FRICTION.md` F-094; `docs/reference/types.md`
### HIGH Running side effects in resolved layout
Wrong: update application state, mutate cached rows, allocate a persistent controller, or read external changing state from `resolveLayout`.
Correct: derive the returned layout solely from inputs and capture local derived rows in its render closure.
Margin and responsive solving may evaluate the callback repeatedly.
Source: hexbin and Sankey references
### HIGH Tension: rich interaction versus portable rendering
Custom DOM behavior is easy to prototype but breaks renderer parity. Prefer renderer-neutral points, focus guides, controls, and semantic application state; isolate platform code in the host seam.
See also: `build-chart-interactions/SKILL.md` and `ship-accessible-charts/SKILL.md`
## References
- [Extension protocol matrix](references/extension-protocols.md)
See also: `compose-marks-and-views/SKILL.md` and `debug-and-verify-charts/SKILL.md` — justify extensions against native composition and verify them across renderer boundaries.Colle ce Markdown dans ton agent ou utilise les boutons ci-dessus pour l’écrire dans ton projet.
Ce que fait Extend Tanstack Charts (TanStack)
[Extension protocol matrix](references/extension-protocols.md)
Comment utiliser Extend Tanstack Charts (TanStack)
1
Copie le prompt
Un clic copie le prompt packagé (ou l'envoie à ton agent).
2
L'agent installe le skill
Il ajoute le SKILL.md et ses ressources à ton projet.
3
Activation automatique
Le skill s'active dès que le contexte correspond.
Déclencheurs pour Extend Tanstack Charts (TanStack)
Dis simplement à ton agent quelque chose comme :
Applique le skill extend-tanstack-charts__tanstack-charts__packages-charts-core-skills-6eaef827489e à cette tâche
Utilise extend-tanstack-charts__tanstack-charts__packages-charts-core-skills-6eaef827489e pour améliorer cette implémentation
Passe en revue ce sujet avec extend-tanstack-charts__tanstack-charts__packages-charts-core-skills-6eaef827489e
Skills liés à Extend Tanstack Charts (TanStack)
Acceleration (Microsoft)
Compare synthetic acceleration options and clearly separate scenario value from forecast commitments.Account Overview (Microsoft)
Create a synthetic Acme account overview and identify evidence that merits seller attention.Acroform Writer (Microsoft)
Use this skill whenever the user wants values written INTO an existing PDF form that lives in the connected SharePoint knowledge source — filling out, completing, populating, or submitting a fillable PDF (application, intake sheet, contract, government form) from data they supply, a spreadsheet row, or the conversation. Triggers include "fill out the job application form", "complete the intake form for [person]", "populate our standard NDA template", and "make this ready to send / non-editable" (flatten). The source form should be found via knowledge search; only ask the user to upload it if knowledge search turns up nothing plausible. different task), and do NOT use it on scanned/image-only PDFs that have no real fillable fields — those need OCR or manual overlay instead, which this skill explicitly detects and reports rather than silently failing.