+
+ Real-time and historical data on key economic indicators like GDP,
+ unemployment, and inflation, essential for tracking economic performance
+ and growth trends.
+
+
+
+
+ Federal Fund Rate
+
+
+
+ The federal funds rate is the interest rate at which banks lend
+ to each other overnight to maintain reserve balances. It's a
+ critical tool for U.S. monetary policy, influencing borrowing
+ costs for consumers and businesses, economic growth, and
+ inflation. Changes in the federal funds rate affect everything
+ from loan interest rates to stock market performance, making it
+ a key indicator of economic health.
+
+
+
+
+
+
+
+
+
+ Consumer Price Index (CPI)
+
+
+
+ The CPI measures the average change in prices for a typical
+ basket of goods. It's key for tracking inflation, affecting
+ interest rates, wages, and business decisions. Rising CPI
+ indicates inflation, impacting purchasing power and the overall
+ economy.
+
+
+
+
+
+
+
+
+
+ Gross Domestic Product (GDP)
+
+
+
+ The GDP measures a country's economic performance, representing
+ the total value of all goods and services produced within a
+ specific period. It's a key indicator of economic health, used
+ to compare the economic output of different nations and track
+ growth or decline over time.
+
+
+
+
+
+
+
+
+
+ Unemployment Rate vs Inflation Rate
+
+
+
+ The unemployment rate measures the jobless percentage in the
+ labor force, impacting spending and growth. Low unemployment
+ boosts wages and activity, while high unemployment slows them.
+ The inflation rate tracks price increases, with moderate
+ inflation (~2%) being healthy. These rates are often inversely
+ related and crucial for economic stability, influencing
+ spending, savings, and investment.
+
+
+
+
+
+
+
+
+
+ Treasury Rates
+
+
+
+ Treasury rates are the interest rates that the US government
+ pays on its debt obligations, and they are a key benchmark for
+ interest rates across the economy.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {#each tabs as item, i}
+
+ {/each}
+
+
+
+
+
+
+
Date
+
1-Month
+
2-Month
+
3-Month
+
6-Month
+
1-Year
+
2-Year
+
3-Year
+
5-Year
+
7-Year
+
10-Year
+
20-Year
+
30-Year
+
+
+
+ {#each tableList as item}
+
+
+
+ {item?.date}
+
+
+ {item?.month1}
+
+
+ {item?.month2 !== null ? item?.month2 : "-"}
+
+
+ {item?.month3}
+
+
+ {item?.month6}
+
+
+ {item?.year1}
+
+
+ {item?.year2}
+
+
+ {item?.year3}
+
+
+ {item?.year5}
+
+
+ {item?.year7}
+
+
+ {item?.year10}
+
+
+ {item?.year20}
+
+
+ {item?.year30}
+
+
+ {/each}
+
+
+
+
+ {:else}
+
+
+
+
+
+ {/if}
+
+
+
+
+
+
+
+
diff --git a/src/routes/analysts/[slug]/+page.svelte b/src/routes/analysts/[slug]/+page.svelte
index e3f66567..1d738b30 100644
--- a/src/routes/analysts/[slug]/+page.svelte
+++ b/src/routes/analysts/[slug]/+page.svelte
@@ -8,11 +8,11 @@
let analystStats = data?.getAnalystStats;
- let rawData = data?.getAnalystStats?.ratingsList;
+ let rawData = processTickerData(data?.getAnalystStats?.ratingsList);
let originalData = [...rawData]; // Unaltered copy of raw data
let stockList = rawData?.slice(0, 50) ?? [];
- console.log(rawData);
+
let analystScore = analystStats?.analystScore;
let rank = analystStats?.rank;
let analystName = analystStats?.analystName;
@@ -26,6 +26,34 @@
}).format(analystStats?.numOfAnalysts);
let numOfStocks = analystStats?.numOfStocks;
+ function processTickerData(data) {
+ const tickerMap = new Map();
+
+ data.forEach((item) => {
+ const { ticker, date } = item;
+
+ if (!ticker) return; // Skip if ticker is not defined
+
+ if (!tickerMap.has(ticker)) {
+ // Add the item and initialize count
+ tickerMap.set(ticker, { ...item, ratings: 1 });
+ } else {
+ const existing = tickerMap.get(ticker);
+
+ // Increment the ratings count
+ existing.ratings += 1;
+
+ // Keep the item with the latest date
+ if (new Date(item.date) > new Date(existing.date)) {
+ tickerMap.set(ticker, { ...item, ratings: existing.ratings });
+ }
+ }
+ });
+
+ // Convert the Map back to an array
+ return Array.from(tickerMap.values());
+ }
+
async function handleScroll() {
const scrollThreshold = document.body.offsetHeight * 0.8; // 80% of the website height
const isBottom = window.innerHeight + window.scrollY >= scrollThreshold;
@@ -47,21 +75,25 @@
$: charNumber = $screenWidth < 640 ? 20 : 40;
let columns = [
+ { key: "chart", label: "", align: "right" },
{ key: "ticker", label: "Name", align: "left" },
{ key: "rating_current", label: "Action", align: "left" },
{ key: "adjusted_pt_current", label: "Price Target", align: "right" },
{ key: "price", label: "Current", align: "right" },
{ key: "upside", label: "% Upside", align: "right" },
+ { key: "ratings", label: "Ratings", align: "right" },
{ key: "date", label: "Updated", align: "right" },
];
let sortOrders = {
+ chart: { order: "none", type: "string" },
ticker: { order: "none", type: "string" },
rating_current: { order: "none", type: "string" },
adjusted_pt_current: { order: "none", type: "number" },
marketCap: { order: "none", type: "number" },
price: { order: "none", type: "number" },
upside: { order: "none", type: "number" },
+ ratings: { order: "none", type: "number" },
date: { order: "none", type: "date" },
};
@@ -346,6 +378,22 @@