-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
145 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
export default function setChartHeight() { | ||
//Match chart height to number of bars currently displayed. | ||
this.raw_height = | ||
(+this.config.range_band + this.config.range_band * this.config.padding) * | ||
this.y_dom.length; | ||
this.raw_height = this.filtered_data.length | ||
? (+this.config.range_band + this.config.range_band * this.config.padding) * | ||
this.y_dom.length | ||
: 100; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function setXDomain() { | ||
if (this.filtered_data.length === 0) this.x_dom = [0, 0]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 11 additions & 9 deletions
20
src/chart/onLayout/updateFilterEventListeners/updateSelectAll.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
export default function updateSelectAll(d, selectedOptions) { | ||
//Update filter object. | ||
const filter = this.filters.find(filter => filter.col === d.value_col); | ||
filter.val = selectedOptions; | ||
const checked = filter.val.length === filter.choices.length; | ||
filter.val = d.multiple ? selectedOptions : selectedOptions.pop(); | ||
|
||
//Update checkbox. | ||
const checkbox = this.controls.filters.checkboxes | ||
.filter(di => di.value_col === d.value_col) | ||
.attr( | ||
'title', | ||
checked ? `Deselect All ${d.label} Options` : `Select All ${d.label} Options` | ||
) | ||
.property('checked', checked); | ||
if (d.multiple) { | ||
const checked = filter.val.length === filter.choices.length; | ||
const checkbox = this.controls.filters.checkboxes | ||
.filter(di => di.value_col === d.value_col) | ||
.attr( | ||
'title', | ||
checked ? `Deselect All ${d.label} Options` : `Select All ${d.label} Options` | ||
) | ||
.property('checked', checked); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export default function addNoDataIndicator() { | ||
this.svg.select('.qo-no-data').remove(); | ||
console.log(this.filtered_data); | ||
if (this.filtered_data.length === 0) | ||
this.svg | ||
.append('text') | ||
.classed('qo-no-data', true) | ||
.attr({ | ||
x: this.plot_width / 2, | ||
y: this.plot_height / 2, | ||
'text-anchor': 'middle' | ||
}) | ||
.text('No queries selected. Verify that no filter selections are in conflict.'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
export default function truncateCellText() { | ||
this.tbody | ||
.selectAll('td') | ||
.attr('title', d => d.text) | ||
.filter(d => d.text.length > this.chart.initialSettings.truncation_cutoff) | ||
.text(d => `${d.text.substring(0, this.chart.initialSettings.truncation_cutoff)}...`); | ||
if (this.data.raw.length) | ||
this.tbody | ||
.selectAll('td') | ||
.attr('title', d => d.text) | ||
.filter(d => d.text.length > this.chart.initialSettings.truncation_cutoff) | ||
.text(d => `${d.text.substring(0, this.chart.initialSettings.truncation_cutoff)}...`); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters