Hacker News new | past | comments | ask | show | jobs | submit login

This looks clever but probably not practical.



Why not? It looks very practical to me.

Currently when wanting a chart on a webpage I would fetch the data, transform it to the needed javascript array, add that to the HTML, and then initialize the javascript library painting the chart. With a CSS solution I'd just create a HTML-datatable instead, apply the needed classes and have it be rendered directly. It looks easier, faster and more accessible to me.

The example graphs are a bit flat, but that's just default styling. That's likely changeable with CSS, and animations can also be added that way, there are example for that linked in the docs.

Awesome project.


Or just use SVG?

I’d highly doubt there were browsers supporting these CSS hacks but not supporting SVG.


That's not close to the same complexity, is it?

With the HTML + CSS solution, all my program has to produce is a HTML table. Very easy.

With SVG my program has to create not just a data table, but the custom SVG code to paint the chart, down to each bar. I'm actually doing that on pc-kombo, https://www.pc-kombo.com/us/benchmark/games/cpu/compare?ids%... shows it, the image is SVG. But it's created with https://github.com/DannyBen/victor/, so my ruby code has to describe all the details of that image, including manually saying how each bar chart should look and where on the coordinate system the text goes. Even with the awesome victor library that wasn't all that easy.

Alternative is a JS library that produces the SVG code, but then it's exactly as complicated as with regular JS libraries, it just changes the output.


This is absolutely practical. Especially with pages with a large number of chart elements. Using larger libs for parklines is impractical. I can totally seeing this being able to extent to the type of chart you would typically put in a PowerPoint.. And how practical is that. Sure not full js charts like amcharts and co, but libs like that ships with 90% of code which 90% of users do not use (sure I’m exaggerating here).


It is an amazing proof of concept. Just think of the possibility to easily draw Charts without SVG and the need of JavaScript. There are still some niche use cases for JavaScript disabled browsers.


Marketing pages always love to have big pretty bar charts to compare whizbang product with the old standbys. This would be great to make a big hero chart that looks good, doesn't need any javascript, and has amazing SEO (the raw table data is slurped down by google indexing).


I think could definitely be a practical use for super simple visualizations (think inline sparklines)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: