How to use sparklines in AG Grid with observablehq?

104 Views Asked by At

A couple of months ago, I created an observablehq based AG Grid table with sparklines. Recently, the sparklines stopped working, and I am not sure why. Here is a notebook with an example that used to work, but is not working anymore. The third column, Rate of Change, is supposed to contain sparklines.

I previously loaded AG Grid with AgGrid = require('ag-grid-enterprise/dist/ag-grid-enterprise.js'), but this generates an error now so I changed it to AgGrid = require('https://cdn.jsdelivr.net/npm/[email protected]/dist/ag-grid-enterprise.min.js'), which seems to be working for the grid, but does not render the sparklines. I do not know why the former require call no longer works. When I inspect the devtools, it says AG Grid: Looking for component [agSparklineCellRenderer] but it wasn't found. so apparently the sparkline module is not imported correctly.

1

There are 1 best solutions below

0
Jakub.Novotny On BEST ANSWER

This should work.

AgGrid = require("[email protected]/dist/ag-grid-enterprise.js")