cirq_web.widget.Widget
Abstract class for all widgets.
cirq_web.widget.Widget()
Methods
generate_html_file
View source
generate_html_file(
output_directory: str = './',
file_name: str = 'bloch_sphere.html',
open_in_browser: bool = False
) -> str
Generates a portable HTML file of the widget that can be run anywhere.
Prints out the absolute path of the file to the console.
Args |
output_directory
|
the directory in which the output file will be
generated. The default is the current directory ('./')
|
file_name
|
the name of the output file. Default is 'bloch_sphere'
|
open_in_browser
|
if True, opens the newly generated file automatically in the browser.
|
Returns |
The path of the HTML file in as a Path object.
|
get_client_code
View source
get_client_code() -> str
Returns HTML code to render the widget.
View source
get_widget_bundle_name() -> str
Returns the name of the Javascript library file for this widget.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-06-27 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{"lastModified": "Last updated 2024-06-27 UTC."}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-06-27 UTC."],[],[]]