diff --git a/src/lib/components/Correlation.svelte b/src/lib/components/Correlation.svelte index 9fcab905..153e2e99 100644 --- a/src/lib/components/Correlation.svelte +++ b/src/lib/components/Correlation.svelte @@ -1,13 +1,14 @@ + + +
@@ -57,13 +94,16 @@ /> + {#if data?.user?.tier === 'Pro'} + {#if isLoaded} + {#if rawData?.length !== 0} + - {#if correlationList?.length !== 0} - - {#each (showFullStats ? correlationList : correlationList?.slice(0, 3)) as item, index} + + {#each (showFullStats ? rawData : rawData?.slice(0, 3)) as item, index} -
+
stockSelector(item?.symbol)} class="flex-shrink-0 mr-3 rounded-full w-8 h-8 sm:w-10 sm:h-10 relative bg-[#09090B]"> showFullStats = !showFullStats} class="{correlationList?.length < 4 ? 'hidden' : ''} cursor-pointer flex justify-center items-center mt-5"> + - {:else} -

- No data available - -

- {/if} + + {/if} + + {:else} +
+
+ +
+
+ {/if} + + {:else} +
+ + Unlock content with Pro Subscription +
+ {/if} + +
diff --git a/src/lib/store.ts b/src/lib/store.ts index 4f88e588..eab81b4e 100644 --- a/src/lib/store.ts +++ b/src/lib/store.ts @@ -81,6 +81,7 @@ export const analystInsightComponent= writable((false)); export const swapComponent= writable((false)); export const taRatingComponent= writable((false)); export const dcfComponent= writable((false)); +export const correlationComponent = writable((false)); diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 89f10a78..17052656 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -44,6 +44,7 @@ export let data; let cloudFrontUrl = import.meta.env.VITE_IMAGE_URL; + console.log(cloudFrontUrl) //const trialLeftDays = Math?.floor(addDays(data, 7, '')); diff --git a/src/routes/etf/[tickerID]/+layout.server.ts b/src/routes/etf/[tickerID]/+layout.server.ts index b63e936b..f24d5ba0 100644 --- a/src/routes/etf/[tickerID]/+layout.server.ts +++ b/src/routes/etf/[tickerID]/+layout.server.ts @@ -116,7 +116,6 @@ const promises = [ fetchData(apiURL,apiKey, '/etf-profile', params.tickerID), fetchData(apiURL,apiKey, '/similar-etfs', params.tickerID), fetchData(apiURL,apiKey, '/etf-country-weighting', params.tickerID), - fetchData(apiURL,apiKey, '/stock-correlation', params.tickerID), fetchData(apiURL,apiKey, '/etf-holdings', params.tickerID), fetchData(apiURL,apiKey, '/stock-dividend',params.tickerID), fetchData(apiURL,apiKey, '/stock-quote', params.tickerID), @@ -130,7 +129,6 @@ const promises = [ getETFProfile, getSimilarETFs, getCountryWeighting, - getCorrelation, getETFHoldings, getStockDividend, getStockQuote, @@ -150,7 +148,6 @@ const promises = [ getETFProfile, getSimilarETFs, getCountryWeighting, - getCorrelation, getETFHoldings, getStockDividend, getStockQuote, diff --git a/src/routes/etf/[tickerID]/+page.svelte b/src/routes/etf/[tickerID]/+page.svelte index 26a59e7f..59127ed8 100644 --- a/src/routes/etf/[tickerID]/+page.svelte +++ b/src/routes/etf/[tickerID]/+page.svelte @@ -34,7 +34,6 @@ let geographicList = []; let sectorList = []; let etfProfile = []; - let correlationList = []; let topHoldingList = []; let dividendList = []; let similarTicker = [] @@ -60,7 +59,6 @@ //let PricePredictionCard; //let TradingModel; - let Correlation; let CountrySegmentation; let SectorSegmentation; let WIIM; @@ -70,7 +68,6 @@ onMount(async() => { WIIM = (await import('$lib/components/WIIM.svelte')).default; - Correlation = (await import('$lib/components/Correlation.svelte')).default; CountrySegmentation = (await import('$lib/components/CountrySegmentation.svelte')).default; SectorSegmentation = (await import('$lib/components/SectorSegmentation.svelte')).default; }) @@ -674,7 +671,6 @@ async function initializePrice() { geographicList = []; sectorList = []; - correlationList = []; prePostData = {}; output = null; @@ -684,9 +680,7 @@ async function initializePrice() { sectorList = sectorList?.sort(function(a,b) { return b?.exposure - a?.exposure; }) - etfProfile = data?.getETFProfile; - correlationList = data?.getCorrelation?.correlation; - + etfProfile = data?.getETFProfile; topHoldingList = data?.getETFHoldings; dividendList = data?.getStockDividend; similarTicker = data?.getSimilarETFs; @@ -1340,11 +1334,13 @@ async function initializePrice() { -
- {#if Correlation} - - {/if} -
+ diff --git a/src/routes/options-flow/+page.svelte b/src/routes/options-flow/+page.svelte index 3323580a..0b166079 100644 --- a/src/routes/options-flow/+page.svelte +++ b/src/routes/options-flow/+page.svelte @@ -803,12 +803,12 @@ $: { -
+
diff --git a/src/routes/options-zero-dte/+page.svelte b/src/routes/options-zero-dte/+page.svelte index 879ce7d9..20928b93 100644 --- a/src/routes/options-zero-dte/+page.svelte +++ b/src/routes/options-zero-dte/+page.svelte @@ -737,12 +737,12 @@ $: {
-
+
diff --git a/src/routes/stocks/[tickerID]/+layout.server.ts b/src/routes/stocks/[tickerID]/+layout.server.ts index eff1c6ae..3a158178 100644 --- a/src/routes/stocks/[tickerID]/+layout.server.ts +++ b/src/routes/stocks/[tickerID]/+layout.server.ts @@ -136,7 +136,6 @@ export const load = async ({ params, locals, cookies, setHeaders}) => { const promises = [ fetchData(apiURL,apiKey, '/similar-stocks',params.tickerID), fetchData(apiURL,apiKey, '/stockdeck',params.tickerID), - fetchData(apiURL,apiKey, '/stock-correlation',params.tickerID), fetchData(apiURL,apiKey, '/analyst-summary-rating',params.tickerID), fetchData(apiURL,apiKey, '/stock-quote',params.tickerID), fetchData(apiURL,apiKey, '/bull-bear-say',params.tickerID), @@ -151,7 +150,6 @@ export const load = async ({ params, locals, cookies, setHeaders}) => { const [ getSimilarStock, getStockDeck, - getCorrelation, getAnalystRating, getStockQuote, getBullBearSay, @@ -172,7 +170,6 @@ export const load = async ({ params, locals, cookies, setHeaders}) => { return { getSimilarStock, getStockDeck, - getCorrelation, getAnalystRating, getStockQuote, getBullBearSay, diff --git a/src/routes/stocks/[tickerID]/+page.svelte b/src/routes/stocks/[tickerID]/+page.svelte index f569522f..eb586a71 100644 --- a/src/routes/stocks/[tickerID]/+page.svelte +++ b/src/routes/stocks/[tickerID]/+page.svelte @@ -3,7 +3,7 @@ import {AreaSeries, Chart, PriceLine, CandlestickSeries} from 'svelte-lightweight-charts'; import { TrackingModeExitMode } from 'lightweight-charts'; - import {getCache, setCache, dcfComponent, taRatingComponent, swapComponent, analystInsightComponent, governmentContractComponent, optionsNetFlowComponent, impliedVolatilityComponent, borrowedShareComponent, clinicalTrialComponent, optionComponent, failToDeliverComponent, marketMakerComponent, analystEstimateComponent, sentimentComponent, screenWidth, displayCompanyName, numberOfUnreadNotification, globalForm, varComponent, shareStatisticsComponent, enterpriseComponent, darkPoolComponent, retailVolumeComponent, shareholderComponent, trendAnalysisComponent, revenueSegmentationComponent, priceAnalysisComponent, fundamentalAnalysisComponent, isCrosshairMoveActive, realtimePrice, priceIncrease, currentPortfolioPrice, currentPrice, stockTicker, isOpen, isBeforeMarketOpen, isWeekend} from '$lib/store'; + import {getCache, setCache, correlationComponent, dcfComponent, taRatingComponent, swapComponent, analystInsightComponent, governmentContractComponent, optionsNetFlowComponent, impliedVolatilityComponent, borrowedShareComponent, clinicalTrialComponent, optionComponent, failToDeliverComponent, marketMakerComponent, analystEstimateComponent, sentimentComponent, screenWidth, displayCompanyName, numberOfUnreadNotification, globalForm, varComponent, shareStatisticsComponent, enterpriseComponent, darkPoolComponent, retailVolumeComponent, shareholderComponent, trendAnalysisComponent, revenueSegmentationComponent, priceAnalysisComponent, fundamentalAnalysisComponent, isCrosshairMoveActive, realtimePrice, priceIncrease, currentPortfolioPrice, currentPrice, stockTicker, isOpen, isBeforeMarketOpen, isWeekend} from '$lib/store'; import { onDestroy, onMount } from 'svelte'; import BullBearSay from '$lib/components/BullBearSay.svelte'; import CommunitySentiment from '$lib/components/CommunitySentiment.svelte'; @@ -16,7 +16,6 @@ let displayChartType = 'line'; let stockDeck = data?.getStockDeck ?? []; - let correlationList = data?.getCorrelation?.correlation ?? []; let prePostData = {}; let similarstock = []; let topETFHolder = []; @@ -41,16 +40,13 @@ let StockSplits; - let Correlation; let WIIM; onMount(async() => { WIIM = (await import('$lib/components/WIIM.svelte')).default; - StockSplits = (await import('$lib/components/StockSplits.svelte')).default; - Correlation = (await import('$lib/components/Correlation.svelte')).default; }) @@ -664,7 +660,6 @@ function changeChartType() { stockDeck = data?.getStockDeck; - correlationList = data?.getCorrelation?.correlation; marketMoods = data?.getBullBearSay; communitySentiment = data?.getCommunitySentiment; @@ -1440,22 +1435,22 @@ function changeChartType() {
-
- {#if Correlation} - - {/if} + - - - - {#if StockSplits && stockDeck?.at(0)?.stockSplits?.length !== 0} -
- -
- {/if} + + {#if StockSplits && stockDeck?.at(0)?.stockSplits?.length !== 0} +
+ +
+ {/if}