-
Notifications
You must be signed in to change notification settings - Fork 326
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
Table viz column header tooltip extended to add data quality stats #11520
Conversation
…sualization.enso Co-authored-by: Radosław Waśko <[email protected]>
…sualization.enso Co-authored-by: Gregory Michael Travis <[email protected]>
…//github.com/enso-org/enso into wip/mk/add-data-quality-indicators-null-vals
…ization.vue Co-authored-by: Kaz Wesley <[email protected]>
…//github.com/enso-org/enso into wip/mk/add-data-quality-indicators-null-vals
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.
Looks good, some minor comments
app/gui/src/project-view/components/visualizations/TableVisualization.vue
Outdated
Show resolved
Hide resolved
@@ -391,7 +316,7 @@ function addRowIndex(data: object[]): object[] { | |||
return data.map((row, i) => ({ [INDEX_FIELD_NAME]: i, ...row })) | |||
} | |||
|
|||
function toField(name: string, valueType?: ValueType | null | undefined): ColDef { | |||
function toField(name: string, index?: number, valueType?: ValueType | null | undefined): ColDef { |
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.
Because this function has multiple optional parameters, passing an options object containing the optional values as fields could make its call sites easier to read.
The parameters could also use some documentation: It's not obvious when index
is expected to be present or what happens if its absent.
!(dataQuality.number_of_whitespace && dataQuality.number_of_whitespace[index]) | ||
: true | ||
|
||
const hideDataQuality = nothingIsZeroOrNull && whitespaceIsZeroOrNull |
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.
I like to stick to the JS convention that "value absent" is falsy and "value present" is truthy--in this case that would mean inverting the logic of this and its sub-computations, like:
const showDataQuality = nothingIsNonZero || whitespaceIsNonZero
app/gui/src/project-view/components/visualizations/TableVisualization.vue
Outdated
Show resolved
Hide resolved
<div style="visibility: ${getVisibility(params.numberOfNothing)};"> | ||
Nulls/Nothing: ${getPercentage(params.numberOfNothing)}% ${createIndicator(+getPercentage(params.numberOfWhitespace))} | ||
</div> |
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.
I think I'd hide this with display:none
rather than visibility:hidden
--if we leave a gap when the value is 0 or not applicable, I don't think it would be obvious why the gap is present.
`<span style='display:flex; flex-direction:row; justify-content:space-between; width:inherit;'><span ref="eLabel" class="ag-header-cell-label" role="presentation" style='display:flex; flex-direction:row; justify-content:space-between; width:inherit;'> ${name} </span> ${menu} ${sort} ${getSvgTemplate(icon)} ${svgTemplateWarning}</span>` | ||
: `<span ref="eLabel" style='display:flex; flex-direction:row; justify-content:space-between; width:inherit;'>${name} ${menu} ${sort} ${svgTemplateWarning}</span>` |
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.
These template lines are getting long. It would help to move some of the styling into classes.
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
TypeScript,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
or the Snowflake database integration, a run of the Extra Tests has been scheduled.