Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle situations where no data are present #1887

Closed
stormpython opened this issue Nov 11, 2014 · 2 comments · Fixed by #2300
Closed

Handle situations where no data are present #1887

stormpython opened this issue Nov 11, 2014 · 2 comments · Fixed by #2300
Assignees
Labels
bug Fixes for quality problems that affect the customer experience discuss Feature:Vislib Vislib chart implementation PR sent
Milestone

Comments

@stormpython
Copy link
Contributor

The current solution to handle situations where no data are present is to check the hits parameter on the elasticsearch response. If hits === 0, then an error is thrown and the visualize directive displays a no results found message in place of the chart.

While this deals with situations where there are no hits, it doesn't fully address the issue. There are other ways in which an Elasticsearch response with no data can be sent to the visualization library. I am not completely sure of all the ways that this can happen, but it would be great to have a list of all the ways in which this particular situation can manifest. I will attempt to start one below.

@rashidkpc @spenceralger @jthomassie @w33ble @lukasolson @simianhacker feel free to add to the list or add to the discussion ways in which to handle these situations.

  1. A user does a search where empty buckets are returned. In these instances, the hits count can be greater than zero, but the buckets are empty. In this situation, the visualization library renders an empty chart or throws an error if the chart rendering depends on data stored in the data object.
  2. Elasticsearch returns a response where all the values are zero. In which case, a chart is rendered with nothing in it.

In my opinion, case 2, isn't actually a bug. A visualization library should render 0 values. It is a valid response. Somethings have zero values and we even purposely introduce zero values with our zero_injection function. I think it would be very difficult to determine when and when not to display zero values. I think the real issue is to distinguish between values of 0 and elasticsearch responses that return nothing.

Zero is equal to nothing, but nothing isn't always equal to zero

Thoughts?

@stormpython stormpython added bug Fixes for quality problems that affect the customer experience Feature:Vislib Vislib chart implementation labels Nov 11, 2014
@stormpython
Copy link
Contributor Author

My current thoughts on how to address this are as follows:

  1. In cases where the visualization library receives an elasticsearch response with an empty rows, columns, series, or slices.children array, we should catch that in the vis render call and bubble an error up to the visualize directive. This to me is the easiest fix for obvious cases of no data.
  2. In cases where we have multiple charts in a visualization with some charts having data and others not, I think we should handle this at the chart level. I am still not sure of all the ways in which this can manifest, so I don't know the best solution to implement here.

@stormpython stormpython added this to the 4.0.0-BETA3 milestone Nov 11, 2014
@spalger
Copy link
Contributor

spalger commented Nov 12, 2014

I think it might be fair to rename this "visualization error handling should be done in one place".

Our solution would hopefully support arbitrary errors that can occur within a visualization:

  • could not find the vis
  • the vis could not load it's related objects
  • the container is too small to be useful
  • there isn't enough data
  • there was a code error, unexpected exception
  • etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience discuss Feature:Vislib Vislib chart implementation PR sent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants