Commit f066bf87 authored by Romain Casati's avatar Romain Casati
Browse files

Python3: plotly module added.

parent 476e9aee
......@@ -115,5 +115,83 @@
"sha256": "7930f720905e03ccd1e1d821db521bff7ec2ac9cf0ceb6552dd73d24a45d3b02",
"imports": ["setuptools_scm"],
"depends": ["packaging", "setuptools", "tomli", "typing-extensions"]
},
"fastjsonschema": {
"name": "fastjsonschema",
"version": "2.16.2",
"file_name": "https://files.pythonhosted.org/packages/e4/be/cf1b876348070a23cb0c3ebfee7a452ad3a91b07b456dade3bd514656009/fastjsonschema-2.16.2-py3-none-any.whl",
"install_dir": "site",
"sha256": "21f918e8d9a1a4ba9c22e09574ba72267a6762d47822db9add95f6454e51cc1c",
"imports": [
"fastjsonschema"
],
"depends": []
},
"jupyter-core": {
"name": "jupyter_core",
"version": "5.1.0",
"file_name": "https://files.pythonhosted.org/packages/ba/88/c829e2cef67fa173ab512a054d1ba7047c2559b311e9f9e7c55b0a9d8278/jupyter_core-5.1.0-py3-none-any.whl",
"install_dir": "site",
"sha256": "f5740d99606958544396914b08e67b668f45e7eff99ab47a7f4bcead419c02f4",
"imports": [],
"depends": [
"platformdirs",
"traitlets"
]
},
"nbformat": {
"name": "nbformat",
"version": "5.7.0",
"file_name": "https://files.pythonhosted.org/packages/5c/9f/957655d02f43b8bff77e6da08c94472b1229c13e7455bbd662163c9b78c0/nbformat-5.7.0-py3-none-any.whl",
"install_dir": "site",
"sha256": "1b05ec2c552c2f1adc745f4eddce1eac8ca9ffd59bb9fd859e827eaa031319f9",
"imports": [],
"depends": [
"fastjsonschema",
"jsonschema",
"jupyter-core",
"traitlets"
]
},
"platformdirs": {
"name": "platformdirs",
"version": "2.6.0",
"file_name": "https://files.pythonhosted.org/packages/87/69/cd019a9473bcdfb38983e2d550ccb239264fc4c2fc32c42ac1b1cc2506b6/platformdirs-2.6.0-py3-none-any.whl",
"install_dir": "site",
"sha256": "1a89a12377800c81983db6be069ec068eee989748799b946cce2a6e80dcc54ca",
"imports": [],
"depends": []
},
"plotly": {
"name": "plotly",
"version": "5.11.0",
"file_name": "https://files.pythonhosted.org/packages/8b/9c/b4a50d20b05dbf36abce70869d794fa1e2fc398af4ef91e20da5e5c288bd/plotly-5.11.0-py2.py3-none-any.whl",
"install_dir": "site",
"sha256": "52fd74b08aa4fd5a55b9d3034a30dbb746e572d7ed84897422f927fdf687ea5f",
"imports": [
"_plotly_future_",
"_plotly_utils",
"jupyterlab_plotly",
"plotly"
],
"depends": ["tenacity", "nbformat", "ipython"]
},
"tenacity": {
"name": "tenacity",
"version": "8.1.0",
"file_name": "https://files.pythonhosted.org/packages/a5/94/933ce16d18450ccf518a6da5bd51418611e8776b992070b9f40b2f9cedff/tenacity-8.1.0-py3-none-any.whl",
"install_dir": "site",
"sha256": "35525cd47f82830069f0d6b73f7eb83bc5b73ee2fff0437952cedf98b27653ac",
"imports": ["tenacity"],
"depends": []
},
"traitlets": {
"name": "traitlets",
"version": "5.7.0",
"file_name": "https://files.pythonhosted.org/packages/da/31/a4740b0177838e5b1b50478cff4de09e5373ba8e5ed0998ae045b42218df/traitlets-5.7.0-py3-none-any.whl",
"install_dir": "site",
"sha256": "61832ea7b7f910f5745e27e9bb269a181fd15af76027d99560299209d5b17c94",
"imports": [],
"depends": []
}
}
......@@ -355,3 +355,24 @@ def patch_drawSvg(drawSvg):
kernel.download(filename, self.asSvg())
drawSvg.Drawing.download = download
@importhook.on_import('plotly')
def patch_plotly(plotly):
import js
import os
import plotly.io as pio
# expose define and require
js.eval("""
window.define = window.requirejsVars?.define;
window.require = window.requirejsVars?.require;
""")
# do not use notebook_connected to save bandwidth
# (plotly.js already downloaded)
os.environ["PLOTLY_RENDERER"] = "notebook"
# activate the default renderer
# (don't really understand why this is needed)
pio.renderers[pio.renderers.default].activate()
["Bio", "CLAPACK", "IPython", "PIL", "RobotRaconteur", "__future__", "__main__", "_abc", "_aix_support", "_ast", "_bisect", "_bootsubprocess", "_bz2", "_codecs", "_collections", "_collections_abc", "_compat_pickle", "_compression", "_contextvars", "_frozen_importlib", "_frozen_importlib_external", "_functools", "_heapq", "_imp", "_io", "_json", "_locale", "_markupbase", "_operator", "_posixsubprocess", "_py_abc", "_pydecimal", "_pyio", "_pyodide", "_pyodide_core", "_random", "_sha512", "_signal", "_sitebuiltins", "_socket", "_sre", "_stat", "_string", "_strptime", "_struct", "_sysconfigdata__emscripten_wasm32-emscripten", "_thread", "_threading_local", "_warnings", "_weakref", "_weakrefset", "abc", "aifc", "antigravity", "argparse", "array", "asciitree", "ast", "astropy", "asynchat", "asyncio", "asyncore", "atexit", "atomicwrites", "attr", "autograd", "b2d", "base64", "basthon", "bdb", "binarytree", "binascii", "binhex", "bisect", "bitarray", "bleach", "bokeh", "boost_histogram", "branca", "brotli", "bs4", "builtins", "bz2", "cProfile", "cairosvg", "calendar", "certifi", "cffi", "cffi_example", "cftime", "cgi", "cgitb", "chunk", "cloudpickle", "cmd", "cmyt", "code", "codecs", "codeop", "collections", "colorspacious", "colorsys", "compileall", "concurrent", "configparser", "contextlib", "contextvars", "copy", "copyreg", "cpp-exceptions-test", "crypt", "cryptography", "cssselect", "csv", "ctypes", "cv2", "cycler", "cytoolz", "dataclasses", "datetime", "dateutil", "decimal", "decorator", "demes", "difflib", "dis", "distlib", "distutils", "doctest", "docutils", "drawSvg", "email", "encodings", "enum", "erfa", "errno", "filecmp", "fileinput", "filelock", "fnmatch", "folium", "fontTools", "fpcast_test", "fractions", "freesasa", "ftplib", "functools", "future", "galpy", "gc", "genericpath", "geos", "getopt", "getpass", "gettext", "glob", "gmpy2", "google", "graphlib", "graphviz", "gsw", "gzip", "hashlib", "heapq", "hmac", "html", "html5lib", "http", "imageio", "imaplib", "imghdr", "imp", "importlib", "iniconfig", "inspect", "io", "ipaddress", "ipythonblocks", "itertools", "jedi", "jinja2", "joblib", "js", "json", "jsonschema", "keyword", "kiwisolver", "lazy_object_proxy", "libmagic", "linecache", "locale", "logbook", "logging", "lolviz", "lxml", "lzma", "magic", "mailbox", "mailcap", "markupsafe", "marshal", "math", "matplotlib", "micropip", "mimetypes", "mne", "modulefinder", "more_itertools", "mpl_toolkits", "mpmath", "msgpack", "msprime", "multiprocessing", "netrc", "networkx", "newick", "nlopt", "nltk", "nntplib", "nose", "ntpath", "nturl2path", "numbers", "numcodecs", "numpy", "opcode", "openssl", "operator", "optlang", "optparse", "os", "osmiter", "p5", "packaging", "pandas", "parso", "pathlib", "patsy", "pdb", "pickle", "pickletools", "pipes", "pkg_resources", "pkgconfig", "pkgutil", "platform", "plistlib", "pluggy", "poplib", "posix", "posixpath", "pprint", "profile", "proj4py", "pstats", "pty", "py", "py_compile", "pyclbr", "pyclipper", "pycparser", "pydantic", "pydoc", "pydoc_data", "pygments", "pylab", "pyodide", "pyodide_js", "pyparsing", "pyproj", "pyroutelib3", "pyrsistent", "pysat", "pytest", "pytest_benchmark", "python_solvespace", "pytz", "pywt", "qrcode", "queue", "quopri", "random", "rcviz", "re", "rebound", "reboundx", "regex", "reprlib", "requests", "retrying", "rlcompleter", "ruamel", "runpy", "sched", "scipy", "secrets", "select", "selectors", "setuptools", "setuptools_scm", "shapely", "sharedlib-test", "sharedlib_test", "shelve", "shlex", "shutil", "signal", "site", "six", "skimage", "sklearn", "smtpd", "smtplib", "sndhdr", "socket", "socketserver", "soupsieve", "sparseqr", "sqlalchemy", "sqlite3", "sre_compile", "sre_constants", "sre_parse", "ssl", "stat", "statistics", "statsmodels", "string", "stringprep", "struct", "subprocess", "suitesparse", "sunau", "svgwrite", "swiglpk", "sympy", "symtable", "sys", "sysconfig", "tabnanny", "tarfile", "tblib", "telnetlib", "tempfile", "termcolor", "test", "textwrap", "this", "threading", "threadpoolctl", "time", "timeit", "token", "tokenize", "tomli", "tomli_w", "toolz", "tqdm", "trace", "traceback", "tracemalloc", "traits", "tskit", "tty", "turtle", "tutor", "types", "typing", "typing_extensions", "uncertainties", "unittest", "unyt", "urllib", "uu", "uuid", "warnings", "wave", "weakref", "webbrowser", "webencodings", "wrapt", "wsgiref", "xarray", "xdrlib", "xgboost", "xlrd", "xml", "xmlrpc", "yaml", "yt", "zarr", "zipapp", "zipfile", "zipimport", "zlib", "zoneinfo"]
\ No newline at end of file
["Bio", "CLAPACK", "IPython", "PIL", "RobotRaconteur", "__future__", "__main__", "_abc", "_aix_support", "_ast", "_bisect", "_bootsubprocess", "_bz2", "_codecs", "_collections", "_collections_abc", "_compat_pickle", "_compression", "_contextvars", "_frozen_importlib", "_frozen_importlib_external", "_functools", "_heapq", "_imp", "_io", "_json", "_locale", "_markupbase", "_operator", "_plotly_future_", "_plotly_utils", "_posixsubprocess", "_py_abc", "_pydecimal", "_pyio", "_pyodide", "_pyodide_core", "_random", "_sha512", "_signal", "_sitebuiltins", "_socket", "_sre", "_stat", "_string", "_strptime", "_struct", "_sysconfigdata__emscripten_wasm32-emscripten", "_thread", "_threading_local", "_warnings", "_weakref", "_weakrefset", "abc", "aifc", "antigravity", "argparse", "array", "asciitree", "ast", "astropy", "asynchat", "asyncio", "asyncore", "atexit", "atomicwrites", "attr", "autograd", "b2d", "base64", "basthon", "bdb", "binarytree", "binascii", "binhex", "bisect", "bitarray", "bleach", "bokeh", "boost_histogram", "branca", "brotli", "bs4", "builtins", "bz2", "cProfile", "cairosvg", "calendar", "certifi", "cffi", "cffi_example", "cftime", "cgi", "cgitb", "chunk", "cloudpickle", "cmd", "cmyt", "code", "codecs", "codeop", "collections", "colorspacious", "colorsys", "compileall", "concurrent", "configparser", "contextlib", "contextvars", "copy", "copyreg", "cpp-exceptions-test", "crypt", "cryptography", "cssselect", "csv", "ctypes", "cv2", "cycler", "cytoolz", "dataclasses", "datetime", "dateutil", "decimal", "decorator", "demes", "difflib", "dis", "distlib", "distutils", "doctest", "docutils", "drawSvg", "email", "encodings", "enum", "erfa", "errno", "fastjsonschema", "filecmp", "fileinput", "filelock", "fnmatch", "folium", "fontTools", "fpcast_test", "fractions", "freesasa", "ftplib", "functools", "future", "galpy", "gc", "genericpath", "geos", "getopt", "getpass", "gettext", "glob", "gmpy2", "google", "graphlib", "graphviz", "gsw", "gzip", "hashlib", "heapq", "hmac", "html", "html5lib", "http", "imageio", "imaplib", "imghdr", "imp", "importlib", "iniconfig", "inspect", "io", "ipaddress", "ipythonblocks", "itertools", "jedi", "jinja2", "joblib", "js", "json", "jsonschema", "jupyterlab_plotly", "keyword", "kiwisolver", "lazy_object_proxy", "libmagic", "linecache", "locale", "logbook", "logging", "lolviz", "lxml", "lzma", "magic", "mailbox", "mailcap", "markupsafe", "marshal", "math", "matplotlib", "micropip", "mimetypes", "mne", "modulefinder", "more_itertools", "mpl_toolkits", "mpmath", "msgpack", "msprime", "multiprocessing", "netrc", "networkx", "newick", "nlopt", "nltk", "nntplib", "nose", "ntpath", "nturl2path", "numbers", "numcodecs", "numpy", "opcode", "openssl", "operator", "optlang", "optparse", "os", "osmiter", "p5", "packaging", "pandas", "parso", "pathlib", "patsy", "pdb", "pickle", "pickletools", "pipes", "pkg_resources", "pkgconfig", "pkgutil", "platform", "plistlib", "plotly", "pluggy", "poplib", "posix", "posixpath", "pprint", "profile", "proj4py", "pstats", "pty", "py", "py_compile", "pyclbr", "pyclipper", "pycparser", "pydantic", "pydoc", "pydoc_data", "pygments", "pylab", "pyodide", "pyodide_js", "pyparsing", "pyproj", "pyroutelib3", "pyrsistent", "pysat", "pytest", "pytest_benchmark", "python_solvespace", "pytz", "pywt", "qrcode", "queue", "quopri", "random", "rcviz", "re", "rebound", "reboundx", "regex", "reprlib", "requests", "retrying", "rlcompleter", "ruamel", "runpy", "sched", "scipy", "secrets", "select", "selectors", "setuptools", "setuptools_scm", "shapely", "sharedlib-test", "sharedlib_test", "shelve", "shlex", "shutil", "signal", "site", "six", "skimage", "sklearn", "smtpd", "smtplib", "sndhdr", "socket", "socketserver", "soupsieve", "sparseqr", "sqlalchemy", "sqlite3", "sre_compile", "sre_constants", "sre_parse", "ssl", "stat", "statistics", "statsmodels", "string", "stringprep", "struct", "subprocess", "suitesparse", "sunau", "svgwrite", "swiglpk", "sympy", "symtable", "sys", "sysconfig", "tabnanny", "tarfile", "tblib", "telnetlib", "tempfile", "tenacity", "termcolor", "test", "textwrap", "this", "threading", "threadpoolctl", "time", "timeit", "token", "tokenize", "tomli", "tomli_w", "toolz", "tqdm", "trace", "traceback", "tracemalloc", "traits", "tskit", "tty", "turtle", "tutor", "types", "typing", "typing_extensions", "uncertainties", "unittest", "unyt", "urllib", "uu", "uuid", "warnings", "wave", "weakref", "webbrowser", "webencodings", "wrapt", "wsgiref", "xarray", "xdrlib", "xgboost", "xlrd", "xml", "xmlrpc", "yaml", "yt", "zarr", "zipapp", "zipfile", "zipimport", "zlib", "zoneinfo"]
\ No newline at end of file
Please wait a moment while I gather a list of all available modules...
Bio cairosvg libmagic sched
CLAPACK calendar linecache scipy
IPython certifi locale secrets
PIL cffi logbook select
RobotRaconteur cffi_example logging selectors
__future__ cftime lolviz setuptools
_abc cgi lxml setuptools_scm
_aix_support cgitb lzma shapely
_ast chunk magic sharedlib-test
_bisect cloudpickle mailbox sharedlib_test
_blake2 cmath mailcap shelve
_bootsubprocess cmd markupsafe shlex
_bz2 cmyt marshal shutil
_codecs code math signal
_codecs_cn codecs matplotlib site
_codecs_hk codeop micropip six
_codecs_iso2022 collections mimetypes skimage
_codecs_jp colorspacious mmap sklearn
_codecs_kr colorsys mne smtpd
_codecs_tw compileall modulefinder smtplib
_collections concurrent more_itertools sndhdr
_collections_abc configparser mpl_toolkits socket
_compat_pickle contextlib mpmath socketserver
_compression contextvars msgpack soupsieve
_contextvars copy msprime sparseqr
_crypt copyreg multiprocessing sqlalchemy
_csv cpp-exceptions-test netrc sqlite3
_ctypes crypt networkx sre_compile
_datetime cryptography newick sre_constants
_decimal cssselect nlopt sre_parse
_distutils_hack csv nltk ssl
_functools ctypes nntplib stat
_heapq cv2 nose statistics
_imp cycler ntpath statsmodels
_io cytoolz nturl2path string
_json dataclasses numbers stringprep
_locale datetime numcodecs struct
_lsprof dateutil numpy subprocess
_markupbase decimal opcode suitesparse
_md5 decorator openssl sunau
_multibytecodec demes operator svgwrite
_operator difflib optlang swiglpk
_pickle dis optparse sympy
_posixsubprocess distlib os symtable
_py_abc distutils osmiter sys
_pydecimal doctest p5 sysconfig
_pyio docutils packaging tabnanny
_pyodide drawSvg pandas tarfile
_queue email parso tblib
_random encodings pathlib telnetlib
_sha1 enum patsy tempfile
_sha256 erfa pdb termcolor
_sha3 errno pickle test
_sha512 faulthandler pickletools textwrap
_signal filecmp pipes this
_sitebuiltins fileinput pkg_resources threading
_socket filelock pkgconfig threadpoolctl
_sqlite3 fnmatch pkgutil time
_sre folium platform timeit
_stat fontTools plistlib token
_string fpcast_test pluggy tokenize
_strptime fractions poplib tomli
_struct freesasa posix tomli_w
_symtable ftplib posixpath toolz
_sysconfigdata__emscripten_wasm32-emscripten functools pprint tqdm
_thread future profile trace
_threading_local galpy proj4py traceback
_tracemalloc gc pstats tracemalloc
_warnings genericpath pty traits
_weakref geos py tskit
_weakrefset getopt py_compile tty
_xxsubinterpreters getpass pyclbr turtle
abc gettext pyclipper tutor
aifc glob pycparser types
antigravity gmpy2 pydantic typing
argparse google pydoc typing_extensions
array graphlib pydoc_data uncertainties
asciitree graphviz pyexpat unicodedata
ast gsw pygments unittest
astropy gzip pylab unyt
asynchat hashlib pyodide urllib
asyncio heapq pyparsing uu
asyncore hmac pyproj uuid
atexit html pyroutelib3 warnings
atomicwrites html5lib pyrsistent wave
attr http pysat weakref
audioop imageio pytest webbrowser
autograd imaplib pytest_benchmark webencodings
b2d imghdr python_solvespace wrapt
base64 imp pytz wsgiref
basthon importlib pywt xarray
bdb iniconfig qrcode xdrlib
binarytree inspect queue xgboost
binascii io quopri xlrd
binhex ipaddress random xml
bisect ipythonblocks rcviz xmlrpc
bitarray itertools re xxsubtype
bleach jedi rebound yaml
bokeh jinja2 reboundx yt
boost_histogram joblib regex zarr
branca js reprlib zipapp
brotli json requests zipfile
bs4 jsonschema retrying zipimport
builtins keyword rlcompleter zlib
bz2 kiwisolver ruamel zoneinfo
cProfile lazy_object_proxy runpy
Bio cairosvg libmagic scipy
CLAPACK calendar linecache secrets
IPython certifi locale select
PIL cffi logbook selectors
RobotRaconteur cffi_example logging setuptools
__future__ cftime lolviz setuptools_scm
_abc cgi lxml shapely
_aix_support cgitb lzma sharedlib-test
_ast chunk magic sharedlib_test
_bisect cloudpickle mailbox shelve
_blake2 cmath mailcap shlex
_bootsubprocess cmd markupsafe shutil
_bz2 cmyt marshal signal
_codecs code math site
_codecs_cn codecs matplotlib six
_codecs_hk codeop micropip skimage
_codecs_iso2022 collections mimetypes sklearn
_codecs_jp colorspacious mmap smtpd
_codecs_kr colorsys mne smtplib
_codecs_tw compileall modulefinder sndhdr
_collections concurrent more_itertools socket
_collections_abc configparser mpl_toolkits socketserver
_compat_pickle contextlib mpmath soupsieve
_compression contextvars msgpack sparseqr
_contextvars copy msprime sqlalchemy
_crypt copyreg multiprocessing sqlite3
_csv cpp-exceptions-test netrc sre_compile
_ctypes crypt networkx sre_constants
_datetime cryptography newick sre_parse
_decimal cssselect nlopt ssl
_distutils_hack csv nltk stat
_functools ctypes nntplib statistics
_heapq cv2 nose statsmodels
_imp cycler ntpath string
_io cytoolz nturl2path stringprep
_json dataclasses numbers struct
_locale datetime numcodecs subprocess
_lsprof dateutil numpy suitesparse
_markupbase decimal opcode sunau
_md5 decorator openssl svgwrite
_multibytecodec demes operator swiglpk
_operator difflib optlang sympy
_pickle dis optparse symtable
_plotly_future_ distlib os sys
_plotly_utils distutils osmiter sysconfig
_posixsubprocess doctest p5 tabnanny
_py_abc docutils packaging tarfile
_pydecimal drawSvg pandas tblib
_pyio email parso telnetlib
_pyodide encodings pathlib tempfile
_queue enum patsy tenacity
_random erfa pdb termcolor
_sha1 errno pickle test
_sha256 fastjsonschema pickletools textwrap
_sha3 faulthandler pipes this
_sha512 filecmp pkg_resources threading
_signal fileinput pkgconfig threadpoolctl
_sitebuiltins filelock pkgutil time
_socket fnmatch platform timeit
_sqlite3 folium plistlib token
_sre fontTools plotly tokenize
_stat fpcast_test pluggy tomli
_string fractions poplib tomli_w
_strptime freesasa posix toolz
_struct ftplib posixpath tqdm
_symtable functools pprint trace
_sysconfigdata__emscripten_wasm32-emscripten future profile traceback
_thread galpy proj4py tracemalloc
_threading_local gc pstats traits
_tracemalloc genericpath pty tskit
_warnings geos py tty
_weakref getopt py_compile turtle
_weakrefset getpass pyclbr tutor
_xxsubinterpreters gettext pyclipper types
abc glob pycparser typing
aifc gmpy2 pydantic typing_extensions
antigravity google pydoc uncertainties
argparse graphlib pydoc_data unicodedata
array graphviz pyexpat unittest
asciitree gsw pygments unyt
ast gzip pylab urllib
astropy hashlib pyodide uu
asynchat heapq pyparsing uuid
asyncio hmac pyproj warnings
asyncore html pyroutelib3 wave
atexit html5lib pyrsistent weakref
atomicwrites http pysat webbrowser
attr imageio pytest webencodings
audioop imaplib pytest_benchmark wrapt
autograd imghdr python_solvespace wsgiref
b2d imp pytz xarray
base64 importlib pywt xdrlib
basthon iniconfig qrcode xgboost
bdb inspect queue xlrd
binarytree io quopri xml
binascii ipaddress random xmlrpc
binhex ipythonblocks rcviz xxsubtype
bisect itertools re yaml
bitarray jedi rebound yt
bleach jinja2 reboundx zarr
bokeh joblib regex zipapp
boost_histogram js reprlib zipfile
branca json requests zipimport
brotli jsonschema retrying zlib
bs4 jupyterlab_plotly rlcompleter zoneinfo
builtins keyword ruamel
bz2 kiwisolver runpy
cProfile lazy_object_proxy sched
Enter any module name to get more help. Or, type "modules spam" to search
for modules whose name or summary contain the string "spam".
......
<div> <div id="" class="plotly-graph-div" style="height:525px; width:100%;"></div> <script type="text/javascript"> require(["plotly"], function(Plotly) { window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById("")) { Plotly.newPlot( "", [{"alignmentgroup":"True","hovertemplate":"x=%{x}<br>y=%{y}<extra></extra>","legendgroup":"","marker":{"color":"#636efa","pattern":{"shape":""}},"name":"","offsetgroup":"","orientation":"v","showlegend":false,"textposition":"auto","x":["a","b","c"],"xaxis":"x","y":[1,3,2],"yaxis":"y","type":"bar"}], {"template":{"data":{"histogram2dcontour":[{"type":"histogram2dcontour","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"choropleth":[{"type":"choropleth","colorbar":{"outlinewidth":0,"ticks":""}}],"histogram2d":[{"type":"histogram2d","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"heatmap":[{"type":"heatmap","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"heatmapgl":[{"type":"heatmapgl","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"contourcarpet":[{"type":"contourcarpet","colorbar":{"outlinewidth":0,"ticks":""}}],"contour":[{"type":"contour","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"surface":[{"type":"surface","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"mesh3d":[{"type":"mesh3d","colorbar":{"outlinewidth":0,"ticks":""}}],"scatter":[{"fillpattern":{"fillmode":"overlay","size":10,"solidity":0.2},"type":"scatter"}],"parcoords":[{"type":"parcoords","line":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatterpolargl":[{"type":"scatterpolargl","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"bar":[{"error_x":{"color":"#2a3f5f"},"error_y":{"color":"#2a3f5f"},"marker":{"line":{"color":"#E5ECF6","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"bar"}],"scattergeo":[{"type":"scattergeo","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatterpolar":[{"type":"scatterpolar","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"histogram":[{"marker":{"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"histogram"}],"scattergl":[{"type":"scattergl","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatter3d":[{"type":"scatter3d","line":{"colorbar":{"outlinewidth":0,"ticks":""}},"marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scattermapbox":[{"type":"scattermapbox","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatterternary":[{"type":"scatterternary","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scattercarpet":[{"type":"scattercarpet","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"carpet":[{"aaxis":{"endlinecolor":"#2a3f5f","gridcolor":"white","linecolor":"white","minorgridcolor":"white","startlinecolor":"#2a3f5f"},"baxis":{"endlinecolor":"#2a3f5f","gridcolor":"white","linecolor":"white","minorgridcolor":"white","startlinecolor":"#2a3f5f"},"type":"carpet"}],"table":[{"cells":{"fill":{"color":"#EBF0F8"},"line":{"color":"white"}},"header":{"fill":{"color":"#C8D4E3"},"line":{"color":"white"}},"type":"table"}],"barpolar":[{"marker":{"line":{"color":"#E5ECF6","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"barpolar"}],"pie":[{"automargin":true,"type":"pie"}]},"layout":{"autotypenumbers":"strict","colorway":["#636efa","#EF553B","#00cc96","#ab63fa","#FFA15A","#19d3f3","#FF6692","#B6E880","#FF97FF","#FECB52"],"font":{"color":"#2a3f5f"},"hovermode":"closest","hoverlabel":{"align":"left"},"paper_bgcolor":"white","plot_bgcolor":"#E5ECF6","polar":{"bgcolor":"#E5ECF6","angularaxis":{"gridcolor":"white","linecolor":"white","ticks":""},"radialaxis":{"gridcolor":"white","linecolor":"white","ticks":""}},"ternary":{"bgcolor":"#E5ECF6","aaxis":{"gridcolor":"white","linecolor":"white","ticks":""},"baxis":{"gridcolor":"white","linecolor":"white","ticks":""},"caxis":{"gridcolor":"white","linecolor":"white","ticks":""}},"coloraxis":{"colorbar":{"outlinewidth":0,"ticks":""}},"colorscale":{"sequential":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"sequentialminus":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"diverging":[[0,"#8e0152"],[0.1,"#c51b7d"],[0.2,"#de77ae"],[0.3,"#f1b6da"],[0.4,"#fde0ef"],[0.5,"#f7f7f7"],[0.6,"#e6f5d0"],[0.7,"#b8e186"],[0.8,"#7fbc41"],[0.9,"#4d9221"],[1,"#276419"]]},"xaxis":{"gridcolor":"white","linecolor":"white","ticks":"","title":{"standoff":15},"zerolinecolor":"white","automargin":true,"zerolinewidth":2},"yaxis":{"gridcolor":"white","linecolor":"white","ticks":"","title":{"standoff":15},"zerolinecolor":"white","automargin":true,"zerolinewidth":2},"scene":{"xaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white","gridwidth":2},"yaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white","gridwidth":2},"zaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white","gridwidth":2}},"shapedefaults":{"line":{"color":"#2a3f5f"}},"annotationdefaults":{"arrowcolor":"#2a3f5f","arrowhead":0,"arrowwidth":1},"geo":{"bgcolor":"white","landcolor":"#E5ECF6","subunitcolor":"white","showland":true,"showlakes":true,"lakecolor":"white"},"title":{"x":0.05},"mapbox":{"style":"light"}}},"xaxis":{"anchor":"y","domain":[0.0,1.0],"title":{"text":"x"}},"yaxis":{"anchor":"x","domain":[0.0,1.0],"title":{"text":"y"}},"legend":{"tracegroupgap":0},"margin":{"t":60},"barmode":"relative"}, {"responsive": true} ).then(function(){
var gd = document.getElementById('');
var x = new MutationObserver(function (mutations, observer) {{
var display = window.getComputedStyle(gd).display;
if (!display || display === 'none') {{
console.log([gd, 'removed!']);
Plotly.purge(gd);
observer.disconnect();
}}
}});
// Listen for the removal of the full notebook cells
var notebookContainer = gd.closest('#notebook-container');
if (notebookContainer) {{
x.observe(notebookContainer, {childList: true});
}}
// Listen for the clearing of the current output cell
var outputEl = gd.closest('.output');
if (outputEl) {{
x.observe(outputEl, {childList: true});
}}
}) }; }); </script> </div>
\ No newline at end of file
<div> <div id="" class="plotly-graph-div" style="height:525px; width:100%;"></div> <script type="text/javascript"> require(["plotly"], function(Plotly) { window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById("")) { Plotly.newPlot( "", [{"y":[2,1,3],"type":"bar"}], {"template":{"data":{"histogram2dcontour":[{"type":"histogram2dcontour","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"choropleth":[{"type":"choropleth","colorbar":{"outlinewidth":0,"ticks":""}}],"histogram2d":[{"type":"histogram2d","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"heatmap":[{"type":"heatmap","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"heatmapgl":[{"type":"heatmapgl","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"contourcarpet":[{"type":"contourcarpet","colorbar":{"outlinewidth":0,"ticks":""}}],"contour":[{"type":"contour","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"surface":[{"type":"surface","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"mesh3d":[{"type":"mesh3d","colorbar":{"outlinewidth":0,"ticks":""}}],"scatter":[{"fillpattern":{"fillmode":"overlay","size":10,"solidity":0.2},"type":"scatter"}],"parcoords":[{"type":"parcoords","line":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatterpolargl":[{"type":"scatterpolargl","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"bar":[{"error_x":{"color":"#2a3f5f"},"error_y":{"color":"#2a3f5f"},"marker":{"line":{"color":"#E5ECF6","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"bar"}],"scattergeo":[{"type":"scattergeo","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatterpolar":[{"type":"scatterpolar","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"histogram":[{"marker":{"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"histogram"}],"scattergl":[{"type":"scattergl","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatter3d":[{"type":"scatter3d","line":{"colorbar":{"outlinewidth":0,"ticks":""}},"marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scattermapbox":[{"type":"scattermapbox","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatterternary":[{"type":"scatterternary","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scattercarpet":[{"type":"scattercarpet","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"carpet":[{"aaxis":{"endlinecolor":"#2a3f5f","gridcolor":"white","linecolor":"white","minorgridcolor":"white","startlinecolor":"#2a3f5f"},"baxis":{"endlinecolor":"#2a3f5f","gridcolor":"white","linecolor":"white","minorgridcolor":"white","startlinecolor":"#2a3f5f"},"type":"carpet"}],"table":[{"cells":{"fill":{"color":"#EBF0F8"},"line":{"color":"white"}},"header":{"fill":{"color":"#C8D4E3"},"line":{"color":"white"}},"type":"table"}],"barpolar":[{"marker":{"line":{"color":"#E5ECF6","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"barpolar"}],"pie":[{"automargin":true,"type":"pie"}]},"layout":{"autotypenumbers":"strict","colorway":["#636efa","#EF553B","#00cc96","#ab63fa","#FFA15A","#19d3f3","#FF6692","#B6E880","#FF97FF","#FECB52"],"font":{"color":"#2a3f5f"},"hovermode":"closest","hoverlabel":{"align":"left"},"paper_bgcolor":"white","plot_bgcolor":"#E5ECF6","polar":{"bgcolor":"#E5ECF6","angularaxis":{"gridcolor":"white","linecolor":"white","ticks":""},"radialaxis":{"gridcolor":"white","linecolor":"white","ticks":""}},"ternary":{"bgcolor":"#E5ECF6","aaxis":{"gridcolor":"white","linecolor":"white","ticks":""},"baxis":{"gridcolor":"white","linecolor":"white","ticks":""},"caxis":{"gridcolor":"white","linecolor":"white","ticks":""}},"coloraxis":{"colorbar":{"outlinewidth":0,"ticks":""}},"colorscale":{"sequential":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"sequentialminus":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"diverging":[[0,"#8e0152"],[0.1,"#c51b7d"],[0.2,"#de77ae"],[0.3,"#f1b6da"],[0.4,"#fde0ef"],[0.5,"#f7f7f7"],[0.6,"#e6f5d0"],[0.7,"#b8e186"],[0.8,"#7fbc41"],[0.9,"#4d9221"],[1,"#276419"]]},"xaxis":{"gridcolor":"white","linecolor":"white","ticks":"","title":{"standoff":15},"zerolinecolor":"white","automargin":true,"zerolinewidth":2},"yaxis":{"gridcolor":"white","linecolor":"white","ticks":"","title":{"standoff":15},"zerolinecolor":"white","automargin":true,"zerolinewidth":2},"scene":{"xaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white","gridwidth":2},"yaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white","gridwidth":2},"zaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white","gridwidth":2}},"shapedefaults":{"line":{"color":"#2a3f5f"}},"annotationdefaults":{"arrowcolor":"#2a3f5f","arrowhead":0,"arrowwidth":1},"geo":{"bgcolor":"white","landcolor":"#E5ECF6","subunitcolor":"white","showland":true,"showlakes":true,"lakecolor":"white"},"title":{"x":0.05},"mapbox":{"style":"light"}}},"title":{"text":"A nice title"}}, {"responsive": true} ).then(function(){
var gd = document.getElementById('');
var x = new MutationObserver(function (mutations, observer) {{
var display = window.getComputedStyle(gd).display;
if (!display || display === 'none') {{
console.log([gd, 'removed!']);
Plotly.purge(gd);
observer.disconnect();
}}
}});
// Listen for the removal of the full notebook cells
var notebookContainer = gd.closest('#notebook-container');
if (notebookContainer) {{
x.observe(notebookContainer, {childList: true});
}}
// Listen for the clearing of the current output cell
var outputEl = gd.closest('.output');
if (outputEl) {{
x.observe(outputEl, {childList: true});
}}
}) }; }); </script> </div>
\ No newline at end of file
......@@ -295,3 +295,41 @@ d
html = result['result']['text/html']
target = read_and_backup(_test_data / "python3_drawSvg.html", html)
assert target == html
def test_plotly(selenium_py3):
reg = re.compile("<div id=\"([0-9a-f-]+)\"")
data = selenium_py3.run_basthon("""
import plotly.graph_objects as go
fig = go.Figure(
data=[go.Bar(y=[2, 1, 3])],
layout_title_text="A nice title"
)
fig""")
assert data['stdout'] == ""
assert data['stderr'] == ""
result = data['result']
html = result['result']['text/html']
id = reg.search(html).group(1)
html = html.replace(id, '')
target = read_and_backup(_test_data / "python3_plotly_go.html", html)
assert target == html
data = selenium_py3.run_basthon("""
import pandas
import plotly.express as px
fig = px.bar(x=["a", "b", "c"], y=[1, 3, 2])
fig.show()
""")
print(data)
assert data['stdout'] == ""
assert data['stderr'] == ""
result = data['display']
html = result['content']['text/html']
id = reg.search(html).group(1)
html = html.replace(id, '')
target = read_and_backup(_test_data / "python3_plotly_express.html", html)
assert target == html
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment