Lurker News

Comments (87) 23 threads

Earlier comments
eridius1 reply#
Is the annual heatmap supposed to be empty?

Also, for the clickable charts, clicking on the popover should count as well. If the bar is really short it can be quite hard to click on, such as the 2007 entry in the first chart.

pratu16x7#
We gave it too less data than it deserved I believe.

Thanks for reporting the click problem. Would you mind creating an issue at GitHub, so that we can keep track?

jazoom3 replies#
This looks great. Can I ask why you didn't use chart.js?
developer2#
I would also appreciate an answer to this question. It's not about "why'd you reinvent the wheel", but rather that I suspect you must have found chart.js while searching for options and decided something was missing or could be improved. I am interested to know how they compare, to have an idea how seriously I should look into this new option.
opmac#
Because Javascript.
pratu16x71 reply#
The argument would be no different from all the products out there who design their own UI (MUX, GitHub). Our framework Frappé (and product ERPNext) has a great emphasis on minimal style, and we really wished the charts to be free of visual clutter (not have too many measure markings for instance). Something that even the customizing API should take care off. Chartjs is awesome and very comprehensive, it just didn't go too well with our look and feel :)
jazoom#
chart.js isn't perfect, but it's pretty easy to customise and remove/change any element you don't like. I find it hard to believe it was easier for you to create an entirely new charting library than to set the option to remove ticks.

I'm not complaining because it's always good to have options and I really like the look of your library. I just find it a very curious use of resources.
Of course, it's your business and you can do whatever you like with it regardless of whether you have a good reason. :-)

harunurhan5 replies#
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.

RubenSandwich#
I don't see how that isn't a good trade as defects only compound on larger projects. In fact without tests, which basically function as a spec, how can you be sure that your refactor still works as the previous version?
iamflimflam1#
Interesting - that 25% seems to come from managers estimating the impact, not from developers.

  Increase in time taken to code the feature because 15–20% 25–35% 15% 25–20%
  of TDD (%) [Management estimates]
And this seems to imply that any increase in time was offset by reduced maintenance costs due to improved quality.

  Another interesting observation from the outcome measures in Table 3 is the increase in
  time to develop the features attributed to the usage of the TDD practice, as subjectively
  estimated by management. The increase in development time ranges from 15% to 35%.
  From an efficacy perspective this increase in development time is offset by the by the
  reduced maintenance costs due to the improvement in quality (Erdogmus and Williams
  2003), an observation that was backed up the product teams at Microsoft and IBM.
bonyboy#
Microsoft uses WordPress?

TIL

sillysaurus34 replies#
Judge work by what it does, not by what it doesn't have.

Like users, programmers don't care whether programs have tests as long as it does what it needs to do.

harunurhan2 replies#
So I should wait until stuff starts breaking, then start complaining.
XR0CSWV3h3kZWg3 replies#
If nothing breaks why would you complain?

Continue this thread — 3 replies

sillysaurus33 replies#
Yeah.

Continue this thread — 3 replies

simplify1 reply#
Tests are a way to judge what it does. It does the judging for you, ensuring features work as advertised, and provide usage examples that are guaranteed to work.
Fifer82#
They are also boring as fuck and assume no talent for a project of this scope.
dabernathy89#
While this is true for you and me, this isn't true for a huge number of developers.
opmac#
Speak for yourself... that's quite the generalization. I'm a programmer, and I care when something doesn't have tests, especially if it's my own code.
handbanana2 replies#
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? ;)
methodin1 reply#
Why would lack of tests be a measure for your desire to contribute?
dflock#
Possibly because it doubles the amount of work to make small changes, because you also have to learn the testing setup and write tests for your change?
trevor-e2 replies#
> 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 your library.

joshwcomeau2 replies#
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 other people have done for me. You wouldn't nitpick about a lack of tests after someone wrote a whole charting library for you; you'd thank them and add your own tests.

Continue this thread — 2 replies

handbanana#
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

thrownaway954#
maybe you could start contributing to the project by helping writing some tests? i see that this is a library for a product that develop, so this might be a project they just extracted from that. as such it most likely was already has the "works on my box" seal of approval :)
vortico1 reply#
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.
cloverich#
You can test more than you'd realize: The generated math, the number of axes and number of visible points, etc. I'm not saying its def. a valuable use of time here, but I've been surprised how investing a little bit in helper methods (like, `getSelectedOption` or `isVisible`, etc) can generate quite useful and expressive unit tests.
pteredactyl1 reply#
D3 doesn’t have dependencies. Why use this?
ryantbrown1 reply#
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).
cormacrelf1 reply#
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 <5kb of D3-dependent code. With the added benefit that:
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 through unnecessary and unfamiliar re-implementations of D3 primitives. So many requirements I've seen involve tweaking visuals just far enough that a pre-baked library ceases to cut it.
3. Chart authors can rely on those primitives for a less buggy experience, given that they are tested and used elsewhere
4. D3 already supports IE9+, which this library doesn't
5. You have the power of D3 to build your own dataviz

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

Load more comments