-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Ihor Dykhta <dikhta.igor@gmail.com>
- Loading branch information
1 parent
934f8e8
commit 6e276e4
Showing
9 changed files
with
102 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// SPDX-License-Identifier: MIT | ||
// Copyright contributors to the kepler.gl project | ||
|
||
import React, {useMemo} from 'react'; | ||
import RangeSliderTimelineFactory from './range-slider-timeline'; | ||
import {Layers} from '../common/icons'; | ||
import {Tooltip} from '../common/styled-components'; | ||
|
||
function RangeSliderTimelinePanelFactory(RangeSliderTimeline) { | ||
const RangeSliderTimelinePanel = ({timelines, scaledValue, timelineLabel, style}) => { | ||
const containerStyle = useMemo( | ||
() => ({ | ||
display: 'flex', | ||
justifyContent: 'spaceBetween', | ||
flexWrap: 'wrap', | ||
...style | ||
}), | ||
[style] | ||
); | ||
|
||
const iconWrapperStyle = { | ||
marginRight: '8px', | ||
cursor: 'pointer' | ||
}; | ||
|
||
return ( | ||
<div style={containerStyle}> | ||
<div data-tip data-for="layers" style={iconWrapperStyle}> | ||
<Layers height="24px" color="#F7F8FA" /> | ||
<Tooltip id="layers" place="right" effect="solid"> | ||
<span>{timelineLabel}</span> | ||
</Tooltip> | ||
</div> | ||
<div style={{flex: 1}}> | ||
{timelines.map((timeline, index) => ( | ||
<RangeSliderTimeline key={index} line={timeline} scaledValue={scaledValue} /> | ||
))} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
return RangeSliderTimelinePanel; | ||
} | ||
|
||
RangeSliderTimelinePanelFactory.deps = [RangeSliderTimelineFactory]; | ||
|
||
export default RangeSliderTimelinePanelFactory; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters