New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@ng-vcl/plotly

Package Overview
Dependencies
Maintainers
4
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ng-vcl/plotly

Plotly vcl component

  • 0.3.3-6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
57
increased by338.46%
Maintainers
4
Weekly downloads
 
Created
Source

21.03.2017.

Be aware of this Plotly bug.

API

Properties:

NameTypeDefaultDescription
plotIdstringundefinedplot div id
plotClassstringundefinedplot div classes
dataany[]undefinedplot data
layoutanyundefinedplot layout
configurationanyundefinedplot configuration
eventsanyundefinedplot events, see "Attaching events" below
plotanyundefinedplot div (HTMLElement)
debug (1)booleanfalsewhether to output event information in the console

(1) Suggested use is in conjunction with browsing the vcl-plotly code

Methods:

NameArgumentsDescription
restyleupdate: any, traces?: number[]Plotly.restyle wrapper
relayoutlayout: any = this.layoutPlotly.relayout wrapper
updatePlotly.update wrapper
redrawPlotly.redraw wrapper (force a full recalculation and redraw of the plot)
recreatePlotly.newPlot wrapper
addTracestraces: any OR any[], index?: numberPlotly.addTraces wrapper
deleteTracestraces: number OR number[]Plotly.deleteTraces wrapper

Usage

Importing plotly (polyfills.ts or some other file)

if you want to use plotly in combination with zone.js, you must include plotly before zone.js in your project!

import '@ng-vcl/plotly';

import 'zone.js/dist/zone';

See also: https://github.com/plotly/plotly.js/issues/955.

app.module.ts

import { VCLPlotlyModule } from '@ng-vcl/plotly';

@NgModule({
    ...
    imports: [
      VCLPlotlyModule
    ]
    ...
})
export class AppModule {}

myAwesomePlotly.component.ts

<vcl-plotly *ngIf="data"
  [debug]="debug"
  [plotId]="plotId"
  [data]="data"
  [layout]="layout"
  [configuration]="configuration"
  [events]="events">
</vcl-plotly>

Attaching events

The events field is an object just like layout and configuration. To attach your custom events to the plotly plot, see the possible events and create them like so:

const events = {
  plotly_click: (data: any, event: any, plotId: string, plot: any, Plotly: any) => {
    ...
  }
}

Note: if you want to add a plotly_afterplot event handler, you'll have to manually set afterPlot to true.

vclPlotlyComponent.afterPlot = true

Debug

It's also possible to enable the debug flag to output information in the console.

<vcl-plotly
  ...
  [debug]="true"
  ...>
</vcl-plotly>

FAQs

Package last updated on 20 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc