react-highcharts
Advanced tools
Comparing version 2.1.0 to 3.0.0
{ | ||
"name": "react-highcharts", | ||
"version": "2.1.0", | ||
"version": "3.0.0", | ||
"description": "React wrapper for highcharts", | ||
"main": "index.js", | ||
"main": "dist/highcharts.js", | ||
"scripts": { | ||
"test": "webpack && mocha", | ||
"demo": "cd demo && webpack && ../node_modules/.bin/webpack-dev-server --content-base dist/", | ||
"demo": "cd demo && webpack && sh generate-contents.sh && ../node_modules/.bin/webpack-dev-server --content-base dist/", | ||
"prepublish": "webpack", | ||
"deploy-demo": "./demo/deploy.sh" | ||
"deploy-demo": "./demo/deploy.sh", | ||
"generate-modules": "(cd src; sh ./generate-modules.sh)" | ||
}, | ||
@@ -19,3 +20,3 @@ "author": "Kirill Cherkashin", | ||
"peerDependencies": { | ||
"react": "*" | ||
"react": "~0.13" | ||
}, | ||
@@ -34,5 +35,3 @@ "bugs": "https://github.com/kirjs/react-highcharts/issues", | ||
"file-loader": "^0.8.4", | ||
"highcharts-release": "^4.1.7", | ||
"highlight.js": "^8.5.0", | ||
"highstock-release": "^2.1.8", | ||
"imports-loader": "^0.6.4", | ||
@@ -42,7 +41,12 @@ "jsdom": "^6.3.0", | ||
"raw-loader": "^0.5.1", | ||
"react": "*", | ||
"react": "~0.13", | ||
"react-highlight": "^0.4.1", | ||
"webpack": "^1.5.3", | ||
"webpack-dev-server": "^1.10.1" | ||
}, | ||
"dependencies": { | ||
"highcharts-release": "^4.1.7", | ||
"highmaps-release": "^1.1.9", | ||
"highstock-release": "^2.1.8" | ||
} | ||
} |
@@ -12,2 +12,3 @@ react-highcharts | ||
* see [example of using react-highcharts/highstock](http://kirjs.github.io/react-highcharts/highstock.html) | ||
* see [example of using react-highcharts/highmaps](http://kirjs.github.io/react-highcharts/highmaps.html) | ||
@@ -32,7 +33,7 @@ You can find the full code for the examples [here](https://github.com/kirjs/react-highcharts/tree/master/demo) | ||
## Usage | ||
#### Basic Usage | ||
#### Basic Usage | ||
```jsx | ||
var React = require('react'); | ||
var Highcharts = require('react-highcharts'); | ||
var Highcharts = require('react-highcharts'); // Expects that Highcharts was loaded in the code. | ||
@@ -45,2 +46,13 @@ var config = { | ||
#### Bundled Usage (includes Highcharts) | ||
```jsx | ||
var React = require('react'); | ||
var Highcharts = require('react-highcharts/bundle/highcharts'); // Highcharts is bundled | ||
var config = { | ||
/* HighchartsConfig */ | ||
}; | ||
React.render(<Highcharts config = {config}></Highcharts>, document.body); | ||
``` | ||
#### Accessing Highcharts API After Render | ||
@@ -67,12 +79,15 @@ For access to methods & properties from the Highcharts library you can use `Highcharts.Highcharts`. For example, the Highcharts options are available via `Highcharts.Highcharts.getOptions()`. | ||
## Using highcharts-more | ||
Just require `require('react-highcharts/more');` instead of `react-highcharts` | ||
* see [the demo](http://kirjs.github.io/react-highcharts/more.html) | ||
## Using highmaps | ||
Require Highmaps first, and then `require('react-highcharts/highmaps');` | ||
Or use bundled version: `require('react-highcharts/bundle/highmaps');` | ||
* see [the demo](http://kirjs.github.io/react-highcharts/highmaps.html) | ||
## Using highstock | ||
Just require `require('react-highcharts/highstock');` instead of `react-highcharts` | ||
Require Highstock first, and then `require('react-highcharts/highstock');` | ||
Or use bundled version: `require('react-highcharts/bundle/highstock');` | ||
* see [the demo](http://kirjs.github.io/react-highcharts/highstock.html) | ||
## Using highcharts modules/add-ons like exporting, data, etc. | ||
Just require `require('react-highcharts/modules/MODULE_NAME');` after requiring `react-highcharts` | ||
## For Contributors | ||
@@ -79,0 +94,0 @@ ### Update Highcharts Version |
var React = require('react'); | ||
if(typeof Highcharts === 'undefined'){ | ||
throw Error('Starting with version 3 of react-highcharts, Highcharts is not bundled by default. ' + | ||
' use "react-highcharts/bundle/highcharts" instead, or include highcharts. ' | ||
); | ||
} | ||
module.exports = function (Highcharts, chartType) { | ||
@@ -18,3 +24,2 @@ var displayName = 'Highcharts' + chartType; | ||
let chartConfig = config.chart; | ||
this.chart = new Highcharts[chartType]({ | ||
@@ -21,0 +26,0 @@ ...config, |
@@ -1,4 +0,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'); |
@@ -1,4 +0,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'); |
@@ -5,5 +5,12 @@ var path = require('path'); | ||
entry: { | ||
highcharts: ['./src/Highcharts.jsx'], // Array syntax to workaround https://github.com/webpack/webpack/issues/300 | ||
highstock: ['./src/Highstock.jsx'], // Array syntax to workaround https://github.com/webpack/webpack/issues/300 | ||
more: './src/More.jsx' | ||
// Array syntax to workaround https://github.com/webpack/webpack/issues/300 | ||
'index': ['./src/Highcharts.jsx'], | ||
'highcharts': ['./src/Highcharts.jsx'], | ||
'highstock': ['./src/Highstock.jsx'], | ||
'highmaps': ['./src/Highmaps.jsx'], | ||
'bundle/index': './src/bundle/Highcharts.jsx', | ||
'bundle/highcharts': './src/bundle/Highcharts.jsx', | ||
'bundle/highstock': './src/bundle/Highstock.jsx', | ||
'bundle/highmaps': './src/bundle/Highmaps.jsx' | ||
}, | ||
@@ -21,13 +28,3 @@ module: { | ||
{ | ||
'react/addons': true, | ||
'react': true | ||
}, | ||
function(context, request, callback) { | ||
if (request === './Highcharts.jsx') { | ||
// Exclude highcharts.js from more.js | ||
// Resolves https://github.com/kirjs/react-highcharts/issues/9 | ||
callback(null, './highcharts'); | ||
} else { | ||
callback(); | ||
} | ||
} | ||
@@ -39,4 +36,5 @@ ], | ||
"highcharts" : "highcharts-release/highcharts.src.js", | ||
"highmaps" : "highmaps-release/highmaps.src.js", | ||
"highcharts-more" : "highcharts-release/highcharts-more.src.js", | ||
"highcharts-standalone-adapter" : "highcharts-release/adapters/standalone-framework.src.js" | ||
"highcharts-standalone-adapter" : "highcharts-release/adapters/standalone-framework.src.js", | ||
}, | ||
@@ -50,2 +48,2 @@ modulesDirectories: ['node_modules'] | ||
} | ||
}; | ||
}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
2711670
13
97
76744
102
4
1
1
+ Addedhighcharts-release@^4.1.7
+ Addedhighmaps-release@^1.1.9
+ Addedhighstock-release@^2.1.8
+ Addedacorn@5.7.4(transitive)
+ Addedamdefine@1.0.1(transitive)
+ Addedast-types@0.9.6(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbase62@1.2.8(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedcommander@2.20.3(transitive)
+ Addedcommoner@0.10.8(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addeddefined@1.0.1(transitive)
+ Addeddetective@4.7.1(transitive)
+ Addedenvify@3.4.1(transitive)
+ Addedesprima@3.1.3(transitive)
+ Addedesprima-fb@15001.1.0-dev-harmony-fb(transitive)
+ Addedglob@5.0.15(transitive)
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedhighcharts-release@4.2.7(transitive)
+ Addedhighmaps-release@1.1.10(transitive)
+ Addedhighstock-release@2.1.10(transitive)
+ Addediconv-lite@0.4.24(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedjstransform@11.0.3(transitive)
+ Addedminimatch@3.1.2(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedmkdirp@0.5.6(transitive)
+ Addedobject-assign@2.1.1(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedprivate@0.1.8(transitive)
+ Addedq@1.5.1(transitive)
+ Addedreact@0.13.3(transitive)
+ Addedrecast@0.11.23(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsource-map@0.4.40.5.7(transitive)
+ Addedthrough@2.3.8(transitive)
+ Addedwrappy@1.0.2(transitive)
- Removedjs-tokens@4.0.0(transitive)
- Removedloose-envify@1.4.0(transitive)
- Removedreact@18.3.1(transitive)