open-nomad/ui/app/templates/components/distribution-bar.hbs
Michael Lange cd6d4e41e5 Fix multiple highlight bug in the distribution-bar component
Caused by the re-indexing that occurs to remove zero-value bars.
2018-08-21 16:37:36 -07:00

29 lines
801 B
Handlebars

<svg>
<defs>
<clipPath>
<rect class="mask" x="0" y="0" width="100%" height="100%" rx="2px" ry="2px" />
</clipPath>
</defs>
<g class="bars"></g>
</svg>
{{#if hasBlock}}
{{yield (hash
data=_data
activeDatum=activeDatum
)}}
{{else}}
<div class="chart-tooltip {{if isActive "active" "inactive"}}" style={{tooltipStyle}}>
<ol>
{{#each _data as |datum index|}}
<li class="{{if (eq datum.label activeDatum.label) "active"}}">
<span class="label {{if (eq datum.value 0) "is-empty"}}">
<span class="color-swatch {{if datum.className datum.className (concat "swatch-" index)}}" />
{{datum.label}}
</span>
<span class="value">{{datum.value}}</span>
</li>
{{/each}}
</ol>
</div>
{{/if}}