Skip to content
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

Remove Datagrid dependency #118

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

b-yogesh
Copy link
Collaborator

This PR removes the @mui/x-data-grid from peerDependencies as it is quite large and it can be installed by the user if required as a plugin. The Provider's guide is also updated in this PR showing the user how to use DataGrid.

@b-yogesh b-yogesh self-assigned this Mar 20, 2025
Copy link

codecov bot commented Mar 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.64%. Comparing base (03a31d9) to head (fb8bc70).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #118   +/-   ##
=======================================
  Coverage   92.64%   92.64%           
=======================================
  Files          85       85           
  Lines        1481     1481           
  Branches      222      222           
=======================================
  Hits         1372     1372           
  Misses         91       91           
  Partials       18       18           
Flag Coverage Δ
backend 100.00% <100.00%> (ø)
frontend 84.53% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@b-yogesh b-yogesh marked this pull request as ready for review March 20, 2025 15:41
@b-yogesh b-yogesh requested a review from forman March 20, 2025 15:41
Define a plugin function that integrates DataGrid with Chartlets.

```typescript
import { DataGrid } from "chartlets/packages/lib/src/plugins/mui/DataGrid";
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am just not sure about this import line. When I tested it in xcube-viewer, it was imported like the following:
import { DataGrid } from "../../../chartlets/chartlets.js/packages/lib/src/plugins/mui/DataGrid";
What do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh right, overlooked it. This wont work!

Copy link
Member

@forman forman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

@b-yogesh b-yogesh requested a review from forman March 20, 2025 16:14
@@ -44,6 +44,11 @@
"types": "./dist/plugins/vega/index.d.ts",
"module": "./dist/vega-plugin.js",
"require": "./dist/vega-plugin.cjs"
},
"./datagrid": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"./datagrid": {
"./mui/datagrid": {

Define a plugin function that integrates DataGrid with Chartlets.

```typescript
import { DataGrid } from "chartlets/DataGrid";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Components should be default export:

Suggested change
import { DataGrid } from "chartlets/DataGrid";
import DataGrid from "chartlets/DataGrid";

@@ -40,6 +40,7 @@ export default defineConfig({
chartlets: resolve(__dirname, "src/index.ts"),
"mui-plugin": resolve(__dirname, "src/plugins/mui/index.ts"),
"vega-plugin": resolve(__dirname, "src/plugins/vega/index.ts"),
datagrid: resolve(__dirname, "src/plugins/mui/DataGrid.tsx"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
datagrid: resolve(__dirname, "src/plugins/mui/DataGrid.tsx"),
"mui-plugin-datagrid": resolve(__dirname, "src/plugins/mui/DataGrid.tsx"),

@forman
Copy link
Member

forman commented Mar 20, 2025

Let's further discuss tomorrow!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants