Add icon labels

This commit is contained in:
Rich Lott / Artful Robot 2025-03-31 11:41:35 +01:00
parent dde3c8ec96
commit 8591d6c060
2 changed files with 51 additions and 14 deletions

View file

@ -51,13 +51,43 @@
</linearGradient>
</defs>
<path ng-repeat="p in $ctrl.sankey.snakes"
d="{{p.d}}"
fill="{{p.fill}}"
fill-opacity=0.5
>
<title>{{p.source.contact_count}} {{p.fromCat.label}} → {{p.toCat.label}}</title>
</path>
<g transform="translate({{$ctrl.sankey.labelWidth}})">
<path ng-repeat="p in $ctrl.sankey.snakes"
d="{{p.d}}"
fill="{{p.fill}}"
fill-opacity=0.5
>
<title>{{p.source.contact_count}} {{p.fromCat.label}} → {{p.toCat.label}}</title>
</path>
</g>
<!-- to-side labels -->
<g transform="translate({{$ctrl.sankey.labelWidth + $ctrl.sankey.snakeWidth}})">
<rect ng-repeat="toAna in $ctrl.sankey.analysisArray"
x=0
y="{{toAna.y}}"
width=16
height="{{toAna.toCatHeight}}"
fill="{{toAna.cat.color}}"
></rect>
<foreignobject ng-repeat="toAna in $ctrl.sankey.analysisArray"
x="20" y="{{toAna.y}}" width="{{$ctrl.sankey.labelWidth}}" height="{{toAna.thisCatHeight}}">
<span class=sankey-label style="display:block;color:{{toAna.cat.color}}"><i class="crm-i {{toAna.cat.icon}}" title="{{toAna.cat.label}}"></i></span>
</foreignobject>
</g>
<!-- from-side labels -->
<g transform="translate({{$ctrl.sankey.labelWidth - 16}})">
<rect ng-repeat="toAna in $ctrl.sankey.analysisArray"
x=0
y="{{toAna.y}}"
width=16
height="{{toAna.fromCatHeight}}"
fill="{{toAna.cat.color}}"
></rect>
<foreignobject ng-repeat="toAna in $ctrl.sankey.analysisArray"
x="-32" y="{{toAna.y}}" width="32" height="{{toAna.thisCatHeight}}">
<span class=sankey-label style="display:block;color:{{toAna.cat.color}}"><i class="crm-i {{toAna.cat.icon}}" title="{{toAna.cat.label}}"></i></span>
</foreignobject>
</g>
<!--
<g ng-repeat="label in $ctrl.sankey.labels">
<text x="{{$ctrl.sankey.labelWidth - 4}}"