Skip to content

Conversation

@douglas-raillard-arm
Copy link
Contributor

  • Remove duplicated setting of Rectangles options
  • Make Segments default to black, like all the other "line-only" shapes
  • Make Rectangles use the default color cycle

Fixes #4981

# Geometries
options.Rectangles = Options('style', line_color='black')
options.Rectangles = Options('style', color=Cycle(), cmap=dflt_cmap, line_color='black')
options.Segments = Options('style', color='black', cmap=dflt_cmap)
Copy link
Member

Choose a reason for hiding this comment

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

What's the motivation for having one of these be a cycle and the other be a fixed color?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It looked like all the other "line-only" things like Segments are drawn in black, like error bars. I suppose it depends on the main use case.

For the Rectangles, I suppose it is an oversight when it was added, as the options were set twice with different values. Polygons sets a facecolor as well. OTH, things like Ellipse do not have any filling by default, so maybe Rectangles should also default to border-only in black.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The current behavior is not aligned to anything else I tried though, since it is filled by default with blue. Elements like Ellipse are not filled by default at all.

* Remove duplicated setting of Rectangles options
* Make Segments default to black, like all the other "line-only" shapes
* Make Rectangles use the default color cycle

Fixes holoviz#4981
@douglas-raillard-arm
Copy link
Contributor Author

As I went through my workarounds, I realized this was still open. @jbednar This rebases cleanly on main.

@hoxbro hoxbro changed the title Fix Rectangles and Segments color fix: Rectangles and Segments color Mar 17, 2025
@codecov
Copy link

codecov bot commented Mar 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.80%. Comparing base (99d3528) to head (95efdf8).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5014   +/-   ##
=======================================
  Coverage   88.79%   88.80%           
=======================================
  Files         323      323           
  Lines       68960    68958    -2     
=======================================
- Hits        61236    61235    -1     
+ Misses       7724     7723    -1     

☔ 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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rectangles do not use default color cycle

4 participants