Comments (2)
1. Outlier detection
I think one problem we have is that our sample size is small. If we were to autosize at a different part of the grid, that value would not be considered an outlier anymore:
![](https://private-user-images.githubusercontent.com/1423607/270460944-d4899069-1fa6-42ed-bcad-8ff462980211.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTY1MDEzNDUsIm5iZiI6MTcxNjUwMTA0NSwicGF0aCI6Ii8xNDIzNjA3LzI3MDQ2MDk0NC1kNDg5OTA2OS0xZmE2LTQyZWQtYmNhZC04ZmY0NjI5ODAyMTEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDUyMyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA1MjNUMjE1MDQ1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9M2IxZjY4NTJhMTY4NmNiM2RiZDQ4ZGEzOTVkNTQ4MTljNzRiNjRmMDE5YmVhYjQwMDEzYzY5MjU3NTBlOWVkYiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.Rg2eEWC3XSWb8s8Z1MMacpNzfXKMJ9gPPlCoyQCZVNM)
I'm not sure how to settle this one. I still feel like the current formula is going to work better for a wider range of cases. We can always find in-between cases where it gives worse results than a different formula, but it's not really clear cut. I think for this particular example, it looks particularly off because we know what the rendered widgets look like and we'd expect the grid to fit them perfectly, but imagine that same column just as text. Would it look as off if it was pure text?
I also think the tradeoffs between wasted space & information display are going to vary depending on the data itself. The more importance a column has, the less acceptable it would be to the user to crop outliers.
I think maybe we could explore making autosizing configurable by column? With some columns accepting different factors/formulas? I feel that this is a bit early though, if we could collect a bit more feedback we might have a clearer answer.
2. Missing a few pixels
Yeah I did it with .getBoundingClientRect
initially but we decided to switch to .scrollWidth
for performance reasons. We'll switch back to the first implementation in light of this information.
Discussion: #10180 (comment)
from mui-x.
I also think the tradeoffs between wasted space & information display are going to vary depending on the data itself. The more importance a column has, the less acceptable it would be to the user to crop outliers.
I think maybe we could explore making autosizing configurable by column? With some columns accepting different factors/formulas? I feel that this is a bit early though, if we could collect a bit more feedback we might have a clearer answer.
@romgrk Right, so if we were to list options:
A. What you referenced above could make sense. In Notion, you can wrap vs. unwrap columns depending on the data (really useful), so why not have the same but for developers (not end-users)
![Screenshot 2023-10-08 at 17 58 15](https://private-user-images.githubusercontent.com/3165635/273459660-ed359fa3-5406-48db-9ebe-5c02e6e5b1bd.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTY1MDEzNDUsIm5iZiI6MTcxNjUwMTA0NSwicGF0aCI6Ii8zMTY1NjM1LzI3MzQ1OTY2MC1lZDM1OWZhMy01NDA2LTQ4ZGItOWViZS01YzAyZTZlNWIxYmQucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDUyMyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA1MjNUMjE1MDQ1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ODU2NGU0NWFhNzVmN2Q1NjlkMDcyZGViNTMyYzMwMWQ2Yjg2MDI0ZGM0MTUxYTZkYjQxY2ZiNzg3NzFmMWMwOSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.aB7-JOzUyvnqMSLps2p-OntPmN55hb84X04-yRaN2Xc)
B. In Excel or Google Sheets, I'm not aware there is outlier detection logic when resizing columns: it resizes (though there is a max width). So it could be an opt-in behavior rather than an opt-out like today. I don't feel I would configure this per column but more keep it disabled by default as it feels unpredictable. There, I would likely need a default max-width value, like what's the point of a column that is >2,000px wide? To consider if a max width should be shared with resizing and autolayout or distinct: https://mui.com/x/react-data-grid/column-dimensions/#minimum-width.
C. We could have a less sensitive threshold, but wouldn't really solve the problem here when there is a select type column.
D. We could have the filtering logic based on how many pixels are allowed between p50 and p100. Anchored around #10180 (comment) rationale.
E. We measure more rows, allowing for a more reliable percentile measurement. But even then, it doesn't feel like it would solve the problem. If all the select have the same width, except for one that is 5px larger, current logic would consider it an outlier ❌. I mean, I make the assumption that in such a case Q3 = Q1. and the formula, cut it: Q3 + (Q3 - Q1 width) * 1.5
from mui-x.
Related Issues (20)
- [code-infra] "pnpm test" works poorly HOT 4
- [data grid] pageSize is reset to zero with enabled autoPageSize and there is enough room on the page for a larger page size HOT 5
- How can I write a controlled filter for a boolean field? HOT 1
- [question] valueFormatter does not work in DataGridPremium, but it works in DataGrid. HOT 2
- [data grid] Column autosizing calculated on old data instead of new data
- [data grid] My print export is failing with 'MIME type ('text/html') is not a supported stylesheet MIME type' and 'rows must have unique ids' on export customization HOT 4
- [DataGrid] cell content not consistently center aligned HOT 4
- [tree view] Checkbox in the Rich tree view HOT 2
- [data grid] Commas in exported files are not handled correctly if value is in array HOT 2
- [data grid] Print function not working with grouping HOT 3
- [charts] Border radius on bar chart: alternative when bars are stacked? HOT 2
- [data grid] Is there a way to update a single ColDef without triggering a re-render of every cell? HOT 5
- [data grid] Column resizing not working with special characters in column names HOT 1
- [data grid] Clicking a focusable <g> element throws an error in the table after sorting a column DESC HOT 2
- [data grid] Aggregation values do not update if column definitions update HOT 6
- [question] How can I render a specific value in an Autocomplete component differently?
- [charts] Bad performance when using large datasets HOT 8
- [pickers] Changing locale between a monday-first or sunday-first language breaks indicated order of weekdays HOT 5
- [fields] hitting "enter" on keyboard does not submit HTML form HOT 5
- GroupingValueGetter function signature change seems wrong in the v6 to v7 migration guide HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mui-x.