-
Notifications
You must be signed in to change notification settings - Fork 98
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
Add ability to save the Resource Estimator space-time diagram as a file (png/jpg/svg) #1063
Comments
CONTRIBUTORS PLEASE READ Welcome! Here are some details to get you started. Detailed issue descriptionThis feature can be implemented either in the VS Code Resource Estimation panel, or in the VS Code
Jupyter notebooks The estimation-factoring.ipynb sample notebook in the repo contains an example of a space-time diagram from The requested feature is a button, a right-click menu item, or some other mechanism that allows you to save or download this image as a file. PNG would be ideal, JPG or SVG could work too. Getting startedPlease take a look through our README to orient yourself in the repo and find instructions on how to build. For this issue, you'll want to have a working knowledge of JavaScript and HTML. The fix will likely be entirely implemented in TypeScript. The Resource Estimator space-time diagram is implemented in the below React component: We're happy to accept a fix to either the VS Code version of this panel or the Python widget version. To build and launch the VS Code extension locally see qsharp/vscode/BUILDING.md To build the Python widgets, see the qsharp/widgets/readme.md . TestingTest your fix manually by building & running the VS Code extension and/or Python widgets as described. Before you submit a pull request please run ReviewsPlease ensure your code is tested, clean and well refactored before opening a pull request. If you're not sure, feel free to open a draft PR for preliminary feedback. It would really help if you include a GIF of your feature working in your PR description. Once you have published your PR, the codeowners will automatically get tagged and we'll review shortly. If you need clarification on an issue please tag @minestarks with your questions. |
@nirajvenkat I want to assign this issue to you (for unitaryhack). Could you please comment on this issue so GitHub will let me assign to you? |
Sure! |
Submission for Unitary Hack issue: fixes #1063 This change adds the ability to save the resource estimates diagram locally as a PNG. For this I added a new dependency called `html2canvas` that takes a DOM and renders it to an image. This currently works only on IPython `qsharp-widgets`, could be extended to the VSCode version. Additionally we take into account the color theme within VSCode (which is provided in the stylesheet `qsharp-ux.css`) and this is passed in as the background color for rendering. Tested on (dark/light) Modern VSCode themes. https://github.com/microsoft/qsharp/assets/3744263/898de6d9-fba4-4fea-b729-a3bb698dc51c ~Current issues:~ - ~This button is placeholder, nicer version: microsoft/vscode-notebook-renderers#118 - ~Saved imaged is slightly truncated at the bottom~ --------- Co-authored-by: Mine Starks <[email protected]>
@nirajvenkat it doesn't look like you registered for the event. Send me an email at [email protected] if you want the bounty! |
This would not work in VS Code but we can consider Jupyter notebook and other scenarios
The text was updated successfully, but these errors were encountered: