diff --git a/plotly/graph_reference/default-schema.json b/plotly/graph_reference/default-schema.json index cc0ae722eec..27cdf82abf6 100644 --- a/plotly/graph_reference/default-schema.json +++ b/plotly/graph_reference/default-schema.json @@ -11230,6 +11230,7 @@ }, "lighting": { "ambient": { + "description": "Ambient light increases overall color visibility but can wash out the image.", "dflt": 0.8, "max": 1, "min": 0, @@ -11237,13 +11238,23 @@ "valType": "number" }, "diffuse": { + "description": "Represents the extent that incident rays are reflected in a range of angles.", "dflt": 0.8, "max": 1, "min": 0, "role": "style", "valType": "number" }, + "facenormalsepsilon": { + "description": "Epsilon for face normals calculation avoids math issues arising from degenerate geometry.", + "dflt": 1e-06, + "max": 1, + "min": 0, + "role": "style", + "valType": "number" + }, "fresnel": { + "description": "Represents the reflectance as a dependency of the viewing angle; e.g. paper is reflective when viewing it from the edge of the paper (almost 90 degrees), causing shine.", "dflt": 0.2, "max": 5, "min": 0, @@ -11252,6 +11263,7 @@ }, "role": "object", "roughness": { + "description": "Alters specular reflection; the rougher the surface, the wider and less contrasty the shine.", "dflt": 0.5, "max": 1, "min": 0, @@ -11259,11 +11271,47 @@ "valType": "number" }, "specular": { + "description": "Represents the level that incident rays are reflected in a single direction, causing shine.", "dflt": 0.05, "max": 2, "min": 0, "role": "style", "valType": "number" + }, + "vertexnormalsepsilon": { + "description": "Epsilon for vertex normals calculation avoids math issues arising from degenerate geometry.", + "dflt": 1e-12, + "max": 1, + "min": 0, + "role": "style", + "valType": "number" + } + }, + "lightposition": { + "role": "object", + "x": { + "description": "Numeric vector, representing the X coordinate for each vertex.", + "dflt": 100000, + "max": 100000, + "min": -100000, + "role": "style", + "valType": "number" + }, + "y": { + "description": "Numeric vector, representing the Y coordinate for each vertex.", + "dflt": 100000, + "max": 100000, + "min": -100000, + "role": "style", + "valType": "number" + }, + "z": { + "description": "Numeric vector, representing the Z coordinate for each vertex.", + "dflt": 0, + "max": 100000, + "min": -100000, + "role": "style", + "valType": "number" } }, "name": { @@ -17937,6 +17985,7 @@ }, "lighting": { "ambient": { + "description": "Ambient light increases overall color visibility but can wash out the image.", "dflt": 0.8, "max": 1, "min": 0, @@ -17944,6 +17993,7 @@ "valType": "number" }, "diffuse": { + "description": "Represents the extent that incident rays are reflected in a range of angles.", "dflt": 0.8, "max": 1, "min": 0, @@ -17951,6 +18001,7 @@ "valType": "number" }, "fresnel": { + "description": "Represents the reflectance as a dependency of the viewing angle; e.g. paper is reflective when viewing it from the edge of the paper (almost 90 degrees), causing shine.", "dflt": 0.2, "max": 5, "min": 0, @@ -17959,6 +18010,7 @@ }, "role": "object", "roughness": { + "description": "Alters specular reflection; the rougher the surface, the wider and less contrasty the shine.", "dflt": 0.5, "max": 1, "min": 0, @@ -17966,6 +18018,7 @@ "valType": "number" }, "specular": { + "description": "Represents the level that incident rays are reflected in a single direction, causing shine.", "dflt": 0.05, "max": 2, "min": 0, @@ -17973,6 +18026,33 @@ "valType": "number" } }, + "lightposition": { + "role": "object", + "x": { + "description": "Numeric vector, representing the X coordinate for each vertex.", + "dflt": 10, + "max": 100000, + "min": -100000, + "role": "style", + "valType": "number" + }, + "y": { + "description": "Numeric vector, representing the Y coordinate for each vertex.", + "dflt": 100000, + "max": 100000, + "min": -100000, + "role": "style", + "valType": "number" + }, + "z": { + "description": "Numeric vector, representing the Z coordinate for each vertex.", + "dflt": 0, + "max": 100000, + "min": -100000, + "role": "style", + "valType": "number" + } + }, "name": { "description": "Sets the trace name. The trace name appear as the legend item and on hover.", "role": "info", diff --git a/plotly/offline/offline.py b/plotly/offline/offline.py index d782fa65a7a..efa520976ae 100644 --- a/plotly/offline/offline.py +++ b/plotly/offline/offline.py @@ -30,7 +30,6 @@ _matplotlib_imported = False __PLOTLY_OFFLINE_INITIALIZED = False -__PLOTLY_USE_CDN = False def download_plotlyjs(download_url): @@ -53,14 +52,31 @@ def init_notebook_mode(connected=False): Initialize plotly.js in the browser if it hasn't been loaded into the DOM yet. This is an idempotent method and can and should be called from any offline methods that require plotly.js to be loaded into the notebook dom. + + Keyword arguments: + + connected (default=False) -- If True, the plotly.js library will be loaded + from an online CDN. If False, the plotly.js library will be loaded locally + from the plotly python package + + Use `connected=True` if you want your notebooks to have smaller file sizes. + In the case where `connected=False`, the entirety of the plotly.js library + will be loaded into the notebook, which will result in a file-size increase + of a couple megabytes. Additionally, because the library will be downloaded + from the web, you and your viewers must be connected to the internet to be + able to view charts within this notebook. + + Use `connected=False` if you want you and your collaborators to be able to + create and view these charts regardless of the availability of an internet + connection. This is the default option since it is the most predictable. + Note that under this setting the library will be included inline inside + your notebook, resulting in much larger notebook sizes compared to the case + where `connected=True`. """ if not _ipython_imported: raise ImportError('`iplot` can only run inside an IPython Notebook.') global __PLOTLY_OFFLINE_INITIALIZED - global __PLOTLY_USE_CDN - - __PLOTLY_USE_CDN = connected if connected: # Inject plotly.js into the output cell @@ -69,6 +85,7 @@ def init_notebook_mode(connected=False): '' - ) + ) else: # Inject plotly.js into the output cell script_inject = (