Skip to content

Commit

Permalink
Update packages/webviz-core from internal repo (#526)
Browse files Browse the repository at this point in the history
Changelog:
-

- Performance for 3D panel-heavy layouts has been improved.
- Added utf-8 support for strings when the `useBinaryTranslation` experimental feature is turned on.
- Charts with very large numbers of points display sampled data to improve performance.
- Added support for newline characters in the Raw Messages panel.
- Node Playground will now automatically format your code on save. This behavior can be toggled using the panel settings menu.
- Added a switch in the Topic Tree that enables a `Diff Mode` visualization when two sources are loaded in the 3D Panel.
- Added an `other source` option in the Raw Messages panel's diff mode to compare the same topic across different sources.
- Added support for Global Variables in Node Playground scripts.

 - Fixed websocket crash when the `useBinaryTranslation` feature is enabled.
 - Fixed bug where disabling a topic would cause the Topic Tree to report undefined datatype errors.
 - Fixed size for `<Point />` markers to use meters instead of pixels in 3D Panel.
  • Loading branch information
vidaaudrey committed Oct 19, 2020
1 parent 2dedb03 commit 6eb6fd9
Show file tree
Hide file tree
Showing 209 changed files with 5,482 additions and 2,074 deletions.
2 changes: 1 addition & 1 deletion packages/webviz-core/migrations/constants/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
// This source code is licensed under the Apache License, Version 2.0,
// found in the LICENSE file in the root directory of this source tree.
// You may not use this file except in compliance with the License.
export const CURRENT_LAYOUT_VERSION = 11;
export const CURRENT_LAYOUT_VERSION = 12;
export const THREE_DIMENSIONAL_SAVED_PROPS_VERSION = 17;
2 changes: 2 additions & 0 deletions packages/webviz-core/migrations/frozenMigrations.sha
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ fcb40bb0e87bb87772608cdc777c801fa19ceec8 ./webviz-core/migrations/frozenMigrati
7bf76678576014dec617bd92cc1b23aa33c01e44 ./webviz-core/migrations/frozenMigrations/2020.06.26.17:40:24.migrate3DPanelColorSettings.test.js
e0a0db07e34966e89227d3e0e1f0c32a97e4e6ee ./webviz-core/migrations/frozenMigrations/2020.07.07.11:17:28.prefixCollapsedSectionsWithDiagnosticName.js
046cef348d45f70edfb0bd2d12626e3279bb7c4a ./webviz-core/migrations/frozenMigrations/2020.07.07.11:17:28.prefixCollapsedSectionsWithDiagnosticName.test.js
564cad7cbd08c52ddccfcf5e8ffacfcb66b8e4dc ./webviz-core/migrations/frozenMigrations/2020.09.30.19:06:38.addAutoFormatOnSaveToNodePlaygroundConfig.js
60711ba5b2d900b05849c540eeb12d1567822c87 ./webviz-core/migrations/frozenMigrations/2020.09.30.19:06:38.addAutoFormatOnSaveToNodePlaygroundConfig.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// @flow
//
// Copyright (c) 2020-present, Cruise LLC
//
// This source code is licensed under the Apache License, Version 2.0,
// found in the LICENSE file in the root directory of this source tree.
// You may not use this file except in compliance with the License.
import { cloneDeep } from "lodash";

import getPanelTypeFromId from "webviz-core/migrations/frozenHelpers/getPanelTypeFromId";

export default function addAutoFormatOnSaveToNodePlaygroundConfig(originalPanelsState: any): any {
const panelsState = cloneDeep(originalPanelsState);
for (const id of Object.keys(panelsState.savedProps)) {
if (getPanelTypeFromId(id) === "NodePlayground" && panelsState.savedProps[id].autoFormatOnSave === undefined) {
panelsState.savedProps[id].autoFormatOnSave = true;
}
}
return panelsState;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// @flow
//
// Copyright (c) 2020-present, Cruise LLC
//
// This source code is licensed under the Apache License, Version 2.0,
// found in the LICENSE file in the root directory of this source tree.
// You may not use this file except in compliance with the License.
import addAutoFormatOnSaveToNodePlaygroundConfig from "webviz-core/migrations/frozenMigrations/2020.09.30.19:06:38.addAutoFormatOnSaveToNodePlaygroundConfig.js";

describe("addAutoFormatOnSaveToNodePlaygroundConfig", () => {
it("sets the autoFormatOnSave config key to true if it doesn't exist", () => {
expect(
addAutoFormatOnSaveToNodePlaygroundConfig({
savedProps: {
"NodePlayground!3bqkn1w": {
selectedNodeId: undefined,
vimMode: false,
},
},
})
).toEqual({
savedProps: {
"NodePlayground!3bqkn1w": {
selectedNodeId: undefined,
vimMode: false,
autoFormatOnSave: true,
},
},
});
});

it("does not set autoFormatOnSave config key to true if it is false", () => {
expect(
addAutoFormatOnSaveToNodePlaygroundConfig({
savedProps: {
"NodePlayground!3bqkn1w": {
selectedNodeId: undefined,
vimMode: false,
autoFormatOnSave: false,
},
},
})
).toEqual({
savedProps: {
"NodePlayground!3bqkn1w": {
selectedNodeId: undefined,
vimMode: false,
autoFormatOnSave: false,
},
},
});
});
});
1 change: 1 addition & 0 deletions packages/webviz-core/migrations/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const migrationsByVersion = {
],
"010": [],
"011": [],
"012": [],
};

export default function migratePanels(originalPanelsState: any): any {
Expand Down
41 changes: 18 additions & 23 deletions packages/webviz-core/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion packages/webviz-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
"version": "0.0.1",
"description": "rosbag analysis tool",
"license": "Apache-2.0",
"engines": {
"node": ">=10.22.0 <12"
},
"dependencies": {
"@cruise-automation/hooks": "0.0.1",
"@mdi/svg": "3.2.89",
"@sentry/browser": "5.11.0",
"async-retry": "1.2.3",
"chart.js": "davidswinegar/Chart.js#0785c29a4c57b3e1b4243f8163df7950a00b2a80",
"chartjs-plugin-annotation": "0.5.7",
"chartjs-plugin-datalabels": "davidswinegar/chartjs-plugin-datalabels#b0ade94116d4e273f0fdc17e9528c9a33c796e90",
Expand Down Expand Up @@ -35,14 +39,14 @@
"natsort": "2.0.0",
"nearley": "2.15.1",
"panzoom": "8.4.0",
"prettier": "1.15.3",
"promise-queue": "2.2.5",
"prop-types": "15.6.2",
"rc-color-picker": "1.2.6",
"rc-tabs": "11.6.1",
"rc-tree": "3.9.5",
"react": "16.10.2",
"react-autocomplete": "janpaul123/react-autocomplete#bc8737070b5744069719c8fcd4e0a197192b0d48",
"react-container-dimensions": "1.4.1",
"react-dnd": "10.0.2",
"react-dnd-html5-backend": "^10.0.2",
"react-document-events": "davidswinegar/react-document-events#d7003228d8cd57535ee8b30fac9811aa237526b8",
Expand Down
112 changes: 77 additions & 35 deletions packages/webviz-core/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,38 +24,23 @@
<title>webviz</title>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
<style>
@keyframes loadingLogoFadeInOut {
@keyframes loadingLogoFadeIn {
0% {
opacity: .3;
transform: scale(.8) skew(0, 0.312rad);
opacity: 0;
}

10% {
opacity: .3;
transform: scale(.8) skew(0, 0.312rad);
animation-timing-function: ease-in-out;
100% {
opacity: 1;
}
}


30% {
opacity: 0.8;
transform: scale(1) skew(0, 0.312rad);
@keyframes loadingLogoFadeInOut {
0%, 3%, 98%, 100% {
opacity: 0.3;
transform: scale(.8) skew(0, 0.312rad);
}

60% {
48%, 53% {
opacity: 0.8;
transform: scale(1) skew(0, 0.312rad);
animation-timing-function: ease-in-out;
}

90% {
opacity: .3;
transform: scale(.8) skew(0, 0.312rad);
}

100% {
opacity: .3;
transform: scale(.8) skew(0, 0.312rad);
}
}

Expand All @@ -66,15 +51,38 @@
bottom: 0px;
position: fixed;
z-index: 1000;
background-color: rgba(0, 0, 0, .3);
transition: opacity 0.2s ease-out;
transition: opacity 0.4s ease-out;
pointer-events: none;
display: flex;
align-items: center;
justify-content: center;
background: #1A1A1F;
}

html, body, #root {
width: 100%;
height: 100%;
border: 0;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
flex: 1 1 100%;
background: #1A1A1F;
overflow: hidden;
line-height: 1;
vertical-align: baseline;
}

#logoFrameContainer {
position: relative;
margin-top: calc(50vh - 80px);
margin-right: calc(50vw - 64px);
height: 85px;
width: 70px;
margin-bottom: 10vh;
line-height: 0;
box-sizing: border-box;
opacity: 0;
animation: loadingLogoFadeIn 0.5s ease-out forwards 0.25s;
}

#logoFrame1,
Expand All @@ -83,11 +91,13 @@
#logoFrame1blur,
#logoFrame2blur,
#logoFrame3blur {
box-sizing: border-box;
transform: skew(0, 0.312rad);
height: 80px;
width: 64px;
transition: all 0.4s;
height: 85px;
width: 70px;
position: absolute;
animation: loadingLogoFadeInOut 1.5s ease-in-out;
animation: loadingLogoFadeInOut 1.3s ease-in-out;
animation-iteration-count: infinite;
}

Expand Down Expand Up @@ -121,11 +131,29 @@
#logoFrame3blur {
filter: blur(3px);
}

#toolbar {
background: #020202;
position: fixed;
top: 0;
height: 36px;
width: 100%;
}

#playback-controls {
background: #020202;
position: fixed;
bottom: 0;
height: 44px;
width: 100%;
}
</style>
</head>

<body style="color: white; background: #121217">
<body>
<div id="loadingLogo">
<div id="toolbar"></div>
<div id="playback-controls"></div>
<div id="logoFrameContainer">
<div id="logoFrame1"></div>
<div id="logoFrame1blur"></div>
Expand All @@ -135,6 +163,7 @@
<div id="logoFrame3blur"></div>
</div>
</div>

<noscript> You need to enable JavaScript to run this app. </noscript>
<div id="root"></div>
<div id="topLevelError" style="display: none; margin: 20px; font-size: 16px; position: absolute;">
Expand All @@ -156,13 +185,27 @@
</ul>
</div>
<script type="text/javascript">
const pageLoadEpoch = Date.now();
const minDurationToShowLogoMs = 2000;
const loadingLogo = document.getElementById("loadingLogo");

window.webviz_hideLoadingLogo = () => {
// We always show the logo animation for a minimum amount of time
// so the logo doesn't flicker for a moment if the page loads quickly.
const hideLogoRequstedEpoch = Date.now();
const delayHidingLogoMs = Math.max(0, minDurationToShowLogoMs - (hideLogoRequstedEpoch - pageLoadEpoch));
setTimeout(() => {
loadingLogo.style.opacity = "0";
setTimeout(() => loadingLogo.remove(), 1000);
}, delayHidingLogoMs)
};

/* THIS COMMENT IS A HOOK FOR INITIAL STATE - please do not change */
// catch and display script errors from bundle.js
window.webviz_handleTopLevelError = (event) => {
window.webviz_caughtTopLevelError = true;
document.getElementById("topLevelErrorMessage").innerText = event.message;
document.getElementById("topLevelError").style.display = "block";
const loadingLogo = document.getElementById("loadingLogo");
if (loadingLogo) {
loadingLogo.remove();
}
Expand All @@ -178,5 +221,4 @@
</script>

</body>

</html>
Loading

0 comments on commit 6eb6fd9

Please sign in to comment.