1/* * 2 * 3 * (c) 2010-2024 Torstein Honsi 4 * 5 * License: www.highcharts.com/license 6 * 7 * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!! 8 * 9 * */ 10'use strict'; 11import H from '../Globals.js'; 12import D from '../Defaults.js'; 13const { defaultOptions } = D; 14import Point from './Point.js'; 15import U from '../Utilities.js'; 16const { extend, extendClass, merge } = U; 17/* * 18 * 19 * Namespace 20 * 21 * */ 22var SeriesRegistry; 23(function (SeriesRegistry) { 24 /* * 25 * 26 * Properties 27 * 28 * */ 29 /** 30 * @internal 31 * @todo Move `Globals.seriesTypes` code to her. 32 */ 33 SeriesRegistry.seriesTypes = H.seriesTypes; 34 /* * 35 * 36 * Functions 37 * 38 * */ 39 /** 40 * Registers class pattern of a series. 41 * 42 * @private 43 */ 44 function registerSeriesType(seriesType, SeriesClass) { 45 const defaultPlotOptions = defaultOptions.plotOptions || {}, seriesOptions = SeriesClass.defaultOptions, seriesProto = SeriesClass.prototype; 46 seriesProto.type = seriesType; 47 if (!seriesProto.pointClass) { 48 seriesProto.pointClass = Point; 49 } 50 if (SeriesRegistry.seriesTypes[seriesType]) { 51 return false; 52 } 53 if (seriesOptions) { 54 defaultPlotOptions[seriesType] = seriesOptions; 55 } 56 SeriesRegistry.seriesTypes[seriesType] = SeriesClass; 57 return true; 58 } 59 SeriesRegistry.registerSeriesType = registerSeriesType; 60 /** 61 * Old factory to create new series prototypes. 62 * 63 * @deprecated 64 * @function Highcharts.seriesType 65 * 66 * @param {string} type 67 * The series type name. 68 * 69 * @param {string} parent 70 * The parent series type name. Use `line` to inherit from the basic 71 * {@link Series} object. 72 * 73 * @param {Highcharts.SeriesOptionsType|Highcharts.Dictionary<*>} options 74 * The additional default options that are merged with the parent's options. 75 * 76 * @param {Highcharts.Dictionary<*>} [props] 77 * The properties (functions and primitives) to set on the new prototype. 78 * 79 * @param {Highcharts.Dictionary<*>} [pointProps] 80 * Members for a series-specific extension of the {@link Point} prototype if 81 * needed. 82 * 83 * @return {Highcharts.Series} 84 * The newly created prototype as extended from {@link Series} or its 85 * derivatives. 86 */ 87 function seriesType(type, parent, options, seriesProto, pointProto) { 88 const defaultPlotOptions = defaultOptions.plotOptions || {}; 89 parent = parent || ''; 90 // Merge the options 91 defaultPlotOptions[type] = merge(defaultPlotOptions[parent], options); 92 // Create the class 93 delete SeriesRegistry.seriesTypes[type]; 94 registerSeriesType(type, extendClass(SeriesRegistry.seriesTypes[parent] || function () { }, seriesProto)); 95 SeriesRegistry.seriesTypes[type].prototype.type = type; 96 // Create the point class if needed 97 if (pointProto) { 98 class PointClass extends Point { 99 } 100 extend(PointClass.prototype, pointProto); 101 SeriesRegistry.seriesTypes[type].prototype.pointClass = PointClass; 102 } 103 return SeriesRegistry.seriesTypes[type]; 104 } 105 SeriesRegistry.seriesType = seriesType; 106})(SeriesRegistry || (SeriesRegistry = {})); 107/* * 108 * 109 * Default Export 110 * 111 * */ 112export default SeriesRegistry;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.