amcharts3-react icon indicating copy to clipboard operation
amcharts3-react copied to clipboard

node_modules empty?

Open scheung38 opened this issue 9 years ago • 1 comments

webpack/examples.js

render: function () {
    // Render the chart
    return React.createElement(AmCharts, {
      "path": "node_modules/amcharts3/amcharts",

But after npm install, node_modules is still empty?

Also why is there no makeChart here

var chart = AmCharts.makeChart("chartdiv", {...}

But it is shown in most examples? Do I not need it?

Noticed I added in package.json

"scripts": { "prepublish": "webpack" } but when removed, node_modules are generate. If not sure why we need prepublish

scheung38 avatar Sep 22 '16 15:09 scheung38

Do you get any error messages when you run npm install?

Are you in the examples/webpack directory when you run npm install?


When using the amcharts3-react plugin, you must use React.createElement(AmCharts, { ... }) rather than AmCharts.makeChart("chartdiv", { ... })

The options are the same as AmCharts.makeChart, except that the id "chartdiv" is created automatically by the plugin, so you do not need to specify it.


After running npm install it needs to run webpack to bundle all of the JavaScript files into a single build/example.js file.

You can remove the prepublish, but then you need to run both npm install and webpack, rather than just npm install, so it is less convenient.

Pauan avatar Sep 22 '16 16:09 Pauan