You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is demo project for AnyChart intergration with angular 5, however, the same approach doesn't work for graphics.js. Attempt to import the library results in error:
core.js:1633 ERROR Error: Uncaught (in promise): ReferenceError: acgraph is not defined
@abudarevsky
Unfortunately, the current version of AnyChart doesn't provide typedefs for pure GraphicsJS which functions and methods are available via acgraph.***(). Now you can use graphicsJS only as a part of AnyChart library. You should include anychart-base.min.js and access to graphics methods and functions via anychart.graphics.***().
Meanwhile, our team prepares additional index.d.ts for pure GraphicsJS.
We will notify you when the update becomes available.
@abudarevsky
We are glad to notify that we have prepared typedefs for graphicsJS!
You can download the current version of graphicsJS.d.ts by this link.
Here are few lines how to use the graphicsJS in the Angular app:
For Angular 6+ integration, the recommended approach:
Download the .d.ts file from the URL above
Import it in your polyfills.ts or a dedicated globals.d.ts:
/// <reference types="./graphics.d.ts" />
In your Angular component:
import*asacgraphfrom"acgraph.vector";// or use anychart// The safer approach is to use anychart.graphics:import*asanychartfrom"anychart";
stage: anychart.graphics.Graph=null;ngOnInit(){this.stage=anychart.graphics.create(this.container.nativeElement);this.stage.circle(50,50,45);}
Note: Pure GraphicsJS standalone usage has limited Angular support. The AnyChart library (which wraps GraphicsJS) provides better TypeScript definitions and Angular integration. Consider using anychart-angular package for Angular projects.
Activity
loki20beta commentedon Aug 3, 2018
@abudarevsky we will look into it and get back to you
Shestac92 commentedon Aug 7, 2018
@abudarevsky
Unfortunately, the current version of AnyChart doesn't provide typedefs for pure GraphicsJS which functions and methods are available via
acgraph.***(). Now you can use graphicsJS only as a part of AnyChart library. You should includeanychart-base.min.jsand access to graphics methods and functions viaanychart.graphics.***().Meanwhile, our team prepares additional index.d.ts for pure GraphicsJS.
We will notify you when the update becomes available.
Shestac92 commentedon Sep 27, 2018
@abudarevsky
We are glad to notify that we have prepared typedefs for graphicsJS!
You can download the current version of graphicsJS.d.ts by this link.
Here are few lines how to use the graphicsJS in the Angular app:
arunmmanoharan commentedon Oct 22, 2018
@Shestac92 Does the link for the ts file work?
Shestac92 commentedon Oct 23, 2018
@a2441918 Please, use this link to get the latest graphics.d.ts
jchatkinson commentedon Dec 29, 2018
@Shestac92 the link seems to be broken
Shestac92 commentedon Dec 29, 2018
@jchatkinson
Thank you for pointing me at this fact!
Very soon I will provide the correct link.
Shestac92 commentedon Sep 16, 2019
@pouya-daneshvar-freelands-it
Use the link to download the index.d.ts file for GraphicsJS.
vincent1981 commentedon Jun 22, 2020
Any news on this? both of links are broken!
decfrr commentedon Nov 5, 2023
The last link mentioned is
http://api.anychart.stg/si/8.3.0/graphics.d.ts, but I was able to download thed.tsfile by replacing.stgwith.com.mithunbabbira commentedon Oct 10, 2026
@abudarevsky Update: The TypeScript definition file (graphics.d.ts) is now available at the stable URL:
https://cdn.anychart.com/releases/v8/graphics.d.ts
For Angular 6+ integration, the recommended approach:
.d.tsfile from the URL abovepolyfills.tsor a dedicatedglobals.d.ts:/// <reference types="./graphics.d.ts" />Note: Pure GraphicsJS standalone usage has limited Angular support. The AnyChart library (which wraps GraphicsJS) provides better TypeScript definitions and Angular integration. Consider using
anychart-angularpackage for Angular projects.