Timline_range_interaction#3325
Timline_range_interaction#3325offtherailz merged 18 commits intogeosolutions-it:c127_geonode_integrationfrom
Conversation
offtherailz
left a comment
There was a problem hiding this comment.
Please apply the changes discussed:
- Setup initial value of currentTime and offsetTime in an epic, one or both of them are missing when you select the range option, using arbitrary values. Display this initial values in the viewport is a good choice.
- Question: it is an absolute time or a relative time? In the first case, I should use a name like
currentTimeEnd, that is more cleaner - Timeline should not fail if the range is not defined, but wait until the 2 variables are defined to show the range.
- Fix the bug sliding the timeline
- Include VisJSTimelineWrapper in compoents
package.json
Outdated
| "react-textfit": "1.1.0", | ||
| "react-twitter-widgets": "1.3.0", | ||
| "react-visjs-timeline": "1.5.0", | ||
| "react-visjs-timeline": "baloola/react-visjs-timeline#master", |
There was a problem hiding this comment.
me and @giohappy say we should instead put the lib inside mapstore, it is only 190 lines of code, we can maintain this wrapper ;)
web/client/plugins/Timeline.jsx
Outdated
| const { offsetEnabledSelector, selectedLayerSelector, timeLineCustomRange } = require('../selectors/timeline'); | ||
| const { withState, compose, branch, renderNothing } = require('recompose'); | ||
| const { selectTime, enableOffset, selectOffset } = require('../actions/timeline'); | ||
| const { selectTime, enableOffset, selectOffset, setCusomizedRange } = require('../actions/timeline'); |
There was a problem hiding this comment.
Get directly range using dimension selector. If you need default values and they are not initialized, set them up with arbitrary values. If the values are in the viewport, the user can see them and so it's easier to change them.
So remove any occurence of timeLineCustomRange and replace it with currentTimeRange (vs currentTime) or some name that is easier to understand.
| timeLineCustomRange, | ||
| (current, range) => ({ | ||
| currentTime: current || range && range.startTimeLineRange || new Date().toISOString(), | ||
| customizedRange: range |
There was a problem hiding this comment.
Here you have to use the currentTimeRange
|
|
||
| const layerDimensionRangeSelector = (state, layerId) => { | ||
| const timeRange = layerDimensionDataSelectorCreator(layerId, "time")(state); | ||
| const dataRange = timeRange && timeRange.domain && timeRange.domain.split('--'); |
There was a problem hiding this comment.
This should work also witd domain value with list of values. Anyway, after your changes, you may not need it anymore
| } | ||
|
|
||
| .vis-item.vis-background.ms-current-range { | ||
| z-index: 60; |
There was a problem hiding this comment.
Maybe this is the reason of the bug for the scroll that don't work anymore.
web/client/selectors/timeline.js
Outdated
|
|
||
| const mouseEventSelector = state => get(state, "timeline.mouseEvent"); | ||
|
|
||
| const timeLineCustomRange = state => { |
|
@offtherailz as discussed, I'll be working an the timeline dragging on a separate PR, while this is getting reviewed |
offtherailz
left a comment
There was a problem hiding this comment.
Noticed this issue: when enable animation and get back, dragging on range doesn't work.
note: We will enable both in the near future.
So:
- Please fix this issue
- Add a cursor: move to the css for draggable range on mouse hover
- please use names that make sense. customizedRange and startTimeLineRange and endTimeLineRange does not makes too much sense. Even because customTime is already a concept of timeline itself.
You should rename them with with :
currentTimeRange,currentTimeRange.startcurrentTimeRange.end
fixing the timeline dragging bug
additional bug fixes Timeline dragging
Timeline work

Description
This PR handles the following:
Issues
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (check one with "x", remove the others)
What is the current behavior? (You can also link to an open issue here)
see the issues
What is the new behavior?
see the description
Does this PR introduce a breaking change? (check one with "x", remove the other)
If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...
Other information:
The PR uses a forked version of react-timeline-vis at @baloola repo (temporary)