-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separated bundled and unbundled components
Move Copy all modules in modules folder Test All3 bundles Add Highmaps Add Highmaps demo Generate contents for demos Clean up build scripts internal paths clean up
- Loading branch information
Showing
28 changed files
with
323 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/sh | ||
# | ||
# This script generates list of all html pages, and creates an HTML | ||
# contents based on the titles of the documents | ||
# | ||
|
||
# Get all title lines from html | ||
titles="grep "\<title\>" ./dist/*.html"; | ||
|
||
# Generate the menu | ||
pattern=".\/dist\/\(.*\)\:.*<title>\(.*\) |.*"; | ||
replacement="<a href = \"\1\">\2<\/a>" | ||
# Transform all titles into links, e.g. | ||
# Input: ./dist/highmaps.html: <title>Highmaps demo | react-highcharts</title> | ||
# Output: <a href = "highmaps.html">Highmaps demo </a> | ||
contents=`$titles | sed -e "s/$pattern/$replacement/" | tr "\\n" " "` | ||
|
||
# Put it in html files | ||
pattern="<div class = \"menu\">.*<\/div>" | ||
replacement="<div class = \"menu\">$contents<\/div>" | ||
# For all HTML files find the pattern, and add the contents | ||
sed -i '' -e "s;$pattern;$replacement;" $(find ./dist -type f -name '*.html') | ||
|
||
echo 'done generating contents'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head lang="en"> | ||
<meta charset="UTF-8"> | ||
<link rel="stylesheet" href="tomorrow.css"/> | ||
<link rel="stylesheet" href="style.css"/> | ||
<title>Highmaps demo | react-highcharts</title> | ||
</head> | ||
<body> | ||
<!-- THE LINE BELOW IS GENERATED, DON'T REMOVE OR MODIFY--> | ||
<div class = "menu"><a href = "highmaps.html">Highmaps demo </a> <a href = "highstock.html">Highstock demo </a> <a href = "index.html">Highcharts demo </a> <a href = "more.html">Highcharts-more demo </a> </div> | ||
<!-- END OF GENERATED CONTENT --> | ||
<h1>Highmaps</h1> | ||
<div id="test"></div> | ||
<h2>Code</h2> | ||
<h3>highmaps.jsx</h3> | ||
<div id="code-js"></div> | ||
<h3>highmaps.html</h3> | ||
<div id="code-html"></div> | ||
<script src="./highmaps.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
var React = require('react'); | ||
var Highmaps = require('react-highcharts/bundle/highmaps'); | ||
var Highlight = require('react-highlight'); | ||
require('./mapdata/europe'); | ||
|
||
|
||
var config = { | ||
chart: { | ||
spacingBottom: 20 | ||
}, | ||
title : { | ||
text : 'Europe time zones' | ||
}, | ||
|
||
legend: { | ||
enabled: true | ||
}, | ||
|
||
plotOptions: { | ||
map: { | ||
allAreas: false, | ||
joinBy: ['iso-a2', 'code'], | ||
dataLabels: { | ||
enabled: true, | ||
color: 'white', | ||
style: { | ||
fontWeight: 'bold' | ||
} | ||
}, | ||
mapData: Highcharts.maps['custom/europe'], | ||
tooltip: { | ||
headerFormat: '', | ||
pointFormat: '{point.name}: <b>{series.name}</b>' | ||
} | ||
|
||
} | ||
}, | ||
|
||
series : [{ | ||
name: 'UTC', | ||
data: ['IE', 'IS', 'GB', 'PT'].map( function (code) { | ||
return { code: code }; | ||
}) | ||
}, { | ||
name: 'UTC + 1', | ||
data: ['NO', 'SE', 'DK', 'DE', 'NL', 'BE', 'LU', 'ES', 'FR', 'PL', 'CZ', 'AT', 'CH', 'LI', 'SK', 'HU', | ||
'SI', 'IT', 'SM', 'HR', 'BA', 'YF', 'ME', 'AL', 'MK'].map(function (code) { | ||
return { code: code }; | ||
}) | ||
} ] | ||
}; | ||
|
||
React.render( | ||
<Highmaps config={config}></Highmaps>, | ||
document.getElementById('test') | ||
); | ||
|
||
React.render( | ||
<Highlight className="jsx">{require("raw-loader!./highmaps.jsx")}</Highlight>, | ||
document.getElementById('code-js') | ||
); | ||
|
||
React.render( | ||
<Highlight className="html">{require("raw-loader!./highmaps.html")}</Highlight>, | ||
document.getElementById('code-html') | ||
); | ||
|
||
require("file?name=[name].[ext]!./highmaps.html"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,23 @@ | ||
body { | ||
font-family: sans-serif; | ||
} | ||
} | ||
|
||
.menu:before { | ||
content: "All demos:"; | ||
} | ||
.menu a { | ||
margin-left: 10px; | ||
color: #f00; | ||
text-decoration: none; | ||
border-left: 1px #ddd solid; | ||
padding-left: 10px; | ||
} | ||
|
||
.menu a:first-child { | ||
border:none; | ||
} | ||
|
||
.menu a:visited { | ||
color: #777; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
global.HighchartsAdapter = require('exports?HighchartsAdapter!highcharts-standalone-adapter'); | ||
var Highcharts = require("exports?Highcharts!highcharts"); | ||
var chartFactory = require('./chartsFactory.jsx'); | ||
module.exports = chartFactory(Highcharts, 'Chart'); | ||
module.exports = chartFactory(Highcharts, 'Chart'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
if( Highcharts && !Highcharts.Map){ | ||
throw Error(''); | ||
} | ||
var chartFactory = require('./chartsFactory.jsx'); | ||
module.exports = chartFactory(Highcharts, 'Map'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
global.HighchartsAdapter = require('exports?HighchartsAdapter!highcharts-standalone-adapter'); | ||
var Highcharts = require("exports?Highcharts!highstock"); | ||
var chartFactory = require('./chartsFactory.jsx'); | ||
module.exports = chartFactory(Highcharts, 'StockChart'); | ||
module.exports = chartFactory(Highcharts, 'StockChart'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
if(!Highcharts) { | ||
global.HighchartsAdapter = require('exports?HighchartsAdapter!highcharts-standalone-adapter'); | ||
var Highcharts = require("highcharts"); | ||
} | ||
module.exports = require('../Highcharts.jsx'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
if( Highcharts && !Highcharts.Map){ | ||
throw Error('React-highcharts Highmaps module expects Highmaps to be loaded, ' + | ||
'but looks like a different copy of Highcharts was loaded before that'); | ||
} | ||
if(!Highcharts) { | ||
global.HighchartsAdapter = require('exports?HighchartsAdapter!highcharts-standalone-adapter'); | ||
var Highcharts = require("exports?Highcharts!highmaps"); | ||
} | ||
module.exports = require('../Highmaps.jsx'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
if( Highcharts && !Highcharts.Map){ | ||
throw Error('React-highcharts Highstock module expects Highstock to be loaded, ' + | ||
'but looks like a different copy of Highcharts was loaded before that'); | ||
} | ||
if( !Highcharts ){ | ||
global.HighchartsAdapter = require('exports?HighchartsAdapter!highcharts-standalone-adapter'); | ||
var Highcharts = require("exports?Highcharts!highstock"); | ||
} | ||
|
||
module.exports = require('../Highstock.jsx'); |
Oops, something went wrong.