plotly / react-pivottable

React-based drag'n'drop pivot table with Plotly.js charts
https://react-pivottable.js.org/
MIT License
997 stars 254 forks source link

I can't deploy the react component on apache server #6

Open jakub0225 opened 6 years ago

jakub0225 commented 6 years ago

Thanks for your attention!

I tried to deploy the react-pivottable component on apache server. I installed the apache server and executed the react-pivottable app in my computer. Now I should deploy it on the apache server. So I tried to build the component to js file, but it doesn't work. I have executed the following commands on the react-pivottable app.

$npm install #this is working $npm start #this is working $npm run build #this is not working $npm run production #this is not working

My aim is to convert the component to general javascript file so that it is used to display some data on apache server. I must use just the react component. Please help me.

nicolaskruchten commented 6 years ago

I'm not sure that this package does exactly what you're looking for but I'm happy to help you try to get there! This is a component which is meant to be used within a compiled and bundled app, not a standalone app, which is why you can't just deploy it by itself.

The commands that you can run via NPM are defined in package.json and there you can see that build and production not defined, which is why those commands aren't working. npm start runs a Webpack dev server that spins up the demo app in /examples. If you run webpack -p, this will output bundle.js which is the compiled Javascript for the demo app, without running the demo server.

This is likely not what you want, though... to use this component you will probably want to create your own app, with its own webpack.config.js file and bundling mechanism, and within that app all you'll need to do is run the npm install command to add this component to your dependencies so you can use it as you like.

I should add that there is also no mechanism at the moment to compile this component to a Javascript file which can be included via a single <script> tag, in case that's what you're trying to do...

If you give me a bit more context about how you'd like to use this component, I should be able to help you further!

jakub0225 commented 6 years ago

Thanks.

I have read your explanation and I got helped a lot. I will ask you for the problems using the pivot table later.

And I have another question, can I display the detail data over the bars when I use the bar chart to show some data? I will be glad to help me in this case. I prefer the detail method to realize it.

capture3

Regards!

nicolaskruchten commented 6 years ago

I'm not sure that's possible at the moment but I'll try to figure out a way to enable it :)

jakub0225 commented 6 years ago

Thank you for your kindness.

pankajkumar48 commented 5 years ago

I ran into a similar issue. Wanted to make this a run into production & could not crack how to make a build. So this is what I did.