Skip to content

Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.

8.3 KB
Raw Blame

Component overrides and possible core migration

The experimental app registers four factory replacements in app.tsx. The reusable adapter separately defines nine default recipes in KeplerInjector.tsx. Those nine recipes apply to components resolved through the adapter's injector; they are not installed by this demo's /shell integration. The first three app overrides are inherited from the original demo, rather than introduced by SQLRooms.

The last column is a proposed direction, assuming core adopts Tailwind. “Core” means reusable Kepler UI and behavior without a dependency on the SQLRooms room store. A styling migration alone will not eliminate overrides that also adapt state ownership or application policy.

Override Scope Why it exists Candidate for Kepler core after Tailwind?
LoadDataModalFactory → CustomLoadDataModalFactory App; inherited Adds the remote-map URL form and sample gallery to core's upload/tileset/storage methods, orders the tabs, and connects demo loading actions/state. Partly. Move the reusable URL form and gallery UI into core, accepting data and callbacks. Keep sample catalogs, routing, and state.demo bindings in the app. Core already accepts loadingMethods; expose that configuration through the host boundary instead of requiring an entire modal replacement.
MapControlFactory → CustomMapControlFactory App; inherited, with preview callout removed Retains default controls, adds effects/SQL/assistant buttons, mounts effect and annotation managers beside the toolbar, and displays sample information. Partly. Core should own generic toolbar/overlay layout and effect/annotation composition. Preserve the existing actionComponents extension point and add slots for contextual panels. Keep sample information in the app; keep SQL/AI integrations in their optional packages. The small SQL toggle can live with @kepler.gl/duckdb. Remove the annotation compatibility shim once the supported core version guarantees the export.
PanelHeaderFactory → CustomPanelHeaderFactory App; inherited Adds bug-report/docs links, keeps storage, and makes Share an icon action. The logo and version still come from core. Mostly replace with configuration. Core already accepts actionItems; pass them through a supported host prop/slot instead of mutating defaultProps in a factory. Keep destination links and action selection as app policy. Tailwind is not a prerequisite.
SidebarFactory → SqlroomsSidebarFactory App; SQLRooms shell Portals the original sidebar children into the collapsible shell, preserving React contexts and providing a sidebar-local popup root. The shell handles mobile drawer dismissal before global dialogs. Strong candidate for a generic core API. Expose sidebar content independently from its container, with controlled visibility and explicit popup/modal containers. Core can supply an accessible Tailwind sidebar. Keep SQLRooms SidebarProvider/layout integration in the adapter; retire the portal workaround when composition is supported directly.
AddDataButtonFactory → CustomAddDataButtonFactory Adapter recipes Renders nothing, suppressing Kepler's Add Data button when the host supplies data selection/loading. Configuration in core. Add a visibility option or an add-data action slot; the host decides whether to show it. A null replacement should not be necessary.
PanelTitleFactory → CustomPanelTitleFactory Adapter recipes Replaces the title layout with a compact, right-aligned container for action children in host-managed panels. Yes, as a variant/slot. A composable panel header can support optional title and trailing actions. Keep the host's choice of layout outside core defaults.
DndContextFactory → CustomDndContextFactory Adapter recipes Reuses Kepler drag visuals/constants but routes layer/effect drag actions through the SQLRooms store to the owning map, including layer ordering and split-map assignment. Partly; primarily an architectural change. Share the drag behavior and visuals in core with explicit map identity and action callbacks. Keep SQLRooms selectors/dispatch binding in a thin adapter. Rewriting styles does not resolve this dependency.
FilterPanelHeaderFactory → CustomFilterPanelHeaderFactory Adapter recipes Adds SQLRooms button/tooltip styling and dispatches filter deletion after locating the owning map/filter in the room store; retains the dataset-color border. Partly. Move the header and delete affordance into core, accepting an onRemove callback and explicit identity. Keep room-store lookup/dispatch in the adapter rather than embedding SQLRooms hooks in core UI.
MapLegendPanelFactory → CustomMapLegendPanelFactory Adapter recipes Uses the full draggable legend in the primary split pane and only a toggle in the secondary pane. Injects CSS to hide the standard header while retaining split-viewport tools because the custom legend has its own header. Yes, as supported legend composition. Add explicit header visibility/content and split-pane placement options; remove the injected global CSS. Core already has draggable/split-viewport behavior, so consolidate with that implementation rather than transplanting the wrapper unchanged.
MapLegendFactory → CustomMapLegendFactory Adapter recipes Provides a compact Tailwind legend with close/collapse controls, pane-specific visible-layer filtering, reused core legend content, and room-store fallback dispatch for closing. UI and generic behavior: yes. Core can own the layout and accept visible layers, pane identity, and onClose. Keep SQLRooms state lookup in the adapter. Reconcile against core's existing legend editing and visibility controls before replacing it; this is a different presentation, not proven feature-equivalent code.
MapControlTooltipFactory → CustomMapControlTooltipFactory Adapter recipes Uses SQLRooms tooltip primitives and Tailwind border/radius tokens around controls while retaining translated tooltip text. Strong styling candidate. Adopt a shared accessible tooltip primitive in core, preserving the core tooltip API and localization. The core implementation should not require SQLRooms application state.
MapDrawPanelFactory → CustomMapDrawPanelFactory Adapter recipes Wraps the original drawing panel with an explicit close button while active, using SQLRooms button styling and absolute offsets. Yes. Provide the close affordance and positioning in the core panel layout with accessible labeling; remove the wrapper and hard-coded offsets after checking the existing drawing interactions.
SourceDataSelectorFactory → CustomSourceDataSelectorFactory Adapter recipes Adds searchable SQLRooms table selection. Layer selectors can load an unloaded table asynchronously before selection; filter selectors offer loaded Kepler datasets only. Partly. Put the reusable searchable selector, loading/error states, and async option-provider contract in core. Keep room table discovery, table-selection policy, addTableToMap, and map-store lookup in the SQLRooms adapter (or a separate data-source integration).

Recommended order: expose host-level configuration for existing actionItems/loadingMethods/actionComponents, introduce independent sidebar/header/popup composition, then consolidate tooltip/draw/legend presentation during the Tailwind migration. Keep SQLRooms store and database adapters separate throughout. Other exported adapter panels, such as the custom layer/filter/map managers, are compositions rather than additional registered factory overrides and are outside this table's count.