Skip to content

Commit 1626b23

Browse files
committed
Better map visualizations & default dashboard
1 parent c3b5a19 commit 1626b23

File tree

3 files changed

+20
-9
lines changed

3 files changed

+20
-9
lines changed

src/card/report/NeoGraphVisReport.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ class NeoGraphVisReport extends NeoReport {
147147
nodesMap["" + value['identity']['low']] = {
148148
id: value['identity']['low'],
149149
fill: 'seagreen',
150-
stroke: "#969696",
150+
stroke: "#555",
151151
radius: 25,
152152
properties: value['properties'],
153153
labels: value['labels']
@@ -199,7 +199,7 @@ class NeoGraphVisReport extends NeoReport {
199199
nodesMap["" + value['start']['low']] = {
200200
id: value['start']['low'],
201201
fill: 'seagreen',
202-
stroke: "#969696",
202+
stroke: "#555",
203203
radius: 25,
204204
properties: [],
205205
labels: []
@@ -209,7 +209,7 @@ class NeoGraphVisReport extends NeoReport {
209209
nodesMap["" + value['end']['low']] = {
210210
id: value['end']['low'],
211211
fill: 'seagreen',
212-
stroke: "#969696",
212+
stroke: "#555",
213213
radius: 25,
214214
properties: [],
215215
labels: []

src/card/report/NeoMapReport.js

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import React from "react";
22
import NeoReport from "./NeoReport";
3-
import {MapContainer, Marker, Popup, TileLayer} from "react-leaflet";
4-
import * as d3 from "d3";
3+
import {MapContainer, Polyline, Popup, TileLayer} from "react-leaflet";
4+
import Marker from 'react-leaflet-enhanced-marker';
5+
import Icon from "react-materialize/lib/Icon";
56

67
class NeoTestReport extends NeoReport {
78
constructor(props) {
@@ -18,21 +19,31 @@ class NeoTestReport extends NeoReport {
1819

1920
this.state.width = this.props.clientWidth - 50; //-90 + props.width * 105 - xShift * 0.5;
2021
this.state.height = -145 + this.props.height * 100;
22+
let colors = ["#588c7e", "#f2e394", "#f2ae72", "#d96459", "#5b9aa0", "#d6d4e0", "#b8a9c9", "#622569", "#ddd5af", "#d9ad7c", "#a2836e", "#674d3c", "grey"]
2123

2224
if (width !== this.props.clientWidth - 50 || height !== -145 + this.props.height * 100){
23-
const position = [51.505, -0.09]
25+
const position = [51.4472055, 4.4601085]
26+
let position2 = [51.4972055, 4.4801085];
2427
this.state.visualization =
2528
<MapContainer key={0} style={{"width": this.state.width + "px", "height": this.state.height + "px"}} center={position} zoom={13}
2629
scrollWheelZoom={false}>
2730
<TileLayer
2831
attribution='&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
2932
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
3033
/>
31-
<Marker position={position}>
34+
<Marker position={position} icon={<div style={{color: colors[0]}}><Icon className="close">place</Icon></div>}>
3235
<Popup>
33-
A pretty CSS3 popup. <br/> Easily customizable.
36+
A pretty CSS3 popup. <br/> Easily customizable. With a lot of text wooooooooooooooooh asdjadnas da sdas
3437
</Popup>
3538
</Marker>
39+
<Marker position={position2} icon={<div style={{color: colors[0]}}><Icon className="close">place</Icon></div>}>
40+
<Popup>
41+
A pretty CSS3 popup. <br/> Easily customizable. With a lot of text wooooooooooooooooh asdjadnas da sdas
42+
</Popup>
43+
</Marker>
44+
<Polyline key={0} positions={[
45+
position, position2,
46+
]} color={colors[0]} />
3647
</MapContainer>;
3748
this.forceUpdate();
3849
}

src/data/default_dashboard.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"width": 4,
2424
"height": 4,
2525
"type": "graph",
26-
"query": "CALL db.schema.visualization()",
26+
"query": "MATCH (n)-[e]->(m) RETURN n,e,m LIMIT 20",
2727
"page": 2,
2828
"properties": [],
2929
"parameters": "",

0 commit comments

Comments
 (0)