
μPlot v1.1 – now with log scales support - leeoniya
https://leeoniya.github.io/uPlot/demos/log-scales.html
======
conroy
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.

------
dan-robertson
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.

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

main project page:
[https://github.com/leeoniya/uPlot](https://github.com/leeoniya/uPlot)

~~~
dr_kiszonka
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/...](https://jupyter-
notebook.readthedocs.io/en/stable/extending/frontend_extensions.html)

~~~
leeoniya
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](https://github.com/plotly/plotly.py) as
a starting point, then gut the relevent parts.

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

------
gan25
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?

~~~
leeoniya
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

------
stupidcar
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/](https://ishoudinireadyyet.com/)

------
karmakaze
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?

~~~
leeoniya
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.

