Live data from Hacker News

Show HN: Frappe Charts – GitHub inspired JavaScript charting with zero dependencies

frappe.github.io

81–90 of 92 posts

Re: Show HN: Frappe Charts – GitHub inspired JavaScript charting with zero dependencies

#81

Earlier quoted context omitted.

D3 is not a charting library but a data visualization library with which one can produce standard charts. The code required to create a simple line chart in D3 spans dozens of lines, not including the data. Using a charting library it is usually one or two (plus options).

Lots of libs advertise 0 dependencies. I'm not fussed if a library depends on D3 though. D3 is 80k gzipped, this is 15k gzipped, ChartJS is about 20k gzipped. If you need one chart, sure, go for it. But each of those libraries would be 1. The code is much simpler and easier to understand and contribute to 2. Knowing D3 means you can modify the visuals, fork the library, and customize it without spending ages wading t…

Yea, I’ve found similar use case where any custom work is much better off done using raw d3.

Re: Show HN: Frappe Charts – GitHub inspired JavaScript charting with zero dependencies

#82

Looks nice, 0 dependency, simple design but there is one issue... I see that you don't have a single unit test or integration or functional etc. Even if your in house developers know what they are doing (which is a myth, stuff will break) it's going to be difficult accept contributions from community without any tests that make (almost) sure existing features are working with the changes.

How would you even test a UI library? For example, if some weird input makes the bar charts too spread apart, how do you convert that to a unit test? If you tried to unit test this, you'd either be fully reproducing the actual source code for spacing logic or you'd be hard-coding in thresholds that might all break if the maintainer decides on a UI change such as "increase the spacing for bar charts having many grouped bars". It seems for UI projects, testing can only cover about 1-10% of the issues that eventually end up on the GitHub issue tracker, so 25% of your time on this project would go toward writing tests, which would save you 1-10% of your time. Doesn't make sense.

Re: Show HN: Frappe Charts – GitHub inspired JavaScript charting with zero dependencies

#84
post #12

Earlier quoted context omitted.

https://rbcs-us.com/documents/Why-Most-Unit-Testing-is-Waste...

I have really bad experience using controls that didn't have a large test suite. They don't have to be "unit" , I just care about the ratio of the number of state transitions it tests to possible state transitions. If that library was written in typescript (or some other strongly typed language), I'd been slightly less worried about the lack of tests, and possibly slightly more convinced to try it out in its early st…

I agree, unit tests wouldn't be very useful here, i was thing that visual regression tests with constant data, that capture graph image and compare with older version for regressions would have been really nice here.

Re: Show HN: Frappe Charts – GitHub inspired JavaScript charting with zero dependencies

#85

Earlier quoted context omitted.

Be that as it may, that doesn’t address the apparent fact that it doesn’t work in all major browsers — certainly IE11 would be considered one by most.

Moreover, whatever % of global browser share IE11 has, within the market of people who want charts, it's much higher. The simple chart is also the #1 feature priority of every business-IT product manager that has ever existed, narrowly beating "make it work in Internet Explorer".

Google Charts is a solid lib if you need the go-wide support

Re: Show HN: Frappe Charts – GitHub inspired JavaScript charting with zero dependencies

#86
It's so good! I am thoroughly impressed with its performance and the dynamic data binding. I discovered in comments that there's a frappe-gantt chart as well, would be nice if such "extra" plugins were listed on homepage (since the gantt example is even more impressive!).

All the best for the project. Are you looking for community contributions?

Re: Show HN: Frappe Charts – GitHub inspired JavaScript charting with zero dependencies

#87

Earlier quoted context omitted.

I see where your coming from, but I disagree. This isn't a new OS, its a tiny charts library/utility. I'm more inclined to contribute because there are no tests. Either way, someone could PR tests if they wished. Perhaps your comment should have been such a PR? ;)

> Perhaps your comment should have been such a PR? ;) I really hate seeing this used in discussion. Just because it's open source does not mean it's immune from criticism. Yes, technically some random HN'er could spend tens of hours writing unit tests and submit a PR, but really this is a task for the library author/maintainer. Having tests is a measure of quality, and should be cared about if you want people using y…

I was hoping the winking face would have led readers to understand that my suggestion was made in jest.

My point was: Many are dogmatic about tests these days, and I find it refreshing there are no tests.

Tests can be added later for something like this library, if/when the need arises - or when someone decides to spend "tens of hours" writing them.

Tests can be a measure of quality, but they aren't the only measure - and do not apply in all cases

Re: Show HN: Frappe Charts – GitHub inspired JavaScript charting with zero dependencies

#88
post #84

Earlier quoted context omitted.

I have really bad experience using controls that didn't have a large test suite. They don't have to be "unit" , I just care about the ratio of the number of state transitions it tests to possible state transitions. If that library was written in typescript (or some other strongly typed language), I'd been slightly less worried about the lack of tests, and possibly slightly more convinced to try it out in its early st…

I agree, unit tests wouldn't be very useful here, i was thing that visual regression tests with constant data, that capture graph image and compare with older version for regressions would have been really nice here.

As a side note: I find these kind of tests flaky, because the antialiasing doesn't seem stable at constant resolution on the same machine & browsers when you repeat tests. When you do a fuzzy compare (ie. allow for X pixels difference), then you are always chasing the golden middle. A test I would like to see for a control is trigger multiple state transitions (for example change 5 properties of a chart), do assertions on the generated DOM.

Unless maybe some HNer knows how to do such SVG/picture testing non flaky?

Re: Show HN: Frappe Charts – GitHub inspired JavaScript charting with zero dependencies

#89

Earlier quoted context omitted.

The library author has already invested probably hundreds of hours creating the library; if someone who benefits from it only has to spend tens of hours writing the unit tests, they've saved an order of magnitude of time. We need to stop thinking of OSS as something we're entitled to, that if a stranger doesn't put in enough free labour we're allowed to complain about it. I try to view my dependencies as favours othe…

And we need to stop thinking of criticism as complaining. I'm very grateful for the OSS dependencies that I use in my projects and often contribute back to them, but I wouldn't touch a project without tests with a ten foot pole. I don't mean that in a bad way, for others it might fit their requirements fine. I'm guessing the author of this project would like people to actually use it, so I don't know why we should av…

Yeah, it's fair to provide criticism... my issue was more with the idea that the library author is responsible for doing what the consumers request, that the burden is 100% on the author. In my ideal world, this project would now be a community effort, and anything the community wants can be implemented by the community.

Re: Show HN: Frappe Charts – GitHub inspired JavaScript charting with zero dependencies

#90

It's so good! I am thoroughly impressed with its performance and the dynamic data binding. I discovered in comments that there's a frappe-gantt chart as well, would be nice if such "extra" plugins were listed on homepage (since the gantt example is even more impressive!). All the best for the project. Are you looking for community contributions?

Yes, community contributions are always welcome. Right now, we have specifically covered the cases we needed for our product. So, it'd be cool if we can make these as generic as possible.
Post reply on HN