mirror of
https://github.com/apache/superset.git
synced 2026-05-29 20:29:34 +00:00
chore(frontend): comprehensive TypeScript quality improvements (#37625)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -22,7 +22,11 @@ import roundDecimal from './roundDecimal';
|
||||
export const EARTH_CIRCUMFERENCE_KM = 40075.16;
|
||||
export const MILES_PER_KM = 1.60934;
|
||||
|
||||
export function kmToPixels(kilometers, latitude, zoomLevel) {
|
||||
export function kmToPixels(
|
||||
kilometers: number,
|
||||
latitude: number,
|
||||
zoomLevel: number,
|
||||
): number {
|
||||
// Algorithm from: http://wiki.openstreetmap.org/wiki/Zoom_levels
|
||||
const latitudeRad = latitude * (Math.PI / 180);
|
||||
// Seems like the zoomLevel is off by one
|
||||
@@ -21,7 +21,11 @@ export const LUMINANCE_RED_WEIGHT = 0.2126;
|
||||
export const LUMINANCE_GREEN_WEIGHT = 0.7152;
|
||||
export const LUMINANCE_BLUE_WEIGHT = 0.0722;
|
||||
|
||||
export default function luminanceFromRGB(r, g, b) {
|
||||
export default function luminanceFromRGB(
|
||||
r: number,
|
||||
g: number,
|
||||
b: number,
|
||||
): number {
|
||||
// Formula: https://en.wikipedia.org/wiki/Relative_luminance
|
||||
return (
|
||||
LUMINANCE_RED_WEIGHT * r +
|
||||
Reference in New Issue
Block a user