M
M
Maxim2017-08-12 01:21:01
Canvas
Maxim, 2017-08-12 01:21:01

Why is canvas and not svg used in statistics graphs on VKontakte?

After all, graphs written on canvas (unlike svg) need to be redrawn every time the user interacts with it.
Explain, please, to an inexperienced person.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dmitry Belyaev, 2017-08-12
@bingo347

canvas is faster and more flexible, drawing programmatically on the svg-path is still a problem ...
And about redrawing, even a complete redrawing will work faster, and people do partial rules, only what has changed

X
xmoonlight, 2017-08-12
@xmoonlight

On canvas, you can use WebGL rendering, which is itself faster (GPU) and much more flexible than SVG, to style and create chart interactivity.

S
sim3x, 2017-08-12
@sim3x

Option 0: the developer who did this, Google gave a solution on the canvas
Option 1: the developer who did it, Google gave the solution on the canvas when the developer was doing a similar task before
Performance tests on the client are done by a few

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question