Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public createContourSeries(data: any[]) {
const brushes = [
"rgba(32, 146, 252, 0.5)", // semi-transparent blue
"rgba(14, 194, 14, 0.5)", // semi-transparent green
"rgba(252, 120, 32, 0.5)", // semi-transparent orange
"rgba(252, 32, 32, 0.5)" // semi-transparent red
];
const brushScale = new IgxValueBrushScaleComponent();
brushScale.brushes = brushes;
brushScale.minimumValue = 0;
brushScale.maximumValue = 30;
const contourSeries = new IgxGeographicContourLineSeriesComponent();
contourSeries.dataSource = data;
contourSeries.longitudeMemberPath = "lon";
contourSeries.latitudeMemberPath = "lat";
contourSeries.valueMemberPath = "value";
contourSeries.fillScale = brushScale;
contourSeries.tooltipTemplate = this.tooltip;
contourSeries.thickness = 4;
this.map.series.add(contourSeries);
}
}
public addSeriesWith(locations: any[]) {
const sizeScale = new IgxSizeScaleComponent();
sizeScale.minimumValue = 4;
sizeScale.maximumValue = 60;
const brushes = [
"rgba(14, 194, 14, 0.4)", // semi-transparent green
"rgba(252, 170, 32, 0.4)", // semi-transparent orange
"rgba(252, 32, 32, 0.4)" // semi-transparent red
];
const brushScale = new IgxValueBrushScaleComponent();
brushScale.brushes = brushes;
brushScale.minimumValue = 0;
brushScale.maximumValue = 30;
const symbolSeries = new IgxGeographicProportionalSymbolSeriesComponent();
symbolSeries.dataSource = locations;
symbolSeries.markerType = MarkerType.Circle;
symbolSeries.radiusScale = sizeScale;
symbolSeries.fillScale = brushScale;
symbolSeries.fillMemberPath = "pop";
symbolSeries.radiusMemberPath = "pop";
symbolSeries.latitudeMemberPath = "lat";
symbolSeries.longitudeMemberPath = "lon";
symbolSeries.markerOutline = "rgba(0,0,0,0.3)";
symbolSeries.tooltipTemplate = this.tooltipTemplate;
series2.showDefaultTooltip = true;
series2.xMemberPath = "population";
series2.yMemberPath = "gdpTotal";
series2.xAxis = this.xAxis;
series2.yAxis = this.yAxis;
this.chart.series.clear();
this.chart.series.add(series1);
this.chart.series.add(series2);
} else if (seriesType === "Bubble") {
const sizeScale = new IgxSizeScaleComponent();
sizeScale.minimumValue = 10;
sizeScale.maximumValue = 60;
const brushScale1 = new IgxValueBrushScaleComponent();
brushScale1.brushes = ["#FFFFFF", "#b56ffc"];
brushScale1.minimumValue = 10;
brushScale1.maximumValue = 60;
const series1 = new IgxBubbleSeriesComponent();
series1.name = "series1";
series1.title = "Large Countries";
series1.markerType = MarkerType.Circle;
series1.dataSource = SampleScatterStats.getCountriesWithLargePop();
series1.showDefaultTooltip = true;
series1.xMemberPath = "population";
series1.yMemberPath = "gdpTotal";
series1.radiusMemberPath = "gdpPerCapita";
series1.radiusScale = sizeScale;
series1.xAxis = this.xAxis;
series1.yAxis = this.yAxis;
constructor() {
this.data = SampleScatterData.create();
this.brushScale = new IgxValueBrushScaleComponent();
this.brushScale.minimumValue = -2;
this.brushScale.maximumValue = 2;
this.brushScale.brushes = [
"#8670CB", "#513E8C", "#003F5E",
"#0C6B99", "#4AC4FF", "#B5CC2E",
"#FFD034", "#FC8612", "#ED4840"
];
}