Skip to content

Latest commit

 

History

History
42 lines (24 loc) · 1.66 KB

FAQ.md

File metadata and controls

42 lines (24 loc) · 1.66 KB

Frequently Asked Questions

How to disable plotly events?

It's possible disable some plotly events returning false in its event. Please see issue: #52 (comment)

Why using (plotlyClick) instead of (click)?

Angular uses the (click) directive to itself. If we use the click name as event alias to plotlyClick we might get unexpected behaviour from both angular and plotly.js. We believe it is simpler to just avoid using the same name is better. Please see issue: #63

How to access global Plotly object code

You can access the Plotly object from plotly.js via PlotlyService. See the example:

import { PlotlyService } from 'angular-plotly.js';

@Component({
    selector: 'app-plotly',
    template: '...',
})
export class AppPlotlyComponent {
    constructor(public plotlyService: PlotlyService) {
        const Plotly = plotlyService.getPlotly();
    }
}

The graph is too slow when interacting, what could I do?

Angular checks all the data everytime to see if there is a change to be applied, sometimes this brings unexpected slowness when treating a large data to be displayed. To avoid this check, set the property updateOnlyWithRevision to true. When you need the component to update, you can use the revision property (a number) to force it to update. Simply incrementing it (e.g.: this.revision += 1) will force the component to be updated.

How to support Angular 7.x?

There was a breaking change from Angular 7.x to 8.x. Please see this thread: #79