{"version":3,"file":"1372.13807e0a.js","mappings":"gGAEAA,EAAOC,QAAU,CACfC,MAAO,OACPC,MAAO,OACPC,QAAS,UACTC,YAAa,cACbC,QAAS,eACTC,OAAQ,CACN,YAAa,UACbC,KAAM,WAERC,KAAM,CACJ,GAAI,UACJ,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,WAEPC,IAAK,CACH,GAAI,UACJ,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,WAEPC,OAAQ,CACN,GAAI,UACJ,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,WAEPC,MAAO,CACL,GAAI,UACJ,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,WAEPC,OAAQ,CACN,GAAI,UACJ,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,WAEPC,aAAc,CACZ,GAAI,UACJ,IAAK,WAEPC,KAAM,CACJ,GAAI,UACJ,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,WAEPC,MAAO,CACL,GAAI,UACJ,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,WAEPC,QAAS,CACP,GAAI,UACJ,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,WAEPC,KAAM,CACJ,GAAI,UACJ,IAAK,UACL,IAAK,U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/C,EAAKgD,WAAkBhD,EAAK2C,aAEhDM,EAAmBb,EAAec,IAAmC,EACrEC,EAAqBd,EAAiBa,IAAmC,EAEzEE,EAA0B,IAAdP,GAAiC,IAAdA,EAC/BQ,EAASV,EAAWJ,GAAgBU,EAAmBX,GAAiBS,EACxEO,EAAWX,EAAWD,GAAcS,EAAqBb,GAAiBS,EAChF,OAAQK,GAAaC,IAAWC,CAClC,C","sources":["webpack://@finviz/website/../config/colors.js","webpack://@finviz/website/./js/app/maps/constants/constants.ts","webpack://@finviz/website/./js/app/maps/constants/generator.ts","webpack://@finviz/website/./js/app/maps/constants/settings.ts","webpack://@finviz/website/./js/app/maps/layout-generator.tsx","webpack://@finviz/website/./js/app/maps/utils.ts","webpack://@finviz/website/./js/app/screener/utils.ts","webpack://@finviz/website/./js/app/shared/isStockFastRefreshAvailable.ts"],"sourcesContent":["// Keep in sync with charts repository colors.js file in: app/constants/colors.js\r\n\r\nmodule.exports = {\r\n white: '#fff',\r\n black: '#000',\r\n inherit: 'inherit',\r\n transparent: 'transparent',\r\n current: 'currentColor',\r\n finviz: {\r\n 'blue-gray': '#262931',\r\n blue: '#4fa4f4',\r\n },\r\n gray: {\r\n 50: '#f3f3f5',\r\n 100: '#dedfe5',\r\n 200: '#c3c6d0',\r\n 300: '#a3a8b9',\r\n 400: '#868ea5',\r\n 500: '#676f85',\r\n 600: '#4c5263',\r\n 700: '#353945',\r\n 750: '#2c303b',\r\n 800: '#22262f',\r\n 900: '#14161d',\r\n },\r\n red: {\r\n 50: '#fef0f0',\r\n 100: '#fcd6d6',\r\n 200: '#fbb4b4',\r\n 300: '#fd8487',\r\n 400: '#fb5057',\r\n 500: '#d91e2b',\r\n 600: '#9f1f2a',\r\n 700: '#691f24',\r\n 800: '#45171a',\r\n 900: '#280e0f',\r\n },\r\n orange: {\r\n 50: '#fef2eb',\r\n 100: '#fdd9c5',\r\n 200: '#fab889',\r\n 300: '#ef9323',\r\n 400: '#ca7b14',\r\n 500: '#a0600e',\r\n 600: '#79460a',\r\n 700: '#583006',\r\n 800: '#3d1e03',\r\n 900: '#261101',\r\n },\r\n amber: {\r\n 50: '#fef2e7',\r\n 100: '#fedab5',\r\n 200: '#fbba56',\r\n 300: '#de9c1a',\r\n 400: '#bb830f',\r\n 500: '#956600',\r\n 600: '#704b00',\r\n 700: '#4f3400',\r\n 800: '#372200',\r\n 900: '#211300',\r\n },\r\n yellow: {\r\n 50: '#fdf2df',\r\n 100: '#fcdc86',\r\n 200: '#f3c736',\r\n 300: '#cda30b',\r\n 400: '#b08900',\r\n 500: '#8b6a00',\r\n 600: '#664e21',\r\n 700: '#46371e',\r\n 800: '#2f2516',\r\n 900: '#1b150d',\r\n },\r\n brightYellow: {\r\n 50: '#fff699',\r\n 100: '#fff200',\r\n },\r\n lime: {\r\n 50: '#ebfad6',\r\n 100: '#caec90',\r\n 200: '#aad547',\r\n 300: '#8db61e',\r\n 400: '#769913',\r\n 500: '#5b7800',\r\n 600: '#435900',\r\n 700: '#2e3e00',\r\n 800: '#1e2a00',\r\n 900: '#111900',\r\n },\r\n green: {\r\n 50: '#e7f7e8',\r\n 100: '#beeac1',\r\n 200: '#86d895',\r\n 300: '#34c062',\r\n 400: '#00a449',\r\n 500: '#19803d',\r\n 600: '#265d35',\r\n 700: '#1e4027',\r\n 800: '#162b1b',\r\n 900: '#0d1810',\r\n },\r\n emerald: {\r\n 50: '#ddfaee',\r\n 100: '#a2f0d2',\r\n 200: '#4dddaf',\r\n 300: '#25be93',\r\n 400: '#1d9f7b',\r\n 500: '#157e60',\r\n 600: '#035d47',\r\n 700: '#004139',\r\n 800: '#002c22',\r\n 900: '#001a13',\r\n },\r\n teal: {\r\n 50: '#e0f8fc',\r\n 100: '#9beef7',\r\n 200: '#4fd8e5',\r\n 300: '#27b9c4',\r\n 400: '#109ba5',\r\n 500: '#007c83',\r\n 600: '#005b62',\r\n 700: '#004045',\r\n 800: '#002b2e',\r\n 900: '#00191b',\r\n },\r\n blue: {\r\n 50: '#ebf4fe',\r\n 100: '#cae2fc',\r\n 200: '#9bcbfa',\r\n 300: '#57aefb',\r\n 400: '#2f91ef',\r\n 500: '#306dca',\r\n 600: '#2f5091',\r\n 700: '#263766',\r\n 800: '#1b2542',\r\n 900: '#101527',\r\n },\r\n violet: {\r\n 50: '#f4f2fe',\r\n 100: '#e1dbfd',\r\n 200: '#c9befc',\r\n 300: '#ad9bfb',\r\n 400: '#9978f9',\r\n 500: '#7c51e7',\r\n 600: '#5e36b8',\r\n 700: '#402979',\r\n 800: '#2a1e4e',\r\n 900: '#18122c',\r\n },\r\n purple: {\r\n 50: '#f9f1fe',\r\n 100: '#eed8fd',\r\n 200: '#e1b6fc',\r\n 300: '#d38bfb',\r\n 400: '#c85bf9',\r\n 500: '#ae27e0',\r\n 600: '#8514ac',\r\n 700: '#60077e',\r\n 800: '#44005a',\r\n 900: '#2a003a',\r\n },\r\n pink: {\r\n 50: '#fef1f4',\r\n 100: '#fdd6e1',\r\n 200: '#fcb2c7',\r\n 300: '#f984aa',\r\n 400: '#f25090',\r\n 500: '#cd2a74',\r\n 600: '#9d1658',\r\n 700: '#700c42',\r\n 800: '#4e052b',\r\n 900: '#32011a',\r\n },\r\n}\r\n","import { MapSubtype, MapSubtypeId, MapType, MapTypeId, ScaleId } from '../types'\r\n\r\nexport const EXPANDED_MAP_BODY_CLASSS = 'is-map-expanded'\r\nexport const FALLBACK_PERF_RESPONSE = { nodes: {}, additional: {}, subtype: MapSubtypeId.DayPerf }\r\n\r\nexport const MAP_SUBTYPES_COMPANIES_BY_ID: Record = {\r\n [MapSubtypeId.DayPerf]: {\r\n id: MapSubtypeId.DayPerf,\r\n name: '1 Day Performance',\r\n scaleId: ScaleId.DayPerf,\r\n tooltip:\r\n \"Color indicates today's stock performance in percent. Based on the color you can identify losers (red), neutral (black), and gainers (green).\",\r\n countIndustryPerf: true,\r\n countSectorPerf: true,\r\n },\r\n [MapSubtypeId.WeekPerf]: {\r\n id: MapSubtypeId.WeekPerf,\r\n name: '1 Week Performance',\r\n scaleId: ScaleId.WeekPerf,\r\n tooltip:\r\n 'Color indicates weekly stock performance in percent. Based on the color you can identify losers (red), neutral (black), and gainers (green).',\r\n countIndustryPerf: true,\r\n countSectorPerf: true,\r\n },\r\n [MapSubtypeId.MonthPerf]: {\r\n id: MapSubtypeId.MonthPerf,\r\n name: '1 Month Performance',\r\n scaleId: ScaleId.MonthPerf,\r\n tooltip:\r\n 'Color indicates monthly stock performance in percent. Based on the color you can identify losers (red), neutral (black), and gainers (green).',\r\n countIndustryPerf: true,\r\n countSectorPerf: true,\r\n },\r\n [MapSubtypeId.ThreeMonthPerf]: {\r\n id: MapSubtypeId.ThreeMonthPerf,\r\n name: '3 Months Performance',\r\n scaleId: ScaleId.ThreeMonthPerf,\r\n tooltip:\r\n 'Color indicates quarterly stock performance in percent. Based on the color you can identify losers (red), neutral (black), and gainers (green).',\r\n countIndustryPerf: true,\r\n countSectorPerf: true,\r\n },\r\n [MapSubtypeId.SixMonthPerf]: {\r\n id: MapSubtypeId.SixMonthPerf,\r\n name: '6 Months Performance',\r\n scaleId: ScaleId.SixMonthPerf,\r\n tooltip:\r\n 'Color indicates half-yearly stock performance in percent. Based on the color you can identify losers (red), neutral (black), and gainers (green).',\r\n countIndustryPerf: true,\r\n countSectorPerf: true,\r\n },\r\n [MapSubtypeId.YearPerf]: {\r\n id: MapSubtypeId.YearPerf,\r\n name: '1 Year Performance',\r\n scaleId: ScaleId.YearPerf,\r\n tooltip:\r\n 'Color indicates yearly stock performance in percent. Based on the color you can identify losers (red), neutral (black), and gainers (green).',\r\n countIndustryPerf: true,\r\n countSectorPerf: true,\r\n },\r\n [MapSubtypeId.YearToDatePerf]: {\r\n id: MapSubtypeId.YearToDatePerf,\r\n name: 'Year To Date Performance',\r\n scaleId: ScaleId.YearPerf,\r\n tooltip:\r\n 'Color indicates year to date stock performance in percent. Based on the color you can identify losers (red), neutral (black), and gainers (green).',\r\n countIndustryPerf: true,\r\n countSectorPerf: true,\r\n },\r\n [MapSubtypeId.RelativeVolume]: {\r\n id: MapSubtypeId.RelativeVolume,\r\n name: 'Relative Volume',\r\n scaleId: ScaleId.RelativeVolume,\r\n tooltip:\r\n \"Color indicates the stock's relative volume, ratio between today's and average volume. Values above 1.5 show strong volume, values below 0.5 indicate weak volume.\",\r\n countIndustryPerf: true,\r\n countSectorPerf: true,\r\n },\r\n [MapSubtypeId.PriceToEarnings]: {\r\n id: MapSubtypeId.PriceToEarnings,\r\n name: 'P/E',\r\n scaleId: ScaleId.PriceToEarnings,\r\n tooltip: \"Color indicates the stock's price-to-earnings ratio.\",\r\n countIndustryPerf: true,\r\n countSectorPerf: true,\r\n },\r\n [MapSubtypeId.ForwardPriceToEearnings]: {\r\n id: MapSubtypeId.ForwardPriceToEearnings,\r\n name: 'Forward P/E',\r\n scaleId: ScaleId.ForwardPriceToEearnings,\r\n tooltip: \"Color indicates the stock's forward price-to-earnings ratio.\",\r\n countIndustryPerf: true,\r\n countSectorPerf: true,\r\n },\r\n [MapSubtypeId.PriceEarningsToGrowth]: {\r\n id: MapSubtypeId.PriceEarningsToGrowth,\r\n name: 'PEG',\r\n scaleId: ScaleId.PriceEarningsToGrowth,\r\n tooltip: \"Color indicates the stock's price-to-earnings-to-growth ratio.\",\r\n countIndustryPerf: true,\r\n countSectorPerf: true,\r\n },\r\n [MapSubtypeId.PriceToSellsRatio]: {\r\n id: MapSubtypeId.PriceToSellsRatio,\r\n name: 'P/S',\r\n scaleId: ScaleId.PriceToSellsRatio,\r\n tooltip: \"Color indicates the stock's price-to-sales ratio.\",\r\n countIndustryPerf: true,\r\n countSectorPerf: true,\r\n },\r\n [MapSubtypeId.PriceToBookRatio]: {\r\n id: MapSubtypeId.PriceToBookRatio,\r\n name: 'P/B',\r\n scaleId: ScaleId.PriceToBookRatio,\r\n tooltip: \"Color indicates the stock's price-to-book ratio.\",\r\n countIndustryPerf: true,\r\n countSectorPerf: true,\r\n },\r\n [MapSubtypeId.DividendYield]: {\r\n id: MapSubtypeId.DividendYield,\r\n name: 'Dividend Yield',\r\n scaleId: ScaleId.DividendYield,\r\n tooltip: \"Color indicates the stock's dividend yield.\",\r\n countIndustryPerf: true,\r\n countSectorPerf: true,\r\n },\r\n [MapSubtypeId.EPSGrowth5y]: {\r\n id: MapSubtypeId.EPSGrowth5y,\r\n name: 'EPS Growth Past 5 Years',\r\n scaleId: ScaleId.EPSGrowth5y,\r\n tooltip: \"Color indicates the stock's annual earnings (EPS) growth over past 5 years.\",\r\n countIndustryPerf: true,\r\n countSectorPerf: true,\r\n },\r\n [MapSubtypeId.FloatShort]: {\r\n id: MapSubtypeId.FloatShort,\r\n name: 'Float Short',\r\n scaleId: ScaleId.FloatShort,\r\n tooltip: \"Color indicates percent of the stock's float sold short.\",\r\n countIndustryPerf: true,\r\n countSectorPerf: true,\r\n },\r\n [MapSubtypeId.AnalystRecommendation]: {\r\n id: MapSubtypeId.AnalystRecommendation,\r\n name: 'Analysts Recom.',\r\n scaleId: ScaleId.AnalystRecommendation,\r\n tooltip:\r\n \"Color indicates the analyst's recommendations for given stocks. The rating is based on a 1-5 scale, ranging from a strong-buy, to a strong-sell.\",\r\n countIndustryPerf: true,\r\n countSectorPerf: true,\r\n },\r\n [MapSubtypeId.EarningsPerf]: {\r\n id: MapSubtypeId.EarningsPerf,\r\n name: 'Earnings Day Performance',\r\n scaleId: ScaleId.MonthPerf,\r\n tooltip:\r\n \"Color indicates stock's performance on earnings day. Next day performance for earnings reported after market close.\",\r\n countIndustryPerf: false,\r\n countSectorPerf: false,\r\n },\r\n [MapSubtypeId.EarningsDate]: {\r\n id: MapSubtypeId.EarningsDate,\r\n name: 'Earnings Date',\r\n scaleId: ScaleId.EarningsDate,\r\n tooltip: \"Color indicates stock's earnings date.\",\r\n countIndustryPerf: false,\r\n countSectorPerf: false,\r\n },\r\n}\r\n\r\nexport const MAP_SUBTYPES_ETF_BY_ID = {\r\n [MapSubtypeId.DayPerf]: {\r\n id: MapSubtypeId.DayPerf,\r\n name: '1 Day Performance',\r\n scaleId: ScaleId.DayPerf,\r\n tooltip:\r\n \"Color indicates today's stock performance in percent. Based on the color you can identify losers (red), neutral (black), and gainers (green).\",\r\n countIndustryPerf: true,\r\n countSectorPerf: true,\r\n },\r\n [MapSubtypeId.WeekPerf]: {\r\n id: MapSubtypeId.WeekPerf,\r\n name: '1 Week Performance',\r\n scaleId: ScaleId.WeekPerf,\r\n tooltip:\r\n 'Color indicates weekly stock performance in percent. Based on the color you can identify losers (red), neutral (black), and gainers (green).',\r\n countIndustryPerf: true,\r\n countSectorPerf: true,\r\n },\r\n [MapSubtypeId.MonthPerf]: {\r\n id: MapSubtypeId.MonthPerf,\r\n name: '1 Month Performance',\r\n scaleId: ScaleId.MonthPerf,\r\n tooltip:\r\n 'Color indicates monthly stock performance in percent. Based on the color you can identify losers (red), neutral (black), and gainers (green).',\r\n countIndustryPerf: true,\r\n countSectorPerf: true,\r\n },\r\n [MapSubtypeId.ThreeMonthPerf]: {\r\n id: MapSubtypeId.ThreeMonthPerf,\r\n name: '3 Months Performance',\r\n scaleId: ScaleId.ThreeMonthPerf,\r\n tooltip:\r\n 'Color indicates quarterly stock performance in percent. Based on the color you can identify losers (red), neutral (black), and gainers (green).',\r\n countIndustryPerf: true,\r\n countSectorPerf: true,\r\n },\r\n [MapSubtypeId.SixMonthPerf]: {\r\n id: MapSubtypeId.SixMonthPerf,\r\n name: '6 Months Performance',\r\n scaleId: ScaleId.SixMonthPerf,\r\n tooltip:\r\n 'Color indicates half-yearly stock performance in percent. Based on the color you can identify losers (red), neutral (black), and gainers (green).',\r\n countIndustryPerf: true,\r\n countSectorPerf: true,\r\n },\r\n [MapSubtypeId.YearPerf]: {\r\n id: MapSubtypeId.YearPerf,\r\n name: '1 Year Performance',\r\n scaleId: ScaleId.YearPerf,\r\n tooltip:\r\n 'Color indicates yearly stock performance in percent. Based on the color you can identify losers (red), neutral (black), and gainers (green).',\r\n countIndustryPerf: true,\r\n countSectorPerf: true,\r\n },\r\n [MapSubtypeId.YearToDatePerf]: {\r\n id: MapSubtypeId.YearToDatePerf,\r\n name: 'Year To Date Performance',\r\n scaleId: ScaleId.YearPerf,\r\n tooltip:\r\n 'Color indicates year to date stock performance in percent. Based on the color you can identify losers (red), neutral (black), and gainers (green).',\r\n countIndustryPerf: true,\r\n countSectorPerf: true,\r\n },\r\n [MapSubtypeId.RelativeVolume]: {\r\n id: MapSubtypeId.RelativeVolume,\r\n name: 'Relative Volume',\r\n scaleId: ScaleId.RelativeVolume,\r\n tooltip:\r\n \"Color indicates the stock's relative volume, ratio between today's and average volume. Values above 1.5 show strong volume, values below 0.5 indicate weak volume.\",\r\n countIndustryPerf: true,\r\n countSectorPerf: true,\r\n },\r\n}\r\n\r\nexport const MAP_SUBTYPES_COMPANIES: MapSubtype[] = Object.values(MAP_SUBTYPES_COMPANIES_BY_ID)\r\n\r\nexport const MAP_SUBTYPES_ETF: MapSubtype[] = Object.values(MAP_SUBTYPES_ETF_BY_ID)\r\n\r\nexport const MAP_TYPES: MapType[] = [\r\n {\r\n name: 'S&P 500',\r\n pageTitle: 'S&P 500 Map',\r\n description:\r\n \"Standard and Poor's 500 index stocks categorized by sectors and industries. Size represents market cap.\",\r\n type: MapTypeId.Sector,\r\n subtypes: MAP_SUBTYPES_COMPANIES,\r\n },\r\n {\r\n name: 'World',\r\n pageTitle: 'World Map',\r\n description:\r\n 'Foreign ADR stocks listed on NYSE, NASDAQ, AMEX categorized by geo location. Size represents market cap.',\r\n type: MapTypeId.World,\r\n subtypes: MAP_SUBTYPES_COMPANIES,\r\n },\r\n {\r\n name: 'Full',\r\n pageTitle: 'Stock Market Map',\r\n description:\r\n 'All stocks listed on US stock exchanges, categorized by sectors and industries. Size represents market cap.',\r\n type: MapTypeId.SectorFull,\r\n subtypes: MAP_SUBTYPES_COMPANIES,\r\n },\r\n {\r\n name: 'Exchange Traded Funds',\r\n pageTitle: 'ETF Map - Exchange Traded Funds Map',\r\n nameShort: 'ETF',\r\n description: 'ETFs categorized by sectors and styles. Size represents 3-month average dollar volume, $1M minimum.',\r\n type: MapTypeId.ETF,\r\n subtypes: MAP_SUBTYPES_ETF,\r\n },\r\n]\r\n\r\nexport const MAP_TYPE_SCREENER = {\r\n name: 'Screener',\r\n pageTitle: 'Screener Map',\r\n description:\r\n 'All stocks listed on US stock exchanges, categorized by sectors and industries. Size represents market cap.',\r\n type: MapTypeId.Screener,\r\n subtypes: MAP_SUBTYPES_COMPANIES,\r\n}\r\n\r\nexport const MAP_TYPE_ETF_HOLDINGS_WIDGET = {\r\n name: 'ETF Holdings',\r\n pageTitle: '',\r\n description: '',\r\n type: MapTypeId.ETFHoldings,\r\n subtypes: MAP_SUBTYPES_COMPANIES,\r\n}\r\n","export type MapOrder = Record\r\n\r\nexport const MAP_MIN_WIDTH = 700\r\nexport const MAP_MIN_HEIGHT = 388\r\nexport const SECTOR_MIN_HEIGHT = 5\r\nexport const LEGEND_HEIGHT = 79\r\n\r\nexport const LARGE_MAP_HEIGHT_RATIO = 1.8\r\nexport const SMALL_MAP_GEO_HEIGHT_RATIO = 1.7\r\nexport const SMALL_MAP_HEIGHT_RATIO = 1.085 // old design ratio - 1.33\r\n\r\n// Minimal size of node to display header\r\nexport const LARGE_NODE_SIZE = {\r\n dx: 40,\r\n dy: 12,\r\n}\r\n\r\n// Don't display header if node height - header is smaller than this\r\nexport const LARGE_NODE_MIN_HEIGHT = 5\r\n\r\nexport const ORDER_SP500: MapOrder = {\r\n Technology: 10,\r\n Financial: 11,\r\n 'Communication Services': 9,\r\n Healthcare: 4,\r\n 'Consumer Cyclical': 6,\r\n 'Consumer Defensive': 5,\r\n Industrials: 4,\r\n 'Real Estate': 3,\r\n Energy: 2,\r\n Utilities: 1,\r\n 'Basic Materials': 0,\r\n}\r\n\r\nexport const ORDER_SEC_ALL: MapOrder = {\r\n Technology: 10,\r\n Financial: 9,\r\n 'Communication Services': 8,\r\n Healthcare: 7,\r\n 'Consumer Cyclical': 6,\r\n 'Consumer Defensive': 5,\r\n Industrials: 4,\r\n 'Real Estate': 3,\r\n Energy: 2,\r\n Utilities: 1,\r\n 'Basic Materials': 0,\r\n}\r\n\r\nexport const ORDER_ETF: MapOrder = {\r\n US: 11,\r\n 'US Sector': 10,\r\n 'US Large Cap': 9,\r\n 'US Mid Cap': 8,\r\n 'US Small Cap': 7,\r\n 'US Volatility': 6,\r\n Global: 5,\r\n International: 3,\r\n 'Fixed Income': 2,\r\n Commodity: 4,\r\n Strategy: 1,\r\n Forex: 0,\r\n}\r\n\r\nexport const ORDER_SCREENER: MapOrder = {\r\n Technology: 10,\r\n Financial: 9,\r\n 'Communication Services': 8,\r\n Healthcare: 7,\r\n 'Consumer Cyclical': 6,\r\n 'Consumer Defensive': 5,\r\n Industrials: 4,\r\n 'Real Estate': 3,\r\n Energy: 2,\r\n Utilities: 1,\r\n 'Basic Materials': 0,\r\n}\r\n\r\nexport const ORDER_SCREENER_ETF: MapOrder = {\r\n ...ORDER_SCREENER,\r\n Financial: 1000,\r\n}\r\n\r\nexport const ORDER_WORLD: MapOrder = {\r\n Ireland: 20,\r\n 'United Kingdom': 19,\r\n Spain: 18,\r\n France: 17,\r\n Belgium: 16,\r\n Netherlands: 15,\r\n Switzerland: 14,\r\n\r\n China: 21,\r\n Japan: 20,\r\n India: 19,\r\n 'Hong Kong': 18,\r\n 'South Korea': 15,\r\n Taiwan: 14,\r\n\r\n Colombia: 30,\r\n Chile: 29,\r\n Argentina: 28,\r\n}\r\n\r\nexport const WORLD_INDUSTRIES = [\r\n {\r\n x: 4,\r\n y: 0,\r\n dx: 240,\r\n dy: 226,\r\n name: 'Canada',\r\n countries: ['Canada'],\r\n },\r\n {\r\n x: 4,\r\n y: 230,\r\n dx: 240,\r\n dy: 135,\r\n name: 'Mexico',\r\n countries: ['Cayman Islands', 'Bermuda', 'Mexico'],\r\n },\r\n {\r\n x: 4,\r\n y: 375,\r\n dx: 240,\r\n dy: 170,\r\n name: 'South America',\r\n countries: ['Netherlands Antilles', 'Panama', 'Peru', 'Argentina', 'Colombia', 'Chile', 'Brazil'],\r\n },\r\n {\r\n x: 730,\r\n y: 380,\r\n dx: 108,\r\n dy: 80,\r\n name: 'South Africa',\r\n countries: ['South Africa'],\r\n },\r\n {\r\n x: 725,\r\n y: 180,\r\n dx: 108,\r\n dy: 81,\r\n name: 'Israel',\r\n countries: ['Israel'],\r\n },\r\n {\r\n x: 1055,\r\n y: 420,\r\n dx: 144,\r\n dy: 80,\r\n name: 'Australia',\r\n countries: ['Australia'],\r\n },\r\n {\r\n x: 871,\r\n y: 0,\r\n dx: 336,\r\n dy: 396,\r\n name: 'Asia',\r\n countries: [\r\n 'Malaysia',\r\n 'Russia',\r\n 'Philippines',\r\n 'Indonesia',\r\n 'Singapore',\r\n 'South Korea',\r\n 'Taiwan',\r\n 'India',\r\n 'Hong Kong',\r\n 'Japan',\r\n 'China',\r\n ],\r\n },\r\n {\r\n x: 324,\r\n y: 0,\r\n dx: 374,\r\n dy: 428,\r\n name: 'Europe',\r\n countries: [\r\n 'Cyprus',\r\n 'Channel Islands',\r\n 'Greece',\r\n 'Luxembourg',\r\n 'Germany',\r\n 'Belgium',\r\n 'Spain',\r\n 'France',\r\n 'Ireland',\r\n 'Switzerland',\r\n 'Netherlands',\r\n 'United Kingdom',\r\n ],\r\n },\r\n {\r\n x: 697,\r\n y: 75,\r\n dx: 144,\r\n dy: 51,\r\n name: 'Frozen',\r\n countries: ['Finland', 'Sweden', 'Norway', 'Denmark'],\r\n },\r\n {\r\n x: 542,\r\n y: 414,\r\n dx: 102,\r\n dy: 68,\r\n name: 'Italy',\r\n countries: ['Italy'],\r\n },\r\n]\r\n","import tailwindColors from '../../../../../config/colors'\r\nimport { ScaleId } from '../types'\r\n\r\nexport interface ISettings {\r\n padding: { top: number; right: number; bottom: number; left: number }\r\n background: string\r\n industry: ISettingsSection\r\n sector: ISettingsSection\r\n scaleFontSizes: Record\r\n fontSizePadding: Record\r\n fontSizePairs: Record\r\n}\r\n\r\nexport interface ISettingsSection {\r\n padding: { top: number; right: number; bottom: number; left: number }\r\n background: string | null\r\n border: string | null\r\n header: ISettingsSectionHeader\r\n hover?: ISettingsSectionHeader\r\n}\r\n\r\nexport interface ISettingsSectionHeader extends ISettingsSectionFont {\r\n background: string | null\r\n border: string | null\r\n height: number\r\n margin: { top: number; right: number; bottom: number; left: number }\r\n}\r\n\r\nexport interface ISettingsSectionFont {\r\n color: string\r\n fontSize: number\r\n fontWeight: 'bold' | 'normal'\r\n padding: { top: number; right: number; left: number }\r\n}\r\n\r\nexport const scaleMinMax: Record = {\r\n [ScaleId.DayPerf]: [-3, 3],\r\n _5: [-6, 6],\r\n _10: [-10, 10],\r\n _15: [-18, 18],\r\n _20: [-24, 24],\r\n _25: [-30, 30],\r\n _relvol: [0, 3],\r\n _pe: [0, 30],\r\n _fpe: [0, 30],\r\n _peg: [0, 3],\r\n _ps: [0, 5],\r\n _pb: [0, 5],\r\n _div: [0, 5],\r\n _eps5y: [-50, 50],\r\n _short: [0, 15],\r\n _rec: [5, 1],\r\n _earndate: [30, -30],\r\n // Portfolio — values are just placeholders, the real value is computed from data\r\n _portfolioPct: [-1, 1],\r\n _portfolioUsd: [-1, 1],\r\n}\r\n\r\nexport const scaleStepFormat: Record = {\r\n [ScaleId.DayPerf]: '%N%',\r\n _5: '%N%',\r\n _10: '%N%',\r\n _15: '%N%',\r\n _20: '%N%',\r\n _25: '%N%',\r\n _relvol: '%N',\r\n _pe: '%N',\r\n _fpe: '%N',\r\n _peg: '%N',\r\n _ps: '%N',\r\n _pb: '%N',\r\n _div: '%N%',\r\n _eps5y: '%N%',\r\n _short: '%N%',\r\n _rec: { 1: '%N Strong Buy', 2: '%N Buy', 3: '%N Hold', 4: '%N Sell', 5: '%N Strong Sell' },\r\n _earndate: {\r\n '-30': '%N Days',\r\n '-15': '%N Days',\r\n '-1': 'After Earnings',\r\n 1: 'Before Earnings',\r\n 15: '%N Days',\r\n 30: '%N Days',\r\n },\r\n _portfolioPct: '%N%',\r\n _portfolioUsd: '$%N',\r\n}\r\n\r\nexport const Settings: ISettings = {\r\n padding: { top: 0, right: 0, bottom: 1, left: 1 },\r\n background: tailwindColors.finviz['blue-gray'],\r\n sector: {\r\n padding: { top: 0, right: 1, bottom: 1, left: 1 },\r\n background: null,\r\n border: null,\r\n header: {\r\n color: '#fff',\r\n background: null,\r\n border: null,\r\n height: 14.5,\r\n fontSize: 13,\r\n fontWeight: 'bold',\r\n margin: { top: 0, right: 0, bottom: 0, left: 0 },\r\n padding: { top: -1, right: 4, left: 4 },\r\n },\r\n },\r\n industry: {\r\n padding: { top: 0, right: 1, bottom: 1, left: 1 },\r\n background: null,\r\n border: null,\r\n header: {\r\n color: '#fff',\r\n background: null,\r\n border: tailwindColors.finviz['blue-gray'],\r\n height: 12,\r\n fontSize: 10,\r\n fontWeight: 'normal',\r\n margin: { top: 0, right: 0.5, bottom: 0, left: -0.5 },\r\n padding: { top: -0.5, right: 4, left: 4 },\r\n },\r\n hover: {\r\n color: '#6b5811',\r\n background: '#ffd614',\r\n border: '#ffd614',\r\n height: 12,\r\n fontSize: 10,\r\n fontWeight: 'normal',\r\n margin: { top: 0, right: 0, bottom: 0, left: 0 },\r\n padding: { top: -0.5, right: 3, left: 4 },\r\n },\r\n },\r\n scaleFontSizes: {\r\n 1: [36, 30, 24, 20, 18, 14, 13, 12, 11, 10, 9, 8],\r\n 1.5: [36, 30, 24, 20, 18, 14, 13, 12, 11, 10, 9, 8, 6, 4],\r\n 2.25: [36, 30, 24, 20, 18, 14, 13, 12, 11, 10, 9, 8, 6, 4],\r\n 3: [36, 30, 24, 20, 18, 14, 13, 12, 11, 10, 9, 8, 6, 4],\r\n },\r\n fontSizePadding: {\r\n 36: 30,\r\n 30: 25,\r\n 24: 20,\r\n 20: 14,\r\n 18: 12,\r\n 14: 9,\r\n 13: 7,\r\n 12: 7,\r\n 11: 4,\r\n 10: 3,\r\n 9: 3,\r\n 8: 2.5,\r\n 6: 0,\r\n 4: 1,\r\n },\r\n fontSizePairs: {\r\n 36: [18, 14, 13, 12],\r\n 30: [14, 13, 12, 11, 10],\r\n 24: [14, 13, 12, 11, 10],\r\n 20: [12, 11, 10, 9, 8, 6],\r\n 18: [11, 10, 9, 8, 6],\r\n 14: [9, 8, 6, 4],\r\n 13: [9, 8, 6, 4],\r\n 12: [9, 8, 6, 4],\r\n 11: [8, 6, 4],\r\n 10: [10, 9, 8, 6, 4],\r\n 9: [9, 8, 6, 4],\r\n 8: [8, 6, 4],\r\n 6: [6, 4],\r\n 4: [4],\r\n },\r\n}\r\n\r\nexport const SettingsSmall: ISettings = {\r\n ...Settings,\r\n padding: { top: 0, right: 0, bottom: 0, left: 0 },\r\n background: '#343842',\r\n sector: {\r\n ...Settings.industry,\r\n padding: { top: 0.5, right: 0, bottom: 0, left: 2 },\r\n border: '#e0e0e0',\r\n header: {\r\n ...Settings.industry.header,\r\n margin: { top: 0, right: 0.5, bottom: 0, left: -1.5 },\r\n padding: { top: 0.5, right: 1, left: 1 },\r\n border: '#343842',\r\n fontSize: 9,\r\n },\r\n },\r\n industry: {\r\n ...Settings.industry,\r\n padding: { top: 0, right: 1, bottom: 1, left: 0 },\r\n header: {\r\n ...Settings.industry.header,\r\n height: 0,\r\n },\r\n },\r\n scaleFontSizes: { ...Settings.scaleFontSizes, 1: [14, 12, 11, 8, 6] },\r\n fontSizePadding: { 14: 5, 12: 2, 11: 2, 8: 2, 6: 0, 4: 0 },\r\n fontSizePairs: {\r\n 14: [9, 8, 6],\r\n 13: [9, 8, 6],\r\n 12: [6],\r\n 11: [6],\r\n 10: [6],\r\n 9: [6],\r\n 8: [6],\r\n 6: [6],\r\n },\r\n}\r\n\r\nexport const SettingsSmallDark: ISettings = {\r\n ...SettingsSmall,\r\n sector: {\r\n ...SettingsSmall.sector,\r\n background: tailwindColors.gray[800],\r\n border: tailwindColors.gray[800],\r\n header: {\r\n ...SettingsSmall.sector.header,\r\n padding: { top: 0.5, right: 2, left: 2 },\r\n margin: { top: 0, right: 1.5, bottom: 0, left: -0.5 },\r\n border: tailwindColors.gray[800],\r\n },\r\n },\r\n industry: {\r\n ...SettingsSmall.industry,\r\n header: {\r\n ...SettingsSmall.industry.header,\r\n border: tailwindColors.gray[800],\r\n },\r\n },\r\n}\r\n\r\nexport const SettingsSmallGeo: ISettings = {\r\n ...Settings,\r\n padding: { top: 0, right: 0, bottom: 0, left: 1 },\r\n background: '#a7c4d3',\r\n industry: {\r\n ...Settings.industry,\r\n background: '#e0e0e0',\r\n header: {\r\n ...Settings.industry.header,\r\n height: 9,\r\n fontSize: 8,\r\n border: '#e0e0e0',\r\n margin: { top: -0.5, right: 0.5, bottom: 0, left: -0.5 },\r\n padding: { top: -1, right: 0, left: 1 },\r\n },\r\n },\r\n scaleFontSizes: { ...Settings.scaleFontSizes, 1: [14, 12, 11, 8, 6] },\r\n fontSizePadding: { 14: 5, 12: 2, 11: 2, 8: 1, 6: 0, 4: 0 },\r\n fontSizePairs: {\r\n 14: [9, 8, 6],\r\n 13: [9, 8, 6],\r\n 12: [6],\r\n 11: [6],\r\n 10: [6],\r\n 9: [6],\r\n 8: [6],\r\n 6: [6],\r\n },\r\n}\r\n\r\nexport const SettingsSmallGeoDark: ISettings = {\r\n ...SettingsSmallGeo,\r\n background: tailwindColors.gray[800],\r\n sector: {\r\n ...SettingsSmallGeo.sector,\r\n background: tailwindColors.gray[800],\r\n border: tailwindColors.gray[800],\r\n },\r\n industry: {\r\n ...SettingsSmallGeo.industry,\r\n border: tailwindColors.gray[800],\r\n background: tailwindColors.gray[800],\r\n header: {\r\n ...SettingsSmallGeo.industry.header,\r\n border: tailwindColors.gray[800],\r\n },\r\n },\r\n}\r\n\r\nexport const SettingsScreener: ISettings = {\r\n ...Settings,\r\n padding: { top: 0, right: 0, bottom: 0, left: 0 },\r\n sector: {\r\n ...Settings.sector,\r\n padding: { top: 0, right: 0, bottom: 0, left: 1 },\r\n background: '#363a46',\r\n border: '#d3d3d3',\r\n header: {\r\n ...Settings.sector.header,\r\n height: 20,\r\n padding: { top: 2.5, right: 4, left: 4 },\r\n },\r\n },\r\n industry: {\r\n ...Settings.industry,\r\n header: {\r\n ...Settings.industry.header,\r\n border: '#363a46',\r\n },\r\n },\r\n}\r\n\r\nexport const SettingsScreenerDark: ISettings = {\r\n ...SettingsScreener,\r\n sector: {\r\n ...SettingsScreener.sector,\r\n background: tailwindColors.gray[800],\r\n border: tailwindColors.gray[800],\r\n },\r\n industry: {\r\n ...SettingsScreener.industry,\r\n header: {\r\n ...SettingsScreener.industry.header,\r\n border: tailwindColors.gray[800],\r\n },\r\n },\r\n}\r\n","import * as d3 from 'd3'\r\n\r\nimport * as constants from './constants/generator'\r\nimport { ISettings } from './constants/settings'\r\nimport { MapDataIndustry, MapDataNode, MapDataRoot, MapDataRow, MapDataSector, MapTypeId, NodeDepth } from './types'\r\n\r\nexport default class LayoutGenerator {\r\n width: number\r\n height: number\r\n settings: ISettings\r\n layout?: Array>\r\n sectors: MapDataSector[] = []\r\n industries: MapDataIndustry[] = []\r\n nodes: MapDataNode[] = []\r\n isSmall: boolean\r\n type: MapTypeId\r\n minSectorHeight: number\r\n\r\n static smallIndustryPadding = {\r\n top: 4,\r\n right: 1,\r\n bottom: 1,\r\n left: 1,\r\n }\r\n\r\n static smallIndustryGeoPadding = {\r\n top: 4,\r\n right: 1,\r\n bottom: 1,\r\n left: 1,\r\n }\r\n\r\n static getSizeRatio = (type: MapTypeId, isSmall: boolean) => {\r\n if (isSmall) {\r\n if (type === MapTypeId.World) {\r\n return constants.SMALL_MAP_GEO_HEIGHT_RATIO\r\n }\r\n return constants.SMALL_MAP_HEIGHT_RATIO\r\n }\r\n\r\n return constants.LARGE_MAP_HEIGHT_RATIO\r\n }\r\n\r\n static calculateHeight = (\r\n width: number,\r\n type: MapTypeId,\r\n isSmall: boolean,\r\n ratio = LayoutGenerator.getSizeRatio(type, isSmall)\r\n ) => ~~(width / ratio)\r\n\r\n static calculateWidth = (height: number, type: MapTypeId, isSmall: boolean) => {\r\n const ratio = LayoutGenerator.getSizeRatio(type, isSmall)\r\n\r\n return Math.round(height * ratio)\r\n }\r\n\r\n static isNodeHeaderVisible(node: any, settings: ISettings) {\r\n const deltaX = node.dx ?? Math.round(node.x1) - Math.round(node.x0)\r\n const deltaY = node.dy ?? Math.round(node.y1) - Math.round(node.y0)\r\n\r\n const isLargeNode = deltaX >= constants.LARGE_NODE_SIZE.dx && deltaY >= constants.LARGE_NODE_SIZE.dy\r\n const showHeader =\r\n deltaY - settings.industry.padding.top - settings.industry.header.height > constants.LARGE_NODE_MIN_HEIGHT\r\n\r\n return isLargeNode && showHeader\r\n }\r\n\r\n constructor(width: number, height: number, type: MapTypeId, settings: ISettings, isSmall: boolean = false) {\r\n this.width = width\r\n this.height = height\r\n this.settings = settings\r\n this.isSmall = isSmall\r\n this.type = type\r\n this.minSectorHeight = settings.sector.padding.top + settings.sector.header.height + constants.SECTOR_MIN_HEIGHT\r\n }\r\n\r\n getExportData() {\r\n let mapRoot: MapDataRoot\r\n if (this.type === MapTypeId.World) {\r\n mapRoot = this._rootsToRoot(this.industries)\r\n } else {\r\n mapRoot = this.layout?.find((node) => node.data.name === 'Root') as unknown as MapDataRoot\r\n }\r\n\r\n // Save some file size by filtering out small nodes on maps where hover is not a concern\r\n if (this.isSmall) {\r\n mapRoot.children = this.filterVisibleNodes(mapRoot.children)\r\n }\r\n\r\n const stringified = JSON.stringify(mapRoot, (key, value) => (key === 'parent' ? '[Circular]' : value))\r\n\r\n return JSON.parse(stringified)\r\n }\r\n\r\n getLayoutData() {\r\n return {\r\n nodes: this.nodes,\r\n sectors: this.sectors,\r\n industries: this.industries,\r\n }\r\n }\r\n\r\n filterVisibleNodes = (arr: T[]) =>\r\n arr.filter((node) => {\r\n const isVisible = this.isNodeVisible(node)\r\n if (isVisible && node.children?.length) {\r\n node.children = this.filterVisibleNodes(node.children)\r\n }\r\n return isVisible\r\n })\r\n\r\n isNodeVisible(d: MapDataRow) {\r\n if (!d.depth || d.depth < NodeDepth.Industry) return true\r\n\r\n return d.dx > 0 && d.dy > 0\r\n }\r\n\r\n getLayout(data: MapDataRoot, options: Record = {}) {\r\n this.nodes = []\r\n this.sectors = []\r\n this.industries = []\r\n\r\n switch (this.type) {\r\n case MapTypeId.Sector:\r\n this.layout = this._generateSP500(data).descendants()\r\n break\r\n case MapTypeId.SectorFull:\r\n this.layout = this._generateFull(data).descendants()\r\n break\r\n case MapTypeId.Portfolio:\r\n case MapTypeId.Screener:\r\n case MapTypeId.ETFHoldings:\r\n this.layout = this._generateScreener(data, options).descendants()\r\n break\r\n case MapTypeId.World:\r\n this.layout = this._generateWorld(data)\r\n break\r\n case MapTypeId.ETF:\r\n this.layout = this._generateETF(data).descendants()\r\n break\r\n }\r\n\r\n this.layout?.forEach((d: any) => {\r\n this._transformNode(d)\r\n\r\n if (!this.isNodeVisible(d)) return\r\n\r\n if (!d.children) {\r\n this.nodes.push(d)\r\n } else if (d.parent && !d.parent.parent) {\r\n this.sectors.push(d)\r\n } else if (d.parent && !!d.parent.parent && d.children) {\r\n this.industries.push(d)\r\n }\r\n })\r\n\r\n return this.getLayoutData()\r\n }\r\n\r\n _transformNode(d: d3.HierarchyRectangularNode) {\r\n Object.assign(d, {\r\n name: d.data.name,\r\n description: d.data.description,\r\n perf: d.data.perf,\r\n additional: d.data.additional,\r\n x: d.x0,\r\n y: d.y0,\r\n dx: d.x1 - d.x0,\r\n dy: d.y1 - d.y0,\r\n })\r\n }\r\n\r\n _rootsToRoot(roots: any) {\r\n return {\r\n name: 'Root',\r\n children: [\r\n {\r\n name: 'World',\r\n children: roots,\r\n },\r\n ],\r\n duplicateTickers: 0,\r\n } as MapDataRoot\r\n }\r\n\r\n _getPadding = (d: d3.HierarchyRectangularNode) => {\r\n // Root\r\n if (d.depth === NodeDepth.Root) {\r\n return [\r\n this.settings.padding.top,\r\n this.settings.padding.right,\r\n this.settings.padding.bottom,\r\n this.settings.padding.left,\r\n ]\r\n }\r\n\r\n // Industries\r\n if (d.depth === NodeDepth.Industry) {\r\n if (this.isSmall || LayoutGenerator.isNodeHeaderVisible(d, this.settings)) {\r\n return [\r\n this.settings.industry.padding.top + this.settings.industry.header.height,\r\n this.settings.industry.padding.right,\r\n this.settings.industry.padding.bottom,\r\n this.settings.industry.padding.left,\r\n ]\r\n }\r\n\r\n return [\r\n LayoutGenerator.smallIndustryPadding.top,\r\n LayoutGenerator.smallIndustryPadding.right,\r\n LayoutGenerator.smallIndustryPadding.bottom,\r\n LayoutGenerator.smallIndustryPadding.left,\r\n ]\r\n }\r\n\r\n // Sectors\r\n return [\r\n this.settings.sector.padding.top + this.settings.sector.header.height,\r\n this.settings.sector.padding.right,\r\n this.settings.sector.padding.bottom,\r\n this.settings.sector.padding.left,\r\n ]\r\n }\r\n\r\n _getPaddingGeo = (d: d3.HierarchyRectangularNode) => {\r\n // Root\r\n if (d.depth === NodeDepth.Root) {\r\n return [\r\n this.settings.padding.top,\r\n this.settings.padding.right,\r\n this.settings.padding.bottom,\r\n this.settings.padding.left,\r\n ]\r\n }\r\n\r\n // Industries\r\n if (d.depth === NodeDepth.Industry) {\r\n if (LayoutGenerator.isNodeHeaderVisible(d, this.settings)) {\r\n return [\r\n this.settings.industry.padding.top + this.settings.industry.header.height,\r\n this.settings.industry.padding.right,\r\n this.settings.industry.padding.bottom,\r\n this.settings.industry.padding.left,\r\n ]\r\n }\r\n\r\n return [\r\n LayoutGenerator.smallIndustryGeoPadding.top,\r\n LayoutGenerator.smallIndustryGeoPadding.right,\r\n LayoutGenerator.smallIndustryGeoPadding.bottom,\r\n LayoutGenerator.smallIndustryGeoPadding.left,\r\n ]\r\n }\r\n\r\n // Sectors\r\n return [\r\n this.settings.sector.padding.top + this.settings.sector.header.height,\r\n this.settings.sector.padding.right,\r\n this.settings.sector.padding.bottom,\r\n this.settings.sector.padding.left,\r\n ]\r\n }\r\n\r\n _getHierarchySort = <\r\n Datum extends { y0?: number; y1?: number; value?: number; data: { name: string }; depth?: number },\r\n >(\r\n a: Datum,\r\n b: Datum,\r\n order: Record\r\n ): number => {\r\n // Sort small sectors (works only when layout is recalculated)\r\n const heightB = b.y1! - b.y0!\r\n if (b.depth === NodeDepth.Sector && Number.isFinite(heightB) && heightB < this.minSectorHeight) {\r\n return b.value! - a.value!\r\n }\r\n\r\n if (order.hasOwnProperty(a.data.name) && order.hasOwnProperty(b.data.name)) {\r\n return order[b.data.name] - order[a.data.name]\r\n }\r\n return b.value! - a.value!\r\n }\r\n\r\n _getHierarchy = (data: MapDataRoot, order: Record) =>\r\n d3\r\n .hierarchy(data as unknown as MapDataNode)\r\n .sum((d) => d.value)\r\n .sort((a, b) => this._getHierarchySort(a, b, order))\r\n\r\n _getTreemap = (width: number, height: number) => {\r\n const paddingFn = this.type === MapTypeId.World ? this._getPaddingGeo : this._getPadding\r\n\r\n return d3\r\n .treemap()\r\n .size([width, height])\r\n .round(true)\r\n .tile(d3.treemapSquarify.ratio(1))\r\n .paddingTop((d) => paddingFn(d)[0])\r\n .paddingRight((d) => paddingFn(d)[1])\r\n .paddingBottom((d) => paddingFn(d)[2])\r\n .paddingLeft((d) => paddingFn(d)[3])\r\n }\r\n\r\n _getIndustriesRoots(data: MapDataRoot, industries: string[]) {\r\n return data.children[0].children.filter(function (d) {\r\n return industries.some((i) => i === d.name)\r\n })\r\n }\r\n\r\n _getSectorsRoots(data: MapDataRoot, sectors: string[]) {\r\n return data.children.filter(function (d) {\r\n return sectors.some((s) => s === d.name)\r\n })\r\n }\r\n\r\n _generateLayout(data: MapDataRoot, order: any, recountSectors = false) {\r\n const treemapHeight = LayoutGenerator.calculateHeight(this.width, this.type, false)\r\n const treemap = this._getTreemap(this.width, treemapHeight)\r\n const hierarchy = this._getHierarchy(data, order)\r\n const recalculateHeight = this.height !== treemapHeight\r\n\r\n // Calculate the base layout\r\n let nodes = treemap(hierarchy)\r\n\r\n // Recalculate for custom height\r\n if (this.height !== treemapHeight) {\r\n treemap.tile(d3.treemapResquarify).size([this.width, this.height])\r\n }\r\n\r\n // Run layout again so that possible small sectors are reordered\r\n // This also applies the recalculateHeight option\r\n if (recountSectors || recalculateHeight) {\r\n nodes = treemap(nodes.sort((a, b) => this._getHierarchySort(a, b, order)))\r\n }\r\n\r\n return nodes\r\n }\r\n\r\n _generateSP500(data: MapDataRoot) {\r\n const nodes = this._generateLayout(data, constants.ORDER_SP500)\r\n\r\n // Switch financial and technology sector\r\n const financialSector = nodes.find((node) => node.data.name === 'Financial')!\r\n const technologySector = nodes.find((node) => node.data.name === 'Technology')!\r\n const financialHeight = financialSector.y1 - financialSector.y0\r\n const technologyHeight = technologySector.y1 - technologySector.y0\r\n\r\n financialSector.eachAfter((node) => {\r\n if (node.y1 - node.y0 < 1) return\r\n node.y0 += technologyHeight\r\n node.y1 += technologyHeight\r\n })\r\n\r\n technologySector.eachAfter((node) => {\r\n if (node.y1 - node.y0 < 1) return\r\n node.y0 -= financialHeight\r\n node.y1 -= financialHeight\r\n })\r\n\r\n return nodes\r\n }\r\n\r\n _generateFull(data: MapDataRoot) {\r\n return this._generateLayout(data, constants.ORDER_SEC_ALL)\r\n }\r\n\r\n _generateScreener(data: MapDataRoot, { showETF }: Record) {\r\n const order = showETF ? constants.ORDER_SCREENER_ETF : constants.ORDER_SCREENER\r\n\r\n return this._generateLayout(data, order, true)\r\n }\r\n\r\n _generateETF(data: MapDataRoot) {\r\n return this._generateLayout(data, constants.ORDER_ETF)\r\n }\r\n\r\n _generateWorld = (data: MapDataRoot) => {\r\n const originalWidth = 1211\r\n const ratio = this.width / originalWidth\r\n let nodes: Array> = []\r\n\r\n for (let industryIndex = 0; industryIndex < constants.WORLD_INDUSTRIES.length; industryIndex++) {\r\n const industry = constants.WORLD_INDUSTRIES[industryIndex]\r\n const industryX = Math.round(industry.x * ratio)\r\n const industryY = Math.round(industry.y * ratio)\r\n const industryWidth = Math.round(industry.dx * ratio)\r\n const industryHeight = Math.round(industry.dy * ratio)\r\n\r\n const countriesRoots = this._getIndustriesRoots(data, industry.countries)\r\n const root = this._rootsToRoot(countriesRoots)\r\n const hierarchy = this._getHierarchy(root, constants.ORDER_WORLD)\r\n const treemap = this._getTreemap(industryWidth, industryHeight)\r\n const treemapNodes = treemap(hierarchy)\r\n\r\n treemapNodes.each((d) => {\r\n d.x0 += industryX\r\n d.x1 += industryX\r\n d.y0 += industryY\r\n d.y1 += industryY\r\n })\r\n\r\n // SWITCH BRAZIL AND OTHERS\r\n if (industry.name === 'South America') {\r\n const brazil = treemapNodes.find((d) => d.data.name === 'Brazil')!\r\n const colombia = treemapNodes.find((d) => d.data.name === 'Colombia')!\r\n const brazilWidth = brazil.x1 - brazil.x0\r\n const colombiaWidth = colombia.x1 - colombia.x0\r\n\r\n treemapNodes.each((d) => {\r\n if ([d.parent?.data.name, d.data.name].includes('Brazil')) {\r\n d.x0 += colombiaWidth\r\n d.x1 += colombiaWidth\r\n } else {\r\n d.x0 -= brazilWidth\r\n d.x1 -= brazilWidth\r\n }\r\n })\r\n }\r\n\r\n nodes = nodes.concat(treemapNodes.descendants())\r\n }\r\n\r\n return nodes\r\n }\r\n}\r\n","import * as React from 'react'\r\n\r\nimport { ScreenerQuery, ScreenerView } from '../screener/utils'\r\nimport { isMobile } from '../shared/isMobile'\r\nimport { isStockFastRefreshAvailable } from '../shared/isStockFastRefreshAvailable'\r\nimport { EXPANDED_MAP_BODY_CLASSS } from './constants/constants'\r\nimport { LEGEND_HEIGHT, MAP_MIN_HEIGHT, MAP_MIN_WIDTH } from './constants/generator'\r\nimport { Settings, SettingsSmall, SettingsSmallGeo } from './constants/settings'\r\nimport LayoutGenerator from './layout-generator'\r\nimport type Treemap from './treemap'\r\nimport {\r\n MapDataIndustry,\r\n MapDataNode,\r\n MapDataRoot,\r\n MapDataRow,\r\n MapDataSector,\r\n MapSubtypeId,\r\n MapTypeId,\r\n PerfData,\r\n} from './types'\r\n\r\nexport function getOffset(e: MouseEvent | React.MouseEvent) {\r\n const rect = (e.currentTarget as HTMLElement).getBoundingClientRect()\r\n\r\n return {\r\n offsetX: e.clientX - rect.left,\r\n offsetY: e.clientY - rect.top,\r\n }\r\n}\r\n\r\nexport function getIsSmall() {\r\n const query = new URLSearchParams(window.location.search)\r\n return query.get('settings') === 'small'\r\n}\r\n\r\nexport function getSettingsForMapType(type: MapTypeId, isSmall?: boolean) {\r\n if (isSmall) {\r\n if (type === MapTypeId.World) {\r\n return SettingsSmallGeo\r\n }\r\n return SettingsSmall\r\n }\r\n\r\n return Settings\r\n}\r\n\r\ntype DataRow = MapDataRow | MapDataRoot\r\n/**\r\n * We strip parents when serializing data for precomputed JSONs\r\n * but we need to restore them so that we can get them in treemap\r\n */\r\nexport function restoreDataKeys(\r\n data: T[],\r\n perfData: PerfData,\r\n parent?: any\r\n): T[] {\r\n return data.map((row) => {\r\n const newRow = {\r\n ...row,\r\n parent,\r\n perf: (perfData.nodes as Record)[row.name],\r\n additional: perfData.additional[row.name],\r\n }\r\n\r\n newRow.children = row.children ? restoreDataKeys(row.children, perfData, newRow) : undefined\r\n\r\n return newRow\r\n })\r\n}\r\n\r\nexport function splitData(mapData: MapDataRoot) {\r\n let sectors: MapDataSector[] = []\r\n let industries: MapDataIndustry[] = []\r\n let nodes: MapDataNode[] = []\r\n\r\n mapData.children?.forEach((sector) => {\r\n sectors.push(sector)\r\n sector.children?.forEach((industry) => {\r\n industries.push(industry)\r\n industry.children?.forEach((company) => {\r\n if (!(company.dx < 1 || company.dy < 1)) {\r\n nodes.push(company)\r\n }\r\n })\r\n })\r\n })\r\n\r\n return { sectors, industries, nodes }\r\n}\r\n\r\nexport function getMapData(mapData: MapDataRoot, perfData: PerfData) {\r\n const [data] = restoreDataKeys([mapData], perfData)\r\n\r\n return splitData(data)\r\n}\r\n\r\nexport async function fetchBaseData(filename: string, cacheBuster: number) {\r\n const response = await fetch(`/maps/${filename}?rev=${cacheBuster}`)\r\n\r\n return response.json()\r\n}\r\n\r\nfunction getSizeForExpandedMap(element: HTMLElement, wrapper: HTMLElement | null, type: MapTypeId, isSmall: boolean) {\r\n wrapper?.style.removeProperty('max-width')\r\n let size = getRatioSizeForWidth(element.clientWidth, type, isSmall)\r\n const elementHeight = Math.max(window.innerHeight - LEGEND_HEIGHT - 50, MAP_MIN_HEIGHT)\r\n\r\n // We don’t want the map to overflow the height\r\n if (size.height > elementHeight) {\r\n const newWidth = LayoutGenerator.calculateWidth(elementHeight, type, isSmall)\r\n size = {\r\n width: newWidth,\r\n height: LayoutGenerator.calculateHeight(newWidth, type, isSmall),\r\n }\r\n }\r\n\r\n if (wrapper) {\r\n wrapper.style.maxWidth = `${size.width}px`\r\n }\r\n\r\n return size\r\n}\r\n\r\nfunction getRatioSizeForWidth(width: number, type: MapTypeId, isSmall: boolean) {\r\n const mapWidth = Math.max(width, MAP_MIN_WIDTH)\r\n return {\r\n width: mapWidth,\r\n height: LayoutGenerator.calculateHeight(mapWidth, type, isSmall),\r\n }\r\n}\r\n\r\nfunction getSizeRatioBasedMap(element: HTMLElement, wrapper: HTMLElement | null, type: MapTypeId, isSmall: boolean) {\r\n // Remove maxWidth if exiting expanded mode\r\n if (wrapper?.style.maxWidth) {\r\n wrapper.style.removeProperty('max-width')\r\n }\r\n\r\n let size = getRatioSizeForWidth(element.clientWidth, type, isSmall)\r\n\r\n // Set height so that we know if scrollbars are visible\r\n element.style.height = `${size.height + LEGEND_HEIGHT}px`\r\n\r\n // Add a bit of padding if scrollbar is visible and map touches it\r\n const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth\r\n const isMediumScreen =\r\n window.innerWidth > 1430 &&\r\n window.innerWidth < 1450 &&\r\n !document.body.classList.contains('is-screener') &&\r\n !document.body.classList.contains('is-portfolio')\r\n if (isMediumScreen && scrollbarWidth > 0) {\r\n size = getRatioSizeForWidth(element.clientWidth - 10, type, isSmall)\r\n\r\n // This means we would display a horizontal scrollbar, which we don’t want\r\n } else if (size.width !== element.clientWidth) {\r\n size = getRatioSizeForWidth(element.clientWidth, type, isSmall)\r\n }\r\n\r\n element.style.removeProperty('height')\r\n\r\n return size\r\n}\r\n\r\n/**\r\n * Calculate size of the treemap based on w/h ratio and scrollbars visibility\r\n */\r\nexport function getSize(element: HTMLElement | null, type: MapTypeId, isSmall: boolean) {\r\n const canvasWrapper = document.getElementById('canvas-wrapper')\r\n\r\n if (!element) {\r\n return { width: 1, height: 1 }\r\n }\r\n\r\n // Custom width using query param\r\n const query = new URLSearchParams(window.location.search)\r\n if (query.has('width')) {\r\n const width = Number(query.get('width'))\r\n const parsedRatio = query.has('ratio') ? parseFloat(query.get('ratio')!) : undefined\r\n const ratio = Number.isFinite(parsedRatio) ? parsedRatio : undefined\r\n return {\r\n width,\r\n height: LayoutGenerator.calculateHeight(width, type, isSmall, ratio),\r\n }\r\n }\r\n\r\n // Expanded map\r\n if (document.body.classList.contains(EXPANDED_MAP_BODY_CLASSS)) {\r\n return getSizeForExpandedMap(element, canvasWrapper, type, isSmall)\r\n }\r\n\r\n if (type === MapTypeId.ETFHoldings) {\r\n return { height: element.clientHeight, width: element.clientWidth }\r\n }\r\n\r\n return getSizeRatioBasedMap(element, canvasWrapper, type, isSmall)\r\n}\r\n\r\n/**\r\n * Get treemap zoom levels based on env\r\n */\r\nexport function getDefaultZoomLevels() {\r\n if (isMobile()) {\r\n return [1, 1.5]\r\n }\r\n\r\n if (/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {\r\n return [1, 1.5, 2.25]\r\n }\r\n\r\n return [1, 1.5, 2.25, 3]\r\n}\r\n\r\nexport function parseInitDataAsPerf(data?: MapDataRoot): PerfData | undefined {\r\n if (!data) return\r\n\r\n const nodes: Record = {}\r\n const additional: Record = {}\r\n\r\n for (const sector of data.children) {\r\n for (const industry of sector.children) {\r\n for (const node of industry.children) {\r\n if (node.perf !== undefined) {\r\n nodes[node.name] = node.perf\r\n }\r\n if (node.additional !== undefined) {\r\n additional[node.name] = node.additional\r\n }\r\n }\r\n }\r\n }\r\n\r\n return {\r\n nodes,\r\n additional,\r\n subtype: MapSubtypeId.DayPerf,\r\n version: 1,\r\n }\r\n}\r\n\r\nconst MAX_SPARKLINES = 120\r\nconst HOVER_TOP_ROW_HEIGHT = 100\r\nconst HOVER_BORDER_WIDTH = 4\r\nconst ROW_HEIGHT = 30\r\nconst ROW_HEIGHT_SMALL = 24\r\nconst ROW_HEIGHT_BREAKPOINT = 15\r\n\r\nexport function getVisibleTooltipTickers(node?: MapDataNode) {\r\n if (!node) return []\r\n\r\n const industryTickers = node.parent.children\r\n const isSmall = industryTickers.length > ROW_HEIGHT_BREAKPOINT\r\n const rowHeight = isSmall ? ROW_HEIGHT_SMALL : ROW_HEIGHT\r\n const visibleRows = Math.floor((window.innerHeight - HOVER_TOP_ROW_HEIGHT - 2 * HOVER_BORDER_WIDTH) / rowHeight)\r\n const visibleChildren = industryTickers\r\n .slice()\r\n .sort((a, b) => b.dx * b.dy - a.dx * a.dy)\r\n .slice(0, Math.min(visibleRows, MAX_SPARKLINES))\r\n .map((n) => n.name)\r\n\r\n return visibleChildren\r\n}\r\n\r\nexport function onNodeClick({\r\n treemap,\r\n node,\r\n industry,\r\n sector,\r\n}: {\r\n treemap: Treemap\r\n node?: MapDataNode\r\n industry?: MapDataIndustry\r\n sector?: MapDataSector\r\n}) {\r\n if (node) {\r\n window.open(`/quote.ashx?t=${node.name}`)\r\n return\r\n }\r\n\r\n const query = new URLSearchParams()\r\n query.set(ScreenerQuery.View, ScreenerView.Overview.toString())\r\n\r\n // Use ticker filter for ETFs\r\n if (treemap.type === MapTypeId.ETF) {\r\n let tickers: string[] = []\r\n if (industry) {\r\n tickers = industry.children.map((node) => node.name)\r\n } else if (sector) {\r\n tickers = sector.children.flatMap((industry) => industry.children.map((node) => node.name))\r\n }\r\n\r\n if (tickers.length) {\r\n query.set(ScreenerQuery.Tickers, tickers.join(','))\r\n window.open(`/screener.ashx?${query}`)\r\n }\r\n\r\n return\r\n }\r\n\r\n if (industry) {\r\n const id = industry.name.replace(/[^a-zA-Z]/g, '').toLowerCase()\r\n const filter = treemap.type === MapTypeId.World ? 'geo' : 'ind'\r\n\r\n query.set(ScreenerQuery.Filters, `${filter}_${id}`)\r\n window.open(`/screener.ashx?${query}`)\r\n } else if (sector) {\r\n const id = sector.name.replace(/[^a-zA-Z]/g, '').toLowerCase()\r\n\r\n query.set(ScreenerQuery.Filters, `sec_${id}`)\r\n window.open(`/screener.ashx?${query}`)\r\n }\r\n}\r\n\r\nenum MapsPollingIntervalInMs {\r\n Free = 180000,\r\n Elite = 3000,\r\n EliteStocksReduced = 60000,\r\n}\r\n\r\nexport function getMapsRefreshInterval({\r\n base = MapsPollingIntervalInMs.Elite,\r\n reduced = MapsPollingIntervalInMs.EliteStocksReduced,\r\n free = MapsPollingIntervalInMs.Free,\r\n}: { base?: number; reduced?: number; free?: number } = {}) {\r\n const isPremium = FinvizSettings.hasUserPremium\r\n let customRefreshInterval = base\r\n if (!isPremium) {\r\n customRefreshInterval = free\r\n } else if (!isStockFastRefreshAvailable()) {\r\n customRefreshInterval = reduced\r\n }\r\n\r\n return customRefreshInterval\r\n}\r\n","export enum ScreenerQuery {\r\n View = 'v',\r\n Signal = 's',\r\n Order = 'o',\r\n Tickers = 't',\r\n Filters = 'f',\r\n FilterTab = 'ft',\r\n MapSubtype = 'st',\r\n}\r\n\r\nexport enum ScreenerFilter {\r\n MarketCap = 'cap',\r\n Index = 'idx',\r\n Sector = 'sec',\r\n Industry = 'ind',\r\n AverageVolume = 'sh_avgvol',\r\n}\r\n\r\nexport enum ScreenerAddtionalQuery {\r\n ShowEtf = 'show_etf',\r\n}\r\n\r\nexport enum ScreenerView {\r\n Overview = 11,\r\n Maps = 71,\r\n Bubbles = 72,\r\n}\r\n\r\nexport function eventListenerRegister(el: HTMLElement, eventName: string, handler: (...args: any[]) => any) {\r\n el.addEventListener(eventName, handler)\r\n\r\n return () => {\r\n el.removeEventListener(eventName, handler)\r\n }\r\n}\r\n\r\nexport function textContent(el: HTMLElement) {\r\n return el.textContent || el.innerText\r\n}\r\n\r\nexport function ScreenerGetOptionsList(select: HTMLSelectElement) {\r\n const options = select.getAttribute('data-selected')?.split('|') ?? [],\r\n result = []\r\n for (var i = 0, len = options.length; i < len; i++) {\r\n var option = options[i]\r\n for (var j = 0; j < select.children.length; j++) {\r\n var optionEl = select.children[j] as HTMLOptionElement\r\n if (optionEl.value === option) {\r\n result.push({\r\n key: option,\r\n value: textContent(optionEl),\r\n })\r\n }\r\n }\r\n }\r\n return result\r\n}\r\n\r\nexport function ScreenerRenderCustomModal(select: any) {\r\n const filter = select.getAttribute('data-filter')\r\n const customWrapper = document.getElementById('fsm_' + filter) as HTMLElement\r\n if (customWrapper) {\r\n select.style.display = 'none'\r\n customWrapper.style.display = 'block'\r\n const input = document.getElementById('fsmi_' + filter) as HTMLInputElement\r\n const options = ScreenerGetOptionsList(select)\r\n const arr = []\r\n for (let i = 0, len = options.length; i < len; i++) {\r\n arr.push(options[i].value)\r\n }\r\n input.value = arr.join(', ')\r\n }\r\n}\r\n\r\nconst DATE_REGEX = /^[0-9]{2}[-][0-9]{2}[-][0-9]{4}/\r\n\r\nexport function getIsOptionDateRange(option: string) {\r\n if (!option.includes('x')) return false\r\n\r\n const [from, to] = option.split('x')\r\n const [isValidFromDate, isValidToDate] = [from, to].map((value) => {\r\n if (DATE_REGEX.test(value)) {\r\n return !Number.isNaN(new Date(value.replace(/-/g, '/')).getTime())\r\n }\r\n return false\r\n })\r\n\r\n return isValidFromDate || isValidToDate\r\n}\r\n\r\nexport function getInitialDateFromSelectedValues(selectedValues: string[]) {\r\n const initialDate = selectedValues.find(getIsOptionDateRange)\r\n\r\n if (initialDate) {\r\n return initialDate.split('x').map((date) => (DATE_REGEX.test(date) ? date.replace(/-/g, '/') : undefined))\r\n }\r\n}\r\n\r\nexport function dateRangeToFilterString({ from, to }: { from?: string; to?: string }) {\r\n return from || to ? `${from ?? ''}x${to ?? ''}`.replace(/\\//g, '-') : null\r\n}\r\n\r\n/**\r\n * Creates link for given view & subview and ignores any additional query params\r\n */\r\nexport function getQueryForView(view?: ScreenerView, allowedParams: string[] = [], baseQuery = window.location.search) {\r\n const query = new URLSearchParams(baseQuery)\r\n const allowList = [...allowedParams, ...Object.values(ScreenerQuery)]\r\n\r\n /**\r\n * Seems like `query` is a live property, so we can’t use `query.forEach` to delete,\r\n * so we need to copy keys before looping.\r\n * https://stackoverflow.com/questions/60522437\r\n */\r\n const keys = Array.from(query.keys())\r\n\r\n keys.forEach((key) => {\r\n if (!allowList.includes(key)) {\r\n query.delete(key)\r\n }\r\n })\r\n\r\n const [, originalView, settings = 0] = query.get(ScreenerQuery.View)?.match(/(\\d{2})(\\d)/) ?? []\r\n\r\n if (view ?? originalView) {\r\n query.set(ScreenerQuery.View, `${view ?? originalView}${settings}`)\r\n }\r\n\r\n return query\r\n}\r\n\r\n/**\r\n * Parse screener `f` query param to object\r\n */\r\nexport function parseScreenerFilters(baseQuery = window.location.search) {\r\n const query = new URLSearchParams(baseQuery)\r\n const filtersString = query.get(ScreenerQuery.Filters)\r\n\r\n if (!filtersString) return {}\r\n\r\n return Object.fromEntries(\r\n filtersString.split(',').map((f) => {\r\n const lastUnderscore = f.lastIndexOf('_')\r\n const key = f.substring(0, lastUnderscore)\r\n const value = f.substring(lastUnderscore + 1)\r\n return [key, value.split('|')]\r\n })\r\n )\r\n}\r\n\r\n/**\r\n * Stringify screener `f` query param\r\n */\r\nexport function stringifyScreenerFilters(filters: Record) {\r\n return Object.entries(filters)\r\n .filter(([, value]) => String(value).length > 0)\r\n .map(([key, value]) => `${key}_${value.join('|')}`)\r\n .join(',')\r\n}\r\n\r\nexport function rangesToFilter(\r\n ranges: {\r\n from: string\r\n to: string\r\n }[],\r\n rangeSuffixes?: string[],\r\n delimiter = 'x',\r\n rangeDelimiter = 'to'\r\n) {\r\n return ranges.reduce((filter, range, index) => {\r\n const { from, to } = range\r\n const rangeStr = from || to ? `${from}${rangeDelimiter}${to}${rangeSuffixes?.[index] ?? ''}` : ''\r\n\r\n let currentFilter = filter\r\n if (index > 0) currentFilter += delimiter\r\n return currentFilter + rangeStr\r\n }, '')\r\n}\r\n","import { getDate } from '../header/utils'\r\n\r\n// Keep in sync with the original in charts repo in app/constants/common.ts\r\nexport const PREMARKET_AFTERMARKET_HOURS = 2.5\r\n\r\n/*\r\n * Keep in sync with the original (Utils static method) in charts repo in app/utils.ts\r\n * See line 15, we use getDate instead of convertLocalToNyTime\r\n */\r\nexport function isStockFastRefreshAvailable(hasPremarket = true, hasAftermarket = true, bufferMinutes = 30) {\r\n const MARKET_START = { hours: 9, minutes: 30 }\r\n const MARKET_END = { hours: 16, minutes: 0 }\r\n const getMinutes = ({ hours, minutes }: { hours: number; minutes: number }) => hours * 60 + minutes\r\n\r\n const date = getDate()\r\n const dayOfWeek = date.getDay()\r\n const currentDayMinutes = date.getHours() * 60 + date.getMinutes()\r\n\r\n const premarketMinutes = hasPremarket ? PREMARKET_AFTERMARKET_HOURS * 60 : 0\r\n const aftermarketMinutes = hasAftermarket ? PREMARKET_AFTERMARKET_HOURS * 60 : 0\r\n\r\n const isWeekend = dayOfWeek === 0 || dayOfWeek === 6\r\n const isOpen = getMinutes(MARKET_START) - premarketMinutes - bufferMinutes <= currentDayMinutes\r\n const isClosed = getMinutes(MARKET_END) + aftermarketMinutes + bufferMinutes <= currentDayMinutes\r\n return !isWeekend && isOpen && !isClosed\r\n}\r\n"],"names":["module","exports","white","black","inherit","transparent","current","finviz","blue","gray","red","orange","amber","yellow","brightYellow","lime","green","emerald","teal","violet","purple","pink","EXPANDED_MAP_BODY_CLASSS","FALLBACK_PERF_RESPONSE","nodes","additional","subtype","MapSubtypeId","MAP_SUBTYPES_COMPANIES_BY_ID","id","name","scaleId","ScaleId","tooltip","countIndustryPerf","countSectorPerf","MAP_SUBTYPES_ETF_BY_ID","MAP_SUBTYPES_COMPANIES","Object","values","MAP_SUBTYPES_ETF","MAP_TYPES","pageTitle","description","type","MapTypeId","subtypes","nameShort","MAP_TYPE_SCREENER","MAP_TYPE_ETF_HOLDINGS_WIDGET","MAP_MIN_WIDTH","MAP_MIN_HEIGHT","SECTOR_MIN_HEIGHT","LEGEND_HEIGHT","LARGE_MAP_HEIGHT_RATIO","SMALL_MAP_GEO_HEIGHT_RATIO","SMALL_MAP_HEIGHT_RATIO","LARGE_NODE_SIZE","dx","dy","LARGE_NODE_MIN_HEIGHT","ORDER_SP500","Technology","Financial","Healthcare","Industrials","Energy","Utilities","ORDER_SEC_ALL","ORDER_ETF","US","Global","International","Commodity","Strategy","Forex","ORDER_SCREENER","ORDER_SCREENER_ETF","ORDER_WORLD","Ireland","Spain","France","Belgium","Netherlands","Switzerland","China","Japan","India","Taiwan","Colombia","Chile","Argentina","WORLD_INDUSTRIES","x","y","countries","scaleMinMax","_5","_10","_15","_20","_25","_relvol","_pe","_fpe","_peg","_ps","_pb","_div","_eps5y","_short","_rec","_earndate","_portfolioPct","_portfolioUsd","scaleStepFormat","Settings","padding","top","right","bottom","left","background","tailwindColors","sector","border","header","color","height","fontSize","fontWeight","margin","industry","hover","scaleFontSizes","fontSizePadding","fontSizePairs","SettingsSmall","SettingsSmallDark","SettingsSmallGeo","SettingsSmallGeoDark","SettingsScreener","SettingsScreenerDark","LayoutGenerator","width","settings","layout","sectors","industries","isSmall","minSectorHeight","static","getSizeRatio","constants","ratio","arguments","length","undefined","calculateWidth","Math","round","node","deltaX","x1","x0","deltaY","y1","y0","isLargeNode","showHeader","constructor","this","getExportData","mapRoot","_rootsToRoot","find","data","children","filterVisibleNodes","stringified","JSON","stringify","key","value","parse","getLayoutData","arr","filter","isVisible","isNodeVisible","d","depth","NodeDepth","getLayout","options","_generateSP500","descendants","_generateFull","_generateScreener","_generateWorld","_generateETF","forEach","_transformNode","parent","push","assign","perf","roots","duplicateTickers","_getPadding","isNodeHeaderVisible","smallIndustryPadding","_getPaddingGeo","smallIndustryGeoPadding","_getHierarchySort","a","b","order","heightB","Number","isFinite","hasOwnProperty","_getHierarchy","d3","sum","sort","_getTreemap","paddingFn","size","tile","paddingTop","paddingRight","paddingBottom","paddingLeft","_getIndustriesRoots","some","i","_getSectorsRoots","s","_generateLayout","recountSectors","treemapHeight","calculateHeight","treemap","hierarchy","recalculateHeight","financialSector","technologySector","financialHeight","technologyHeight","eachAfter","_ref","showETF","industryIndex","industryX","industryY","industryWidth","industryHeight","countriesRoots","root","treemapNodes","each","brazil","colombia","brazilWidth","colombiaWidth","includes","concat","getOffset","e","rect","currentTarget","getBoundingClientRect","offsetX","clientX","offsetY","clientY","getIsSmall","URLSearchParams","window","location","search","get","getSettingsForMapType","restoreDataKeys","perfData","map","row","newRow","getMapData","mapData","company","splitData","async","fetchBaseData","filename","cacheBuster","fetch","json","getRatioSizeForWidth","mapWidth","max","getSize","element","canvasWrapper","document","getElementById","query","has","parsedRatio","parseFloat","body","classList","contains","wrapper","style","removeProperty","clientWidth","elementHeight","innerHeight","newWidth","maxWidth","getSizeForExpandedMap","clientHeight","scrollbarWidth","innerWidth","documentElement","getSizeRatioBasedMap","getDefaultZoomLevels","isMobile","test","navigator","userAgent","parseInitDataAsPerf","version","getVisibleTooltipTickers","industryTickers","rowHeight","visibleRows","floor","slice","min","n","onNodeClick","open","set","ScreenerQuery","ScreenerView","tickers","flatMap","join","replace","toLowerCase","MapsPollingIntervalInMs","getMapsRefreshInterval","base","Elite","reduced","EliteStocksReduced","free","Free","isPremium","FinvizSettings","hasUserPremium","customRefreshInterval","isStockFastRefreshAvailable","ScreenerFilter","ScreenerAddtionalQuery","eventListenerRegister","el","eventName","handler","addEventListener","removeEventListener","textContent","innerText","ScreenerRenderCustomModal","select","getAttribute","customWrapper","display","input","split","result","len","option","j","optionEl","ScreenerGetOptionsList","DATE_REGEX","getIsOptionDateRange","from","to","isValidFromDate","isValidToDate","isNaN","Date","getTime","getInitialDateFromSelectedValues","selectedValues","initialDate","date","dateRangeToFilterString","getQueryForView","view","allowedParams","baseQuery","allowList","keys","Array","delete","originalView","View","match","parseScreenerFilters","filtersString","Filters","fromEntries","f","lastUnderscore","lastIndexOf","substring","stringifyScreenerFilters","filters","entries","_ref2","String","_ref3","rangesToFilter","ranges","rangeSuffixes","delimiter","rangeDelimiter","reduce","range","index","currentFilter","hasPremarket","hasAftermarket","bufferMinutes","MARKET_START","hours","minutes","MARKET_END","getMinutes","getDate","dayOfWeek","getDay","currentDayMinutes","getHours","premarketMinutes","PREMARKET_AFTERMARKET_HOURS","aftermarketMinutes","isWeekend","isOpen","isClosed"],"sourceRoot":""}