diff --git a/plotly/graph_reference/default-schema.json b/plotly/graph_reference/default-schema.json index cf0b1bd5065..d9285f84ec6 100644 --- a/plotly/graph_reference/default-schema.json +++ b/plotly/graph_reference/default-schema.json @@ -7017,7 +7017,7 @@ "valType": "string" } }, - "description": "The data that describes the heatmap value-to-color mapping is set in `z`. Data in `z` can either be a {2D array} of values (ragged or not) or a 1D array of values. In the case where `z` is a {2D array}, say that `z` has N rows and M columns. Then, by default, the resulting heatmap will have N partitions along the y axis and M partitions along the x axis. In other words, the i-th row/ j-th column cell in `z` is mapped to the i-th partition of the y axis (starting from the bottom of the plot) and the j-th partition of the x-axis (starting from the left of the plot). This behavior can be flipped by using `transpose`. Moreover, `x` (`y`) can be provided with M or M+1 (N or N+1) elements If M (N), then the coordinates correspond to the center of the heatmap cells and the cells have equal width. If M+1 (N+1), then the coordinates correspond to the edges of the heatmap cells. In the case where `z` is a 1D {array}, the x and y coordinates must be provided in `x` and `y` respectively to form data triplets." + "description": "The data that describes the heatmap value-to-color mapping is set in `z`. Data in `z` can either be a {2D array} of values (ragged or not) or a 1D array of values. In the case where `z` is a {2D array}, say that `z` has N rows and M columns. Then, by default, the resulting heatmap will have N partitions along the y axis and M partitions along the x axis. In other words, the i-th row/ j-th column cell in `z` is mapped to the i-th partition of the y axis (starting from the bottom of the plot) and the j-th partition of the x-axis (starting from the left of the plot). This behavior can be flipped by using `transpose`. Moreover, `x` (`y`) can be provided with M or M+1 (N or N+1) elements. If M (N), then the coordinates correspond to the center of the heatmap cells and the cells have equal width. If M+1 (N+1), then the coordinates correspond to the edges of the heatmap cells. In the case where `z` is a 1D {array}, the x and y coordinates must be provided in `x` and `y` respectively to form data triplets." }, "histogram": { "attributes": { diff --git a/plotly/plotly/chunked_requests/chunked_request.py b/plotly/plotly/chunked_requests/chunked_request.py index 85ff835cf58..c154ec8635d 100644 --- a/plotly/plotly/chunked_requests/chunked_request.py +++ b/plotly/plotly/chunked_requests/chunked_request.py @@ -70,6 +70,28 @@ def write(self, data, reconnect_on=('', 200, )): self._reconnect() self.write(data) + def _get_proxy_config(self): + """ + Determine if self._url should be passed through a proxy. If so, return + the appropriate proxy_server and proxy_port + + """ + + proxy_server = None + proxy_port = None + + ## only doing HTTPConnection, so only use http_proxy + proxy = os.environ.get("http_proxy") + no_proxy = os.environ.get("no_proxy") + no_proxy_url = no_proxy and self._url in no_proxy + + if proxy and not no_proxy_url: + p = urlparse(proxy) + proxy_server = p.hostname + proxy_port = p.port + + return proxy_server, proxy_port + def _connect(self): ''' Initialize an HTTP connection with chunked Transfer-Encoding to server:port with optional headers. @@ -77,17 +99,9 @@ def _connect(self): server = self._server port = self._port headers = self._headers + proxy_server, proxy_port = self._get_proxy_config() - ## only doing HTTPConnection, so only use http_proxy - proxy = os.environ.get("http_proxy"); - proxy_server = None - proxy_port = None - if (proxy != None): - p = urlparse(proxy) - proxy_server = p.hostname - proxy_port = p.port - - if (proxy_server != None and proxy_port != None): + if (proxy_server and proxy_port): self._conn = http_client.HTTPConnection(proxy_server, proxy_port) self._conn.set_tunnel(server, port) else: diff --git a/submodules/chunked_requests b/submodules/chunked_requests index 62581cf3a1d..f940b023110 160000 --- a/submodules/chunked_requests +++ b/submodules/chunked_requests @@ -1 +1 @@ -Subproject commit 62581cf3a1df522e52470a1120ada87f700e153a +Subproject commit f940b023110a77bbaf79f9dbccca701cf756335f