Skip to content
This repository has been archived by the owner on Apr 21, 2022. It is now read-only.

Commit

Permalink
Merge pull request #121 from noahamac/master
Browse files Browse the repository at this point in the history
adding error handling for no results in the LFG viz
  • Loading branch information
swhitey committed Jan 10, 2020
2 parents 3bdf48c + 00d336f commit abe1cf6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/examples/liquid_fill_gauge/liquid_fill_gauge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ const vis: LiquidFillGaugeVisualization = {
this.svg.attr('id', elementId)
},
// Render in response to the data or settings changing
update(data, element, config, queryResponse) {
update(data, element, config, queryResponse, details) {
if (!handleErrors(this, queryResponse, {
min_pivots: 0, max_pivots: 0,
min_dimensions: 0, max_dimensions: undefined,
Expand All @@ -222,6 +222,9 @@ const vis: LiquidFillGaugeVisualization = {
if (gaugeConfig.maxValue <= 0) {
this.addError({ group: 'config', title: 'Max value must be greater than zero.' })
return
} else if (data.length === 0) {
this.addError({ title: 'No results.' })
return
} else {
this.clearErrors('config')
}
Expand Down

0 comments on commit abe1cf6

Please sign in to comment.