jupyter_clickable_image_widget icon indicating copy to clipboard operation
jupyter_clickable_image_widget copied to clipboard

Stuck loading model

Open SirMaximilian opened this issue 5 years ago • 5 comments

After an update, the widget doesn't load and gets stuck saying loading widget. Is it possible to get this updated for the newer JupiterLab versions? Is it also possible to get this on the Jupyter extension Manager?

SirMaximilian avatar Nov 22 '19 07:11 SirMaximilian

I am having the same problem. Please let me know if you find a way around.

apusky avatar May 21 '20 21:05 apusky

I gave up and used ipycanvas ... found a good example that worked like a charm.

jiver54 avatar May 22 '20 11:05 jiver54

It seems that the widget is not compatible with the last version of jupyterlab. I downgraded it to 1.2.4 and it works

apusky avatar May 22 '20 13:05 apusky

I gave up and used ipycanvas ... found a good example that worked like a charm.

Hi jiver54, could you please share that ipycanvas example? I am stuck with the clickable image widget. Thank you!

Tzowbiie avatar Nov 26 '20 21:11 Tzowbiie

I sort of put things together from https://github.com/martinRenou/ipycanvas I did find some mouse drawing examples

These are the bits of mouse code I used... It's strange that it does not seem to pass the (x,y) however it seems to get there!

sets up the layers

from ipycanvas import MultiCanvas, hold_canvas canvas = MultiCanvas(3, width=width, height=height) background_layer = canvas[0] drawing_layer = canvas[1] interaction_layer = canvas[2] ...

Functions to do stuff

def draw_line(canvas, start, end): canvas.begin_path() canvas.move_to(start[0], start[1]) canvas.line_to(end[0], end[1]) canvas.stroke() canvas.close_path()

def on_mouse_down(x, y): global drawing global start if not drawing: drawing_layer.clear() start = (x, y) TopX.value=str(int(x)) TopY.value=str(int(y)) else: with hold_canvas(canvas): draw_line(drawing_layer, start, (x, y)) BtmX.value=str(int(x)) BtmY.value=str(int(y)) interaction_layer.clear() start = None drawing = not drawing

def on_mouse_move(x, y): if not drawing: return with hold_canvas(canvas): interaction_layer.clear() draw_line(interaction_layer, start, (x, y))

sets the functions to trigger when there is mouse activity

interaction_layer.on_mouse_down(on_mouse_down) interaction_layer.on_mouse_move(on_mouse_move)

On Fri, 27 Nov 2020 at 08:47, Tobias Zwiehoff [email protected] wrote:

I gave up and used ipycanvas ... found a good example that worked like a charm.

Hi jiver54, could you please share that ipycanvas example? I am stuck with the clickable image widget. Thank you!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jaybdub/jupyter_clickable_image_widget/issues/2#issuecomment-734488031, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANKI56OPBCGGELJDOSDV3D3SR3EF5ANCNFSM4JQM6BTQ .

--

Graeme Murphy B.E.(Civil) DipEd

Tech-Rentals Pty Ltd

18 Joseph St Blackburn Nth Victoria Australia

jiver54 avatar Nov 26 '20 22:11 jiver54