Skip to content

Latest commit

 

History

History
57 lines (48 loc) · 1.25 KB

extensions.md

File metadata and controls

57 lines (48 loc) · 1.25 KB

Index

Extensions

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'
}));

Prev: Shorthand Next: Properties