Skip to content

Conversation

@hansthen
Copy link
Collaborator

During an earlier change, I noted that many MacroElement subclasses do not fully use the templating facilities of their parent class.

This PR makes the code more internally consistent by using the template route where possible. I skipped the DualMap, Vega and Vegalite classes because I do not fully understand what is happening there.

@hansthen hansthen requested a review from Conengmo January 27, 2025 07:09
Copy link
Member

@Conengmo Conengmo left a comment

Choose a reason for hiding this comment

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

Nice that you identified some areas where templates are not used in the default way. I added some comments to places that may require some more attention. If you could limit this PR to just the straight forward cases, it should be easy to merge. Then we can maybe look at the more complicated cases separately or leave them as is.

Earlier I noted many macroelements do not fully use
the facilities of Figure, but instead in render manipulate
the parent Figure.

Step 1: remove GlobalSwitches as Element
@hansthen hansthen force-pushed the cleanup_macroelements branch from f40bd8c to 0e9ef12 Compare March 16, 2025 21:32
@hansthen hansthen requested a review from Conengmo March 16, 2025 21:38
@hansthen
Copy link
Collaborator Author

Nice that you identified some areas where templates are not used in the default way. I added some comments to places that may require some more attention. If you could limit this PR to just the straight forward cases, it should be easy to merge. Then we can maybe look at the more complicated cases separately or leave them as is.

I made the requested changes.

Copy link
Member

@Conengmo Conengmo left a comment

Choose a reason for hiding this comment

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

Very nice cleanup!

"""
{% macro html(this, kwargs) %}
{% if this.export %}
<style>
Copy link
Member

Choose a reason for hiding this comment

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

this style element was originally added to the header. Here it's in the body. I guess it doesn't make a difference really, does it?

@hansthen hansthen merged commit c50ab41 into python-visualization:main Mar 22, 2025
11 checks passed
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.

2 participants