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 #96 from 4mile/cam/subtotal-html
Browse files Browse the repository at this point in the history
Subtotal vis - use html field when applicable
  • Loading branch information
RichardCzechowski authored Jul 11, 2019
2 parents 86116dd + 5e78ed0 commit 3cab45f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/subtotal.js

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions src/examples/subtotal/subtotal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const vis: Subtotal = {
for (const key of Object.keys(row)) {
const obj = row[key]
if (pivotSet[key]) continue
ptRow[key] = obj.value
ptRow[key] = obj.html || obj.value
}
if (pivots.length === 0) {
// No pivoting, just add each data row.
Expand All @@ -111,7 +111,8 @@ const vis: Subtotal = {
pivotRow[pivot] = LOOKER_ROW_TOTAL_KEY
}
for (const measure of measures) {
pivotRow[measure.name] = row[measure.name][pivotKey].value
const value = row[measure.name][pivotKey].html || row[measure.name][pivotKey].value
pivotRow[measure.name] = value
}
}
} else {
Expand All @@ -120,7 +121,8 @@ const vis: Subtotal = {
pivotRow[pivots[i]] = pivotValues[i]
}
for (const measure of measures) {
pivotRow[measure.name] = row[measure.name][flatKey].value
const value = row[measure.name][flatKey].html || row[measure.name][flatKey].value
pivotRow[measure.name] = value
}
}
ptData.push(pivotRow)
Expand Down

0 comments on commit 3cab45f

Please sign in to comment.