summaryrefslogtreecommitdiff
path: root/themes/blowfish/assets/lib/mermaid/diagrams/xychart/chartBuilder/interfaces.d.ts
diff options
context:
space:
mode:
authorChristoph Cullmann <cullmann@kde.org>2024-04-28 17:33:09 +0200
committerChristoph Cullmann <cullmann@kde.org>2024-04-28 17:33:09 +0200
commite77051ccc4b47951bfa4fde2be436b1bb2fb113b (patch)
treef0b75ee3521da9c8cd39dac4359212348f70e4e8 /themes/blowfish/assets/lib/mermaid/diagrams/xychart/chartBuilder/interfaces.d.ts
parent4b355837824ac2422d371acef790f0f4249255c7 (diff)
use https://github.com/nunocoracao/blowfish.git
Diffstat (limited to 'themes/blowfish/assets/lib/mermaid/diagrams/xychart/chartBuilder/interfaces.d.ts')
-rw-r--r--themes/blowfish/assets/lib/mermaid/diagrams/xychart/chartBuilder/interfaces.d.ts132
1 files changed, 132 insertions, 0 deletions
diff --git a/themes/blowfish/assets/lib/mermaid/diagrams/xychart/chartBuilder/interfaces.d.ts b/themes/blowfish/assets/lib/mermaid/diagrams/xychart/chartBuilder/interfaces.d.ts
new file mode 100644
index 0000000..bbf7194
--- /dev/null
+++ b/themes/blowfish/assets/lib/mermaid/diagrams/xychart/chartBuilder/interfaces.d.ts
@@ -0,0 +1,132 @@
+export interface XYChartAxisThemeConfig {
+ titleColor: string;
+ labelColor: string;
+ tickColor: string;
+ axisLineColor: string;
+}
+export interface XYChartThemeConfig {
+ backgroundColor: string;
+ titleColor: string;
+ xAxisLabelColor: string;
+ xAxisTitleColor: string;
+ xAxisTickColor: string;
+ xAxisLineColor: string;
+ yAxisLabelColor: string;
+ yAxisTitleColor: string;
+ yAxisTickColor: string;
+ yAxisLineColor: string;
+ plotColorPalette: string;
+}
+export interface ChartComponent {
+ calculateSpace(availableSpace: Dimension): Dimension;
+ setBoundingBoxXY(point: Point): void;
+ getDrawableElements(): DrawableElem[];
+}
+export type SimplePlotDataType = [string, number][];
+export interface LinePlotData {
+ type: 'line';
+ strokeFill: string;
+ strokeWidth: number;
+ data: SimplePlotDataType;
+}
+export interface BarPlotData {
+ type: 'bar';
+ fill: string;
+ data: SimplePlotDataType;
+}
+export type PlotData = LinePlotData | BarPlotData;
+export declare function isBarPlot(data: PlotData): data is BarPlotData;
+export interface BandAxisDataType {
+ type: 'band';
+ title: string;
+ categories: string[];
+}
+export interface LinearAxisDataType {
+ type: 'linear';
+ title: string;
+ min: number;
+ max: number;
+}
+export type AxisDataType = LinearAxisDataType | BandAxisDataType;
+export declare function isBandAxisData(data: AxisDataType): data is BandAxisDataType;
+export declare function isLinearAxisData(data: AxisDataType): data is LinearAxisDataType;
+/**
+ * For now we are keeping this configs as we are removing the required fields while generating the config.type.ts file
+ * we should remove `XYChartAxisConfig` and `XYChartConfig` after we started using required fields
+ */
+export interface XYChartAxisConfig {
+ showLabel: boolean;
+ labelFontSize: number;
+ labelPadding: number;
+ showTitle: boolean;
+ titleFontSize: number;
+ titlePadding: number;
+ showTick: boolean;
+ tickLength: number;
+ tickWidth: number;
+ showAxisLine: boolean;
+ axisLineWidth: number;
+}
+export interface XYChartConfig {
+ width: number;
+ height: number;
+ titleFontSize: number;
+ titlePadding: number;
+ showTitle: boolean;
+ xAxis: XYChartAxisConfig;
+ yAxis: XYChartAxisConfig;
+ chartOrientation: 'vertical' | 'horizontal';
+ plotReservedSpacePercent: number;
+}
+export interface XYChartData {
+ xAxis: AxisDataType;
+ yAxis: AxisDataType;
+ title: string;
+ plots: PlotData[];
+}
+export interface Dimension {
+ width: number;
+ height: number;
+}
+export interface BoundingRect extends Point, Dimension {
+}
+export interface Point {
+ x: number;
+ y: number;
+}
+export type TextHorizontalPos = 'left' | 'center' | 'right';
+export type TextVerticalPos = 'top' | 'middle';
+export interface RectElem extends Point {
+ width: number;
+ height: number;
+ fill: string;
+ strokeWidth: number;
+ strokeFill: string;
+}
+export interface TextElem extends Point {
+ text: string;
+ fill: string;
+ verticalPos: TextVerticalPos;
+ horizontalPos: TextHorizontalPos;
+ fontSize: number;
+ rotation: number;
+}
+export interface PathElem {
+ path: string;
+ fill?: string;
+ strokeWidth: number;
+ strokeFill: string;
+}
+export type DrawableElem = {
+ groupTexts: string[];
+ type: 'rect';
+ data: RectElem[];
+} | {
+ groupTexts: string[];
+ type: 'text';
+ data: TextElem[];
+} | {
+ groupTexts: string[];
+ type: 'path';
+ data: PathElem[];
+};