From ffcffa87717c5c766ff693d714e4f287da511bfb Mon Sep 17 00:00:00 2001 From: Brandon Clayton <bclayton@usgs.gov> Date: Fri, 31 May 2024 09:42:07 -0600 Subject: [PATCH] add minor type --- libs/plotly/plotly-layout.model.ts | 45 ++++++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/libs/plotly/plotly-layout.model.ts b/libs/plotly/plotly-layout.model.ts index f853c2a..392e2ee 100644 --- a/libs/plotly/plotly-layout.model.ts +++ b/libs/plotly/plotly-layout.model.ts @@ -1,11 +1,46 @@ -import {Layout} from 'plotly.js'; - -import {PlotlyLegend} from './plotly-legend.model'; +import { + Color, + Datum, + DTickValue, + Layout, + LayoutAxis, + TypedArray, +} from 'plotly.js'; export interface PlotlyLayout extends Partial<Layout> { + /** x-axis */ + xaxis: Partial<PlotlyAxis>; + /** y-axis */ + yaxis: Partial<PlotlyAxis>; + /** Aspect ratio of plot */ aspectRatio?: string; +} + +/** + * Plotly axis + */ +export interface PlotlyAxis extends Partial<LayoutAxis> { + minor: Partial<PlotlyMinor>; +} - /** Plotly legend */ - legend?: Partial<PlotlyLegend>; +/** + * Plotly minor axis type. + * + * https://plotly.com/javascript/reference/layout/xaxis/#layout-xaxis-minor + */ +export interface PlotlyMinor { + dtick: DTickValue; + gridcolor: Color; + griddash: string; + gridwidth: number; + nticks: number; + showgrid: boolean; + tick0: number | string; + tickcolor: Color; + ticklen: number; + tickmode: 'auto' | 'linear' | 'array'; + ticks: 'outside' | 'inside' | ''; + tickvals: Datum[] | Datum[][] | Datum[][][] | TypedArray; + tickwidth: number; } -- GitLab