ChartType
Chart types
Enum Members:
BAR(“bar”)LINE(“line”)PIE(“pie”)SCATTER(“scatter”)UNKNOWN(“unknown”)
parseChart()
function parseChart(data: any): Chart
Parameters:
dataany
Returns:
Chart
BarChart
type BarChart = Chart2D & {
elements: BarData[];
type: BAR;
};
Represents a bar chart with metadata.
Type declaration:
elementsBarData[] - The bars of the charttypeBAR - The type of chart
BarData
type BarData = {
group: string;
label: string;
value: string;
};
Represents a bar in a bar chart.
Type declaration:
groupstring - The group of the barlabelstring - The label of the barvaluestring - The value of the bar
BoxAndWhiskerChart
type BoxAndWhiskerChart = Chart2D & {
elements: BoxAndWhiskerData[];
type: BOX_AND_WHISKER;
};
Represents a box and whisker chart with metadata.
Type declaration:
elementsBoxAndWhiskerData[] - The box and whiskers of the charttypeBOX_AND_WHISKER - The type of chart
BoxAndWhiskerData
type BoxAndWhiskerData = {
first_quartile: number;
label: string;
max: number;
median: number;
min: number;
outliers: number[];
};
Represents a box and whisker in a box and whisker chart.
Type declaration:
first\_quartilenumber - The first quartile of the box and whiskerlabelstring - The label of the box and whiskermaxnumber - The third quartile of the box and whiskermediannumber - The median of the box and whiskerminnumber - The minimum value of the box and whiskeroutliersnumber[]
Chart
type Chart = {
elements: any[];
png: string;
title: string;
type: ChartType;
};
Represents a chart with metadata from matplotlib.
Type declaration:
elementsany[] - The elements of the chartpng?string - The PNG representation of the chart encoded in base64titlestring - The title of the charttypeChartType - The type of chart
Chart2D
type Chart2D = Chart & {
x_label: string;
y_label: string;
};
Represents a 2D chart with metadata.
Type declaration:
x\_label?string - The label of the x-axisy\_label?string - The label of the y-axis
CompositeChart
type CompositeChart = Chart & {
elements: Chart[];
type: COMPOSITE_CHART;
};
Represents a composite chart with metadata.
Type declaration:
elementsChart[] - The charts of the composite charttypeCOMPOSITE_CHART - The type of chart
LineChart
type LineChart = PointChart & {
type: LINE;
};
Represents a line chart with metadata.
Type declaration:
typeLINE - The type of chart
PieChart
type PieChart = Chart & {
elements: PieData[];
type: PIE;
};
Represents a pie chart with metadata.
Type declaration:
elementsPieData[] - The pie slices of the charttypePIE - The type of chart
PieData
type PieData = {
angle: number;
label: string;
radius: number;
};
Represents a pie slice in a pie chart.
Type declaration:
anglenumber - The angle of the pie slicelabelstring - The label of the pie sliceradiusnumber - The radius of the pie slice
PointChart
type PointChart = Chart2D & {
elements: PointData[];
x_scale: string;
x_tick_labels: string[];
x_ticks: (number | string)[];
y_scale: string;
y_tick_labels: string[];
y_ticks: (number | string)[];
};
Represents a point chart with metadata.
Type declaration:
elementsPointData[] - The points of the chartx\_scalestring - The scale of the x-axisx\_tick\_labelsstring[] - The labels of the x-axisx\_ticks(number | string)[] - The ticks of the x-axisy\_scalestring - The scale of the y-axisy\_tick\_labelsstring[] - The labels of the y-axisy\_ticks(number | string)[] - The ticks of the y-axis
PointData
type PointData = {
label: string;
points: [number | string, number | string][];
};
Represents a point in a 2D chart.
Type declaration:
labelstring - The label of the pointpoints[number | string, number | string][] - The points of the chart
ScatterChart
type ScatterChart = PointChart & {
type: SCATTER;
};
Represents a scatter chart with metadata.
Type declaration:
typeSCATTER - The type of chart