MCPcopy Index your code
hub / github.com/bqplot/bqplot / update_image

Method update_image

js/src/Image.ts:107–123  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

105 }
106
107 update_image() {
108 if (this.im.attr('href')) {
109 URL.revokeObjectURL(this.im.attr('href'));
110 }
111 const image = this.model.get('image');
112 const format = image.get('format');
113 if (format === 'url') {
114 const url = new TextDecoder('utf-8').decode(image.get('value'));
115 this.im.attr('href', url);
116 } else {
117 const blob = new Blob([image.get('value')], {
118 type: 'image/' + image.get('format'),
119 });
120 const url = URL.createObjectURL(blob);
121 this.im.attr('href', url);
122 }
123 }
124
125 remove() {
126 URL.revokeObjectURL(this.im.attr('href'));

Callers 1

renderMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected