Code Monkey home page Code Monkey logo

Comments (2)

romgrk avatar romgrk commented on August 26, 2024 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:

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.

oliviertassinari avatar oliviertassinari commented on August 26, 2024

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

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.