-
Notifications
You must be signed in to change notification settings - Fork 41
Allows for createPart to be used to craft parts to be utilized with withPart
#428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allows for createPart to be used to craft parts to be utilized with withPart
#428
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It added 1kb, I could see it as worth it.
KoolADE85
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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