Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix timeline chart by explicitly setting start and end time #3772

Merged
merged 5 commits into from
Feb 14, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.md).
### Fixed

- Fixed an error that occured when changing the URL hash. [#3746](https://github.com/scalableminds/webknossos/pull/3746)
- Fixed a bug in the timeline chart rendering. The start and end time of the timeline chart now match the selected time range. [#3772](https://github.com/scalableminds/webknossos/pull/3772)
- The modals for a new task description and recommended task settings are no longer shown in read-only tracings. [#3724](https://github.com/scalableminds/webknossos/pull/3724)
- Fixed a bug where some NMLs caused the webKnossos tab to freeze during NML upload. [#3758](https://github.com/scalableminds/webknossos/pull/3758)

Expand Down
11 changes: 9 additions & 2 deletions frontend/javascripts/admin/time/time_line_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ class TimeLineView extends React.PureComponent<*, State> {
{ id: "End", type: "date" },
];

const { dateRange } = this.state;
const timeTrackingRowGrouped = []; // shows each time span grouped by annotation id
const timeTrackingRowTotal = []; // show all times spans in a single row

Expand Down Expand Up @@ -167,7 +168,7 @@ class TimeLineView extends React.PureComponent<*, State> {
<RangePicker
allowClear={false}
style={{ width: "100%" }}
value={this.state.dateRange}
value={dateRange}
onChange={this.handleDateChange}
/>
</FormItem>
Expand Down Expand Up @@ -201,7 +202,13 @@ class TimeLineView extends React.PureComponent<*, State> {
chartType="Timeline"
columns={columns}
rows={rows}
options={{ timeline: { singleColor: "#108ee9" } }}
options={{
timeline: { singleColor: "#108ee9" },
hAxis: {
Copy link
Member

Choose a reason for hiding this comment

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

Maybe add a comment here with a reference to this PR? Otherwise, we might forget about it and re-introduce the bug again at some point 🙈

minValue: dateRange[0].toDate(),
maxValue: dateRange[1].toDate(),
},
}}
graph_id="TimeLineGraph"
chartPackages={["timeline"]}
width="100%"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
"react-debounce-render": "^4.0.1",
"react-dom": "^16.8.0",
"react-dropzone": "^4.2.13",
"react-google-charts": "^1.5.5",
"react-google-charts": "^2.0.0",
"react-redux": "^5.0.6",
"react-remarkable": "^1.1.3",
"react-router-dom": "^4.2.2",
Expand Down
40 changes: 10 additions & 30 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6624,10 +6624,6 @@ loader-utils@^1.0.0, loader-utils@^1.0.2, loader-utils@^1.1.0:
emojis-list "^2.0.0"
json5 "^0.5.0"

loadjs@^3.3.1:
version "3.5.4"
resolved "https://registry.yarnpkg.com/loadjs/-/loadjs-3.5.4.tgz#ef0f4eb5a6ac2b86c7597a3d4de97b83816e36b8"

locate-path@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e"
Expand Down Expand Up @@ -9354,15 +9350,6 @@ [email protected]:
object-assign "^4.1.0"
prop-types "~15.5.7"

"react-dom@^15.3.2 || ^16":
version "16.3.2"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.3.2.tgz#cb90f107e09536d683d84ed5d4888e9640e0e4df"
dependencies:
fbjs "^0.8.16"
loose-envify "^1.1.0"
object-assign "^4.1.1"
prop-types "^15.6.0"

react-dom@^16.8.0:
version "16.8.0"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.8.0.tgz#18f28d4be3571ed206672a267c66dd083145a9c4"
Expand All @@ -9380,15 +9367,12 @@ react-dropzone@^4.2.13:
attr-accept "^1.0.3"
prop-types "^15.5.7"

react-google-charts@^1.5.5:
version "1.5.7"
resolved "https://registry.yarnpkg.com/react-google-charts/-/react-google-charts-1.5.7.tgz#70d5daf1e362a9ef199576f15e37769185888067"
react-google-charts@^2.0.0:
version "2.0.29"
resolved "https://registry.yarnpkg.com/react-google-charts/-/react-google-charts-2.0.29.tgz#1f07b6cccf6c6b0965a00ae9e50f1d75d48f723d"
integrity sha512-VwP4AhNJp24oI7yUq6ItJ+jOPlxjsXTk/QMWWaGLkNInaRoQno4PHSNOebNmvZv97E4rqnJpxPwddhqXcK3R8g==
dependencies:
debug "^2.2.0"
loadjs "^3.3.1"
prop-types "^15.5.8"
react "^15.3.2 || ^16"
react-dom "^15.3.2 || ^16"
react-load-script "^0.0.6"

react-is@^16.3.2:
version "16.3.2"
Expand All @@ -9412,6 +9396,11 @@ react-lifecycles-compat@^3.0.2, react-lifecycles-compat@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362"

react-load-script@^0.0.6:
version "0.0.6"
resolved "https://registry.yarnpkg.com/react-load-script/-/react-load-script-0.0.6.tgz#db6851236aaa25bb622677a2eb51dad4f8d2c258"
integrity sha512-aRGxDGP9VoLxcsaYvKWIW+LRrMOzz2eEcubTS4NvQPPugjk2VvMhow0wWTkSl7RxookomD1MwcP4l5UStg5ShQ==

react-redux@^5.0.6:
version "5.0.7"
resolved "https://registry.yarnpkg.com/react-redux/-/react-redux-5.0.7.tgz#0dc1076d9afb4670f993ffaef44b8f8c1155a4c8"
Expand Down Expand Up @@ -9522,15 +9511,6 @@ [email protected]:
object-assign "^4.1.0"
prop-types "^15.5.7"

"react@^15.3.2 || ^16":
version "16.3.2"
resolved "https://registry.yarnpkg.com/react/-/react-16.3.2.tgz#fdc8420398533a1e58872f59091b272ce2f91ea9"
dependencies:
fbjs "^0.8.16"
loose-envify "^1.1.0"
object-assign "^4.1.1"
prop-types "^15.6.0"

react@^16.8.0:
version "16.8.0"
resolved "https://registry.yarnpkg.com/react/-/react-16.8.0.tgz#8533f0e4af818f448a276eae71681d09e8dd970a"
Expand Down