feat(ui) - funnels - step percentage

This commit is contained in:
Shekar Siri 2022-05-10 17:50:50 +02:00
parent d619083a85
commit 0174e265e0
2 changed files with 15 additions and 5 deletions

View file

@ -22,7 +22,7 @@ function FunnelBar(props: Props) {
borderRadius: '3px',
overflow: 'hidden',
}}>
<div style={{
<div className="flex items-center" style={{
width: `${completed * 100 / (completed + dropped)}px`,
position: 'absolute',
top: 0,
@ -30,7 +30,9 @@ function FunnelBar(props: Props) {
bottom: 0,
// height: '10px',
backgroundColor: '#00b5ad',
}} />
}}>
<div className="color-white absolute right-0 flex items-center font-medium mr-2 leading-3">10%</div>
</div>
</div>
<div className="flex justify-between py-2">
<div className="flex items-center">
@ -39,7 +41,7 @@ function FunnelBar(props: Props) {
<span>completed</span>
</div>
<div className="flex items-center">
<Icon name="caret-down-fill" color="red" size={18} />
<Icon name="caret-down-fill" color="red" size={16} />
<span className="font-medium mx-1 color-red">20</span>
<span>Dropped off</span>
</div>

View file

@ -206,12 +206,20 @@ const sampleJson = {
value: ['/sessions', '/errors', '/users'],
percent: 100,
completed: 60,
dropped: 0,
dropped: 40,
},
{
type: 'LOCATION',
operator: 'is',
value: ['/sessions', '/errors', '/users'],
value: ['/sessions'],
percent: 80,
completed: 40,
dropped: 20,
},
{
type: 'CLICK',
operator: 'on',
value: ['DASHBOARDS'],
percent: 80,
completed: 40,
dropped: 20,