Comments (9)
Thanks for this bug report! I can't actually replicate this behaviour outside of your repo, for example this works for me:
<!DOCTYPE html>
<html>
<head>
<title>react-plotly.js Scratch</title>
<script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
<script crossorigin src="https://cdn.plot.ly/plotly-1.33.0.min.js"></script>
<script crossorigin src="https://unpkg.com/[email protected]/dist/create-plotly-component.js"></script>
</head>
<body>
<div id="chart"> </div>
<script>
var gd = document.getElementById('chart')
var data = [
{
x: [1, 2, 3],
y: [4, 5, 6],
z: [7, 8, 9],
type: 'scatter3d',
mode: 'lines+markers',
}
];
var layout = {};
ReactDOM.render(
React.createElement(createPlotlyComponent(Plotly),
{ data: data, layout: layout}), gd );
</script>
</body>
</html>
from react-plotly.js.
Any idea what might be causing this? My guess might be something with how the webpack integration might be working, although I've followed the instructions for that in the README. I'm seeing this consistently with this webpack setup.
I also experimented by using a ref directly and using the Plotly library and not React-Plotly but seeing the same behavior. I was also having some trouble getting the imports to work as specified as in here. Was seeing runtime errors from react when using the default import e.g.
import Plot from 'react-plotly.js'; // Error
and
import { Plot } from 'react-plotly.js'; // Error
Don't know if this is related, I see you using createReactPlotlyComponent, but I'm assuming that's integrated into how the module is exported.
from react-plotly.js.
OK, first things first: I was able to reproduce the axes issue with Webpack and without React or create-react-app or TypeScript, so the issue seems to be in the Webpack bundling step. I'll try to find a fix for this shortly, but I may need to involve some plotly.js people.
With respect to the imports import Plot from 'react-plotly.js'
definitely works for multiple projects on this end, so let's create a new issue for that please, so as to stick to one problem/one Github issue :)
from react-plotly.js.
I believe we have a fix ready for this problem, it seems to be a dependency issue that shows up differently based on whether you install with yarn
or npm
:(
from react-plotly.js.
@nicolaskruchten Awesome, looking forward to the fix.
from react-plotly.js.
This should be fixed with the latest version of plotly.js. There were some issues with versions of gl-shader
that were installing in a different order depending on whether you were using Yarn or NPM but the new version should be more deterministic/correct.
from react-plotly.js.
I've just tried your example app with plotly.js version 1.34.0 and it works with both NPM and Yarn but please note that I had to erase yarn.lock
and rebuild it in order to make it work, otherwise it still installed the wrong version of gl-shader
for some dependencies for some reason that I'm struggling to understand.
from react-plotly.js.
(note that I'm assuming the error was from gl-shader
based on some previous investigations but it might be something else too)
from react-plotly.js.
Thanks, I've confirmed this works 👍
from react-plotly.js.
Related Issues (20)
- How do I configure spikedistance? HOT 1
- Depreciated in favor of Angular? HOT 2
- Update plotly.js to include the latest version HOT 1
- onDoubleClick does not work in 3D mesh HOT 1
- Support Synchronizing of zoom & hover for multiple charts on the same page HOT 1
- ranges does not get computed when same data is used but Plot is updated
- Can't resolve 'react-plotly.js' in HOT 1
- onUpdate - reset the zoom in Nextjs (React) HOT 2
- Rangeselector buttons flashing
- Plotly.restyle breaks onClick handlers
- Can't disable sunburst default animation HOT 1
- Is layout.height really disallowed when layout.autosize=true ?
- Axis `automarging` does not work HOT 6
- Need to extract `.default` before using `createPlotlyComponent` HOT 1
- Request for Kernel Density Estimate Plot Feature in react-plotly HOT 1
- Chart is cropped. HOT 1
- How can I use animate method ?
- How do I use Plotly.Fx.hover with react-plotly.js?
- Heatmap not showing HOT 1
- Clickmode "event+select" activated and Clicking outside of Graph calls onUpdate incorrectly
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-plotly.js.