Closed phdoerfler closed 3 years ago
On a side note: I don't suppose a SparseVector
is what I'm looking for to best model the missing values, is it?
On another side note: how does breeze know in which order to plot the map’s keys? After all it’s not an OrderedMap
and I think my code compiled even without having an implicit Ordering
for Instant
.
Turns out, if I clone the repo and remove the Map
DomainFunction
implicit breeze still compiles. It would seem the implicit is unused and thus my search for code using relying on it was deemed fruitless from the very beginning.
Alright, I think I figured it out. It didn't help that I'm not an English native speaker. Once I learned what function domain translates to the veil of confusion started to lift itself.
What happened so far
I searched for libraries to do one dimensional morphological operations on signals, re-discovered breeze, looked through the quickstart and lo and behold discovered this:
Awesome!
We're finally approaching python numpy levels of
plot(whatever)
, excellent!Despite being a complete Breeze newb I managed to plot some data from a Prometheus DB:
Next thing was to deal with the missing values just like Prometheus did in its graph. It was not long that I was writing my own
DomainFunction
implicit. Fast forward: I saw that there is an implicit for plotting Maps. Perfect, I thought, since my data looks like this:or, a few maps later:
But how would I feed it to
plot
? After all, it takes an X and a Y and that Map already has both of those. Glancing at the source I wasn't any wiser:It knows what the domain, the x axis, is and it knows how to get the values, the y axis, based on the domain. Right?
So why can't I just
plot(mappy)
? Since there's already an implicit forMap
, is there any code that uses it? I searched the source on Github to no avail. fwiw out of curiosity:did at least compile and give me:
A straight line. Not overly surprising.
So: How to plot a
Map
? I might be persuaded into filing a PR for adding this to the quickstart once I know how to do it, so the next person (AKA me in a few months) won't have to scratch their head.