Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions app/scripts/components/exploration/atoms/viewMode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@ const dehydrateViewMode = (value: ViewMode) => {
return value ?? 'default';
};

/**
* Atom that manages the exploration view mode via URL parameter.
*
* - 'simple': Minimal view for embedding (no navigation/header)
* - 'default': Full exploration and analysis interface
*
* URL parameter: `?viewMode=simple` (defaults to 'default')
*
* @example
* const [viewMode] = useAtom(viewModeAtom);
*/
export const viewModeAtom = atomWithUrlValueStability<ViewMode>({
initialValue: hydrateViewMode(initialParams.get('viewMode')),
urlParam: 'viewMode',
Expand Down
14 changes: 11 additions & 3 deletions app/scripts/components/exploration/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,20 @@ import PageHero from '$components/common/page-hero';
import { DATASETS_PATH, EXPLORATION_PATH } from '$utils/routes';

/**
* Container component that manages exploration view routing and data state.
*
* Routes between two view modes based on URL parameter:
* - Simple view (`?viewMode=simple`): Minimal interface for embedding
* - Default view: Full exploration and analysis interface
*
* @LEGACY-SUPPORT
*
* @NOTE: This container component serves as a wrapper for the purpose of data management, this is ONLY to support current instances.
* veda2 instances can just use the direct component, 'ExplorationAndAnalysis', and manage data directly in their page views
* @NOTE: This container component serves as a wrapper for the purpose of data management,
* this is ONLY to support current instances. veda2 instances can just use the direct
Copy link
Contributor Author

@ifsimicoded ifsimicoded Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vgeorge what is current instances vs veda2? is current instances, veda as a submodule? and veda2 is the the next-veda-ui implementation as a library (instead of submodule)?

when you say current instances, if I read this in one year, will that still apply?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ifsimicoded my original intent with this change was just to rename the reference component, and I was also confused by the veda2 term. After digging through past tickets, I realized it refers to a refactor effort from last year to evolve the architecture. Since this wasn’t well documented, I created a new ADR to capture what was done and how it connects to the current architecture discussions in #1952.

* component, 'ExplorationAndAnalysisDefaultView', and manage data directly in their page views
*
* @returns {JSX.Element | null} Renders the appropriate view or null if not on exploration path
*/

export default function ExplorationAndAnalysisContainer() {
const setExternalDatasets = useSetAtom(externalDatasetsAtom);
setExternalDatasets(allExploreDatasets);
Expand Down
6 changes: 6 additions & 0 deletions app/scripts/components/exploration/types.d.ts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,10 @@ export interface ZoomTransformPlain {
k: number;
}

/**
* Exploration view mode.
*
* - 'simple': Minimal view for embedding
* - 'default': Full exploration interface
*/
export type ViewMode = 'simple' | 'default';
10 changes: 10 additions & 0 deletions app/scripts/components/exploration/views/default/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,16 @@ interface ExplorationAndAnalysisDefaultViewProps {
openDatasetsSelectionModal?: () => void;
}

/**
* Full exploration and analysis view with all features.
*
* Includes interactive map, resizable timeline panel, dataset management,
* and analysis tools. Exported as `ExplorationAndAnalysis` in the public API.
*
* @param props.datasets - Timeline datasets to display and analyze
* @param props.setDatasets - Callback to update the dataset list
* @param props.openDatasetsSelectionModal - Optional callback to open dataset selector
*/
export default function ExplorationAndAnalysisDefaultView(
props: ExplorationAndAnalysisDefaultViewProps
) {
Expand Down
12 changes: 12 additions & 0 deletions app/scripts/components/exploration/views/simple/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,18 @@ import { useVedaUI } from '$context/veda-ui-provider';
interface ExplorationAndAnalysisSimpleViewProps {
datasets: TimelineDataset[];
}

/**
* Simplified exploration view optimized for embedding.
*
* Renders only the map visualization and timeline controls,
* without navigation, header, or dataset selection UI.
*
* @param props.datasets - Timeline datasets to display
*
* @example
* <ExplorationAndAnalysisSimpleView datasets={timelineDatasets} />
*/
export default function ExplorationAndAnalysisSimpleView(
props: ExplorationAndAnalysisSimpleViewProps
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,17 @@ interface TimelineSimpleViewProps {
tipContent?: string;
}

/**
* Timeline date picker for the simple exploration view.
*
* Adjusts calendar view (month/year/day) based on dataset time density
* and calculates temporal extent from provided datasets.
*
* @param props.date - Currently selected date
* @param props.setDate - Callback to update the selected date
* @param props.timeDensity - Dataset time density (determines calendar view)
* @param props.datasets - Datasets used to calculate temporal extent
*/
function TimelineSimpleView(props: TimelineSimpleViewProps) {
const { date, setDate, timeDensity, datasets, label, tipContent } = props;

Expand Down
Loading