question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

feature: multiple x axis to combine different time precisions

See original GitHub issue

assume we have multiple time series with different time precisions / resolutions / divisions: some series are value per year, others are value per month, others are value per week

currently we must preprocess our data to match the highest value frequency (here: value per week) and repeat values with lower frequencies (annual data: same value for all 52 weeks) (please tell me im wrong …)

here is a plot of annual and monthly values:

what is ugly here are the circles in the white annual line - they are too many

disabling the circles completely is a bad solution

possible workarounds: use nulls/gaps to encode missing values show only every N-th circle (others?) … but these still require to merge x values into one axis

possible solution: currently, data[0] holds the x values, and all other data[i] hold y values we could introduce a mapping between arrays, mapping x values to y values or more general, map input values to output values

the default mapping would be

datamap: [
  [0, 1], // f(d0) -> d1
  [0, 2], // f(d0) -> d2
  [0, 3], // f(d0) -> d3
  [0, 4], // f(d0) -> d4
  // ....
]

to combine annual and weekly x values, we could then use

datamap: [
  [0, 1], // f(d0) -> d1
  [2, 3], // f(d2) -> d3
]

or plot functions with multiple inputs

datamap: [
  [0, 1, 2], // f(d0, d1) -> d2
  [3, 4], // f(d3) -> d4
]

or we extend opt.series[i] like

series: [
  {
    label: "T year",
    axis: 0, // x axis
  },
  {
    label: "T month",
    axis: 0, // x axis
  },
  {
    label: "N year",
    axis: 1, // y axis
    input: 0,
    // this is an output/value series
    // with series 0 (T year) as single input/key
  },
  {
    label: "N month",
    axis: 1, // y axis
    input: 1,
    // this is an output/value series
    // with series 1 (T month) as single input/key
  },
]

in the future we might need 3D plotting and MISO functions (multi input, single output) (not sure if MIMO makes much sense)

@leeoniya please share your thoughts so i can make a better PR : )

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
leeoniyacommented, Dec 17, 2020

im happy to help … or do you mean SIGNIFICANT?

you’re welcome to help. but, yes, i think it will be very substantial as the underlying data format assumptions permeate many parts of the internals. it’s not gonna be as simple as tweaking just the pathbuilder, for example. the probability of not breaking many things to get this done is basically zero, imo.

the ultimate question is, what gains do you expect in non-artificial cases, and can you prove that this will work robustly and generally. if someone tells me that they need better perf on a 10M pts scatter dataset, the simple answer is that this is not the right library to use - at some point, this just becomes true. so, it’s important to evaluate real use-cases, costs and possible gains from this effort.

simple, im plotting global population data over the last 500 years (or more)

this is an arbitrary number. is that 500 datapoints? 500 * 52 datapoints? 500 * 365 * 24 * 3600 datapoints? as i said, i would be interested to see how uPlot.join() performs on your dataset, and its details.

edit: this would make #107 easier to solve

scatter/bubble is much easier (not easy) to solve with a different underlying data structure (as described there), which is the plan. if you’d like to help with that, i think it will be a much better use of time 😃 i don’t plan to work on that for a few more months due to other work, so cannot promise a timely PR review either, unfortunately.

0reactions
leeoniyacommented, Dec 17, 2020

gonna close this since i don’t think there is anything actionable here. feel free to follow up in this thread if you have perf issues with a specific use-case/dataset.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Display Data with Multiple Scales and Axes Limits
Learn about techniques for visualizing data with multiple x- and y-axes, multiple colorbars, or with an x-axis that is broken into intervals.
Read more >
Line chart options | Looker
You can separate, or trellis, a chart into several smaller charts, each representing a single ... The x-axis is labeled with appropriate time...
Read more >
Create and use a combo chart—ArcGIS Insights
A combo chart is a nonspatial tool that can be used to display a column chart and a line graph on the same...
Read more >
Time series reference - Looker Studio Help
Individual metrics are plotted as a series of data points (also called "markers") between the 2 axes. You can have separate left and...
Read more >
introduction to data visualization with ggplot2
This time the x-axis does not contain variables like 5 or 7, ... This lets you map two aesthetics to each point. ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found