-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
DOC [PST] FIX/RFC machine learning map #28630
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
DOC [PST] FIX/RFC machine learning map #28630
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not desired. Sadly I think Edit: I think I've figured out a way to limit the pan. I will update when I get some time to test. |
Okay so this new version limits the pan. It relies on Choosing.the.right.estimator.scikit-learn.1.5.dev0.documentation.8.-.-.Microsoft.Edge.2024-03-15.20-38-20.mp4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I'll let @thomasjpfan or @ogrisel have another look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good! I left a comment about including the license of the vendoered svg-pan-zoom
.
License added! |
Please note that this PR targets the
new_web_theme
branch!Towards #28084. Check the rendered docs here.
Prior to this PR the machine learning map is a PNG image and the links on the nodes are realized using the
<map>
component. However the<map>
requires hard-coded positions and will not automatically scale as the width and height of the image changes. The only way is to usetransform: scale(xxx)
. The problem with this is:transform
does not change width and height so the image will still take up that much space on the page. The solution prior to this PR was to useposition: absolute
but this will breakpydata-sphinx-theme
.The solution of this PR is to use SVG+XML, which natively allows links so there is no need for
<map>
and no problem of image scaling. The chart is created using draw.io, and to modify the chart one simplify import the chart into draw.io, make changes, and re-export.This PR also supports zoom on wheel and pan on drag when JavaScript is available using svg-pan-zoom-container. It also supports dark mode by inverting the colors and rotating the hues.
I've tried my best to simulate the original chart. The nodes and their layout are also the same, but I don't know how to create irregular shapes in draw.io so I used the rounded rectangles for the four main blocks instead.
Choosing.the.right.estimator.scikit-learn.1.5.dev0.documentation.9.-.-.Microsoft.Edge.2024-03-15.02-44-49.mp4