amCharts 5

repository·master·Indexed 19 days ago

https://github.com/amcharts/amcharts5

A high-performance data visualization library designed for speed and advanced charting capabilities. It includes core rendering components, a Root class for HTML element connection, a Registry for instance management, and specialized tools for memory management via Disposers. The library provides support for themes, color management, data formatters, and optional packages for geodata and PDF fonts.

Tokens
3K
Snippets
11
Records
18
Agent score
66%

What's inside amCharts 5

  1. Use amCharts 5 fonts via CDN

    master

    If you prefer not to host the font files locally, you can access the JavaScript version of these fonts via the amCharts free CDN service. The base URL is https://www.amcharts.com/lib/5/fonts/.

    <script src="https://cdn.amcharts.com/lib/5/fonts/notosans-sc.js"></script>
  2. Use amCharts 5 Geodata via CDN

    master

    You can access the JavaScript versions of geodata files directly via the amCharts CDN. The base URL is https://www.amcharts.com/lib/5/geodata/.

    For example, to include the worldLow.js map file, use the following script tag:

    <script src="https://www.amcharts.com/lib/5/geodata/worldLow.js"></script>
  3. Compile amCharts 5 from source

    master

    If you need to build the library from the source code, you can use yarn to install dependencies and run the build scripts. This allows you to generate ES2015 modules, script versions, or geodata.

    # Install dependencies
    yarn install
    
    # Build ES2015 modules
    yarn build
    
    # Build script version
    yarn build:script
    
    # Build geodata
    yarn build:geodata
  4. Install the amCharts 5 PDF Font Pack

    master

    The PDF Font Pack provides the font files required for PDF exports using the amCharts 5 Exporting plugin. You can install it using one of two methods:

    1. NPM: Install the @amcharts/amcharts5-fonts package.
    2. Manual: Place the contents of this package directly into your amcharts5/fonts folder.
    npm install @amcharts/amcharts5-fonts
  5. Install amCharts 5 via NPM

    master

    The easiest way to use amCharts 5 in your project is by installing the pre-built NPM package. This provides the compiled version of the library ready for use in modern web development workflows.

    npm install @amcharts/amcharts5
  6. Install the amCharts 5 Geodata package

    master

    The Geodata package contains map files used with MapChart. You must also have the main @amcharts/amcharts5 library installed to use these files.

    Using NPM

    npm install @amcharts/amcharts5
    npm install @amcharts/amcharts5-geodata

    Using Yarn

    yarn add @amcharts/amcharts5
    yarn add @amcharts/amcharts5-geodata

    Standalone Installation

    Download the package contents and place them into your local amcharts5/geodata folder.

  7. Use Disposers for memory management

    master

    amCharts 5 uses Disposer objects to manage the lifecycle of various resources (like series, axes, or graphics) and ensure they are properly cleaned up to prevent memory leaks.

    • Disposer: The base class for managing disposables.
    • ArrayDisposer: Manages a collection of disposables.
    • MultiDisposer: Allows grouping multiple disposers.
    • MutableValueDisposer: Manages a single value that can be updated.
    • CounterDisposer: Manages disposables based on a count.
  8. Third-party libraries used in amCharts 5 optional plugins

    master

    Certain optional plugins in amCharts 5 introduce additional third-party dependencies. These are typically used for specific features like PDF generation, Excel export, or annotation tools. The following libraries are used in these optional modules:

    |Package|Copyright (c)|License|
    |-------|-------------|-------|
    |pdfmake|bpampuch|[License](https://github.com/bpampuch/pdfmake/blob/master/LICENSE)|
    |SheetJS js-xlsx|SheetJS LLC|[License](https://github.com/SheetJS/js-xlsx/blob/master/LICENSE)|
    |marker.js 2|Alan Mendelevich|[License](https://github.com/ailon/markerjs2/blob/master/LICENSE)|
  9. Third-party libraries used in amCharts 5 Core

    master

    The amCharts 5 core package relies on several third-party libraries for its fundamental functionality, including D3 modules for various visualization logic, utility libraries for math and selection, and others. If you are auditing dependencies or concerned about license compliance for the core package, these are the libraries included:

    |Package|Copyright (c)|License|
    |-------|-------------|-------|
    |d3|Mike Bostock|[License](https://github.com/d3/d3/blob/master/LICENSE)|
    |d3-chord|Mike Bostock|[License](https://github.com/d3/d3-fchord/blob/master/LICENSE)|
    |d3-geo|Mike Bostock|[License](https://github.com/d3/d3-geo/blob/master/LICENSE)|
    |d3-geo-projection|Mike Bostock|[License](https://github.com/d3/d3-geo-projection/blob/master/LICENSE)|
    |d3-force|Mike Bostock|[License](https://github.com/d3/d3-force/blob/master/LICENSE)|
    |d3-sankey|Mike Bostock|[License](https://github.com/d3/d3-sankey/blob/master/LICENSE)|
    |d3-selection|Mike Bostock|[License](https://github.com/d3/d3-selection/blob/main/LICENSE)|
    |d3-transition|Mike Bostock|[License](https://github.com/d3/d3-transition/blob/main/LICENSE)|
    |d3-voronoi-treemap|LEBEAU Franck|[License](https://github.com/Kcnarf/d3-voronoi-treemap/blob/master/LICENSE)|
    |flatpickr|Gregory Petrosyan|[License](https://github.com/flatpickr/flatpickr/blob/master/LICENSE.md)|
    |polylabel|Mapbox|[License](https://github.com/mapbox/polylabel/blob/master/LICENSE)|
    |seedrandom|David Bau|[License](https://github.com/davidbau/seedrandom?tab=readme-ov-file#license-mit)|
    |svg-arc-to-cubic-bezier|Colin Meinke|[License](https://github.com/colinmeinke/svg-arc-to-cubic-bezier/blob/master/LICENSE.md)|
    |tslib|Microsoft|[License](https://github.com/microsoft/tslib/blob/master/LICENSE.txt)|