feat: remove statistics from Distinct Colors generator
This commit is contained in:
@@ -14,11 +14,6 @@ export default function DistinctPage() {
|
||||
const [count, setCount] = useState(8);
|
||||
const [metric, setMetric] = useState<'cie76' | 'ciede2000'>('ciede2000');
|
||||
const [colors, setColors] = useState<string[]>([]);
|
||||
const [stats, setStats] = useState<{
|
||||
min_distance: number;
|
||||
avg_distance: number;
|
||||
generation_time_ms: number;
|
||||
} | null>(null);
|
||||
|
||||
const generateMutation = useGenerateDistinct();
|
||||
|
||||
@@ -29,7 +24,6 @@ export default function DistinctPage() {
|
||||
metric,
|
||||
});
|
||||
setColors(result.colors);
|
||||
setStats(result.stats);
|
||||
toast.success(`Generated ${result.colors.length} distinct colors`);
|
||||
} catch (error) {
|
||||
toast.error('Failed to generate distinct colors');
|
||||
@@ -100,28 +94,6 @@ export default function DistinctPage() {
|
||||
This may take a few moments..
|
||||
</div>
|
||||
)}
|
||||
|
||||
{stats && (
|
||||
<div className="pt-4 border-t space-y-2">
|
||||
<h3 className="font-semibold text-sm">Statistics</h3>
|
||||
<div className="space-y-1 text-sm">
|
||||
<div className="flex justify-between">
|
||||
<span className="text-muted-foreground">Min Distance:</span>
|
||||
<span className="font-mono">{stats.min_distance.toFixed(2)}</span>
|
||||
</div>
|
||||
<div className="flex justify-between">
|
||||
<span className="text-muted-foreground">Avg Distance:</span>
|
||||
<span className="font-mono">{stats.avg_distance.toFixed(2)}</span>
|
||||
</div>
|
||||
<div className="flex justify-between">
|
||||
<span className="text-muted-foreground">Generation Time:</span>
|
||||
<span className="font-mono">
|
||||
{(stats.generation_time_ms / 1000).toFixed(2)}s
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -152,11 +152,6 @@ export interface DistinctColorsRequest {
|
||||
|
||||
export interface DistinctColorsData {
|
||||
colors: string[];
|
||||
stats: {
|
||||
min_distance: number;
|
||||
avg_distance: number;
|
||||
generation_time_ms: number;
|
||||
};
|
||||
}
|
||||
|
||||
export interface GradientRequest {
|
||||
|
||||
@@ -292,11 +292,6 @@ export class PastelWASMClient {
|
||||
const colors = generate_random_colors(request.count, true);
|
||||
return {
|
||||
colors,
|
||||
stats: {
|
||||
min_distance: 0,
|
||||
avg_distance: 0,
|
||||
generation_time_ms: 0,
|
||||
},
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user