@amcharts/amcharts5
Version:
amCharts 5
162 lines • 6.2 kB
TypeScript
import { Container } from "../../core/render/Container";
import { Serializer, ISerializerEvents, ISerializerSettings, ISerializerPrivate } from "./Serializer";
export interface IChartSerializerSettings extends ISerializerSettings {
/**
* Remove empty objects from the output.
*
* @default true
*/
removeEmptyObjects?: boolean;
/**
* Include a `root` section (settings and properties of the [[Root]] object)
* in the serialized output.
*
* @default false
* @since 5.20.2
*/
includeRoot?: boolean;
}
export interface IChartSerializerPrivate extends ISerializerPrivate {
}
export interface IChartSerializerEvents extends ISerializerEvents {
}
/**
* Serializes whole charts into simple objects or JSON.
*
* @see {@link https://www.amcharts.com/docs/v5/concepts/serializing/chart-serializer/} for more info
* @since 5.15.0
*/
export declare class ChartSerializer extends Serializer {
static className: string;
static classNames: Array<string>;
_settings: IChartSerializerSettings;
_privateSettings: IChartSerializerPrivate;
_events: IChartSerializerEvents;
private _disableDataSerialization;
/**
* Settings that hold another series (a map line series' `pointSeries`, say).
* They are written out as a reference, but the series they point at may not
* have been given one yet, so they are collected and filled in at the end.
*/
private _pendingSeriesRefs;
/**
* Work that cannot be done until every series has been given an id - a legend
* that sits above its chart is reached before the series it lists.
*/
private _deferred;
private _globalRefs;
private _internalRefs;
private _counters;
private _lists;
private _mainRefs;
protected _afterNew(): void;
reset(): void;
/**
* Serializes target object into a simple object.
*
* @param source Target object
* @return Serialized data
*/
serializeAll(source: Container): any;
private _serializeRoot;
private _serializeEntity;
private _examineStructure;
private _processCustomChildren;
/**
* A map's `geoJSON` is normally one of the geodata packs, loaded as a global.
* Written out by the name it is loaded under, so a config stays small and the
* pack is not duplicated into it.
*/
private _referenceGeodata;
private _processSeries;
private _referenceSeriesColors;
private _processTemplate;
private _processSerialChart;
private _processSerialChartContainer;
private _processXYChart;
private _processAxis;
/**
* Some elements are built out of smaller ones they make for themselves - a
* scrollbar's thumb and grips, a button's background and icon, a clock hand's
* hand and pin. Styling those is styling the chart, so they go out as settings
* for the ones already there, wherever the element was reached from.
*/
protected _afterEntity(source: any, res: any): void;
/**
* Writes out the named parts of an element, type-less so that they configure
* the ones it has already made rather than standing in for them. A part with
* nothing configured on it is left out, and one the element carries as a
* setting is left to that setting.
*/
private _processParts;
private _processCurveChart;
private _processMapChart;
/**
* A Gantt is its own settings, the rows it lays out and the tasks on them.
* The chart, both date axes, the category axis, the series and the
* scrollbars are the Gantt's own doing, so they are written out only where
* something was configured on them - as settings on the ones it rebuilds,
* never as replacements.
*/
private _processGantt;
/**
* The ref a data array is written out as, reusing the one already made if
* the same data is on more than one element.
*/
private _dataRef;
private _processStockChart;
private _processHierarchy;
private _processBullets;
private _populateTemplates;
/**
* A reference to a data item, by the path it sits at. Only rows of a series'
* data end up in `dataItems`; anything below that (a hierarchy's second level,
* say) is reached through its parent's `children`.
*/
private _dataItemRef;
private _stripKeys;
private _stripType;
private _saveInternalRef;
private _getInternalRef;
private _findInternalRef;
private _getRef;
private _getRefIndex;
private _saveRef;
/**
* Puts a series that another series points at before the one pointing at it.
*
* Refs are resolved in the order they are written, so a reference to a series
* further down the list is not there yet when it is read. Series are usually
* added to a chart in drawing order - lines under points, say - which is
* exactly the order that breaks.
*/
private _orderSeriesRefs;
private _saveRefId;
private _hashObject;
private _maybeInit;
private _counter;
private _getId;
/**
* Leaves out what a range sets up for itself when parsed back: `isRange`,
* which `__parseLogic` already implies, and any asset that came out carrying
* nothing but a type - saying only that the object exists.
*/
private _stripRangeInternals;
private _pruneEmptyObjects;
/**
* A legend holding a whole list of data items, in order, is written out as the
* list itself - the way it is usually configured - rather than as one
* reference per item, so it still matches the series after its data changes.
*/
private _collapseLegendData;
/**
* Whether the element is one the parent keeps for itself - held in a property
* or in a setting. Anything else among its children was put there by whoever
* built the chart.
*/
private _isOwnElement;
private _holds;
private _isLegend;
private _notSupported;
}
//# sourceMappingURL=ChartSerializer.d.ts.map