forked from googlemaps/fleet-debugger
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDataframe.js
More file actions
39 lines (34 loc) · 970 Bytes
/
Dataframe.js
File metadata and controls
39 lines (34 loc) · 970 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
* src/Dataframe.js
*
* JSON viewer for log entries. Clicking on a property _value_
* adds it to the log viewer.
*
*/
import ReactJson from "react-json-view";
function Dataframe(props) {
return (
<ReactJson
src={props.featuredObject}
onSelect={props.onClick}
shouldCollapse={(field) => {
if (field.name === "root") {
return false;
}
if (field.name === "request" && field.namespace[0] === "root") {
return false;
}
if (field.name === "vehicle" && field.namespace[0] === "root" && field.namespace[1] === "request") {
return false;
}
// Collapse everything else
return true;
}}
/>
);
}
// TODO: Ideas: allow selecting a field and see how it changes along the map
// or the slider (ie view on map / view on slider)
// or 'add slider' that instantiates a slider that has marks
// when that value changes
export default Dataframe;