Skip to content

Conversation

@chanlii
Copy link
Collaborator

@chanlii chanlii commented Dec 6, 2025

As title, migrate add_hrect from using annotation to label as source of truth to build annotation.
Unit test result:

PS C:\Users\licha\plotly.py> python -m pytest -q tests/test_optional/test_autoshapes/test_annotated_shapes.py -k annotated                                                                                                 
..........                                                                                                                                                                                                          [100%] 
==================================================================================================== warnings summary ====================================================================================================
tests/test_optional/test_autoshapes/test_annotated_shapes.py::test_add_annotated_shape_single_plot
tests/test_optional/test_autoshapes/test_annotated_shapes.py::test_add_annotated_shape_multi_plot
tests/test_optional/test_autoshapes/test_annotated_shapes.py::test_bad_annotation_position
tests/test_optional/test_autoshapes/test_annotated_shapes.py::test_position_order
tests/test_optional/test_autoshapes/test_annotated_shapes.py::test_annotation_position_override
tests/test_optional/test_autoshapes/test_annotated_shapes.py::test_default_annotation_positions
tests/test_optional/test_autoshapes/test_annotated_shapes.py::test_all_annotation_positions
  C:\Users\licha\plotly.py\plotly\basedatatypes.py:430: FutureWarning:

  annotation_* kwargs are deprecated; use label={...} to leverage Plotly.js shape labels.

tests/test_optional/test_autoshapes/test_annotated_shapes.py::test_all_annotation_positions
  C:\Users\licha\plotly.py\plotly\basedatatypes.py:4204: FutureWarning:

  annotation_bgcolor/annotation_bordercolor are not supported on shape.label and will be ignored; use label.font/color or a background shape instead.

tests/test_optional/test_autoshapes/test_annotated_shapes.py::test_all_annotation_positions
  C:\Users\licha\plotly.py\plotly\basedatatypes.py:4253: FutureWarning:

  annotation_bgcolor/annotation_bordercolor are not supported on shape.label and will be ignored; use label.font/color or a background shape instead.

tests/test_optional/test_autoshapes/test_annotated_shapes.py::test_all_annotation_positions
  C:\Users\licha\plotly.py\plotly\basedatatypes.py:4301: FutureWarning:

  annotation_bgcolor/annotation_bordercolor are not supported on shape.label and will be ignored; use label.font/color or a background shape instead.

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
10 passed, 10 warnings in 3.76s

Copy link
Collaborator

@nochinxx nochinxx 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

@nochinxx nochinxx merged commit eab6069 into main Dec 6, 2025
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.

3 participants