Conversation
|
Should the js grid be imported automatically so you don't have to do it like this in all the apps? app = Dash(
external_scripts=[
f'https://cdn.jsdelivr.net/npm/ag-grid-community@{dag.grid_version}/dist/ag-grid-community.min.js'
]
) |
src/lib/fragments/AgGrid.react.js
Outdated
| themeBalham, | ||
| themeMaterial, | ||
| themeQuartz, | ||
| createPart, |
There was a problem hiding this comment.
Since we already have ag-grid-community imported, it seems like we could avoid the requirement to download it as an external script by supplying it as context for the function?
import * as agGrid from 'ag-grid-community';
...
const context = {
...themes,
agGrid,
d3,
...etc
};
Then, in the app:
dagfuncs.customTheme = (theme, agGrid) => {
return theme.withPart(agGrid.createPart(agGrid.colorSchemeDark))
}
So basically, instead of cherry-picking createPart, we could just send over the entire agGrid api?
There was a problem hiding this comment.
agGrid could be community or it could be enterprise.
The attempt was to reduce the component size by not bloating it with everything available but only pulling the necessary things out. Not sure what the impact of this would be.
There was a problem hiding this comment.
It added 1kb, I could see it as worth it.
KoolADE85
left a comment
There was a problem hiding this comment.
This works well on my end!
AG Grid is looking for a specific type when using the
withPart, this allows a developer to create their own parts and configure properly for the grid to accept