Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
μPlot v1.1 – now with log scales support (leeoniya.github.io)
112 points by leeoniya on Aug 2, 2020 | hide | past | favorite | 15 comments


I integrated uPlot into my small SaaS product a few weeks ago. Not only was it easy to do, leeoniya quickly answered a question of mine on GitHub about custom line shapes.

leeoniya, if you’re reading this, please apply to GitHub sponsors so I can give you money.


This library is great.

Computers are so fast these days. It’s amazing how crap they do often are when it comes to plotting a few thousand data points.


i tagged v1.1 a bit ago, with lots of goodies and new demos.

main project page: https://github.com/leeoniya/uPlot


If you have the bandwidth to write a Python wrapper and a Jupyter extension (in JS [0]), you would make uPlot appealing to quite a few data science folks (like me).

0. https://jupyter-notebook.readthedocs.io/en/stable/extending/...


i'm a bit worried this will be a pretty deep rabbit hole in terms of unpaid support issues. since i'm not a python dev nor am familiar with Jupyter, this will likely occupy too much of my time.

if someone more familiar is willing to contribute an integration, i'd be happy to review it and answer questions.

it may help to use https://github.com/plotly/plotly.py as a starting point, then gut the relevent parts.


If you want to make a way to earmark contributions toward this feature, I'd be happy to help support (and probably many others).


This is very cool. One slightly annoying thing I found in these demo is that the width of the labels in the legend isn't fixed, so stuff keeps shifting around. One of those rather annoying to fix things. (Though this being JS maybe not as much)


yeah, uplot doesnt do much in terms of auto-sizing. both title and legend are in DOM, so it's just a matter of some css foo. all the demos in the repo are starting points and not really meant to be fully polished.

if you feel like PRing an improvement i'll certainly review it.


There's a table of numbers in the readme but it has no headers so I don't know what it means.


woops, that's a botched manual copy-pasta from the generated table here:

https://github.com/leeoniya/uPlot/blob/master/bench/table.md

i'll fix it soon.


With all due respect for the library and its beautiful showcase of demos, why do we apparently keep having to re-invent the wheel? Log-scaling axes seems like one of the most fundamental features in any plotting library. How many dev hours are wasted implementing logarithmic axis scaling for the umpteenth time?


you can dismiss almost anything by that logic.

why do we need 100 implementations of SQL parsers & relational dbs?

why do we need to have 4 different js engines? graphics APIs? memory allocators? operating systems?

why do we need 100 different companies making slight variations of a smartphone?

why did i write uPlot when there are already 100 js charting libs out there?

> Log-scaling axes seems like one of the most fundamental features in any plotting library.

the overwhelming majority of line charts in this world are not logarithmic. the only things which are "most fundamental" are axes lines, axis ticks/labels, series legend, chart title and connected datapoints.

if you've ever implemented anything even as simple as a log axis, you would realize there is not just 1 way to do it, despite the math being the same. there was no way for me to simply "use" someone else's already-invented log axis because it would not fit properly into uPlot's architecture. so it had to be re-implemented.

> How many dev hours are wasted implementing logarithmic axis scaling for the umpteenth time?

rest assured that the amount of dev hours "wasted" on this feature is many orders of magnitude less (see what i did there?) than it took to re-invent yet another message board that you're using right now :D


uPlot really is amazing. My dream is that one day all the CSS Houdini[1] tech will be finished and widely supported and someone will create a version of it on top of the layout/painting/font-metrics APIs that is equally performant while fully responsive w.r.t. to container size and dynamic data.

[1] https://ishoudinireadyyet.com/


The log demo only shows Log Y Scale. Am I to assume that it can also do Log/Log scales or Log X scale too?


yes, it can do both. though the default tick & axis label metrics are probably biased towards vertically stacked labels. so that would probably be tweaked for horizontal log x since the default label density will cause run-ins.




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

Search: