AxisArrowNode might be a more appropriate use than ArrowNode since it does all the work for you.
AxisArrowNode extends ArrowNode and takes a chartTransform as an argument. The option field extension might be useful for your use case.
class AxisArrowNode extends ArrowNode {
private readonly chartTransform: ChartTransform;
private readonly value: number;
private readonly extension: number;
private readonly axisOrientation: Orientation;
private disposeAxisNode: () => void;
public constructor( chartTransform: ChartTransform, axisOrientation: Orientation, providedOptions?: AxisArrowNodeOptions ) {
const options = optionize<AxisArrowNodeOptions, SelfOptions, ArrowNodeOptions>()( {
value: 0, // by default the axis is at 0, but you can put it somewhere else
extension: 20,
// ArrowNode options
doubleHead: true,
headHeight: 10,
headWidth: 10,
tailWidth: 2
}, providedOptions );
...
While reviewing usages of modelViewTransform that could be converted to chartTransform, I came across this:
AxisArrowNode
might be a more appropriate use thanArrowNode
since it does all the work for you.AxisArrowNode
extendsArrowNode
and takes achartTransform
as an argument. The option fieldextension
might be useful for your use case.