Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
b131b91
grid for stacked charts
hellobontempo Dec 20, 2021
37c75da
pass in data as arg from parent
hellobontempo Dec 20, 2021
1f37434
pull out vertical bar chart component
hellobontempo Dec 20, 2021
0bbe0b2
refactor to use vertical bar chart component
hellobontempo Dec 20, 2021
07db985
remove any chart handling stuff from parent
hellobontempo Dec 20, 2021
f205420
rename variables
hellobontempo Dec 20, 2021
0b73b0a
refactor horizontal bar chart into separate component
hellobontempo Dec 20, 2021
933004e
move descriptions to inside template (not passed in)
hellobontempo Dec 20, 2021
8768f1f
constructs attribution copy
hellobontempo Dec 21, 2021
7911db3
add sample response to mirage config
hellobontempo Dec 21, 2021
c934ed1
change indenting
hellobontempo Dec 21, 2021
608bfdd
rename to MonthlyUsage
hellobontempo Dec 21, 2021
b097804
change name to running totals
hellobontempo Dec 21, 2021
3befc5e
rename variable
hellobontempo Dec 21, 2021
7f2a109
finishes line chart
hellobontempo Dec 22, 2021
49fc0e2
pull constants to util
hellobontempo Dec 22, 2021
6863af9
cleanup add todos
hellobontempo Dec 23, 2021
41d2bca
fix formatNumbers return"
hellobontempo Dec 23, 2021
26ef446
comments and cleanup
hellobontempo Dec 23, 2021
ee9b44f
adds tooltip to line chart
hellobontempo Dec 23, 2021
ddddace
make cover area larger
hellobontempo Dec 23, 2021
b305b77
fixes tooltip styling
hellobontempo Dec 23, 2021
d473178
adds tooltip styling"
hellobontempo Dec 24, 2021
33f1b2c
adds tooltip modal to horizontal chart
hellobontempo Dec 24, 2021
7988f80
finishes tooltip for horizontal chart
hellobontempo Dec 24, 2021
a4d37a9
remove click event arg
hellobontempo Jan 3, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
adds tooltip styling"
  • Loading branch information
hellobontempo committed Dec 24, 2021
commit d473178b2e361e5e87d523c37300da482a54d33a
11 changes: 8 additions & 3 deletions ui/app/components/clients/vertical-bar-chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ import {

export default class VerticalBarChart extends Component {
@tracked tooltipTarget = '';
@tracked hoveredLabel = '';
@tracked tooltipTotal = '';
@tracked uniqueEntities = '';
@tracked nonEntityTokens = '';

get chartLegend() {
return this.args.chartLegend;
Expand Down Expand Up @@ -116,15 +118,18 @@ export default class VerticalBarChart extends Component {

// MOUSE EVENT FOR TOOLTIP
tooltipRect.on('mouseover', data => {
this.hoveredLabel = data.month;
let hoveredMonth = data.month;
this.tooltipTotal = `${data.total} total clients`;
this.uniqueEntities = `${data.distinct_entities} unique entities`;
this.nonEntityTokens = `${data.non_entity_tokens} non-entity tokens`;
// let node = chartSvg
// .selectAll('rect.tooltip-rect')
// .filter(data => data.month === this.hoveredLabel)
// .node();
let node = chartSvg
.selectAll('rect.data-bar')
// filter for the top data bar (so y-coord !== 0) with matching month
.filter(data => data[0] !== 0 && data.data.month === this.hoveredLabel)
.filter(data => data[0] !== 0 && data.data.month === hoveredMonth)
.node();
this.tooltipTarget = node; // grab the node from the list of rects
});
Expand Down
13 changes: 11 additions & 2 deletions ui/app/styles/core/charts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,22 @@ p.data-details {
.chart-tooltip {
background-color: $ui-gray-700;
color: white;
width: 117px;
font-size: $size-9;
padding: 6px;
border-radius: $radius-large;
> h4 {

.line-chart {
width: 117px;
}

.bold {
font-weight: $font-weight-bold;
}
.vertical-chart {
text-align: center;
flex-wrap: nowrap;
width: fit-content;
}
}

.chart-tooltip-arrow {
Expand Down
4 changes: 2 additions & 2 deletions ui/app/templates/components/clients/line-chart.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
attachment='bottom middle'
offset='35px 0'
}}
<div class="chart-tooltip">
<h4>{{this.tooltipMonth}}</h4>
<div class="chart-tooltip line-chart">
<p class="bold">{{this.tooltipMonth}}</p>
<p>{{this.tooltipTotal}}</p>
<p>{{this.tooltipNew}}</p>
</div>
Expand Down
6 changes: 5 additions & 1 deletion ui/app/templates/components/clients/vertical-bar-chart.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
attachment='bottom middle'
offset='40px 0'
}}
<p class="chart-tooltip">{{this.hoveredLabel}}</p>
<div class="chart-tooltip vertical-chart">
<p>{{this.tooltipTotal}}</p>
<p>{{this.uniqueEntities}}</p>
<p>{{this.nonEntityTokens}}</p>
</div>
<div class="chart-tooltip-arrow" />
{{/modal-dialog}}
{{/if}}