@@ -41,7 +41,7 @@ export interface PackageQuadrantPoint {
4141const WEIGHTS = {
4242 adoption : {
4343 downloads : 0.75 , // dominant signal because they best reflect real-world adoption (in the data we have through facets currently)
44- freshness : 0.15 , // small correction so stale packages are slightly
44+ freshness : 0.15 , // small correction so stale packages are slightly
4545 likes : 0.1 , // might be pumped up in the future when ./npmx likes are more mainstream
4646 } ,
4747 efficiency : {
@@ -59,11 +59,11 @@ const WEIGHTS = {
5959}
6060
6161/* Fixed logarithmic ceilings to normalize metrics onto a stable [-1, 1] scale.
62- * This avoids dataset-relative min/max normalization, which would shift scores depending
63- * on which packages are being compared. Ceilings act as reference points for what is
64- * considered 'high' for each metric, ensuring consistent positioning across different
65- * datasets while preserving meaningful differences via log scaling.
66- */
62+ * This avoids dataset-relative min/max normalization, which would shift scores depending
63+ * on which packages are being compared. Ceilings act as reference points for what is
64+ * considered 'high' for each metric, ensuring consistent positioning across different
65+ * datasets while preserving meaningful differences via log scaling.
66+ */
6767const LOG_CEILINGS = {
6868 downloads : 100_000_000 ,
6969 likes : 1000 , // might be pumped up in the future when ./npmx likes are more mainstream
@@ -165,7 +165,10 @@ function createQuadrantPoint(packageItem: PackageQuadrantInput): PackageQuadrant
165165 const normalisedLikes = normalizeLogHigherBetter ( totalLikes , LOG_CEILINGS . likes )
166166 const normalisedInstallSize = normalizeLogLowerBetter ( installSize , LOG_CEILINGS . installSize )
167167 const normalisedDependencies = normalizeLogLowerBetter ( dependencies , LOG_CEILINGS . dependencies )
168- const normalisedTotalDependencies = normalizeLogLowerBetter ( totalDependencies , LOG_CEILINGS . totalDependencies )
168+ const normalisedTotalDependencies = normalizeLogLowerBetter (
169+ totalDependencies ,
170+ LOG_CEILINGS . totalDependencies ,
171+ )
169172 const normalisedPackageSize = normalizeLogLowerBetter ( packageSize , LOG_CEILINGS . packageSize )
170173
171174 const normalisedVulnerabilities = getVulnerabilityPenalty ( vulnerabilities )
@@ -216,4 +219,4 @@ function createQuadrantPoint(packageItem: PackageQuadrantInput): PackageQuadrant
216219export function createQuadrantDataset ( packages : PackageQuadrantInput [ ] ) : PackageQuadrantPoint [ ] {
217220 if ( ! packages . length ) return [ ]
218221 return packages . map ( packageItem => createQuadrantPoint ( packageItem ) )
219- }
222+ }
0 commit comments