Skip to content

Conversation

Qxisylolo
Copy link
Contributor

Description

this pr adds bar gauge

Screenshot

2025-10-09.16.27.59.mov

Testing the changes

Changelog

  • feat: add bar gauge

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

Signed-off-by: Qxisylolo <[email protected]>
Signed-off-by: Qxisylolo <[email protected]>
Copy link

codecov bot commented Oct 9, 2025

Codecov Report

❌ Patch coverage is 75.80645% with 30 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.20%. Comparing base (67890d6) to head (1f33027).
⚠️ Report is 23 commits behind head on main.

Files with missing lines Patch % Lines
.../components/visualizations/theme/default_colors.ts 6.66% 14 Missing ⚠️
...mponents/visualizations/bar_gauge/to_expression.ts 79.16% 0 Missing and 10 partials ⚠️
...visualizations/bar_gauge/bar_gauge_vis_options.tsx 76.47% 4 Missing ⚠️
...onents/visualizations/bar_gauge/bar_gauge_utils.ts 95.23% 0 Missing and 1 partial ⚠️
...ublic/components/visualizations/rule_repository.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10697      +/-   ##
==========================================
+ Coverage   60.18%   60.20%   +0.01%     
==========================================
  Files        4428     4449      +21     
  Lines      118504   119063     +559     
  Branches    19456    19621     +165     
==========================================
+ Hits        71320    71677     +357     
- Misses      42265    42437     +172     
- Partials     4919     4949      +30     
Flag Coverage Δ
Linux_1 26.62% <ø> (-0.04%) ⬇️
Linux_2 38.82% <ø> (-0.01%) ⬇️
Linux_3 38.67% <ø> (-0.04%) ⬇️
Linux_4 32.92% <75.80%> (?)
Windows_1 26.63% <ø> (-0.04%) ⬇️
Windows_2 38.80% <ø> (-0.01%) ⬇️
Windows_3 38.68% <ø> (-0.04%) ⬇️
Windows_4 32.92% <75.80%> (+0.30%) ⬆️

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

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Qxisylolo Qxisylolo changed the title [Explore vis]Feat/add bar gauge [Explore Vis]Feat/add bar gauge Oct 9, 2025
data: { values: transformedData },
layer: layers,
// Add legend configuration if needed, or explicitly set to null if disabled
legend: styles.addLegend
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: why this is removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just cleaning, legend should be controlled by encoding.color, I cleaned some when I was doing global thresholds, I missed to clean this one.

encoding: {
[`${symbolOpposite(styleOptions.exclusive.orientation, 'y')}`]: {
type: 'quantitative',
field: 'maxVal',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maxVal of unfilled bar should take styleOptions.max into consider


export const DEFAULT_GREY = '#d3d3d3';

export const getUnfilledArea = () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this function to /bar_gauge because it's bar gauge specific

return '#f1f1f1ff';
};

export const darkenColor = (hex: string, degree = 1) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function doesn't seem belong to theme folder, consider to move it to /utils

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants