From 4ccb2badd6a1a74b40ea989bcf5aa95f47451b65 Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Sun, 9 Jun 2024 18:39:13 +0200 Subject: [PATCH] add share statistics component --- src/lib/components/Enterprise.svelte | 33 +-- src/lib/components/ShareHolders.svelte | 8 +- src/lib/components/ShareStatistics.svelte | 247 ++++++++++++++++++++++ src/routes/stocks/[tickerID]/+page.svelte | 8 + 4 files changed, 278 insertions(+), 18 deletions(-) create mode 100644 src/lib/components/ShareStatistics.svelte diff --git a/src/lib/components/Enterprise.svelte b/src/lib/components/Enterprise.svelte index dc4a74f0..b09c7376 100644 --- a/src/lib/components/Enterprise.svelte +++ b/src/lib/components/Enterprise.svelte @@ -188,7 +188,8 @@ $: { id={"enterpriseValueInfo"} /> - + + {#if isLoaded} {#if rawData?.length !== 0}
@@ -210,29 +211,29 @@ $: {
- - + + Enterprise Value
- - + + Mkt Cap
- - + + Debt
- - + + Cash Equivalents @@ -241,12 +242,16 @@ $: {
+ {/if} + {:else} -

- No data available - -

- +
+
+ +
+
{/if} diff --git a/src/lib/components/ShareHolders.svelte b/src/lib/components/ShareHolders.svelte index 15717367..b772d389 100644 --- a/src/lib/components/ShareHolders.svelte +++ b/src/lib/components/ShareHolders.svelte @@ -184,16 +184,16 @@ $: {
- - + + Others: {otherOwner >= 99.99 ? 99.99 : otherOwner?.toFixed(2)}%
- - + + Institutions: {institutionalOwner <= 0.01 ? "< 0.01%" : institutionalOwner?.toFixed(2)+'%'} diff --git a/src/lib/components/ShareStatistics.svelte b/src/lib/components/ShareStatistics.svelte new file mode 100644 index 00000000..3005da79 --- /dev/null +++ b/src/lib/components/ShareStatistics.svelte @@ -0,0 +1,247 @@ + + + + + +
+
+ +
+ + +
+ + {#if isLoaded} + + {#if rawData?.length !== 0} +
+ +
+
+ {$displayCompanyName}'s' has {abbreviateNumber(lastOutstandingShares)} shares outstanding with {abbreviateNumber(lastFloatShares)} of those shares currently floating. +
+
+ + + +
+ +
+
+ +
+
+ + + + Floating Shares + +
+
+ + + + Outstanding Shares + +
+ +
+
+ + {/if} + + {:else} +
+
+ +
+
+ {/if} + +
+
+ + + + + \ No newline at end of file diff --git a/src/routes/stocks/[tickerID]/+page.svelte b/src/routes/stocks/[tickerID]/+page.svelte index 392132d9..891f322b 100644 --- a/src/routes/stocks/[tickerID]/+page.svelte +++ b/src/routes/stocks/[tickerID]/+page.svelte @@ -1269,6 +1269,14 @@ function changeChartType() { + + +
+ {#await import('$lib/components/ShareStatistics.svelte') then {default: Comp}} + + {/await} +
+