npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@ng-vcl/plotly

v0.4.0-12

Published

Plotly vcl component

Downloads

64

Readme

21.03.2017.

Be aware of this Plotly bug.

API

Properties:

Input()

Name | Type | Default | Description -------------------- | ------------------------- | ------- | -------------------------------------------------- debug (1) | boolean | false | whether to output debug information in the console plotId | string | '' | plot div id plotHoverInfoId | string | '' | hoverinfo div id, defaults to ${this.plotId}HoverInfo plotClass | string | '' | plot div classes plotHoverInfoClass | string | '' | hoverinfo div classes

data | Plotly.Data[] | | plot data layout | Plotly.Layout | | plot layout configuration | Plotly.Configuration | | plot configuration events | [event: string]: Function | | plot events, see "Attaching events" below frames | Plotly.Frame | | plot frames

width | number | | the width of the plot in percentage relative to the parent element height | number | | the height of the plot in percentage relative to the parent element

Public

afterPlot | boolean | | Whether the plot has been drawn for the first time plot | HTMLElement | | The plot's HTML element hoverInfo | HTMLElement | | An HTML element which can be used as a custom hoverinfo

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

Methods:

Name | Arguments | Description -------------- | -------------------------------------------- | ----------------------------------- restyle | update: any, traces?: number[] | Plotly.restyle wrapper resize | | Plotly.resize wrapper - resize the plot relayout | layout: any = this.layout | Plotly.relayout wrapper update | | Plotly.update wrapper redraw | | Plotly.redraw wrapper - force a full recalculation and redraw of the plot recreate | | Plotly.newPlot wrapper addTraces | traces: any OR any[], index?: number | Plotly.addTraces wrapper deleteTraces | traces: number OR number[] | Plotly.deleteTraces wrapper

Usage

Using with webpack

The plotly package provides a special entry point for webpack. Add "webpack" to resolve.mainFields in your webpack config file.

resolve: { mainFields: ["webpack", "module", "browser", "main"], ... }

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>