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

Table viz column header tooltip extended to add data quality stats #11520

Merged
merged 64 commits into from
Nov 14, 2024

Conversation

marthasharkey
Copy link
Contributor

data-qual-tooltip-bad-data
data-qual-tooltip-no-bad-data

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    TypeScript,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • Unit tests have been written where possible.
  • If meaningful changes were made to logic or tests affecting Enso Cloud integration in the libraries,
    or the Snowflake database integration, a run of the Extra Tests has been scheduled.
    • If applicable, it is suggested to paste a link to a successful run of the Extra Tests.

marthasharkey and others added 30 commits October 9, 2024 16:11
…sualization.enso

Co-authored-by: Gregory Michael Travis <[email protected]>
@marthasharkey marthasharkey marked this pull request as ready for review November 11, 2024 14:54
Copy link
Contributor

@kazcw kazcw left a 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

@@ -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 {
Copy link
Contributor

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
Copy link
Contributor

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

Comment on lines 37 to 39
<div style="visibility: ${getVisibility(params.numberOfNothing)};">
Nulls/Nothing: ${getPercentage(params.numberOfNothing)}% ${createIndicator(+getPercentage(params.numberOfWhitespace))}
</div>
Copy link
Contributor

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.

Comment on lines 373 to 374
`<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>`
Copy link
Contributor

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.

@jdunkerley jdunkerley added the CI: Keep up to date Automatically update this PR to the latest develop. label Nov 13, 2024
@jdunkerley jdunkerley added CI: No changelog needed Do not require a changelog entry for this PR. and removed CI: Keep up to date Automatically update this PR to the latest develop. labels Nov 13, 2024
@jdunkerley jdunkerley changed the title Draft- Table viz column header tooltip extended to add data quality stats Table viz column header tooltip extended to add data quality stats Nov 14, 2024
@jdunkerley jdunkerley added the CI: Ready to merge This PR is eligible for automatic merge label Nov 14, 2024
@mergify mergify bot merged commit 5b79f67 into develop Nov 14, 2024
36 checks passed
@mergify mergify bot deleted the wip/mk/make-data-quality-tooltip branch November 14, 2024 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR. CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants