Skip to content

Timline_range_interaction#3325

Merged
offtherailz merged 18 commits intogeosolutions-it:c127_geonode_integrationfrom
baloola:timline_range
Nov 15, 2018
Merged

Timline_range_interaction#3325
offtherailz merged 18 commits intogeosolutions-it:c127_geonode_integrationfrom
baloola:timline_range

Conversation

@baloola
Copy link
Copy Markdown
Contributor

@baloola baloola commented Nov 9, 2018

Description

This PR handles the following:

  • 'proposed' initial range value and playback range that is retrieved from the data range itself ( does not work with all the scenarios (e.g. if the domain is a list of value or a single value )
  • align the range borders with currentTime and offsetTime, once one of them change, the correspondet side is changed as well.
  • click and drag on the range will move the whole range.
  • currentTime and offsetTime are included within the dimension state

Issues

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (check one with "x", remove the others)

  • Bugfix
  • Feature

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)

  • Yes
  • No

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)

Copy link
Copy Markdown
Member

@offtherailz offtherailz left a comment

Choose a reason for hiding this comment

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

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",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

me and @giohappy say we should instead put the lib inside mapstore, it is only 190 lines of code, we can maintain this wrapper ;)

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');
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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('--');
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe this is the reason of the bug for the scroll that don't work anymore.


const mouseEventSelector = state => get(state, "timeline.mouseEvent");

const timeLineCustomRange = state => {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Remove this selector

@coveralls
Copy link
Copy Markdown

coveralls commented Nov 10, 2018

Coverage Status

Coverage decreased (-0.05%) to 80.802% when pulling 9c8c9b9 on baloola:timline_range into 34606fb on geosolutions-it:c127_geonode_integration.

@baloola
Copy link
Copy Markdown
Contributor Author

baloola commented Nov 13, 2018

@offtherailz as discussed, I'll be working an the timeline dragging on a separate PR, while this is getting reviewed

@ghost ghost assigned offtherailz Nov 13, 2018
Copy link
Copy Markdown
Member

@offtherailz offtherailz left a comment

Choose a reason for hiding this comment

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

Noticed this issue: when enable animation and get back, dragging on range doesn't work.

issue_timeline

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.start currentTimeRange.end

@offtherailz offtherailz merged commit f96f790 into geosolutions-it:c127_geonode_integration Nov 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants