TransWikia.com

Javascript library to draw 2D shapes and pan and zoom

Software Recommendations Asked by danday74 on September 25, 2021

Imagine something like Pascals triangle, made up of many circles, with a number written on each circle.

This Pascal’s triangle might be 200 rows or more, which obviously wont fit on screen.

As such, I need a JavaScript library to draw circles (in a triangle formation) and pan and zoom around Pascals triangle.

I’m not sure if an SVG library is best or canvas or something else. I’m open to suggestions. Anyone know of a good JavaScript lib? npm modules are fine too.

Help much appreciated. Many thanks.

One Answer

My suggestion for custom javascript drawings is d3.js.

As an example, http://bl.ocks.org/edrex/1920883 shows a way to draw pascal's triangle.

https://github.com/d3/d3-zoom shows how to do some zoom/pan activities.

This library also makes it possible to render in svg or canvas, depending on your needs.

Correct answer by cmonkey on September 25, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP