Create single coordinate system and inject it into seriesModel.

@param {module:echarts/model/Global} ecModel
@param {module:echarts/ExtensionAPI} api
@return {Array.<module:echarts/coord/single/Single>}
434961
function create(ecModel, api) {
    var singles = [];

    ecModel.eachComponent('singleAxis', function (axisModel, idx) {

        var single = new Single(axisModel, ecModel, api);
        single.name = 'single_' + idx;
        single.resize(axisModel, api);
        axisModel.coordinateSystem = single;
        singles.push(single);

    });

    ecModel.eachSeries(function (seriesModel) {
        if (seriesModel.get('coordinateSystem') === 'singleAxis') {
            var singleAxisModel = ecModel.queryComponents({
                mainType: 'singleAxis',
                index: seriesModel.get('singleAxisIndex'),
                id: seriesModel.get('singleAxisId')
            })[0];
            seriesModel.coordinateSystem = singleAxisModel && singleAxisModel.coordinateSystem;
        }
    });

    return singles;
}
1016584
function histogramBinHoverProvider(publicAPI, model) {
  if (!model.hoverState) {
    model.hoverState = {};
  }

  publicAPI.setHoverState = (hoverState) => {
    model.hoverState = hoverState;
    publicAPI.fireHoverBinChange(model.hoverState);
  };
}
638223
function () {
		var chartOptions = this.chartOptions,
			getValueCount = function (type) {
				return (Highcharts.seriesTypes[type || 'line'].prototype.pointArrayMap || [0]).length;
			},
			globalType = chartOptions && chartOptions.chart && chartOptions.chart.type,
			individualCounts = [];

		each((chartOptions && chartOptions.series) || [], function (series) {
			individualCounts.push(getValueCount(series.type || globalType));
		});

		this.valueCount = {
			global: getValueCount(globalType),
			individual: individualCounts
		};
	}
564710
function (parallelModel, ecModel, api) {

        var dimensions = parallelModel.dimensions;
        var parallelAxisIndex = parallelModel.parallelAxisIndex;

        each(dimensions, function (dim, idx) {

            var axisIndex = parallelAxisIndex[idx];
            var axisModel = ecModel.getComponent('parallelAxis', axisIndex);

            var axis = this._axesMap.set(dim, new ParallelAxis(
                dim,
                axisHelper.createScaleByModel(axisModel),
                [0, 0],
                axisModel.get('type'),
                axisIndex
            ));

            var isCategory = axis.type === 'category';
            axis.onBand = isCategory && axisModel.get('boundaryGap');
            axis.inverse = axisModel.get('inverse');

            // Injection
            axisModel.axis = axis;
            axis.model = axisModel;
            axis.coordinateSystem = axisModel.coordinateSystem = this;

        }, this);
    }
1168602
private SpatialReferenceSystem createIfNeeded(SpatialReferenceSystem srs,
			String organization, long id) throws SQLException {

		if (srs == null) {

			if (organization
					.equalsIgnoreCase(ProjectionConstants.AUTHORITY_EPSG)) {

				switch ((int) id) {
				case ProjectionConstants.EPSG_WORLD_GEODETIC_SYSTEM:
					srs = createWgs84();
					break;
				case ProjectionConstants.EPSG_WEB_MERCATOR:
					srs = createWebMercator();
					break;
				case ProjectionConstants.EPSG_WORLD_GEODETIC_SYSTEM_GEOGRAPHICAL_3D:
					srs = createWgs84Geographical3D();
					break;
				default:
					throw new GeoPackageException(
							"Spatial Reference System not supported for metadata creation. Organization: "
									+ organization + ", id: " + id);
				}
			} else if (organization
					.equalsIgnoreCase(ProjectionConstants.AUTHORITY_NONE)) {
				switch ((int) id) {
				case ProjectionConstants.UNDEFINED_CARTESIAN:
					srs = createUndefinedCartesian();
					break;
				case ProjectionConstants.UNDEFINED_GEOGRAPHIC:
					srs = createUndefinedGeographic();
					break;
				default:
					throw new GeoPackageException(
							"Spatial Reference System not supported for metadata creation. Organization: "
									+ organization + ", id: " + id);
				}
			} else {
				throw new GeoPackageException(
						"Spatial Reference System not supported for metadata creation. Organization: "
								+ organization + ", id: " + id);
			}
		} else {
			setDefinition_12_063(srs);
		}

		return srs;
	}
60521
private MapController createVertexController(GeometryEditService editService, GeometryIndex index) {
		CompositeGeometryIndexController controller = new CompositeGeometryIndexController(editService, index,
				editService.getEditingState() == GeometryEditState.DRAGGING);
		for (VertexMapHandlerFactory factory : vertexFactories) {
			controller.addMapHandler(factory.create());
		}
		return controller;
	}
132144
function (axisModel, api) {
        this._rect = getLayoutRect(
            {
                left: axisModel.get('left'),
                top: axisModel.get('top'),
                right: axisModel.get('right'),
                bottom: axisModel.get('bottom'),
                width: axisModel.get('width'),
                height: axisModel.get('height')
            },
            {
                width: api.getWidth(),
                height: api.getHeight()
            }
        );

        this._adjustAxis();
    }
734975
function (e, chartPosition) {
            var chartX,
              chartY,
              ePos;

            // common IE normalizing
            e = e || window.event;

            // Framework specific normalizing (#1165)
            e = washMouseEvent(e);

            // More IE normalizing, needs to go after washMouseEvent
            if (!e.target) {
                e.target = e.srcElement;
            }

            // iOS (#2757)
            ePos = e.touches ?  (e.touches.length ? e.touches.item(0) : e.changedTouches[0]) : e;

            // Get mouse position
            if (!chartPosition) {
                this.chartPosition = chartPosition = offset(this.chart.container);
            }

            // chartX and chartY
            if (ePos.pageX === UNDEFINED) { // IE < 9. #886.
                chartX = mathMax(e.x, e.clientX - chartPosition.left); // #2005, #2129: the second case is
                // for IE10 quirks mode within framesets
                chartY = e.y;
            } else {
                chartX = ePos.pageX - chartPosition.left;
                chartY = ePos.pageY - chartPosition.top;
            }

            return extend(e, {
                chartX: mathRound(chartX),
                chartY: mathRound(chartY)
            });
        }
13874
function createApi () {
  api = {
    eth: {
      blockNumber: sinon.stub().resolves(new BigNumber(2)),
      gasPrice: sinon.stub().resolves(GASPRICE)
    },
    parity: {
      gasPriceHistogram: sinon.stub().resolves(HISTOGRAM)
    }
  };

  return api;
}
339666
function(axis,name,stacked){
    var _self = this,
      data = [],
      series = _self._getRelativeSeries(axis,name);
    axis = axis || _self.get('yAxis');
    name = name || 'yAxis';

    Util.each(series,function(item){
      if(name == 'xAxis' || (stacked && item.isStacked && item.isStacked())|| (!stacked &&(!item.isStacked || !item.isStacked()))){
        if(item.get(name) == axis){
          var arr = item.getData(name);
          if(arr.length){
            data.push(arr);
          }
        }
      }
    });

    return data;
  }
1362463
function () {
			var series = this,
				yAxis = series.yAxis,
				plotHigh;

			colProto.translate.apply(series);

			// Set plotLow and plotHigh
			each(series.points, function (point) {
				var shapeArgs = point.shapeArgs,
					minPointLength = series.options.minPointLength,
					heightDifference,
					height,
					y;

				point.tooltipPos = null; // don't inherit from column
				point.plotHigh = plotHigh = yAxis.translate(point.high, 0, 1, 0, 1);
				point.plotLow = point.plotY;

				// adjust shape
				y = plotHigh;
				height = point.plotY - plotHigh;

				if (height < minPointLength) {
					heightDifference = (minPointLength - height);
					height += heightDifference;
					y -= heightDifference / 2;
				}
				shapeArgs.height = height;
				shapeArgs.y = y;
			});
		}
312957
function (options) {
		var chart = this,
			optionsChart = chart.options.chart,
			type = options.type || optionsChart.type || optionsChart.defaultSeriesType,
			series,
			constr = seriesTypes[type];

		// No such series type
		if (!constr) {
			error(17, true);
		}

		series = new constr();
		series.init(this, options);
		return series;
	}
1235479
function callApi(endpoint, schema) {
  const fullUrl = (endpoint.indexOf(API_ROOT) === -1) ? API_ROOT + endpoint : endpoint;

  return fetch(fullUrl)
    .then(response =>
      response.json().then(json => ({ json, response }))
    ).then(({ json, response }) => {
      if (json.error) {
        throw new Error(json.error);
      }
      if (!response.ok) {
        throw new Error(json && json.message || response.statusText || response.status + ' http error');
      }

      const camelizedJson = camelizeKeys(json);
      const nextPageUrl = getNextPageUrl(response);

      return Object.assign({},
        normalize(camelizedJson, schema),
        { nextPageUrl }
      );
    })
    .then(
      response => ({response})
    );
}
787471
@POST
	@Produces(MediaType.APPLICATION_JSON)
    @Consumes(MediaType.APPLICATION_JSON)
    @Description("Create a chart object.")
	public ChartDto createChart(@Context HttpServletRequest req, ChartDto chartDto) {
		
		if (chartDto == null) {
			throw new WebApplicationException("Cannot create a null chart object.", Status.BAD_REQUEST);
		}

		PrincipalUser remoteUser = getRemoteUser(req);
		PrincipalUser owner;
		
		String ownerName = chartDto.getOwnerName();
        if (ownerName == null || ownerName.isEmpty() || ownerName.equalsIgnoreCase(remoteUser.getUserName())) {
        	//If ownerName is not present or if it is present and equal to remote username, then return remoteUser.
            owner = remoteUser;
        } else if (remoteUser.isPrivileged()) {
            owner = userService.findUserByUsername(ownerName);
            if (owner == null) {
                throw new WebApplicationException(ownerName + ": User does not exist.", Status.NOT_FOUND);
            }
        } else {
        	//Remote user is not privileged and ownerName is not equal to remoteUser.username
        	throw new WebApplicationException("You are not authorized to access charts owned by user: " + ownerName, Status.FORBIDDEN);
        }
		
		Chart chart = new Chart(remoteUser, owner, chartDto.getType(), chartDto.getQueries());
		if(chartDto.getEntityId() != null) {
			//TODO: For now, we are only allowing entityId to be a dashboardId or an alertId
			PrincipalUser associatedEntityOwner;
			JPAEntity entity = _chartService.getAssociatedEntity(chartDto.getEntityId());
			if(entity == null) {
				throw new WebApplicationException("Entity id: " + chartDto.getEntityId() + " does not exist.", Status.BAD_REQUEST);
			} else if(entity instanceof Dashboard) {
				associatedEntityOwner = Dashboard.class.cast(entity).getOwner(); 
			} else if(entity instanceof Alert) {
				associatedEntityOwner = Alert.class.cast(entity).getOwner();
			} else {
				throw new WebApplicationException("Unknown entity type associated with this chart. Please use either a dashboard id or an alert id.", Status.BAD_REQUEST);
			}
			
			_validateResourceAuthorization(remoteUser, associatedEntityOwner);
			chart.setEntity(entity);
		}
		
		copyProperties(chart, chartDto);
		chart = _chartService.updateChart(chart);
		chartDto = ChartDto.transformToDto(chart);
		chartDto.setHref(req.getRequestURL().append('/').append(chartDto.getId()).toString());
		return chartDto;
	}
1337532
function fromCoordSystem(cm, coords, context) {
    if (context == "div") return coords;
    var left = coords.left, top = coords.top;
    // First move into "page" coordinate system
    if (context == "page") {
      left -= pageScrollX();
      top -= pageScrollY();
    } else if (context == "local" || !context) {
      var localBox = cm.display.sizer.getBoundingClientRect();
      left += localBox.left;
      top += localBox.top;
    }

    var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();
    return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};
  }
432418
function (e) {
            var pointer = this,
              chart = pointer.chart,
              series = chart.series,
              tooltip = chart.tooltip,
              followPointer,
              point,
              points,
              hoverPoint = chart.hoverPoint,
              hoverSeries = chart.hoverSeries,
              i,
              j,
              distance = chart.chartWidth,
              index = pointer.getIndex(e),
              anchor;

            // shared tooltip
            if (tooltip && pointer.options.tooltip.shared && !(hoverSeries && hoverSeries.noSharedTooltip)) {
                points = [];

                // loop over all series and find the ones with points closest to the mouse
                i = series.length;
                for (j = 0; j < i; j++) {
                    if (series[j].visible &&
                      series[j].options.enableMouseTracking !== false &&
                      !series[j].noSharedTooltip && series[j].singularTooltips !== true && series[j].tooltipPoints.length) {
                        point = series[j].tooltipPoints[index];
                        if (point && point.series) { // not a dummy point, #1544
                            point._dist = mathAbs(index - point.clientX);
                            distance = mathMin(distance, point._dist);
                            points.push(point);
                        }
                    }
                }
                // remove furthest points
                i = points.length;
                while (i--) {
                    if (points[i]._dist > distance) {
                        points.splice(i, 1);
                    }
                }
                // refresh the tooltip if necessary
                if (points.length && (points[0].clientX !== pointer.hoverX)) {
                    tooltip.refresh(points, e);
                    pointer.hoverX = points[0].clientX;
                }
            }

            // Separate tooltip and general mouse events
            followPointer = hoverSeries && hoverSeries.tooltipOptions.followPointer;
            if (hoverSeries && hoverSeries.tracker && !followPointer) { // #2584, #2830

                // get the point
                point = hoverSeries.tooltipPoints[index];

                // a new point is hovered, refresh the tooltip
                if (point && point !== hoverPoint) {

                    // trigger the events
                    point.onMouseOver(e);

                }

            } else if (tooltip && followPointer && !tooltip.isHidden) {
                anchor = tooltip.getAnchor([{}], e);
                tooltip.updatePosition({ plotX: anchor[0], plotY: anchor[1] });
            }

            // Start the event listener to pick up the tooltip
            if (tooltip && !pointer._onDocumentMouseMove) {
                pointer._onDocumentMouseMove = function (e) {
                    if (charts[hoverChartIndex]) {
                        charts[hoverChartIndex].pointer.onDocumentMouseMove(e);
                    }
                };
                addEvent(doc, 'mousemove', pointer._onDocumentMouseMove);
            }

            // Draw independent crosshairs
            each(chart.axes, function (axis) {
                axis.drawCrosshair(e, pick(point, hoverPoint));
            });
        }
460894
function createAndAddSlot(slotNext, indexMapForSlot) {
                    var slotNew = (indexMapForSlot === indexMap ? createPrimarySlot() : createSlot());

                    insertSlot(slotNew, slotNext);

                    return slotNew;
                }