import { Container } from "../../core/render/Container"; import { Serializer, ISerializerEvents, ISerializerSettings, ISerializerPrivate } from "./Serializer"; export interface IChartSerializerSettings extends ISerializerSettings { /** * Leaves empty objects out of the output. * * @default true */ removeEmptyObjects?: boolean; /** * Adds a `root` section with what was configured on the [[Root]], such as * its settings, formatters and locale. * * @default false * @since 5.20.2 */ includeRoot?: boolean; } export interface IChartSerializerPrivate extends ISerializerPrivate { } export interface IChartSerializerEvents extends ISerializerEvents { } /** * Serializes a whole chart, with its axes, series, data and legends, into a * config that [[JsonParser]] builds the chart from again. Unlike * [[Serializer]], by default it writes states and adapters, keeps adapter * callbacks as functions, and goes 10 levels deep. * * @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; _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; /** * Clears what the serializer remembers from an earlier `serializeAll()`. * Call it before serializing again with the same serializer. */ reset(): void; /** * Serializes a chart, or a container with charts, into a config object. * * @param source Chart or container * @return Config */ 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; /** * A data item's endless animation - a plane flying its route, say - is * started in code, so nothing on the bullet says it is playing. It is * written on the bullet's sprite as an `animations` entry aimed at the data * item, which is what plays it back. * * @param series Series * @param serializedSprite Serialized bullet sprite */ private _processDataItemAnimations; private _processBullets; private _disposeSampleBullet; 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