Skip to content

Modify template generator to automatically add new map traces and subplots #4881

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 22, 2024

Conversation

archmoj
Copy link
Contributor

@archmoj archmoj commented Nov 14, 2024

Resolves #4879.

See #4879 for discussion.

  1. Move material from packages/python/plotly/templategen/__init__.py to new file packages/python/plotly/templategen/__main__.py so that we can run python -m templategen from the packages/python/plotly directory.
  2. Modify packages/python/plotly/templategen/utils/__init__.py to change heatmapgl reference to heatmap.
  3. Run python -m templategen to generate new versions of the following files:
    • packages/python/plotly/plotly/package_data/templates/ggplot2.json
    • packages/python/plotly/plotly/package_data/templates/plotly.json
    • packages/python/plotly/plotly/package_data/templates/plotly_dark.json
    • packages/python/plotly/plotly/package_data/templates/plotly_white.json
    • packages/python/plotly/plotly/package_data/templates/seaborn.json
    • packages/python/plotly/plotly/package_data/templates/simple_white.json

gvwilson and others added 2 commits November 14, 2024 17:04
See #4879 for discussion.

1.  Move material from `packages/python/plotly/templategen/__init__.py` to new file `packages/python/plotly/templategen/__main__.py` so that we can run `python -m templategen` from the `packages/python/plotly` directory.
2.  Modify `packages/python/plotly/templategen/utils/__init__.py` to change `heatmapgl` reference to `heatmap`.
3.  Run `python -m templategen` to generate new versions of the following files:
    -   `packages/python/plotly/plotly/package_data/templates/ggplot2.json`
    -   `packages/python/plotly/plotly/package_data/templates/plotly.json`
    -   `packages/python/plotly/plotly/package_data/templates/plotly_dark.json`
    -   `packages/python/plotly/plotly/package_data/templates/plotly_white.json`
    -   `packages/python/plotly/plotly/package_data/templates/seaborn.json`
    -   `packages/python/plotly/plotly/package_data/templates/simple_white.json`
@gvwilson
Copy link
Contributor

does this replace #4880 ?

@gvwilson gvwilson added P1 needed for current cycle fix fixes something broken labels Nov 15, 2024
@emilykl
Copy link
Contributor

emilykl commented Nov 19, 2024

@archmoj @gvwilson Looks good.

Do we have any automated way of testing that these templates are working as expected?

@gvwilson
Copy link
Contributor

The only way I can think of to test the templates themselves is to add something that parses the JSON and looks at the structure, but I don't think that would add much value, since it would basically be cloning the generator code.

Copy link
Collaborator

@alexcjohnson alexcjohnson left a comment

Choose a reason for hiding this comment

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

💃

Copy link
Contributor

@emilykl emilykl left a comment

Choose a reason for hiding this comment

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

🚀

@archmoj archmoj merged commit 0a4f0a0 into master Nov 22, 2024
5 checks passed
@archmoj archmoj deleted the add-new-traces-to-templategen branch November 22, 2024 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix fixes something broken P1 needed for current cycle
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add scattermap and map to plotly.py templates similar to scattermapbox and mapbox
4 participants