Skip to content

feat: data bar render from API#1415

Merged
ethanalvizo merged 12 commits intodeephaven:mainfrom
ethanalvizo:1103-databar-cell-render
Oct 4, 2023
Merged

feat: data bar render from API#1415
ethanalvizo merged 12 commits intodeephaven:mainfrom
ethanalvizo:1103-databar-cell-render

Conversation

@ethanalvizo
Copy link
Copy Markdown
Contributor

@ethanalvizo ethanalvizo commented Jul 19, 2023

No specific ticket to close. Just alters the front-end to allow the new data from JSON API to be parsed and turned into a data bar

Works in tandem with this deephaven/deephaven-core#4181 from deephaven-core

Demo Code:

from deephaven import new_table
from deephaven.column import int_col, double_col, string_col

students = new_table([
    string_col("Name", ["Andy", "Claire", "Jane", "Steven"]),
    int_col("StudentID", [1, 2, 3, 4]),
    int_col("Threshold", [3, 3, 3, 3]),
    double_col("GPA", [-3.0, 4.0, 3.7, 2.8]),
    double_col("DirectionalAxis", [-3.0, 4.0, 3.7, 2.8]),
    double_col("MiddleAxis", [-3.0, 4.0, 3.7, 2.8]),
    double_col("OverlapPlacement", [-3.0, 4.0, 3.7, 2.8]),
    double_col("HidePlacement", [-3.0, 4.0, 3.7, 2.8]),
    double_col("RTLDirection", [-3.0, 4.0, 3.7, 2.8]),
    double_col("Markers", [-3.0, 4.0, 3.7, 2.8]),
    double_col("Markers2", [-3.0, 4.0, 3.7, 2.8]),
    double_col("Gradient", [-3.0, 4.0, 3.7, 2.8]),
])

data_bars = students.format_data_bar(column= "GPA", value_column= "GPA").format_data_bar(column="DirectionalAxis", value_column="DirectionalAxis", axis="directional").format_data_bar(column="MiddleAxis", value_column="MiddleAxis", axis="middle").format_data_bar(column="OverlapPlacement", value_column="OverlapPlacement", value_placement="overlap").format_data_bar(column="HidePlacement", value_column="HidePlacement", value_placement="hide").format_data_bar(column="RTLDirection", value_column="RTLDirection", direction="RTL").format_data_bar(column="Markers", value_column="Markers", marker_column="Threshold").format_data_bar(column="Markers2", value_column="Markers2", marker_column="StudentID", marker_color="#0000FF").format_data_bar(column="Gradient", value_column="Gradient", negative_color=["#FF0000", "#FFFF00"], positive_color=["#FFFF00", "#00FF00"])

Expected Output:

image

@ethanalvizo ethanalvizo self-assigned this Jul 19, 2023
Comment thread packages/iris-grid/src/IrisGridTableModelTemplate.ts Outdated
@ethanalvizo ethanalvizo requested a review from mofojed July 19, 2023 22:35
@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 19, 2023

Codecov Report

Patch coverage: 18.18% and no project coverage change.

Comparison is base (32e6d20) 46.42% compared to head (f87c45b) 46.42%.
Report is 7 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1415   +/-   ##
=======================================
  Coverage   46.42%   46.42%           
=======================================
  Files         558      556    -2     
  Lines       35706    35727   +21     
  Branches     8917     8921    +4     
=======================================
+ Hits        16576    16586   +10     
- Misses      19080    19091   +11     
  Partials       50       50           
Flag Coverage Δ
unit 46.42% <18.18%> (+<0.01%) ⬆️

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

Files Changed Coverage Δ
...io/src/styleguide/grid-examples/DataBarExample.tsx 100.00% <ø> (ø)
packages/grid/src/DataBarCellRenderer.ts 0.39% <0.00%> (+0.01%) ⬆️
packages/grid/src/DataBarGridModel.ts 0.00% <ø> (ø)
packages/grid/src/GridTheme.ts 100.00% <ø> (ø)
packages/iris-grid/src/IrisGridModel.ts 30.76% <0.00%> (-0.98%) ⬇️
packages/iris-grid/src/IrisGridTheme.ts 100.00% <ø> (ø)
...ckages/iris-grid/src/IrisGridTableModelTemplate.ts 46.28% <17.64%> (-0.50%) ⬇️
packages/iris-grid/src/IrisGridProxyModel.ts 67.43% <75.00%> (+0.08%) ⬆️

... and 7 files with indirect coverage changes

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

Comment thread packages/iris-grid/src/IrisGridTableModelTemplate.ts Outdated
Comment thread packages/jsapi-types/src/dh.types.ts Outdated
@ethanalvizo ethanalvizo requested a review from mofojed July 31, 2023 16:29
@ethanalvizo
Copy link
Copy Markdown
Contributor Author

ethanalvizo commented Jul 31, 2023

The prettier check is still failing after fixing the few files mentioned in the summary. So I fixed all of them but now the PR size is significantly larger. @mofojed this PR should probably go in after @bmingles PR where he makes all the style changes across community

Not sure if I can just rebase off main when that happens or if I need to revert the prettier commits I have in this branch

@bmingles
Copy link
Copy Markdown
Contributor

@ethanalvizo This should be addressed once PR #1430 merges

@ethanalvizo ethanalvizo enabled auto-merge (squash) August 17, 2023 20:09
@ethanalvizo ethanalvizo merged commit ee7d1c1 into deephaven:main Oct 4, 2023
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants