Skip to content

Commit

Permalink
Merge branch 'master' of github.com:plotly/Kaleido
Browse files Browse the repository at this point in the history
  • Loading branch information
jonmmease committed Jun 30, 2020
2 parents 28a6dee + 9d7e41d commit 77262a1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
7 changes: 5 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
mac_build_blink:
macos: # indicate that we are using the macOS executor
xcode: 11.3.0 # indicate our selected version of Xcode
resource_class: medium
resource_class: large
steps:
- checkout
- attach_workspace:
Expand All @@ -82,7 +82,7 @@ jobs:
mac_build:
macos: # indicate that we are using the macOS executor
xcode: 11.3.0 # indicate our selected version of Xcode
resource_class: medium
resource_class: large
steps:
- checkout
- attach_workspace:
Expand Down Expand Up @@ -122,6 +122,9 @@ jobs:
shell: powershell.exe
steps:
- checkout
- run:
name: Update PowerShell.Archive to fix slash direction
command: Install-Module Microsoft.PowerShell.Archive -MinimumVersion 1.2.3.0 -Repository PSGallery -Force
- attach_workspace:
at: .\repos
- run: .\repos\win_scripts\build_kaleido.ps1
Expand Down
3 changes: 2 additions & 1 deletion repos/kaleido/py/kaleido/scopes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

class BaseScope(object):
_json_encoder = None
_text_formats = ("svg",)

def __init__(self, disable_gpu=True, suppress_stderr=True, **kwargs):

Expand Down Expand Up @@ -162,7 +163,7 @@ def to_image(self, figure, format="png", width=700, height=500, scale=1):

# Export successful
img_string = response.pop("result", None)
if format == 'svg':
if format in self._text_formats:
img = img_string.encode()
else:
img = base64.decodebytes(img_string.encode())
Expand Down
1 change: 1 addition & 0 deletions repos/kaleido/py/kaleido/scopes/plotly.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

class PlotlyScope(BaseScope):
_json_encoder = PlotlyJSONEncoder
_text_formats = ("svg", "json")

def __init__(self, plotlyjs=None, mathjax=None, topojson=None, mapbox_access_token=None, **kwargs):
# TODO: validate args
Expand Down

0 comments on commit 77262a1

Please sign in to comment.