mirror of
https://github.com/huggingface/lerobot.git
synced 2026-07-23 17:56:07 +00:00
rm unneeded comments
This commit is contained in:
@@ -2,7 +2,7 @@ import type { NextConfig } from "next";
|
|||||||
import packageJson from './package.json';
|
import packageJson from './package.json';
|
||||||
|
|
||||||
const nextConfig: NextConfig = {
|
const nextConfig: NextConfig = {
|
||||||
/* config options here */
|
|
||||||
typescript: {
|
typescript: {
|
||||||
ignoreBuildErrors: true,
|
ignoreBuildErrors: true,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -134,7 +134,6 @@ export async function getEpisodeData(
|
|||||||
)
|
)
|
||||||
.map(([key]) => key);
|
.map(([key]) => key);
|
||||||
|
|
||||||
// --- Refactored: Group columns by suffix first, then by scale ---
|
|
||||||
// 1. Group all numeric keys by suffix (excluding 'timestamp')
|
// 1. Group all numeric keys by suffix (excluding 'timestamp')
|
||||||
const numericKeys = seriesNames.filter((k) => k !== "timestamp");
|
const numericKeys = seriesNames.filter((k) => k !== "timestamp");
|
||||||
const suffixGroupsMap: Record<string, string[]> = {};
|
const suffixGroupsMap: Record<string, string[]> = {};
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import {
|
|||||||
formatStringWithVars,
|
formatStringWithVars,
|
||||||
} from "@/utils/parquetUtils";
|
} from "@/utils/parquetUtils";
|
||||||
|
|
||||||
// Server component for data fetching
|
|
||||||
export default async function ExplorePage({
|
export default async function ExplorePage({
|
||||||
searchParams,
|
searchParams,
|
||||||
}: {
|
}: {
|
||||||
|
|||||||
@@ -47,10 +47,8 @@ export const DataRecharts = React.memo(
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
// Delimiter for nested/flattened keys
|
|
||||||
const NESTED_KEY_DELIMITER = ",";
|
const NESTED_KEY_DELIMITER = ",";
|
||||||
|
|
||||||
// SingleDataGraph renders one chart for a group
|
|
||||||
const SingleDataGraph = React.memo(
|
const SingleDataGraph = React.memo(
|
||||||
({
|
({
|
||||||
data,
|
data,
|
||||||
@@ -62,7 +60,6 @@ const SingleDataGraph = React.memo(
|
|||||||
setHoveredTime: (t: number | null) => void;
|
setHoveredTime: (t: number | null) => void;
|
||||||
}) => {
|
}) => {
|
||||||
const { currentTime, setCurrentTime } = useTime();
|
const { currentTime, setCurrentTime } = useTime();
|
||||||
// Utility: flatten nested objects with dot notation
|
|
||||||
function flattenRow(row: Record<string, any>, prefix = ""): Record<string, number> {
|
function flattenRow(row: Record<string, any>, prefix = ""): Record<string, number> {
|
||||||
const result: Record<string, number> = {};
|
const result: Record<string, number> = {};
|
||||||
for (const [key, value] of Object.entries(row)) {
|
for (const [key, value] of Object.entries(row)) {
|
||||||
@@ -129,12 +126,10 @@ const SingleDataGraph = React.memo(
|
|||||||
return chartData.length - 1;
|
return chartData.length - 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Handle mouseLeave - restore to video's current time
|
|
||||||
const handleMouseLeave = () => {
|
const handleMouseLeave = () => {
|
||||||
setHoveredTime(null);
|
setHoveredTime(null);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Handle click on chart - this SHOULD change the video time
|
|
||||||
const handleClick = (data: any) => {
|
const handleClick = (data: any) => {
|
||||||
if (data && data.activePayload && data.activePayload.length) {
|
if (data && data.activePayload && data.activePayload.length) {
|
||||||
const timeValue = data.activePayload[0].payload.timestamp;
|
const timeValue = data.activePayload[0].payload.timestamp;
|
||||||
@@ -143,9 +138,7 @@ const SingleDataGraph = React.memo(
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Custom legend to show current value next to each series
|
// Custom legend to show current value next to each series
|
||||||
// --- Grouped Legend UI ---
|
|
||||||
const CustomLegend = () => {
|
const CustomLegend = () => {
|
||||||
// Find the closest data point to the hovered or current time
|
|
||||||
const closestIndex = findClosestDataIndex(
|
const closestIndex = findClosestDataIndex(
|
||||||
hoveredTime != null ? hoveredTime : currentTime,
|
hoveredTime != null ? hoveredTime : currentTime,
|
||||||
);
|
);
|
||||||
@@ -172,12 +165,9 @@ const SingleDataGraph = React.memo(
|
|||||||
groupColorMap[group] = `hsl(${idx * (360 / allGroups.length)}, 100%, 50%)`;
|
groupColorMap[group] = `hsl(${idx * (360 / allGroups.length)}, 100%, 50%)`;
|
||||||
});
|
});
|
||||||
|
|
||||||
// Helper: check if all children are visible
|
|
||||||
const isGroupChecked = (group: string) => groups[group].every(k => visibleKeys.includes(k));
|
const isGroupChecked = (group: string) => groups[group].every(k => visibleKeys.includes(k));
|
||||||
// Helper: check if some children are visible
|
|
||||||
const isGroupIndeterminate = (group: string) => groups[group].some(k => visibleKeys.includes(k)) && !isGroupChecked(group);
|
const isGroupIndeterminate = (group: string) => groups[group].some(k => visibleKeys.includes(k)) && !isGroupChecked(group);
|
||||||
|
|
||||||
// Handle parent (group) checkbox
|
|
||||||
const handleGroupCheckboxChange = (group: string) => {
|
const handleGroupCheckboxChange = (group: string) => {
|
||||||
if (isGroupChecked(group)) {
|
if (isGroupChecked(group)) {
|
||||||
// Uncheck all children
|
// Uncheck all children
|
||||||
@@ -188,7 +178,6 @@ const SingleDataGraph = React.memo(
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Handle single (non-grouped) or child checkbox
|
|
||||||
const handleCheckboxChange = (key: string) => {
|
const handleCheckboxChange = (key: string) => {
|
||||||
setVisibleKeys((prev) =>
|
setVisibleKeys((prev) =>
|
||||||
prev.includes(key) ? prev.filter((k) => k !== key) : [...prev, key]
|
prev.includes(key) ? prev.filter((k) => k !== key) : [...prev, key]
|
||||||
|
|||||||
@@ -10,8 +10,6 @@ import {
|
|||||||
FaArrowUp,
|
FaArrowUp,
|
||||||
} from "react-icons/fa";
|
} from "react-icons/fa";
|
||||||
|
|
||||||
// duration is now provided by useTime context
|
|
||||||
|
|
||||||
import { debounce } from "@/utils/debounce";
|
import { debounce } from "@/utils/debounce";
|
||||||
|
|
||||||
const PlaybackBar: React.FC = () => {
|
const PlaybackBar: React.FC = () => {
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ const Sidebar: React.FC<SidebarProps> = ({
|
|||||||
const [sidebarVisible, setSidebarVisible] = React.useState(true);
|
const [sidebarVisible, setSidebarVisible] = React.useState(true);
|
||||||
const toggleSidebar = () => setSidebarVisible((prev) => !prev);
|
const toggleSidebar = () => setSidebarVisible((prev) => !prev);
|
||||||
|
|
||||||
// Ref for the sidebar nav
|
|
||||||
const sidebarRef = React.useRef<HTMLDivElement>(null);
|
const sidebarRef = React.useRef<HTMLDivElement>(null);
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user