How to draw lines or curves inside a canvas?

I need to draw lines or curves on a canvas.

I would like to do something like this.

But I even know how to get the context using Ionic 2/Angular 2.

How could I draw lines or curves inside an element using Ionic 2?