diff --git a/src/lib/components/AnalystEstimate.svelte b/src/lib/components/AnalystEstimate.svelte index 70aeb44a..81e34c3d 100644 --- a/src/lib/components/AnalystEstimate.svelte +++ b/src/lib/components/AnalystEstimate.svelte @@ -40,21 +40,6 @@ function findIndex(data) { displayData = event.target.value; } - function normalizer(value) { - if (Math?.abs(value) >= 1e18) { - return { unit: "Q", denominator: 1e18 }; - } else if (Math?.abs(value) >= 1e12) { - return { unit: "T", denominator: 1e12 }; - } else if (Math?.abs(value) >= 1e9) { - return { unit: "B", denominator: 1e9 }; - } else if (Math?.abs(value) >= 1e6) { - return { unit: "M", denominator: 1e6 }; - } else if (Math?.abs(value) >= 1e5) { - return { unit: "K", denominator: 1e5 }; - } else { - return { unit: "", denominator: 1 }; - } - } let tableDataActual = []; let tableDataForecast = []; @@ -115,7 +100,6 @@ function findIndex(data) { } // Normalize the data if needed (not required in this case, but leaving it here for reference) - const { unit, denominator } = normalizer(Math.max(...valueList, ...avgList) ?? 0); const option = { silent: true, @@ -139,23 +123,18 @@ function findIndex(data) { color: "#fff", }, }, - yAxis: { - type: "value", + yAxis: [ + { + type: 'value', splitLine: { - show: false, // Disable x-axis grid lines + show: false, // Disable x-axis grid lines }, + axisLabel: { - color: "#fff", // Change label color to white - formatter: function (value, index) { - // Display every second tick - if (index % 2 === 0) { - return (value / denominator)?.toFixed(0) + unit; // Format value in millions - } else { - return ""; // Hide this tick - } - }, - }, + show: false // Hide y-axis labels + } }, + ], series: [ { name: "Actual", diff --git a/src/lib/components/PriceAnalysis.svelte b/src/lib/components/PriceAnalysis.svelte index ff598f34..38c141f0 100644 --- a/src/lib/components/PriceAnalysis.svelte +++ b/src/lib/components/PriceAnalysis.svelte @@ -37,7 +37,6 @@ let r2Score; let mape; let priceSentiment = 'n/a'; - let displayData = 'threeMonth'; let lastPrice = 'n/a'; let oneYearPricePrediction = 'n/a'; let optionsData; @@ -59,6 +58,10 @@ function getPlotOptions() { bottom: $screenWidth < 640 ? '0%' : '5%', containLabel: true }, + tooltip: { + trigger: 'axis', + hideDelay: 100, // Set the delay in milliseconds + }, xAxis: { type: 'category', boundaryGap: false, @@ -75,17 +78,31 @@ function getPlotOptions() { } } }, - yAxis: { - type: 'value', - splitLine: { - show: false, - }, - axisLabel: { - color: '#fff', - } - }, - series: [ + yAxis: [ { + type: 'value', + splitLine: { + show: false, // Disable x-axis grid lines + }, + + axisLabel: { + show: false // Hide y-axis labels + } + }, + ], + series: [ + { + name: 'Stock Price', + data: historicalPrice, + showSymbol: false, + smooth: true, + type: 'line', + itemStyle: { + color: "#fff" + } + }, + { + name: 'Upperband', data: upperBand, showSymbol: false, smooth: true, @@ -98,6 +115,7 @@ function getPlotOptions() { } }, { + name: 'Lowerband', data: lowerBand, showSymbol: false, smooth: true, @@ -121,15 +139,6 @@ function getPlotOptions() { } }, */ - { - data: historicalPrice, - showSymbol: false, - smooth: true, - type: 'line', - itemStyle: { - color: "#fff" - } - } ] }; diff --git a/src/routes/stocks/[tickerID]/forecast/analyst/+page.svelte b/src/routes/stocks/[tickerID]/forecast/analyst/+page.svelte index 6332cf2d..f1d71d2e 100644 --- a/src/routes/stocks/[tickerID]/forecast/analyst/+page.svelte +++ b/src/routes/stocks/[tickerID]/forecast/analyst/+page.svelte @@ -249,10 +249,10 @@ changeTab(0) {#each (data?.user?.tier === 'Pro' ? historyList : historyList?.slice(0,3)) as item,index} - goto(`/analysts/${item?.analystId}`)} class="cursor-pointer {latestInfoDate(item?.date) ? 'bg-[#F9AB00] bg-opacity-[0.1]' : 'odd:bg-[#27272A]'} border-b-[#09090B] {index+1 === historyList?.slice(0,3)?.length && data?.user?.tier !== 'Pro' ? 'opacity-[0.1]' : ''}"> +
- {item?.analyst_name} + {item?.analyst_name} {item?.analyst?.length > 15 ? item?.analyst?.slice(0,15) + '...' : item?.analyst}
diff --git a/src/routes/stocks/[tickerID]/insider/congress-trading/+page.svelte b/src/routes/stocks/[tickerID]/insider/congress-trading/+page.svelte index b2a13f29..4c11966d 100644 --- a/src/routes/stocks/[tickerID]/insider/congress-trading/+page.svelte +++ b/src/routes/stocks/[tickerID]/insider/congress-trading/+page.svelte @@ -1,12 +1,7 @@ @@ -161,7 +131,7 @@ onMount(async () => { {#if senateTradingList?.length !== 0} -

+

Congress Statistics

@@ -169,7 +139,7 @@ onMount(async () => {
-
+
Buy/Sell @@ -196,7 +166,7 @@ onMount(async () => {
-
+
Dem/Rep @@ -227,14 +197,6 @@ onMount(async () => { - - - - {#if displayStructure === 'Card'}
@@ -253,7 +215,7 @@ onMount(async () => { {#each senateTradingList as item} - goto(`/politicians/${item?.id}`)} class="odd:bg-[#27272A] sm:hover:bg-[#245073] sm:hover:bg-opacity-[0.2] bg-[#09090B] border-b-[#09090B] cursor-pointer"> +
@@ -262,7 +224,7 @@ onMount(async () => {
- {item?.representative?.replace('_',' ')} + {item?.representative?.replace('_',' ')} {item?.party}
@@ -294,95 +256,7 @@ onMount(async () => { - - {:else} -
- {#each senateTradingList as item} -
-
- {#if item?.party === 'Republican'} - - {:else if item?.party === 'Democratic'} - - {:else} - - {/if} -
- - -
- -
- - {item?.representative?.replace('_',' ')} - - - {item?.party ?? 'n/a'} / {district[item?.representative] ?? 'n/a'} - - -
- -
- -
- Owner - - {item?.owner?.length !== 0 ? item?.owner : '-'} - -
-
- -
- -
-
- Transaction Date - - {new Date(item?.transactionDate)?.toLocaleString('en-US', { month: 'short', day: 'numeric', year: 'numeric', daySuffix: '2-digit' })} - -
- -
- Disclosure Date - - {new Date(item?.disclosureDate)?.toLocaleString('en-US', { month: 'short', day: 'numeric', year: 'numeric', daySuffix: '2-digit' })} - -
-
- -
- -
-
- Amount - - {item?.amount?.replace("$1,000,001 - $5,000,000","$1Mio - $5Mio")} - -
- -
- Type - - {#if item?.type === 'Bought'} - Bought - {:else if item?.type === 'Sold'} - Sold - {:else if item?.type === 'Exchange'} - Exchange - {/if} - -
-
- -
- - -
- {/each} - - -
{#if rawData?.length >= 20} {/if} - - - {/if} {:else}

diff --git a/src/routes/stocks/[tickerID]/stats/ratios/+page.svelte b/src/routes/stocks/[tickerID]/stats/ratios/+page.svelte index 0fc003cb..e8592073 100644 --- a/src/routes/stocks/[tickerID]/stats/ratios/+page.svelte +++ b/src/routes/stocks/[tickerID]/stats/ratios/+page.svelte @@ -2,6 +2,8 @@ import { Chart } from 'svelte-echarts' import {numberOfUnreadNotification, displayCompanyName, stockTicker} from '$lib/store'; import { abbreviateNumber } from '$lib/utils'; +import * as DropdownMenu from "$lib/components/shadcn/dropdown-menu/index.js"; +import { Button } from "$lib/components/shadcn/button/index.js"; //import * as XLSX from 'xlsx'; import { init, use } from 'echarts/core' import { LineChart, BarChart } from 'echarts/charts' @@ -126,7 +128,6 @@ const statementConfig = [ ]; -let namingList = statementConfig?.map(config => config?.propertyName) || []; function toggleMode() { @@ -204,21 +205,16 @@ function plotData() type: 'category', }, yAxis: [ - { + { type: 'value', splitLine: { - show: false, // Disable x-axis grid lines + show: false, // Disable x-axis grid lines }, + axisLabel: { - color: '#fff', // Change label color to white + show: false // Hide y-axis labels + } }, - }, - { - type: 'value', - splitLine: { - show: false, // Disable x-axis grid lines - }, - }, ], series: [ { @@ -237,53 +233,7 @@ function plotData() return options; } -/* -const exportData = (format = 'csv') => { - const data = fullStatement; - if (!data || data.length === 0) { - return; - } - let properties = [ - { key: "calendarYear", label: "Year" }, - ]; - - for (let i = 0; i < statementConfig?.length; i++) { - properties.push({ key: statementConfig[i]?.propertyName, label: statementConfig[i]?.label }) - } - - // Helper function to handle special cases - - - // Create rows for CSV/Excel - let rows = data.map(item => properties?.map(property => item[property?.key] || 0)); - - // Include headers - const headers = properties.map(prop => prop.label); - rows.unshift(headers); - - - // Check the format to export - if (format.toLowerCase() === 'csv') { - const csvContent = rows.map(row => row.join(",")).join("\n"); - const blob = new Blob([csvContent], { type: "data:text/csv;charset=utf-8" }); - const url = URL.createObjectURL(blob); - const a = document.createElement("a"); - a.href = url; - a.download = $stockTicker.toLowerCase() + "-ratios-statement.csv"; - document.body.appendChild(a); - a.click(); - document.body.removeChild(a); - URL.revokeObjectURL(url); - } else if (format.toLowerCase() === 'excel') { - const worksheet = XLSX.utils.aoa_to_sheet(rows); - const workbook = XLSX.utils.book_new(); - XLSX.utils.book_append_sheet(workbook, worksheet, "Ratios Statement"); - XLSX.writeFile(workbook, `${$stockTicker.toLowerCase()}-ratios-statement.xlsx`); - } -}; - -*/ fullStatement = data?.getRatiosStatement; @@ -404,12 +354,42 @@ $: { - + + +
+
+ + + + + + + Select time frame + + + + timeFrame = '5Y'} class="cursor-pointer hover:bg-[#27272A]"> + 5 years + + timeFrame = '10Y'} class="cursor-pointer hover:bg-[#27272A]"> + 10 years + + timeFrame = 'MAX'} class="cursor-pointer hover:bg-[#27272A]"> + Max + + + + + + +
+
+ - - - - - - - - - - - - - - - - - - - - - - +