update:清理误提交构建产物并更新range适配
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
import { cubicIn, cubicOut } from "svelte/easing";
|
||||
import { onMount } from "svelte";
|
||||
import { fly } from "svelte/transition";
|
||||
import { DEFAULT_PRESSURE_RANGE_MAX, DEFAULT_PRESSURE_RANGE_MIN } from "$lib/config/pressure-range";
|
||||
import ConfigPanel from "$lib/components/ConfigPanel.svelte";
|
||||
import NeonBreakoutArena from "$lib/components/NeonBreakoutArena.svelte";
|
||||
import PressureMatrixViewer from "$lib/components/PressureMatrixViewer.svelte";
|
||||
@@ -37,8 +38,8 @@
|
||||
export let applyLiveHint = "";
|
||||
export let matrixRows = 12;
|
||||
export let matrixCols = 7;
|
||||
export let rangeMin = 0;
|
||||
export let rangeMax = 16000;
|
||||
export let rangeMin = DEFAULT_PRESSURE_RANGE_MIN;
|
||||
export let rangeMax = DEFAULT_PRESSURE_RANGE_MAX;
|
||||
export let colorMapPreset: PressureColorMapPreset = "emerald";
|
||||
export let matrixDisplayMode: MatrixDisplayMode = "dots";
|
||||
export let colorMapOptions: HudColorMapOption[] = [];
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { createEventDispatcher } from "svelte";
|
||||
import { DEFAULT_PRESSURE_RANGE_MAX, DEFAULT_PRESSURE_RANGE_MIN } from "$lib/config/pressure-range";
|
||||
import type { HudColorMapOption, PressureColorMapPreset } from "$lib/types/hud";
|
||||
|
||||
export let title = "";
|
||||
@@ -15,8 +16,8 @@
|
||||
export let applyLiveHint = "";
|
||||
export let matrixRows = 12;
|
||||
export let matrixCols = 7;
|
||||
export let rangeMin = 0;
|
||||
export let rangeMax = 16000;
|
||||
export let rangeMin = DEFAULT_PRESSURE_RANGE_MIN;
|
||||
export let rangeMax = DEFAULT_PRESSURE_RANGE_MAX;
|
||||
export let colorMapPreset: PressureColorMapPreset = "emerald";
|
||||
export let colorMapOptions: HudColorMapOption[] = [];
|
||||
|
||||
@@ -84,8 +85,8 @@
|
||||
function resetDefaults(): void {
|
||||
matrixRows = 12;
|
||||
matrixCols = 7;
|
||||
rangeMin = 0;
|
||||
rangeMax = 16000;
|
||||
rangeMin = DEFAULT_PRESSURE_RANGE_MIN;
|
||||
rangeMax = DEFAULT_PRESSURE_RANGE_MAX;
|
||||
colorMapPreset = "emerald";
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { onMount } from "svelte";
|
||||
import * as THREE from "three";
|
||||
import { DEFAULT_PRESSURE_RANGE_MAX, DEFAULT_PRESSURE_RANGE_MIN } from "$lib/config/pressure-range";
|
||||
import { pressureColorPalettes } from "$lib/config/color-map";
|
||||
import type { LocaleCode, PressureColorMapPreset } from "$lib/types/hud";
|
||||
|
||||
@@ -44,8 +45,8 @@
|
||||
export let pressureMatrix: number[] | null = null;
|
||||
export let matrixRows = 12;
|
||||
export let matrixCols = 7;
|
||||
export let rangeMin = 0;
|
||||
export let rangeMax = 16000;
|
||||
export let rangeMin = DEFAULT_PRESSURE_RANGE_MIN;
|
||||
export let rangeMax = DEFAULT_PRESSURE_RANGE_MAX;
|
||||
export let colorMapPreset: PressureColorMapPreset = "emerald";
|
||||
|
||||
const FIELD_HALF_W = 46;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import { onMount } from "svelte";
|
||||
import * as THREE from "three";
|
||||
import { OrbitControls } from "three/examples/jsm/controls/OrbitControls.js";
|
||||
import { DEFAULT_PRESSURE_RANGE_MAX, DEFAULT_PRESSURE_RANGE_MIN } from "$lib/config/pressure-range";
|
||||
import { pressureColorPalettes } from "$lib/config/color-map";
|
||||
import type { HudSummary, MatrixDisplayMode, PressureColorMapPreset } from "$lib/types/hud";
|
||||
|
||||
@@ -25,8 +26,8 @@
|
||||
export let pressureMatrix: number[] | null = null;
|
||||
export let matrixRows = 12;
|
||||
export let matrixCols = 7;
|
||||
export let rangeMin = 0;
|
||||
export let rangeMax = 16000;
|
||||
export let rangeMin = DEFAULT_PRESSURE_RANGE_MIN;
|
||||
export let rangeMax = DEFAULT_PRESSURE_RANGE_MAX;
|
||||
export let colorMapPreset: PressureColorMapPreset = "emerald";
|
||||
export let matrixDisplayMode: MatrixDisplayMode = "dots";
|
||||
export let summary: HudSummary | null = null;
|
||||
@@ -37,7 +38,6 @@
|
||||
let overlayEl: HTMLCanvasElement | undefined;
|
||||
let stats: ViewerStats = { current: null, max: null, min: null };
|
||||
|
||||
const DEFAULT_RANGE_MAX = 16000;
|
||||
const BASE_MATRIX_SPAN = 24;
|
||||
const MATRIX_SPAN_GROWTH = 0.6;
|
||||
const MIN_MATRIX_SPAN = 24;
|
||||
@@ -117,8 +117,11 @@
|
||||
}
|
||||
|
||||
function sanitizeRangePair(minValue: number, maxValue: number): { min: number; max: number } {
|
||||
const resolvedMin = Math.round(Number.isFinite(minValue) ? minValue : 0);
|
||||
const resolvedMax = Math.max(Math.round(Number.isFinite(maxValue) ? maxValue : DEFAULT_RANGE_MAX), resolvedMin + 1);
|
||||
const resolvedMin = Math.round(Number.isFinite(minValue) ? minValue : DEFAULT_PRESSURE_RANGE_MIN);
|
||||
const resolvedMax = Math.max(
|
||||
Math.round(Number.isFinite(maxValue) ? maxValue : DEFAULT_PRESSURE_RANGE_MAX),
|
||||
resolvedMin + 1
|
||||
);
|
||||
return { min: resolvedMin, max: resolvedMax };
|
||||
}
|
||||
|
||||
|
||||
2
src/lib/config/pressure-range.ts
Normal file
2
src/lib/config/pressure-range.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export const DEFAULT_PRESSURE_RANGE_MIN = 0;
|
||||
export const DEFAULT_PRESSURE_RANGE_MAX = 6000;
|
||||
Reference in New Issue
Block a user