Extensions add functionality to Ax, usually for the purpose of integrating third-party libraries.
See the installation page for instructions on how to load extensions.
ax((a, x) => x.chartjs({
canvasTag: {height: '150px'},
type: 'horizontalBar',
data: {
labels: ['Red', 'Blue', 'Green'],
datasets: [{
data: [12, 19, 3],
backgroundColor: ['red', 'blue', 'green'],
}]
},
options: {
legend: {display: false},
maintainAspectRatio: false,
}
}));
ax((a, x) => x.xtermjs({
divTag: {style: {height: '100px'}},
text: 'Hello from \x1B[1;3;31mxterm.js\x1B[0m\r\n'
}));
ax((a, x) => x.codemirror({
value: 'let i = 0;\n',
lineNumbers: true,
mode: 'javascript'
}));