From ec480afd276e684ba66a0a3a03c41582c91765cc Mon Sep 17 00:00:00 2001 From: Alexander Weber Date: Mon, 26 Aug 2024 19:05:38 +0200 Subject: [PATCH] third region is grayed out only if more than 3 regions exists --- src/lib/components/RevenueSegmentation.svelte | 559 ++++++++---------- 1 file changed, 258 insertions(+), 301 deletions(-) diff --git a/src/lib/components/RevenueSegmentation.svelte b/src/lib/components/RevenueSegmentation.svelte index 83e300b3..a76c832c 100644 --- a/src/lib/components/RevenueSegmentation.svelte +++ b/src/lib/components/RevenueSegmentation.svelte @@ -1,362 +1,319 @@ - - -
-
- +
- - + +
- {#if userTier === 'Pro'} - {#if isLoaded} - {#if Object?.keys(data)?.length !== 0 && totalProductRevenue !== 0} - -
-
- Based on the latest earnings report - the main contributors of revenue are: -
- -
-
- + {#if userTier === "Pro"} + {#if isLoaded} + {#if Object?.keys(data)?.length !== 0 && totalProductRevenue !== 0} +
+
Based on the latest earnings report the main contributors of revenue are:
-
- - - '#3B82F6'} - colorLinks={d => '#3B82F635'} - /> - - -
- - - Full report - - - -
-
-
- - {#if geographicList?.length !== 0 && totalGeographicRevenue !== 0} -
- The highest revenue was generated in the {geographicList?.length} regions: -
- -
-
- - {#each (showFullStats ? geographicList : geographicList?.slice(0,3)) as item,index} - -
+
+
+
+ + + "#3B82F6"} colorLinks={(d) => "#3B82F635"} /> + + +
-
- {#if item?.name?.toLowerCase() === 'europe'} - - {:else if item?.name?.toLowerCase() === 'taiwan'} - - {:else if item?.code == 'xx'} - - {:else} - Country Logo - {/if} -
+ Full report +
+
+
-
-
- - {item?.name?.length > charNumber ? formatString(item?.name)?.slice(0,charNumber) + "..." : formatString(item?.name)} · ${abbreviateNumber(item?.value)} - - - {(item?.value/totalGeographicRevenue * 100)?.toFixed(2)}% - -
- -
+ {#if geographicList?.length !== 0 && totalGeographicRevenue !== 0} +
+ The highest revenue was generated in the {geographicList?.length} regions: +
-
- - - {/each} - -
-
- {/if} - - {#if geographicList?.length > 2} - - {/if} - - {/if} - - {:else} -
-
- +
+
+ + {#each showFullStats ? geographicList : geographicList?.slice(0, 3) as item, index} +
+
+ {#if item?.name?.toLowerCase() === "europe"} + + {:else if item?.name?.toLowerCase() === "taiwan"} + + {:else if item?.code == "xx"} + + {:else} + Country Logo + {/if} +
+ +
+
+ + {item?.name?.length > charNumber ? formatString(item?.name)?.slice(0, charNumber) + "..." : formatString(item?.name)} · ${abbreviateNumber(item?.value)} + + + {((item?.value / totalGeographicRevenue) * 100)?.toFixed(2)}% + +
+
-
- {/if} - - {:else} -
- - Unlock content with Pro Subscription
- {/if} -
+ {/each} + + + + {/if} + + {#if geographicList?.length > 3} + {/if} + {/if} + {:else} +
+
+ +
+
+ {/if} + {:else} +
+ + Unlock content with Pro Subscription +
+ {/if} +
- - - - - \ No newline at end of file +