-
-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Web GL not supported issue #241
Comments
Hello @ssalveMobiltex . Quite weird this. Does this happen with another browser ? (e.g.: Firefox, edge or safari ?) |
Yes @andrefarzat I do get it on different browsers as well |
I could not replicate this issue. Could you show me the code you're using to import the angular-plotly.js module and an example of graph data ? |
eg. import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { PlotlyViaWindowModule } from 'angular-plotly.js';
@NgModule({
declarations: [],
imports: [
CommonModule,
PlotlyViaWindowModule
],
exports: [
CommonModule,
PlotlyViaWindowModule
]
}) Step 2: Import the shared module in your lazy loaded module import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { SharedPlotlyModule} from '../../shared-plotly.module';
import { SharedModule } from '../../shared.module';
import { GraphRoutingModule } from './graph-routing.module';
import { GraphWrapperComponent } from './reading-graph-wrapper/graph-wrapper.component';
import { GraphComponent } from './graph.component';
@NgModule({
declarations: [
GraphComponent,
GraphWrapperComponent
],
imports: [
CommonModule,
GraphRoutingModule,
SharedModule,
SharedPlotlyModule
]
})
export class GraphModule { } Step 3: Code in Component <div>
<plotly-plot class='chart' [data]="graph.data" [layout]="graph.layout" [config]="graph.config">
</plotly-plot>
</div> TS: graph;
graphData = [];
createGraph(result) {
const X = [], Y = [];
let fData, pData = {};
if (Condition) {
for (let index = 0; index < result.length; index++) {
X.push(result.x),
Y.push(result.y)
}
fData = {
type: "scattergl",
mode: "line",
x: X,
y: Y,
}
this.graphData.push(fData);
}
else if (Condition) {
for (let index = 0; index < result.length; index++) {
X.push(result.x),
Y.push(result.y)
}
pData = {
type: "scattergl",
mode: "line",
yaxis: 'y2',
x: X,
y: Y,
}
this.graphData.push(pData);
}
const layout = {
title: 'Graph',
yaxis: {domain: [0, 0.40], title: 'F'},
yaxis2: {domain: [0.50,1], title: 'P'},
showlegend: true,
legend: { orientation: "h",
traceorder: 'reversed',
x: 0,
y: -0.2
},
height: 700
}
this.graph = {
data: this.graphData,
layout: layout,
config: { responsive: true, displaylogo: false }
};
} |
I can't see anything wrong with your code. Secondly, please fork this codepen and try to make it work within your data. I am trying to confirm that plotly.js is working correctly before attacking angular-plotly.js, for it's just a wrapper for plotly.js |
Hi all, I am facing web gl not supported issue on Production build for plotly
Angular Plotly version - "angular-plotly.js": "^5.1.0",
"plotly.js-dist": "^2.24.2",
"plotly.js-dist-min": "^2.24.2",
I am using the latest Chrome version with hardware acceleration on.
The text was updated successfully, but these errors were encountered: