Skip to content

Commit

Permalink
[Chore] Pass onBruch, filter and datasets through range slide to plot (
Browse files Browse the repository at this point in the history
…#2220)

Signed-off-by: Ihor Dykhta <dikhta.igor@gmail.com>
Co-authored-by: Ilya Boyandin <ilya@boyandin.me>
  • Loading branch information
igorDykhta and ilyabo committed May 7, 2023
1 parent f80853b commit 41c8099
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
8 changes: 7 additions & 1 deletion src/components/src/common/range-plot.tsx
Expand Up @@ -25,7 +25,8 @@ import HistogramPlotFactory from './histogram-plot';
import LineChartFactory, {HoverDP} from './line-chart';
import {isTest, hasMobileWidth} from '@kepler.gl/utils';
import {breakPointValues} from '@kepler.gl/styles';
import {LineChart} from '@kepler.gl/types';
import {LineChart, Filter} from '@kepler.gl/types';
import {Datasets} from '@kepler.gl/table';

const StyledRangePlot = styled.div`
margin-bottom: ${props => props.theme.sliderBarHeight}px;
Expand All @@ -47,6 +48,10 @@ interface RangePlotProps {
timeFormat?: string;
timezone?: string | null;
playbackControlWidth?: number;

animationWindow?: string;
filter?: Filter;
datasets?: Datasets;
}

RangePlotFactory.deps = [RangeBrushFactory, HistogramPlotFactory, LineChartFactory];
Expand Down Expand Up @@ -127,6 +132,7 @@ export default function RangePlotFactory(
onMouseMove,
hoveredDP,
isRanged,
onBrush,
...chartProps
};

Expand Down
15 changes: 13 additions & 2 deletions src/components/src/common/range-slider.tsx
Expand Up @@ -27,7 +27,8 @@ import Slider from './slider/slider';
import {Input} from './styled-components';

import {observeDimensions, unobserveDimensions, roundValToStep, clamp} from '@kepler.gl/utils';
import {LineChart} from '@kepler.gl/types';
import {LineChart, Filter} from '@kepler.gl/types';
import {Datasets} from '@kepler.gl/table';

interface SliderInputProps {
flush?: boolean;
Expand Down Expand Up @@ -79,6 +80,10 @@ interface RangeSliderProps {
marks?: number[];
plotType?: string;
plotValue?: number[];

animationWindow?: string;
filter?: Filter;
datasets?: Datasets;
}

RangeSliderFactory.deps = [RangePlotFactory];
Expand Down Expand Up @@ -227,7 +232,10 @@ export default function RangeSliderFactory(
step,
timezone,
timeFormat,
playbackControlWidth
playbackControlWidth,
animationWindow,
filter,
datasets
} = this.props;

const {width} = this.state;
Expand All @@ -249,6 +257,9 @@ export default function RangeSliderFactory(
isEnlarged={this.props.isEnlarged}
onBrush={(val0, val1) => onChange([val0, val1])}
marks={this.props.marks}
animationWindow={animationWindow}
filter={filter}
datasets={datasets}
range={range}
value={this.props.plotValue || this.filterValueSelector(this.props)}
width={plotWidth}
Expand Down

0 comments on commit 41c8099

Please sign in to comment.