GithubHelp home page GithubHelp logo

mpx200 / ng-dygraphs Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 9.0 43 KB

Angular 2+ library for support of dygraphs(http://dygraphs.com) charts

License: MIT License

TypeScript 55.68% HTML 7.22% CSS 37.09%
ng-dygraphs dygraphs chart angular2 docker angular4 angular dygraphs-library

ng-dygraphs's People

Contributors

bushev avatar jimic avatar mpx200 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

ng-dygraphs's Issues

Instructions need to include restart of 'ng serve'

Spent about a day on this wondering why I had followed all directions but couldn't get it to work. I kept getting an error in the JS console in Firefox sayingERROR ReferenceError: Dygraph is not defined. The Dygraph object just showing a spinning bubble wheel in the browser. No amount of searching the internet for combinations of the error message, Angular, Dygraph, ng-dygraphs, etc came anywhere close to a solution. I branched out and started researching how to use an existing JS library within angular and after very careful reading I noticed one little statement that said you need to restart 'ng serve' in order for the modifications to angular.json (angular-cli.json in the instruction) to be picked up.

Can't get options with text to work

I have created a new project using ng new my-project. I followed the directions so that the following template (app.component.html) shows a chart with data and responds appropriately to the options shown.

<ng-dygraphs 
   [data]=[[1,2],[2,3],[3,0],[4,1]]
   [options]={width:-1,stepPlot:true}>
</ng-dygraphs>

If I try to use any option that has a type of string then the Digraph chart will not display. For example, if I modify the template as shown below then the chart will not render. (see [options]={width:'auto',...)

<ng-dygraphs 
   [data]=[[1,2],[2,3],[3,0],[4,1]]
   [options]={width:'auto',stepPlot:true}>
</ng-dygraphs>

In addition, putting any spaces in the original template field options will generate an error in the JS console. I do not know if this is my error in syntax but the README.md file contains the following comments which will introduce this error:

<!-- data property needs to be  defined in your controller and in native array format http://dygraphs.com/data.html#array
  
  data = [[new Date("2008/05/07"), 75],
          [new Date("2008/05/08"), 70],
          [new Date("2008/05/09"), 80]
         ];
  
  options = {width: 'auto', labels: ['Date','Temperature'], xlabel: 'X label text', ylabel: 'Y label text', title: 'Working title :)', animatedZooms: true, pointSize: 4}
-->

Unable to import component without deeplink

To include the component in the project, the import statement has to look like this,

import {NgDygraphsComponent} from "ng-dygraphs/lib/src/ng-dygraphs.component";

Update index.ts to export the component and module

export { NvD3Component } from './lib/ng2-nvd3.component';
export { NvD3Module } from './lib/ng2-nvd3.module';

Memory leak when data are changed

With latest version of ng-dygraphs (don't know with prior also) when data is binded, and changed often, ng-dygraphs does not release resources. Data are accumulated in the memory. There is no way to fix it.

If ng-dygraphs is replaced with a regular dygraph, the problem does not occur.

Call dygraphs methods

It seems impossible to access the chart methods such as .resetZoom() and .xAxisRange() as described here: http://dygraphs.com/jsdoc/symbols/Dygraph.html
Because _g (the chart instance) is private so we can't access it. Also NgDygraphsComponent isn't exported in index.ts (but available by importing Éľa from 'ng-dygraphs').

Is there a good reason to keep _g and NgDygraphsComponent private?

FYI: angular2-chartjs use this way to allow developers to access to the chart instance (emn178/angular2-chartjs#2 (comment))

Can we use ng-dygraphs with angular7?

I am using Angular7 and want to integrate ng-dygraphs.
I am trying to integrate but got some error like: "ng-dygraphs is not defined".

Send me solution if anyone has.

Thank you..

Failed to load ng-dygraphs.component.html

Since updating from 0.3.5 to 0.3.8/0.3.9 I get some weird errors when I want to start my application:

Uncaught ReferenceError: exports is not defined at scripts.bundle.js:sourcemap:44808

GET http://localhost:4200/ng-dygraphs.component.html 404 (Not Found)

Unhandled Promise rejection: Failed to load ng-dygraphs.component.html ; Zone: <root> ; Task: Promise.then ; Value: Failed to load ng-dygraphs.component.html

When I go back to 0.3.5 everything works fine.

[Proposal] Use `ng-packagr` as packager

In light of issue #18, I would like to propose to switch to using ng-packagr as the packager of this NgModule.

Advantages

  • It produces es5 compatible code.
  • It produces es6 compatible code.
  • It produces umd bundle code.
  • Produces code that works out of the box with both ts and js angular projects

Disadvantages

  • Requires to read the manual (RTFM)

A good tutorial on how to use it can be found here.

You can see it in action @ https://github.com/JimiC/ng-dygraphs/tree/ng-packagr.

@mpx200 Thoughts?

Reference Error: Dygraph is not defined

Hi,

i get the following error:

core.js:1440 ERROR ReferenceError: Dygraph is not defined
at eval (ng-dygraphs.es5.js:59)
at ZoneDelegate.invokeTask (zone.js:421)
at Object.onInvokeTask (core.js:4724)
at ZoneDelegate.invokeTask (zone.js:420)
at Zone.runTask (zone.js:188)
at ZoneTask.invokeTask (zone.js:496)
at ZoneTask.invoke (zone.js:485)
at timer (zone.js:2025)`

I did install ng-dygraphs with

npm install ng-dygraphs --save
but got the following warning:

npm WARN @schematics/[email protected] requires a peer of @angular-devkit/[email protected] but none is installed. You must install peer dependencies yourself.
npm WARN @schematics/[email protected] requires a peer of @angular-devkit/[email protected] but none is installed. You must install peer dependencies yourself.`

I added the module in app.module and I called it like that:

<ng-dygraphs [data]="data" [options]="options"> </ng-dygraphs>

Can you guys help me out with this? I looks like it can not find the Dygraphs library. Any dependency issue?

Loader not working

There is a mismatch between the variable loadingChartInProgress used in html and lodingInProgress used in ts causing loader to not show.

Angular 4+ doesn't like `umd` modules

Angular compiler complains about the umd module.

WARNING in ./~/ng-dygraphs/lib/index.js
9:24-31 Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.