Live data from Hacker News

Show HN: GraphicsJS, New Powerful Free Open-Source JavaScript Graphics Library

graphicsjs.org

21–30 of 45 posts

Re: Show HN: GraphicsJS, New Powerful Free Open-Source JavaScript Graphics Library

#21

Looking at the source for the examples, I really can't see how that's practical to write. It may be fast but damn is that code gnarly.

The documentation doesn't help either - it's nasty generated stuff that simply enumerates the API interfaces without adding very much useful information.

For example, https://api.anychart.com/7.11.1/anychart.palettes.DistinctCo... - why would you want to attach listeners to palette colors? There might be a great reason, or those methods might just have been inherited from the base class, but the documentation is no to your understanding help whatsoever. The example is for the base class rather than the palette object.

This is actually a good example of bad documentation.

Re: Show HN: GraphicsJS, New Powerful Free Open-Source JavaScript Graphics Library

#22
post #3

The speed and responsiveness of Canvas for complex visualisation (ones where there are a lot of objects) means it's often the better choice. However, libraries like d3 make working with SVG a lot easier. I'm interested, why does SVG seem to de the default choice for web graphics? And is there something like d3 that makes working with Canvas more accessible?

What are D3 and Canvas and why are they being injected into this conversation?

Re: Show HN: GraphicsJS, New Powerful Free Open-Source JavaScript Graphics Library

#23
post #11

Earlier quoted context omitted.

China, India, Africa, Indonesia, Russia (regional government offices), for this and for many other countries IE6-8 is common case. It's just a fact.

It's a fact that can change.

Nope. Most modern browsers stopped Windows XP support.

Hell like that are able to run computers with 1G RAM.

Re: Show HN: GraphicsJS, New Powerful Free Open-Source JavaScript Graphics Library

#25
post #3

The speed and responsiveness of Canvas for complex visualisation (ones where there are a lot of objects) means it's often the better choice. However, libraries like d3 make working with SVG a lot easier. I'm interested, why does SVG seem to de the default choice for web graphics? And is there something like d3 that makes working with Canvas more accessible?

>I'm interested, why does SVG seem to de the default choice for web graphics?

Because SVG IS web graphics (emphasis on "web"). It lives on the DOM, it's objects have event callbacks, can be styled in CSS-fashion, have nested items, links, etc.

In contrast, Canvas is just a bitmap pane that you can draw own in an imperative way through a JS API -- and everything above that has to be programmed by you or a third party lib in an ad-hoc way.

Re: Show HN: GraphicsJS, New Powerful Free Open-Source JavaScript Graphics Library

#26
post #3

The speed and responsiveness of Canvas for complex visualisation (ones where there are a lot of objects) means it's often the better choice. However, libraries like d3 make working with SVG a lot easier. I'm interested, why does SVG seem to de the default choice for web graphics? And is there something like d3 that makes working with Canvas more accessible?

People pick SVG because it looks sharp, has certain features that make development easier, and because they are hack developers who do not understand how performance graphics work.

>and because they are hack developers who do not understand how performance graphics work.

Nothing "hack" about vector graphics, and nothing about graphics that necessitates "performance" above all else.

We're not all making AAA games.

Re: Show HN: GraphicsJS, New Powerful Free Open-Source JavaScript Graphics Library

#27
post #3

The speed and responsiveness of Canvas for complex visualisation (ones where there are a lot of objects) means it's often the better choice. However, libraries like d3 make working with SVG a lot easier. I'm interested, why does SVG seem to de the default choice for web graphics? And is there something like d3 that makes working with Canvas more accessible?

People pick SVG because it looks sharp, has certain features that make development easier, and because they are hack developers who do not understand how performance graphics work.

So the simpler and better solution for [eg] icons or graphs is for idiots, and the Very Smart Developers are are all off building solutions that might, just might have utterly trivial perfomance gains at the expense of easily writable and modifiable code? Hmm.

Re: Show HN: GraphicsJS, New Powerful Free Open-Source JavaScript Graphics Library

#28
post #3

The speed and responsiveness of Canvas for complex visualisation (ones where there are a lot of objects) means it's often the better choice. However, libraries like d3 make working with SVG a lot easier. I'm interested, why does SVG seem to de the default choice for web graphics? And is there something like d3 that makes working with Canvas more accessible?

D3 Version 4 has more utilities and examples of interactions with Canvas. Here's an example of a relatively small graph (~500 nodes, 10k edges) that SVG used to struggle with, but Canvas renders with ease. http://bl.ocks.org/syntagmatic/954b31aa8b8beb91b30ccb0c9e57f... Notice the nodes are draggable, an interaction supported by the new simulation.find https://github.com/d3/d3-force/#simulation_find

Wow, I didn't know D3 v.4 is so much better for Canvas, thanks for the link. However, this simulation runs horribly slow in FF and IE - I wonder where the fault is.

Re: Show HN: GraphicsJS, New Powerful Free Open-Source JavaScript Graphics Library

#30
post #3

The speed and responsiveness of Canvas for complex visualisation (ones where there are a lot of objects) means it's often the better choice. However, libraries like d3 make working with SVG a lot easier. I'm interested, why does SVG seem to de the default choice for web graphics? And is there something like d3 that makes working with Canvas more accessible?

One important reason I often use it: you can trivially bind click events and the like to SVG nodes. In Canvas you have to track x/y coordinates of a click and what it matches up to yourself.
Post reply on HN