Changelog
v0.0.159
<Axis />
components now use @vx/text
to render tick labels. This enables multi line labels and scaling text to fit in a certain amount of space. #260Example:
<Axis
{...axisProps}
tickLabelProps = (tickValue, index) => ({
textAnchor: 'middle',
verticalAnchor: 'middle',
width: 100,
scaleToFit: true
})
/>
<Axis />
components got a new prop tickComponent
to enable rendering of custom ticks. With this prop one can completely customize ticks without having to create a new custom <Axis />
component. #260Example:
<Axis
{...axisProps}
tickComponent={({ x, y, formattedValue }) => (
<g>
<circle cx={x} cy={y} r={2} fill='rebeccapurple' />
<text x={x + 4} y={y}>{formattedValue}</text>
</g>
)}
/>
tickComponent
accepts a function and gets called with the following attribute:
tickComponent({ x, y, formattedValue, ...tickLabelPropsObj })
@vx/axis
documentation. #260@vx/text
package. #257Changes:
- @vx/axis: 0.0.158 => 0.0.159
- @vx/demo: 0.0.158 => 0.0.159
- @vx/text: 0.0.153 => 0.0.159
- @vx/vx: 0.0.158 => 0.0.159
Changelog
v0.0.139
<Stack />
for streamgraphs and other fun + exciting things #153Changes:
- @vx/annotation: 0.0.136 => 0.0.139
- @vx/axis: 0.0.138 => 0.0.139
- @vx/demo: 0.0.138 => 0.0.139
- @vx/grid: 0.0.136 => 0.0.139
- @vx/hierarchy: 0.0.138 => 0.0.139
- @vx/legend: 0.0.136 => 0.0.139
- @vx/marker: 0.0.136 => 0.0.139
- @vx/shape: 0.0.136 => 0.0.139
- @vx/vx: 0.0.138 => 0.0.139