Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 12, 2021
1 parent fca10db commit 30f7dba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
12 changes: 6 additions & 6 deletions ipympl/backend_nbagg.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,9 @@ def send_json(self, content):
def send_binary(self, data):
buf = io.BytesIO()
self.figure.savefig(buf, format='png', dpi='figure')
self._data_url = 'data:image/png;base64,' + b64encode(
buf.getvalue()
).decode('utf-8')
self._data_url = 'data:image/png;base64,' + b64encode(buf.getvalue()).decode(
'utf-8'
)

self.send({'data': '{"type": "binary"}'}, buffers=[data])

Expand All @@ -273,9 +273,9 @@ def _repr_mimebundle_(self, **kwargs):

buf = io.BytesIO()
self.figure.savefig(buf, format='png', dpi='figure')
self._data_url = 'data:image/png;base64,' + b64encode(
buf.getvalue()
).decode('utf-8')
self._data_url = 'data:image/png;base64,' + b64encode(buf.getvalue()).decode(
'utf-8'
)

data = {
'text/plain': plaintext,
Expand Down
3 changes: 1 addition & 2 deletions src/mpl_widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import * as utils from './utils';

import { MODULE_VERSION } from './version';


export class MPLCanvasModel extends DOMWidgetModel {
offscreen_canvas: HTMLCanvasElement;
offscreen_context: CanvasRenderingContext2D;
Expand Down Expand Up @@ -52,7 +51,7 @@ export class MPLCanvasModel extends DOMWidgetModel {

static serializers: ISerializers = {
...DOMWidgetModel.serializers,
toolbar: { deserialize: unpack_models as any }
toolbar: { deserialize: unpack_models as any },
};

initialize(attributes: any, options: any) {
Expand Down

0 comments on commit 30f7dba

Please sign in to comment.