mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-18 03:25:55 +00:00
ncplot: add labelaxisd, use it in keyplot #438
This commit is contained in:
parent
baa233634b
commit
2a7ccffec6
@ -31,9 +31,9 @@ typedef struct ncplot_options {
|
||||
// dependent min and max. set both equal to 0 to
|
||||
// use domain autodiscovery.
|
||||
int64_t miny, maxy;
|
||||
bool labelaxisd; // label dependent axis
|
||||
bool exponentialy; // is dependent exponential?
|
||||
// independent variable is vertical, not horizontal
|
||||
bool vertical_indep;
|
||||
bool vertical_indep; // vertical independent variable
|
||||
} ncplot_options;
|
||||
```
|
||||
|
||||
|
@ -2518,15 +2518,14 @@ typedef struct ncplot_options {
|
||||
// applied across the domain between these two.
|
||||
uint64_t maxchannel;
|
||||
uint64_t minchannel;
|
||||
// number of "pixels" per row x column
|
||||
ncgridgeom_e gridtype;
|
||||
ncgridgeom_e gridtype; // number of "pixels" per row x column
|
||||
// independent variable can either be a contiguous range, or a finite set
|
||||
// of keys. for a time range, say the previous hour sampled with second
|
||||
// resolution, the independent variable would be the range [0..3600): 3600.
|
||||
// if rangex is 0, it is dynamically set to the number of columns.
|
||||
uint64_t rangex;
|
||||
// y axis min and max. for autodiscovery, these must be equal
|
||||
int64_t miny, maxy;
|
||||
int64_t miny, maxy; // y axis min and max. for autodiscovery, set them equal.
|
||||
bool labelaxisd; // generate labels for the dependent axis
|
||||
bool exponentialy; // is y-axis exponential? (not yet implemented)
|
||||
// independent variable is vertical rather than horizontal
|
||||
bool vertical_indep;
|
||||
|
@ -34,6 +34,7 @@ int main(void){
|
||||
planes.emplace_back(6, plotlen, 23, 1, nullptr);
|
||||
planes.emplace_back(6, plotlen, 31, 1, nullptr);
|
||||
struct ncplot_options popts{};
|
||||
popts.labelaxisd = true;
|
||||
std::array<struct ncplot*, 5> plots;
|
||||
for(auto i = 0u ; i < plots.size() ; ++i){
|
||||
popts.maxchannel = 0;
|
||||
|
@ -167,6 +167,7 @@ typedef struct ncplot {
|
||||
unsigned slotstart; // slot index corresponding to slotx
|
||||
uint64_t slotx; // x value corresponding to slots[slotstart]
|
||||
unsigned slotcount;
|
||||
bool labelaxisd; // label dependent axis
|
||||
bool exponentialy;
|
||||
bool detectdomain;
|
||||
} ncplot;
|
||||
|
@ -48,6 +48,7 @@ ncplot* ncplot_create(ncplane* n, const ncplot_options* opts){
|
||||
ret->maxy = opts->maxy;
|
||||
ret->vertical_indep = opts->vertical_indep;
|
||||
ret->gridtype = opts->gridtype;
|
||||
ret->labelaxisd = opts->labelaxisd;
|
||||
ret->exponentialy = opts->exponentialy;
|
||||
ret->detectdomain = opts->miny == opts->maxy;
|
||||
ret->windowbase = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user