Skip to content
This repository was archived by the owner on Sep 7, 2021. It is now read-only.

Commit 2548466

Browse files
author
booleanhunter
committed
Adding component for world map
1 parent 6c2cb10 commit 2548466

11 files changed

Lines changed: 121 additions & 32 deletions

File tree

reactjs-adminlte/public/dist/js/buttons.bundle.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

reactjs-adminlte/public/dist/js/chartVendors.bundle.js

Lines changed: 10 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

reactjs-adminlte/public/dist/js/dashboardV1.bundle.js

Lines changed: 12 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

reactjs-adminlte/public/dist/js/generalUIElements.bundle.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

reactjs-adminlte/public/dist/js/timeline.bundle.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

reactjs-adminlte/public/dist/js/vendors.js

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

reactjs-adminlte/public/dist/js/widgets.bundle.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
define(
2+
[
3+
'react',
4+
'jquery',
5+
'jvectormap',
6+
'jvectormapWorld'
7+
],
8+
function(React,$){
9+
var WorldMap = React.createClass({
10+
getDefaultProps: function() {
11+
return {
12+
id: 'world-map-1',
13+
}
14+
},
15+
componentDidMount: function(){
16+
console.log(this.props.info["US"])
17+
var visitorsData = this.props.info;
18+
$('#'+this.props.id).vectorMap({
19+
map: 'world_mill_en',
20+
backgroundColor: "transparent",
21+
regionStyle: {
22+
initial: {
23+
fill: '#e4e4e4',
24+
"fill-opacity": 1,
25+
stroke: 'none',
26+
"stroke-width": 0,
27+
"stroke-opacity": 1
28+
}
29+
},
30+
series: {
31+
regions: [{
32+
values: visitorsData,
33+
scale: ["#92c1dc", "#ebf4f9"],
34+
normalizeFunction: 'polynomial'
35+
}]
36+
},
37+
onRegionLabelShow: function(e, el, code) {
38+
if(typeof visitorsData[code] != "undefined")
39+
el.html(el.html() + ': ' + visitorsData[code] + ' new visitors');
40+
}
41+
});
42+
},
43+
render: function(){
44+
var style = {
45+
height: '250px'
46+
};
47+
//style="overflow: hidden; width: auto; height: 250px;"
48+
return (
49+
<div id={this.props.id} style={style}>
50+
</div>
51+
)
52+
}
53+
})
54+
55+
return WorldMap;
56+
}
57+
)

reactjs-adminlte/public/src/dashboardV1/js/components/containers/container-five.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@ define(
22
[
33
'react',
44
'jquery',
5+
56
],
67
function(React,$){
78
var ContainerFive = React.createClass({
9+
componentDidMount: function(){
10+
},
811
render: function(){
912
var style = {
1013
height: '250px'
@@ -29,6 +32,7 @@ define(
2932
</div>
3033

3134
<div className="box-body" style={style}>
35+
{this.props.children}
3236
</div>
3337

3438
<div className="box-footer no-border">

reactjs-adminlte/public/src/dashboardV1/js/components/dashboard.js

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ define(
99
'./control-panel',
1010
'./charts/donut-chart',
1111
'./charts/area-chart',
12+
'./charts/world-map',
1213
'./containers/container-one',
1314
'./containers/container-two',
1415
'./containers/container-three',
@@ -19,7 +20,7 @@ define(
1920
'./controls-menu',
2021
'./stat-tile'
2122
],
22-
function(React, $, Raphael, Morris, HeaderBar, NavigationMenu, ControlPanel, DonutChart, AreaChart, ContainerOne, ContainerTwo, ContainerThree, ContainerFour,ContainerFive,ContainerSix,ContainerSeven,ControlsMenu,StatTile){
23+
function(React, $, Raphael, Morris, HeaderBar, NavigationMenu, ControlPanel, DonutChart, AreaChart, WorldMap, ContainerOne, ContainerTwo, ContainerThree, ContainerFour,ContainerFive,ContainerSix,ContainerSeven,ControlsMenu,StatTile){
2324
var Dashboard = React.createClass({
2425
getInitialState: function() {
2526
return {
@@ -144,7 +145,23 @@ define(
144145
</section>
145146

146147
<section className="col-lg-5 connectedSortable ui-sortable">
147-
<ContainerFive />
148+
<ContainerFive>
149+
<WorldMap
150+
id="world-map"
151+
info = {{
152+
"US": 398,
153+
"SA": 400,
154+
"CA": 1000,
155+
"DE": 500,
156+
"FR": 760,
157+
"CN": 300,
158+
"AU": 700,
159+
"BR": 600,
160+
"IN": 800,
161+
"GB": 320,
162+
"RU": 3000
163+
}} />
164+
</ContainerFive>
148165
<ContainerSix />
149166
<ContainerSeven />
150167
</section>

0 commit comments

Comments
 (0)